elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.6k stars 8.21k forks source link

[Lens] Add support for step in area/line charts #154410

Closed stratoula closed 1 year ago

stratoula commented 1 year ago

Describe the feature:

TSVB supports stepped areas.

image

We would like to give the same capability in Lens, this is supported by EC https://elastic.github.io/elastic-charts/?path=/story/area-chart--stepped-area&globals=theme:light

We can add a new switch under the curve switch

image

Also we should add this to the transition from TSVB to Lens

Dropdown options

CurveType Lens dropdown description Example
CurveType.LINEAR Linear image
CurveType.CURVE_MONOTONE_X Interpolated image
CurveType.CURVE_STEP_AFTER Step image
elasticmachine commented 1 year ago

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

stratoula commented 1 year ago

cc @markov00 @nickofthyme will provide the line style options. We are considering to remove the curve lines switch and merge them all together on a dropdown!

markov00 commented 1 year ago

I think we should consider to expose only: Step after, linear, monotone x All the others could are not a good choice for Kibana/ES IMHO

nickofthyme commented 1 year ago

@markov00 I agree, I added the options to be added and their corresponding CurveType in the description above. I also added a column for what each option type should be called in the Lens dropdown UI. Can you please verify?

markov00 commented 1 year ago

@nickofthyme it looks good to me. I think we should change the property name to something like Interpolation or point interpolation because Curve lines is not clear anymore. Our API (elastic-charts) should also change the name probably to interpolation.

nickofthyme commented 1 year ago

@markov00 Yeah could be but better but I always think linear interpolation when I hear interpolation. The other factor at play is that we already have the toggle button as Curve lines so changing it could be jarring to the user. And what happens if we want to add a more pronounced curve function in the future, how would be distinguish the two by name?

I'm fine with changing it to Interpolation just wanted to add those two points. Please update the table in the description with the value you think is best.

markov00 commented 1 year ago

Curve lines so changing it could be jarring to the user.

I don't think so, if the user enabled that switch it will appear as Interpolation: Curved line so it looks similar to the previous switch and is just slightly adjusted. Not a breaking change or something that will distress the user.

And what happens if we want to add a more pronounced curve function in the future, how would be distinguish the two by name?

At that point, we should probably call that "more pronounced curve fn" with its proper name, like Cubic Hermite, Centripetal Catmull–Rom, Polynomial etc. Going technically with the naming for everything else is fine, but I don't think we will ever need those. At least we will probably just change the default. Grafana for example uses linear, smooth, step before, step after. Smooth is definitely a better alternative than "curved".

It will be great to get feedback from @KOTungseth for the naming here. I know that we don't want to be too technical, but I also have the fear to use too vague terms that don't align us with other tools. Interpolation or Line interpolation is my preference over Curve, Curve mode etc.