How the new plugin controller works (metric_vis)?

Hi ! Im the developer of plugin kibana_health_metrics_vis (https://github.com/clamarque/kibana_health_metric_vis). My plugin is based on the plugin metric vis. I try to work it on v7.0.0 kibana but don't understand this lines:
_processTableGroups(table) { .... const dimensions = this.props.visParams.dimensions; .... }

Indeed, for me the variable dimensions is undefined and when I Launch my plugin, he give a error because he can't define dimensions. Can you explain me, how kibana retrieve the variable dimensions from visParams ?

Thanks you

visParams is a property passed to the MetricVisComponent component.

From the looks of it, there is a factory created with defaults here: https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/vis_type_metric/public/metric_vis_type.ts#L35

Which you can see how it's unwound here: https://github.com/elastic/kibana/blob/master/src/legacy/ui/public/vis/vis_types/react_vis_type.js#L37-L50

Not sure if it makes a difference, but you might want to check out TSVB. The Metric visualization there provides the ability to specify color rules under the panel options.

So, In logic, kibana pass visParams from herself and this, contain the property 'dimensions' ? Thank for your response

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