Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PieVis] Adapt for Canvas and Lens. #121725

Closed
7 tasks done
Kuznietsov opened this issue Dec 21, 2021 · 6 comments
Closed
7 tasks done

[PieVis] Adapt for Canvas and Lens. #121725

Kuznietsov opened this issue Dec 21, 2021 · 6 comments
Assignees
Labels
Feature:Canvas Feature:Pie Chart Pie chart visualization feature Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@Kuznietsov
Copy link
Contributor

Kuznietsov commented Dec 21, 2021

Introduction

After moving out the pieVis expression from vis_types, it is required to decide what to add to the existent API of pieVis.

Short investigation

Comparing pieVis from vis_types and lens_pie_renderer, there are such differences in the API and in the functionality:

VisEditors Pie     Lens Pie  
Field Type, single/multi Default Field Type, single/multi
metric visdimension   metric string
bucket visdimension, multi   groups string, multi
addLegend boolean   legendDisplay string (default/show/hide)
legendPosition string   legendPosition string
nestedLegend boolean false nestedLegend boolean
truncateLegend boolean true truncateLegend boolean
maxLegendLines number   legendMaxLines number
isDonut boolean false shape string (pie/donut/treemap/mosaic)
emptySizeRatio number   emptySizeRatio number
labels 'pie_labels_value      
labels.show boolean   hideLabels boolean
labels.percentDecimals number 2 percentDecimals number
labels.valuesFormat string 'percent' numberDisplay string (hidden/percent/value)
labels.values boolean   --  
labels.position string 'default' categoryDisplay string (default/inside/hide)
labels.lastLevel boolean true --  
labels.truncate number   --  
splitColumn visdimension, multi   --  
splitRow visdimension, multi   --  
addTooltip boolean true --  
distinctColors boolean false --  
--     showValuesInLegend boolean

Adaptation notes

Globally

  • Replace data.fieldFormats with fieldFormats plugin.
  • Add full support of visdimension at fields: metric, bucket, splitColumn, splitRow.
  • Change palette type from string to palette.

Addressed at the PR: #121763


For Canvas

  • ...

cc @crob611.


For Lens

  • Add new expression functions for supporting mosaic, treemap and waffle charts.
  • Waffle only supports a single bucket/group dimension.
  • Mosaic supports only up to two bucket/group dimensions.
  • Treemap supports only up to two bucket/group dimensions.

Source: #121725 (comment).
Addressed at the PR: #122420

@elastic/kibana-vis-editors, please, feel free to add some notes and plans to this issue.

cc @stratoula and @flash1293.

@Kuznietsov Kuznietsov added the Feature:Pie Chart Pie chart visualization feature label Dec 21, 2021
@botelastic botelastic bot added the needs-team Issues missing a team label label Dec 21, 2021
@Kuznietsov Kuznietsov added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Dec 21, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs-team Issues missing a team label label Dec 21, 2021
@stratoula
Copy link
Contributor

stratoula commented Jan 4, 2022

The title and description in lens expression function is not needed anymore so I think we can remove them from the list :)

@stratoula
Copy link
Contributor

stratoula commented Jan 4, 2022

Also the lens categoryDisplay is connected with the labels position if I am not mistaken so it should be matched with the labels.position property of viz.

@flash1293
Copy link
Contributor

AFAIK Visualize pie doesn't support multiple metrics. While there's a use case for that, I think we shouldn't introduce it as part of this PR but split that out for later and stick with just a single metric dimension for now.

The other settings look like they can be merged into a single renderer supporting everything pretty well. Please note that mosaic and waffle have additional limitations compared to pie/donut. Waffle only supports a single bucket/group dimension and Mosaic supports only up to two.

@Kuznietsov
Copy link
Contributor Author

@flash1293, added those details to the issue's text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Canvas Feature:Pie Chart Pie chart visualization feature Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

5 participants