feat: Canvas pie chart — add "Other" grouping + hover percentages#9136
Draft
feat: Canvas pie chart — add "Other" grouping + hover percentages#9136
Conversation
- Add smart 'Other' grouping algorithm (target ≤20% of total, max 10 slices) - Support explicit limit via YAML config and showOther toggle - Add percentage display in tooltips (1 decimal place) - Add mini-leaderboard tooltip for 'Other' slice (top 5 + N more) - Muted color for 'Other' slice (light/dark mode aware) - Add data transformer pipeline for circular chart data - Custom tooltip formatter for pie/donut charts Closes APP-818 Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
- Use grandTotal from total query for Other value calculation - Fetch more data from API when showOther is enabled with low limit - Distinguish between query limit and user's explicit limit - Add 13 unit tests for other-grouping algorithm - All 2419 existing tests continue to pass Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
…Total Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pie/donut charts with many slices are now readable via smart "Other" grouping, and hovering any slice shows percentage of total.
What changed
Smart "Other" Grouping (
other-grouping.ts)showOtherYAML config (defaulttrue) controls groupinglimiton the color field bypasses dynamic algorithm for a fixed cutoff"Other" Slice Appearance
#d1d5db/ dark#4b5563Hover Tooltips with Percentages (
pie-tooltip.ts)Data Pipeline
dataTransformertoChartDataDependenciesfor pre-chart data transformationCircularChartProvider.transformData()applies "Other" grouping before data reaches Vega-LiteshowOtheris enabled (not justshowTotal)DEFAULT_COLOR_LIMITeven when user sets a low explicitlimitFiles changed
circular/other-grouping.tscircular/other-grouping.spec.tscircular/pie-tooltip.tscircular/pie.tscircular/CircularChartProvider.tsshowOtheron spec, data transform, total query logicChart.sveltedata-provider.tsdataTransformerin data pipelineBaseChart.tsgetDataTransformer()/getOtherGroupResult()methodsCircularChart.tsCanvasChart.svelteotherGroupResultto Chartselector.tsdataTransformerintogetChartDataForCanvasChecklist:
Linear Issue: APP-818