Skip to content

feat: allow users to change the inferred chart type#191

Merged
calvarjorge merged 5 commits intomainfrom
jorge.calvar/add_chart_dropdown
Mar 17, 2026
Merged

feat: allow users to change the inferred chart type#191
calvarjorge merged 5 commits intomainfrom
jorge.calvar/add_chart_dropdown

Conversation

@calvarjorge
Copy link
Copy Markdown
Contributor

@calvarjorge calvarjorge commented Mar 17, 2026

Summary

  • Add a small dropdown next to the Chart/Table tabs that lets users switch chart types when the auto-inferred one is wrong
  • Fix pie chart labels looking blurry in dark mode (black text with white border)
  • Fix layout jumping when switching between Chart and Table tabs

Before

image image

After

image image image

Allow users to override the auto-inferred chart type via a small
dropdown button next to the Chart/Table tabs. Only compatible chart
types are shown based on the data shape.

Co-authored-by: Isaac
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
Set label color to inherit from slice color and remove textBorderWidth
to eliminate the blurry black-text-with-white-border appearance.

Co-authored-by: Isaac
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
Use CSS grid overlay with forceMount and visibility:hidden so both
panels stay in the DOM and contribute to layout sizing. The container
always matches the tallest panel, preventing height jumps on tab switch.

Co-authored-by: Isaac
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
Deduplicate column classification between inferChartType and
getCompatibleChartTypes by sharing a classifyColumns helper.
Consolidate the two useMemo calls into one since both depend on
the same transformed data.

Co-authored-by: Isaac
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
Co-authored-by: Isaac
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
Comment on lines +170 to +171
xKey={inference.xKey}
yKey={inference.yKey}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the xKey and yKey adapt to the activeChartType if the user overrides it? Or are all values coercible to the right shape for each chart?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the user can override the chart type, but the data fed into the chart stays the same. At the moment, we don't allow to override axis keys (I personally think the use case isn't as big).

@calvarjorge calvarjorge merged commit 4c090f3 into main Mar 17, 2026
7 checks passed
@calvarjorge calvarjorge deleted the jorge.calvar/add_chart_dropdown branch March 17, 2026 13:01
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