Update dependency layerchart to v2.0.0-next.64#190
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
167f13f to
18ebee8
Compare
18ebee8 to
f7cc925
Compare
f7cc925 to
dd90006
Compare
dd90006 to
5e59e1f
Compare
5e59e1f to
e532125
Compare
e532125 to
dcba557
Compare
ebdf8f5 to
085d50d
Compare
085d50d to
21e4ee9
Compare
21e4ee9 to
bc902fc
Compare
bc902fc to
1ca94f0
Compare
15b3e92 to
4243afd
Compare
880dbca to
865c980
Compare
865c980 to
c8b325e
Compare
c8b325e to
255b9e6
Compare
e038e0b to
7a05190
Compare
7a05190 to
32fa162
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.0.0-next.43→2.0.0-next.64Release Notes
techniq/layerchart (layerchart)
v2.0.0-next.64Compare Source
Patch Changes
v2.0.0-next.63Compare Source
Minor Changes
feat(Dodge): Add Dodge component for deterministic non-overlapping layout (#862)
feat(Waffle): Add Waffle component for countable-cell visualizations (#864)
feat(Pattern): Add
rectsshape definition for tile patterns for rendering one or more rectangles per pattern tile (#864)feat(Text): Add
fontSizeprop with auto-derivedcapHeight(#862)Patch Changes
fix(Chart): Don't compute
[undefined, undefined]domain whenseriesis metadata-only (#449)fix(canvas): Resolve
currentColorforfill/stroke(and other style props) (#449)fix(Pattern): fix alignment and sharply render on high-DPI displays when using Canvas layers (#864)
fix(downloadImage / getChartImageBlob): Fix image download (container sizing and text clipping) (#449)
fix(Spline): Allow CSS class
opacityto fade lines on the Canvas layer.Splinewas always passingopacity={1}to the underlyingPathwhen no series fade was active, which becameconstantStyles.opacity = 1in the canvas renderer and shadowed the value resolved from a user'sclass(e.g.class="opacity-20"). Now skip passingopacitywhen the computed series fade is the no-fade default, so the class can take effect — matching SVG behavior where CSS class rules override the presentation attribute. (#449)fix(Image): Stop disabling pointer events by default (#862)
fix(Circle, Text): Inherit chart accessors by default in data mode (#862)
fix(Rect): Support non-uniform
cornersin data/edge mode (#449)v2.0.0-next.62Compare Source
Minor Changes
Patch Changes
perf(Chart): Eliminate per-instance props spread in
ChartState(#857)fix(SeriesState): Avoid
derived_inertcrash when chart unmounts under a<svelte:boundary>(#855)The
selectedKeyssync effect was wrapped in$effect.root, creating an isolated scope that survived chart unmount. When the parent chart was destroyed (e.g. an example reloading inside the docs<svelte:boundary>after an async$derivedre-evaluated), the#seriesderived became inert while the orphaned effect kept reading it — producingReading a derived belonging to a now-destroyed effect may result in stale valueswarnings followed byTypeError: e.some is not a function. The effect now lives in the constructor, scoped to the component that instantiatedSeriesState, so it is torn down with the chart.fix(Arc, RectClipPath, ChartClipPath): Restore on-mount tween animations (#855)
Two related regressions introduced in the layer-component split (#848) prevented
motion+initial*props from animating on mount.Arc—motion,value,initialValueand the rest of Arc's geometry props (domain,range,startAngle,endAngle,innerRadius,outerRadius,cornerRadius,padAngle,track*,offset) were not destructured inArc.base.svelte, so they leaked through{...restProps}onto the inner<Path>. The forwardedmotionmadePathalso tween the path-string on top of the end-angle tween thatArcStatealready drives, producing visibly wrong arcs (NaN coordinates, runaway radii). They are now extracted and passed explicitly toArcState.RectClipPath/ChartClipPath—motion,initialX,initialY,initialWidth,initialHeightwere declared on the type but never consumed: the path was a plain$derivedof the staticx/y/width/heightprops, so passing<ChartClipPath initialWidth={0} motion={{ width: { type: 'tween', … } }}>rendered the final width on mount with no animation. Each dimension now flows through its owncreateMotion(using the correspondinginitial*value as the animation start), and the path is built from the animated values.perf: Reduce per-tick reactive overhead in
Path/Link(force-simulation graphs) (#855)In mark-heavy scenes (force simulations with hundreds of links flowing through
Link → Path) several reactive structures unconditionally subscribed every<path>template updater to props that don't change on a tick, causing per-frame work to scale with the number of props × the number of marks. Each fix below is independent; together they take the lattice (n=20, 760 links) example from ~5–6 fps to ~9 fps during simulation.PathState.tweenedPathDatanow reads onlypathData, not all Path props.Pre-fix, the getter resolved
pathDataviagetProps(), a function that constructs an object literal of every reactive Path prop. Each read oftweenedPathData(i.e. each per-tick<path d=...>update) therefore subscribed the updater to every Path prop and re-read all of them.PathStatenow takes a dedicatedgetPathDatagetter alongsidegetProps, and the hot-path tween / DOM read only touchespathData.Path.svg.svelteandPath.canvas.sveltepass them as separate getters.Link.base.sveltepasses a stablegetPathDatafunction rather thanmotionPath.currentdirectly.Reading
motionPath.currentfromLink.base.svelte's template subscribed the entire<Path>block to every tick, forcing the parent's prop spread ({...restProps}) andcls(...)evaluation to re-run on every change. Passing a stable function reference moves the per-tick read inside<Path>'s own template, keepingLink.base.sveltestable. Requires the newpathData?: string | (() => string)form onPath.Path.svg.svelteallocatesdraw-related state lazily.endPoint = createControlledMotion(..., { type: 'none' })was created for everyPath, even when nodrawtransition was configured. Now only created whendrawis set.$effectthat trackedtweenedPathDataforstartContent/endContentpositioning ran on everyPath, even when neither prop was provided. Now only registered when at least one is set.drawKeyis only ever set whendrawis configured, so the{#key c.drawKey}block is a no-op for paths without a draw transition. The block stays unconditional — splitting it behind{#if draw}showed no measurable benefit over leaving the inert subscription in place.Path.svg.svelteextracts styling props out of...rest.pathData,class,fill/fillOpacity/stroke/strokeOpacity/strokeWidth/opacityandmotionare now destructured out of$props()rather than left in...rest, so the<path>element's{...rest}spread doesn't re-evaluate every frame when those props change (pathDatachanges on every force-sim tick;classis typically a freshcls(...)string per parent render).Link.base.sveltedrops a redundant prop spread.Removed
{...extractLayerProps(restProps, 'lc-link')}before{...restProps}— the call's only contribution (class) was being immediately overridden by the explicitclass={cls('lc-link', …)}that follows, making the spread pure overhead.perf: Skip mark-info
$effectfor pixel-mode primitives (#855)registerComponentnow probesmarkInfo()once at construction; if the result is initially empty (pixel-mode primitives wherecx/cy/r/etc. are numbers rather than string/function accessors), it skips creating the tracking$effectentirely. Saves one effect frame per primitive — adds up in mark-heavy scenes (force simulations, scatter plots with hundreds of nodes).Trade-off: a primitive that starts in pixel mode and later flips to data mode at runtime (e.g.
cxmutates from a number to a string) will not register a mark. Mark mode is typically static; if a chart needs runtime data-mode marks, define an explicitserieson the chart instead.v2.0.0-next.61Compare Source
Minor Changes
feat: Per-layer variants for primitives, compound marks, and high-level charts (
layerchart/svg,layerchart/canvas,layerchart/html) (#848)Layer-agnostic components auto-detect the surrounding
<Svg>,<Canvas>, or<Html>layer and bundle every render path. The new sub-path exports expose layer-specific variants so consumers committed to a single rendering layer can opt into a smaller bundle.Each agnostic component (e.g.
Rect.svelte) now dispatches to the corresponding per-layer variant under the hood (Rect.svg.svelte,Rect.canvas.svelte,Rect.html.svelte) — no breaking change for existing consumers.What's split
Standout per-layer wins (gz, vs agnostic baseline)
Bundle reductions on the default
<Chart>path<ChartCore>for non-cartesian charts (new)Behavior
v2.0.0-next.60Compare Source
Minor Changes
breaking: Move heavy-dep components into sub-path exports (#845)
The following components are no longer re-exported from
'layerchart'and must be imported from new sub-paths:'layerchart/geo'—GeoCircle,GeoClipPath,GeoEdgeFade,GeoLegend,GeoPath,GeoPoint,GeoProjection,GeoRaster,GeoSpline,GeoTile,GeoVisible,Graticule,TileImage'layerchart/hierarchy'—Tree,Treemap,Pack,Partition'layerchart/force'—ForceSimulation'layerchart/graph'—Dagre,Sankey,Chord,RibbonThis isolates each group's external d3 dependency (
@dagrejs/dagre~22 KB,d3-geo~15 KB,d3-force~7 KB,d3-hierarchy~6 KB,d3-sankey~6 KB,d3-chord~2 KB) behind an opt-in import — defending against bundlers that don't tree-shake the root barrel cleanly.Voronoi/Hullstay at root (already lazy-loaded viaTooltipContext).Contour/Density/Raster/BoxPlot/Violin/Thresholdand high-level charts (LineChart,BarChart, etc.) remain at root.Migration: update affected imports, e.g.
Patch Changes
perf: Lazy-load opt-in features in
corepath (#845)5 components/dependencies that previously sat in every
<Chart>user's sync graph are now dynamically imported only when the corresponding feature is used:BrushContextinChart— only loads when<Chart brush={...}>is set (defaultundefined)DefaultTooltipinChartChildren— only loads whentooltipContextis set and no customtooltipsnippet is providedd3-quadtreeinTooltipContext— only loads whenmodeis'quadtree','quadtree-x', or'quadtree-y'SplineinGrid— only loads when rendering radial linear grid lines (<Chart radial>withradialY="linear")BarinHighlight— only loads when<Chart highlight={{ bar: ... }}>is set (defaultfalse)Result: ~10 KB gz off
core(115.6 → 105.25 KB) and comparable savings on every cartesian/geo/graph/hierarchy scenario, with no impact on rendered output for users who already opt into these features.Also switches internal
@layerstack/svelte-actionsimports from the barrel (@layerstack/svelte-actions) to sub-paths (@layerstack/svelte-actions/styles,@layerstack/svelte-actions/portal). No production bundle effect — bundlers already tree-shake the unusedpopover.js— but it stops the Svelte REPL/CDN from eagerly fetching@floating-ui/dom(popover's transitive dep) when consumers loadlayerchartfrom a CDN.v2.0.0-next.59Compare Source
Patch Changes
v2.0.0-next.58Compare Source
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)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.labelPlacement,labelXOffset, andlabelYOffsetapplied along and perpendicular to the line.feat(AnnotationPoint): Add
linkprop for ring-note style callouts, plus geo projection support (#449)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.<Chart>,x/yare now interpreted as[lon, lat]and projected directly, soAnnotationPointcan be used on maps.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)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:x/yaccessor ontooltipContext/Voronoi.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.Now when
<Chart data>is explicit (non-empty):ctx.dataalways returns the chart's data.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)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.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)v2.0.0-next.57Compare Source
Patch Changes
fix(AnnotationRange): Don't extend past chart bounds when
xis omitted on band scales, and treatnullon either side ofx/yas "extend to chart edge". (#449)fix(Spline): Restore
series.props.opacity(and other style props) precedence over the computed series fade opacity. Regression introduced by per-segment styling refactor where the explicitopacitywas spread afterseries.props, clobbering per-series opacity values (e.g.series={[{ props: { opacity: 0.1 } }, ...]}). (#449)fix(ChartState): Don't filter explicit
x1Domain/y1Domainby visible series when no series are configured. Restores grouped layout for composable<Chart>usage (e.g.<Bars>withx1/x1Domain/x1Range) where the visible-series filter previously emptied the secondary band scale domain, collapsing all bars to a single category position. (#449)v2.0.0-next.56Compare Source
Minor Changes
feat(Circle, Ellipse): Support pattern/gradient
fillvalues on the<Html>layer by switching frombackground-colorto thebackgroundshorthand (withbackground-origin: border-boxto keep patterns aligned under the border). Accepts values produced by<Pattern>/<LinearGradient>in HTML mode. (#449)feat(Pattern): Support
<Html>layer by producing CSSrepeating-linear-gradient(lines) andradial-gradient(circles) values usable as abackground/fill. Gradient-valuedbackground(e.g.<Pattern background={gradient}>) is also supported. (#449)Patch Changes
fix(Pattern): Restore canvas layer support by registering as a
groupnode so snippet children (e.g.<Rect fill={pattern}>) render correctly (#449)fix(Rect): On the
<Html>layer, setbackground-origin: border-boxso fills/patterns start at the outer edge — previously the CSSbackgroundshorthand reset origin topadding-box, shifting patterns inward byborder-widthwhen a stroke was applied. (#449)fix(Rect, Circle, Ellipse): Apply
box-sizing: border-boxon the<Html>layer so the visual extent equalswidth×height(orr * 2,rx * 2×ry * 2) — the border is drawn within that extent instead of added to it, matching SVG bounds. (#449)fix(Rect, Circle, Ellipse): On the
<Html>layer, defaultborder-widthto1pxwhenstrokeis set without an explicitstrokeWidth, matching SVG's implicitstroke-width: 1. Also ensures Circle/Ellipseborder-widthgets the requiredpxunit. (#449)v2.0.0-next.55Compare Source
Minor Changes
feat(Bar, Bars): Support
<Html>layer (#449)Bar/Bars now render in
<Html>layers in addition to<Svg>and<Canvas>, including per-cornerroundedvariants (top,bottom,left,right,edge, and individual corners). Previously, any non-uniformroundedvalue fell through to a<Path>and was SVG-only.feat(ClipPath, RectClipPath, CircleClipPath, GeoClipPath): HTML layer support + unified
pathAPI (#449)ClipPathnow accepts a singlepath: string(SVG pathdsyntax) that drives all three layers:<path d={path}>inside the<clipPath>element.Path2Dand applied viactx.clip(...).clip-path: path("${path}")on a wrapper<div>covering the chart container.This replaces the previous
canvasClip/canvasClipDepscallbacks (and skipped HTML entirely) with a single declarative value. Theclipsnippet is still accepted for advanced/custom SVG content.RectClipPath,CircleClipPath, andGeoClipPathare rewritten on top of this — they each compute a path string (d3-geo-path already emits one natively) and pass it through. All three now support<Html>layers in addition to<Svg>and<Canvas>.Note:
clip-path: path()requires Chrome 88+, Safari 13.1+, Firefox 118+.feat(ClipPath, RectClipPath, CircleClipPath, GeoClipPath): Add
invertprop to render content outside the clip shape (cutouts/masks) across SVG, Canvas, and HTML layers (#449)feat(Line, Rect, Circle, Text): Multi-layer compatible
dashArrayand inline color props (#449)dashArrayprop toLine,Rect, andCircle. Accepts a number, array, or SVG-style string and maps tostroke-dasharray(SVG),setLineDash(Canvas), and eitherrepeating-linear-gradient(HTML lines) orborder-style: dashed(HTML borders). Previously dashed styling was SVG-only when applied via CSS class or attribute.TextandLineHTML branches now honor thefill/strokeprops as inlinecolor/background, so prop-based colors work across all three layers (not just SVG/Canvas).Grid.x/Grid.yandAxis.gridnow acceptstroke,strokeWidth,opacity, anddashArrayin their object form, matching the props forwarded to the underlying line.Rulealready forwarded arbitrary Line props via spread;dashArraynow works there unchanged.parseDashArrayanddashArrayToGradienthelpers frompathutils.feat(Tree, Link, Connector): Add radial support (#831)
Treenow detects<Chart radial>and lays out withd3.tree().size([2π, min(width, height)/2])plus radial separation. Nodes emit polar coords (x= angle,y= radius).Connectorgains aradialprop (defaults toctx.radial) that interpretssource/targetas polar and dispatches to newgetConnectorRadialPresetPath/getConnectorRadialD3Pathhelpers. Radial behavior per connectortype:straight— straight cartesian linesquare— radial → arc at midR → radialbeveled— chord at source radius with chamfered corner (controlled byradius)rounded— visx LinkRadialCurve Bezierd3—d3.linkRadialby default; with acurveprop,curveStep/curveStepBefore/curveStepAftermap to polar arcs/radials, other curves go throughd3.lineRadialLinkforwardsradialtoConnectorautomatically when inside a radial<Chart>.feat(Rect): Add
cornersprop for per-corner rounding (#449)New
cornersprop accepts either a number (equivalent torx), a[topLeft, topRight, bottomRight, bottomLeft]tuple, or{ topLeft, topRight, bottomRight, bottomLeft }. Works across<Svg>,<Canvas>, and<Html>layers — Svg renders a<rect>when corners are uniform and a<path>when they differ, Canvas usesroundRect's per-corner radii, and Html uses the 4-valueborder-radiusshorthand.Also exports a shared
roundedRectPath(x, y, width, height, [tl, tr, br, bl])helper frompathutils for building per-corner rounded-rect path data.Patch Changes
fix(canvas): Compose globalAlpha multiplicatively so Group opacity propagates to children (#831)
Canvas
renderPathDatawas overwritingctx.globalAlphawith absolute values for element opacity, fill opacity, and stroke opacity. This meant a parent<Group opacity={0.2}>had no effect on child marks rendered on canvas — the child's own opacity (defaulting to 1) would replace the inherited value.Now all three sites multiply against the current
globalAlpha, which correctly composes with ancestor Group opacity set viasave()/restore()scoping. Also removes double-application of elementopacityinside the fill/stroke blocks (it's already applied at the element level).v2.0.0-next.54Compare Source
Minor Changes
feat: New
GeoClipPathcomponent for clipping content to GeoJSON boundaries in both SVG and Canvas modes (#449)feat(Text): Add
segmentsprop for inline mixed-style text (#449)New
segmentsprop accepts an array of{ value, class }objects to render text with different styles (font size, weight, color) inline. Works across SVG (via tspans), Canvas (via sequential measureText/fillText), and HTML layers. Useful for labels that combine a bold name with a lighter value, such as treemap headers.feat(Hull): Add CommonStyleProps (fill, fillOpacity, stroke, strokeOpacity, strokeWidth, opacity) for Canvas layer compatibility (#449)
feat(Tooltip): Add
fadeDurationprop to control fade in/out transition (#828)The fade transition on
Tooltip.Rootis now configurable via thefadeDurationprop (default:100ms). Set to0to disable the fade transition entirely.feat(Tooltip): Portal tooltip to body by default to fix overflow clipping. Resolves #446 (#828)
Tooltip.Root now portals to
document.body(or.PortalTarget) by default using theportalaction from@layerstack/svelte-actions. This prevents tooltips from being clipped by ancestor elements withoverflow: hidden. The tooltip usesposition: fixedwith viewport-relative coordinates when portaled. Setportal={false}to restore the previous inline behavior. Bothcontained="container"andcontained="window"modes continue to work correctly with portaling.Patch Changes
fix(ArcLabel): Support rotation in Canvas mode (#449)
Changed
centroid-rotatedandcentroid-radialplacements to passrotateprop instead of SVGtransformstring toText, enabling rotation in Canvas rendering.fix: Pie and Arc components now correctly use Chart's
xRangeprop for angle degrees instead of the computed viewport pixel range, and compute radius from chart dimensions instead of scale range (#449)v2.0.0-next.53Compare Source
Minor Changes
feat: Support pre-projected topologies in
GeoLegendviareferenceScale(#449)Add a
referenceScaleprop toGeoLegendfor charts that render pre-projected data withgeoIdentity(e.g.us-atlas'scounties-albers-10m/states-albers-10m, pre-projected withgeoAlbersUsa().scale(1300)). When provided, pixels-per-distance is derived from the chart's fit scale and the supplied base scale, bypassing theprojection.invert+geoDistancepath which only works for real lon/lat projections. TheGeoPathbubble-map example now renders a correct scale bar.v2.0.0-next.52Compare Source
Minor Changes
feat(ArcLabel): New component for positioning text labels on arc segments (#817)
ArcLabelis a new marking component for placing text (and optional leader lines) relative to an arc. It's used internally byPieChartandArcChartwhen thelabelsprop is set, but can also be rendered directly inside anArcchildren snippet.Supported placements:
centroid— at the arc centroid (horizontal text, default)centroid-rotated— at the centroid, rotated to follow the arc tangent, flipped where needed so text stays uprightcentroid-radial— at the centroid, rotated to read along the radial direction (center → outer edge)inner/middle/outer— along the inner, medial, or outer arc path (centered viastartOffset: '50%'by default)callout— outside the arc with a leader line that bends horizontally to the labelArcLabelaccepts a singleoffsetprop that is routed to the placement-appropriate radial padding (centroid offset,innerPadding/outerPadding, orcalloutLineLength), pluscalloutLineLength/calloutLabelOffset/calloutPaddingfor fine-grained control of callout leader lines. The leader line renders via thePathprimitive, so it works in both SVG and Canvas chart layers.breaking(Arc): Center arc text along path by default for
inner/middle/outerpositions (#817)getArcTextProps('inner' | 'middle' | 'outer')now defaults tostartOffset: '50%'withtextAnchor: 'middle', centering the text along the arc path rather than anchoring it at the arc start. When an explicitstartOffsetis provided, the anchor falls back to'start'so the text begins at that position (matching prior behavior for callers that set a start offset).feat(Arc): Add
innerPaddingoption togetArcTextProps/getTrackTextProps(#817)ArcTextOptionsnow supports aninnerPaddingoption, symmetric to the existingouterPadding. Positive values shrink the inner radius used to build theinner/middlearc text paths, moving text inward (toward the chart center). Previously, offsetting aninner-placed arc label away from the arc edge required overriding the path manually; now it works the same asouterPaddingdoes foroutertext.feat(CircleLegend): New component for visualizing radius (
rScale) values as nested circles (#818)CircleLegenddisplays a set of bottom-aligned nested circles representing values from a radius scale, useful alongside bubble maps and scatter charts that encode magnitude via circle area. By default it readsrScalefrom the chart context, but ascaleprop can also be passed to render standalone.Supports
tickValues/ticks/tickFormatfor value selection and formatting, atitlerendered centered above the circles, andlabelPlacement="right" | "left" | "inline"to render tick labels with a leader line on either side of the circles or centered inside each circle near the top.feat(GeoLegend): New scale-bar legend showing real-world distance for the current
Chartprojection (#818)GeoLegendreads the active geo projection from the chart context and renders a labeled scale bar with tick subdivisions. By default it picks a "nice" round distance that covers ~25% of the chart width, butdistancecan be passed for an explicit value. Supportsunits="km" | "mi", configurableticks,tickFormat,title, and the standardplacementprops. Inspired by Harry Stevens' d3-geo-scale-bar.feat(Labels): Add
middleplacement and changecenterto center within the bar body (#449)placement="center"now positions the label at the center of the bar body (between the value edge and the baseline). The previouscenterbehavior (label aligned to the value edge with a middle anchor) is now available as the newplacement="middle".feat(Legend, CircleLegend): Show an indicator of the current tooltip value on the legend (#818)
Legend(ramp variant) now draws a small upward-pointing arrow below the color ramp at the position of the currently hovered value, andCircleLegenddraws a 50%-opacity filled circle at the corresponding radius. Both auto-read the hovered data fromctx.tooltip.dataand pipe it through the chart's color (ctx.c) / radius (ctx.r) accessors, so wiring is automatic for charts that configurec/r/cScale/rScaleviaChartprops.A new
valueprop on both components allows explicitly setting the indicator value (overriding the auto-detection), useful when the tooltip data shape doesn't match the chart's accessor.For
scaleThreshold/scaleQuantize/scaleQuantilescales, theLegendindicator centers on the matching bucket swatch.feat(PieChart/ArcChart): Add top-level
labelsprop (#817)PieChartandArcChartnow accept alabelsprop that renders text labels on each arc without requiring a customarcsnippet. Passtrueto enable defaults (centroid placement, default value accessor), or an object to configure anyArcLabelprops — placement, offset, value accessor, callout line lengths, leader line style, text class, etc.v2.0.0-next.51Compare Source
Minor Changes
feat: New
GeoRastercomponent for reprojecting raster imagery (e.g. NASA Blue Marble) onto any d3-geo projection via per-pixel inverse sampling on Canvas (#815)feat: Add
renderChart()tolayerchart/serverfor server-side chart-to-image rendering (PNG/JPEG) (#813)Patch Changes
feat: Add
strokeandfillprops toAxisandGridfor explicit color control (useful for SSR where CSS variables are unavailable) (#813)fix: Skip mark x/y/data from domain/series calculation when geo projection is active (#449)
fix: Default geo projection
translateto container center whentranslateandfitGeojsonare not specified, instead of using d3-geo's fixed default ([480, 250]) (#815)fix: improve compatibility with UnoCSS Svelte scoped preprocessing (#813)
asassertions from exported Svelte markup in core mark components so preprocessors that parse markup expressions as plain JavaScript can consume packaged components without failingv2.0.0-next.50Compare Source
Minor Changes
feat: New Trail component for variable-width lines (#449)
fix(Axis): Default
tickSpacingtonullfor categorical band scales, showing all ticks by default instead of reducing them. UsetickSpacing={80}to opt-in to tick reducing on categorical band scale axes. (#449)Patch Changes
v2.0.0-next.49Compare Source
Minor Changes
feat(Labels): Add
smartplacement option (#799)New
placement="smart"mode that dynamically positions labels based on neighboring point values (peak, trough, rising, falling) to reduce overlapping.feat(Chart, BrushState): Add band scale (categorical) support for transform pan/zoom and brush selection. Uses range-rescaling pattern to smoothly zoom and pan categorical bar charts. Automatically constrains panning to data boundaries and prevents zooming out past initial view. (#449)
feat(Chart): In projection mode,
scaleExtentandtranslateExtentare now interpreted as relative values (like d3-zoom).scaleExtent: [0.5, 8]means 0.5x to 8x of the fitted projection scale.translateExtentis offset from the initial fitted position in pixels. (#449)feat(Spline): Support function-valued
stroke,fill, andopacityfor per-segment styling (#449)feat(Text): Add
formatprop and tween numericvaluewhenmotionis configured (#449)Patch Changes
Support
tickSpacingfor band scales on Axis, thinning tick labels when the domain is larger than the available space. Automatically shows more tick labels when zoomed in on band scale transforms. (#449)perf: Optimize primitive component instantiation (~3-5x faster for Rect, Circle, Ellipse, Line, Text, Path, Group) (#449)
createMotion: Fast-path passthrough when nomotionprop is provided, avoiding$state/$effectoverhead per axiscreateDataMotionMap: Short-circuit whenmotionisundefined, skippingparseMotionPropoverheadcreateKey: Only create fill/stroke key trackers in canvas layer (skipped for SVG/HTML)registerComponent: SkipregisterMarkfor emptyMarkInfo(pixel-mode marks)$effectfor data motion tracking when no motion is configuredparseMotionPropcalls whenmotionisundefinedfeat(Marker): Add
squareandsquare-stroketypes (#805)fix(GeoPath): Fix canvas tooltip by conditionally passing onclick to Path, preventing non-interactive overlays from capturing hit canvas events (#449)
fix(scaleBandInvert): Account for range offset in band scale inversion. Previously assumed range started at 0, causing incorrect pixel-to-category mapping when the scale range was transformed. (#449)
fix(TransformContext): Reactively sync
processTranslateanddisablePointerto TransformState when props change. Fixes inverted globe dragging when dynamically switching between flat and globe projections. (#449)fix(Chart): Enable scroll zoom for globe projections by including
scale: truein defaulttransformApplyfor globes. (#449)feat(Raster, Contour): support bounded geo raster overlays with projected interpolation (#449)
feat: Add Month component (#671)
fix(LinearGradient, RadialGradient): Register as
groupinstead ofmarkin canvas component tree so wrapped children (e.g. Arc, Path) are rendered (#449)v2.0.0-next.48Compare Source
Patch Changes
v2.0.0-next.47Compare Source
Major Changes
breaking(BrushContext|TransformContext): Rename
bind:brushContext/bind:transformContexttobind:state(#663)Both
BrushContextandTransformContextnow usebind:stateinstead of their previous named bindings. Additionally, properties onChartStatehave been renamed:chartContext.brushContext→chartContext.brushStatechartContext.transformContext→chartContext.transformStatebreaking(TransformContext): Rename
domainExtent: 'original'todomainExtent: 'data'(#663)The
'original'value fordomainExtenthas been renamed to'data'to better describe that it constrains pan/zoom to the data's domain bounds:breaking(GeoContext): Rename
GeoContextcomponent toGeoProjection(#663)The
GeoContextcomponent has been renamed toGeoProjectionto better describe its purpose. Update your imports and template usage:breaking: Rename render context APIs to layer context (#663)
getRenderContext()→getLayerContext()setRenderContext()→setLayerContext()supportedContextsprop →layersprop on componentslayout/directory moved tolayers/(affects deep imports)breaking(Chart): Remove
isVerticalfrom ChartState, addvalueAxisprop toChart(#663)ChartState.isVerticalhas been removed in favor ofChartState.valueAxis('x'|'y'), which explicitly defines which axis represents the value (dependent variable).Simplified charts (
BarChart,LineChart,AreaChart,ScatterChart) still accept theorientationprop as before — each chart maps it to the correctvalueAxisinternally. The<Chart>component itself now usesvalueAxisdirectly, sinceorientationis ambiguous at that level (a "vertical" BarChart hasvalueAxis="y"while a "vertical" LineChart hasvalueAxis="x").When accessing chart state:
When using
<Chart>directly (not simplified charts):breaking: Remove standalone context getter/setter functions (#663)
The following standalone context functions have been removed in favor of the unified
getChartContext()API:getTooltipContext()/setTooltipContext()→ usegetChartContext().tooltipgetBrushContext()/setBrushContext()→ usegetChartContext().brushStategetTransformContext()/setTransformContext()→ usegetChartContext().transformStatebreaking(Arc|Pie|Calendar|GeoPath): Rename
tooltipContextto simpletooltip(boolean), simplifying use case (#663)Minor Changes
feat: Add BoxPlot component for box-and-whisker plots (#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,outliersaccessors) and automatic computation from raw values via thevaluesprop. Orientation-aware viavalueAxiscontext.feat: Add statistical utility functions
computeBoxStats()andkde()(#663)computeBoxStats(values, k?)computes the five-number summary and outliers using the Tukey IQR methodkde(values, options?)computes kernel density estimation using the Epanechnikov kernel with Silverman's rule-of-thumb bandwidthfeat: Add Violin component for violin plots (#663)
New composite mark that renders a symmetric density curve (mirrored area) from raw data using kernel density estimation (Ep
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.