From 9f0344af8b4b3983e478b17acee3a175378cba8f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 15:12:50 +0000 Subject: [PATCH] Version Packages (next) --- .changeset/pre.json | 52 +++++++ packages/layerchart/CHANGELOG.md | 230 +++++++++++++++++++++++++++++++ packages/layerchart/package.json | 2 +- 3 files changed, 283 insertions(+), 1 deletion(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 68845a1b8..12deb0b70 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -12,6 +12,11 @@ "skeleton4": "0.0.1" }, "changesets": [ + "add-boxplot-component", + "add-stats-utils", + "add-violin-component", + "afraid-jobs-say", + "area-y0-baseline-default", "beige-bears-joke", "beige-doodles-shout", "beige-trams-check", @@ -19,10 +24,14 @@ "better-pets-divide", "big-boxes-shout", "blue-doodles-chew", + "blue-rules-feel", "brave-spies-give", "breezy-breads-pump", "breezy-donuts-sniff", + "breezy-oranges-drive", + "bright-bubbles-zoom", "brown-terms-tie", + "brush-api-refactor", "bumpy-breads-rhyme", "calm-jars-mix", "chatty-flies-bet", @@ -31,8 +40,11 @@ "chubby-ties-play", "clean-nights-jog", "clear-ghosts-arrive", + "clear-moose-rush", "clear-pears-tickle", "clear-points-care", + "component-tree", + "context-bind-state-rename", "cozy-moments-work", "crazy-ads-appear", "crazy-friends-talk", @@ -44,10 +56,15 @@ "cyan-cougars-occur", "dark-pandas-start", "deep-signs-listen", + "default-chart-padding", "dirty-kings-send", + "domain-extent-original-to-data", + "download-chart-utils", + "early-bats-wait", "early-peaches-accept", "easy-candies-wait", "eight-shirts-cover", + "eighty-foxes-notice", "eighty-islands-jam", "eleven-corners-float", "eleven-crabs-switch", @@ -60,6 +77,10 @@ "evil-hoops-return", "fair-phones-wink", "fast-insects-deny", + "fiery-lamps-tickle", + "fix-area-all-zero", + "fix-barchart-diverging-edge-rounding", + "flat-arcs-heal", "flat-cases-enter", "four-lizards-win", "four-taxes-beam", @@ -70,8 +91,10 @@ "full-times-guess", "funny-otters-kick", "funny-wasps-heal", + "geo-context-rename", "giant-donuts-yell", "good-glasses-design", + "green-hotels-strive", "green-mirrors-retire", "green-poems-drop", "grumpy-ties-mix", @@ -90,37 +113,48 @@ "kind-shirts-sniff", "large-spiders-stay", "late-glasses-itch", + "layer-context-rename", "legal-parrots-beam", "lemon-bats-change", "loud-lies-film", "loud-paws-allow", "lovely-loops-ring", + "lucky-cats-stand", "lucky-pianos-count", + "lucky-worlds-share", "major-rats-raise", + "mark-registration", "mean-flies-play", "mean-loops-peel", + "metal-flowers-sneeze", "mighty-weeks-try", "modern-nails-kiss", + "new-pans-serve", "new-turtles-clean", + "nice-regions-ask", "nine-badgers-teach", "nine-carrots-grin", "nine-pens-design", "ninety-ghosts-taste", + "ninety-melons-tickle", "odd-pears-float", "old-lions-hide", "open-bushes-run", "open-houses-vanish", + "orientation-to-valueaxis", "pink-flies-worry", "pink-hornets-rest", "pink-showers-hunt", "polite-parts-learn", "poor-clocks-occur", + "pretty-roses-invent", "proud-camels-cut", "proud-llamas-fold", "proud-melons-warn", "public-queens-invite", "puny-clocks-admire", "puny-shoes-kiss", + "purple-beers-smile", "purple-things-count", "quiet-insects-share", "quiet-mangos-kneel", @@ -129,26 +163,37 @@ "ready-pumas-sink", "real-badgers-say", "red-monkeys-sleep", + "remove-context-getters", + "rename-scroll-mode", "rich-keys-take", + "ripe-numbers-speak", "sad-chairs-stand", + "scroll-activation-key", "shaggy-dryers-make", "shaky-animals-wave", "shaky-dots-go", "shaky-ends-bake", "sharp-rockets-jam", + "shiny-mails-hug", + "silver-baboons-smile", "silver-mugs-leave", "slow-hounds-hide", "slow-streets-look", + "small-moles-jog", "smart-dots-rule", "smart-paths-jog", + "smooth-bars-grow", + "smooth-domains-zoom", "social-masks-teach", "soft-pens-invite", "solid-badgers-tan", "some-frogs-camp", "sour-hounds-repeat", "sparkly-beds-dress", + "sparkly-mice-peel", "spicy-gifts-float", "spicy-seals-kiss", + "spline-motion-support", "spotty-plums-invite", "spotty-rules-taste", "swift-gifts-flow", @@ -157,20 +202,27 @@ "tame-lamps-report", "tangy-lies-strive", "tasty-states-raise", + "thick-months-join", "thirty-glasses-pick", "three-cities-chew", + "tooltip-item-highlight-fade", "tricky-nights-mix", "tricky-pears-help", "true-waves-roll", "twelve-frogs-agree", "twenty-bushes-hope", + "twenty-teeth-stand", "violet-gifts-fail", "violet-horses-walk", + "warm-colors-glow", + "warm-labels-shine", "warm-mammals-deny", "warm-women-glow", "weak-donuts-tan", "whole-women-listen", "wide-berries-invite", + "wide-pillows-march", + "wide-wasps-enjoy", "witty-clocks-divide" ] } diff --git a/packages/layerchart/CHANGELOG.md b/packages/layerchart/CHANGELOG.md index 2955cd267..42e1109ed 100644 --- a/packages/layerchart/CHANGELOG.md +++ b/packages/layerchart/CHANGELOG.md @@ -1,5 +1,235 @@ # LayerChart +## 2.0.0-next.47 + +### Major Changes + +- breaking(BrushContext|TransformContext): Rename `bind:brushContext` / `bind:transformContext` to `bind:state` ([#663](https://github.com/techniq/layerchart/pull/663)) + + Both `BrushContext` and `TransformContext` now use `bind:state` instead of their previous named bindings. Additionally, properties on `ChartState` have been renamed: + - `chartContext.brushContext` → `chartContext.brushState` + - `chartContext.transformContext` → `chartContext.transformState` + + ```diff + - + + + + - + + + ``` + +- breaking(TransformContext): Rename `domainExtent: 'original'` to `domainExtent: 'data'` ([#663](https://github.com/techniq/layerchart/pull/663)) + + The `'original'` value for `domainExtent` has been renamed to `'data'` to better describe that it constrains pan/zoom to the data's domain bounds: + + ```diff + - + + + ``` + +- breaking(GeoContext): Rename `GeoContext` component to `GeoProjection` ([#663](https://github.com/techniq/layerchart/pull/663)) + + The `GeoContext` component has been renamed to `GeoProjection` to better describe its purpose. Update your imports and template usage: + + ```diff + - import { GeoContext } from 'layerchart' + + import { GeoProjection } from 'layerchart' + ``` + + ```diff + - + + + ``` + +- breaking: Rename render context APIs to layer context ([#663](https://github.com/techniq/layerchart/pull/663)) + - `getRenderContext()` → `getLayerContext()` + - `setRenderContext()` → `setLayerContext()` + - `supportedContexts` prop → `layers` prop on components + - Internal `layout/` directory moved to `layers/` (affects deep imports) + + ```diff + - import { getRenderContext } from 'layerchart' + + import { getLayerContext } from 'layerchart' + ``` + +- breaking(Chart): Remove `isVertical` from ChartState, add `valueAxis` prop to `Chart` ([#663](https://github.com/techniq/layerchart/pull/663)) + + `ChartState.isVertical` has been removed in favor of `ChartState.valueAxis` (`'x'` | `'y'`), which explicitly defines which axis represents the value (dependent variable). + + Simplified charts (`BarChart`, `LineChart`, `AreaChart`, `ScatterChart`) still accept the `orientation` prop as before — each chart maps it to the correct `valueAxis` internally. The `` component itself now uses `valueAxis` directly, since `orientation` is ambiguous at that level (a "vertical" BarChart has `valueAxis="y"` while a "vertical" LineChart has `valueAxis="x"`). + + When accessing chart state: + + ```diff + - if (chartContext.isVertical) { ... } + + if (chartContext.valueAxis === 'y') { ... } + ``` + + When using `` directly (not simplified charts): + + ```diff + - + + + ``` + +- breaking: Remove standalone context getter/setter functions ([#663](https://github.com/techniq/layerchart/pull/663)) + + The following standalone context functions have been removed in favor of the unified `getChartContext()` API: + - `getTooltipContext()` / `setTooltipContext()` → use `getChartContext().tooltip` + - `getBrushContext()` / `setBrushContext()` → use `getChartContext().brushState` + - `getTransformContext()` / `setTransformContext()` → use `getChartContext().transformState` + + ```diff + - import { getTooltipContext } from 'layerchart' + - const tooltip = getTooltipContext() + + import { getChartContext } from 'layerchart' + + const chart = getChartContext() + + // access via chart.tooltip + ``` + +- breaking(Arc|Pie|Calendar|GeoPath): Rename `tooltipContext` to simple `tooltip` (boolean), simplifying use case ([#663](https://github.com/techniq/layerchart/pull/663)) + +### Minor Changes + +- feat: Add BoxPlot component for box-and-whisker plots ([#663](https://github.com/techniq/layerchart/pull/663)) + + New composite mark that renders whiskers, caps, IQR box, median line, and outlier dots. Supports both pre-computed statistics (`min`, `q1`, `median`, `q3`, `max`, `outliers` accessors) and automatic computation from raw values via the `values` prop. Orientation-aware via `valueAxis` context. + +- feat: Add statistical utility functions `computeBoxStats()` and `kde()` ([#663](https://github.com/techniq/layerchart/pull/663)) + - `computeBoxStats(values, k?)` computes the five-number summary and outliers using the Tukey IQR method + - `kde(values, options?)` computes kernel density estimation using the Epanechnikov kernel with Silverman's rule-of-thumb bandwidth + +- feat: Add Violin component for violin plots ([#663](https://github.com/techniq/layerchart/pull/663)) + + New composite mark that renders a symmetric density curve (mirrored area) from raw data using kernel density estimation (Epanechnikov kernel). Supports pre-computed density data via `density` prop or automatic KDE from raw values via `values` prop. Optional `box` and `median` overlays. Configurable `bandwidth`, `thresholds`, and `curve`. + +- feat(Spline): Support geo projection ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat: Add geo projection support for primitives (Circle, Rect, etc) ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat(Highlight): Add `r` prop to scale highlight points using the chart's rScale. Supports `r={true}` to use the chart's r config or a custom accessor. ([#663](https://github.com/techniq/layerchart/pull/663)) + +- breaking(Brush): Redesign brush API ([#663](https://github.com/techniq/layerchart/pull/663)) + + **Breaking changes:** + - Remove `mode` prop ('integrated' | 'separated') — sync behavior is now driven by presence of `x`/`y` props + - Remove `resetOnEnd` — call `e.brush.reset()` in your `onBrushEnd` handler instead + - Remove `ignoreResetClick` — replaced by `clickToReset` (default `true`) + - Remove `onReset` event — check `brush.active === false` in `onBrushEnd`/`onChange` instead + + **New features:** + - Add `BrushState.move({ x?, y? })` for programmatic selection control (like d3's `brush.move()`) + - Add `BrushState.selectAll()` to select the full domain extent + - Add `BrushState.reset()` to clear the selection + - Add `clickToReset` prop (default `true`) + - Add `zoomOnBrush` prop on Chart for simplified charts to opt into brush-to-zoom + - Move domain clamping, edge adjustment, and range computation logic into `BrushState` class + - Add `BrushChartContext` interface for easier testing + +- feat: Unified component tree for Canvas rendering with proper Group transform scoping. Fixes #662 ([#663](https://github.com/techniq/layerchart/pull/663)) + - New `registerComponentNode({ name, kind, canvasRender })` API replaces both `registerCanvasComponent` and the `InsideCompositeMark` boolean context with a single unified component tree. + - Canvas rendering now walks the tree recursively with proper `save()`/`restore()` scoping, fixing Group transforms (translate, opacity) leaking to sibling components instead of only affecting children. + - Composite marks (Area, Threshold, Hull, Labels, Grid) register as `'composite-mark'` nodes, automatically preventing child marks from registering with the chart without manual `_skipRegistration` props. + - Removed `retainState` and `name` from `ComponentRender` type — Group's transform scoping is handled by tree position, and component names live on the tree node. + +- feat: add `downloadImage`, `downloadSvg`, `getChartImageBlob`, and `getChartSvgString` utilities to export charts as PNG/JPEG/WebP images or SVG files ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat: Add Image component. Resolves #628 ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat(SeriesState): Support passing `selected` as part of series declaration (Ex. ` `) ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat: Add data mode to primitive components (Circle, Ellipse, Group, Line, Polygon, Rect, Text) ([#663](https://github.com/techniq/layerchart/pull/663)) + + Primitives now accept string or function accessors for positional props (e.g. `x="date"`, `y={d => d.value}`) to automatically resolve values through chart scales and iterate over data. Components also accept an optional `data` prop to override chart context data. + + Color properties (`fill`, `stroke`) can also be data-driven, resolving per-item through the chart's color scale (`cScale`). String values are disambiguated: data property names resolve through `cScale`, while literal CSS colors pass through unchanged. + +- feat: Mark registration for automatic domain calculation, accessor aggregation, and implicit series ([#663](https://github.com/techniq/layerchart/pull/663)) + - Marks (Spline, Area, Points, Bars) now register their data, accessors, and colors with the Chart via `registerMark()`. + - Chart automatically aggregates y/x accessors from marks, removing the need to pass `y={['apples', 'oranges']}` when each mark specifies its own `y`. Works for both horizontal (`valueAxis='y'`) and vertical (`valueAxis='x'`) charts. + - Per-mark `data` props are included in the chart's domain calculation automatically. + - Implicit series are generated from mark registrations when no explicit `series` prop is provided, enabling tooltip and legend support without requiring series definitions. + +- feat: Add inertia (momentum) support for transform drag gestures ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat: Add Cell mark. Resolves #627. ([#663](https://github.com/techniq/layerchart/pull/663)) + +- breaking(Chart): Rename `tooltip` prop to `tooltipContext` to better describe purpose and fix conflict with new `tooltip` snippet ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat: Add Chord layout and Ribbon primitive ([#663](https://github.com/techniq/layerchart/pull/663)) + +- breaking(TransformContext): Rename `initialScrollMode` to `scrollMode` and make it reactive ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat(TransformContext): Add `scrollActivationKey` option to require a modifier key (meta, alt, control, shift) for scroll/wheel zoom/pan, preventing accidental page scroll from triggering transforms ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat(Transform): Add zoom/pan constraints (`scaleExtent`, `translateExtent`, `constrain`, `domainExtent`), replace `geo.applyTransform` with `transform.mode: 'projection' | 'rotate'`, and reactively sync initial transform values on projection changes ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat(Bar): Support fixed `width` and `height` props to override scale-derived dimensions, centering the bar within its band. Resolves #360 ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat: Auto-compute Bar/Bars mount animation initial values from chart scales ([#663](https://github.com/techniq/layerchart/pull/663)) + + Bar now automatically derives `initialY`/`initialHeight` (vertical) or `initialX`/`initialWidth` (horizontal) from the chart's scale range when `motion` is configured, removing the need to hardcode pixel values. + + Also improves `valueAxis` inference on `ChartState` — when not explicitly set, it is now derived from scale types (band scale on y → `valueAxis: 'x'`, band scale on x → `valueAxis: 'y'`). + +- feat(Chart): Add cartesian pan/zoom via `transform={{ mode: 'domain' }}` with single or both axis support. Resolves #366 ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat(Spline): Add motion support for mount animation from baseline ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat: Support continuous color scales via `cScale` prop without requiring `cRange` ([#663](https://github.com/techniq/layerchart/pull/663)) + - Allow `cScale` (e.g. `scaleSequential(interpolateTurbo)`) to activate without `cRange`, enabling pre-configured sequential/diverging color scales + - Guard `createScale` against undefined `range` to avoid breaking interpolator-based scales + - Auto-detect numeric `cDomain` values and use `extent` instead of `unique`, producing correct `[min, max]` domains for continuous scales + - Prefer `cScale` color over default series color in tooltip/highlight when a color scale is configured + +- feat(Labels): Support `seriesKey` in `labels` prop to filter which series renders labels. Resolves #633 ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat(Rect): New edge-based props (`x0`/`x1`/`y0`/`y1`) along with existing (`x`/`y`/`width`/`height`) and `insets` support ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat: Add Vector component ([#663](https://github.com/techniq/layerchart/pull/663)) + +### Patch Changes + +- fix(Area): Default y0 baseline to chart's yBaseline when set ([#663](https://github.com/techniq/layerchart/pull/663)) + + Area's y0 fallback now respects the chart's `yBaseline` prop (e.g. `yBaseline={0}` set by AreaChart) instead of always using `min(yScale.domain())`. This fixes areas filling to the bottom of the chart instead of to the baseline when data goes negative. + +- fix(Points|Labels): Correctly position when using x1 / y1 scales (issue #773) ([#663](https://github.com/techniq/layerchart/pull/663)) + +- refactor(Chart): Add `debug` prop and update `settings` context ([#663](https://github.com/techniq/layerchart/pull/663)) + +- fix: Default chart padding now applied when using ChartChildren layout (marks snippet) ([#663](https://github.com/techniq/layerchart/pull/663)) + + When `` is used with `marks`/`grid`/`axis` snippets (no explicit `children` snippet), default padding is now applied to match the axes that ChartChildren renders by default. When `children` is provided directly (e.g. Treemap, Pack), no default padding is applied since the user controls layout. This can still be overridden with explicit `axis` or `padding` props. + +- fix(Tooltip): Apply inverse transform for quadtree lookup when zoomed/panned ([#663](https://github.com/techniq/layerchart/pull/663)) + +- fix(Area): Handle degenerate domains (e.g. all-zero data) and unify y0/y1 baseline logic ([#663](https://github.com/techniq/layerchart/pull/663)) + - Guard against degenerate scale domains where min === max (e.g. `[0, 0]`), which caused `yScale()` to return `NaN` and break area path rendering + - Unify Area y0/y1 path computation to consistently use accessors through the scale, removing duplicate fallback logic + +- fix(BarChart): automatically round the outer edge of each direction in `stackDiverging` layout ([#663](https://github.com/techniq/layerchart/pull/663)) + +- fix: `flattenPathData` now handles relative arc commands, fixing rounded bars starting below the baseline during mount animation ([#663](https://github.com/techniq/layerchart/pull/663)) + +- fix(Area|Highlight): Properly handling diveraging stack layouts for negative values (line, highlight point) ([#663](https://github.com/techniq/layerchart/pull/663)) + +- fix(Points|Labels): Correctly position when using array accessors (duration charts, etc). Fixes #633 ([#663](https://github.com/techniq/layerchart/pull/663)) + +- fix(TooltipContext): correct `bisect-band` hit detection by accounting for chart padding ([#806](https://github.com/techniq/layerchart/pull/806)) + +- fix(ClipPath): Support canvas layers. Resolves #660 ([#663](https://github.com/techniq/layerchart/pull/663)) + +- feat(Chart): Support `motion` prop to transition x/y scales using tween or spring ([#663](https://github.com/techniq/layerchart/pull/663)) + +- fix(Canavs): support `strokeOpacity` for Path component ([#663](https://github.com/techniq/layerchart/pull/663)) + +- fix(Text): handle inline styles and CSS class-based text-anchor ([#663](https://github.com/techniq/layerchart/pull/663)) + +- fix(Tooltip): Fade non-highlighted series items on hover to match chart highlight state ([#663](https://github.com/techniq/layerchart/pull/663)) + +- fix(TooltipContext): Support band mode with array-based range accessors (e.g. histograms using `x={['x0', 'x1']}`) ([#663](https://github.com/techniq/layerchart/pull/663)) + ## 2.0.0-next.46 ### Patch Changes diff --git a/packages/layerchart/package.json b/packages/layerchart/package.json index c6e2d65cd..b4ad87047 100644 --- a/packages/layerchart/package.json +++ b/packages/layerchart/package.json @@ -5,7 +5,7 @@ "license": "MIT", "repository": "techniq/layerchart", "homepage": "https://layerchart.com", - "version": "2.0.0-next.46", + "version": "2.0.0-next.47", "scripts": { "dev": "pnpm package:watch", "package": "svelte-package",