Skip to content

feat: implement default data converters#8966

Open
ugur-vaadin wants to merge 3 commits intomainfrom
feat-implement-default-data-converters
Open

feat: implement default data converters#8966
ugur-vaadin wants to merge 3 commits intomainfrom
feat-implement-default-data-converters

Conversation

@ugur-vaadin
Copy link
Contributor

Description

Adds DefaultDataConverter that supports 15 chart type patterns via column-name-based detection, plus a fallback for basic charts. DefaultDataConverter supports

  • 15 chart type patterns via column-name-based detection
  • a fallback for basic charts
  • multi-series grouping via a series column

The patterns checked:

  • OHLC (open, high, low, close)
  • BoxPlot (low, q1, median, q3, high)
  • Organization (id, name, parent, title)
  • Gantt (name, start, end + optional id, parent, dependency, completed)
  • Treemap (id, parent, value)
  • Sankey (from, to, weight)
  • Heatmap (x, y, value)
  • XRange (x, x2, y)
  • Timeline (name, label, description)
  • Bubble (x, y, z)
  • Flags (title, optionally text)
  • Range (low, high)
  • Bullet (y, target)
  • Waterfall (y, waterfall_type)
  • Fallback (first category + first numeric column)

Fixes https://github.com/orgs/vaadin/projects/103/views/1?filterQuery=&pane=issue&itemId=165657712

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/contributing/overview
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.
  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

@ugur-vaadin ugur-vaadin requested a review from tomivirkki March 19, 2026 08:57
@sonarqubecloud
Copy link

"time", "timestamp", "datetime");

@Override
public List<Series> convertToSeries(List<Map<String, Object>> data) {
Copy link
Member

Choose a reason for hiding this comment

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

"series" is a pretty common column name — e.g. a table tracking TV shows could easily have a series column for the show name. Consider using something more specific to avoid accidental collisions with real data columns.

Comment on lines +120 to +121
private static final List<String> X_COLUMN_NAMES = List.of("x", "date",
"time", "timestamp", "datetime");
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to have all these options for the x-column name? I'd assume we can make the system prompt use a consistent column name for x.

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