Skip to content

feat(ui-dashboard): chart foundation — ECharts base, legend, theme, icons (0.2.0)#301

Merged
frozenluo merged 3 commits into
mainfrom
dev/frozenluo/charts-foundation-to-ui-dashboard
Jun 18, 2026
Merged

feat(ui-dashboard): chart foundation — ECharts base, legend, theme, icons (0.2.0)#301
frozenluo merged 3 commits into
mainfrom
dev/frozenluo/charts-foundation-to-ui-dashboard

Conversation

@frozenluo

Copy link
Copy Markdown
Contributor

What

Phase 3a of the charts extraction — moves the framework-level chart foundation into @sentio/ui-dashboard so the render charts and option panels (phase 3b) can build on it:

  • EchartsBase (ECharts wrapper + imperative EChartsHandle), ChartLegend, RefreshContext/RefreshButton
  • theme: sentioColors, sentioTheme (+ sentioThemeDark), register (ECharts theme registration)
  • 8 chart-type icons: Line / Area / Bar / BarGuage / Pie / QueryValue / Scatter / Table

Decoupling from app internals

  • BarLoading / Button come from @sentio/ui-core
  • useDarkMode and isMobile relocated to ui-dashboard/src/utils (both pure)
  • a small generic Tooltip (floating-ui) copied to ui-dashboard/src/common, adapted to @floating-ui/react v0.27 (refs.setReference/setFloating)
  • sansFontFamily inlined into the theme (was the app's next/font lib)
  • strict-mode param types added

Deps / version

Adds runtime deps echarts ^6 and react-resize-detector ^12. Bumps 0.1.2 → 0.2.0.

Verification

pnpm build (css+js+dts) clean; tsc --noEmit clean for src/ (only the known unrelated @mswjs lib-dts error remains). No proto/private-repo references.

Note

App-side backfill is a separate PR. theme/sentioColors will not be shimmed to this package in the app, because the app pulls it into a web-worker bundle (must stay free of react/echarts) — the app keeps its own copy there.

🤖 Generated with Claude Code

frozenluo and others added 3 commits June 18, 2026 12:03
….1.2) (#299)

Replace the hardcoded `h-0.5 bg-gray-300` connector lines between query
functions with `h-px bg-border-color` so they follow the theme (and dark mode)
instead of a fixed gray.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Stories for the phase-3a chart foundation: ReactEChartsBase (line + bar, which
also exercises ChartLegend), the 8 chart-type icons, the series color palettes,
and RefreshButton. `ladle serve` compiles and lists all five cleanly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Charts rendered with ECharts' default palette instead of the sentio theme. The
theme was registered via a side-effect-only `import './theme/register'`, but the
package marks only *.css as side-effectful, so the bundler tree-shook the import
away and registerTheme never ran.

Make registration an explicit call: register.ts now exports an idempotent
registerSentioTheme(), invoked at EchartsBase module load. Verified registerTheme
is present in the built dist.

Also fixes the charts barrel to import the kebab-cased theme files
(sentio-colors / sentio-theme) — the rename's index.ts update was missed earlier.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@frozenluo frozenluo force-pushed the dev/frozenluo/charts-foundation-to-ui-dashboard branch from dfbe1f6 to 7e1742c Compare June 18, 2026 04:03
@frozenluo frozenluo merged commit 81315f5 into main Jun 18, 2026
1 check passed
@frozenluo frozenluo deleted the dev/frozenluo/charts-foundation-to-ui-dashboard branch June 18, 2026 04:08
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.

1 participant