kibana-vega-vis icon indicating copy to clipboard operation
kibana-vega-vis copied to clipboard

use dashboard context as parameters for external URL query

Open MartonEstok opened this issue 6 years ago • 5 comments

I'd like to use the dashboard context parameters to change the external URL's parameters. Example:

{
  $schema: https://vega.github.io/schema/vega/v3.0.json
  data: [
    {
      name: source
      "%context%": true,
      url: https://example.com/datawarehousepublic?action=getReportData&country=%context.country.must.clause%
    }
  ]
}

Is this possible in any way ? To access some variables within the context ?

MartonEstok avatar Jul 03 '18 03:07 MartonEstok

Hmm, this is similar in a way to https://github.com/elastic/kibana/issues/17211 but here you want a stringified version of built-in parameters... TBH, not exactly sure how common this usecase would be... If possible, I would like to avoid building a whole additional query language with macros, even though we already have a few macro expansions... TBD :)

nyurik avatar Jul 03 '18 03:07 nyurik

I understand your point and thanks for the fast response. The reason why I think this would make the product more complete is this: you already support haing multiple sources with Elastic data and External data - but external is not a first class citizen so to speak. So if you mix the 2 types of data sources and make the Elastic side respond to context while the External stays the same, I think that's not ideal.

By the way, I'm following https://github.com/elastic/kibana/issues/17210#issuecomment-401868862 and now I wonder, if clicking a Vega chart will add filters that kinda makes it work in one direction already, so this would expand on this side too.

On the other hand, I'm a total outsider, so I don't neccesarily understand the implications with macros and so on.

Thanks again.

MartonEstok avatar Jul 03 '18 06:07 MartonEstok

@MartonEstok you do make valid argument about "second class citizen". I'm not sure i understood the reference to 17210. Could you spec out which expansions you would need, and how they would look like? It seems that if expansions are simply json-stringified objects, you will always need a kibana-aware backend to support these things...

nyurik avatar Jul 03 '18 14:07 nyurik

Hi Yuri, thanks for being open to this. I'm currently on a business trip, I go home next week - please keep this open, it's not forgotten and I'll try to write down specs that I think would be a great addition.

MartonEstok avatar Jul 05 '18 03:07 MartonEstok

Hey,

What's the status of this enhancement? I believe my requirement is something similar. Please take a look at https://stackoverflow.com/questions/58064722/vega-use-filter-as-input-and-dynamically-change-data-url

aryak007 avatar Sep 24 '19 03:09 aryak007