kibana icon indicating copy to clipboard operation
kibana copied to clipboard

[XY] Expression unification

Open Kuznietsov opened this issue 2 years ago • 5 comments

Plan

  • [x] Move xy function and renderer to the separate plugin (chart_expressions/expression_xy) from Lens. Register expression functions on the server and client sides - https://github.com/elastic/kibana/pull/127150 (author: @Kunzetsov)
  • [x] Write down the issue with the comparison of xy_vis and lens_xy_chart configuration possibilities with highlighting missing features - https://github.com/elastic/kibana/issues/127712 (author: @VladLasitsa)

Additional types for the existing arguments

  • [x] Change palette type from string to palette - https://github.com/elastic/kibana/pull/128053 (author: @Kunzetsov).
  • [x] Add full support of visdimension at fields: splitAccessor, accessors, xAccessor. - https://github.com/elastic/kibana/pull/129612 (author: @VladLasitsa)

Global features, required for using xy in Lens/VisTypes/Canvas.

  • [x] #128056 - #128255 (author: @Kunzetsov)
  • [x] Check if filters are applied to the expression functions, executed at the table arguments of the layers. (author: @Kunzetsov)
  • [x] Add possibility to override the x-axis interval. - https://github.com/elastic/kibana/pull/128726 (author: @VladLasitsa)
  • [x] Add pointseries input type as possible to xyVis. Add default accessors and make them optional to xyVis, if the input type is pointseries, as mentioned in the xy vis proposal. - https://github.com/elastic/kibana/pull/131919 (author: @VladLasitsa)
  • [x] https://github.com/elastic/kibana/issues/129062 (author: @VladLasitsa)

Missing features, required at VisEditors xy implementation

  • [x] Add missing features related to this: splitRowDimension, seriesDimension, zDimension. (author: @Kunzetsov)
    • [x] splitRowAccessor and splitColumnAccessor - allow split by row and column (in xy_vis - Split chart) (https://github.com/elastic/kibana/pull/130229)
    • [x] dataLayer.splitAccessor - allow multiple split accessors for one layer. https://github.com/elastic/kibana/pull/134566 (author: @VladLasitsa)
    • [x] zDimension - allow to provide field name of mark size metric on Datum. Only used with line/area series. Add support to define size ratio for zDimension. (radiusRatio arg) - (https://github.com/elastic/kibana/pull/130361)
  • [x] Add missing features for UI configuring charts: (seriesParams args: showCircles, lineWidth, circlesRadius) - (https://github.com/elastic/kibana/pull/130391)
  • [x] Add possibility to show circles without line between them: (seriesParams arg: drawLinesBetweenPoints) - (https://github.com/elastic/kibana/pull/130452)
  • [x] Add feature related to show time marker (addTimeMarker arg) - (https://github.com/elastic/kibana/pull/131495) (author: @VladLasitsa)
  • [x] Add support of orderBucketsBySum (allow to order ordinal x values by descending) - (https://github.com/elastic/kibana/pull/130457)
  • [x] Add support to show/hide tooltips (addTooltip arg) - (https://github.com/elastic/kibana/pull/130530)
  • [x] Add supporting of detailed tooltip (detailedTooltip arg) - (https://github.com/elastic/kibana/pull/131116)
  • [x] Add full functionality related to axes (categoryAxes are x - axes, valueAxes are y-axes): - https://github.com/elastic/kibana/pull/129476 (author: @VladLasitsa)
    • [x] Add support of scaling mode for axes. (categoryAxes.scale.mode/valueAxes.axisParams.scale.mode arg)
    • [x] Add possibility to customize axis position (categoryAxes.position/valueAxes.axisParams.position arg)
    • [x] Add possibility to configure padding for computed domain as positive number. (categoryAxes.scale.boundsMargin/valueAxes.axisParams.scale.boundsMargin arg)
    • [x] Add possibility to configure color of labels on axes. (categoryAxes.labels.color/valueAxes.axisParams.labels.color arg)
    • [x] Add possibility to hides overlapping labels and duplicates on axis. (categoryAxes.labels.filter/valueAxes.axisParams.labels.filter arg)
    • [x] Add possibility to number of symbols before truncating label on axis. (categoryAxes.labels.truncate/valueAxes.axisParams.labels.truncate arg)
  • [x] Make reference lines usable - https://github.com/elastic/kibana/pull/132192, https://github.com/elastic/kibana/pull/132607
  • [x] Make annotations to be able to work with time fields from the datasource, different from esaggs' ones. - https://github.com/elastic/kibana/pull/131917

Final steps of the plan

  • [x] Check all the expressions for stability. Add necessary checks for the arguments.
  • [ ] Migrate xy vis_type to the new expression. - https://github.com/elastic/kibana/pull/136475 (author: @VladLasitsa)
    • [ ] Remove all unused code from xy vis_type (author: @VladLasitsa)
  • [ ] Add XY to the Canvas. (author: @Kunzetsov)

cc @crob611, @stratoula, @flash1293, @alexwizp, @VladLasitsa


co-author: @VladLasitsa.

Kuznietsov avatar Mar 08 '22 08:03 Kuznietsov

Pinging @elastic/kibana-presentation (Team:Presentation)

elasticmachine avatar Mar 08 '22 08:03 elasticmachine

Add support of palette expression function instead of string

Lens should support palette expression function already: Add support of palette expression function instead of string

Check if filters are applied to the expression functions, executed at the table arguments of the layers.

What exactly is this referring to?

flash1293 avatar Mar 08 '22 16:03 flash1293

@flash1293, there is such expression chain:

kibana
| selectFilter ...
| removeFilter ...
| esaggs ...
...

These filters are applied to the datasource expressions, like esaggs. If we are creating separate fetches, adding tables to the layers, we should check if these filters are applied to the execution context, or we will have to duplicate expressions with filters on every layer table fetch.

I don't remember the code of those expressions, so, need to investigate it when the time will come and propose the useful solution in case of the troubles.

Kuznietsov avatar Mar 08 '22 16:03 Kuznietsov

I see, for Lens this wouldn't be relevant because we aren't manipulating filters this way (it's just the kibana context, then esaggs). I see it being relevant for Canvas.

flash1293 avatar Mar 08 '22 16:03 flash1293

Yes. And this ability is provided by the data plugin and we were moving the canvas in this direction not so long time ago. As I understand, a lot of parts of Kibana will rely on it in the future, as the only way of manipulating filters.

Kuznietsov avatar Mar 08 '22 16:03 Kuznietsov