layerchart 2.0.0-next.5 → 2.0.0-next.51
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 +31 -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 +16 -3
- package/dist/components/AnnotationPoint.svelte +30 -12
- package/dist/components/AnnotationRange.svelte +32 -17
- package/dist/components/Arc.svelte +25 -25
- package/dist/components/Arc.svelte.d.ts +5 -6
- package/dist/components/Arc.svelte.test.d.ts +1 -0
- package/dist/components/Arc.svelte.test.js +858 -0
- package/dist/components/Area.svelte +95 -100
- package/dist/components/Area.svelte.d.ts +7 -3
- package/dist/components/Axis.svelte +244 -58
- package/dist/components/Axis.svelte.d.ts +34 -6
- package/dist/components/Bar.svelte +178 -31
- 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 +397 -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 +301 -0
- package/dist/components/Calendar.svelte +45 -20
- package/dist/components/Calendar.svelte.d.ts +4 -4
- package/dist/components/Cell.svelte +59 -0
- package/dist/components/Cell.svelte.d.ts +25 -0
- package/dist/components/Chart.svelte +505 -768
- package/dist/components/Chart.svelte.d.ts +127 -101
- package/dist/components/ChartChildren.svelte +290 -0
- package/dist/components/ChartChildren.svelte.d.ts +147 -0
- package/dist/components/ChartClipPath.svelte +2 -2
- package/dist/components/Chord.svelte +114 -0
- package/dist/components/Chord.svelte.d.ts +53 -0
- package/dist/components/Circle.svelte +350 -72
- package/dist/components/Circle.svelte.d.ts +34 -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 +18 -2
- package/dist/components/ClipPath.svelte +36 -6
- package/dist/components/ClipPath.svelte.d.ts +10 -0
- package/dist/components/ColorRamp.svelte +1 -1
- package/dist/components/ComputedStyles.svelte +9 -2
- package/dist/components/Connector.svelte +7 -7
- package/dist/components/Connector.svelte.d.ts +4 -4
- package/dist/components/Contour.svelte +301 -0
- package/dist/components/Contour.svelte.d.ts +48 -0
- package/dist/components/Dagre.svelte +5 -0
- package/dist/components/Density.svelte +146 -0
- package/dist/components/Density.svelte.d.ts +21 -0
- package/dist/components/Ellipse.svelte +464 -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/ForceSimulation.svelte +184 -50
- package/dist/components/ForceSimulation.svelte.d.ts +95 -21
- package/dist/components/Frame.svelte +2 -2
- package/dist/components/GeoCircle.svelte +1 -1
- package/dist/components/GeoEdgeFade.svelte +4 -5
- package/dist/components/GeoPath.svelte +62 -98
- package/dist/components/GeoPath.svelte.d.ts +6 -6
- package/dist/components/GeoPoint.svelte +22 -13
- package/dist/components/GeoProjection.svelte +30 -0
- package/dist/components/GeoProjection.svelte.d.ts +8 -0
- package/dist/components/GeoRaster.svelte +311 -0
- package/dist/components/GeoRaster.svelte.d.ts +61 -0
- package/dist/components/GeoSpline.svelte +26 -30
- package/dist/components/GeoSpline.svelte.d.ts +3 -3
- package/dist/components/GeoTile.svelte +12 -13
- package/dist/components/GeoVisible.svelte +3 -3
- package/dist/components/Graticule.svelte +9 -12
- package/dist/components/Graticule.svelte.d.ts +2 -1
- package/dist/components/Grid.svelte +79 -64
- package/dist/components/Grid.svelte.d.ts +5 -0
- package/dist/components/Group.svelte +182 -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 +384 -159
- package/dist/components/Highlight.svelte.d.ts +12 -0
- package/dist/components/Hull.svelte +21 -11
- package/dist/components/Image.svelte +546 -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 +105 -25
- package/dist/components/Labels.svelte.d.ts +19 -7
- package/dist/components/Legend.svelte +237 -81
- package/dist/components/Legend.svelte.d.ts +23 -12
- package/dist/components/Line.svelte +361 -84
- package/dist/components/Line.svelte.d.ts +39 -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 +43 -13
- package/dist/components/Link.svelte +1 -1
- package/dist/components/Marker.svelte +43 -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/Pack.svelte +4 -6
- package/dist/components/Pack.svelte.d.ts +12 -7
- package/dist/components/Partition.svelte +4 -3
- package/dist/components/Partition.svelte.d.ts +12 -4
- package/dist/components/Path.svelte +361 -0
- package/dist/components/Path.svelte.d.ts +72 -0
- package/dist/components/Pattern.svelte +15 -14
- package/dist/components/Pie.svelte +6 -8
- 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 +12 -16
- package/dist/components/Raster.svelte +335 -0
- package/dist/components/Raster.svelte.d.ts +48 -0
- package/dist/components/Rect.svelte +551 -89
- package/dist/components/Rect.svelte.d.ts +82 -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 +16 -4
- package/dist/components/RectClipPath.svelte.d.ts +2 -2
- package/dist/components/Ribbon.svelte +141 -0
- package/dist/components/Ribbon.svelte.d.ts +51 -0
- package/dist/components/Rule.svelte +170 -78
- package/dist/components/Rule.svelte.d.ts +7 -2
- package/dist/components/Sankey.svelte +1 -3
- package/dist/components/Spline.svelte +181 -279
- package/dist/components/Spline.svelte.d.ts +28 -56
- package/dist/components/Text.svelte +579 -215
- package/dist/components/Text.svelte.d.ts +54 -14
- 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/TileImage.svelte +19 -4
- package/dist/components/Trail.svelte +256 -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/Tree.svelte +4 -3
- package/dist/components/Tree.svelte.d.ts +12 -4
- package/dist/components/Treemap.svelte +67 -29
- package/dist/components/Treemap.svelte.d.ts +23 -15
- package/dist/components/Vector.svelte +376 -0
- package/dist/components/Vector.svelte.d.ts +109 -0
- package/dist/components/Violin.svelte +319 -0
- package/dist/components/Violin.svelte.d.ts +47 -0
- package/dist/components/Voronoi.svelte +17 -18
- 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__/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 +148 -221
- package/dist/components/charts/ArcChart.svelte.d.ts +44 -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 +86 -529
- 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 +128 -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 +449 -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 +98 -33
- 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 +231 -0
- package/dist/components/charts/LineChart.svelte +94 -433
- 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 +45 -0
- package/dist/components/charts/PieChart.svelte +292 -362
- package/dist/components/charts/PieChart.svelte.d.ts +62 -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-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/types.d.ts +6 -211
- package/dist/components/index.d.ts +45 -13
- package/dist/components/index.js +45 -14
- 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 +97 -61
- package/dist/components/tooltip/Tooltip.svelte.d.ts +12 -14
- package/dist/components/tooltip/TooltipContext.svelte +321 -173
- package/dist/components/tooltip/TooltipContext.svelte.d.ts +23 -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/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 +48 -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/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 +246 -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 +1066 -0
- package/dist/states/chart.svelte.test.d.ts +1 -0
- package/dist/states/chart.svelte.test.js +1403 -0
- package/dist/states/geo.svelte.d.ts +49 -0
- package/dist/states/geo.svelte.js +100 -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-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 +1 -1
- package/dist/utils/arcText.svelte.js +4 -4
- 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 +83 -0
- package/dist/utils/canvas.js +228 -55
- package/dist/utils/canvas.svelte.test.d.ts +1 -0
- package/dist/utils/canvas.svelte.test.js +703 -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 +5 -7
- 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/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 +54 -1
- package/dist/utils/path.js +147 -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 +11 -4
- package/dist/utils/rect.svelte.js +87 -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 +341 -0
- package/dist/utils/treemap.d.ts +1 -1
- package/dist/utils/types.d.ts +28 -2
- package/package.json +54 -57
- package/README.md +0 -41
- package/dist/components/GeoContext.svelte +0 -176
- package/dist/components/GeoContext.svelte.d.ts +0 -52
- package/dist/components/TransformControls.svelte +0 -179
- package/dist/components/TransformControls.svelte.d.ts +0 -28
- package/dist/components/charts/utils.svelte.d.ts +0 -30
- package/dist/components/charts/utils.svelte.js +0 -55
- 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/graph/dagre.d.ts +0 -34
- package/dist/utils/object.js +0 -2
- /package/dist/{utils → contexts}/legendPayload.d.ts +0 -0
- /package/dist/{utils → contexts}/legendPayload.js +0 -0
|
@@ -1,47 +1,35 @@
|
|
|
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';
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
createGetter,
|
|
30
|
-
createChartScale,
|
|
31
|
-
} from '../utils/chart.js';
|
|
32
|
-
import { onMount, type ComponentProps, type Snippet } from 'svelte';
|
|
33
|
-
import GeoContext, { type GeoContextValue } from './GeoContext.svelte';
|
|
34
|
-
import TooltipContext, { type TooltipContextValue } from './tooltip/TooltipContext.svelte';
|
|
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';
|
|
19
|
+
import type { GeoStateProps } from '../states/geo.svelte.js';
|
|
20
|
+
import TooltipContext from './tooltip/TooltipContext.svelte';
|
|
21
|
+
|
|
39
22
|
import { geoFitObjectTransform } from '../utils/geo.js';
|
|
40
|
-
import TransformContext
|
|
41
|
-
import BrushContext
|
|
42
|
-
import {
|
|
23
|
+
import TransformContext from './TransformContext.svelte';
|
|
24
|
+
import BrushContext from './BrushContext.svelte';
|
|
25
|
+
import { type BrushDomainType, type BrushState, expandBandBrushDomain } from '../states/brush.svelte.js';
|
|
43
26
|
|
|
44
|
-
|
|
27
|
+
import { setChartContext } from '../contexts/chart.js';
|
|
28
|
+
import { ChartState } from '../states/chart.svelte.js';
|
|
29
|
+
import type { StackLayout } from '../states/series.svelte.js';
|
|
30
|
+
|
|
31
|
+
import type { ChartChildrenProps } from './ChartChildren.svelte';
|
|
32
|
+
import type { SeriesData } from './charts/types.js';
|
|
45
33
|
|
|
46
34
|
export type ChartResizeDetail = {
|
|
47
35
|
width: number;
|
|
@@ -79,83 +67,6 @@
|
|
|
79
67
|
| 'y1Range'
|
|
80
68
|
>;
|
|
81
69
|
|
|
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
70
|
export type LayerChartInternalMeta = {
|
|
160
71
|
/**
|
|
161
72
|
* The current chart type.
|
|
@@ -171,37 +82,6 @@
|
|
|
171
82
|
| 'simplified-scatter';
|
|
172
83
|
};
|
|
173
84
|
|
|
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
85
|
export type ChartPropsWithoutHTML<
|
|
206
86
|
T,
|
|
207
87
|
XScale extends AnyScale = AnyScale,
|
|
@@ -417,21 +297,21 @@
|
|
|
417
297
|
/**
|
|
418
298
|
* The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if
|
|
419
299
|
* you want to override the default or you want to extra options.
|
|
420
|
-
* @default
|
|
300
|
+
* @default autoScale
|
|
421
301
|
*/
|
|
422
302
|
xScale?: XScale;
|
|
423
303
|
|
|
424
304
|
/**
|
|
425
305
|
* The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if
|
|
426
306
|
* you want to override the default or you want to extra options.
|
|
427
|
-
* @default
|
|
307
|
+
* @default autoScale
|
|
428
308
|
*/
|
|
429
309
|
yScale?: YScale;
|
|
430
310
|
|
|
431
311
|
/**
|
|
432
312
|
* The D3 scale that should be used for the x-dimension. Pass in an instantiated D3 scale if
|
|
433
313
|
* you want to override the default or you want to extra options.
|
|
434
|
-
* @default
|
|
314
|
+
* @default autoScale
|
|
435
315
|
*/
|
|
436
316
|
zScale?: AnyScale;
|
|
437
317
|
|
|
@@ -445,14 +325,14 @@
|
|
|
445
325
|
/**
|
|
446
326
|
* The D3 scale that should be used for the x1-dimension. Pass in an instantiated D3 scale if
|
|
447
327
|
* you want to override the default or you want to extra options.
|
|
448
|
-
* @default
|
|
328
|
+
* @default autoScale
|
|
449
329
|
*/
|
|
450
330
|
x1Scale?: AnyScale;
|
|
451
331
|
|
|
452
332
|
/**
|
|
453
333
|
* The D3 scale that should be used for the y1-dimension. Pass in an instantiated D3 scale if
|
|
454
334
|
* you want to override the default or you want to extra options.
|
|
455
|
-
* @default
|
|
335
|
+
* @default autoScale
|
|
456
336
|
*/
|
|
457
337
|
y1Scale?: AnyScale;
|
|
458
338
|
|
|
@@ -640,7 +520,22 @@
|
|
|
640
520
|
*/
|
|
641
521
|
yBaseline?: number | null;
|
|
642
522
|
|
|
643
|
-
|
|
523
|
+
/**
|
|
524
|
+
* Time interval to use for the x-axis when using a time scale.
|
|
525
|
+
*/
|
|
526
|
+
xInterval?: TimeInterval | null;
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Time interval to use for the y-axis when using a time scale.
|
|
530
|
+
*/
|
|
531
|
+
yInterval?: TimeInterval | null;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* The axis that represents the value dimension, typically based on the type and orientation of the chart
|
|
535
|
+
*
|
|
536
|
+
* @default 'y'
|
|
537
|
+
*/
|
|
538
|
+
valueAxis?: 'x' | 'y';
|
|
644
539
|
|
|
645
540
|
/**
|
|
646
541
|
* Use radial instead of cartesian coordinates, mapping `x` to `angle` and `y`` to radial.
|
|
@@ -651,726 +546,572 @@
|
|
|
651
546
|
*/
|
|
652
547
|
radial?: boolean;
|
|
653
548
|
|
|
654
|
-
children?: Snippet<[{ context:
|
|
549
|
+
children?: Snippet<[{ context: ChartState<T, XScale, YScale> }]>;
|
|
655
550
|
|
|
656
551
|
/**
|
|
657
552
|
* A bindable reference to the chart context.
|
|
658
553
|
*/
|
|
659
|
-
context?:
|
|
554
|
+
context?: ChartState<T, XScale, YScale>;
|
|
660
555
|
|
|
661
556
|
/**
|
|
662
|
-
* Props passed to
|
|
557
|
+
* Props passed to GeoState
|
|
663
558
|
*/
|
|
664
|
-
geo?: Partial<
|
|
559
|
+
geo?: Partial<GeoStateProps>;
|
|
665
560
|
|
|
666
561
|
/**
|
|
667
562
|
* Props passed to the `TooltipContext` component.
|
|
668
563
|
*/
|
|
669
|
-
|
|
564
|
+
tooltipContext?: Partial<ComponentProps<typeof TooltipContext>> | boolean;
|
|
670
565
|
|
|
671
566
|
/**
|
|
672
|
-
* Props passed to TransformContext
|
|
673
|
-
*/
|
|
674
|
-
transform?: Partial<ComponentProps<typeof TransformContext
|
|
567
|
+
* Props passed to TransformContext, with optional domain-space constraints.
|
|
568
|
+
*/
|
|
569
|
+
transform?: Partial<ComponentProps<typeof TransformContext>> & {
|
|
570
|
+
/**
|
|
571
|
+
* Controls which projection properties are updated by transform state in `mode: 'projection'`.
|
|
572
|
+
* Auto-detected from the projection type when not specified:
|
|
573
|
+
* - Globe projections (e.g. `geoOrthographic`): `{ rotation: true, scale: false, translate: false }`
|
|
574
|
+
* - Flat maps (e.g. `geoMercator`): `{ rotation: false, scale: true, translate: true }`
|
|
575
|
+
*
|
|
576
|
+
* `rotation` and `translate` are mutually exclusive.
|
|
577
|
+
*/
|
|
578
|
+
apply?: {
|
|
579
|
+
/** Apply transform translate as projection rotation (yaw/pitch). */
|
|
580
|
+
rotation?: boolean;
|
|
581
|
+
/** Apply transform scale to projection scale. */
|
|
582
|
+
scale?: boolean;
|
|
583
|
+
/** Apply transform translate to projection translate. */
|
|
584
|
+
translate?: boolean;
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Domain-space constraints for pan/zoom in `mode: 'domain'`.
|
|
589
|
+
* Expressed in data units (numbers, Dates) rather than pixel-space.
|
|
590
|
+
* Converted internally to a `constrain` function on TransformState.
|
|
591
|
+
*/
|
|
592
|
+
domainExtent?: {
|
|
593
|
+
x?: {
|
|
594
|
+
/** Minimum domain value. `'data'` = initial data bounds. */
|
|
595
|
+
min?: number | Date | 'data';
|
|
596
|
+
/** Maximum domain value. `'data'` = initial data bounds. */
|
|
597
|
+
max?: number | Date | 'data';
|
|
598
|
+
/** Minimum visible range (max zoom in). In data units (e.g., ms for dates). */
|
|
599
|
+
minRange?: number;
|
|
600
|
+
};
|
|
601
|
+
y?: {
|
|
602
|
+
min?: number | Date | 'data';
|
|
603
|
+
max?: number | Date | 'data';
|
|
604
|
+
minRange?: number;
|
|
605
|
+
};
|
|
606
|
+
};
|
|
607
|
+
};
|
|
675
608
|
|
|
676
609
|
/** Props passed to BrushContext */
|
|
677
|
-
brush?:
|
|
610
|
+
brush?:
|
|
611
|
+
| (Partial<ComponentProps<typeof BrushContext>> & {
|
|
612
|
+
/**
|
|
613
|
+
* Zoom the chart domain to the brushed area on brush end.
|
|
614
|
+
*
|
|
615
|
+
* @default false
|
|
616
|
+
*/
|
|
617
|
+
zoomOnBrush?: boolean;
|
|
618
|
+
})
|
|
619
|
+
| boolean;
|
|
620
|
+
|
|
621
|
+
/** Series definitions for multi-series charts */
|
|
622
|
+
series?: SeriesData<T, any>[];
|
|
623
|
+
|
|
624
|
+
/** Layout mode for series: 'overlap', 'group', 'stack', 'stackExpand', 'stackDiverging' */
|
|
625
|
+
seriesLayout?: StackLayout | 'group';
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Padding between primary bands (e.g. bars), applied to the category axis scaleBand().padding().
|
|
629
|
+
* When set, the category axis (opposite of valueAxis) automatically uses a scaleBand with this padding.
|
|
630
|
+
*/
|
|
631
|
+
bandPadding?: number;
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* Padding between group/series items when using seriesLayout="group", applied to the x1/y1 scaleBand().padding().
|
|
635
|
+
* @default 0
|
|
636
|
+
*/
|
|
637
|
+
groupPadding?: number;
|
|
678
638
|
|
|
679
639
|
/**
|
|
680
640
|
* A callback function that is called when the chart is resized.
|
|
681
641
|
*/
|
|
682
642
|
onResize?: (e: ChartResizeDetail) => void;
|
|
683
643
|
|
|
644
|
+
/**
|
|
645
|
+
* Whether to clip overflow content.
|
|
646
|
+
* When true, sets `overflow: hidden` on the container.
|
|
647
|
+
*
|
|
648
|
+
* @default false
|
|
649
|
+
*/
|
|
650
|
+
clip?: boolean;
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Animate scale domain transitions with spring or tween motion.
|
|
654
|
+
* Applies to all domain changes (data updates, brush zoom, transform, etc.)
|
|
655
|
+
*/
|
|
656
|
+
motion?: MotionProp;
|
|
657
|
+
|
|
684
658
|
// TransformContext callback events
|
|
685
659
|
ondragstart?: ComponentProps<typeof TransformContext>['ondragstart'];
|
|
686
660
|
ondragend?: ComponentProps<typeof TransformContext>['ondragend'];
|
|
687
661
|
onTransform?: ComponentProps<typeof TransformContext>['onTransform'];
|
|
688
|
-
|
|
662
|
+
|
|
663
|
+
/** Sets width of the chart container. Uses parent width if not set (bind:clientWidth) */
|
|
664
|
+
width?: number;
|
|
665
|
+
|
|
666
|
+
/** Sets height of the chart container. Uses parent height if not set (bind:clientHeight) */
|
|
667
|
+
height?: number;
|
|
668
|
+
} & ChartChildrenProps<T, XScale, YScale>;
|
|
669
|
+
|
|
670
|
+
export type ChartProps<
|
|
671
|
+
T,
|
|
672
|
+
XScale extends AnyScale = AnyScale,
|
|
673
|
+
YScale extends AnyScale = AnyScale,
|
|
674
|
+
> = ChartPropsWithoutHTML<T, XScale, YScale> &
|
|
675
|
+
Without<HTMLAttributes<HTMLDivElement>, ChartPropsWithoutHTML<T, XScale, YScale>>;
|
|
689
676
|
</script>
|
|
690
677
|
|
|
691
678
|
<script
|
|
692
679
|
lang="ts"
|
|
693
680
|
generics="TData = any, XScale extends AnyScale = AnyScale, YScale extends AnyScale = AnyScale"
|
|
694
681
|
>
|
|
682
|
+
import { setGeoContext } from '../contexts/geo.js';
|
|
683
|
+
import { getSettings } from '../contexts/settings.js';
|
|
684
|
+
import ChartChildren from './ChartChildren.svelte';
|
|
685
|
+
|
|
686
|
+
let {
|
|
687
|
+
ref: refProp = $bindable(),
|
|
688
|
+
context: contextProp = $bindable(),
|
|
689
|
+
...props
|
|
690
|
+
}: ChartProps<TData, XScale, YScale> = $props();
|
|
691
|
+
|
|
695
692
|
let {
|
|
696
693
|
ssr = false,
|
|
697
694
|
pointerEvents = true,
|
|
695
|
+
width,
|
|
696
|
+
height,
|
|
698
697
|
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,
|
|
698
|
+
children,
|
|
758
699
|
geo,
|
|
759
|
-
|
|
760
|
-
tooltip,
|
|
700
|
+
tooltipContext,
|
|
761
701
|
transform,
|
|
762
702
|
onTransform,
|
|
763
703
|
ondragend,
|
|
764
704
|
ondragstart,
|
|
765
705
|
brush,
|
|
766
|
-
|
|
706
|
+
motion,
|
|
707
|
+
debug = false,
|
|
708
|
+
clip = false,
|
|
709
|
+
onTooltipClick,
|
|
710
|
+
class: className,
|
|
711
|
+
...restProps
|
|
712
|
+
} = $derived(props);
|
|
713
|
+
|
|
714
|
+
let brushXDomain = $state<BrushDomainType>();
|
|
715
|
+
let brushYDomain = $state<BrushDomainType>();
|
|
716
|
+
|
|
717
|
+
const chartState = new ChartState<TData, XScale, YScale>(() => ({
|
|
718
|
+
ref: refProp,
|
|
719
|
+
context: contextProp,
|
|
720
|
+
...props,
|
|
721
|
+
xDomain: brushXDomain ?? props.xDomain,
|
|
722
|
+
yDomain: brushYDomain ?? props.yDomain,
|
|
723
|
+
}));
|
|
767
724
|
|
|
768
725
|
let ref = $state<HTMLElement>();
|
|
769
|
-
|
|
770
726
|
$effect.pre(() => {
|
|
771
727
|
refProp = ref;
|
|
728
|
+
chartState.containerRef = ref;
|
|
772
729
|
});
|
|
773
730
|
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
let containerWidth = $state(100);
|
|
777
|
-
let containerHeight = $state(100);
|
|
731
|
+
// Update bindable
|
|
732
|
+
contextProp = chartState;
|
|
778
733
|
|
|
779
|
-
|
|
734
|
+
setChartContext(chartState);
|
|
735
|
+
setGeoContext(chartState.geoState);
|
|
780
736
|
|
|
781
|
-
const
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
const xValues = data.flatMap(accessor(xProp));
|
|
785
|
-
return [min([xBaseline, ...xValues]), max([xBaseline, ...xValues])];
|
|
786
|
-
}
|
|
787
|
-
});
|
|
788
|
-
|
|
789
|
-
const _yDomain: DomainType | undefined = $derived.by(() => {
|
|
790
|
-
if (yDomainProp !== undefined) return yDomainProp;
|
|
791
|
-
if (yBaseline != null && Array.isArray(data)) {
|
|
792
|
-
const yValues = data.flatMap(accessor(yProp));
|
|
793
|
-
return [min([yBaseline, ...yValues]), max([yBaseline, ...yValues])];
|
|
794
|
-
}
|
|
737
|
+
const settings = getSettings();
|
|
738
|
+
$effect(() => {
|
|
739
|
+
settings.debug = debug;
|
|
795
740
|
});
|
|
796
741
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
742
|
+
// Resolve which projection properties the transform state applies to
|
|
743
|
+
const resolvedApply = $derived.by(() => {
|
|
744
|
+
if (transform?.mode !== 'projection') return { rotation: false, scale: false, translate: false };
|
|
800
745
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
const c = $derived(accessor(cProp));
|
|
808
|
-
const x1 = $derived(accessor(x1Prop));
|
|
809
|
-
const y1 = $derived(accessor(y1Prop));
|
|
746
|
+
// Auto-detect globe projections from clipAngle (flat projections return 0, globes return > 0)
|
|
747
|
+
let isGlobe = false;
|
|
748
|
+
if (geo?.projection) {
|
|
749
|
+
const proj = geo.projection();
|
|
750
|
+
isGlobe = (proj.clipAngle?.() ?? 0) > 0;
|
|
751
|
+
}
|
|
810
752
|
|
|
811
|
-
|
|
753
|
+
const defaults = isGlobe
|
|
754
|
+
? { rotation: true, scale: true, translate: false }
|
|
755
|
+
: { rotation: false, scale: true, translate: true };
|
|
812
756
|
|
|
813
|
-
|
|
757
|
+
// User overrides win; enforce mutual exclusion
|
|
758
|
+
const result = { ...defaults, ...transform?.apply };
|
|
759
|
+
if (transform?.apply?.rotation === true && transform?.apply?.translate == null) {
|
|
760
|
+
result.translate = false;
|
|
761
|
+
}
|
|
762
|
+
if (transform?.apply?.translate === true && transform?.apply?.rotation == null) {
|
|
763
|
+
result.rotation = false;
|
|
764
|
+
}
|
|
814
765
|
|
|
815
|
-
|
|
816
|
-
x,
|
|
817
|
-
y,
|
|
818
|
-
z,
|
|
819
|
-
r,
|
|
766
|
+
return result;
|
|
820
767
|
});
|
|
821
768
|
|
|
822
|
-
|
|
823
|
-
if (
|
|
824
|
-
|
|
825
|
-
...defaultPadding,
|
|
826
|
-
top: paddingProp,
|
|
827
|
-
right: paddingProp,
|
|
828
|
-
bottom: paddingProp,
|
|
829
|
-
left: paddingProp,
|
|
830
|
-
};
|
|
769
|
+
$effect.pre(() => {
|
|
770
|
+
if (chartState.geoState) {
|
|
771
|
+
chartState.geoState.transformApply = resolvedApply;
|
|
831
772
|
}
|
|
832
|
-
return { ...defaultPadding, ...paddingProp };
|
|
833
773
|
});
|
|
834
774
|
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
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
|
-
}
|
|
855
|
-
}
|
|
775
|
+
const initialTransform = $derived(
|
|
776
|
+
transform?.mode === 'projection' && (resolvedApply.translate || resolvedApply.scale) && geo?.fitGeojson && geo?.projection
|
|
777
|
+
? geoFitObjectTransform(
|
|
778
|
+
geo.projection(),
|
|
779
|
+
[chartState.width, chartState.height],
|
|
780
|
+
geo.fitGeojson
|
|
781
|
+
)
|
|
782
|
+
: undefined
|
|
783
|
+
);
|
|
856
784
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
785
|
+
const processTranslate = $derived.by(() => {
|
|
786
|
+
if (resolvedApply.rotation && chartState.geoState?.projection) {
|
|
787
|
+
return (x: number, y: number, deltaX: number, deltaY: number) => {
|
|
788
|
+
// When applying transform as rotation, invert `y` values and reduce sensitivity based on projection scale
|
|
789
|
+
// see: https://observablehq.com/@benoldenburg/simple-globe and https://observablehq.com/@michael-keith/draggable-globe-in-d3
|
|
790
|
+
const projectionScale = chartState.geoState.projection!.scale() ?? 0;
|
|
791
|
+
const sensitivity = 75;
|
|
792
|
+
return {
|
|
793
|
+
x: x + deltaX * (sensitivity / projectionScale),
|
|
794
|
+
y: y + deltaY * (sensitivity / projectionScale) * -1,
|
|
795
|
+
};
|
|
796
|
+
};
|
|
797
|
+
}
|
|
798
|
+
return undefined;
|
|
865
799
|
});
|
|
866
800
|
|
|
867
|
-
|
|
868
|
-
const
|
|
801
|
+
// Convert domainExtent to a constrain function on TransformState
|
|
802
|
+
const domainExtentConstrain = $derived.by(() => {
|
|
803
|
+
const de = transform?.domainExtent;
|
|
804
|
+
if (!de) return undefined;
|
|
805
|
+
|
|
806
|
+
return (t: { scale: number; translate: { x: number; y: number } }) => {
|
|
807
|
+
let { scale, translate } = t;
|
|
808
|
+
|
|
809
|
+
// Helper to resolve 'data' to base domain values
|
|
810
|
+
const resolveValue = (
|
|
811
|
+
val: number | Date | 'data' | undefined,
|
|
812
|
+
baseDomainValue: unknown
|
|
813
|
+
): number | undefined => {
|
|
814
|
+
if (val === undefined) return undefined;
|
|
815
|
+
if (val === 'data') {
|
|
816
|
+
if (baseDomainValue instanceof Date) return baseDomainValue.getTime();
|
|
817
|
+
return baseDomainValue as number;
|
|
818
|
+
}
|
|
819
|
+
if (val instanceof Date) return val.getTime();
|
|
820
|
+
return val;
|
|
821
|
+
};
|
|
869
822
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
823
|
+
// Constrain a single axis. Normalizes reversed domains (e.g. [500, 0])
|
|
824
|
+
// to ascending order, applies constraints, then maps back.
|
|
825
|
+
const constrainAxis = (
|
|
826
|
+
axisTranslate: number,
|
|
827
|
+
axisScale: number,
|
|
828
|
+
dimension: number,
|
|
829
|
+
baseDomain: number[],
|
|
830
|
+
extent: { min?: number | Date | 'data'; max?: number | Date | 'data'; minRange?: number } | undefined
|
|
831
|
+
): number => {
|
|
832
|
+
if (!extent || baseDomain.length < 2 || dimension <= 0) return axisTranslate;
|
|
833
|
+
|
|
834
|
+
const d0 = baseDomain[0] as unknown;
|
|
835
|
+
const d1 = baseDomain[1] as unknown;
|
|
836
|
+
|
|
837
|
+
// Skip domain extent constraint for categorical scales (range clamping handles boundaries)
|
|
838
|
+
if (typeof d0 === 'string') return axisTranslate;
|
|
839
|
+
const isDate = d0 instanceof Date;
|
|
840
|
+
const rawD0 = isDate ? (d0 as Date).getTime() : (d0 as number);
|
|
841
|
+
const rawD1 = isDate ? (d1 as Date).getTime() : (d1 as number);
|
|
842
|
+
const range = Math.abs(rawD1 - rawD0);
|
|
843
|
+
if (!isFinite(range) || range === 0) return axisTranslate;
|
|
844
|
+
|
|
845
|
+
// Normalize reversed domains by flipping the translate
|
|
846
|
+
const reversed = rawD0 > rawD1;
|
|
847
|
+
const normTranslate = reversed ? dimension * axisScale - axisTranslate - dimension : axisTranslate;
|
|
848
|
+
const numMin = Math.min(rawD0, rawD1);
|
|
849
|
+
|
|
850
|
+
const rawMinVal = resolveValue(extent.min, baseDomain[0]);
|
|
851
|
+
const rawMaxVal = resolveValue(extent.max, baseDomain[1]);
|
|
852
|
+
const minVal = rawMinVal != null && rawMaxVal != null ? Math.min(rawMinVal, rawMaxVal) : rawMinVal;
|
|
853
|
+
const maxVal = rawMinVal != null && rawMaxVal != null ? Math.max(rawMinVal, rawMaxVal) : rawMaxVal;
|
|
854
|
+
|
|
855
|
+
// Current visible domain from translate/scale
|
|
856
|
+
const f0 = -normTranslate / axisScale / dimension;
|
|
857
|
+
const f1 = (dimension - normTranslate) / axisScale / dimension;
|
|
858
|
+
let visMin = numMin + f0 * range;
|
|
859
|
+
let visMax = numMin + f1 * range;
|
|
860
|
+
const visRange = visMax - visMin;
|
|
861
|
+
|
|
862
|
+
// Enforce minRange (max zoom in limit)
|
|
863
|
+
if (extent.minRange != null && visRange < extent.minRange) {
|
|
864
|
+
const center = (visMin + visMax) / 2;
|
|
865
|
+
visMin = center - extent.minRange / 2;
|
|
866
|
+
visMax = center + extent.minRange / 2;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
// Enforce domain min/max (pan boundaries)
|
|
870
|
+
if (minVal != null && visMin < minVal) {
|
|
871
|
+
visMin = minVal;
|
|
872
|
+
visMax = visMin + (extent.minRange != null && visRange < extent.minRange ? extent.minRange : visRange);
|
|
873
|
+
}
|
|
874
|
+
if (maxVal != null && visMax > maxVal) {
|
|
875
|
+
visMax = maxVal;
|
|
876
|
+
visMin = visMax - (extent.minRange != null && visRange < extent.minRange ? extent.minRange : visRange);
|
|
877
|
+
if (minVal != null && visMin < minVal) visMin = minVal;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
// Back-compute translate from corrected visible domain
|
|
881
|
+
const newF0 = (visMin - numMin) / range;
|
|
882
|
+
const result = -newF0 * axisScale * dimension;
|
|
883
|
+
return reversed ? dimension * axisScale - result - dimension : result;
|
|
884
|
+
};
|
|
874
885
|
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
886
|
+
const transformAxis = transform?.axis ?? 'both';
|
|
887
|
+
|
|
888
|
+
if (de.x && (transformAxis === 'x' || transformAxis === 'both') && chartState.width > 0) {
|
|
889
|
+
// Also enforce minRange via scale clamping
|
|
890
|
+
if (de.x.minRange != null && chartState._baseXDomain.length >= 2) {
|
|
891
|
+
const d0 = chartState._baseXDomain[0] as unknown;
|
|
892
|
+
const d1 = chartState._baseXDomain[1] as unknown;
|
|
893
|
+
const isDate = d0 instanceof Date;
|
|
894
|
+
const numD0 = isDate ? (d0 as Date).getTime() : (d0 as number);
|
|
895
|
+
const numD1 = isDate ? (d1 as Date).getTime() : (d1 as number);
|
|
896
|
+
const fullRange = Math.abs(numD1 - numD0);
|
|
897
|
+
if (fullRange > 0) {
|
|
898
|
+
const maxScale = fullRange / de.x.minRange;
|
|
899
|
+
scale = Math.min(scale, maxScale);
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
translate = {
|
|
903
|
+
...translate,
|
|
904
|
+
x: constrainAxis(translate.x, scale, chartState.width, chartState._baseXDomain, de.x),
|
|
905
|
+
};
|
|
906
|
+
}
|
|
888
907
|
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
908
|
+
if (de.y && (transformAxis === 'y' || transformAxis === 'both') && chartState.height > 0) {
|
|
909
|
+
if (de.y.minRange != null && chartState._baseYDomain.length >= 2) {
|
|
910
|
+
const d0 = chartState._baseYDomain[0] as unknown;
|
|
911
|
+
const d1 = chartState._baseYDomain[1] as unknown;
|
|
912
|
+
const isDate = d0 instanceof Date;
|
|
913
|
+
const numD0 = isDate ? (d0 as Date).getTime() : (d0 as number);
|
|
914
|
+
const numD1 = isDate ? (d1 as Date).getTime() : (d1 as number);
|
|
915
|
+
const fullRange = Math.abs(numD1 - numD0);
|
|
916
|
+
if (fullRange > 0) {
|
|
917
|
+
const maxScale = fullRange / de.y.minRange;
|
|
918
|
+
scale = Math.min(scale, maxScale);
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
translate = {
|
|
922
|
+
...translate,
|
|
923
|
+
y: constrainAxis(translate.y, scale, chartState.height, chartState._baseYDomain, de.y),
|
|
924
|
+
};
|
|
925
|
+
}
|
|
893
926
|
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
return { ...calculatedExtents, ...filteredExtents };
|
|
897
|
-
} else {
|
|
898
|
-
return {};
|
|
899
|
-
}
|
|
927
|
+
return { scale, translate };
|
|
928
|
+
};
|
|
900
929
|
});
|
|
901
930
|
|
|
902
|
-
|
|
903
|
-
const
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
const y1Domain = $derived(y1DomainProp ?? extent(chartDataArray(data), y1));
|
|
909
|
-
const cDomain = $derived(cDomainProp ?? unique(chartDataArray(data).map(c)));
|
|
910
|
-
|
|
911
|
-
const snappedPadding = $derived($state.snapshot(xPadding));
|
|
912
|
-
const snappedExtents = $derived($state.snapshot(extents));
|
|
913
|
-
|
|
914
|
-
const xScale = $derived(
|
|
915
|
-
createChartScale('x', {
|
|
916
|
-
scale: xScaleProp,
|
|
917
|
-
domain: xDomain,
|
|
918
|
-
padding: snappedPadding,
|
|
919
|
-
nice: xNice,
|
|
920
|
-
reverse: xReverse,
|
|
921
|
-
percentRange,
|
|
922
|
-
range: xRangeProp,
|
|
923
|
-
height,
|
|
924
|
-
width,
|
|
925
|
-
extents: snappedExtents,
|
|
926
|
-
})
|
|
931
|
+
// Whether this is a band scale domain transform (affects scaleExtent and constrain defaults)
|
|
932
|
+
const isBandDomainTransform = $derived(
|
|
933
|
+
transform?.mode === 'domain' && (
|
|
934
|
+
((transform.axis ?? 'both') !== 'y' && isScaleBand(chartState._xScaleProp)) ||
|
|
935
|
+
((transform.axis ?? 'both') !== 'x' && isScaleBand(chartState._yScaleProp))
|
|
936
|
+
)
|
|
927
937
|
);
|
|
928
938
|
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
);
|
|
945
|
-
|
|
946
|
-
const yGet = $derived(createGetter(y, yScale));
|
|
947
|
-
|
|
948
|
-
const zScale = $derived(
|
|
949
|
-
createChartScale('z', {
|
|
950
|
-
scale: zScaleProp,
|
|
951
|
-
domain: zDomain,
|
|
952
|
-
padding: zPadding,
|
|
953
|
-
nice: zNice,
|
|
954
|
-
reverse: zReverse,
|
|
955
|
-
percentRange,
|
|
956
|
-
range: zRangeProp,
|
|
957
|
-
height,
|
|
958
|
-
width,
|
|
959
|
-
extents: filteredExtents,
|
|
960
|
-
})
|
|
961
|
-
);
|
|
962
|
-
const zGet = $derived(createGetter(z, zScale));
|
|
963
|
-
|
|
964
|
-
const rScale = $derived(
|
|
965
|
-
createChartScale('r', {
|
|
966
|
-
scale: rScaleProp,
|
|
967
|
-
domain: rDomain,
|
|
968
|
-
padding: rPadding,
|
|
969
|
-
nice: rNice,
|
|
970
|
-
reverse: rReverse,
|
|
971
|
-
percentRange,
|
|
972
|
-
range: rRangeProp,
|
|
973
|
-
height,
|
|
974
|
-
width,
|
|
975
|
-
extents: filteredExtents,
|
|
976
|
-
})
|
|
977
|
-
);
|
|
939
|
+
// For projection mode, scaleExtent is relative to the initial fitted scale (like d3-zoom).
|
|
940
|
+
// e.g. [0.5, 8] means 0.5x to 8x of the fitted projection scale.
|
|
941
|
+
// For band scale domain transforms, enforce minimum of 1 (can't zoom out past initial view).
|
|
942
|
+
const resolvedScaleExtent = $derived.by(() => {
|
|
943
|
+
if (transform?.mode === 'projection' && transform?.scaleExtent && initialTransform) {
|
|
944
|
+
const baseScale = initialTransform.scale;
|
|
945
|
+
return [
|
|
946
|
+
transform.scaleExtent[0] * baseScale,
|
|
947
|
+
transform.scaleExtent[1] * baseScale,
|
|
948
|
+
] as [number, number];
|
|
949
|
+
}
|
|
950
|
+
if (!isBandDomainTransform) return transform?.scaleExtent;
|
|
951
|
+
const userExtent = transform?.scaleExtent;
|
|
952
|
+
return [Math.max(1, userExtent?.[0] ?? 1), userExtent?.[1] ?? Infinity] as [number, number];
|
|
953
|
+
});
|
|
978
954
|
|
|
979
|
-
|
|
955
|
+
// For projection mode with flat projections, translateExtent defines the pannable world bounds
|
|
956
|
+
// at the initial (1x) zoom level, similar to d3-zoom. The allowed translate range scales with
|
|
957
|
+
// the zoom ratio so you can pan more when zoomed in.
|
|
958
|
+
// For rotation mode (globes), translateExtent is passed through as degrees (yaw/pitch).
|
|
959
|
+
const resolvedTranslateExtent = $derived.by(() => {
|
|
960
|
+
if (transform?.mode === 'projection' && transform?.translateExtent) {
|
|
961
|
+
if (resolvedApply.rotation) {
|
|
962
|
+
// Rotation mode: values are degrees (yaw/pitch), pass through as-is
|
|
963
|
+
return transform.translateExtent;
|
|
964
|
+
}
|
|
965
|
+
// Flat projection translate mode: handled via projectionTranslateConstrain below
|
|
966
|
+
return undefined;
|
|
967
|
+
}
|
|
968
|
+
return transform?.translateExtent;
|
|
969
|
+
});
|
|
980
970
|
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
: null
|
|
989
|
-
);
|
|
971
|
+
// For flat projection mode, implement d3-zoom-style translate constraining:
|
|
972
|
+
// The viewport (at current zoom) must overlap with the translateExtent world bounds.
|
|
973
|
+
// As zoom increases, the allowed translate range grows proportionally.
|
|
974
|
+
const projectionTranslateConstrain = $derived.by(() => {
|
|
975
|
+
if (transform?.mode !== 'projection' || !transform?.translateExtent || !initialTransform || resolvedApply.rotation) {
|
|
976
|
+
return undefined;
|
|
977
|
+
}
|
|
990
978
|
|
|
991
|
-
|
|
979
|
+
const baseScale = initialTransform.scale;
|
|
980
|
+
const baseTranslate = initialTransform.translate;
|
|
981
|
+
const [[x0, y0], [x1, y1]] = transform.translateExtent;
|
|
992
982
|
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
width,
|
|
998
|
-
height,
|
|
999
|
-
})
|
|
1000
|
-
: null
|
|
1001
|
-
);
|
|
983
|
+
return (t: { scale: number; translate: { x: number; y: number } }) => {
|
|
984
|
+
let { scale, translate } = t;
|
|
985
|
+
// Zoom ratio relative to fitted scale
|
|
986
|
+
const k = scale / baseScale;
|
|
1002
987
|
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
: null
|
|
1009
|
-
);
|
|
988
|
+
// Allowed translate range scales with zoom ratio
|
|
989
|
+
translate = {
|
|
990
|
+
x: Math.max(baseTranslate.x + x0 * k, Math.min(baseTranslate.x + x1 * k, translate.x)),
|
|
991
|
+
y: Math.max(baseTranslate.y + y0 * k, Math.min(baseTranslate.y + y1 * k, translate.y)),
|
|
992
|
+
};
|
|
1010
993
|
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
const xDomainPossiblyNice = $derived(xScale.domain());
|
|
1014
|
-
const yDomainPossiblyNice = $derived(yScale.domain());
|
|
1015
|
-
const zDomainPossiblyNice = $derived(zScale.domain());
|
|
1016
|
-
const rDomainPossiblyNice = $derived(rScale.domain());
|
|
1017
|
-
|
|
1018
|
-
const xRange = $derived(getRange(xScale));
|
|
1019
|
-
const yRange = $derived(getRange(yScale));
|
|
1020
|
-
const zRange = $derived(getRange(zScale));
|
|
1021
|
-
const rRange = $derived(getRange(rScale));
|
|
1022
|
-
|
|
1023
|
-
const aspectRatio = $derived(width / height);
|
|
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,
|
|
994
|
+
return { scale, translate };
|
|
995
|
+
};
|
|
1047
996
|
});
|
|
1048
997
|
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
return
|
|
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
|
-
};
|
|
1269
|
-
|
|
1270
|
-
contextProp = context;
|
|
1271
|
-
|
|
1272
|
-
setChartContext(context);
|
|
1273
|
-
|
|
1274
|
-
$effect(() => {
|
|
1275
|
-
isMounted = true;
|
|
998
|
+
// Default constrain for band scale domain transforms: prevent panning past data boundaries
|
|
999
|
+
const bandScaleConstrain = $derived.by(() => {
|
|
1000
|
+
if (!isBandDomainTransform) return undefined;
|
|
1001
|
+
const xIsBand =
|
|
1002
|
+
(transform!.axis ?? 'both') !== 'y' && isScaleBand(chartState._xScaleProp);
|
|
1003
|
+
const yIsBand =
|
|
1004
|
+
(transform!.axis ?? 'both') !== 'x' && isScaleBand(chartState._yScaleProp);
|
|
1005
|
+
|
|
1006
|
+
return (t: { scale: number; translate: { x: number; y: number } }) => {
|
|
1007
|
+
let { scale, translate } = t;
|
|
1008
|
+
let tx = translate.x;
|
|
1009
|
+
let ty = translate.y;
|
|
1010
|
+
if (xIsBand) {
|
|
1011
|
+
// translate.x must be in [width * (1 - scale), 0]
|
|
1012
|
+
tx = Math.max(chartState.width * (1 - scale), Math.min(0, tx));
|
|
1013
|
+
}
|
|
1014
|
+
if (yIsBand) {
|
|
1015
|
+
ty = Math.max(chartState.height * (1 - scale), Math.min(0, ty));
|
|
1016
|
+
}
|
|
1017
|
+
return { scale, translate: { x: tx, y: ty } };
|
|
1018
|
+
};
|
|
1276
1019
|
});
|
|
1277
1020
|
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
z: zProp,
|
|
1288
|
-
r: rProp,
|
|
1289
|
-
xScale,
|
|
1290
|
-
yScale,
|
|
1291
|
-
zScale,
|
|
1292
|
-
rScale,
|
|
1293
|
-
});
|
|
1294
|
-
}
|
|
1021
|
+
// Compose user-provided constrain with domainExtent constrain and band scale constrain
|
|
1022
|
+
const composedConstrain = $derived.by(() => {
|
|
1023
|
+
const userConstrain = transform?.constrain;
|
|
1024
|
+
const constrains = [bandScaleConstrain, domainExtentConstrain, projectionTranslateConstrain, userConstrain].filter(Boolean) as Array<(t: { scale: number; translate: { x: number; y: number } }) => { scale: number; translate: { x: number; y: number } }>;
|
|
1025
|
+
if (constrains.length === 0) return undefined;
|
|
1026
|
+
if (constrains.length === 1) return constrains[0];
|
|
1027
|
+
return (t: { scale: number; translate: { x: number; y: number } }) => {
|
|
1028
|
+
return constrains.reduce((acc, fn) => fn(acc), t);
|
|
1029
|
+
};
|
|
1295
1030
|
});
|
|
1296
1031
|
|
|
1297
|
-
$
|
|
1298
|
-
if (!
|
|
1299
|
-
|
|
1300
|
-
width: context.width,
|
|
1301
|
-
height: context.height,
|
|
1302
|
-
containerWidth: context.containerWidth,
|
|
1303
|
-
containerHeight: context.containerHeight,
|
|
1304
|
-
});
|
|
1305
|
-
});
|
|
1032
|
+
const enhancedBrushProps = $derived.by(() => {
|
|
1033
|
+
if (!brush) return { disabled: true };
|
|
1034
|
+
const userProps = typeof brush === 'object' ? brush : {};
|
|
1306
1035
|
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
);
|
|
1036
|
+
const userOnBrushEnd = userProps.onBrushEnd;
|
|
1037
|
+
const zoomOnBrush = 'zoomOnBrush' in userProps ? userProps.zoomOnBrush : false;
|
|
1038
|
+
const needsEnhancement = transform?.mode === 'domain' || zoomOnBrush;
|
|
1039
|
+
if (!needsEnhancement) return userProps;
|
|
1312
1040
|
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1041
|
+
return {
|
|
1042
|
+
...userProps,
|
|
1043
|
+
onBrushEnd: (e: { brush: BrushState }) => {
|
|
1044
|
+
if (e.brush.active) {
|
|
1045
|
+
if (transform?.mode === 'domain') {
|
|
1046
|
+
chartState.zoomToBrush(e.brush, userProps.axis ?? 'x');
|
|
1047
|
+
} else if (zoomOnBrush) {
|
|
1048
|
+
const axis = userProps.axis ?? 'x';
|
|
1049
|
+
if (axis === 'x' || axis === 'both') {
|
|
1050
|
+
brushXDomain = expandBandBrushDomain(e.brush.x, chartState._baseXDomain);
|
|
1051
|
+
}
|
|
1052
|
+
if (axis === 'y' || axis === 'both') {
|
|
1053
|
+
brushYDomain = expandBandBrushDomain(e.brush.y, chartState._baseYDomain);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
userOnBrushEnd?.(e);
|
|
1057
|
+
e.brush.reset();
|
|
1058
|
+
} else {
|
|
1059
|
+
// Brush was cleared (click-to-reset) — reset transform/domain too
|
|
1060
|
+
if (transform?.mode === 'domain') {
|
|
1061
|
+
chartState.transform.reset();
|
|
1062
|
+
} else if (zoomOnBrush) {
|
|
1063
|
+
brushXDomain = undefined;
|
|
1064
|
+
brushYDomain = undefined;
|
|
1065
|
+
}
|
|
1066
|
+
userOnBrushEnd?.(e);
|
|
1067
|
+
}
|
|
1068
|
+
},
|
|
1329
1069
|
};
|
|
1330
1070
|
});
|
|
1331
|
-
|
|
1332
|
-
const brushProps = $derived(typeof brush === 'object' ? brush : { disabled: !brush });
|
|
1333
|
-
const tooltipProps = $derived(typeof tooltip === 'object' ? tooltip : {});
|
|
1334
1071
|
</script>
|
|
1335
1072
|
|
|
1336
1073
|
{#if ssr === true || typeof window !== 'undefined'}
|
|
1337
1074
|
<div
|
|
1338
1075
|
bind:this={ref}
|
|
1339
1076
|
style:position
|
|
1340
|
-
style:top={position === 'absolute' ?
|
|
1341
|
-
style:right={position === 'absolute' ?
|
|
1342
|
-
style:bottom={position === 'absolute' ?
|
|
1343
|
-
style:left={position === 'absolute' ?
|
|
1077
|
+
style:top={position === 'absolute' ? 0 : null}
|
|
1078
|
+
style:right={position === 'absolute' ? 0 : null}
|
|
1079
|
+
style:bottom={position === 'absolute' ? 0 : null}
|
|
1080
|
+
style:left={position === 'absolute' ? 0 : null}
|
|
1344
1081
|
style:pointer-events={pointerEvents === false ? 'none' : null}
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1082
|
+
style:overflow={clip ? 'hidden' : null}
|
|
1083
|
+
style:width={width ? `${width}px` : '100%'}
|
|
1084
|
+
style:height={height ? `${height}px` : '100%'}
|
|
1085
|
+
bind:clientWidth={chartState._containerWidth}
|
|
1086
|
+
bind:clientHeight={chartState._containerHeight}
|
|
1087
|
+
class={['lc-root-container', className]}
|
|
1088
|
+
{...restProps}
|
|
1348
1089
|
>
|
|
1349
|
-
{#key isMounted}
|
|
1090
|
+
{#key chartState.isMounted}
|
|
1350
1091
|
<!-- svelte-ignore ownership_invalid_binding -->
|
|
1092
|
+
{@const { domainExtent: _de, constrain: _uc, apply: _apply, scaleExtent: _se, translateExtent: _te, ...transformProps } = transform ?? {}}
|
|
1351
1093
|
<TransformContext
|
|
1352
|
-
bind:
|
|
1353
|
-
mode={
|
|
1354
|
-
initialTranslate={initialTransform?.translate}
|
|
1355
|
-
initialScale={initialTransform?.scale}
|
|
1094
|
+
bind:state={chartState.transformState}
|
|
1095
|
+
mode={transform?.mode ?? 'none'}
|
|
1096
|
+
initialTranslate={resolvedApply.translate ? initialTransform?.translate : undefined}
|
|
1097
|
+
initialScale={resolvedApply.scale ? initialTransform?.scale : undefined}
|
|
1356
1098
|
{processTranslate}
|
|
1357
|
-
{...
|
|
1099
|
+
{...transformProps}
|
|
1100
|
+
scaleExtent={resolvedScaleExtent}
|
|
1101
|
+
translateExtent={resolvedTranslateExtent}
|
|
1102
|
+
constrain={composedConstrain}
|
|
1103
|
+
disablePointer={(brush === true || (typeof brush === 'object' && !brush.disabled)) || transform?.disablePointer}
|
|
1358
1104
|
{ondragstart}
|
|
1359
1105
|
{onTransform}
|
|
1360
1106
|
{ondragend}
|
|
1361
1107
|
>
|
|
1362
1108
|
<!-- svelte-ignore ownership_invalid_binding -->
|
|
1363
|
-
<
|
|
1109
|
+
<BrushContext {...enhancedBrushProps} bind:state={chartState.brushState}>
|
|
1364
1110
|
<!-- svelte-ignore ownership_invalid_binding -->
|
|
1365
|
-
<
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
context,
|
|
1370
|
-
})}
|
|
1371
|
-
</TooltipContext>
|
|
1372
|
-
</BrushContext>
|
|
1373
|
-
</GeoContext>
|
|
1111
|
+
<TooltipContext onclick={onTooltipClick} {...getObjectOrNull(tooltipContext)} bind:state={chartState.tooltipState}>
|
|
1112
|
+
<ChartChildren {children} {tooltipContext} {...restProps} />
|
|
1113
|
+
</TooltipContext>
|
|
1114
|
+
</BrushContext>
|
|
1374
1115
|
</TransformContext>
|
|
1375
1116
|
{/key}
|
|
1376
1117
|
</div>
|
|
@@ -1381,8 +1122,4 @@
|
|
|
1381
1122
|
.lc-root-container :global(*) {
|
|
1382
1123
|
box-sizing: border-box;
|
|
1383
1124
|
}
|
|
1384
|
-
.lc-root-container {
|
|
1385
|
-
width: 100%;
|
|
1386
|
-
height: 100%;
|
|
1387
|
-
}
|
|
1388
1125
|
</style>
|