Skip to content

Per-slice color and label overrides for pie/treemap/funnel - #72

Merged
TanayBensuYurtturk merged 3 commits into
mainfrom
bensu/dac-slice-colors
Sep 1, 2026
Merged

Per-slice color and label overrides for pie/treemap/funnel#72
TanayBensuYurtturk merged 3 commits into
mainfrom
bensu/dac-slice-colors

Conversation

@TanayBensuYurtturk

Copy link
Copy Markdown
Contributor

Adds a widget-level slices map ({label: {color, label}}) so pie, treemap, and funnel charts can recolor and rename individual slices, mirroring the existing per-series series map. Wired through the schema, Go model/loader/validator, TS types, and the chart renderer.

Adds a widget-level slices map ({label: {color, label}}) so label/value
charts can recolor and rename individual slices, mirroring the existing
per-series map. Wired through the schema, Go model/loader/validator, TS
types, and the chart renderer.
@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown

Fix all with Greploop Fix All in Conductor

Prompt To Fix All With AI
### Issue 1
frontend/src/components/widgets/ChartWidget.tsx:1482
**Slice rename overwrites pie value**

When a pie chart uses the same result column for `label` and `value`, constructing `pieData` replaces the numeric value with the slice's display label before Recharts reads it, causing an invalid or zero-sized slice and incorrect percentages.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "Add per-slice color and label overrides ..." | Re-trigger Greptile

Comment thread frontend/src/components/widgets/ChartWidget.tsx Outdated
Write the display name to a dedicated key so a widget whose label and
value point at the same column no longer overwrites its numeric value.
@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown

Fix all with Greploop Fix All in Conductor

Prompt To Fix All With AI
### Issue 1
frontend/src/components/widgets/ChartWidget.tsx:1483
**Synthetic key overwrites pie value**

When a pie chart uses a result column named `__sliceName` as its value field, this object spread replaces the numeric value with the slice's display label before Recharts reads it, causing invalid slice sizes and percentages.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (2): Last reviewed commit: "Keep pie slice rename off the value colu..." | Re-trigger Greptile

Comment thread frontend/src/components/widgets/ChartWidget.tsx Outdated
Apply the slice rename in the label/legend/tooltip formatters instead of
injecting it into the row data, so no synthetic key can collide with a
result column.
@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown

Reviews (3): Last reviewed commit: "Rename pie slices at the display layer o..." | Re-trigger Greptile

@TanayBensuYurtturk
TanayBensuYurtturk merged commit db4aeb7 into main Sep 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants