Version Packages (next)#859
Open
github-actions[bot] wants to merge 1 commit intonextfrom
Open
Conversation
4099304 to
76deec6
Compare
76deec6 to
201ba33
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 was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.
nextis currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, runchangeset pre exitonnext.Releases
layerchart@2.0.0-next.63
Minor Changes
feat(Dodge): Add Dodge component for deterministic non-overlapping layout (#862)
A new composition component (similar to
ForceSimulation) that packs items along one axis to avoid overlaps. Modeled after Observable Plot'sdodgetransform:axis:'x'or'y'— which axis to dodge along (default'y')anchor:'top'/'middle'/'bottom'(foraxis='y') or'left'/'middle'/'right'(foraxis='x') — controls which edge items grow away frompadding: minimum px gap between itemsr: collision radius per item (constant or accessor). When omitted, falls back to the chart'sraccessor /rScale(matchingPoints), then to a default of5.position: override the anchor-axis pixel accessor (defaults to chart'sxGet/yGet)Yields each item's computed pixel
x/y(and originalindex) via the children snippet, so you can render with any primitive (Circle,Text, etc.).Also includes a
rowHeightmode that switches from circular to row-based rectangular packing — useful for text labels where circular collision would produce unnecessarily large vertical gaps. The puredodge()algorithm is exported fromDodge.shared.svelte.tsfor direct use.Algorithm modeled after Observable Plot / SveltePlot: maintains an interval tree of placed items keyed by anchor-axis extent, queries it for items in the new item's collision zone, and builds candidate dodge-axis positions from circle-tangency math. Currently implemented as a linear-scan tracker with the same API; can be swapped for a real interval tree without API changes if profiling demands it.
feat(Circle, Text): Inherit chart accessors by default in data mode (#862)
<Circle>and<Text>now fall back to the chart'sx/y/raccessors (viaxGet/yGet/rGet) when the corresponding position prop is omitted — matching how<Points>and the new<Dodge>work. This lets the chart be the single source of truth forx/y/rand removes the boilerplate of repeating those props on every primitive:CircleandTextalso now enter data mode whendatais explicitly passed (in addition to the existing trigger whencx/cy/x/yare data-driven), so the implicit-accessor pattern works without needing to pass redundant string accessors just to trigger iteration.Behavior is unchanged whenever any position prop is set explicitly — the hardcoded defaults (0/0/1) only apply when neither prop nor chart-level config is present. All existing usages in the docs pass explicit position props, so this is purely additive.
feat(Text): Add
fontSizeprop with auto-derivedcapHeight(#862)Adds a typed
fontSize?: number | stringprop on<Text>(number = pixels, string passes through). When set,capHeightdefaults tofontSize * 0.71instead of the legacy'0.71em'— so per-item scaled labels withverticalAnchor="middle"align to a common visual baseline without an explicitcapHeightoverride.Previously,
getPixelValueresolved'0.71em'against a hard-coded 16px, so vertical centering was only correct for ~16px text. Larger labels sat too low, smaller ones too high — visible on text-driven beeswarms or any caller scaling labels per-element.Patch Changes
fix(Chart): Don't compute
[undefined, undefined]domain whenseriesis metadata-only (#449)When
seriesis configured for legend/color metadata only (no per-seriesdata, and items lack the series-key properties on the value axis), the value-axis domain calculation collected all-undefined values and returned[undefined, undefined]. Combined withmotion, this threwCannot spring undefined valueswhenever the series visibility changed (e.g. toggling a legend swatch).The series-aware branch now filters out null/undefined values and falls through to the other domain-resolution paths when nothing remains, instead of returning a poisoned extent.
fix(Image): Stop disabling pointer events by default (#862)