Major Changes
-
breaking: Merge
ConnectorintoLink, removeConnectorcomponent (#449)Linknow supports both pixel mode (x1/y1/x2/y2props) and data mode (data+source/target/x/yaccessors), mirroring the pattern used by primitives likeCircle,Text, andRect.Migration:
<Connector source={{...}} target={{...}} ... />→<Link x1={...} y1={...} x2={...} y2={...} ... /><Link explicitCoords={{ x1, y1, x2, y2 }} />→<Link {x1} {y1} {x2} {y2} />(or<Link {...linkPositions[i]} />)
All Connector props (
type,curve,sweep,radius,bend,orientation,radial, markers, motion) are available directly onLink. TheexplicitCoordsprop andConnectorexport are removed.
Minor Changes
-
feat(AnnotationLine): Add
x1/y1/x2/y2props for sloped lines (#449)- Pass any combination of
x1,y1,x2,y2to draw a line between arbitrary points. Missing coordinates fall back to the corresponding axis range (sox1/x2alone still span the y range, etc.). The existingx/yshorthand for full-span vertical/horizontal lines is unchanged. - Labels on sloped lines automatically rotate to follow the line angle (normalized to stay upright), with
labelPlacement,labelXOffset, andlabelYOffsetapplied along and perpendicular to the line.
- Pass any combination of
-
feat(AnnotationPoint): Add
linkprop for ring-note style callouts, plus geo projection support (#449)- Pass
link={true}orlink={{ type: 'beveled', radius: 20, ... }}etc. to draw a<Link>from the ring edge to the label. AnyLinkprop (type,curve,sweep,radius,bend,class, ...) can be passed through. - Inside a geo
<Chart>,x/yare now interpreted as[lon, lat]and projected directly, soAnnotationPointcan be used on maps.
- Pass
-
feat(Connector): Add
'swoop'connector type (#449)New
'swoop'connector type draws a circular arc between source and target, equivalent to ObservablePlot's Arrowbendoption. Configured via a newbendprop (degrees, default22.5) — positive bends right (clockwise from source to target), negative bends left,0draws a straight line. Works in both cartesian and radial modes;Linkforwards it automatically. -
feat(tooltipContext, Voronoi): Add
x/yaccessor overrides and default array endpoint to max (#449)- New
x/yprops ontooltipContextandVoronoiaccept anAccessor(property name string or function). When set, hit-detection points use these accessors instead of the Chart'sx/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:<Chart {data} x={['POP_1980', 'POP_2015']} tooltipContext={{ mode: 'voronoi', x: 'POP_2015', y: 'R90_10_2015' }}> - 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/yaccessor ontooltipContext/Voronoi.
- New
Patch Changes
-
fix(Chart): Explicit
<Chart data>now takes precedence over marks' implicit-series data (#449)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:ctx.datawould silently switch to the filtered subset viaseriesState.visibleSeriesData, causing sibling array-driven marks (like<Link>) to iterate only the subset.- An implicit series would be created from the decorative mark, narrowing the domain calculation to only the subset's values.
Now when
<Chart data>is explicit (non-empty):ctx.dataalways returns the chart's data.- 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 owndataarray.
Marks with their own data still contribute to
flatDatafor domain calculation when their accessor differs from the chart's (the multi-dataset / multi-series scenario). -
fix(Connector, Link): Orient d3 step curves by
orientation(#449)- Added
orientation?: 'horizontal' | 'vertical'prop toConnector(defaults to'horizontal').Linkforwards its own orientation so step curves step along the natural flow direction. curveStep,curveStepBefore, andcurveStepAfternow step alongyin vertical orientation instead of always stepping alongx.
- Added
-
fix(GeoPath): Avoid passing
undefinedevent handlers to underlyingPath, preventing a Svelte error while preserving canvas hit-testing for non-interactive paths (#449) -
fix: Allow negative string values (e.g.
y="-6") inTextposition props to be treated as pixel values instead of data property names (#449)