Skip to content

Replace Frappe Charts with Orchid Charts and simplify the PHP API - #3143

Open
tabuna wants to merge 7 commits into
masterfrom
codex/replace-frappe-with-orchid-charts
Open

tabuna wants to merge 7 commits into
masterfrom
codex/replace-frappe-with-orchid-charts

Conversation

@tabuna

@tabuna tabuna commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Replace Frappe Charts with @orchidsoftware/charts 0.0.8 and let screens configure charts directly through the PHP layout API, without a dedicated chart class.

Layout::chart('visits', 'Visits')
    ->height(300)
    ->smooth()
    ->gradient();

The screen query supplies shared labels and datasets:

'visits' => [
    'labels' => ['Mon', 'Tue'],
    'datasets' => [
        ['name' => 'Visits', 'values' => [12, 18]],
    ],
],

Changes

  • Support line, bar, mixed, pie, and percentage charts with native Orchid Charts options, markers, and SVG export.
  • Update metric collections, example screens, and the orchid:chart generator to the new PHP API and data format.
  • Use the package's hover styling variables for a neutral highlight and refresh example data with a gradient on the main line chart.
  • Reserve the configured chart height in the initial HTML to prevent layout shifts while charts load.
  • Handle configuration and canvas updates in the controller, clean up chart instances on disconnect, and rebuild the distributed assets without Frappe.

Breaking changes

  • Chart data now uses shared labels and datasets; labels inside individual datasets are no longer the supported format. TimeCollection::toChart() and GroupCollection::toChart() return the new shape.
  • Frappe-specific options are replaced by native Orchid Charts options. TYPE_MIXED replaces TYPE_AXIS_MIXED.
  • Pie and percentage charts require exactly one dataset instead of silently aggregating multiple datasets.
  • Chart properties are typed; custom subclasses should configure charts through fluent methods, as the updated generator does.

Validation

  • Production asset build passed.
  • Six JavaScript controller tests passed.
  • Full PHP suite passed: 624 tests and 1,697 assertions. After adding the generator regression and fixing its stub, the focused generator, chart layout, and metrics suite passed: 23 tests and 82 assertions.
  • Scoped Pint checks and git diff --check passed.

The previous PR revision had unrelated Psalm failures concerning PhpVersionNotSupportedException and Dusk failures in notification badges and the item creation modal. Those areas are outside this change; CI will run again on this revision.

@tabuna tabuna changed the title Replace Frappe Charts with Orchid Charts Replace Frappe Charts with Orchid Charts and simplify the PHP API Sep 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant