Skip to content

Commit afa67f6

Browse files
Version Packages (next) (#838)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent a986ec4 commit afa67f6

3 files changed

Lines changed: 67 additions & 1 deletion

File tree

.changeset/pre.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"add-trail-component",
2222
"add-violin-component",
2323
"afraid-jobs-say",
24+
"annotation-line-sloped",
25+
"annotation-point-link-callouts",
2426
"arclabel-component",
2527
"arctext-centered-default",
2628
"arctext-inner-padding",
@@ -48,6 +50,7 @@
4850
"bumpy-breads-rhyme",
4951
"calm-jars-mix",
5052
"canvas-group-opacity",
53+
"chart-data-precedence",
5154
"chatty-flies-bet",
5255
"chatty-shirts-rule",
5356
"chilly-games-hide",
@@ -61,6 +64,8 @@
6164
"clip-path-unified",
6265
"clippath-invert",
6366
"component-tree",
67+
"connector-orientation-step-curves",
68+
"connector-swoop-type",
6469
"context-bind-state-rename",
6570
"cozy-moments-work",
6671
"crazy-ads-appear",
@@ -104,11 +109,13 @@
104109
"fix-barchart-diverging-edge-rounding",
105110
"fix-geo-mark-domain",
106111
"fix-geopath-canvas-tooltip",
112+
"fix-geopath-undefined-handlers",
107113
"fix-implicit-series-domain",
108114
"fix-pattern-canvas",
109115
"fix-pie-arc-xrange",
110116
"fix-scale-band-invert",
111117
"fix-spline-series-props-opacity",
118+
"fix-text-negative-string-position",
112119
"fix-transform-projection-reactivity",
113120
"fix-x1-y1-domain-filter-without-series",
114121
"flat-arcs-heal",
@@ -169,6 +176,7 @@
169176
"mark-registration",
170177
"mean-flies-play",
171178
"mean-loops-peel",
179+
"merge-connector-into-link",
172180
"metal-flowers-sneeze",
173181
"mighty-weeks-try",
174182
"modern-nails-kiss",
@@ -262,6 +270,7 @@
262270
"tooltip-fade-duration",
263271
"tooltip-item-highlight-fade",
264272
"tooltip-portal",
273+
"tooltip-xy-accessor-overrides",
265274
"tricky-nights-mix",
266275
"tricky-pears-help",
267276
"true-waves-roll",

packages/layerchart/CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
11
# LayerChart
22

3+
## 2.0.0-next.58
4+
5+
### Major Changes
6+
7+
- breaking: Merge `Connector` into `Link`, remove `Connector` component ([#449](https://github.com/techniq/layerchart/pull/449))
8+
9+
`Link` now supports both **pixel mode** (`x1`/`y1`/`x2`/`y2` props) and **data mode** (`data` + `source`/`target`/`x`/`y` accessors), mirroring the pattern used by primitives like `Circle`, `Text`, and `Rect`.
10+
11+
**Migration:**
12+
- `<Connector source={{...}} target={{...}} ... />``<Link x1={...} y1={...} x2={...} y2={...} ... />`
13+
- `<Link explicitCoords={{ x1, y1, x2, y2 }} />``<Link {x1} {y1} {x2} {y2} />` (or `<Link {...linkPositions[i]} />`)
14+
15+
All Connector props (`type`, `curve`, `sweep`, `radius`, `bend`, `orientation`, `radial`, markers, motion) are available directly on `Link`. The `explicitCoords` prop and `Connector` export are removed.
16+
17+
### Minor Changes
18+
19+
- feat(AnnotationLine): Add `x1`/`y1`/`x2`/`y2` props for sloped lines ([#449](https://github.com/techniq/layerchart/pull/449))
20+
- Pass any combination of `x1`, `y1`, `x2`, `y2` to draw a line between arbitrary points. Missing coordinates fall back to the corresponding axis range (so `x1`/`x2` alone still span the y range, etc.). The existing `x` / `y` shorthand for full-span vertical/horizontal lines is unchanged.
21+
- Labels on sloped lines automatically rotate to follow the line angle (normalized to stay upright), with `labelPlacement`, `labelXOffset`, and `labelYOffset` applied along and perpendicular to the line.
22+
23+
- feat(AnnotationPoint): Add `link` prop for ring-note style callouts, plus geo projection support ([#449](https://github.com/techniq/layerchart/pull/449))
24+
- Pass `link={true}` or `link={{ type: 'beveled', radius: 20, ... }}` etc. to draw a `<Link>` from the ring edge to the label. Any `Link` prop (`type`, `curve`, `sweep`, `radius`, `bend`, `class`, ...) can be passed through.
25+
- Inside a geo `<Chart>`, `x`/`y` are now interpreted as `[lon, lat]` and projected directly, so `AnnotationPoint` can be used on maps.
26+
27+
- feat(Connector): Add `'swoop'` connector type ([#449](https://github.com/techniq/layerchart/pull/449))
28+
29+
New `'swoop'` connector type draws a circular arc between source and target, equivalent to ObservablePlot's Arrow `bend` option. Configured via a new `bend` prop (degrees, default `22.5`) — positive bends right (clockwise from source to target), negative bends left, `0` draws a straight line. Works in both cartesian and radial modes; `Link` forwards it automatically.
30+
31+
- feat(tooltipContext, Voronoi): Add `x`/`y` accessor overrides and default array endpoint to max ([#449](https://github.com/techniq/layerchart/pull/449))
32+
- **New `x`/`y` props** on `tooltipContext` and `Voronoi` accept an `Accessor` (property name string or function). When set, hit-detection points use these accessors instead of the Chart's `x`/`y`. Useful when the Chart's accessor returns an array (e.g. `x={['POP_1980', 'POP_2015']}`) and you want detection at a specific endpoint:
33+
```svelte
34+
<Chart {data} x={['POP_1980', 'POP_2015']} tooltipContext={{ mode: 'voronoi', x: 'POP_2015', y: 'R90_10_2015' }}>
35+
```
36+
- **Breaking (minor)**: when the chart's x/y accessor returns an array (duration bars, candlesticks, stacked areas, etc.), quadtree and voronoi hit-detection now default to the **max** value of the array instead of the **min**. For most use cases (target endpoint, stack top) this is the more natural hover position. If you need the old behavior, pass an explicit `x`/`y` accessor on `tooltipContext`/`Voronoi`.
37+
38+
### Patch Changes
39+
40+
- fix(Chart): Explicit `<Chart data>` now takes precedence over marks' implicit-series data ([#449](https://github.com/techniq/layerchart/pull/449))
41+
42+
When a mark registered its own filtered dataset via `markInfo` (e.g. a decorative `<Text data={highlighted}>` showing labels for a subset), two things went wrong:
43+
1. `ctx.data` would silently switch to the filtered subset via `seriesState.visibleSeriesData`, causing sibling array-driven marks (like `<Link>`) to iterate only the subset.
44+
2. An implicit series would be created from the decorative mark, narrowing the domain calculation to only the subset's values.
45+
46+
Now when `<Chart data>` is explicit (non-empty):
47+
- `ctx.data` always returns the chart's data.
48+
- Marks whose axis accessor matches the chart's axis accessor (including any element of an array accessor like `y={['v1', 'v2']}`) are treated as decorative and don't create implicit series — even if they have their own `data` array.
49+
50+
Marks with their own data still contribute to `flatData` for domain calculation when their accessor differs from the chart's (the multi-dataset / multi-series scenario).
51+
52+
- fix(Connector, Link): Orient d3 step curves by `orientation` ([#449](https://github.com/techniq/layerchart/pull/449))
53+
- Added `orientation?: 'horizontal' | 'vertical'` prop to `Connector` (defaults to `'horizontal'`). `Link` forwards its own orientation so step curves step along the natural flow direction.
54+
- `curveStep`, `curveStepBefore`, and `curveStepAfter` now step along `y` in vertical orientation instead of always stepping along `x`.
55+
56+
- fix(GeoPath): Avoid passing `undefined` event handlers to underlying `Path`, preventing a Svelte error while preserving canvas hit-testing for non-interactive paths ([#449](https://github.com/techniq/layerchart/pull/449))
57+
58+
- fix: Allow negative string values (e.g. `y="-6"`) in `Text` position props to be treated as pixel values instead of data property names ([#449](https://github.com/techniq/layerchart/pull/449))
59+
360
## 2.0.0-next.57
461
562
### Patch Changes

packages/layerchart/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "MIT",
66
"repository": "techniq/layerchart",
77
"homepage": "https://layerchart.com",
8-
"version": "2.0.0-next.57",
8+
"version": "2.0.0-next.58",
99
"scripts": {
1010
"dev": "pnpm package:watch",
1111
"package": "svelte-package",

0 commit comments

Comments
 (0)