Conversation
f993c60 to
1fb4f67
Compare
1fb4f67 to
4cda324
Compare
4cda324 to
3a9bd26
Compare
Improve the typing and structure of the categorical series infrastructure: - Export AttributeValueType and use it as the base for CategoricalValueType - Add CategoricalItemCategory, CategoricalItemValue, and Category types - Add PlottableCategoricalValueType for constrained plottable types - Move type coercion from data layer to plottable layer with fallback - Add formatXAxisValue formatter for categorical chart X-axis labels - Add transformTabularDataToCategoricalSeries utility for data transformation These changes align the categorical series types with the TimeSeries pattern, where the data layer accepts broad types and the plottable layer constrains to renderable types.
3a9bd26 to
acafc7a
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
...pp/views/dashboards/widgets/categoricalSeriesWidget/categoricalSeriesWidgetVisualization.tsx
Show resolved
Hide resolved
nsdeschenes
approved these changes
Feb 5, 2026
Contributor
nsdeschenes
left a comment
There was a problem hiding this comment.
ECharts seems to be very ... particular 😭
jaydgoss
pushed a commit
that referenced
this pull request
Feb 12, 2026
) A few improvements to the types and code around categorical bar charts. The main change is that I'm loosening the types around categorical data itself. Right now, the category can only be a string according to the types, but that's a bit too tight. Tabular data can return any kind of thing, and categorical data is just tabular data re-arranged. In this PR, I make it so that category and value are much looser, and corresponding to the incoming data rather than what can be plotted on the chart. As a consequence of that, the type for what can actually be plotted is moved out to the categorical plottables, after all they decide what can be plotted! Handling for formatting these new looser category values as strings is moved into a formatting function. This creates a pleasant symmetry between categorical and time series charts, now they have the same approach for how to handle different data types. It also makes converting between tabular data and categorical data simpler, which will come in handy soon. The quirk is that ECharts needs all the categories to be strings even before formatting is applied, so we have to run X axis formatting on the data in `Bars` rather than in the X axis configuration. Alas! Last important change is using the `[category, value]` format instead of `{name: category, value: value}` format in output of `toSeries`. The former is more robust and allows ECharts to correctly assign points to categories regardless of order. This is _very_ important in cases where different plottables have different categories! Otherwise ECharts will silently put points on the wrong categories which is ... catastrophically fucked up <!-- BUGBOT_STATUS --><sup><a href="https://cursor.com/dashboard?tab=bugbot">Cursor Bugbot</a> found 1 potential issue for commit <u>acafc7a</u></sup><!-- /BUGBOT_STATUS -->
dcramer
pushed a commit
that referenced
this pull request
Feb 17, 2026
) A few improvements to the types and code around categorical bar charts. The main change is that I'm loosening the types around categorical data itself. Right now, the category can only be a string according to the types, but that's a bit too tight. Tabular data can return any kind of thing, and categorical data is just tabular data re-arranged. In this PR, I make it so that category and value are much looser, and corresponding to the incoming data rather than what can be plotted on the chart. As a consequence of that, the type for what can actually be plotted is moved out to the categorical plottables, after all they decide what can be plotted! Handling for formatting these new looser category values as strings is moved into a formatting function. This creates a pleasant symmetry between categorical and time series charts, now they have the same approach for how to handle different data types. It also makes converting between tabular data and categorical data simpler, which will come in handy soon. The quirk is that ECharts needs all the categories to be strings even before formatting is applied, so we have to run X axis formatting on the data in `Bars` rather than in the X axis configuration. Alas! Last important change is using the `[category, value]` format instead of `{name: category, value: value}` format in output of `toSeries`. The former is more robust and allows ECharts to correctly assign points to categories regardless of order. This is _very_ important in cases where different plottables have different categories! Otherwise ECharts will silently put points on the wrong categories which is ... catastrophically fucked up <!-- BUGBOT_STATUS --><sup><a href="https://cursor.com/dashboard?tab=bugbot">Cursor Bugbot</a> found 1 potential issue for commit <u>acafc7a</u></sup><!-- /BUGBOT_STATUS -->
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
A few improvements to the types and code around categorical bar charts.
The main change is that I'm loosening the types around categorical data itself. Right now, the category can only be a string according to the types, but that's a bit too tight. Tabular data can return any kind of thing, and categorical data is just tabular data re-arranged. In this PR, I make it so that category and value are much looser, and corresponding to the incoming data rather than what can be plotted on the chart.
As a consequence of that, the type for what can actually be plotted is moved out to the categorical plottables, after all they decide what can be plotted! Handling for formatting these new looser category values as strings is moved into a formatting function.
This creates a pleasant symmetry between categorical and time series charts, now they have the same approach for how to handle different data types. It also makes converting between tabular data and categorical data simpler, which will come in handy soon.
The quirk is that ECharts needs all the categories to be strings even before formatting is applied, so we have to run X axis formatting on the data in
Barsrather than in the X axis configuration. Alas!Last important change is using the
Cursor Bugbot found 1 potential issue for commit acafc7a[category, value]format instead of{name: category, value: value}format in output oftoSeries. The former is more robust and allows ECharts to correctly assign points to categories regardless of order. This is very important in cases where different plottables have different categories! Otherwise ECharts will silently put points on the wrong categories which is ... catastrophically fucked up