layerchart 2.0.0-next.6 → 2.0.0-next.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/bench/ComposableLineChart.svelte +56 -0
- package/dist/bench/ComposableLineChart.svelte.d.ts +16 -0
- package/dist/bench/GeoBench.svelte +24 -0
- package/dist/bench/GeoBench.svelte.d.ts +11 -0
- package/dist/bench/PrimitiveBench.svelte +66 -0
- package/dist/bench/PrimitiveBench.svelte.d.ts +10 -0
- package/dist/bench/composable-vs-linechart.svelte.bench.d.ts +1 -0
- package/dist/bench/composable-vs-linechart.svelte.bench.js +100 -0
- package/dist/bench/generateData.d.ts +29 -0
- package/dist/bench/generateData.js +93 -0
- package/dist/bench/primitives.svelte.bench.d.ts +1 -0
- package/dist/bench/primitives.svelte.bench.js +42 -0
- package/dist/bench/svg-vs-canvas.svelte.bench.d.ts +1 -0
- package/dist/bench/svg-vs-canvas.svelte.bench.js +431 -0
- package/dist/components/AnnotationLine.svelte +126 -69
- package/dist/components/AnnotationLine.svelte.d.ts +10 -2
- package/dist/components/AnnotationPoint.svelte +122 -36
- package/dist/components/AnnotationPoint.svelte.d.ts +8 -1
- package/dist/components/AnnotationRange.svelte +45 -17
- package/dist/components/Arc.svelte +42 -35
- package/dist/components/Arc.svelte.d.ts +9 -6
- package/dist/components/Arc.svelte.test.d.ts +1 -0
- package/dist/components/Arc.svelte.test.js +858 -0
- package/dist/components/ArcLabel.svelte +259 -0
- package/dist/components/ArcLabel.svelte.d.ts +73 -0
- package/dist/components/ArcLabel.svelte.test.d.ts +1 -0
- package/dist/components/ArcLabel.svelte.test.js +235 -0
- package/dist/components/Area.svelte +95 -100
- package/dist/components/Area.svelte.d.ts +7 -3
- package/dist/components/Axis.svelte +254 -60
- package/dist/components/Axis.svelte.d.ts +42 -8
- package/dist/components/Bar.svelte +174 -53
- package/dist/components/Bar.svelte.d.ts +22 -2
- package/dist/components/Bars.svelte +33 -7
- package/dist/components/Bars.svelte.d.ts +9 -1
- package/dist/components/Blur.svelte +10 -9
- package/dist/components/Blur.svelte.d.ts +2 -5
- package/dist/components/Bounds.svelte +1 -1
- package/dist/components/BoxPlot.svelte +389 -0
- package/dist/components/BoxPlot.svelte.d.ts +40 -0
- package/dist/components/BrushContext.svelte +149 -329
- package/dist/components/BrushContext.svelte.d.ts +17 -45
- package/dist/components/BrushContext.svelte.test.d.ts +1 -0
- package/dist/components/BrushContext.svelte.test.js +308 -0
- package/dist/components/Calendar.svelte +45 -20
- package/dist/components/Calendar.svelte.d.ts +4 -4
- package/dist/components/Cell.svelte +64 -0
- package/dist/components/Cell.svelte.d.ts +25 -0
- package/dist/components/Chart.svelte +580 -767
- package/dist/components/Chart.svelte.d.ts +127 -101
- package/dist/components/ChartChildren.svelte +334 -0
- package/dist/components/ChartChildren.svelte.d.ts +147 -0
- package/dist/components/ChartClipPath.svelte +2 -2
- package/dist/components/Circle.svelte +392 -72
- package/dist/components/Circle.svelte.d.ts +40 -9
- package/dist/components/Circle.svelte.test.d.ts +1 -0
- package/dist/components/Circle.svelte.test.js +141 -0
- package/dist/components/CircleClipPath.svelte +13 -15
- package/dist/components/CircleClipPath.svelte.d.ts +7 -1
- package/dist/components/CircleLegend.svelte +389 -0
- package/dist/components/CircleLegend.svelte.d.ts +114 -0
- package/dist/components/ClipPath.svelte +77 -10
- package/dist/components/ClipPath.svelte.d.ts +21 -2
- package/dist/components/ColorRamp.svelte +1 -1
- package/dist/components/ComputedStyles.svelte +10 -3
- package/dist/components/Contour.svelte +301 -0
- package/dist/components/Contour.svelte.d.ts +48 -0
- package/dist/components/Density.svelte +146 -0
- package/dist/components/Density.svelte.d.ts +21 -0
- package/dist/components/Ellipse.svelte +485 -0
- package/dist/components/Ellipse.svelte.d.ts +89 -0
- package/dist/components/Ellipse.svelte.test.d.ts +1 -0
- package/dist/components/Ellipse.svelte.test.js +126 -0
- package/dist/components/Frame.svelte +2 -2
- package/dist/components/Grid.svelte +106 -77
- package/dist/components/Grid.svelte.d.ts +19 -4
- package/dist/components/Group.svelte +188 -65
- package/dist/components/Group.svelte.d.ts +34 -9
- package/dist/components/Group.svelte.test.d.ts +1 -0
- package/dist/components/Group.svelte.test.js +63 -0
- package/dist/components/Highlight.svelte +393 -165
- package/dist/components/Highlight.svelte.d.ts +13 -1
- package/dist/components/Hull.svelte +42 -14
- package/dist/components/Hull.svelte.d.ts +2 -2
- package/dist/components/Image.svelte +558 -0
- package/dist/components/Image.svelte.d.ts +127 -0
- package/dist/components/Image.svelte.test.d.ts +1 -0
- package/dist/components/Image.svelte.test.js +220 -0
- package/dist/components/Labels.svelte +144 -31
- package/dist/components/Labels.svelte.d.ts +24 -8
- package/dist/components/Legend.svelte +296 -84
- package/dist/components/Legend.svelte.d.ts +30 -12
- package/dist/components/Line.svelte +389 -84
- package/dist/components/Line.svelte.d.ts +46 -14
- package/dist/components/Line.svelte.test.d.ts +1 -0
- package/dist/components/Line.svelte.test.js +121 -0
- package/dist/components/LinearGradient.svelte +47 -13
- package/dist/components/Link.svelte +269 -70
- package/dist/components/Link.svelte.d.ts +69 -26
- package/dist/components/Marker.svelte +51 -27
- package/dist/components/Marker.svelte.d.ts +1 -1
- package/dist/components/Month.svelte +273 -0
- package/dist/components/Month.svelte.d.ts +70 -0
- package/dist/components/MonthPath.svelte +32 -18
- package/dist/components/MonthPath.svelte.d.ts +8 -3
- package/dist/components/MotionPath.svelte +1 -1
- package/dist/components/Path.svelte +381 -0
- package/dist/components/Path.svelte.d.ts +72 -0
- package/dist/components/Pattern.svelte +112 -15
- package/dist/components/Pattern.svelte.d.ts +3 -1
- package/dist/components/Pie.svelte +10 -10
- package/dist/components/Pie.svelte.d.ts +2 -3
- package/dist/components/Point.svelte +1 -1
- package/dist/components/Points.svelte +76 -84
- package/dist/components/Points.svelte.d.ts +7 -8
- package/dist/components/Polygon.svelte +538 -0
- package/dist/components/Polygon.svelte.d.ts +136 -0
- package/dist/components/Polygon.svelte.test.d.ts +1 -0
- package/dist/components/Polygon.svelte.test.js +121 -0
- package/dist/components/RadialGradient.svelte +16 -16
- package/dist/components/Raster.svelte +335 -0
- package/dist/components/Raster.svelte.d.ts +48 -0
- package/dist/components/Rect.svelte +659 -89
- package/dist/components/Rect.svelte.d.ts +94 -8
- package/dist/components/Rect.svelte.test.d.ts +1 -0
- package/dist/components/Rect.svelte.test.js +179 -0
- package/dist/components/RectClipPath.svelte +17 -9
- package/dist/components/RectClipPath.svelte.d.ts +8 -2
- package/dist/components/Rule.svelte +170 -78
- package/dist/components/Rule.svelte.d.ts +7 -2
- package/dist/components/Spline.svelte +189 -269
- package/dist/components/Spline.svelte.d.ts +28 -56
- package/dist/components/Text.svelte +633 -211
- package/dist/components/Text.svelte.d.ts +62 -12
- package/dist/components/Text.svelte.test.d.ts +1 -0
- package/dist/components/Text.svelte.test.js +152 -0
- package/dist/components/Threshold.svelte +6 -3
- package/dist/components/Trail.svelte +268 -0
- package/dist/components/Trail.svelte.d.ts +88 -0
- package/dist/components/TransformContext.svelte +132 -428
- package/dist/components/TransformContext.svelte.d.ts +22 -0
- package/dist/components/TransformContext.svelte.test.d.ts +1 -0
- package/dist/components/TransformContext.svelte.test.js +166 -0
- package/dist/components/Vector.svelte +399 -0
- package/dist/components/Vector.svelte.d.ts +109 -0
- package/dist/components/Violin.svelte +318 -0
- package/dist/components/Violin.svelte.d.ts +47 -0
- package/dist/components/Voronoi.svelte +53 -25
- package/dist/components/Voronoi.svelte.d.ts +9 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-full-circle--360-degree-range--1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-full-circle--360-degree-range--2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-innerRadius-of-0--pie-slice--1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-innerRadius-of-0--pie-slice--2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-negative-domain-values-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-negative-domain-values-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-partial-arc--e-g---180-degrees--1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-partial-arc--e-g---180-degrees--2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-at-max-domain-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-at-max-domain-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-below-domain-min-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-below-domain-min-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-exceeding-domain-max-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-exceeding-domain-max-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-of-0-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-of-0-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-pointer-enter-events-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-pointer-enter-events-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-pointer-move-events-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-pointer-move-events-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-offset-to-arc-position-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-offset-to-arc-position-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-call-tooltip-hide-on-pointer-leave-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-call-tooltip-hide-on-pointer-leave-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-call-tooltip-show-on-pointer-enter-with-data-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-call-tooltip-show-on-pointer-enter-with-data-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-handle-custom-start-angle-in-range-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-handle-custom-start-angle-in-range-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-an-arc-path-with-value-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-an-arc-path-with-value-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-when-track-prop-is-provided-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-when-track-prop-is-provided-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackEndAngle-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackEndAngle-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackInnerRadius-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackInnerRadius-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackPadAngle-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackPadAngle-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackStartAngle-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackStartAngle-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackStartAngle-and-trackEndAngle-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackStartAngle-and-trackEndAngle-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-both-startAngle-and-endAngle-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-both-startAngle-and-endAngle-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-cornerRadius-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-cornerRadius-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-domain-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-domain-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-domain-and-range-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-domain-and-range-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-range-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-range-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-endAngle-in-radians-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-endAngle-in-radians-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-innerRadius-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-innerRadius-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-padAngle-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-padAngle-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-startAngle-in-radians-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-startAngle-in-radians-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-snippets-should-render-text-inner--middle--outer-Text-children-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-snippets-should-render-text-inner--middle--outer-Text-children-2.png +0 -0
- package/dist/components/__screenshots__/ArcLabel.svelte.test.ts/ArcLabel-defaults-placement-to-centroid--x-y-at-the-centroid--middle-anchors--1.png +0 -0
- package/dist/components/__screenshots__/ArcLabel.svelte.test.ts/ArcLabel-defaults-placement-to-centroid--x-y-at-the-centroid--middle-anchors--2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-clear-brush-when-x-prop-changes-to--null--null--1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-clear-brush-when-x-prop-changes-to--null--null--2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-not-show-brush-when-x-prop-is-null-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-not-show-brush-when-x-prop-is-null-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-not-show-brush-when-x-prop-matches-full-domain-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-not-show-brush-when-x-prop-matches-full-domain-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-show-brush-when-x-prop-is-provided-with-a-sub-domain-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-show-brush-when-x-prop-is-provided-with-a-sub-domain-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-update-brush-width-when-x-prop-changes-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-update-brush-width-when-x-prop-changes-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-clear-brush-when-reset-programmatically-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-clear-brush-when-reset-programmatically-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-compute-correct-pixel-width-for-brush-move---1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-compute-correct-pixel-width-for-brush-move---2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-move-only-y-when-x-is-not-specified-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-move-only-y-when-x-is-not-specified-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-select-full-domain-with-selectAll-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-select-full-domain-with-selectAll-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-show-brush-when-moved-programmatically-via-context-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-show-brush-when-moved-programmatically-via-context-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-update-width-when-brush-move---is-called-again-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-update-width-when-brush-move---is-called-again-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-rendering-should-not-render-brush-UI-when-brush-is-disabled-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-rendering-should-not-render-brush-UI-when-brush-is-disabled-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-rendering-should-not-render-range-or-handles-initially-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-rendering-should-not-render-range-or-handles-initially-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-rendering-should-render-brush-context-when-brush-is-enabled-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-rendering-should-render-brush-context-when-brush-is-enabled-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-zoomOnBrush-with-onBrushEnd-should-pass-brush-domain-values-to-onBrushEnd-before-resetting-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-zoomOnBrush-with-onBrushEnd-should-pass-brush-domain-values-to-onBrushEnd-before-resetting-2.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-render-one-circle-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-render-one-circle-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-render-with-function-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-render-with-function-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-resolve-data-driven-fill-through-cScale-1.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-resolve-data-driven-fill-through-cScale-2.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-pixel-mode-should-render-a-circle-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-pixel-mode-should-render-a-circle-with-pixel-values-2.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-render-one-ellipse-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-render-one-ellipse-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-resolve-data-driven-fill-through-cScale-1.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-resolve-data-driven-fill-through-cScale-2.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-pixel-mode-should-render-an-ellipse-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-pixel-mode-should-render-an-ellipse-with-pixel-values-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-apply-circular-clipping-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-apply-circular-clipping-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-pass-literal-URL-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-pass-literal-URL-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-render-one-image-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-render-one-image-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-render-with-function-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-render-with-function-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-resolve-data-driven-href-from-data-property-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-resolve-data-driven-href-from-data-property-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-apply-circular-clipping-when-r-is-set-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-apply-circular-clipping-when-r-is-set-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-apply-preserveAspectRatio-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-apply-preserveAspectRatio-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-apply-rotation-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-apply-rotation-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-default-width-and-height-to-16-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-default-width-and-height-to-16-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-render-an-image-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-render-an-image-with-pixel-values-2.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-render-one-line-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-render-one-line-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-resolve-data-driven-stroke-through-cScale-1.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-resolve-data-driven-stroke-through-cScale-2.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-pixel-mode-should-render-a-line-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-pixel-mode-should-render-a-line-with-pixel-values-2.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-render-one-polygon-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-render-one-polygon-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-resolve-data-driven-fill-through-cScale-1.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-resolve-data-driven-fill-through-cScale-2.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-pixel-mode-should-render-a-polygon-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-pixel-mode-should-render-a-polygon-with-pixel-values-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---colors-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---colors-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---colors-should-resolve-data-driven-fill-through-cScale-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---colors-should-resolve-data-driven-fill-through-cScale-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---edge-based-should-render-rects-from-edge-props-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---edge-based-should-render-rects-from-edge-props-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---edge-based-should-render-rects-with-insets-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---edge-based-should-render-rects-with-insets-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---edge-based-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---edge-based-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---standard-should-render-one-rect-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---standard-should-render-one-rect-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-pixel-mode-should-render-a-rect-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-pixel-mode-should-render-a-rect-with-pixel-values-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-render-one-text-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-render-one-text-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-resolve-data-driven-fill-through-cScale-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-resolve-data-driven-fill-through-cScale-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-resolve-value-as-data-property-name-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-resolve-value-as-data-property-name-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-pixel-mode-should-preserve-CSS-like-string-values-as-SVG-values-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-pixel-mode-should-preserve-CSS-like-string-values-as-SVG-values-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-pixel-mode-should-render-text-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-pixel-mode-should-render-text-with-pixel-values-2.png +0 -0
- package/dist/components/charts/ArcChart.svelte +192 -225
- package/dist/components/charts/ArcChart.svelte.d.ts +55 -18
- package/dist/components/charts/ArcChart.svelte.test.d.ts +1 -0
- package/dist/components/charts/ArcChart.svelte.test.js +24 -0
- package/dist/components/charts/AreaChart.svelte +88 -526
- package/dist/components/charts/AreaChart.svelte.d.ts +36 -37
- package/dist/components/charts/AreaChart.svelte.test.d.ts +1 -0
- package/dist/components/charts/AreaChart.svelte.test.js +154 -0
- package/dist/components/charts/BarChart.svelte +130 -507
- package/dist/components/charts/BarChart.svelte.d.ts +39 -32
- package/dist/components/charts/BarChart.svelte.test.d.ts +1 -0
- package/dist/components/charts/BarChart.svelte.test.js +454 -0
- package/dist/components/charts/BarChartFixedWidthTest.svelte +47 -0
- package/dist/components/charts/BarChartFixedWidthTest.svelte.d.ts +11 -0
- package/dist/components/charts/ChartAnnotations.svelte +8 -7
- package/dist/components/charts/ChartAnnotations.svelte.d.ts +1 -3
- package/dist/components/charts/DefaultTooltip.svelte +109 -35
- package/dist/components/charts/DefaultTooltip.svelte.d.ts +2 -4
- package/dist/components/charts/DefaultTooltip.svelte.test.d.ts +1 -0
- package/dist/components/charts/DefaultTooltip.svelte.test.js +242 -0
- package/dist/components/charts/LineChart.svelte +96 -430
- package/dist/components/charts/LineChart.svelte.bench.d.ts +1 -0
- package/dist/components/charts/LineChart.svelte.bench.js +189 -0
- package/dist/components/charts/LineChart.svelte.d.ts +36 -31
- package/dist/components/charts/LineChart.svelte.test.d.ts +1 -0
- package/dist/components/charts/LineChart.svelte.test.js +48 -0
- package/dist/components/charts/PieChart.svelte +337 -362
- package/dist/components/charts/PieChart.svelte.d.ts +72 -33
- package/dist/components/charts/PieChart.svelte.test.d.ts +1 -0
- package/dist/components/charts/PieChart.svelte.test.js +36 -0
- package/dist/components/charts/ScatterChart.svelte +53 -376
- package/dist/components/charts/ScatterChart.svelte.d.ts +27 -23
- package/dist/components/charts/__fixtures__/ArcChartTooltip.svelte +39 -0
- package/dist/{docs/Blockquote.svelte.d.ts → components/charts/__fixtures__/ArcChartTooltip.svelte.d.ts} +4 -6
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-multiple-area-paths-for-each-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-multiple-area-paths-for-each-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-multiple-area-paths-for-each-series-with-separate-data-1.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-multiple-area-paths-for-each-series-with-separate-data-2.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-multiple-area-paths-for-each-series-with-separate-data-and-stack-layout-1.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-multiple-area-paths-for-each-series-with-separate-data-and-stack-layout-2.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-with-single-series-when-no-series-prop-provided-1.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-with-single-series-when-no-series-prop-provided-2.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-series-layout-should-render-with-overlap-layout-1.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-series-layout-should-render-with-overlap-layout-2.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-series-layout-should-render-with-stack-layout-1.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-series-layout-should-render-with-stack-layout-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-basic-should-render-horizontal-bars-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-basic-should-render-horizontal-bars-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-basic-should-render-vertical-bars-without-NaN-attributes-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-basic-should-render-vertical-bars-without-NaN-attributes-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-basic-should-render-with-default-series-when-no-series-prop-provided-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-basic-should-render-with-default-series-when-no-series-prop-provided-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-fixed-width-height-should-center-fixed-width-bars-within-their-band-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-fixed-width-height-should-center-fixed-width-bars-within-their-band-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-fixed-width-height-should-render-horizontal-bars-with-fixed-height-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-fixed-width-height-should-render-horizontal-bars-with-fixed-height-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-fixed-width-height-should-render-vertical-bars-with-fixed-width-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-fixed-width-height-should-render-vertical-bars-with-fixed-width-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-legend-series-toggle-adjusts-group-scale-should-adjust-grouped-bar-widths-when-series-are-toggled-via-legend-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-legend-series-toggle-adjusts-group-scale-should-adjust-grouped-bar-widths-when-series-are-toggled-via-legend-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-no-series-prop--transition-example-pattern--should-render-without-series-prop-and-not-produce-NaN-rect-attributes-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-no-series-prop--transition-example-pattern--should-render-without-series-prop-and-not-produce-NaN-rect-attributes-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-separate-data-per-series-should-render-overlapping-series-with-separate-data-arrays-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-separate-data-per-series-should-render-overlapping-series-with-separate-data-arrays-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-separate-data-per-series-should-render-stacked-series-with-separate-data-arrays-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-separate-data-per-series-should-render-stacked-series-with-separate-data-arrays-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-grouped-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-grouped-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-multiple-Bars-groups-for-each-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-multiple-Bars-groups-for-each-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stackDiverging-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stackDiverging-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stackExpand-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stackExpand-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stacked-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stacked-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stacked-series-horizontally-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stacked-series-horizontally-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-stackDiverging-edge-rounding-should-round-both-tips-when-there-is-one-positive-and-one-negative-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-stackDiverging-edge-rounding-should-round-both-tips-when-there-is-one-positive-and-one-negative-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-stackDiverging-edge-rounding-should-round-the-tip-of-each-direction--not-inner-layers-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-stackDiverging-edge-rounding-should-round-the-tip-of-each-direction--not-inner-layers-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-tooltip-should-use-explicit-series-colors--not-color-scale-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-tooltip-should-use-explicit-series-colors--not-color-scale-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-fade-non-highlighted-tooltip-series-items-on-hover-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-fade-non-highlighted-tooltip-series-items-on-hover-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-show-header-and-all-series-items-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-show-header-and-all-series-items-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-show-series-colors-in-tooltip-items-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-show-series-colors-in-tooltip-items-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-show-single-series-without-total-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-show-single-series-without-total-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-LineChart--multi-series--quadtree-x-mode--should-show-header-and-all-series-items-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-LineChart--multi-series--quadtree-x-mode--should-show-header-and-all-series-items-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-ScatterChart--single-point--quadtree-mode--should-show-series-header-for-multi-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-ScatterChart--single-point--quadtree-mode--should-show-series-header-for-multi-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-ScatterChart--single-point--quadtree-mode--should-show-x--y--and-r-items-when-r-is-configured-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-ScatterChart--single-point--quadtree-mode--should-show-x--y--and-r-items-when-r-is-configured-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-ScatterChart--single-point--quadtree-mode--should-show-x-and-y-items-in-tooltip-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-ScatterChart--single-point--quadtree-mode--should-show-x-and-y-items-in-tooltip-2.png +0 -0
- package/dist/components/charts/__screenshots__/LineChart.svelte.test.ts/LineChart-tooltip-should-prefer-cScale-color-over-default-series-color-when-cScale-is-explicitly-provided-1.png +0 -0
- package/dist/components/charts/__screenshots__/LineChart.svelte.test.ts/LineChart-tooltip-should-prefer-cScale-color-over-default-series-color-when-cScale-is-explicitly-provided-2.png +0 -0
- package/dist/components/charts/__screenshots__/PieChart.svelte.test.ts/PieChart-uses-hovered-slice-identity-for-implicit-tooltip-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/PieChart.svelte.test.ts/PieChart-uses-hovered-slice-identity-for-implicit-tooltip-series-2.png +0 -0
- package/dist/components/charts/types.d.ts +6 -211
- package/dist/components/{ForceSimulation.svelte → force/ForceSimulation.svelte} +184 -50
- package/dist/components/force/ForceSimulation.svelte.d.ts +158 -0
- package/dist/components/force/index.d.ts +2 -0
- package/dist/components/force/index.js +2 -0
- package/dist/components/{GeoCircle.svelte → geo/GeoCircle.svelte} +3 -3
- package/dist/components/{GeoCircle.svelte.d.ts → geo/GeoCircle.svelte.d.ts} +1 -1
- package/dist/components/geo/GeoClipPath.svelte +72 -0
- package/dist/components/geo/GeoClipPath.svelte.d.ts +35 -0
- package/dist/components/{GeoEdgeFade.svelte → geo/GeoEdgeFade.svelte} +7 -8
- package/dist/components/{GeoEdgeFade.svelte.d.ts → geo/GeoEdgeFade.svelte.d.ts} +2 -2
- package/dist/components/geo/GeoLegend.svelte +433 -0
- package/dist/components/geo/GeoLegend.svelte.d.ts +117 -0
- package/dist/components/geo/GeoPath.svelte +161 -0
- package/dist/components/{GeoPath.svelte.d.ts → geo/GeoPath.svelte.d.ts} +7 -7
- package/dist/components/geo/GeoPoint.svelte +105 -0
- package/dist/components/{GeoPoint.svelte.d.ts → geo/GeoPoint.svelte.d.ts} +2 -2
- package/dist/components/geo/GeoProjection.svelte +30 -0
- package/dist/components/geo/GeoProjection.svelte.d.ts +8 -0
- package/dist/components/geo/GeoRaster.svelte +311 -0
- package/dist/components/geo/GeoRaster.svelte.d.ts +61 -0
- package/dist/components/geo/GeoSpline.svelte +78 -0
- package/dist/components/{GeoSpline.svelte.d.ts → geo/GeoSpline.svelte.d.ts} +4 -4
- package/dist/components/{GeoTile.svelte → geo/GeoTile.svelte} +18 -15
- package/dist/components/{GeoTile.svelte.d.ts → geo/GeoTile.svelte.d.ts} +1 -1
- package/dist/components/{GeoVisible.svelte → geo/GeoVisible.svelte} +4 -4
- package/dist/components/{Graticule.svelte → geo/Graticule.svelte} +11 -14
- package/dist/components/{Graticule.svelte.d.ts → geo/Graticule.svelte.d.ts} +3 -2
- package/dist/components/{TileImage.svelte → geo/TileImage.svelte} +22 -7
- package/dist/components/{TileImage.svelte.d.ts → geo/TileImage.svelte.d.ts} +1 -1
- package/dist/components/geo/index.d.ts +26 -0
- package/dist/components/geo/index.js +26 -0
- package/dist/components/graph/Chord.svelte +114 -0
- package/dist/components/graph/Chord.svelte.d.ts +53 -0
- package/dist/components/{Dagre.svelte → graph/Dagre.svelte} +6 -1
- package/dist/components/graph/Ribbon.svelte +141 -0
- package/dist/components/graph/Ribbon.svelte.d.ts +51 -0
- package/dist/components/{Sankey.svelte → graph/Sankey.svelte} +1 -3
- package/dist/components/graph/index.d.ts +8 -0
- package/dist/components/graph/index.js +8 -0
- package/dist/components/{Pack.svelte → hierarchy/Pack.svelte} +4 -6
- package/dist/components/{Pack.svelte.d.ts → hierarchy/Pack.svelte.d.ts} +12 -7
- package/dist/components/{Partition.svelte → hierarchy/Partition.svelte} +4 -3
- package/dist/components/{Partition.svelte.d.ts → hierarchy/Partition.svelte.d.ts} +12 -4
- package/dist/components/{Tree.svelte → hierarchy/Tree.svelte} +11 -6
- package/dist/components/{Tree.svelte.d.ts → hierarchy/Tree.svelte.d.ts} +12 -4
- package/dist/components/hierarchy/Treemap.svelte +203 -0
- package/dist/components/{Treemap.svelte.d.ts → hierarchy/Treemap.svelte.d.ts} +23 -15
- package/dist/components/hierarchy/index.d.ts +8 -0
- package/dist/components/hierarchy/index.js +8 -0
- package/dist/components/index.d.ts +41 -47
- package/dist/components/index.js +41 -48
- package/dist/components/layers/Canvas.svelte +502 -0
- package/dist/components/{layout → layers}/Canvas.svelte.d.ts +17 -37
- package/dist/components/{layout → layers}/Html.svelte +34 -16
- package/dist/components/{layout → layers}/Html.svelte.d.ts +7 -0
- package/dist/components/layers/Layer.svelte +85 -0
- package/dist/components/layers/Layer.svelte.d.ts +23 -0
- package/dist/components/{layout → layers}/Svg.svelte +38 -18
- package/dist/components/{layout → layers}/Svg.svelte.d.ts +7 -0
- package/dist/components/{layout → layers}/WebGL.svelte +27 -7
- package/dist/components/{layout → layers}/WebGL.svelte.d.ts +8 -5
- package/dist/components/tests/BrushTestHarness.svelte +27 -0
- package/dist/components/tests/BrushTestHarness.svelte.d.ts +8 -0
- package/dist/components/tests/TestHarness.svelte +87 -0
- package/dist/components/tests/TestHarness.svelte.d.ts +21 -0
- package/dist/components/tests/TransformTestHarness.svelte +27 -0
- package/dist/components/tests/TransformTestHarness.svelte.d.ts +8 -0
- package/dist/components/tooltip/Tooltip.svelte +239 -93
- package/dist/components/tooltip/Tooltip.svelte.d.ts +28 -14
- package/dist/components/tooltip/Tooltip.svelte.test.d.ts +1 -0
- package/dist/components/tooltip/Tooltip.svelte.test.js +294 -0
- package/dist/components/tooltip/TooltipContext.svelte +440 -243
- package/dist/components/tooltip/TooltipContext.svelte.d.ts +37 -21
- package/dist/components/tooltip/TooltipHeader.svelte +32 -18
- package/dist/components/tooltip/TooltipHeader.svelte.d.ts +3 -3
- package/dist/components/tooltip/TooltipItem.svelte +57 -37
- package/dist/components/tooltip/TooltipItem.svelte.d.ts +3 -3
- package/dist/components/tooltip/TooltipList.svelte +12 -10
- package/dist/components/tooltip/TooltipSeparator.svelte +18 -10
- package/dist/components/tooltip/__screenshots__/Tooltip.svelte.test.ts/Tooltip-portal-should-portal-tooltip-to-a-custom-selector-target-1.png +0 -0
- package/dist/components/tooltip/__screenshots__/Tooltip.svelte.test.ts/Tooltip-portal-should-portal-tooltip-to-a-custom-selector-target-2.png +0 -0
- package/dist/components/tooltip/__screenshots__/Tooltip.svelte.test.ts/Tooltip-portal-should-render-tooltip-inline-when-portal-is-false-1.png +0 -0
- package/dist/components/tooltip/__screenshots__/Tooltip.svelte.test.ts/Tooltip-portal-should-render-tooltip-inline-when-portal-is-false-2.png +0 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/contexts/canvas.d.ts +34 -0
- package/dist/contexts/canvas.js +14 -0
- package/dist/contexts/chart.d.ts +6 -0
- package/dist/contexts/chart.js +50 -0
- package/dist/contexts/componentTree.test.d.ts +1 -0
- package/dist/contexts/componentTree.test.js +83 -0
- package/dist/contexts/geo.d.ts +4 -0
- package/dist/contexts/geo.js +11 -0
- package/dist/contexts/index.d.ts +5 -0
- package/dist/contexts/index.js +5 -0
- package/dist/contexts/layer.d.ts +3 -0
- package/dist/contexts/layer.js +8 -0
- package/dist/contexts/settings.d.ts +4 -0
- package/dist/contexts/settings.js +10 -0
- package/dist/contexts/transform.d.ts +96 -0
- package/dist/contexts/transform.js +10 -0
- package/dist/force.d.ts +1 -0
- package/dist/force.js +1 -0
- package/dist/geo.d.ts +1 -0
- package/dist/geo.js +1 -0
- package/dist/graph.d.ts +1 -0
- package/dist/graph.js +1 -0
- package/dist/hierarchy.d.ts +1 -0
- package/dist/hierarchy.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/server/ContextCapture.svelte +30 -0
- package/dist/server/ContextCapture.svelte.d.ts +8 -0
- package/dist/server/ServerChart.svelte +26 -0
- package/dist/server/ServerChart.svelte.d.ts +11 -0
- package/dist/server/TestBarChart.svelte +35 -0
- package/dist/server/TestBarChart.svelte.d.ts +14 -0
- package/dist/server/TestLineChart.svelte +35 -0
- package/dist/server/TestLineChart.svelte.d.ts +14 -0
- package/dist/server/captureStore.d.ts +8 -0
- package/dist/server/captureStore.js +18 -0
- package/dist/server/index.d.ts +137 -0
- package/dist/server/index.js +141 -0
- package/dist/server/renderChart.ssr.test.d.ts +1 -0
- package/dist/server/renderChart.ssr.test.js +205 -0
- package/dist/server/renderTree.d.ts +8 -0
- package/dist/server/renderTree.js +29 -0
- package/dist/states/__fixtures__/ComponentNodeLifecycleChild.svelte +13 -0
- package/dist/{docs/Json.svelte.d.ts → states/__fixtures__/ComponentNodeLifecycleChild.svelte.d.ts} +4 -8
- package/dist/states/__fixtures__/ComponentNodeLifecycleHarness.svelte +48 -0
- package/dist/states/__fixtures__/ComponentNodeLifecycleHarness.svelte.d.ts +8 -0
- package/dist/states/__fixtures__/ComponentNodeLifecycleParent.svelte +26 -0
- package/dist/states/__fixtures__/ComponentNodeLifecycleParent.svelte.d.ts +9 -0
- package/dist/states/__screenshots__/chart.component-node.svelte.test.ts/ChartState-registerComponent-cleans-up-child-nodes-and-mark-registrations-when-components-unmount-1.png +0 -0
- package/dist/states/__screenshots__/chart.component-node.svelte.test.ts/ChartState-registerComponent-cleans-up-child-nodes-and-mark-registrations-when-components-unmount-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-baseline-domain-multi-series-should-work-without-baseline--no-forced-0--1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-baseline-domain-multi-series-should-work-without-baseline--no-forced-0--2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-degenerate-domain-should-expand-degenerate-y-domain--5--5--to--5--6--1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-degenerate-domain-should-expand-degenerate-y-domain--5--5--to--5--6--2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-geo-projection-skips-markInfo-should-not-derive-x-y-accessors-from-marks-when-geo-projection-is-active-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-geo-projection-skips-markInfo-should-not-derive-x-y-accessors-from-marks-when-geo-projection-is-active-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-series-domain-update-on-visibility-toggle-should-update-y-domain-when-hiding-an-explicit-series-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-series-domain-update-on-visibility-toggle-should-update-y-domain-when-hiding-an-explicit-series-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-series-domain-update-on-visibility-toggle-should-update-y-domain-when-hiding-an-implicit-series-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-series-domain-update-on-visibility-toggle-should-update-y-domain-when-hiding-an-implicit-series-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-x-y-from-marks--no-x-y-on-Chart--should-deduplicate-repeated-mark-x-keys-into-a-single-accessor-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-x-y-from-marks--no-x-y-on-Chart--should-deduplicate-repeated-mark-x-keys-into-a-single-accessor-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-x-y-from-marks--no-x-y-on-Chart--should-derive-correct-y-domain-across-two-marks-with-different-data-and-no-y-prop-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-x-y-from-marks--no-x-y-on-Chart--should-derive-correct-y-domain-across-two-marks-with-different-data-and-no-y-prop-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-x-y-from-marks--no-x-y-on-Chart--should-derive-x-accessor-from-marks-when-x-prop-is-absent-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-x-y-from-marks--no-x-y-on-Chart--should-derive-x-accessor-from-marks-when-x-prop-is-absent-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-aggregate-y-accessor-from-implicit-series-into-resolveAccessor-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-aggregate-y-accessor-from-implicit-series-into-resolveAccessor-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-calculate-correct-y-domain-from-two-marks-with-same-y-accessor-but-different-data-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-calculate-correct-y-domain-from-two-marks-with-same-y-accessor-but-different-data-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-deduplicate-implicit-series-with-the-same-key-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-deduplicate-implicit-series-with-the-same-key-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-generate-implicit-series-from-marks-with-seriesKey-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-generate-implicit-series-from-marks-with-seriesKey-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-generate-implicit-series-from-marks-with-string-y-accessors-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-generate-implicit-series-from-marks-with-string-y-accessors-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-generate-implicit-series-from-x-accessor-for-vertical-charts--valueAxis-x--1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-generate-implicit-series-from-x-accessor-for-vertical-charts--valueAxis-x--2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-data-from-two-marks-with-same-y-accessor-but-different-data-arrays-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-data-from-two-marks-with-same-y-accessor-but-different-data-arrays-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-implicit-series-label-when-provided-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-implicit-series-label-when-provided-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-mark-data-in-flatData-for-domain-calculation-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-mark-data-in-flatData-for-domain-calculation-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-per-mark-data-in-domain-via-implicit-series-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-per-mark-data-in-domain-via-implicit-series-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-not-double-include-data-when-mark-data-matches-series-data-reference-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-not-double-include-data-when-mark-data-matches-series-data-reference-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-register-and-unregister-marks-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-register-and-unregister-marks-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-revert-flatData-after-all-marks-unregister-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-revert-flatData-after-all-marks-unregister-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-skip-marks-without-a-derivable-key-for-implicit-series-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-skip-marks-without-a-derivable-key-for-implicit-series-2.png +0 -0
- package/dist/states/__screenshots__/series.svelte.test.ts/SeriesState-visibility-should-allow-toggling-after-initial-selected--false-1.png +0 -0
- package/dist/states/__screenshots__/series.svelte.test.ts/SeriesState-visibility-should-allow-toggling-after-initial-selected--false-2.png +0 -0
- package/dist/states/__screenshots__/series.svelte.test.ts/SeriesState-visibility-should-respect-selected--false-on-series-items-1.png +0 -0
- package/dist/states/__screenshots__/series.svelte.test.ts/SeriesState-visibility-should-respect-selected--false-on-series-items-2.png +0 -0
- package/dist/states/brush.svelte.d.ts +99 -0
- package/dist/states/brush.svelte.js +249 -0
- package/dist/states/brush.svelte.test.d.ts +1 -0
- package/dist/states/brush.svelte.test.js +417 -0
- package/dist/states/chart.component-node.svelte.test.d.ts +1 -0
- package/dist/states/chart.component-node.svelte.test.js +28 -0
- package/dist/states/chart.svelte.d.ts +264 -0
- package/dist/states/chart.svelte.js +1092 -0
- package/dist/states/chart.svelte.test.d.ts +1 -0
- package/dist/states/chart.svelte.test.js +1635 -0
- package/dist/states/geo.svelte.d.ts +49 -0
- package/dist/states/geo.svelte.js +97 -0
- package/dist/states/series.svelte.d.ts +83 -0
- package/dist/states/series.svelte.js +248 -0
- package/dist/states/series.svelte.test.d.ts +1 -0
- package/dist/states/series.svelte.test.js +333 -0
- package/dist/states/settings.svelte.d.ts +12 -0
- package/dist/states/settings.svelte.js +10 -0
- package/dist/states/tooltip.svelte.d.ts +22 -0
- package/dist/states/tooltip.svelte.js +16 -0
- package/dist/states/transform.svelte.d.ts +175 -0
- package/dist/states/transform.svelte.js +408 -0
- package/dist/styles/daisyui-5.css +6 -0
- package/dist/styles/shadcn-svelte.css +11 -0
- package/dist/styles/skeleton-3.css +15 -0
- package/dist/styles/skeleton-4.css +15 -0
- package/dist/utils/__screenshots__/canvas.svelte.test.ts/clearCanvasContext-clears-with-zero-padding--no-offset--1.png +0 -0
- package/dist/utils/__screenshots__/canvas.svelte.test.ts/clearCanvasContext-clears-with-zero-padding--no-offset--2.png +0 -0
- package/dist/utils/__screenshots__/canvas.svelte.test.ts/renderPathData-composes-element-opacity-with-inherited-globalAlpha--Group-opacity--1.png +0 -0
- package/dist/utils/__screenshots__/canvas.svelte.test.ts/renderPathData-composes-element-opacity-with-inherited-globalAlpha--Group-opacity--2.png +0 -0
- package/dist/utils/__screenshots__/canvas.svelte.test.ts/renderPathData-inline-style-overrides-styles-object-1.png +0 -0
- package/dist/utils/__screenshots__/canvas.svelte.test.ts/renderPathData-inline-style-overrides-styles-object-2.png +0 -0
- package/dist/utils/arcText.svelte.d.ts +8 -2
- package/dist/utils/arcText.svelte.js +12 -8
- package/dist/utils/array.d.ts +11 -0
- package/dist/utils/array.js +23 -0
- package/dist/utils/array.test.d.ts +1 -0
- package/dist/utils/array.test.js +200 -0
- package/dist/utils/attributes.d.ts +3 -13
- package/dist/utils/attributes.js +4 -18
- package/dist/utils/canvas.d.ts +85 -0
- package/dist/utils/canvas.js +238 -56
- package/dist/utils/canvas.svelte.test.d.ts +1 -0
- package/dist/utils/canvas.svelte.test.js +758 -0
- package/dist/utils/chart.js +8 -0
- package/dist/utils/color.js +11 -8
- package/dist/utils/common.d.ts +19 -3
- package/dist/utils/common.js +29 -10
- package/dist/utils/common.test.js +35 -1
- package/dist/utils/dataProp.d.ts +112 -0
- package/dist/utils/dataProp.js +125 -0
- package/dist/utils/dataProp.test.d.ts +1 -0
- package/dist/utils/dataProp.test.js +128 -0
- package/dist/utils/download.d.ts +98 -0
- package/dist/utils/download.js +250 -0
- package/dist/utils/genData.d.ts +22 -8
- package/dist/utils/genData.js +34 -14
- package/dist/utils/graph/dagre.js +6 -8
- package/dist/utils/graph/sankey.js +9 -7
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/linkUtils.d.ts +42 -0
- package/dist/utils/linkUtils.js +280 -0
- package/dist/utils/math.d.ts +17 -0
- package/dist/utils/math.js +17 -0
- package/dist/utils/motion.svelte.d.ts +26 -2
- package/dist/utils/motion.svelte.js +99 -2
- package/dist/utils/motion.test.js +49 -1
- package/dist/utils/path.d.ts +73 -1
- package/dist/utils/path.js +219 -17
- package/dist/utils/rasterBounds.d.ts +18 -0
- package/dist/utils/rasterBounds.js +98 -0
- package/dist/utils/rasterBounds.test.d.ts +1 -0
- package/dist/utils/rasterBounds.test.js +63 -0
- package/dist/utils/rasterInterpolate.d.ts +11 -0
- package/dist/utils/rasterInterpolate.js +103 -0
- package/dist/utils/rect.svelte.d.ts +29 -4
- package/dist/utils/rect.svelte.js +120 -7
- package/dist/utils/scales.svelte.d.ts +10 -4
- package/dist/utils/scales.svelte.js +60 -13
- package/dist/utils/scales.svelte.test.d.ts +1 -0
- package/dist/utils/scales.svelte.test.js +67 -0
- package/dist/utils/shape.d.ts +43 -0
- package/dist/utils/shape.js +59 -0
- package/dist/utils/stack.js +1 -1
- package/dist/utils/stats.d.ts +33 -0
- package/dist/utils/stats.js +79 -0
- package/dist/utils/string.d.ts +51 -0
- package/dist/utils/string.js +4 -2
- package/dist/utils/ticks.d.ts +15 -4
- package/dist/utils/ticks.js +147 -162
- package/dist/utils/ticks.test.js +26 -26
- package/dist/utils/trail.d.ts +36 -0
- package/dist/utils/trail.js +340 -0
- package/dist/utils/treemap.d.ts +1 -1
- package/dist/utils/types.d.ts +28 -2
- package/package.json +78 -57
- package/README.md +0 -41
- package/dist/components/Connector.svelte +0 -149
- package/dist/components/Connector.svelte.d.ts +0 -51
- package/dist/components/ForceSimulation.svelte.d.ts +0 -84
- package/dist/components/GeoContext.svelte +0 -176
- package/dist/components/GeoContext.svelte.d.ts +0 -52
- package/dist/components/GeoPath.svelte +0 -197
- package/dist/components/GeoPoint.svelte +0 -74
- package/dist/components/GeoSpline.svelte +0 -85
- package/dist/components/TransformControls.svelte +0 -179
- package/dist/components/TransformControls.svelte.d.ts +0 -28
- package/dist/components/Treemap.svelte +0 -165
- package/dist/components/charts/utils.svelte.d.ts +0 -30
- package/dist/components/charts/utils.svelte.js +0 -59
- package/dist/components/layout/Canvas.svelte +0 -505
- package/dist/components/layout/Layer.svelte +0 -39
- package/dist/components/layout/Layer.svelte.d.ts +0 -17
- package/dist/components/tooltip/tooltipMetaContext.d.ts +0 -79
- package/dist/components/tooltip/tooltipMetaContext.js +0 -139
- package/dist/docs/Blockquote.svelte +0 -15
- package/dist/docs/Code.svelte +0 -38
- package/dist/docs/Code.svelte.d.ts +0 -29
- package/dist/docs/ConnectorSweepMenuField.svelte +0 -17
- package/dist/docs/ConnectorSweepMenuField.svelte.d.ts +0 -7
- package/dist/docs/ConnectorTypeMenuField.svelte +0 -17
- package/dist/docs/ConnectorTypeMenuField.svelte.d.ts +0 -7
- package/dist/docs/CurveMenuField.svelte +0 -44
- package/dist/docs/CurveMenuField.svelte.d.ts +0 -9
- package/dist/docs/GeoDebug.svelte +0 -60
- package/dist/docs/GeoDebug.svelte.d.ts +0 -4
- package/dist/docs/Header1.svelte +0 -14
- package/dist/docs/Header1.svelte.d.ts +0 -29
- package/dist/docs/Json.svelte +0 -28
- package/dist/docs/Layout.svelte +0 -18
- package/dist/docs/Layout.svelte.d.ts +0 -23
- package/dist/docs/Link.svelte +0 -5
- package/dist/docs/Link.svelte.d.ts +0 -39
- package/dist/docs/PathDataMenuField.svelte +0 -78
- package/dist/docs/PathDataMenuField.svelte.d.ts +0 -9
- package/dist/docs/Preview.svelte +0 -105
- package/dist/docs/Preview.svelte.d.ts +0 -14
- package/dist/docs/TilesetField.svelte +0 -135
- package/dist/docs/TilesetField.svelte.d.ts +0 -23
- package/dist/docs/TransformDebug.svelte +0 -22
- package/dist/docs/TransformDebug.svelte.d.ts +0 -20
- package/dist/docs/ViewSourceButton.svelte +0 -50
- package/dist/docs/ViewSourceButton.svelte.d.ts +0 -25
- package/dist/utils/connectorUtils.d.ts +0 -21
- package/dist/utils/connectorUtils.js +0 -111
- package/dist/utils/graph/dagre.d.ts +0 -34
- package/dist/utils/object.js +0 -2
- /package/dist/components/{GeoVisible.svelte.d.ts → geo/GeoVisible.svelte.d.ts} +0 -0
- /package/dist/components/{Dagre.svelte.d.ts → graph/Dagre.svelte.d.ts} +0 -0
- /package/dist/components/{Sankey.svelte.d.ts → graph/Sankey.svelte.d.ts} +0 -0
- /package/dist/{utils → contexts}/legendPayload.d.ts +0 -0
- /package/dist/{utils → contexts}/legendPayload.js +0 -0
|
@@ -1,47 +1,40 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type AnyScale,
|
|
12
|
-
type DomainType,
|
|
13
|
-
} from '../utils/scales.svelte.js';
|
|
14
|
-
import { Context, useDebounce } from 'runed';
|
|
2
|
+
import { type ComponentProps, type Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
import type { TimeInterval } from 'd3-time';
|
|
5
|
+
import type { HierarchyNode } from 'd3-hierarchy';
|
|
6
|
+
import type { SankeyGraph } from 'd3-sankey';
|
|
7
|
+
|
|
8
|
+
import { getObjectOrNull, type Accessor } from '../utils/common.js';
|
|
9
|
+
import type { MotionProp } from '../utils/motion.svelte.js';
|
|
10
|
+
import { type AnyScale, type DomainType, isScaleBand } from '../utils/scales.svelte.js';
|
|
15
11
|
import type {
|
|
16
|
-
AxisKey,
|
|
17
12
|
BaseRange,
|
|
18
|
-
DataType,
|
|
19
|
-
Extents,
|
|
20
13
|
Nice,
|
|
21
|
-
Padding,
|
|
22
14
|
PaddingArray,
|
|
15
|
+
Without,
|
|
23
16
|
XRangeWithScale,
|
|
24
17
|
YRangeWithScale,
|
|
25
18
|
} from '../utils/types.js';
|
|
19
|
+
import type { GeoStateProps } from '../states/geo.svelte.js';
|
|
20
|
+
import TooltipContext from './tooltip/TooltipContext.svelte';
|
|
21
|
+
|
|
22
|
+
import TransformContext from './TransformContext.svelte';
|
|
23
|
+
// BrushContext (used only when `brush` prop is set) is lazy-loaded inline
|
|
24
|
+
// via `{#await import(...)}` so non-brush charts don't pay for it.
|
|
25
|
+
import type BrushContext from './BrushContext.svelte';
|
|
26
26
|
import {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
import {
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import { extent, max, min } from 'd3-array';
|
|
36
|
-
import type { HierarchyNode } from 'd3-hierarchy';
|
|
37
|
-
import type { SankeyGraph } from 'd3-sankey';
|
|
38
|
-
import { unique } from '@layerstack/utils';
|
|
39
|
-
import { geoFitObjectTransform } from '../utils/geo.js';
|
|
40
|
-
import TransformContext, { type TransformContextValue } from './TransformContext.svelte';
|
|
41
|
-
import BrushContext, { type BrushContextValue } from './BrushContext.svelte';
|
|
42
|
-
import { layerClass } from '../utils/attributes.js';
|
|
27
|
+
type BrushDomainType,
|
|
28
|
+
type BrushState,
|
|
29
|
+
expandBandBrushDomain,
|
|
30
|
+
} from '../states/brush.svelte.js';
|
|
31
|
+
|
|
32
|
+
import { setChartContext } from '../contexts/chart.js';
|
|
33
|
+
import { ChartState } from '../states/chart.svelte.js';
|
|
34
|
+
import type { StackLayout } from '../states/series.svelte.js';
|
|
43
35
|
|
|
44
|
-
|
|
36
|
+
import type { ChartChildrenProps } from './ChartChildren.svelte';
|
|
37
|
+
import type { SeriesData } from './charts/types.js';
|
|
45
38
|
|
|
46
39
|
export type ChartResizeDetail = {
|
|
47
40
|
width: number;
|
|
@@ -79,83 +72,6 @@
|
|
|
79
72
|
| 'y1Range'
|
|
80
73
|
>;
|
|
81
74
|
|
|
82
|
-
export type ChartContextValue<
|
|
83
|
-
T = any,
|
|
84
|
-
XScale extends AnyScale = AnyScale,
|
|
85
|
-
YScale extends AnyScale = AnyScale,
|
|
86
|
-
> = {
|
|
87
|
-
activeGetters: Record<AxisKey, (d: T) => any>;
|
|
88
|
-
width: number;
|
|
89
|
-
height: number;
|
|
90
|
-
percentRange: boolean;
|
|
91
|
-
aspectRatio: number;
|
|
92
|
-
containerRef: HTMLElement | undefined;
|
|
93
|
-
containerWidth: number;
|
|
94
|
-
containerHeight: number;
|
|
95
|
-
config: PreservedChartConfig<T, XScale, YScale>;
|
|
96
|
-
x: (d: T) => any;
|
|
97
|
-
y: (d: T) => any;
|
|
98
|
-
z: (d: T) => any;
|
|
99
|
-
r: (d: T) => any;
|
|
100
|
-
x1: (d: T) => any;
|
|
101
|
-
y1: (d: T) => any;
|
|
102
|
-
c: (d: T) => any;
|
|
103
|
-
data: DataType<T>;
|
|
104
|
-
xNice: Nice;
|
|
105
|
-
yNice: Nice;
|
|
106
|
-
zNice: Nice;
|
|
107
|
-
rNice: Nice;
|
|
108
|
-
xDomainSort: boolean;
|
|
109
|
-
yDomainSort: boolean;
|
|
110
|
-
zDomainSort: boolean;
|
|
111
|
-
rDomainSort: boolean;
|
|
112
|
-
xReverse: boolean;
|
|
113
|
-
yReverse: boolean;
|
|
114
|
-
zReverse: boolean;
|
|
115
|
-
rReverse: boolean;
|
|
116
|
-
xPadding: PaddingArray;
|
|
117
|
-
yPadding: PaddingArray;
|
|
118
|
-
zPadding: PaddingArray;
|
|
119
|
-
rPadding: PaddingArray;
|
|
120
|
-
padding: Padding;
|
|
121
|
-
flatData: T[];
|
|
122
|
-
extents: Extents;
|
|
123
|
-
xDomain: number[];
|
|
124
|
-
yDomain: number[];
|
|
125
|
-
zDomain: DomainType;
|
|
126
|
-
rDomain: DomainType;
|
|
127
|
-
cDomain: DomainType;
|
|
128
|
-
x1Domain: DomainType;
|
|
129
|
-
y1Domain: DomainType;
|
|
130
|
-
xRange: any[];
|
|
131
|
-
yRange: any[];
|
|
132
|
-
zRange: any[];
|
|
133
|
-
rRange: any[];
|
|
134
|
-
cRange: readonly string[] | string[] | undefined;
|
|
135
|
-
x1Range: XRangeWithScale<XScale> | undefined;
|
|
136
|
-
y1Range: YRangeWithScale<YScale> | undefined;
|
|
137
|
-
meta: Record<string, any>;
|
|
138
|
-
xScale: AnyScale;
|
|
139
|
-
yScale: AnyScale;
|
|
140
|
-
zScale: AnyScale;
|
|
141
|
-
rScale: AnyScale;
|
|
142
|
-
cScale: AnyScale | null;
|
|
143
|
-
x1Scale: AnyScale | null;
|
|
144
|
-
y1Scale: AnyScale | null;
|
|
145
|
-
yGet: (d: T) => any;
|
|
146
|
-
xGet: (d: T) => any;
|
|
147
|
-
zGet: (d: T) => any;
|
|
148
|
-
rGet: (d: T) => any;
|
|
149
|
-
cGet: (d: T) => any;
|
|
150
|
-
x1Get: (d: T) => any;
|
|
151
|
-
y1Get: (d: T) => any;
|
|
152
|
-
radial: boolean;
|
|
153
|
-
tooltip: TooltipContextValue<T>;
|
|
154
|
-
geo: GeoContextValue;
|
|
155
|
-
brush: BrushContextValue;
|
|
156
|
-
transform: TransformContextValue;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
75
|
export type LayerChartInternalMeta = {
|
|
160
76
|
/**
|
|
161
77
|
* The current chart type.
|
|
@@ -171,37 +87,6 @@
|
|
|
171
87
|
| 'simplified-scatter';
|
|
172
88
|
};
|
|
173
89
|
|
|
174
|
-
const _ChartContext = new Context<ChartContextValue<any, AnyScale, AnyScale>>('ChartContext');
|
|
175
|
-
|
|
176
|
-
export function getChartContext<
|
|
177
|
-
T,
|
|
178
|
-
XScale extends AnyScale = AnyScale,
|
|
179
|
-
YScale extends AnyScale = AnyScale,
|
|
180
|
-
>(): ChartContextValue<T, XScale, YScale> {
|
|
181
|
-
return _ChartContext.getOr({} as ChartContextValue<T, XScale, YScale>);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export function setChartContext<
|
|
185
|
-
T,
|
|
186
|
-
XScale extends AnyScale = AnyScale,
|
|
187
|
-
YScale extends AnyScale = AnyScale,
|
|
188
|
-
>(context: ChartContextValue<T, XScale, YScale>): ChartContextValue<T, XScale, YScale> {
|
|
189
|
-
// @ts-expect-error - shh
|
|
190
|
-
return _ChartContext.set(context);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export type RenderContext = 'svg' | 'canvas' | 'html';
|
|
194
|
-
|
|
195
|
-
const _RenderContext = new Context<RenderContext>('RenderContext');
|
|
196
|
-
|
|
197
|
-
export function getRenderContext(): RenderContext {
|
|
198
|
-
return _RenderContext.get();
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
export function setRenderContext(context: RenderContext): RenderContext {
|
|
202
|
-
return _RenderContext.set(context);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
90
|
export type ChartPropsWithoutHTML<
|
|
206
91
|
T,
|
|
207
92
|
XScale extends AnyScale = AnyScale,
|
|
@@ -417,21 +302,21 @@
|
|
|
417
302
|
/**
|
|
418
303
|
* The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if
|
|
419
304
|
* you want to override the default or you want to extra options.
|
|
420
|
-
* @default
|
|
305
|
+
* @default autoScale
|
|
421
306
|
*/
|
|
422
307
|
xScale?: XScale;
|
|
423
308
|
|
|
424
309
|
/**
|
|
425
310
|
* The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if
|
|
426
311
|
* you want to override the default or you want to extra options.
|
|
427
|
-
* @default
|
|
312
|
+
* @default autoScale
|
|
428
313
|
*/
|
|
429
314
|
yScale?: YScale;
|
|
430
315
|
|
|
431
316
|
/**
|
|
432
317
|
* The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if
|
|
433
318
|
* you want to override the default or you want to extra options.
|
|
434
|
-
* @default
|
|
319
|
+
* @default autoScale
|
|
435
320
|
*/
|
|
436
321
|
zScale?: AnyScale;
|
|
437
322
|
|
|
@@ -445,14 +330,14 @@
|
|
|
445
330
|
/**
|
|
446
331
|
* The D3 scale that should be used for the x1-dimension. Pass in an instantiated D3 scale if
|
|
447
332
|
* you want to override the default or you want to extra options.
|
|
448
|
-
* @default
|
|
333
|
+
* @default autoScale
|
|
449
334
|
*/
|
|
450
335
|
x1Scale?: AnyScale;
|
|
451
336
|
|
|
452
337
|
/**
|
|
453
338
|
* The D3 scale that should be used for the y1-dimension. Pass in an instantiated D3 scale if
|
|
454
339
|
* you want to override the default or you want to extra options.
|
|
455
|
-
* @default
|
|
340
|
+
* @default autoScale
|
|
456
341
|
*/
|
|
457
342
|
y1Scale?: AnyScale;
|
|
458
343
|
|
|
@@ -640,7 +525,22 @@
|
|
|
640
525
|
*/
|
|
641
526
|
yBaseline?: number | null;
|
|
642
527
|
|
|
643
|
-
|
|
528
|
+
/**
|
|
529
|
+
* Time interval to use for the x-axis when using a time scale.
|
|
530
|
+
*/
|
|
531
|
+
xInterval?: TimeInterval | null;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Time interval to use for the y-axis when using a time scale.
|
|
535
|
+
*/
|
|
536
|
+
yInterval?: TimeInterval | null;
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* The axis that represents the value dimension, typically based on the type and orientation of the chart
|
|
540
|
+
*
|
|
541
|
+
* @default 'y'
|
|
542
|
+
*/
|
|
543
|
+
valueAxis?: 'x' | 'y';
|
|
644
544
|
|
|
645
545
|
/**
|
|
646
546
|
* Use radial instead of cartesian coordinates, mapping `x` to `angle` and `y`` to radial.
|
|
@@ -651,726 +551,643 @@
|
|
|
651
551
|
*/
|
|
652
552
|
radial?: boolean;
|
|
653
553
|
|
|
654
|
-
children?: Snippet<[{ context:
|
|
554
|
+
children?: Snippet<[{ context: ChartState<T, XScale, YScale> }]>;
|
|
655
555
|
|
|
656
556
|
/**
|
|
657
557
|
* A bindable reference to the chart context.
|
|
658
558
|
*/
|
|
659
|
-
context?:
|
|
559
|
+
context?: ChartState<T, XScale, YScale>;
|
|
660
560
|
|
|
661
561
|
/**
|
|
662
|
-
* Props passed to
|
|
562
|
+
* Props passed to GeoState
|
|
663
563
|
*/
|
|
664
|
-
geo?: Partial<
|
|
564
|
+
geo?: Partial<GeoStateProps>;
|
|
665
565
|
|
|
666
566
|
/**
|
|
667
567
|
* Props passed to the `TooltipContext` component.
|
|
668
568
|
*/
|
|
669
|
-
|
|
569
|
+
tooltipContext?: Partial<ComponentProps<typeof TooltipContext>> | boolean;
|
|
670
570
|
|
|
671
571
|
/**
|
|
672
|
-
* Props passed to TransformContext
|
|
673
|
-
*/
|
|
674
|
-
transform?: Partial<ComponentProps<typeof TransformContext
|
|
572
|
+
* Props passed to TransformContext, with optional domain-space constraints.
|
|
573
|
+
*/
|
|
574
|
+
transform?: Partial<ComponentProps<typeof TransformContext>> & {
|
|
575
|
+
/**
|
|
576
|
+
* Controls which projection properties are updated by transform state in `mode: 'projection'`.
|
|
577
|
+
* Auto-detected from the projection type when not specified:
|
|
578
|
+
* - Globe projections (e.g. `geoOrthographic`): `{ rotation: true, scale: false, translate: false }`
|
|
579
|
+
* - Flat maps (e.g. `geoMercator`): `{ rotation: false, scale: true, translate: true }`
|
|
580
|
+
*
|
|
581
|
+
* `rotation` and `translate` are mutually exclusive.
|
|
582
|
+
*/
|
|
583
|
+
apply?: {
|
|
584
|
+
/** Apply transform translate as projection rotation (yaw/pitch). */
|
|
585
|
+
rotation?: boolean;
|
|
586
|
+
/** Apply transform scale to projection scale. */
|
|
587
|
+
scale?: boolean;
|
|
588
|
+
/** Apply transform translate to projection translate. */
|
|
589
|
+
translate?: boolean;
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Domain-space constraints for pan/zoom in `mode: 'domain'`.
|
|
594
|
+
* Expressed in data units (numbers, Dates) rather than pixel-space.
|
|
595
|
+
* Converted internally to a `constrain` function on TransformState.
|
|
596
|
+
*/
|
|
597
|
+
domainExtent?: {
|
|
598
|
+
x?: {
|
|
599
|
+
/** Minimum domain value. `'data'` = initial data bounds. */
|
|
600
|
+
min?: number | Date | 'data';
|
|
601
|
+
/** Maximum domain value. `'data'` = initial data bounds. */
|
|
602
|
+
max?: number | Date | 'data';
|
|
603
|
+
/** Minimum visible range (max zoom in). In data units (e.g., ms for dates). */
|
|
604
|
+
minRange?: number;
|
|
605
|
+
};
|
|
606
|
+
y?: {
|
|
607
|
+
min?: number | Date | 'data';
|
|
608
|
+
max?: number | Date | 'data';
|
|
609
|
+
minRange?: number;
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
};
|
|
675
613
|
|
|
676
614
|
/** Props passed to BrushContext */
|
|
677
|
-
brush?:
|
|
615
|
+
brush?:
|
|
616
|
+
| (Partial<ComponentProps<typeof BrushContext>> & {
|
|
617
|
+
/**
|
|
618
|
+
* Zoom the chart domain to the brushed area on brush end.
|
|
619
|
+
*
|
|
620
|
+
* @default false
|
|
621
|
+
*/
|
|
622
|
+
zoomOnBrush?: boolean;
|
|
623
|
+
})
|
|
624
|
+
| boolean;
|
|
625
|
+
|
|
626
|
+
/** Series definitions for multi-series charts */
|
|
627
|
+
series?: SeriesData<T, any>[];
|
|
628
|
+
|
|
629
|
+
/** Layout mode for series: 'overlap', 'group', 'stack', 'stackExpand', 'stackDiverging' */
|
|
630
|
+
seriesLayout?: StackLayout | 'group';
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Padding between primary bands (e.g. bars), applied to the category axis scaleBand().padding().
|
|
634
|
+
* When set, the category axis (opposite of valueAxis) automatically uses a scaleBand with this padding.
|
|
635
|
+
*/
|
|
636
|
+
bandPadding?: number;
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Padding between group/series items when using seriesLayout="group", applied to the x1/y1 scaleBand().padding().
|
|
640
|
+
* @default 0
|
|
641
|
+
*/
|
|
642
|
+
groupPadding?: number;
|
|
678
643
|
|
|
679
644
|
/**
|
|
680
645
|
* A callback function that is called when the chart is resized.
|
|
681
646
|
*/
|
|
682
647
|
onResize?: (e: ChartResizeDetail) => void;
|
|
683
648
|
|
|
649
|
+
/**
|
|
650
|
+
* Whether to clip overflow content.
|
|
651
|
+
* When true, sets `overflow: hidden` on the container.
|
|
652
|
+
*
|
|
653
|
+
* @default false
|
|
654
|
+
*/
|
|
655
|
+
clip?: boolean;
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Animate scale domain transitions with spring or tween motion.
|
|
659
|
+
* Applies to all domain changes (data updates, brush zoom, transform, etc.)
|
|
660
|
+
*/
|
|
661
|
+
motion?: MotionProp;
|
|
662
|
+
|
|
684
663
|
// TransformContext callback events
|
|
685
664
|
ondragstart?: ComponentProps<typeof TransformContext>['ondragstart'];
|
|
686
665
|
ondragend?: ComponentProps<typeof TransformContext>['ondragend'];
|
|
687
666
|
onTransform?: ComponentProps<typeof TransformContext>['onTransform'];
|
|
688
|
-
|
|
667
|
+
|
|
668
|
+
/** Sets width of the chart container. Uses parent width if not set (bind:clientWidth) */
|
|
669
|
+
width?: number;
|
|
670
|
+
|
|
671
|
+
/** Sets height of the chart container. Uses parent height if not set (bind:clientHeight) */
|
|
672
|
+
height?: number;
|
|
673
|
+
} & ChartChildrenProps<T, XScale, YScale>;
|
|
674
|
+
|
|
675
|
+
export type ChartProps<
|
|
676
|
+
T,
|
|
677
|
+
XScale extends AnyScale = AnyScale,
|
|
678
|
+
YScale extends AnyScale = AnyScale,
|
|
679
|
+
> = ChartPropsWithoutHTML<T, XScale, YScale> &
|
|
680
|
+
Without<HTMLAttributes<HTMLDivElement>, ChartPropsWithoutHTML<T, XScale, YScale>>;
|
|
689
681
|
</script>
|
|
690
682
|
|
|
691
683
|
<script
|
|
692
684
|
lang="ts"
|
|
693
685
|
generics="TData = any, XScale extends AnyScale = AnyScale, YScale extends AnyScale = AnyScale"
|
|
694
686
|
>
|
|
687
|
+
import { setGeoContext } from '../contexts/geo.js';
|
|
688
|
+
import { getSettings } from '../contexts/settings.js';
|
|
689
|
+
import ChartChildren from './ChartChildren.svelte';
|
|
690
|
+
|
|
691
|
+
let {
|
|
692
|
+
ref: refProp = $bindable(),
|
|
693
|
+
context: contextProp = $bindable(),
|
|
694
|
+
...props
|
|
695
|
+
}: ChartProps<TData, XScale, YScale> = $props();
|
|
696
|
+
|
|
695
697
|
let {
|
|
696
698
|
ssr = false,
|
|
697
699
|
pointerEvents = true,
|
|
700
|
+
width,
|
|
701
|
+
height,
|
|
698
702
|
position = 'relative',
|
|
699
|
-
|
|
700
|
-
ref: refProp = $bindable(),
|
|
701
|
-
x: xProp,
|
|
702
|
-
y: yProp,
|
|
703
|
-
z: zProp,
|
|
704
|
-
r: rProp,
|
|
705
|
-
data = [],
|
|
706
|
-
xDomain: xDomainProp,
|
|
707
|
-
yDomain: yDomainProp,
|
|
708
|
-
zDomain: zDomainProp,
|
|
709
|
-
rDomain: rDomainProp,
|
|
710
|
-
xNice = false,
|
|
711
|
-
yNice = false,
|
|
712
|
-
zNice = false,
|
|
713
|
-
rNice = false,
|
|
714
|
-
xPadding,
|
|
715
|
-
yPadding,
|
|
716
|
-
zPadding,
|
|
717
|
-
rPadding,
|
|
718
|
-
// @ts-expect-error shh
|
|
719
|
-
xScale: xScaleProp = scaleLinear(),
|
|
720
|
-
// @ts-expect-error shh
|
|
721
|
-
yScale: yScaleProp = scaleLinear(),
|
|
722
|
-
zScale: zScaleProp = scaleLinear(),
|
|
723
|
-
rScale: rScaleProp = scaleSqrt(),
|
|
724
|
-
flatData: flatDataProp,
|
|
725
|
-
padding: paddingProp = {},
|
|
726
|
-
verbose = true,
|
|
727
|
-
debug = false,
|
|
728
|
-
extents: extentsProp = {},
|
|
729
|
-
xDomainSort = false,
|
|
730
|
-
yDomainSort = false,
|
|
731
|
-
zDomainSort = false,
|
|
732
|
-
rDomainSort = false,
|
|
733
|
-
xReverse = false,
|
|
734
|
-
zReverse = false,
|
|
735
|
-
rReverse = false,
|
|
736
|
-
yRange: _yRangeProp,
|
|
737
|
-
zRange: zRangeProp,
|
|
738
|
-
rRange: rRangeProp,
|
|
739
|
-
xBaseline = null,
|
|
740
|
-
yBaseline = null,
|
|
741
|
-
meta = {},
|
|
742
|
-
children: _children,
|
|
743
|
-
radial = false,
|
|
744
|
-
xRange: _xRangeProp,
|
|
745
|
-
x1: x1Prop,
|
|
746
|
-
x1Domain: x1DomainProp,
|
|
747
|
-
x1Range: x1RangeProp,
|
|
748
|
-
x1Scale: x1ScaleProp,
|
|
749
|
-
y1: y1Prop,
|
|
750
|
-
y1Domain: y1DomainProp,
|
|
751
|
-
y1Range: y1RangeProp,
|
|
752
|
-
y1Scale: y1ScaleProp,
|
|
753
|
-
c: cProp,
|
|
754
|
-
cScale: cScaleProp,
|
|
755
|
-
cDomain: cDomainProp,
|
|
756
|
-
cRange: cRangeProp,
|
|
757
|
-
onResize,
|
|
703
|
+
children,
|
|
758
704
|
geo,
|
|
759
|
-
|
|
760
|
-
tooltip,
|
|
705
|
+
tooltipContext,
|
|
761
706
|
transform,
|
|
762
707
|
onTransform,
|
|
763
708
|
ondragend,
|
|
764
709
|
ondragstart,
|
|
765
710
|
brush,
|
|
766
|
-
|
|
711
|
+
motion,
|
|
712
|
+
debug = false,
|
|
713
|
+
clip = false,
|
|
714
|
+
onTooltipClick,
|
|
715
|
+
class: className,
|
|
716
|
+
...restProps
|
|
717
|
+
} = $derived(props);
|
|
718
|
+
|
|
719
|
+
let brushXDomain = $state<BrushDomainType>();
|
|
720
|
+
let brushYDomain = $state<BrushDomainType>();
|
|
721
|
+
|
|
722
|
+
const chartState = new ChartState<TData, XScale, YScale>(() => ({
|
|
723
|
+
ref: refProp,
|
|
724
|
+
context: contextProp,
|
|
725
|
+
...props,
|
|
726
|
+
xDomain: brushXDomain ?? props.xDomain,
|
|
727
|
+
yDomain: brushYDomain ?? props.yDomain,
|
|
728
|
+
}));
|
|
767
729
|
|
|
768
730
|
let ref = $state<HTMLElement>();
|
|
769
|
-
|
|
770
731
|
$effect.pre(() => {
|
|
771
732
|
refProp = ref;
|
|
733
|
+
chartState.containerRef = ref;
|
|
772
734
|
});
|
|
773
735
|
|
|
774
|
-
|
|
736
|
+
// Update bindable
|
|
737
|
+
contextProp = chartState;
|
|
775
738
|
|
|
776
|
-
|
|
777
|
-
|
|
739
|
+
setChartContext(chartState);
|
|
740
|
+
setGeoContext(chartState.geoState);
|
|
778
741
|
|
|
779
|
-
const
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
if (xDomainProp !== undefined) return xDomainProp;
|
|
783
|
-
if (xBaseline != null && Array.isArray(data)) {
|
|
784
|
-
const xValues = data.flatMap(accessor(xProp));
|
|
785
|
-
return [min([xBaseline, ...xValues]), max([xBaseline, ...xValues])];
|
|
786
|
-
}
|
|
742
|
+
const settings = getSettings();
|
|
743
|
+
$effect(() => {
|
|
744
|
+
settings.debug = debug;
|
|
787
745
|
});
|
|
788
746
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
if (
|
|
792
|
-
|
|
793
|
-
return [min([yBaseline, ...yValues]), max([yBaseline, ...yValues])];
|
|
794
|
-
}
|
|
795
|
-
});
|
|
747
|
+
// Resolve which projection properties the transform state applies to
|
|
748
|
+
const resolvedApply = $derived.by(() => {
|
|
749
|
+
if (transform?.mode !== 'projection')
|
|
750
|
+
return { rotation: false, scale: false, translate: false };
|
|
796
751
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
const x = $derived(makeAccessor(xProp));
|
|
804
|
-
const y = $derived(makeAccessor(yProp));
|
|
805
|
-
const z = $derived(makeAccessor(zProp));
|
|
806
|
-
const r = $derived(makeAccessor(rProp));
|
|
807
|
-
const c = $derived(accessor(cProp));
|
|
808
|
-
const x1 = $derived(accessor(x1Prop));
|
|
809
|
-
const y1 = $derived(accessor(y1Prop));
|
|
752
|
+
// Auto-detect globe projections from clipAngle (flat projections return 0, globes return > 0)
|
|
753
|
+
let isGlobe = false;
|
|
754
|
+
if (geo?.projection) {
|
|
755
|
+
const proj = geo.projection();
|
|
756
|
+
isGlobe = (proj.clipAngle?.() ?? 0) > 0;
|
|
757
|
+
}
|
|
810
758
|
|
|
811
|
-
|
|
759
|
+
const defaults = isGlobe
|
|
760
|
+
? { rotation: true, scale: true, translate: false }
|
|
761
|
+
: { rotation: false, scale: true, translate: true };
|
|
812
762
|
|
|
813
|
-
|
|
763
|
+
// User overrides win; enforce mutual exclusion
|
|
764
|
+
const result = { ...defaults, ...transform?.apply };
|
|
765
|
+
if (transform?.apply?.rotation === true && transform?.apply?.translate == null) {
|
|
766
|
+
result.translate = false;
|
|
767
|
+
}
|
|
768
|
+
if (transform?.apply?.translate === true && transform?.apply?.rotation == null) {
|
|
769
|
+
result.rotation = false;
|
|
770
|
+
}
|
|
814
771
|
|
|
815
|
-
|
|
816
|
-
x,
|
|
817
|
-
y,
|
|
818
|
-
z,
|
|
819
|
-
r,
|
|
772
|
+
return result;
|
|
820
773
|
});
|
|
821
774
|
|
|
822
|
-
|
|
823
|
-
if (
|
|
824
|
-
|
|
825
|
-
...defaultPadding,
|
|
826
|
-
top: paddingProp,
|
|
827
|
-
right: paddingProp,
|
|
828
|
-
bottom: paddingProp,
|
|
829
|
-
left: paddingProp,
|
|
830
|
-
};
|
|
775
|
+
$effect.pre(() => {
|
|
776
|
+
if (chartState.geoState) {
|
|
777
|
+
chartState.geoState.transformApply = resolvedApply;
|
|
831
778
|
}
|
|
832
|
-
return { ...defaultPadding, ...paddingProp };
|
|
833
779
|
});
|
|
834
780
|
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
const height = bottom - top;
|
|
844
|
-
if (verbose === true) {
|
|
845
|
-
if (width <= 0 && isMounted === true) {
|
|
846
|
-
console.warn(
|
|
847
|
-
'[LayerChart] Target div has zero or negative width. Did you forget to set an explicit width in CSS on the container?'
|
|
848
|
-
);
|
|
849
|
-
}
|
|
850
|
-
if (height <= 0 && isMounted === true) {
|
|
851
|
-
console.warn(
|
|
852
|
-
'[LayerChart] Target div has zero or negative height. Did you forget to set an explicit height in CSS on the container?'
|
|
853
|
-
);
|
|
854
|
-
}
|
|
781
|
+
const initialTransform = $derived.by(() => {
|
|
782
|
+
if (
|
|
783
|
+
transform?.mode !== 'projection' ||
|
|
784
|
+
!(resolvedApply.translate || resolvedApply.scale) ||
|
|
785
|
+
!geo?.fitGeojson ||
|
|
786
|
+
!geo?.projection
|
|
787
|
+
) {
|
|
788
|
+
return undefined;
|
|
855
789
|
}
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
right,
|
|
862
|
-
width,
|
|
863
|
-
height,
|
|
864
|
-
};
|
|
790
|
+
// Inlined to avoid pulling `$lib/utils/geo.js` (and its d3-geo imports)
|
|
791
|
+
// into Chart's static graph for non-geo charts.
|
|
792
|
+
const fitted = geo.projection().fitSize([chartState.width, chartState.height], geo.fitGeojson);
|
|
793
|
+
const t = fitted.translate();
|
|
794
|
+
return { translate: { x: t[0], y: t[1] }, scale: fitted.scale() };
|
|
865
795
|
});
|
|
866
796
|
|
|
867
|
-
const
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
* in as a domain, which can be a partial domain
|
|
880
|
-
*/
|
|
881
|
-
const extents: Extents = $derived.by(() => {
|
|
882
|
-
const scaleLookup: Record<string, ScaleEntry> = {
|
|
883
|
-
x: { scale: xScaleProp, sort: xDomainSort },
|
|
884
|
-
y: { scale: yScaleProp, sort: yDomainSort },
|
|
885
|
-
z: { scale: zScaleProp, sort: zDomainSort },
|
|
886
|
-
r: { scale: rScaleProp, sort: rDomainSort },
|
|
887
|
-
};
|
|
888
|
-
|
|
889
|
-
const getters = filterObject(activeGetters, filteredExtents);
|
|
890
|
-
const activeScales: Record<string, ScaleEntry> = Object.fromEntries(
|
|
891
|
-
Object.keys(getters).map((k) => [k, scaleLookup[k]])
|
|
892
|
-
);
|
|
893
|
-
|
|
894
|
-
if (Object.keys(getters).length > 0) {
|
|
895
|
-
const calculatedExtents = calcScaleExtents(flatData, getters, activeScales);
|
|
896
|
-
return { ...calculatedExtents, ...filteredExtents };
|
|
897
|
-
} else {
|
|
898
|
-
return {};
|
|
797
|
+
const processTranslate = $derived.by(() => {
|
|
798
|
+
if (resolvedApply.rotation && chartState.geoState?.projection) {
|
|
799
|
+
return (x: number, y: number, deltaX: number, deltaY: number) => {
|
|
800
|
+
// When applying transform as rotation, invert `y` values and reduce sensitivity based on projection scale
|
|
801
|
+
// see: https://observablehq.com/@benoldenburg/simple-globe and https://observablehq.com/@michael-keith/draggable-globe-in-d3
|
|
802
|
+
const projectionScale = chartState.geoState.projection!.scale() ?? 0;
|
|
803
|
+
const sensitivity = 75;
|
|
804
|
+
return {
|
|
805
|
+
x: x + deltaX * (sensitivity / projectionScale),
|
|
806
|
+
y: y + deltaY * (sensitivity / projectionScale) * -1,
|
|
807
|
+
};
|
|
808
|
+
};
|
|
899
809
|
}
|
|
810
|
+
return undefined;
|
|
900
811
|
});
|
|
901
812
|
|
|
902
|
-
|
|
903
|
-
const
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
height,
|
|
924
|
-
width,
|
|
925
|
-
extents: snappedExtents,
|
|
926
|
-
})
|
|
927
|
-
);
|
|
928
|
-
|
|
929
|
-
const xGet = $derived(createGetter(x, xScale));
|
|
930
|
-
|
|
931
|
-
const yScale = $derived(
|
|
932
|
-
createChartScale('y', {
|
|
933
|
-
scale: yScaleProp,
|
|
934
|
-
domain: yDomain,
|
|
935
|
-
padding: yPadding,
|
|
936
|
-
nice: yNice,
|
|
937
|
-
reverse: yReverse,
|
|
938
|
-
percentRange,
|
|
939
|
-
range: yRangeProp,
|
|
940
|
-
height,
|
|
941
|
-
width,
|
|
942
|
-
extents: filteredExtents,
|
|
943
|
-
})
|
|
944
|
-
);
|
|
813
|
+
// Convert domainExtent to a constrain function on TransformState
|
|
814
|
+
const domainExtentConstrain = $derived.by(() => {
|
|
815
|
+
const de = transform?.domainExtent;
|
|
816
|
+
if (!de) return undefined;
|
|
817
|
+
|
|
818
|
+
return (t: { scale: number; translate: { x: number; y: number } }) => {
|
|
819
|
+
let { scale, translate } = t;
|
|
820
|
+
|
|
821
|
+
// Helper to resolve 'data' to base domain values
|
|
822
|
+
const resolveValue = (
|
|
823
|
+
val: number | Date | 'data' | undefined,
|
|
824
|
+
baseDomainValue: unknown
|
|
825
|
+
): number | undefined => {
|
|
826
|
+
if (val === undefined) return undefined;
|
|
827
|
+
if (val === 'data') {
|
|
828
|
+
if (baseDomainValue instanceof Date) return baseDomainValue.getTime();
|
|
829
|
+
return baseDomainValue as number;
|
|
830
|
+
}
|
|
831
|
+
if (val instanceof Date) return val.getTime();
|
|
832
|
+
return val;
|
|
833
|
+
};
|
|
945
834
|
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
835
|
+
// Constrain a single axis. Normalizes reversed domains (e.g. [500, 0])
|
|
836
|
+
// to ascending order, applies constraints, then maps back.
|
|
837
|
+
const constrainAxis = (
|
|
838
|
+
axisTranslate: number,
|
|
839
|
+
axisScale: number,
|
|
840
|
+
dimension: number,
|
|
841
|
+
baseDomain: number[],
|
|
842
|
+
extent:
|
|
843
|
+
| { min?: number | Date | 'data'; max?: number | Date | 'data'; minRange?: number }
|
|
844
|
+
| undefined
|
|
845
|
+
): number => {
|
|
846
|
+
if (!extent || baseDomain.length < 2 || dimension <= 0) return axisTranslate;
|
|
847
|
+
|
|
848
|
+
const d0 = baseDomain[0] as unknown;
|
|
849
|
+
const d1 = baseDomain[1] as unknown;
|
|
850
|
+
|
|
851
|
+
// Skip domain extent constraint for categorical scales (range clamping handles boundaries)
|
|
852
|
+
if (typeof d0 === 'string') return axisTranslate;
|
|
853
|
+
const isDate = d0 instanceof Date;
|
|
854
|
+
const rawD0 = isDate ? (d0 as Date).getTime() : (d0 as number);
|
|
855
|
+
const rawD1 = isDate ? (d1 as Date).getTime() : (d1 as number);
|
|
856
|
+
const range = Math.abs(rawD1 - rawD0);
|
|
857
|
+
if (!isFinite(range) || range === 0) return axisTranslate;
|
|
858
|
+
|
|
859
|
+
// Normalize reversed domains by flipping the translate
|
|
860
|
+
const reversed = rawD0 > rawD1;
|
|
861
|
+
const normTranslate = reversed
|
|
862
|
+
? dimension * axisScale - axisTranslate - dimension
|
|
863
|
+
: axisTranslate;
|
|
864
|
+
const numMin = Math.min(rawD0, rawD1);
|
|
865
|
+
|
|
866
|
+
const rawMinVal = resolveValue(extent.min, baseDomain[0]);
|
|
867
|
+
const rawMaxVal = resolveValue(extent.max, baseDomain[1]);
|
|
868
|
+
const minVal =
|
|
869
|
+
rawMinVal != null && rawMaxVal != null ? Math.min(rawMinVal, rawMaxVal) : rawMinVal;
|
|
870
|
+
const maxVal =
|
|
871
|
+
rawMinVal != null && rawMaxVal != null ? Math.max(rawMinVal, rawMaxVal) : rawMaxVal;
|
|
872
|
+
|
|
873
|
+
// Current visible domain from translate/scale
|
|
874
|
+
const f0 = -normTranslate / axisScale / dimension;
|
|
875
|
+
const f1 = (dimension - normTranslate) / axisScale / dimension;
|
|
876
|
+
let visMin = numMin + f0 * range;
|
|
877
|
+
let visMax = numMin + f1 * range;
|
|
878
|
+
const visRange = visMax - visMin;
|
|
879
|
+
|
|
880
|
+
// Enforce minRange (max zoom in limit)
|
|
881
|
+
if (extent.minRange != null && visRange < extent.minRange) {
|
|
882
|
+
const center = (visMin + visMax) / 2;
|
|
883
|
+
visMin = center - extent.minRange / 2;
|
|
884
|
+
visMax = center + extent.minRange / 2;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
// Enforce domain min/max (pan boundaries)
|
|
888
|
+
if (minVal != null && visMin < minVal) {
|
|
889
|
+
visMin = minVal;
|
|
890
|
+
visMax =
|
|
891
|
+
visMin +
|
|
892
|
+
(extent.minRange != null && visRange < extent.minRange ? extent.minRange : visRange);
|
|
893
|
+
}
|
|
894
|
+
if (maxVal != null && visMax > maxVal) {
|
|
895
|
+
visMax = maxVal;
|
|
896
|
+
visMin =
|
|
897
|
+
visMax -
|
|
898
|
+
(extent.minRange != null && visRange < extent.minRange ? extent.minRange : visRange);
|
|
899
|
+
if (minVal != null && visMin < minVal) visMin = minVal;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
// Back-compute translate from corrected visible domain
|
|
903
|
+
const newF0 = (visMin - numMin) / range;
|
|
904
|
+
const result = -newF0 * axisScale * dimension;
|
|
905
|
+
return reversed ? dimension * axisScale - result - dimension : result;
|
|
906
|
+
};
|
|
978
907
|
|
|
979
|
-
|
|
908
|
+
const transformAxis = transform?.axis ?? 'both';
|
|
909
|
+
|
|
910
|
+
if (de.x && (transformAxis === 'x' || transformAxis === 'both') && chartState.width > 0) {
|
|
911
|
+
// Also enforce minRange via scale clamping
|
|
912
|
+
if (de.x.minRange != null && chartState._baseXDomain.length >= 2) {
|
|
913
|
+
const d0 = chartState._baseXDomain[0] as unknown;
|
|
914
|
+
const d1 = chartState._baseXDomain[1] as unknown;
|
|
915
|
+
const isDate = d0 instanceof Date;
|
|
916
|
+
const numD0 = isDate ? (d0 as Date).getTime() : (d0 as number);
|
|
917
|
+
const numD1 = isDate ? (d1 as Date).getTime() : (d1 as number);
|
|
918
|
+
const fullRange = Math.abs(numD1 - numD0);
|
|
919
|
+
if (fullRange > 0) {
|
|
920
|
+
const maxScale = fullRange / de.x.minRange;
|
|
921
|
+
scale = Math.min(scale, maxScale);
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
translate = {
|
|
925
|
+
...translate,
|
|
926
|
+
x: constrainAxis(translate.x, scale, chartState.width, chartState._baseXDomain, de.x),
|
|
927
|
+
};
|
|
928
|
+
}
|
|
980
929
|
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
930
|
+
if (de.y && (transformAxis === 'y' || transformAxis === 'both') && chartState.height > 0) {
|
|
931
|
+
if (de.y.minRange != null && chartState._baseYDomain.length >= 2) {
|
|
932
|
+
const d0 = chartState._baseYDomain[0] as unknown;
|
|
933
|
+
const d1 = chartState._baseYDomain[1] as unknown;
|
|
934
|
+
const isDate = d0 instanceof Date;
|
|
935
|
+
const numD0 = isDate ? (d0 as Date).getTime() : (d0 as number);
|
|
936
|
+
const numD1 = isDate ? (d1 as Date).getTime() : (d1 as number);
|
|
937
|
+
const fullRange = Math.abs(numD1 - numD0);
|
|
938
|
+
if (fullRange > 0) {
|
|
939
|
+
const maxScale = fullRange / de.y.minRange;
|
|
940
|
+
scale = Math.min(scale, maxScale);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
translate = {
|
|
944
|
+
...translate,
|
|
945
|
+
y: constrainAxis(translate.y, scale, chartState.height, chartState._baseYDomain, de.y),
|
|
946
|
+
};
|
|
947
|
+
}
|
|
990
948
|
|
|
991
|
-
|
|
949
|
+
return { scale, translate };
|
|
950
|
+
};
|
|
951
|
+
});
|
|
992
952
|
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
height,
|
|
999
|
-
})
|
|
1000
|
-
: null
|
|
953
|
+
// Whether this is a band scale domain transform (affects scaleExtent and constrain defaults)
|
|
954
|
+
const isBandDomainTransform = $derived(
|
|
955
|
+
transform?.mode === 'domain' &&
|
|
956
|
+
(((transform.axis ?? 'both') !== 'y' && isScaleBand(chartState._xScaleProp)) ||
|
|
957
|
+
((transform.axis ?? 'both') !== 'x' && isScaleBand(chartState._yScaleProp)))
|
|
1001
958
|
);
|
|
1002
959
|
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
960
|
+
// For projection mode, scaleExtent is relative to the initial fitted scale (like d3-zoom).
|
|
961
|
+
// e.g. [0.5, 8] means 0.5x to 8x of the fitted projection scale.
|
|
962
|
+
// For band scale domain transforms, enforce minimum of 1 (can't zoom out past initial view).
|
|
963
|
+
const resolvedScaleExtent = $derived.by(() => {
|
|
964
|
+
if (transform?.mode === 'projection' && transform?.scaleExtent && initialTransform) {
|
|
965
|
+
const baseScale = initialTransform.scale;
|
|
966
|
+
return [transform.scaleExtent[0] * baseScale, transform.scaleExtent[1] * baseScale] as [
|
|
967
|
+
number,
|
|
968
|
+
number,
|
|
969
|
+
];
|
|
970
|
+
}
|
|
971
|
+
if (!isBandDomainTransform) return transform?.scaleExtent;
|
|
972
|
+
const userExtent = transform?.scaleExtent;
|
|
973
|
+
return [Math.max(1, userExtent?.[0] ?? 1), userExtent?.[1] ?? Infinity] as [number, number];
|
|
974
|
+
});
|
|
1010
975
|
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
const
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
const config: PreservedChartConfig<TData, XScale, YScale> = $derived({
|
|
1026
|
-
x: xProp,
|
|
1027
|
-
y: yProp,
|
|
1028
|
-
z: zProp,
|
|
1029
|
-
r: rProp,
|
|
1030
|
-
c: cProp,
|
|
1031
|
-
x1: x1Prop,
|
|
1032
|
-
y1: y1Prop,
|
|
1033
|
-
xDomain: _xDomain,
|
|
1034
|
-
yDomain: _yDomain,
|
|
1035
|
-
zDomain: zDomainProp,
|
|
1036
|
-
rDomain: rDomainProp,
|
|
1037
|
-
x1Domain: x1DomainProp,
|
|
1038
|
-
y1Domain: y1DomainProp,
|
|
1039
|
-
cDomain: cDomainProp,
|
|
1040
|
-
xRange: _xRangeProp,
|
|
1041
|
-
yRange: _yRangeProp,
|
|
1042
|
-
zRange: zRangeProp,
|
|
1043
|
-
rRange: rRangeProp,
|
|
1044
|
-
cRange: cRangeProp,
|
|
1045
|
-
x1Range: x1RangeProp,
|
|
1046
|
-
y1Range: y1RangeProp,
|
|
976
|
+
// For projection mode with flat projections, translateExtent defines the pannable world bounds
|
|
977
|
+
// at the initial (1x) zoom level, similar to d3-zoom. The allowed translate range scales with
|
|
978
|
+
// the zoom ratio so you can pan more when zoomed in.
|
|
979
|
+
// For rotation mode (globes), translateExtent is passed through as degrees (yaw/pitch).
|
|
980
|
+
const resolvedTranslateExtent = $derived.by(() => {
|
|
981
|
+
if (transform?.mode === 'projection' && transform?.translateExtent) {
|
|
982
|
+
if (resolvedApply.rotation) {
|
|
983
|
+
// Rotation mode: values are degrees (yaw/pitch), pass through as-is
|
|
984
|
+
return transform.translateExtent;
|
|
985
|
+
}
|
|
986
|
+
// Flat projection translate mode: handled via projectionTranslateConstrain below
|
|
987
|
+
return undefined;
|
|
988
|
+
}
|
|
989
|
+
return transform?.translateExtent;
|
|
1047
990
|
});
|
|
1048
991
|
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
return
|
|
1060
|
-
}
|
|
1061
|
-
get width() {
|
|
1062
|
-
return width;
|
|
1063
|
-
},
|
|
1064
|
-
get height() {
|
|
1065
|
-
return height;
|
|
1066
|
-
},
|
|
1067
|
-
get percentRange() {
|
|
1068
|
-
return percentRange;
|
|
1069
|
-
},
|
|
1070
|
-
get aspectRatio() {
|
|
1071
|
-
return aspectRatio;
|
|
1072
|
-
},
|
|
1073
|
-
get containerWidth() {
|
|
1074
|
-
return containerWidth;
|
|
1075
|
-
},
|
|
1076
|
-
get containerHeight() {
|
|
1077
|
-
return containerHeight;
|
|
1078
|
-
},
|
|
1079
|
-
get x() {
|
|
1080
|
-
return x;
|
|
1081
|
-
},
|
|
1082
|
-
get y() {
|
|
1083
|
-
return y;
|
|
1084
|
-
},
|
|
1085
|
-
get z() {
|
|
1086
|
-
return z;
|
|
1087
|
-
},
|
|
1088
|
-
get r() {
|
|
1089
|
-
return r;
|
|
1090
|
-
},
|
|
1091
|
-
get c() {
|
|
1092
|
-
return c;
|
|
1093
|
-
},
|
|
1094
|
-
get x1() {
|
|
1095
|
-
return x1;
|
|
1096
|
-
},
|
|
1097
|
-
get y1() {
|
|
1098
|
-
return y1;
|
|
1099
|
-
},
|
|
1100
|
-
get data() {
|
|
1101
|
-
return data;
|
|
1102
|
-
},
|
|
1103
|
-
get xNice() {
|
|
1104
|
-
return xNice;
|
|
1105
|
-
},
|
|
1106
|
-
get yNice() {
|
|
1107
|
-
return yNice;
|
|
1108
|
-
},
|
|
1109
|
-
get zNice() {
|
|
1110
|
-
return zNice;
|
|
1111
|
-
},
|
|
1112
|
-
get rNice() {
|
|
1113
|
-
return rNice;
|
|
1114
|
-
},
|
|
1115
|
-
get xDomainSort() {
|
|
1116
|
-
return xDomainSort;
|
|
1117
|
-
},
|
|
1118
|
-
get yDomainSort() {
|
|
1119
|
-
return yDomainSort;
|
|
1120
|
-
},
|
|
1121
|
-
get zDomainSort() {
|
|
1122
|
-
return zDomainSort;
|
|
1123
|
-
},
|
|
1124
|
-
get rDomainSort() {
|
|
1125
|
-
return rDomainSort;
|
|
1126
|
-
},
|
|
1127
|
-
get xReverse() {
|
|
1128
|
-
return xReverse;
|
|
1129
|
-
},
|
|
1130
|
-
get yReverse() {
|
|
1131
|
-
return yReverse;
|
|
1132
|
-
},
|
|
1133
|
-
get zReverse() {
|
|
1134
|
-
return zReverse;
|
|
1135
|
-
},
|
|
1136
|
-
get rReverse() {
|
|
1137
|
-
return rReverse;
|
|
1138
|
-
},
|
|
1139
|
-
get xPadding() {
|
|
1140
|
-
return xPadding;
|
|
1141
|
-
},
|
|
1142
|
-
get yPadding() {
|
|
1143
|
-
return yPadding;
|
|
1144
|
-
},
|
|
1145
|
-
get zPadding() {
|
|
1146
|
-
return zPadding;
|
|
1147
|
-
},
|
|
1148
|
-
get rPadding() {
|
|
1149
|
-
return rPadding;
|
|
1150
|
-
},
|
|
1151
|
-
get padding() {
|
|
1152
|
-
return padding;
|
|
1153
|
-
},
|
|
1154
|
-
get flatData() {
|
|
1155
|
-
return flatData;
|
|
1156
|
-
},
|
|
1157
|
-
get extents() {
|
|
1158
|
-
return extents;
|
|
1159
|
-
},
|
|
1160
|
-
get xDomain() {
|
|
1161
|
-
return xDomainPossiblyNice;
|
|
1162
|
-
},
|
|
1163
|
-
get yDomain() {
|
|
1164
|
-
return yDomainPossiblyNice;
|
|
1165
|
-
},
|
|
1166
|
-
get zDomain() {
|
|
1167
|
-
return zDomainPossiblyNice;
|
|
1168
|
-
},
|
|
1169
|
-
get rDomain() {
|
|
1170
|
-
return rDomainPossiblyNice;
|
|
1171
|
-
},
|
|
1172
|
-
get cDomain() {
|
|
1173
|
-
return cDomain;
|
|
1174
|
-
},
|
|
1175
|
-
get x1Domain() {
|
|
1176
|
-
return x1Domain;
|
|
1177
|
-
},
|
|
1178
|
-
get y1Domain() {
|
|
1179
|
-
return y1Domain;
|
|
1180
|
-
},
|
|
1181
|
-
get xRange() {
|
|
1182
|
-
return xRange;
|
|
1183
|
-
},
|
|
1184
|
-
get yRange() {
|
|
1185
|
-
return yRange;
|
|
1186
|
-
},
|
|
1187
|
-
get zRange() {
|
|
1188
|
-
return zRange;
|
|
1189
|
-
},
|
|
1190
|
-
get rRange() {
|
|
1191
|
-
return rRange;
|
|
1192
|
-
},
|
|
1193
|
-
get cRange() {
|
|
1194
|
-
return cRangeProp;
|
|
1195
|
-
},
|
|
1196
|
-
get x1Range() {
|
|
1197
|
-
return x1RangeProp;
|
|
1198
|
-
},
|
|
1199
|
-
get y1Range() {
|
|
1200
|
-
return y1RangeProp;
|
|
1201
|
-
},
|
|
1202
|
-
get meta() {
|
|
1203
|
-
return meta;
|
|
1204
|
-
},
|
|
1205
|
-
set meta(v: Record<string, any>) {
|
|
1206
|
-
meta = v;
|
|
1207
|
-
},
|
|
1208
|
-
get xScale() {
|
|
1209
|
-
return xScale;
|
|
1210
|
-
},
|
|
1211
|
-
get yScale() {
|
|
1212
|
-
return yScale;
|
|
1213
|
-
},
|
|
1214
|
-
get zScale() {
|
|
1215
|
-
return zScale;
|
|
1216
|
-
},
|
|
1217
|
-
get rScale() {
|
|
1218
|
-
return rScale;
|
|
1219
|
-
},
|
|
1220
|
-
get yGet() {
|
|
1221
|
-
return yGet;
|
|
1222
|
-
},
|
|
1223
|
-
get xGet() {
|
|
1224
|
-
return xGet;
|
|
1225
|
-
},
|
|
1226
|
-
get zGet() {
|
|
1227
|
-
return zGet;
|
|
1228
|
-
},
|
|
1229
|
-
get rGet() {
|
|
1230
|
-
return rGet;
|
|
1231
|
-
},
|
|
1232
|
-
get cGet() {
|
|
1233
|
-
return cGet;
|
|
1234
|
-
},
|
|
1235
|
-
get x1Get() {
|
|
1236
|
-
return x1Get;
|
|
1237
|
-
},
|
|
1238
|
-
get y1Get() {
|
|
1239
|
-
return y1Get;
|
|
1240
|
-
},
|
|
1241
|
-
get cScale() {
|
|
1242
|
-
return cScale;
|
|
1243
|
-
},
|
|
1244
|
-
get x1Scale() {
|
|
1245
|
-
return x1Scale;
|
|
1246
|
-
},
|
|
1247
|
-
get y1Scale() {
|
|
1248
|
-
return y1Scale;
|
|
1249
|
-
},
|
|
1250
|
-
get radial() {
|
|
1251
|
-
return radial;
|
|
1252
|
-
},
|
|
1253
|
-
get containerRef() {
|
|
1254
|
-
return ref;
|
|
1255
|
-
},
|
|
1256
|
-
get geo() {
|
|
1257
|
-
return geoContext;
|
|
1258
|
-
},
|
|
1259
|
-
get transform() {
|
|
1260
|
-
return transformContext;
|
|
1261
|
-
},
|
|
1262
|
-
get tooltip() {
|
|
1263
|
-
return tooltipContext;
|
|
1264
|
-
},
|
|
1265
|
-
get brush() {
|
|
1266
|
-
return brushContext;
|
|
1267
|
-
},
|
|
1268
|
-
};
|
|
992
|
+
// For flat projection mode, implement d3-zoom-style translate constraining:
|
|
993
|
+
// The viewport (at current zoom) must overlap with the translateExtent world bounds.
|
|
994
|
+
// As zoom increases, the allowed translate range grows proportionally.
|
|
995
|
+
const projectionTranslateConstrain = $derived.by(() => {
|
|
996
|
+
if (
|
|
997
|
+
transform?.mode !== 'projection' ||
|
|
998
|
+
!transform?.translateExtent ||
|
|
999
|
+
!initialTransform ||
|
|
1000
|
+
resolvedApply.rotation
|
|
1001
|
+
) {
|
|
1002
|
+
return undefined;
|
|
1003
|
+
}
|
|
1269
1004
|
|
|
1270
|
-
|
|
1005
|
+
const baseScale = initialTransform.scale;
|
|
1006
|
+
const baseTranslate = initialTransform.translate;
|
|
1007
|
+
const [[x0, y0], [x1, y1]] = transform.translateExtent;
|
|
1271
1008
|
|
|
1272
|
-
|
|
1009
|
+
return (t: { scale: number; translate: { x: number; y: number } }) => {
|
|
1010
|
+
let { scale, translate } = t;
|
|
1011
|
+
// Zoom ratio relative to fitted scale
|
|
1012
|
+
const k = scale / baseScale;
|
|
1273
1013
|
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1014
|
+
// Allowed translate range scales with zoom ratio
|
|
1015
|
+
translate = {
|
|
1016
|
+
x: Math.max(baseTranslate.x + x0 * k, Math.min(baseTranslate.x + x1 * k, translate.x)),
|
|
1017
|
+
y: Math.max(baseTranslate.y + y0 * k, Math.min(baseTranslate.y + y1 * k, translate.y)),
|
|
1018
|
+
};
|
|
1277
1019
|
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
logDebug({
|
|
1281
|
-
data,
|
|
1282
|
-
flatData: typeof flatData !== 'undefined' ? flatData : null,
|
|
1283
|
-
boundingBox: box,
|
|
1284
|
-
activeGetters,
|
|
1285
|
-
x: xProp,
|
|
1286
|
-
y: yProp,
|
|
1287
|
-
z: zProp,
|
|
1288
|
-
r: rProp,
|
|
1289
|
-
xScale,
|
|
1290
|
-
yScale,
|
|
1291
|
-
zScale,
|
|
1292
|
-
rScale,
|
|
1293
|
-
});
|
|
1294
|
-
}
|
|
1020
|
+
return { scale, translate };
|
|
1021
|
+
};
|
|
1295
1022
|
});
|
|
1296
1023
|
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1024
|
+
// Default constrain for band scale domain transforms: prevent panning past data boundaries
|
|
1025
|
+
const bandScaleConstrain = $derived.by(() => {
|
|
1026
|
+
if (!isBandDomainTransform) return undefined;
|
|
1027
|
+
const xIsBand = (transform!.axis ?? 'both') !== 'y' && isScaleBand(chartState._xScaleProp);
|
|
1028
|
+
const yIsBand = (transform!.axis ?? 'both') !== 'x' && isScaleBand(chartState._yScaleProp);
|
|
1029
|
+
|
|
1030
|
+
return (t: { scale: number; translate: { x: number; y: number } }) => {
|
|
1031
|
+
let { scale, translate } = t;
|
|
1032
|
+
let tx = translate.x;
|
|
1033
|
+
let ty = translate.y;
|
|
1034
|
+
if (xIsBand) {
|
|
1035
|
+
// translate.x must be in [width * (1 - scale), 0]
|
|
1036
|
+
tx = Math.max(chartState.width * (1 - scale), Math.min(0, tx));
|
|
1037
|
+
}
|
|
1038
|
+
if (yIsBand) {
|
|
1039
|
+
ty = Math.max(chartState.height * (1 - scale), Math.min(0, ty));
|
|
1040
|
+
}
|
|
1041
|
+
return { scale, translate: { x: tx, y: ty } };
|
|
1042
|
+
};
|
|
1305
1043
|
});
|
|
1306
1044
|
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
const projectionScale = geoContext.projection.scale() ?? 0;
|
|
1320
|
-
const sensitivity = 75;
|
|
1321
|
-
return {
|
|
1322
|
-
x: x + deltaX * (sensitivity / projectionScale),
|
|
1323
|
-
y: y + deltaY * (sensitivity / projectionScale) * -1,
|
|
1324
|
-
};
|
|
1325
|
-
} else {
|
|
1326
|
-
// Apply default TransformContext.processTransform (passing `undefined` below appears to not work when checking for `geo?.applyTransform` exists)
|
|
1327
|
-
return { x: x + deltaX, y: y + deltaY };
|
|
1045
|
+
// Compose user-provided constrain with domainExtent constrain and band scale constrain
|
|
1046
|
+
const composedConstrain = $derived.by(() => {
|
|
1047
|
+
const userConstrain = transform?.constrain;
|
|
1048
|
+
const constrains = [
|
|
1049
|
+
bandScaleConstrain,
|
|
1050
|
+
domainExtentConstrain,
|
|
1051
|
+
projectionTranslateConstrain,
|
|
1052
|
+
userConstrain,
|
|
1053
|
+
].filter(Boolean) as Array<
|
|
1054
|
+
(t: { scale: number; translate: { x: number; y: number } }) => {
|
|
1055
|
+
scale: number;
|
|
1056
|
+
translate: { x: number; y: number };
|
|
1328
1057
|
}
|
|
1058
|
+
>;
|
|
1059
|
+
if (constrains.length === 0) return undefined;
|
|
1060
|
+
if (constrains.length === 1) return constrains[0];
|
|
1061
|
+
return (t: { scale: number; translate: { x: number; y: number } }) => {
|
|
1062
|
+
return constrains.reduce((acc, fn) => fn(acc), t);
|
|
1329
1063
|
};
|
|
1330
1064
|
});
|
|
1331
1065
|
|
|
1332
|
-
const
|
|
1333
|
-
|
|
1066
|
+
const enhancedBrushProps = $derived.by(() => {
|
|
1067
|
+
if (!brush) return { disabled: true };
|
|
1068
|
+
const userProps = typeof brush === 'object' ? brush : {};
|
|
1069
|
+
|
|
1070
|
+
const userOnBrushEnd = userProps.onBrushEnd;
|
|
1071
|
+
const zoomOnBrush = 'zoomOnBrush' in userProps ? userProps.zoomOnBrush : false;
|
|
1072
|
+
const needsEnhancement = transform?.mode === 'domain' || zoomOnBrush;
|
|
1073
|
+
if (!needsEnhancement) return userProps;
|
|
1074
|
+
|
|
1075
|
+
return {
|
|
1076
|
+
...userProps,
|
|
1077
|
+
onBrushEnd: (e: { brush: BrushState }) => {
|
|
1078
|
+
if (e.brush.active) {
|
|
1079
|
+
if (transform?.mode === 'domain') {
|
|
1080
|
+
chartState.zoomToBrush(e.brush, userProps.axis ?? 'x');
|
|
1081
|
+
} else if (zoomOnBrush) {
|
|
1082
|
+
const axis = userProps.axis ?? 'x';
|
|
1083
|
+
if (axis === 'x' || axis === 'both') {
|
|
1084
|
+
brushXDomain = expandBandBrushDomain(e.brush.x, chartState._baseXDomain);
|
|
1085
|
+
}
|
|
1086
|
+
if (axis === 'y' || axis === 'both') {
|
|
1087
|
+
brushYDomain = expandBandBrushDomain(e.brush.y, chartState._baseYDomain);
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
userOnBrushEnd?.(e);
|
|
1091
|
+
e.brush.reset();
|
|
1092
|
+
} else {
|
|
1093
|
+
// Brush was cleared (click-to-reset) — reset transform/domain too
|
|
1094
|
+
if (transform?.mode === 'domain') {
|
|
1095
|
+
chartState.transform.reset();
|
|
1096
|
+
} else if (zoomOnBrush) {
|
|
1097
|
+
brushXDomain = undefined;
|
|
1098
|
+
brushYDomain = undefined;
|
|
1099
|
+
}
|
|
1100
|
+
userOnBrushEnd?.(e);
|
|
1101
|
+
}
|
|
1102
|
+
},
|
|
1103
|
+
};
|
|
1104
|
+
});
|
|
1334
1105
|
</script>
|
|
1335
1106
|
|
|
1336
1107
|
{#if ssr === true || typeof window !== 'undefined'}
|
|
1337
1108
|
<div
|
|
1338
1109
|
bind:this={ref}
|
|
1339
1110
|
style:position
|
|
1340
|
-
style:top={position === 'absolute' ?
|
|
1341
|
-
style:right={position === 'absolute' ?
|
|
1342
|
-
style:bottom={position === 'absolute' ?
|
|
1343
|
-
style:left={position === 'absolute' ?
|
|
1111
|
+
style:top={position === 'absolute' ? 0 : null}
|
|
1112
|
+
style:right={position === 'absolute' ? 0 : null}
|
|
1113
|
+
style:bottom={position === 'absolute' ? 0 : null}
|
|
1114
|
+
style:left={position === 'absolute' ? 0 : null}
|
|
1344
1115
|
style:pointer-events={pointerEvents === false ? 'none' : null}
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1116
|
+
style:overflow={clip ? 'hidden' : null}
|
|
1117
|
+
style:width={width ? `${width}px` : '100%'}
|
|
1118
|
+
style:height={height ? `${height}px` : '100%'}
|
|
1119
|
+
bind:clientWidth={chartState._containerWidth}
|
|
1120
|
+
bind:clientHeight={chartState._containerHeight}
|
|
1121
|
+
class={['lc-root-container', className]}
|
|
1122
|
+
{...restProps}
|
|
1348
1123
|
>
|
|
1349
|
-
{#key isMounted}
|
|
1124
|
+
{#key chartState.isMounted}
|
|
1350
1125
|
<!-- svelte-ignore ownership_invalid_binding -->
|
|
1126
|
+
{@const {
|
|
1127
|
+
domainExtent: _de,
|
|
1128
|
+
constrain: _uc,
|
|
1129
|
+
apply: _apply,
|
|
1130
|
+
scaleExtent: _se,
|
|
1131
|
+
translateExtent: _te,
|
|
1132
|
+
...transformProps
|
|
1133
|
+
} = transform ?? {}}
|
|
1351
1134
|
<TransformContext
|
|
1352
|
-
bind:
|
|
1353
|
-
mode={
|
|
1354
|
-
initialTranslate={initialTransform?.translate}
|
|
1355
|
-
initialScale={initialTransform?.scale}
|
|
1135
|
+
bind:state={chartState.transformState}
|
|
1136
|
+
mode={transform?.mode ?? 'none'}
|
|
1137
|
+
initialTranslate={resolvedApply.translate ? initialTransform?.translate : undefined}
|
|
1138
|
+
initialScale={resolvedApply.scale ? initialTransform?.scale : undefined}
|
|
1356
1139
|
{processTranslate}
|
|
1357
|
-
{...
|
|
1140
|
+
{...transformProps}
|
|
1141
|
+
scaleExtent={resolvedScaleExtent}
|
|
1142
|
+
translateExtent={resolvedTranslateExtent}
|
|
1143
|
+
constrain={composedConstrain}
|
|
1144
|
+
disablePointer={brush === true ||
|
|
1145
|
+
(typeof brush === 'object' && !brush.disabled) ||
|
|
1146
|
+
transform?.disablePointer}
|
|
1358
1147
|
{ondragstart}
|
|
1359
1148
|
{onTransform}
|
|
1360
1149
|
{ondragend}
|
|
1361
1150
|
>
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1151
|
+
{#if brush}
|
|
1152
|
+
{#await import('./BrushContext.svelte')}
|
|
1153
|
+
<!--
|
|
1154
|
+
Pending: render the chart subtree immediately so the chart paints
|
|
1155
|
+
before the BrushContext chunk arrives (avoids a perceived hang on
|
|
1156
|
+
slow networks). The subtree re-mounts once `{:then}` resolves —
|
|
1157
|
+
acceptable because it happens before user interaction, brush is
|
|
1158
|
+
an opt-in feature, and any chart state at that point is empty.
|
|
1159
|
+
-->
|
|
1366
1160
|
<!-- svelte-ignore ownership_invalid_binding -->
|
|
1367
|
-
<TooltipContext
|
|
1368
|
-
{
|
|
1369
|
-
|
|
1370
|
-
}
|
|
1161
|
+
<TooltipContext
|
|
1162
|
+
onclick={onTooltipClick}
|
|
1163
|
+
{...getObjectOrNull(tooltipContext)}
|
|
1164
|
+
bind:state={chartState.tooltipState}
|
|
1165
|
+
>
|
|
1166
|
+
<ChartChildren {children} {tooltipContext} {...restProps} />
|
|
1371
1167
|
</TooltipContext>
|
|
1372
|
-
|
|
1373
|
-
|
|
1168
|
+
{:then { default: BrushContext }}
|
|
1169
|
+
<!-- svelte-ignore ownership_invalid_binding -->
|
|
1170
|
+
<BrushContext {...enhancedBrushProps} bind:state={chartState.brushState}>
|
|
1171
|
+
<!-- svelte-ignore ownership_invalid_binding -->
|
|
1172
|
+
<TooltipContext
|
|
1173
|
+
onclick={onTooltipClick}
|
|
1174
|
+
{...getObjectOrNull(tooltipContext)}
|
|
1175
|
+
bind:state={chartState.tooltipState}
|
|
1176
|
+
>
|
|
1177
|
+
<ChartChildren {children} {tooltipContext} {...restProps} />
|
|
1178
|
+
</TooltipContext>
|
|
1179
|
+
</BrushContext>
|
|
1180
|
+
{/await}
|
|
1181
|
+
{:else}
|
|
1182
|
+
<!-- svelte-ignore ownership_invalid_binding -->
|
|
1183
|
+
<TooltipContext
|
|
1184
|
+
onclick={onTooltipClick}
|
|
1185
|
+
{...getObjectOrNull(tooltipContext)}
|
|
1186
|
+
bind:state={chartState.tooltipState}
|
|
1187
|
+
>
|
|
1188
|
+
<ChartChildren {children} {tooltipContext} {...restProps} />
|
|
1189
|
+
</TooltipContext>
|
|
1190
|
+
{/if}
|
|
1374
1191
|
</TransformContext>
|
|
1375
1192
|
{/key}
|
|
1376
1193
|
</div>
|
|
@@ -1381,8 +1198,4 @@
|
|
|
1381
1198
|
.lc-root-container :global(*) {
|
|
1382
1199
|
box-sizing: border-box;
|
|
1383
1200
|
}
|
|
1384
|
-
.lc-root-container {
|
|
1385
|
-
width: 100%;
|
|
1386
|
-
height: 100%;
|
|
1387
|
-
}
|
|
1388
1201
|
</style>
|