Skip to content

State improvements#663

Open
techniq wants to merge 1009 commits intonextfrom
state-refactor
Open

State improvements#663
techniq wants to merge 1009 commits intonextfrom
state-refactor

Conversation

@techniq
Copy link
Owner

@techniq techniq commented Oct 19, 2025

Goals

  • Integrate simplified charts
    • snippets / default impl
    • simplified setup
    • series state
  • External control / sync
    • Set initial highlightSeriesKey
    • Save/restore state to localStorage / query string / etc
  • Improve tooltip data (multi-series with/without data, etc)
    • currently expose tooltipState.data and tooltipState.payload
  • Data-driven primitives / marks
  • Image mark

  • Chart
    • Add series prop
    • Add orientation to Chart (if needed)?
      • Added valueAxis due to inverted orientation meaning in LineChart/BarChart
  • ChartState / context
    • Expose seriesState on context
    • Simplify HighlightKey
  • Rename ChartState geoContext / brushContext / tooltipContext to geoState / etc
  • Rename <GeoContext bind:geoContext> to <GeoContext bind:state> (and BrushContext, TooltipContext, TransformContext)
  • Instantiate GeoState etc within Chart / ChartState?
    • Replace getGeoContext with getChartContext and use ctx.geo
      • Useful to keep getGeoContext for overrides such as a translucent globe
    • Do we need GeoContext / etc? (if it doesn't have any pointer events / elements)
      • Only when overriding (not within Chart. Simplified and renamed GeoContext to GeoProjection
    • Move $effect()logic in GeoContext to GeoState
  • Fix <BarChart seriesLayout="group"> regression (before this PR)
  • Remove createLegendProps() and handle directly since ctx.seriesState is available
  • Update ChartAnnotations to use ctx.seriesState
  • Update DefaultTooltip to use ctx.seriesState
  • GeoDebug usage
  • TransformDebug usage
  • GeoTile performance (local-only?)
  • Should TransformState handle pointer events onPointerMove, etc or within TransformContext
  • Rename tooltipContext props (Arc, GeoPath, etc) to tooltipState (or just tooltip)?
  • Remove tooltipMetaContext (consolidate payload, etc)
  • Bounds use case integration (reference)

Verify


To fix

@changeset-bot
Copy link

changeset-bot bot commented Oct 19, 2025

🦋 Changeset detected

Latest commit: 3ebb212

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@techniq techniq changed the base branch from main to docs-v2 October 19, 2025 18:44
@github-actions
Copy link
Contributor

github-actions bot commented Oct 19, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
layerchart ✅ Ready (View Log) Visit Preview 3ebb212

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 19, 2025

Open in StackBlitz

npm i https://pkg.pr.new/layerchart@663

commit: 3ebb212

This was referenced Oct 23, 2025
techniq added 30 commits March 23, 2026 07:15
…ration (Ex. ` <Chart series={...}>`). Add docs (including programmatic control example), and tests
… modifier key (meta, alt, control, shift) for scroll/wheel zoom/pan, preventing accidental page scroll from triggering transforms. Also rename `initialScrollMode` to `scrollMode` and make it reactive
…ified component tree for Canvas rendering

Marks register data, accessors, and colors with Chart via registerMark() for automatic domain calculation and implicit series generation, eliminating the need for explicit y={[...]} or series props. A new registerComponentNode() API replaces the flat Canvas registry with a tree structure, fixing Group transform scoping (fixes #662) and providing composite-mark detection for child marks.
…etChartSvgString` utilities to export charts as PNG/JPEG/WebP images or SVG files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment