I have developed a working simple visualization plugin in v7.6, based on the legacy plugin development framework. On version v7.6, a component UI change props.vis.updateState() does trigger requestHandler function, as expected.
After upgrade to 7.7 using the new plugin dev framework, the very same code does not trigger any requestHandler call anymore.
How can the UI component can trigger a requestHandler call?
add toExpression property to your visualization definition which should be an async function accepting vis as first parameter and params as second parameter. it needs to return expression string. something like this:
write your expression function for request handler and register it with expression service
write your expression function for your visualization and register it with expression service
write renderer for your visualization and register it with expression service
best to take a look at some of our code:
build_pipeline.ts --> builds expression strings for our build in charts, and calls toExpression for third party charts (that's currently the only way to get your own request handler working, but we are in the middle of refactoring so things will keep changing during 7.x)
vis_type_metric which registers chart expression function (metric_vis_fn.ts)
data/public/search/expressions/esaggs.ts is our default 'request handler' (by the way we are in the process of adding another one that will allow you to do raw es queries + there is essql in basic so maybe you can use one of the existing data fetching functions ?
For the short term, I changed my approach by using the 'data' service to access the query filter. I just released my plugin fully NP, working on 7.8.0!
Back to the Expression service, is there is high level conceptual documentation? For example I read the markdown_fn.ts code, it is very difficult for me to understand how it behaves and the APIs and concepts behind. It looks fairly similar in purpose to markdown_vis.ts...
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.