queryFilter and timeFilter

@nyuriks is it possible to access queryFilter and timeFilter inside a custom vega visualization?

Similar to kibanaAddFilter method that allows for adding contextual filter to visualization or dashboards in vega?

I'd like to create a vega visualization where I can access these filters and use them to construct a mark with an href URL navigate to a custom search application and send the visualization or dashboard filters.

I saw these properties available in the Vega code, and thought it might be possible https://github.com/elastic/kibana/blob/089e7c87b1abb2e6715cb8f6de8e1b451cde5b15/src/legacy/core_plugins/vega/public/vega_visualization.js

    const vegaViewParams = {
      vegaConfig,
      parentEl: this._el,
      vegaParser,
      serviceSettings,
      queryfilter: this._vis.API.queryFilter,
      timefilter: this._vis.API.timeFilter,
      findIndex: this.findIndex.bind(this),
      $rootScope,
    };

Thanks

Astrit

Hi @astv right now is not possible to use directly the query filters and the time filters.
The ES Query can be made aware of the surrounding context using the time filter and the query filter, but it's only applied to the data.url object via https://github.com/elastic/kibana/blob/88fffd5f642cf7c34af6e1af4333e0de2e111c7d/src/legacy/core_plugins/vis_type_vega/public/data_model/es_query_parser.js#L39

I think you can open an enhancement request ticket here for that,

Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.