@d3plus/core 4.7.0 → 4.9.0
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/README.md +1 -26117
- package/es/index.js +1 -3
- package/es/internal.js +148 -7
- package/es/src/charts/AreaPlot/index.js +7 -10
- package/es/src/charts/BarChart/index.js +50 -17
- package/es/src/charts/Beeswarm/index.js +39 -0
- package/es/src/charts/BoxWhisker/index.js +6 -16
- package/es/src/charts/Bullet/applyLayout.js +157 -0
- package/es/src/charts/Bullet/bulletGeometry.js +215 -0
- package/es/src/charts/Bullet/bulletLayout.js +111 -0
- package/es/src/charts/Bullet/bulletStyle.js +44 -0
- package/es/src/charts/Bullet/emit.js +258 -0
- package/es/src/charts/Bullet/index.js +268 -0
- package/es/src/charts/BumpChart/index.js +21 -49
- package/es/src/charts/Calendar/applyLayout.js +120 -0
- package/es/src/charts/Calendar/calendarDates.js +151 -0
- package/es/src/charts/Calendar/calendarFormat.js +40 -0
- package/es/src/charts/Calendar/calendarGrid.js +138 -0
- package/es/src/charts/Calendar/calendarInset.js +22 -0
- package/es/src/charts/Calendar/calendarLayout.js +242 -0
- package/es/src/charts/Calendar/emit.js +179 -0
- package/es/src/charts/Calendar/index.js +206 -0
- package/es/src/charts/Candlestick/aggregate.js +154 -0
- package/es/src/charts/Candlestick/buffer.js +83 -0
- package/es/src/charts/Candlestick/emit.js +198 -0
- package/es/src/charts/Candlestick/index.js +257 -0
- package/es/src/charts/Candlestick/ohlc.js +114 -0
- package/es/src/charts/Candlestick/periods.js +191 -0
- package/es/src/charts/Candlestick/tooltip.js +116 -0
- package/es/src/charts/Candlestick/volume.js +278 -0
- package/es/src/charts/Chord/applyLayout.js +75 -111
- package/es/src/charts/Chord/emit.js +82 -173
- package/es/src/charts/Chord/index.js +92 -106
- package/es/src/charts/Donut/index.js +6 -12
- package/es/src/charts/Dumbbell/emit.js +106 -0
- package/es/src/charts/Dumbbell/gapSort.js +79 -0
- package/es/src/charts/Dumbbell/index.js +84 -0
- package/es/src/charts/FanChart/index.js +28 -0
- package/es/src/charts/Funnel/applyLayout.js +103 -0
- package/es/src/charts/Funnel/emit.js +99 -0
- package/es/src/charts/Funnel/funnelFacet.js +53 -0
- package/es/src/charts/Funnel/funnelGeometry.js +171 -0
- package/es/src/charts/Funnel/funnelLabels.js +118 -0
- package/es/src/charts/Funnel/index.js +180 -0
- package/es/src/charts/Funnel/labelNodes.js +202 -0
- package/es/src/charts/Gauge/applyLayout.js +70 -0
- package/es/src/charts/Gauge/dialLayout.js +106 -0
- package/es/src/charts/Gauge/emit.js +214 -0
- package/es/src/charts/Gauge/emitDial.js +167 -0
- package/es/src/charts/Gauge/gaugeGeometry.js +157 -0
- package/es/src/charts/Gauge/index.js +148 -0
- package/es/src/charts/Geomap/applyLayout.js +42 -73
- package/es/src/charts/Geomap/basemapTheme.js +16 -31
- package/es/src/charts/Geomap/emit.js +94 -162
- package/es/src/charts/Geomap/index.js +186 -193
- package/es/src/charts/Geomap/projections.js +37 -0
- package/es/src/charts/Histogram/binData.js +60 -209
- package/es/src/charts/Histogram/index.js +104 -137
- package/es/src/charts/Icicle/applyLayout.js +124 -0
- package/es/src/charts/Icicle/emit.js +162 -0
- package/es/src/charts/Icicle/enterStagger.js +55 -0
- package/es/src/charts/Icicle/geometry.js +101 -0
- package/es/src/charts/Icicle/index.js +130 -0
- package/es/src/charts/Icicle/interaction.js +20 -0
- package/es/src/charts/Icicle/labelFit.js +55 -0
- package/es/src/charts/Icicle/layout.js +20 -0
- package/es/src/charts/LinePlot/index.js +1 -9
- package/es/src/charts/Lollipop/emit.js +85 -0
- package/es/src/charts/Lollipop/index.js +97 -0
- package/es/src/charts/Lollipop/stemLayout.js +97 -0
- package/es/src/charts/Marimekko/axis.js +46 -0
- package/es/src/charts/Marimekko/index.js +77 -0
- package/es/src/charts/Matrix/applyLayout.js +22 -27
- package/es/src/charts/Matrix/emit.js +33 -34
- package/es/src/charts/Matrix/index.js +56 -80
- package/es/src/charts/Network/applyLayout.js +95 -172
- package/es/src/charts/Network/emit.js +132 -266
- package/es/src/charts/Network/index.js +148 -132
- package/es/src/charts/Pack/applyLayout.js +12 -17
- package/es/src/charts/Pack/emit.js +44 -106
- package/es/src/charts/Pack/index.js +63 -107
- package/es/src/charts/Pack/recursionCircles.js +2 -5
- package/es/src/charts/ParallelCoordinates/applyLayout.js +99 -0
- package/es/src/charts/ParallelCoordinates/axes.js +213 -0
- package/es/src/charts/ParallelCoordinates/brushDom.js +187 -0
- package/es/src/charts/ParallelCoordinates/brushFilter.js +79 -0
- package/es/src/charts/ParallelCoordinates/dimensions.js +102 -0
- package/es/src/charts/ParallelCoordinates/emit.js +72 -0
- package/es/src/charts/ParallelCoordinates/format.js +23 -0
- package/es/src/charts/ParallelCoordinates/index.js +190 -0
- package/es/src/charts/ParallelCoordinates/lineStates.js +62 -0
- package/es/src/charts/ParallelCoordinates/paths.js +31 -0
- package/es/src/charts/ParallelCoordinates/titles.js +56 -0
- package/es/src/charts/Pie/applyLayout.js +20 -28
- package/es/src/charts/Pie/emit.js +109 -219
- package/es/src/charts/Pie/index.js +49 -78
- package/es/src/charts/Plot/axisInk.js +31 -0
- package/es/src/charts/Plot/barConfidence.js +273 -0
- package/es/src/charts/Plot/barWidth.js +255 -0
- package/es/src/charts/Plot/baselineBreak.js +139 -0
- package/es/src/charts/Plot/baselineDomain.js +120 -0
- package/es/src/charts/Plot/columnHighlight.js +39 -0
- package/es/src/charts/Plot/confidenceBands.js +143 -0
- package/es/src/charts/Plot/confidenceConfig.js +50 -0
- package/es/src/charts/Plot/confidenceTooltip.js +102 -0
- package/es/src/charts/Plot/curveLength.js +97 -0
- package/es/src/charts/Plot/discreteDomain.js +19 -0
- package/es/src/charts/Plot/discreteSpan.js +6 -24
- package/es/src/charts/Plot/domainClip.js +190 -0
- package/es/src/charts/Plot/draw.js +164 -295
- package/es/src/charts/Plot/facetScales.js +27 -0
- package/es/src/charts/Plot/fillBetween.js +233 -0
- package/es/src/charts/Plot/forecast.js +211 -0
- package/es/src/charts/Plot/forecastScene.js +316 -0
- package/es/src/charts/Plot/index.js +355 -930
- package/es/src/charts/Plot/insetRegion.js +5 -10
- package/es/src/charts/Plot/labelPlacement.js +12 -14
- package/es/src/charts/Plot/lineBands.js +48 -0
- package/es/src/charts/Plot/lineCurve.js +25 -0
- package/es/src/charts/Plot/openDomainEnds.js +92 -0
- package/es/src/charts/Plot/pipeline.js +143 -480
- package/es/src/charts/Plot/pipelineAxisLayout.js +132 -0
- package/es/src/charts/Plot/pipelineDomains.js +121 -239
- package/es/src/charts/Plot/pipelineLineLabels.js +81 -147
- package/es/src/charts/Plot/pipelineScales.js +177 -0
- package/es/src/charts/Plot/plotBreaks.js +223 -0
- package/es/src/charts/Plot/plotFacet.js +172 -0
- package/es/src/charts/Plot/plotInit.js +252 -0
- package/es/src/charts/Plot/plotZoom.js +105 -206
- package/es/src/charts/Plot/shapeDefaults.js +66 -81
- package/es/src/charts/Plot/sharedHover.js +185 -308
- package/es/src/charts/Plot/sharedHoverScene.js +115 -157
- package/es/src/charts/Plot/sharedTooltip.js +96 -104
- package/es/src/charts/Plot/stackEnter.js +87 -0
- package/es/src/charts/Plot/stackHelpers.js +36 -69
- package/es/src/charts/Plot/stackShareLabels.js +34 -88
- package/es/src/charts/Plot/stackShareTooltip.js +10 -15
- package/es/src/charts/Plot/swarm.js +96 -0
- package/es/src/charts/Plot/swarmLayout.js +102 -0
- package/es/src/charts/Plot/trendLines.js +105 -321
- package/es/src/charts/Plot/trendProjection.js +27 -69
- package/es/src/charts/Plot/trendScene.js +27 -171
- package/es/src/charts/Plot/trendTooltip.js +50 -132
- package/es/src/charts/PolarArea/applyLayout.js +26 -0
- package/es/src/charts/PolarArea/emit.js +12 -0
- package/es/src/charts/PolarArea/index.js +183 -0
- package/es/src/charts/Priestley/applyLayout.js +33 -53
- package/es/src/charts/Priestley/emit.js +50 -111
- package/es/src/charts/Priestley/index.js +35 -35
- package/es/src/charts/Pyramid/gutter.js +208 -0
- package/es/src/charts/Pyramid/index.js +373 -0
- package/es/src/charts/Pyramid/pyramidData.js +65 -0
- package/es/src/charts/Pyramid/scene.js +224 -0
- package/es/src/charts/Pyramid/stackOrder.js +39 -0
- package/es/src/charts/Radar/applyLayout.js +52 -291
- package/es/src/charts/Radar/axisDecorations.js +200 -0
- package/es/src/charts/Radar/axisLabels.js +109 -0
- package/es/src/charts/Radar/emit.js +23 -19
- package/es/src/charts/Radar/index.js +64 -45
- package/es/src/charts/Radar/levels.js +136 -0
- package/es/src/charts/Radar/rings.js +72 -0
- package/es/src/charts/RadialBar/applyLayout.js +47 -0
- package/es/src/charts/RadialBar/emit.js +38 -0
- package/es/src/charts/RadialBar/index.js +221 -0
- package/es/src/charts/RadialBar/trackLayout.js +330 -0
- package/es/src/charts/RadialBar/tracks.js +53 -0
- package/es/src/charts/RadialMatrix/applyLayout.js +42 -80
- package/es/src/charts/RadialMatrix/emit.js +23 -23
- package/es/src/charts/RadialMatrix/index.js +65 -67
- package/es/src/charts/Ridgeline/emit.js +75 -0
- package/es/src/charts/Ridgeline/index.js +55 -0
- package/es/src/charts/Rings/applyLayout.js +124 -266
- package/es/src/charts/Rings/emit.js +127 -236
- package/es/src/charts/Rings/index.js +118 -98
- package/es/src/charts/Rings/ringsGraph.js +88 -0
- package/es/src/charts/Rings/ringsSizing.js +41 -89
- package/es/src/charts/Sankey/applyLayout.js +32 -60
- package/es/src/charts/Sankey/emit.js +94 -150
- package/es/src/charts/Sankey/index.js +130 -104
- package/es/src/charts/Sankey/sankeyLayout.js +283 -0
- package/es/src/charts/StackedArea/index.js +3 -10
- package/es/src/charts/Sunburst/applyLayout.js +116 -0
- package/es/src/charts/Sunburst/emit.js +181 -0
- package/es/src/charts/Sunburst/geometry.js +98 -0
- package/es/src/charts/Sunburst/index.js +168 -0
- package/es/src/charts/Sunburst/interaction.js +23 -0
- package/es/src/charts/Sunburst/labelFit.js +159 -0
- package/es/src/charts/Sunburst/partition.js +32 -0
- package/es/src/charts/Tree/applyLayout.js +78 -130
- package/es/src/charts/Tree/emit.js +76 -184
- package/es/src/charts/Tree/index.js +26 -37
- package/es/src/charts/Treemap/applyLayout.js +34 -57
- package/es/src/charts/Treemap/emit.js +57 -136
- package/es/src/charts/Treemap/index.js +57 -95
- package/es/src/charts/Treemap/thresholdFunction.js +14 -75
- package/es/src/charts/Violin/emit.js +80 -0
- package/es/src/charts/Violin/index.js +88 -0
- package/es/src/charts/Violin/inner.js +196 -0
- package/es/src/charts/Violin/violinLayout.js +80 -0
- package/es/src/charts/Waffle/applyLayout.js +90 -0
- package/es/src/charts/Waffle/emit.js +89 -0
- package/es/src/charts/Waffle/index.js +170 -0
- package/es/src/charts/Waffle/tooltip.js +37 -0
- package/es/src/charts/Waffle/waffleLayout.js +104 -0
- package/es/src/charts/Waterfall/buffer.js +65 -0
- package/es/src/charts/Waterfall/connectors.js +103 -0
- package/es/src/charts/Waterfall/index.js +211 -0
- package/es/src/charts/Waterfall/labels.js +82 -0
- package/es/src/charts/Waterfall/state.js +147 -0
- package/es/src/charts/Waterfall/steps.js +138 -0
- package/es/src/charts/definition/ChartDefinition.js +2 -4
- package/es/src/charts/definition/applyDefinition.js +4 -88
- package/es/src/charts/definition/makeChart.js +35 -141
- package/es/src/charts/drawSteps/backControl.js +15 -14
- package/es/src/charts/drawSteps/bottomRightControls.js +39 -115
- package/es/src/charts/drawSteps/bottomRightControlsMarkup.js +60 -174
- package/es/src/charts/drawSteps/controlButtonStyle.js +39 -63
- package/es/src/charts/drawSteps/minimap.js +82 -139
- package/es/src/charts/drawSteps/minimapMarkup.js +13 -93
- package/es/src/charts/drawSteps/searchControls.js +48 -105
- package/es/src/charts/drawSteps/searchControlsMarkup.js +62 -176
- package/es/src/charts/drawSteps/tableView.js +23 -40
- package/es/src/charts/drawSteps/tableViewControl.js +2 -8
- package/es/src/charts/drawSteps/tableViewMarkup.js +152 -233
- package/es/src/charts/drawSteps/topLeftControls.js +8 -28
- package/es/src/charts/drawSteps/topLeftControlsMarkup.js +49 -119
- package/es/src/charts/drawSteps/zoomControls.js +72 -145
- package/es/src/charts/drawSteps/zoomControlsMarkup.js +59 -124
- package/es/src/charts/drawSteps/zoomGesture.js +17 -0
- package/es/src/charts/drawSteps/zoomShown.js +40 -0
- package/es/src/charts/events/click.legend.js +12 -23
- package/es/src/charts/events/click.shape.js +6 -11
- package/es/src/charts/events/mouseenter.js +14 -24
- package/es/src/charts/events/mouseleave.js +29 -14
- package/es/src/charts/events/mousemove.legend.js +20 -30
- package/es/src/charts/events/mousemove.shape.js +12 -21
- package/es/src/charts/events/touchstart.body.js +0 -2
- package/es/src/charts/facet/drawFacets.js +332 -0
- package/es/src/charts/facet/facetConfig.js +72 -0
- package/es/src/charts/facet/facetData.js +97 -0
- package/es/src/charts/facet/facetGrid.js +107 -0
- package/es/src/charts/facet/facetGutter.js +131 -0
- package/es/src/charts/facet/facetPanel.js +56 -0
- package/es/src/charts/facet/facetScene.js +111 -0
- package/es/src/charts/features/attributionFeature.js +38 -38
- package/es/src/charts/features/axes.js +105 -304
- package/es/src/charts/features/axesFinal.js +134 -0
- package/es/src/charts/features/axesMeasure.js +138 -0
- package/es/src/charts/features/backgroundImageEmit.js +61 -0
- package/es/src/charts/features/chartGeometry.js +3 -5
- package/es/src/charts/features/colorScaleBucket.js +17 -21
- package/es/src/charts/features/edgeArrows.js +36 -70
- package/es/src/charts/features/emitHelpers.js +42 -137
- package/es/src/charts/features/ensureZoomDom.js +27 -40
- package/es/src/charts/features/features.js +216 -256
- package/es/src/charts/features/featuresColorScale.js +40 -39
- package/es/src/charts/features/featuresLegend.js +152 -188
- package/es/src/charts/features/frozenAxis.js +14 -0
- package/es/src/charts/features/insetState.js +25 -90
- package/es/src/charts/features/legendCategory.js +61 -0
- package/es/src/charts/features/legendLabel.js +5 -9
- package/es/src/charts/features/lineLabels.js +20 -87
- package/es/src/charts/features/plotAnnotations.js +105 -0
- package/es/src/charts/features/plotEndLabels.js +209 -0
- package/es/src/charts/features/plotPaint.js +192 -404
- package/es/src/charts/features/sceneBounds.js +57 -164
- package/es/src/charts/features/shapeEmit.js +183 -184
- package/es/src/charts/features/shareKey.js +32 -0
- package/es/src/charts/features/sharedFields.js +38 -0
- package/es/src/charts/features/tooltipSwatch.js +99 -42
- package/es/src/charts/features/xAxisConfig.js +19 -0
- package/es/src/charts/features/zoomExtent.js +23 -108
- package/es/src/charts/helpers/densityChart.js +267 -0
- package/es/src/charts/helpers/densityData.js +116 -0
- package/es/src/charts/helpers/densityEnter.js +64 -0
- package/es/src/charts/helpers/matrixData.js +11 -82
- package/es/src/charts/helpers/tileAttributions.js +1 -3
- package/es/src/charts/helpers/valueTitle.js +29 -0
- package/es/src/charts/index.js +20 -2
- package/es/src/charts/partition/chartFields.js +43 -0
- package/es/src/charts/partition/hierarchy.js +174 -0
- package/es/src/charts/partition/interaction.js +158 -0
- package/es/src/charts/partition/labelWords.js +95 -0
- package/es/src/charts/partition/shade.js +56 -0
- package/es/src/charts/partition/zoom.js +80 -0
- package/es/src/charts/pipeline/drillMorph.js +16 -37
- package/es/src/charts/pipeline/insetPlacement.js +95 -188
- package/es/src/charts/pipeline/preDrawData.js +74 -0
- package/es/src/charts/pipeline/resolveSpec.js +1 -3
- package/es/src/charts/pipeline/runChartDraw.js +14 -69
- package/es/src/charts/pipeline/runVizPipeline.js +13 -35
- package/es/src/charts/pipeline/stages.js +24 -61
- package/es/src/charts/pipeline/vizDraw.js +165 -30
- package/es/src/charts/pipeline/vizPreDraw.js +145 -106
- package/es/src/charts/plotBuffers/Bar.js +7 -108
- package/es/src/charts/plotBuffers/Box.js +6 -102
- package/es/src/charts/plotBuffers/Circle.js +11 -14
- package/es/src/charts/plotBuffers/Line.js +7 -13
- package/es/src/charts/plotBuffers/Rect.js +11 -15
- package/es/src/charts/plotBuffers/defaultBuffers.js +12 -0
- package/es/src/charts/plotBuffers/discreteBuffer.js +5 -9
- package/es/src/charts/plotBuffers/numericBuffer.js +24 -33
- package/es/src/charts/plotBuffers/rectLikeBuffer.js +39 -0
- package/es/src/charts/polar/chrome.js +170 -0
- package/es/src/charts/polar/config.js +82 -0
- package/es/src/charts/polar/geometry.js +92 -0
- package/es/src/charts/polar/labels.js +124 -0
- package/es/src/charts/polar/polarFacet.js +43 -0
- package/es/src/charts/polar/wedgeLayout.js +140 -0
- package/es/src/charts/viz/Viz.js +503 -991
- package/es/src/charts/viz/VizBase.js +260 -613
- package/es/src/charts/viz/backgroundInk.js +17 -0
- package/es/src/charts/viz/interactionOpacity.js +92 -135
- package/es/src/charts/viz/labelDefaults.js +61 -0
- package/es/src/charts/viz/linkGroup.js +63 -237
- package/es/src/charts/viz/ordinalColor.js +12 -44
- package/es/src/charts/viz/reserveContainerSize.js +49 -0
- package/es/src/charts/viz/resetChromeBoxes.js +41 -0
- package/es/src/charts/viz/sceneRows.js +7 -9
- package/es/src/charts/viz/shapeClassTargets.js +33 -0
- package/es/src/charts/viz/shapeHover.js +9 -0
- package/es/src/charts/viz/simpleHover.js +14 -0
- package/es/src/charts/viz/trailCatchup.js +28 -87
- package/es/src/charts/viz/vizDefaults.js +113 -385
- package/es/src/charts/viz/vizFields.js +197 -0
- package/es/src/charts/viz/vizRender.js +84 -78
- package/es/src/charts/viz/vizTypes.js +1 -3
- package/es/src/charts/viz/vizVisibility.js +32 -51
- package/es/src/components/Axis/Axis.js +304 -469
- package/es/src/components/Axis/AxisBottom.js +9 -74
- package/es/src/components/Axis/AxisLeft.js +9 -74
- package/es/src/components/Axis/AxisRight.js +9 -74
- package/es/src/components/Axis/AxisTop.js +9 -74
- package/es/src/components/Axis/axisBreak.js +243 -0
- package/es/src/components/Axis/axisDefaults.js +65 -0
- package/es/src/components/Axis/axisEndLabels.js +60 -0
- package/es/src/components/Axis/axisLabelThinning.js +123 -0
- package/es/src/components/Axis/axisLayout.js +211 -160
- package/es/src/components/Axis/axisLayoutLabels.js +187 -108
- package/es/src/components/Axis/axisLayoutScale.js +130 -247
- package/es/src/components/Axis/axisRender.js +82 -411
- package/es/src/components/Axis/axisRounding.js +68 -0
- package/es/src/components/Axis/axisScene.js +184 -0
- package/es/src/components/Axis/brokenScale.js +183 -0
- package/es/src/components/Axis/gridStroke.js +10 -0
- package/es/src/components/Axis/timeValues.js +155 -0
- package/es/src/components/Axis/yearValues.js +32 -0
- package/es/src/components/ColorScale/ColorScale.js +187 -345
- package/es/src/components/ColorScale/colorScaleRender.js +72 -108
- package/es/src/components/ColorScale/colorScaleScale.js +101 -164
- package/es/src/components/Legend/Legend.js +164 -352
- package/es/src/components/Legend/legendConfig.js +43 -55
- package/es/src/components/Legend/legendRender.js +61 -109
- package/es/src/components/Message.js +50 -98
- package/es/src/components/SizeLegend/SizeLegend.js +188 -330
- package/es/src/components/SizeLegend/sizeLegendLayout.js +65 -161
- package/es/src/components/TextBox.js +156 -615
- package/es/src/components/Timeline/Timeline.js +345 -554
- package/es/src/components/Timeline/timelineConfig.js +23 -56
- package/es/src/components/Timeline/timelineRender.js +58 -112
- package/es/src/components/Tooltip.js +128 -607
- package/es/src/components/index.js +0 -2
- package/es/src/components/textBoxLayout.js +230 -0
- package/es/src/components/tooltipDom.js +218 -0
- package/es/src/fluent.js +177 -203
- package/es/src/shapes/Area.js +128 -329
- package/es/src/shapes/Bar.js +92 -245
- package/es/src/shapes/Box.js +231 -405
- package/es/src/shapes/Circle.js +46 -199
- package/es/src/shapes/Image.js +98 -210
- package/es/src/shapes/Line.js +73 -251
- package/es/src/shapes/Path.js +34 -149
- package/es/src/shapes/Rect.js +57 -210
- package/es/src/shapes/Shape.js +328 -655
- package/es/src/shapes/Whisker.js +166 -371
- package/es/src/shapes/buildLabelData.js +31 -80
- package/es/src/shapes/emitLabels.js +17 -49
- package/es/src/shapes/hitAreaNode.js +8 -10
- package/es/src/shapes/index.js +0 -2
- package/es/src/shapes/interactionPoints.js +5 -7
- package/es/src/shapes/sceneSort.js +61 -161
- package/es/src/shapes/shapeConfig.js +0 -2
- package/es/src/shapes/shapeOwners.js +37 -0
- package/es/src/shapes/shapeStandalone.js +71 -0
- package/es/src/shapes/textureKey.js +11 -61
- package/es/src/shapes/uniqueIds.js +19 -0
- package/es/src/shapes/validateShapeConfig.js +23 -119
- package/es/src/utils/AccessorFn.js +0 -2
- package/es/src/utils/BaseClass.js +114 -262
- package/es/src/utils/D3Scale.js +0 -2
- package/es/src/utils/D3plusConfig.js +0 -2
- package/es/src/utils/RESET.js +1 -3
- package/es/src/utils/accessor.js +2 -8
- package/es/src/utils/configDefault.js +1 -3
- package/es/src/utils/configPrep.js +15 -35
- package/es/src/utils/configWarnings.js +11 -13
- package/es/src/utils/constant.js +0 -2
- package/es/src/utils/getProp.js +0 -2
- package/es/src/utils/index.js +0 -2
- package/es/src/utils/paintComponentScene.js +12 -23
- package/es/src/utils/wholeWords.js +44 -0
- package/package.json +16 -25
- package/types/index.d.ts +12 -4
- package/types/internal.d.ts +210 -12
- package/types/src/charts/AreaPlot/index.d.ts +2 -1
- package/types/src/charts/BarChart/index.d.ts +4 -2
- package/types/src/charts/Beeswarm/index.d.ts +15 -0
- package/types/src/charts/Bullet/applyLayout.d.ts +65 -0
- package/types/src/charts/Bullet/bulletGeometry.d.ts +91 -0
- package/types/src/charts/Bullet/bulletLayout.d.ts +54 -0
- package/types/src/charts/Bullet/bulletStyle.d.ts +33 -0
- package/types/src/charts/Bullet/emit.d.ts +25 -0
- package/types/src/charts/Bullet/index.d.ts +40 -0
- package/types/src/charts/Calendar/applyLayout.d.ts +37 -0
- package/types/src/charts/Calendar/calendarDates.d.ts +68 -0
- package/types/src/charts/Calendar/calendarFormat.d.ts +24 -0
- package/types/src/charts/Calendar/calendarGrid.d.ts +84 -0
- package/types/src/charts/Calendar/calendarInset.d.ts +13 -0
- package/types/src/charts/Calendar/calendarLayout.d.ts +84 -0
- package/types/src/charts/Calendar/emit.d.ts +31 -0
- package/types/src/charts/Calendar/index.d.ts +26 -0
- package/types/src/charts/Candlestick/aggregate.d.ts +91 -0
- package/types/src/charts/Candlestick/buffer.d.ts +37 -0
- package/types/src/charts/Candlestick/emit.d.ts +54 -0
- package/types/src/charts/Candlestick/index.d.ts +16 -0
- package/types/src/charts/Candlestick/ohlc.d.ts +94 -0
- package/types/src/charts/Candlestick/periods.d.ts +84 -0
- package/types/src/charts/Candlestick/tooltip.d.ts +50 -0
- package/types/src/charts/Candlestick/volume.d.ts +129 -0
- package/types/src/charts/Chord/emit.d.ts +2 -2
- package/types/src/charts/Dumbbell/emit.d.ts +34 -0
- package/types/src/charts/Dumbbell/gapSort.d.ts +47 -0
- package/types/src/charts/Dumbbell/index.d.ts +21 -0
- package/types/src/charts/FanChart/index.d.ts +17 -0
- package/types/src/charts/Funnel/applyLayout.d.ts +89 -0
- package/types/src/charts/Funnel/emit.d.ts +29 -0
- package/types/src/charts/Funnel/funnelFacet.d.ts +33 -0
- package/types/src/charts/Funnel/funnelGeometry.d.ts +78 -0
- package/types/src/charts/Funnel/funnelLabels.d.ts +101 -0
- package/types/src/charts/Funnel/index.d.ts +30 -0
- package/types/src/charts/Funnel/labelNodes.d.ts +57 -0
- package/types/src/charts/Gauge/applyLayout.d.ts +41 -0
- package/types/src/charts/Gauge/dialLayout.d.ts +78 -0
- package/types/src/charts/Gauge/emit.d.ts +22 -0
- package/types/src/charts/Gauge/emitDial.d.ts +41 -0
- package/types/src/charts/Gauge/gaugeGeometry.d.ts +89 -0
- package/types/src/charts/Gauge/index.d.ts +21 -0
- package/types/src/charts/Geomap/projections.d.ts +8 -0
- package/types/src/charts/Histogram/binData.d.ts +9 -1
- package/types/src/charts/Icicle/applyLayout.d.ts +54 -0
- package/types/src/charts/Icicle/emit.d.ts +20 -0
- package/types/src/charts/Icicle/enterStagger.d.ts +30 -0
- package/types/src/charts/Icicle/geometry.d.ts +72 -0
- package/types/src/charts/Icicle/index.d.ts +25 -0
- package/types/src/charts/Icicle/interaction.d.ts +16 -0
- package/types/src/charts/Icicle/labelFit.d.ts +37 -0
- package/types/src/charts/Icicle/layout.d.ts +21 -0
- package/types/src/charts/Lollipop/emit.d.ts +19 -0
- package/types/src/charts/Lollipop/index.d.ts +17 -0
- package/types/src/charts/Lollipop/stemLayout.d.ts +82 -0
- package/types/src/charts/Marimekko/axis.d.ts +27 -0
- package/types/src/charts/Marimekko/index.d.ts +19 -0
- package/types/src/charts/ParallelCoordinates/applyLayout.d.ts +27 -0
- package/types/src/charts/ParallelCoordinates/axes.d.ts +40 -0
- package/types/src/charts/ParallelCoordinates/brushDom.d.ts +47 -0
- package/types/src/charts/ParallelCoordinates/brushFilter.d.ts +39 -0
- package/types/src/charts/ParallelCoordinates/dimensions.d.ts +63 -0
- package/types/src/charts/ParallelCoordinates/emit.d.ts +27 -0
- package/types/src/charts/ParallelCoordinates/format.d.ts +13 -0
- package/types/src/charts/ParallelCoordinates/index.d.ts +27 -0
- package/types/src/charts/ParallelCoordinates/lineStates.d.ts +21 -0
- package/types/src/charts/ParallelCoordinates/paths.d.ts +27 -0
- package/types/src/charts/ParallelCoordinates/titles.d.ts +21 -0
- package/types/src/charts/Plot/axisInk.d.ts +8 -0
- package/types/src/charts/Plot/barConfidence.d.ts +120 -0
- package/types/src/charts/Plot/barWidth.d.ts +119 -0
- package/types/src/charts/Plot/baselineBreak.d.ts +52 -0
- package/types/src/charts/Plot/baselineDomain.d.ts +67 -0
- package/types/src/charts/Plot/columnHighlight.d.ts +23 -0
- package/types/src/charts/Plot/confidenceBands.d.ts +72 -0
- package/types/src/charts/Plot/confidenceConfig.d.ts +16 -0
- package/types/src/charts/Plot/confidenceTooltip.d.ts +70 -0
- package/types/src/charts/Plot/curveLength.d.ts +27 -0
- package/types/src/charts/Plot/discreteDomain.d.ts +14 -0
- package/types/src/charts/Plot/domainClip.d.ts +21 -0
- package/types/src/charts/Plot/facetScales.d.ts +27 -0
- package/types/src/charts/Plot/fillBetween.d.ts +69 -0
- package/types/src/charts/Plot/forecast.d.ts +102 -0
- package/types/src/charts/Plot/forecastScene.d.ts +88 -0
- package/types/src/charts/Plot/index.d.ts +24 -5
- package/types/src/charts/Plot/lineBands.d.ts +7 -0
- package/types/src/charts/Plot/lineCurve.d.ts +15 -0
- package/types/src/charts/Plot/openDomainEnds.d.ts +25 -0
- package/types/src/charts/Plot/pipeline.d.ts +5 -30
- package/types/src/charts/Plot/pipelineAxisLayout.d.ts +2 -0
- package/types/src/charts/Plot/pipelineScales.d.ts +20 -0
- package/types/src/charts/Plot/plotBreaks.d.ts +61 -0
- package/types/src/charts/Plot/plotFacet.d.ts +36 -0
- package/types/src/charts/Plot/plotInit.d.ts +44 -0
- package/types/src/charts/Plot/plotZoom.d.ts +14 -8
- package/types/src/charts/Plot/sharedHover.d.ts +5 -0
- package/types/src/charts/Plot/sharedHoverScene.d.ts +3 -6
- package/types/src/charts/Plot/sharedTooltip.d.ts +13 -8
- package/types/src/charts/Plot/stackEnter.d.ts +42 -0
- package/types/src/charts/Plot/swarm.d.ts +66 -0
- package/types/src/charts/Plot/swarmLayout.d.ts +59 -0
- package/types/src/charts/PolarArea/applyLayout.d.ts +17 -0
- package/types/src/charts/PolarArea/emit.d.ts +3 -0
- package/types/src/charts/PolarArea/index.d.ts +19 -0
- package/types/src/charts/Pyramid/gutter.d.ts +76 -0
- package/types/src/charts/Pyramid/index.d.ts +19 -0
- package/types/src/charts/Pyramid/pyramidData.d.ts +48 -0
- package/types/src/charts/Pyramid/scene.d.ts +106 -0
- package/types/src/charts/Pyramid/stackOrder.d.ts +9 -0
- package/types/src/charts/Radar/applyLayout.d.ts +7 -5
- package/types/src/charts/Radar/axisDecorations.d.ts +67 -0
- package/types/src/charts/Radar/axisLabels.d.ts +79 -0
- package/types/src/charts/Radar/emit.d.ts +2 -2
- package/types/src/charts/Radar/index.d.ts +5 -1
- package/types/src/charts/Radar/levels.d.ts +68 -0
- package/types/src/charts/Radar/rings.d.ts +30 -0
- package/types/src/charts/RadialBar/applyLayout.d.ts +19 -0
- package/types/src/charts/RadialBar/emit.d.ts +6 -0
- package/types/src/charts/RadialBar/index.d.ts +21 -0
- package/types/src/charts/RadialBar/trackLayout.d.ts +46 -0
- package/types/src/charts/RadialBar/tracks.d.ts +32 -0
- package/types/src/charts/Ridgeline/emit.d.ts +11 -0
- package/types/src/charts/Ridgeline/index.d.ts +16 -0
- package/types/src/charts/Rings/index.d.ts +2 -0
- package/types/src/charts/Rings/ringsGraph.d.ts +72 -0
- package/types/src/charts/Sankey/applyLayout.d.ts +1 -1
- package/types/src/charts/Sankey/sankeyLayout.d.ts +57 -0
- package/types/src/charts/StackedArea/index.d.ts +2 -1
- package/types/src/charts/Sunburst/applyLayout.d.ts +67 -0
- package/types/src/charts/Sunburst/emit.d.ts +29 -0
- package/types/src/charts/Sunburst/geometry.d.ts +65 -0
- package/types/src/charts/Sunburst/index.d.ts +21 -0
- package/types/src/charts/Sunburst/interaction.d.ts +20 -0
- package/types/src/charts/Sunburst/labelFit.d.ts +73 -0
- package/types/src/charts/Sunburst/partition.d.ts +34 -0
- package/types/src/charts/Violin/emit.d.ts +4 -0
- package/types/src/charts/Violin/index.d.ts +16 -0
- package/types/src/charts/Violin/inner.d.ts +31 -0
- package/types/src/charts/Violin/violinLayout.d.ts +64 -0
- package/types/src/charts/Waffle/applyLayout.d.ts +36 -0
- package/types/src/charts/Waffle/emit.d.ts +29 -0
- package/types/src/charts/Waffle/index.d.ts +21 -0
- package/types/src/charts/Waffle/tooltip.d.ts +20 -0
- package/types/src/charts/Waffle/waffleLayout.d.ts +81 -0
- package/types/src/charts/Waterfall/buffer.d.ts +31 -0
- package/types/src/charts/Waterfall/connectors.d.ts +40 -0
- package/types/src/charts/Waterfall/index.d.ts +24 -0
- package/types/src/charts/Waterfall/labels.d.ts +59 -0
- package/types/src/charts/Waterfall/state.d.ts +62 -0
- package/types/src/charts/Waterfall/steps.d.ts +84 -0
- package/types/src/charts/definition/ChartDefinition.d.ts +28 -7
- package/types/src/charts/definition/makeChart.d.ts +3 -1
- package/types/src/charts/drawSteps/bottomRightControls.d.ts +19 -0
- package/types/src/charts/drawSteps/bottomRightControlsMarkup.d.ts +1 -1
- package/types/src/charts/drawSteps/controlButtonStyle.d.ts +21 -0
- package/types/src/charts/drawSteps/searchControlsMarkup.d.ts +2 -6
- package/types/src/charts/drawSteps/topLeftControlsMarkup.d.ts +10 -2
- package/types/src/charts/drawSteps/zoomControlsMarkup.d.ts +9 -0
- package/types/src/charts/drawSteps/zoomGesture.d.ts +17 -0
- package/types/src/charts/drawSteps/zoomShown.d.ts +32 -0
- package/types/src/charts/facet/drawFacets.d.ts +52 -0
- package/types/src/charts/facet/facetConfig.d.ts +178 -0
- package/types/src/charts/facet/facetData.d.ts +47 -0
- package/types/src/charts/facet/facetGrid.d.ts +62 -0
- package/types/src/charts/facet/facetGutter.d.ts +68 -0
- package/types/src/charts/facet/facetPanel.d.ts +24 -0
- package/types/src/charts/facet/facetScene.d.ts +39 -0
- package/types/src/charts/features/axes.d.ts +4 -89
- package/types/src/charts/features/axesFinal.d.ts +66 -0
- package/types/src/charts/features/axesMeasure.d.ts +88 -0
- package/types/src/charts/features/backgroundImageEmit.d.ts +32 -0
- package/types/src/charts/features/features.d.ts +40 -12
- package/types/src/charts/features/featuresLegend.d.ts +10 -2
- package/types/src/charts/features/frozenAxis.d.ts +8 -0
- package/types/src/charts/features/insetState.d.ts +3 -4
- package/types/src/charts/features/legendCategory.d.ts +36 -0
- package/types/src/charts/features/legendLabel.d.ts +3 -6
- package/types/src/charts/features/plotAnnotations.d.ts +38 -0
- package/types/src/charts/features/plotEndLabels.d.ts +108 -0
- package/types/src/charts/features/plotPaint.d.ts +10 -25
- package/types/src/charts/features/sceneBounds.d.ts +8 -2
- package/types/src/charts/features/shapeEmit.d.ts +14 -1
- package/types/src/charts/features/shareKey.d.ts +24 -0
- package/types/src/charts/features/sharedFields.d.ts +22 -0
- package/types/src/charts/features/tooltipSwatch.d.ts +36 -4
- package/types/src/charts/features/xAxisConfig.d.ts +6 -0
- package/types/src/charts/helpers/densityChart.d.ts +62 -0
- package/types/src/charts/helpers/densityData.d.ts +88 -0
- package/types/src/charts/helpers/densityEnter.d.ts +23 -0
- package/types/src/charts/helpers/valueTitle.d.ts +23 -0
- package/types/src/charts/index.d.ts +20 -0
- package/types/src/charts/partition/chartFields.d.ts +29 -0
- package/types/src/charts/partition/hierarchy.d.ts +109 -0
- package/types/src/charts/partition/interaction.d.ts +57 -0
- package/types/src/charts/partition/labelWords.d.ts +50 -0
- package/types/src/charts/partition/shade.d.ts +61 -0
- package/types/src/charts/partition/zoom.d.ts +51 -0
- package/types/src/charts/pipeline/preDrawData.d.ts +34 -0
- package/types/src/charts/pipeline/stages.d.ts +11 -3
- package/types/src/charts/pipeline/vizDraw.d.ts +25 -20
- package/types/src/charts/pipeline/vizPreDraw.d.ts +23 -17
- package/types/src/charts/plotBuffers/Bar.d.ts +9 -12
- package/types/src/charts/plotBuffers/Box.d.ts +8 -11
- package/types/src/charts/plotBuffers/defaultBuffers.d.ts +25 -0
- package/types/src/charts/plotBuffers/numericBuffer.d.ts +1 -1
- package/types/src/charts/plotBuffers/rectLikeBuffer.d.ts +25 -0
- package/types/src/charts/polar/chrome.d.ts +62 -0
- package/types/src/charts/polar/config.d.ts +21 -0
- package/types/src/charts/polar/geometry.d.ts +68 -0
- package/types/src/charts/polar/labels.d.ts +87 -0
- package/types/src/charts/polar/polarFacet.d.ts +33 -0
- package/types/src/charts/polar/wedgeLayout.d.ts +81 -0
- package/types/src/charts/viz/Viz.d.ts +24 -24
- package/types/src/charts/viz/VizBase.d.ts +59 -204
- package/types/src/charts/viz/backgroundInk.d.ts +15 -0
- package/types/src/charts/viz/labelDefaults.d.ts +11 -0
- package/types/src/charts/viz/reserveContainerSize.d.ts +15 -0
- package/types/src/charts/viz/resetChromeBoxes.d.ts +4 -0
- package/types/src/charts/viz/shapeClassTargets.d.ts +25 -0
- package/types/src/charts/viz/shapeHover.d.ts +10 -0
- package/types/src/charts/viz/simpleHover.d.ts +9 -0
- package/types/src/charts/viz/vizDefaults.d.ts +10 -0
- package/types/src/charts/viz/vizFields.d.ts +199 -0
- package/types/src/charts/viz/vizTypes.d.ts +107 -39
- package/types/src/components/Axis/Axis.d.ts +59 -4
- package/types/src/components/Axis/axisBreak.d.ts +86 -0
- package/types/src/components/Axis/axisDefaults.d.ts +11 -0
- package/types/src/components/Axis/axisEndLabels.d.ts +37 -0
- package/types/src/components/Axis/axisLabelThinning.d.ts +48 -0
- package/types/src/components/Axis/axisLayout.d.ts +10 -0
- package/types/src/components/Axis/axisLayoutLabels.d.ts +30 -0
- package/types/src/components/Axis/axisLayoutScale.d.ts +13 -2
- package/types/src/components/Axis/axisRender.d.ts +1 -30
- package/types/src/components/Axis/axisRounding.d.ts +14 -0
- package/types/src/components/Axis/axisScene.d.ts +33 -0
- package/types/src/components/Axis/brokenScale.d.ts +66 -0
- package/types/src/components/Axis/gridStroke.d.ts +8 -0
- package/types/src/components/Axis/timeValues.d.ts +63 -0
- package/types/src/components/Axis/yearValues.d.ts +21 -0
- package/types/src/components/TextBox.d.ts +1 -36
- package/types/src/components/textBoxLayout.d.ts +45 -0
- package/types/src/components/tooltipDom.d.ts +30 -0
- package/types/src/fluent.d.ts +103 -34
- package/types/src/shapes/Box.d.ts +12 -1
- package/types/src/shapes/Shape.d.ts +2 -3
- package/types/src/shapes/Whisker.d.ts +4 -1
- package/types/src/shapes/emitLabels.d.ts +15 -0
- package/types/src/shapes/shapeConfig.d.ts +35 -5
- package/types/src/shapes/shapeOwners.d.ts +10 -0
- package/types/src/shapes/shapeStandalone.d.ts +7 -0
- package/types/src/shapes/uniqueIds.d.ts +6 -0
- package/types/src/shapes/validateShapeConfig.d.ts +20 -3
- package/types/src/utils/BaseClass.d.ts +6 -0
- package/types/src/utils/D3Scale.d.ts +3 -0
- package/types/src/utils/D3plusConfig.d.ts +940 -99
- package/types/src/utils/configPrep.d.ts +3 -2
- package/types/src/utils/configWarnings.d.ts +5 -0
- package/types/src/utils/index.d.ts +1 -1
- package/types/src/utils/wholeWords.d.ts +28 -0
- package/umd/d3plus-core.full.js +74785 -75059
- package/umd/d3plus-core.full.min.js +2 -10702
- package/umd/d3plus-core.js +44707 -23629
- package/umd/d3plus-core.min.js +2 -6671
- package/es/index.js.map +0 -1
- package/es/internal.js.map +0 -1
- package/es/src/charts/AreaPlot/index.js.map +0 -1
- package/es/src/charts/BarChart/index.js.map +0 -1
- package/es/src/charts/BoxWhisker/index.js.map +0 -1
- package/es/src/charts/BumpChart/index.js.map +0 -1
- package/es/src/charts/Chord/applyLayout.js.map +0 -1
- package/es/src/charts/Chord/emit.js.map +0 -1
- package/es/src/charts/Chord/index.js.map +0 -1
- package/es/src/charts/Donut/index.js.map +0 -1
- package/es/src/charts/Geomap/applyLayout.js.map +0 -1
- package/es/src/charts/Geomap/basemapTheme.js.map +0 -1
- package/es/src/charts/Geomap/emit.js.map +0 -1
- package/es/src/charts/Geomap/index.js.map +0 -1
- package/es/src/charts/Histogram/binData.js.map +0 -1
- package/es/src/charts/Histogram/index.js.map +0 -1
- package/es/src/charts/LinePlot/index.js.map +0 -1
- package/es/src/charts/Matrix/applyLayout.js.map +0 -1
- package/es/src/charts/Matrix/emit.js.map +0 -1
- package/es/src/charts/Matrix/index.js.map +0 -1
- package/es/src/charts/Network/applyLayout.js.map +0 -1
- package/es/src/charts/Network/emit.js.map +0 -1
- package/es/src/charts/Network/index.js.map +0 -1
- package/es/src/charts/Pack/applyLayout.js.map +0 -1
- package/es/src/charts/Pack/emit.js.map +0 -1
- package/es/src/charts/Pack/index.js.map +0 -1
- package/es/src/charts/Pack/recursionCircles.js.map +0 -1
- package/es/src/charts/Pie/applyLayout.js.map +0 -1
- package/es/src/charts/Pie/emit.js.map +0 -1
- package/es/src/charts/Pie/index.js.map +0 -1
- package/es/src/charts/Plot/discreteSpan.js.map +0 -1
- package/es/src/charts/Plot/draw.js.map +0 -1
- package/es/src/charts/Plot/index.js.map +0 -1
- package/es/src/charts/Plot/insetRegion.js.map +0 -1
- package/es/src/charts/Plot/labelPlacement.js.map +0 -1
- package/es/src/charts/Plot/pipeline.js.map +0 -1
- package/es/src/charts/Plot/pipelineDomains.js.map +0 -1
- package/es/src/charts/Plot/pipelineLineLabels.js.map +0 -1
- package/es/src/charts/Plot/plotZoom.js.map +0 -1
- package/es/src/charts/Plot/shapeDefaults.js.map +0 -1
- package/es/src/charts/Plot/sharedHover.js.map +0 -1
- package/es/src/charts/Plot/sharedHoverScene.js.map +0 -1
- package/es/src/charts/Plot/sharedTooltip.js.map +0 -1
- package/es/src/charts/Plot/stackHelpers.js.map +0 -1
- package/es/src/charts/Plot/stackShareLabels.js.map +0 -1
- package/es/src/charts/Plot/stackShareTooltip.js.map +0 -1
- package/es/src/charts/Plot/trendLines.js.map +0 -1
- package/es/src/charts/Plot/trendProjection.js.map +0 -1
- package/es/src/charts/Plot/trendScene.js.map +0 -1
- package/es/src/charts/Plot/trendTooltip.js.map +0 -1
- package/es/src/charts/Priestley/applyLayout.js.map +0 -1
- package/es/src/charts/Priestley/emit.js.map +0 -1
- package/es/src/charts/Priestley/index.js.map +0 -1
- package/es/src/charts/Radar/applyLayout.js.map +0 -1
- package/es/src/charts/Radar/emit.js.map +0 -1
- package/es/src/charts/Radar/index.js.map +0 -1
- package/es/src/charts/RadialMatrix/applyLayout.js.map +0 -1
- package/es/src/charts/RadialMatrix/emit.js.map +0 -1
- package/es/src/charts/RadialMatrix/index.js.map +0 -1
- package/es/src/charts/Rings/applyLayout.js.map +0 -1
- package/es/src/charts/Rings/emit.js.map +0 -1
- package/es/src/charts/Rings/index.js.map +0 -1
- package/es/src/charts/Rings/ringsSizing.js.map +0 -1
- package/es/src/charts/Sankey/applyLayout.js.map +0 -1
- package/es/src/charts/Sankey/emit.js.map +0 -1
- package/es/src/charts/Sankey/index.js.map +0 -1
- package/es/src/charts/StackedArea/index.js.map +0 -1
- package/es/src/charts/Tree/applyLayout.js.map +0 -1
- package/es/src/charts/Tree/emit.js.map +0 -1
- package/es/src/charts/Tree/index.js.map +0 -1
- package/es/src/charts/Treemap/applyLayout.js.map +0 -1
- package/es/src/charts/Treemap/emit.js.map +0 -1
- package/es/src/charts/Treemap/index.js.map +0 -1
- package/es/src/charts/Treemap/thresholdFunction.js.map +0 -1
- package/es/src/charts/definition/ChartDefinition.js.map +0 -1
- package/es/src/charts/definition/applyDefinition.js.map +0 -1
- package/es/src/charts/definition/makeChart.js.map +0 -1
- package/es/src/charts/drawSteps/backControl.js.map +0 -1
- package/es/src/charts/drawSteps/bottomRightControls.js.map +0 -1
- package/es/src/charts/drawSteps/bottomRightControlsMarkup.js.map +0 -1
- package/es/src/charts/drawSteps/controlButtonStyle.js.map +0 -1
- package/es/src/charts/drawSteps/minimap.js.map +0 -1
- package/es/src/charts/drawSteps/minimapMarkup.js.map +0 -1
- package/es/src/charts/drawSteps/searchControls.js.map +0 -1
- package/es/src/charts/drawSteps/searchControlsMarkup.js.map +0 -1
- package/es/src/charts/drawSteps/tableView.js.map +0 -1
- package/es/src/charts/drawSteps/tableViewControl.js.map +0 -1
- package/es/src/charts/drawSteps/tableViewMarkup.js.map +0 -1
- package/es/src/charts/drawSteps/topLeftControls.js.map +0 -1
- package/es/src/charts/drawSteps/topLeftControlsMarkup.js.map +0 -1
- package/es/src/charts/drawSteps/zoomControls.js.map +0 -1
- package/es/src/charts/drawSteps/zoomControlsMarkup.js.map +0 -1
- package/es/src/charts/events/click.legend.js.map +0 -1
- package/es/src/charts/events/click.shape.js.map +0 -1
- package/es/src/charts/events/mouseenter.js.map +0 -1
- package/es/src/charts/events/mouseleave.js.map +0 -1
- package/es/src/charts/events/mousemove.legend.js.map +0 -1
- package/es/src/charts/events/mousemove.shape.js.map +0 -1
- package/es/src/charts/events/touchstart.body.js.map +0 -1
- package/es/src/charts/features/attributionFeature.js.map +0 -1
- package/es/src/charts/features/axes.js.map +0 -1
- package/es/src/charts/features/chartGeometry.js.map +0 -1
- package/es/src/charts/features/colorScaleBucket.js.map +0 -1
- package/es/src/charts/features/edgeArrows.js.map +0 -1
- package/es/src/charts/features/emitHelpers.js.map +0 -1
- package/es/src/charts/features/ensureZoomDom.js.map +0 -1
- package/es/src/charts/features/features.js.map +0 -1
- package/es/src/charts/features/featuresColorScale.js.map +0 -1
- package/es/src/charts/features/featuresLegend.js.map +0 -1
- package/es/src/charts/features/insetState.js.map +0 -1
- package/es/src/charts/features/legendLabel.js.map +0 -1
- package/es/src/charts/features/lineLabels.js.map +0 -1
- package/es/src/charts/features/plotPaint.js.map +0 -1
- package/es/src/charts/features/sceneBounds.js.map +0 -1
- package/es/src/charts/features/shapeEmit.js.map +0 -1
- package/es/src/charts/features/tooltipSwatch.js.map +0 -1
- package/es/src/charts/features/zoomExtent.js.map +0 -1
- package/es/src/charts/helpers/matrixData.js.map +0 -1
- package/es/src/charts/helpers/tileAttributions.js.map +0 -1
- package/es/src/charts/index.js.map +0 -1
- package/es/src/charts/pipeline/drillMorph.js.map +0 -1
- package/es/src/charts/pipeline/insetPlacement.js.map +0 -1
- package/es/src/charts/pipeline/resolveSpec.js.map +0 -1
- package/es/src/charts/pipeline/runChartDraw.js.map +0 -1
- package/es/src/charts/pipeline/runVizPipeline.js.map +0 -1
- package/es/src/charts/pipeline/stages.js.map +0 -1
- package/es/src/charts/pipeline/vizContext.js +0 -29
- package/es/src/charts/pipeline/vizContext.js.map +0 -1
- package/es/src/charts/pipeline/vizDraw.js.map +0 -1
- package/es/src/charts/pipeline/vizDrawPure.js +0 -220
- package/es/src/charts/pipeline/vizDrawPure.js.map +0 -1
- package/es/src/charts/pipeline/vizPreDraw.js.map +0 -1
- package/es/src/charts/pipeline/vizPreDrawPure.js +0 -279
- package/es/src/charts/pipeline/vizPreDrawPure.js.map +0 -1
- package/es/src/charts/plotBuffers/Bar.js.map +0 -1
- package/es/src/charts/plotBuffers/Box.js.map +0 -1
- package/es/src/charts/plotBuffers/Circle.js.map +0 -1
- package/es/src/charts/plotBuffers/Line.js.map +0 -1
- package/es/src/charts/plotBuffers/Rect.js.map +0 -1
- package/es/src/charts/plotBuffers/discreteBuffer.js.map +0 -1
- package/es/src/charts/plotBuffers/numericBuffer.js.map +0 -1
- package/es/src/charts/viz/Viz.js.map +0 -1
- package/es/src/charts/viz/VizBase.js.map +0 -1
- package/es/src/charts/viz/VizBaseConfig.js +0 -538
- package/es/src/charts/viz/VizBaseConfig.js.map +0 -1
- package/es/src/charts/viz/interactionOpacity.js.map +0 -1
- package/es/src/charts/viz/linkGroup.js.map +0 -1
- package/es/src/charts/viz/ordinalColor.js.map +0 -1
- package/es/src/charts/viz/sceneRows.js.map +0 -1
- package/es/src/charts/viz/trailCatchup.js.map +0 -1
- package/es/src/charts/viz/vizDefaults.js.map +0 -1
- package/es/src/charts/viz/vizRender.js.map +0 -1
- package/es/src/charts/viz/vizTypes.js.map +0 -1
- package/es/src/charts/viz/vizVisibility.js.map +0 -1
- package/es/src/components/Axis/Axis.js.map +0 -1
- package/es/src/components/Axis/AxisBottom.js.map +0 -1
- package/es/src/components/Axis/AxisLeft.js.map +0 -1
- package/es/src/components/Axis/AxisRight.js.map +0 -1
- package/es/src/components/Axis/AxisTop.js.map +0 -1
- package/es/src/components/Axis/axisLayout.js.map +0 -1
- package/es/src/components/Axis/axisLayoutLabels.js.map +0 -1
- package/es/src/components/Axis/axisLayoutScale.js.map +0 -1
- package/es/src/components/Axis/axisRender.js.map +0 -1
- package/es/src/components/ColorScale/ColorScale.js.map +0 -1
- package/es/src/components/ColorScale/colorScaleRender.js.map +0 -1
- package/es/src/components/ColorScale/colorScaleScale.js.map +0 -1
- package/es/src/components/Legend/Legend.js.map +0 -1
- package/es/src/components/Legend/legendConfig.js.map +0 -1
- package/es/src/components/Legend/legendRender.js.map +0 -1
- package/es/src/components/Message.js.map +0 -1
- package/es/src/components/SizeLegend/SizeLegend.js.map +0 -1
- package/es/src/components/SizeLegend/sizeLegendLayout.js.map +0 -1
- package/es/src/components/TextBox.js.map +0 -1
- package/es/src/components/Timeline/Timeline.js.map +0 -1
- package/es/src/components/Timeline/timelineConfig.js.map +0 -1
- package/es/src/components/Timeline/timelineRender.js.map +0 -1
- package/es/src/components/Tooltip.js.map +0 -1
- package/es/src/components/index.js.map +0 -1
- package/es/src/fluent.js.map +0 -1
- package/es/src/shapes/Area.js.map +0 -1
- package/es/src/shapes/Bar.js.map +0 -1
- package/es/src/shapes/Box.js.map +0 -1
- package/es/src/shapes/Circle.js.map +0 -1
- package/es/src/shapes/Image.js.map +0 -1
- package/es/src/shapes/Line.js.map +0 -1
- package/es/src/shapes/Path.js.map +0 -1
- package/es/src/shapes/Rect.js.map +0 -1
- package/es/src/shapes/Shape.js.map +0 -1
- package/es/src/shapes/Whisker.js.map +0 -1
- package/es/src/shapes/buildLabelData.js.map +0 -1
- package/es/src/shapes/emitLabels.js.map +0 -1
- package/es/src/shapes/hitAreaNode.js.map +0 -1
- package/es/src/shapes/index.js.map +0 -1
- package/es/src/shapes/interactionPoints.js.map +0 -1
- package/es/src/shapes/sceneSort.js.map +0 -1
- package/es/src/shapes/shapeConfig.js.map +0 -1
- package/es/src/shapes/textureKey.js.map +0 -1
- package/es/src/shapes/validateShapeConfig.js.map +0 -1
- package/es/src/utils/AccessorFn.js.map +0 -1
- package/es/src/utils/BaseClass.js.map +0 -1
- package/es/src/utils/D3Scale.js.map +0 -1
- package/es/src/utils/D3plusConfig.js.map +0 -1
- package/es/src/utils/RESET.js.map +0 -1
- package/es/src/utils/accessor.js.map +0 -1
- package/es/src/utils/configDefault.js.map +0 -1
- package/es/src/utils/configPrep.js.map +0 -1
- package/es/src/utils/configWarnings.js.map +0 -1
- package/es/src/utils/constant.js.map +0 -1
- package/es/src/utils/getProp.js.map +0 -1
- package/es/src/utils/index.js.map +0 -1
- package/es/src/utils/paintComponentScene.js.map +0 -1
- package/es/umd-entry.js +0 -16
- package/es/umd-entry.js.map +0 -1
- package/types/src/charts/AreaPlot.d.ts +0 -16
- package/types/src/charts/BarChart.d.ts +0 -16
- package/types/src/charts/BoxWhisker.d.ts +0 -11
- package/types/src/charts/BumpChart.d.ts +0 -36
- package/types/src/charts/ChartDefinition.d.ts +0 -75
- package/types/src/charts/Donut.d.ts +0 -11
- package/types/src/charts/Geomap.d.ts +0 -126
- package/types/src/charts/LinePlot.d.ts +0 -15
- package/types/src/charts/Matrix.d.ts +0 -48
- package/types/src/charts/Network.d.ts +0 -54
- package/types/src/charts/Pack.d.ts +0 -34
- package/types/src/charts/Pie.d.ts +0 -17
- package/types/src/charts/Plot.d.ts +0 -150
- package/types/src/charts/Priestley.d.ts +0 -37
- package/types/src/charts/Radar.d.ts +0 -38
- package/types/src/charts/RadialMatrix.d.ts +0 -63
- package/types/src/charts/Rings.d.ts +0 -61
- package/types/src/charts/Sankey.d.ts +0 -77
- package/types/src/charts/StackedArea.d.ts +0 -14
- package/types/src/charts/Tree.d.ts +0 -17
- package/types/src/charts/Treemap.d.ts +0 -42
- package/types/src/charts/Viz.d.ts +0 -90
- package/types/src/charts/VizBase.d.ts +0 -158
- package/types/src/charts/VizBaseConfig.d.ts +0 -148
- package/types/src/charts/applyDefinition.d.ts +0 -13
- package/types/src/charts/axes.d.ts +0 -134
- package/types/src/charts/chartGeometry.d.ts +0 -58
- package/types/src/charts/drawSteps/drawAttribution.d.ts +0 -7
- package/types/src/charts/drawSteps/drawBack.d.ts +0 -6
- package/types/src/charts/drawSteps/drawColorScale.d.ts +0 -6
- package/types/src/charts/drawSteps/drawLegend.d.ts +0 -12
- package/types/src/charts/drawSteps/drawSubtitle.d.ts +0 -7
- package/types/src/charts/drawSteps/drawTimeline.d.ts +0 -7
- package/types/src/charts/drawSteps/drawTitle.d.ts +0 -7
- package/types/src/charts/drawSteps/drawTotal.d.ts +0 -7
- package/types/src/charts/emitHelpers.d.ts +0 -122
- package/types/src/charts/ensureZoomDom.d.ts +0 -39
- package/types/src/charts/factories.d.ts +0 -73
- package/types/src/charts/features/colorScaleBucketShare.d.ts +0 -16
- package/types/src/charts/features.d.ts +0 -152
- package/types/src/charts/featuresLegend.d.ts +0 -12
- package/types/src/charts/legendLabel.d.ts +0 -11
- package/types/src/charts/lineLabels.d.ts +0 -40
- package/types/src/charts/makeChart.d.ts +0 -22
- package/types/src/charts/pipeline/vizContext.d.ts +0 -45
- package/types/src/charts/pipeline/vizDrawPure.d.ts +0 -46
- package/types/src/charts/pipeline/vizPreDrawPure.d.ts +0 -68
- package/types/src/charts/plotPaint.d.ts +0 -233
- package/types/src/charts/resolveSpec.d.ts +0 -50
- package/types/src/charts/runChartDraw.d.ts +0 -38
- package/types/src/charts/runVizPipeline.d.ts +0 -31
- package/types/src/charts/shapeEmit.d.ts +0 -61
- package/types/src/charts/stages.d.ts +0 -117
- package/types/src/charts/viz/VizBaseConfig.d.ts +0 -175
- package/types/src/charts/vizContext.d.ts +0 -46
- package/types/src/charts/vizDefaults.d.ts +0 -8
- package/types/src/charts/vizDraw.d.ts +0 -25
- package/types/src/charts/vizDrawPure.d.ts +0 -17
- package/types/src/charts/vizPreDraw.d.ts +0 -22
- package/types/src/charts/vizPreDrawPure.d.ts +0 -40
- package/types/src/charts/vizRender.d.ts +0 -8
- package/types/src/charts/vizTypes.d.ts +0 -202
- package/types/src/components/Axis.d.ts +0 -183
- package/types/src/components/AxisBottom.d.ts +0 -11
- package/types/src/components/AxisLeft.d.ts +0 -11
- package/types/src/components/AxisRight.d.ts +0 -11
- package/types/src/components/AxisTop.d.ts +0 -11
- package/types/src/components/ColorScale.d.ts +0 -80
- package/types/src/components/Legend.d.ts +0 -93
- package/types/src/components/Timeline.d.ts +0 -83
- package/types/src/components/axisLayout.d.ts +0 -27
- package/types/src/components/axisLayoutLabels.d.ts +0 -42
- package/types/src/components/axisLayoutScale.d.ts +0 -12
- package/types/src/components/axisRender.d.ts +0 -65
- package/types/src/components/colorScaleRender.d.ts +0 -15
- package/types/src/components/colorScaleScale.d.ts +0 -19
- package/types/src/components/legendConfig.d.ts +0 -7
- package/types/src/components/legendRender.d.ts +0 -16
- package/types/src/components/timelineConfig.d.ts +0 -6
- package/types/src/components/timelineRender.d.ts +0 -14
- package/umd/d3plus-core.full.js.map +0 -1
- package/umd/d3plus-core.js.map +0 -1
package/es/src/charts/viz/Viz.js
CHANGED
|
@@ -1,322 +1,3 @@
|
|
|
1
|
-
function _array_like_to_array(arr, len) {
|
|
2
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
-
return arr2;
|
|
5
|
-
}
|
|
6
|
-
function _array_with_holes(arr) {
|
|
7
|
-
if (Array.isArray(arr)) return arr;
|
|
8
|
-
}
|
|
9
|
-
function _array_without_holes(arr) {
|
|
10
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
11
|
-
}
|
|
12
|
-
function _assert_this_initialized(self) {
|
|
13
|
-
if (self === void 0) {
|
|
14
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
15
|
-
}
|
|
16
|
-
return self;
|
|
17
|
-
}
|
|
18
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
19
|
-
try {
|
|
20
|
-
var info = gen[key](arg);
|
|
21
|
-
var value = info.value;
|
|
22
|
-
} catch (error) {
|
|
23
|
-
reject(error);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (info.done) {
|
|
27
|
-
resolve(value);
|
|
28
|
-
} else {
|
|
29
|
-
Promise.resolve(value).then(_next, _throw);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
function _async_to_generator(fn) {
|
|
33
|
-
return function() {
|
|
34
|
-
var self = this, args = arguments;
|
|
35
|
-
return new Promise(function(resolve, reject) {
|
|
36
|
-
var gen = fn.apply(self, args);
|
|
37
|
-
function _next(value) {
|
|
38
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
39
|
-
}
|
|
40
|
-
function _throw(err) {
|
|
41
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
42
|
-
}
|
|
43
|
-
_next(undefined);
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function _call_super(_this, derived, args) {
|
|
48
|
-
derived = _get_prototype_of(derived);
|
|
49
|
-
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
50
|
-
}
|
|
51
|
-
function _class_call_check(instance, Constructor) {
|
|
52
|
-
if (!(instance instanceof Constructor)) {
|
|
53
|
-
throw new TypeError("Cannot call a class as a function");
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function _defineProperties(target, props) {
|
|
57
|
-
for(var i = 0; i < props.length; i++){
|
|
58
|
-
var descriptor = props[i];
|
|
59
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
60
|
-
descriptor.configurable = true;
|
|
61
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
62
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
66
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
67
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
68
|
-
return Constructor;
|
|
69
|
-
}
|
|
70
|
-
function _define_property(obj, key, value) {
|
|
71
|
-
if (key in obj) {
|
|
72
|
-
Object.defineProperty(obj, key, {
|
|
73
|
-
value: value,
|
|
74
|
-
enumerable: true,
|
|
75
|
-
configurable: true,
|
|
76
|
-
writable: true
|
|
77
|
-
});
|
|
78
|
-
} else {
|
|
79
|
-
obj[key] = value;
|
|
80
|
-
}
|
|
81
|
-
return obj;
|
|
82
|
-
}
|
|
83
|
-
function _get_prototype_of(o) {
|
|
84
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
85
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
86
|
-
};
|
|
87
|
-
return _get_prototype_of(o);
|
|
88
|
-
}
|
|
89
|
-
function _inherits(subClass, superClass) {
|
|
90
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
91
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
92
|
-
}
|
|
93
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
94
|
-
constructor: {
|
|
95
|
-
value: subClass,
|
|
96
|
-
writable: true,
|
|
97
|
-
configurable: true
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
101
|
-
}
|
|
102
|
-
function _instanceof(left, right) {
|
|
103
|
-
"@swc/helpers - instanceof";
|
|
104
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
105
|
-
return !!right[Symbol.hasInstance](left);
|
|
106
|
-
} else {
|
|
107
|
-
return left instanceof right;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
function _iterable_to_array(iter) {
|
|
111
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
112
|
-
}
|
|
113
|
-
function _iterable_to_array_limit(arr, i) {
|
|
114
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
115
|
-
if (_i == null) return;
|
|
116
|
-
var _arr = [];
|
|
117
|
-
var _n = true;
|
|
118
|
-
var _d = false;
|
|
119
|
-
var _s, _e;
|
|
120
|
-
try {
|
|
121
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
122
|
-
_arr.push(_s.value);
|
|
123
|
-
if (i && _arr.length === i) break;
|
|
124
|
-
}
|
|
125
|
-
} catch (err) {
|
|
126
|
-
_d = true;
|
|
127
|
-
_e = err;
|
|
128
|
-
} finally{
|
|
129
|
-
try {
|
|
130
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
131
|
-
} finally{
|
|
132
|
-
if (_d) throw _e;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return _arr;
|
|
136
|
-
}
|
|
137
|
-
function _non_iterable_rest() {
|
|
138
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
139
|
-
}
|
|
140
|
-
function _non_iterable_spread() {
|
|
141
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
142
|
-
}
|
|
143
|
-
function _object_spread(target) {
|
|
144
|
-
for(var i = 1; i < arguments.length; i++){
|
|
145
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
146
|
-
var ownKeys = Object.keys(source);
|
|
147
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
148
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
149
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
150
|
-
}));
|
|
151
|
-
}
|
|
152
|
-
ownKeys.forEach(function(key) {
|
|
153
|
-
_define_property(target, key, source[key]);
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
return target;
|
|
157
|
-
}
|
|
158
|
-
function ownKeys(object, enumerableOnly) {
|
|
159
|
-
var keys = Object.keys(object);
|
|
160
|
-
if (Object.getOwnPropertySymbols) {
|
|
161
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
162
|
-
if (enumerableOnly) {
|
|
163
|
-
symbols = symbols.filter(function(sym) {
|
|
164
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
keys.push.apply(keys, symbols);
|
|
168
|
-
}
|
|
169
|
-
return keys;
|
|
170
|
-
}
|
|
171
|
-
function _object_spread_props(target, source) {
|
|
172
|
-
source = source != null ? source : {};
|
|
173
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
174
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
175
|
-
} else {
|
|
176
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
177
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
return target;
|
|
181
|
-
}
|
|
182
|
-
function _possible_constructor_return(self, call) {
|
|
183
|
-
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
184
|
-
return call;
|
|
185
|
-
}
|
|
186
|
-
return _assert_this_initialized(self);
|
|
187
|
-
}
|
|
188
|
-
function _set_prototype_of(o, p) {
|
|
189
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
190
|
-
o.__proto__ = p;
|
|
191
|
-
return o;
|
|
192
|
-
};
|
|
193
|
-
return _set_prototype_of(o, p);
|
|
194
|
-
}
|
|
195
|
-
function _sliced_to_array(arr, i) {
|
|
196
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
197
|
-
}
|
|
198
|
-
function _to_consumable_array(arr) {
|
|
199
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
200
|
-
}
|
|
201
|
-
function _type_of(obj) {
|
|
202
|
-
"@swc/helpers - typeof";
|
|
203
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
204
|
-
}
|
|
205
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
206
|
-
if (!o) return;
|
|
207
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
208
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
209
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
210
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
211
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
212
|
-
}
|
|
213
|
-
function _is_native_reflect_construct() {
|
|
214
|
-
try {
|
|
215
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
216
|
-
} catch (_) {}
|
|
217
|
-
return (_is_native_reflect_construct = function() {
|
|
218
|
-
return !!result;
|
|
219
|
-
})();
|
|
220
|
-
}
|
|
221
|
-
function _ts_generator(thisArg, body) {
|
|
222
|
-
var f, y, t, _ = {
|
|
223
|
-
label: 0,
|
|
224
|
-
sent: function() {
|
|
225
|
-
if (t[0] & 1) throw t[1];
|
|
226
|
-
return t[1];
|
|
227
|
-
},
|
|
228
|
-
trys: [],
|
|
229
|
-
ops: []
|
|
230
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
231
|
-
return d(g, "next", {
|
|
232
|
-
value: verb(0)
|
|
233
|
-
}), d(g, "throw", {
|
|
234
|
-
value: verb(1)
|
|
235
|
-
}), d(g, "return", {
|
|
236
|
-
value: verb(2)
|
|
237
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
238
|
-
value: function() {
|
|
239
|
-
return this;
|
|
240
|
-
}
|
|
241
|
-
}), g;
|
|
242
|
-
function verb(n) {
|
|
243
|
-
return function(v) {
|
|
244
|
-
return step([
|
|
245
|
-
n,
|
|
246
|
-
v
|
|
247
|
-
]);
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
function step(op) {
|
|
251
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
252
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
253
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
254
|
-
if (y = 0, t) op = [
|
|
255
|
-
op[0] & 2,
|
|
256
|
-
t.value
|
|
257
|
-
];
|
|
258
|
-
switch(op[0]){
|
|
259
|
-
case 0:
|
|
260
|
-
case 1:
|
|
261
|
-
t = op;
|
|
262
|
-
break;
|
|
263
|
-
case 4:
|
|
264
|
-
_.label++;
|
|
265
|
-
return {
|
|
266
|
-
value: op[1],
|
|
267
|
-
done: false
|
|
268
|
-
};
|
|
269
|
-
case 5:
|
|
270
|
-
_.label++;
|
|
271
|
-
y = op[1];
|
|
272
|
-
op = [
|
|
273
|
-
0
|
|
274
|
-
];
|
|
275
|
-
continue;
|
|
276
|
-
case 7:
|
|
277
|
-
op = _.ops.pop();
|
|
278
|
-
_.trys.pop();
|
|
279
|
-
continue;
|
|
280
|
-
default:
|
|
281
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
282
|
-
_ = 0;
|
|
283
|
-
continue;
|
|
284
|
-
}
|
|
285
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
286
|
-
_.label = op[1];
|
|
287
|
-
break;
|
|
288
|
-
}
|
|
289
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
290
|
-
_.label = t[1];
|
|
291
|
-
t = op;
|
|
292
|
-
break;
|
|
293
|
-
}
|
|
294
|
-
if (t && _.label < t[2]) {
|
|
295
|
-
_.label = t[2];
|
|
296
|
-
_.ops.push(op);
|
|
297
|
-
break;
|
|
298
|
-
}
|
|
299
|
-
if (t[2]) _.ops.pop();
|
|
300
|
-
_.trys.pop();
|
|
301
|
-
continue;
|
|
302
|
-
}
|
|
303
|
-
op = body.call(thisArg, _);
|
|
304
|
-
} catch (e) {
|
|
305
|
-
op = [
|
|
306
|
-
6,
|
|
307
|
-
e
|
|
308
|
-
];
|
|
309
|
-
y = 0;
|
|
310
|
-
} finally{
|
|
311
|
-
f = t = 0;
|
|
312
|
-
}
|
|
313
|
-
if (op[0] & 5) throw op[1];
|
|
314
|
-
return {
|
|
315
|
-
value: op[0] ? op[1] : void 0,
|
|
316
|
-
done: true
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
1
|
import { select } from "d3-selection";
|
|
321
2
|
import { date, getSize } from "@d3plus/dom";
|
|
322
3
|
import { computeTrailCatchup } from "./trailCatchup.js";
|
|
@@ -328,36 +9,19 @@ import { initInsetDefaults, insetComponentScene } from "../features/insetState.j
|
|
|
328
9
|
import { applyZoomPointerEvents, bindCanvasZoom } from "../drawSteps/zoomControls.js";
|
|
329
10
|
import { initVizDefaults } from "./vizDefaults.js";
|
|
330
11
|
import { unregisterLink } from "./linkGroup.js";
|
|
12
|
+
import { facetPanelAt, withFacetPanel } from "../facet/facetPanel.js";
|
|
331
13
|
import { vizRender } from "./vizRender.js";
|
|
332
14
|
import { vizDraw } from "../pipeline/vizDraw.js";
|
|
333
15
|
import { vizPreDraw } from "../pipeline/vizPreDraw.js";
|
|
16
|
+
import { handlerDatum, shapeClassTargets } from "./shapeClassTargets.js";
|
|
334
17
|
/**
|
|
335
18
|
Stamps `interactionGroup` onto a component's scene subtree so the pointer
|
|
336
19
|
bridge can route its nodes to component-scoped handlers (e.g. legend) on
|
|
337
20
|
every backend — including Canvas, where there is no per-shape DOM to walk.
|
|
338
21
|
*/ function tagInteractionGroup(node, group) {
|
|
339
22
|
node.interactionGroup = group;
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
if (kids) try {
|
|
343
|
-
for(var _iterator = kids[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
344
|
-
var child = _step.value;
|
|
345
|
-
tagInteractionGroup(child, group);
|
|
346
|
-
}
|
|
347
|
-
} catch (err) {
|
|
348
|
-
_didIteratorError = true;
|
|
349
|
-
_iteratorError = err;
|
|
350
|
-
} finally{
|
|
351
|
-
try {
|
|
352
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
353
|
-
_iterator.return();
|
|
354
|
-
}
|
|
355
|
-
} finally{
|
|
356
|
-
if (_didIteratorError) {
|
|
357
|
-
throw _iteratorError;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
23
|
+
const kids = node.children;
|
|
24
|
+
if (kids) for (const child of kids)tagInteractionGroup(child, group);
|
|
361
25
|
}
|
|
362
26
|
/**
|
|
363
27
|
Resolves the element a renderer mounts into. A `<canvas>` cannot paint inside
|
|
@@ -365,529 +29,344 @@ import { vizPreDraw } from "../pipeline/vizPreDraw.js";
|
|
|
365
29
|
into that svg's parent (the user's element); the emptied, position:absolute
|
|
366
30
|
compute svg overlays the same top-left box. SVG mounts into the target as-is.
|
|
367
31
|
*/ function mountTargetFor(kind, target) {
|
|
368
|
-
|
|
369
|
-
if (kind === "canvas" && typeof Element !== "undefined" && _instanceof(target, Element) && target.tagName.toLowerCase() === "svg") return (_target_parentNode = target.parentNode) !== null && _target_parentNode !== void 0 ? _target_parentNode : target;
|
|
32
|
+
if (kind === "canvas" && typeof Element !== "undefined" && target instanceof Element && target.tagName.toLowerCase() === "svg") return target.parentNode ?? target;
|
|
370
33
|
return target;
|
|
371
34
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
35
|
+
/**
|
|
36
|
+
The base class every d3plus chart extends. Owns the shared configuration surface (data, groupBy, size and color accessors, title, legend, tooltip, timeline, zoom, table view) and the render lifecycle that each chart type's definition plugs its layout into. Not used directly; see the chart classes (BarChart, Treemap, …).
|
|
37
|
+
*/ export default class Viz extends VizBase {
|
|
38
|
+
/**
|
|
39
|
+
Invoked when creating a new class instance, and sets any default parameters.
|
|
40
|
+
@private
|
|
41
|
+
*/ constructor(){
|
|
42
|
+
super();
|
|
43
|
+
initVizDefaults(this);
|
|
44
|
+
initInsetDefaults(this);
|
|
382
45
|
}
|
|
383
|
-
|
|
384
|
-
{
|
|
385
|
-
/**
|
|
46
|
+
/**
|
|
386
47
|
Called by draw before anything is drawn. Formats the data and performs preparations for draw.
|
|
387
48
|
@private
|
|
388
|
-
*/
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
},
|
|
393
|
-
{
|
|
394
|
-
/**
|
|
49
|
+
*/ _preDraw() {
|
|
50
|
+
vizPreDraw(this);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
395
53
|
Composes a backend-agnostic scene graph from the shapes/features produced
|
|
396
54
|
by the most recent render. Combines:
|
|
397
55
|
- `_chartScene` (cells from `chartDef.emit`, or `Plot._paint` for the
|
|
398
56
|
paint-driven Plot family) wrapped in viz-chart-cells
|
|
399
|
-
- `_shapes` (still used by some charts) — each shape's toScene
|
|
400
57
|
- chart-level components (Legend/ColorScale/Timeline) via their toScene
|
|
401
58
|
- `_featurePanels` (from FeatureModule layouts) wrapped in viz-features
|
|
402
|
-
*/
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
59
|
+
*/ toScene() {
|
|
60
|
+
const children = [];
|
|
61
|
+
// Chart cells stashed on _chartScene — via `chartDef.emit(ctx)` for
|
|
62
|
+
// data-driven charts, or `Plot._paint` for the paint-driven Plot family.
|
|
63
|
+
// Wraps in three groups:
|
|
64
|
+
// viz-chart-cells (clip window, untransformed)
|
|
65
|
+
// viz-zoom (zoom transform — pan/scale from d3-zoom)
|
|
66
|
+
// viz-chart-body (chart-positioning transform)
|
|
67
|
+
// … chart scene children
|
|
68
|
+
// This lets zoom apply to the chart content WITHOUT moving legend/
|
|
69
|
+
// title/total/etc. (which live in sibling viz-* groups, not under
|
|
70
|
+
// viz-chart-cells). The zoom transform sits above the chart transform so
|
|
71
|
+
// it lives in the same surface space d3-zoom measures the pointer in —
|
|
72
|
+
// a wheel zoom stays anchored under the cursor regardless of margins or
|
|
73
|
+
// a chart's own centering transform (Pie, Radar, …).
|
|
74
|
+
if (this._chartScene && this._chartScene.length) {
|
|
75
|
+
const sliced = applyInteractionOpacity(this._chartScene, this);
|
|
76
|
+
// Always emit the viz-zoom group (identity transform when no zoom is
|
|
77
|
+
// active) so its key is stable across the first zoom. Otherwise the first
|
|
78
|
+
// zoom adds a brand-new group → the renderer treats the chart cells as
|
|
79
|
+
// exit+enter (teardown/rebuild) instead of tweening the group transform,
|
|
80
|
+
// so the zoom snaps in instead of animating.
|
|
81
|
+
const zoomNode = [
|
|
82
|
+
{
|
|
83
|
+
type: "group",
|
|
84
|
+
key: "viz-zoom",
|
|
85
|
+
transform: this._zoomTransform ?? {
|
|
86
|
+
x: 0,
|
|
87
|
+
y: 0,
|
|
88
|
+
scale: 1
|
|
89
|
+
},
|
|
90
|
+
children: [
|
|
427
91
|
{
|
|
428
92
|
type: "group",
|
|
429
|
-
key: "viz-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
},
|
|
435
|
-
children: [
|
|
436
|
-
_object_spread_props(_object_spread({
|
|
437
|
-
type: "group",
|
|
438
|
-
key: "viz-chart-body"
|
|
439
|
-
}, this._chartTransform ? {
|
|
440
|
-
transform: this._chartTransform
|
|
441
|
-
} : {}), {
|
|
442
|
-
children: sliced
|
|
443
|
-
})
|
|
444
|
-
]
|
|
445
|
-
}
|
|
446
|
-
];
|
|
447
|
-
// Fixed clip window (e.g. Geomap's map rect): stays put in scene space
|
|
448
|
-
// while the viz-zoom child transform pans/scales content beneath it.
|
|
449
|
-
// Any zoomable chart without its own clip is clipped to the chart area,
|
|
450
|
-
// so zoomed content can't spill over the legend/title/timeline.
|
|
451
|
-
var clip = (_this__chartClip = this._chartClip) !== null && _this__chartClip !== void 0 ? _this__chartClip : this.schema.zoom && this._margin ? chartAreaRect(this) : undefined;
|
|
452
|
-
children.push(_object_spread_props(_object_spread({
|
|
453
|
-
type: "group",
|
|
454
|
-
key: "viz-chart-cells"
|
|
455
|
-
}, clip ? {
|
|
456
|
-
clip: clip
|
|
457
|
-
} : {}), {
|
|
458
|
-
children: zoomNode
|
|
459
|
-
}));
|
|
460
|
-
}
|
|
461
|
-
// `_shapes` collection (Treemap/Pack/etc. route through `_chartScene`
|
|
462
|
-
// instead, as does Plot's `absorbShapeIntoChartScene`). Any caller
|
|
463
|
-
// pushing into `_shapes` gets its `toScene()` walked here; we read the
|
|
464
|
-
// shape's `_select` transform via d3's transform baseVal if present,
|
|
465
|
-
// otherwise emit without a transform.
|
|
466
|
-
(this._shapes || []).forEach(function(shape, si) {
|
|
467
|
-
if (!shape || typeof shape.toScene !== "function") return;
|
|
468
|
-
var group = shape.toScene();
|
|
469
|
-
var transform;
|
|
470
|
-
var sel = shape._select;
|
|
471
|
-
if (sel && typeof sel.attr === "function") {
|
|
472
|
-
// Parse `translate(x, y)` from the selection's transform attr.
|
|
473
|
-
// Falls back to undefined for non-translate transforms — the
|
|
474
|
-
// `_shapes` path only uses translate.
|
|
475
|
-
var t = sel.attr("transform");
|
|
476
|
-
if (typeof t === "string") {
|
|
477
|
-
var m = t.match(/translate\(\s*(-?[\d.]+)[, ]\s*(-?[\d.]+)\s*\)/);
|
|
478
|
-
if (m) transform = {
|
|
479
|
-
x: parseFloat(m[1]),
|
|
480
|
-
y: parseFloat(m[2])
|
|
481
|
-
};
|
|
93
|
+
key: "viz-chart-body",
|
|
94
|
+
...this._chartTransform ? {
|
|
95
|
+
transform: this._chartTransform
|
|
96
|
+
} : {},
|
|
97
|
+
children: sliced
|
|
482
98
|
}
|
|
483
|
-
}
|
|
484
|
-
children.push(_object_spread_props(_object_spread({
|
|
485
|
-
type: "group",
|
|
486
|
-
key: "".concat(group.key || "shape", "-").concat(si)
|
|
487
|
-
}, transform ? {
|
|
488
|
-
transform: transform
|
|
489
|
-
} : {}), {
|
|
490
|
-
children: group.children
|
|
491
|
-
}));
|
|
492
|
-
});
|
|
493
|
-
// Chart-level components that have their own toScene.
|
|
494
|
-
var components = [
|
|
495
|
-
[
|
|
496
|
-
"legend",
|
|
497
|
-
this._legendClass
|
|
498
|
-
],
|
|
499
|
-
[
|
|
500
|
-
"colorScale",
|
|
501
|
-
this._colorScaleClass
|
|
502
|
-
],
|
|
503
|
-
[
|
|
504
|
-
"timeline",
|
|
505
|
-
this._timelineClass
|
|
506
99
|
]
|
|
507
|
-
];
|
|
508
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
509
|
-
try {
|
|
510
|
-
for(var _iterator = components[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
511
|
-
var _step_value = _sliced_to_array(_step.value, 2), name = _step_value[0], comp = _step_value[1];
|
|
512
|
-
if (comp && typeof comp.toScene === "function" && comp._select && typeof comp._select.node === "function" && comp._select.node()) {
|
|
513
|
-
var compScene = comp.toScene();
|
|
514
|
-
// Tag the legend subtree so its swatches route to legend handlers via
|
|
515
|
-
// the node stamp (renderer-independent), not just SVG DOM ancestry.
|
|
516
|
-
if (name === "legend") {
|
|
517
|
-
tagInteractionGroup(compScene, "legend");
|
|
518
|
-
// Hovering a legend swatch dims the others, like the chart marks:
|
|
519
|
-
// run the legend subtree through the same interaction-opacity pass
|
|
520
|
-
// (a no-op when no hover/active predicate is set).
|
|
521
|
-
compScene = applyInteractionOpacity([
|
|
522
|
-
compScene
|
|
523
|
-
], this)[0];
|
|
524
|
-
} else if (name === "colorScale") {
|
|
525
|
-
compScene = applyColorScaleBucketOpacity([
|
|
526
|
-
compScene
|
|
527
|
-
], this)[0];
|
|
528
|
-
} else if (name === "timeline") tagInteractionGroup(compScene, "timeline");
|
|
529
|
-
children.push({
|
|
530
|
-
type: "group",
|
|
531
|
-
key: "viz-".concat(name),
|
|
532
|
-
children: name === "timeline" ? [
|
|
533
|
-
compScene
|
|
534
|
-
] : insetComponentScene(this, name, compScene, comp.outerBounds())
|
|
535
|
-
});
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
} catch (err) {
|
|
539
|
-
_didIteratorError = true;
|
|
540
|
-
_iteratorError = err;
|
|
541
|
-
} finally{
|
|
542
|
-
try {
|
|
543
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
544
|
-
_iterator.return();
|
|
545
|
-
}
|
|
546
|
-
} finally{
|
|
547
|
-
if (_didIteratorError) {
|
|
548
|
-
throw _iteratorError;
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
100
|
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
101
|
+
];
|
|
102
|
+
// Fixed clip window (e.g. Geomap's map rect): stays put in scene space
|
|
103
|
+
// while the viz-zoom child transform pans/scales content beneath it.
|
|
104
|
+
// Any zoomable chart without its own clip is clipped to the chart area,
|
|
105
|
+
// so zoomed content can't spill over the legend/title/timeline.
|
|
106
|
+
const clip = this._chartClip ?? (this.schema.zoom && this._margin ? chartAreaRect(this) : undefined);
|
|
107
|
+
children.push({
|
|
108
|
+
type: "group",
|
|
109
|
+
key: "viz-chart-cells",
|
|
110
|
+
...clip ? {
|
|
111
|
+
clip
|
|
112
|
+
} : {},
|
|
113
|
+
children: zoomNode
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
// Chart-level components that have their own toScene.
|
|
117
|
+
const components = [
|
|
118
|
+
[
|
|
119
|
+
"legend",
|
|
120
|
+
this._legendClass
|
|
121
|
+
],
|
|
122
|
+
[
|
|
123
|
+
"colorScale",
|
|
124
|
+
this._colorScaleClass
|
|
125
|
+
],
|
|
126
|
+
[
|
|
127
|
+
"timeline",
|
|
128
|
+
this._timelineClass
|
|
129
|
+
]
|
|
130
|
+
];
|
|
131
|
+
for (const [name, comp] of components){
|
|
132
|
+
if (comp && typeof comp.toScene === "function" && comp._select && typeof comp._select.node === "function" && comp._select.node()) {
|
|
133
|
+
let compScene = comp.toScene();
|
|
134
|
+
// Tag the legend subtree so its swatches route to legend handlers via
|
|
135
|
+
// the node stamp (renderer-independent), not just SVG DOM ancestry.
|
|
136
|
+
if (name === "legend") {
|
|
137
|
+
tagInteractionGroup(compScene, "legend");
|
|
138
|
+
// Hovering a legend swatch dims the others, like the chart marks:
|
|
139
|
+
// run the legend subtree through the same interaction-opacity pass
|
|
140
|
+
// (a no-op when no hover/active predicate is set).
|
|
141
|
+
compScene = applyInteractionOpacity([
|
|
142
|
+
compScene
|
|
143
|
+
], this)[0];
|
|
144
|
+
} else if (name === "colorScale") {
|
|
145
|
+
compScene = applyColorScaleBucketOpacity([
|
|
146
|
+
compScene
|
|
147
|
+
], this)[0];
|
|
148
|
+
} else if (name === "timeline") tagInteractionGroup(compScene, "timeline");
|
|
149
|
+
children.push({
|
|
150
|
+
type: "group",
|
|
151
|
+
key: `viz-${name}`,
|
|
152
|
+
children: name === "timeline" ? [
|
|
153
|
+
compScene
|
|
154
|
+
] : insetComponentScene(this, name, compScene, comp.outerBounds())
|
|
155
|
+
});
|
|
570
156
|
}
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
|
|
157
|
+
}
|
|
158
|
+
// E2: FeatureModule.layout() panels (title/subtitle/total, plus the
|
|
159
|
+
// zoom/top-left-controls/attribution overlays appended post-draw).
|
|
160
|
+
if (this._featurePanels && this._featurePanels.length) {
|
|
161
|
+
children.push({
|
|
162
|
+
type: "group",
|
|
163
|
+
key: "viz-features",
|
|
164
|
+
children: this._featurePanels
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
width: this.schema.width,
|
|
169
|
+
height: this.schema.height,
|
|
170
|
+
root: {
|
|
171
|
+
type: "group",
|
|
172
|
+
key: "viz-root",
|
|
173
|
+
children
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
574
178
|
Called by render once all checks are passed.
|
|
575
179
|
@private
|
|
576
|
-
*/
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
},
|
|
581
|
-
{
|
|
582
|
-
/**
|
|
180
|
+
*/ _draw() {
|
|
181
|
+
vizDraw(this);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
583
184
|
The chart's size-legend radius scale (see `ChartDefinition.sizeLegendScale`).
|
|
584
185
|
Charts that size marks override this; the base chart sizes nothing.
|
|
585
186
|
@private
|
|
586
|
-
*/
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
},
|
|
591
|
-
{
|
|
592
|
-
/**
|
|
187
|
+
*/ _sizeLegendScale(_available) {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
593
191
|
The region chart chrome may be drawn inside, with the chart's mark boxes
|
|
594
192
|
as obstacles (see `ChartDefinition.insetRegion`). Charts that leave
|
|
595
193
|
negative space override this; the base chart offers none.
|
|
596
194
|
@private
|
|
597
|
-
*/
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
},
|
|
602
|
-
{
|
|
603
|
-
/**
|
|
195
|
+
*/ _insetRegion() {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
604
199
|
* Applies the threshold algorithm according to the type of chart used.
|
|
605
200
|
* @param {Array} data The data to process.
|
|
606
201
|
* @private
|
|
607
|
-
*/
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
},
|
|
612
|
-
{
|
|
613
|
-
/**
|
|
202
|
+
*/ _thresholdFunction(data, _tree) {
|
|
203
|
+
return data;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
614
206
|
* Detects width and height and sets SVG properties
|
|
615
207
|
* @private
|
|
616
|
-
*/
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
/**
|
|
208
|
+
*/ _setSVGSize(width, height) {
|
|
209
|
+
let [w, h] = width && height ? [
|
|
210
|
+
width,
|
|
211
|
+
height
|
|
212
|
+
] : getSize(this._select.node().parentNode);
|
|
213
|
+
w -= parseFloat(this._select.style("border-left-width"));
|
|
214
|
+
w -= parseFloat(this._select.style("border-right-width"));
|
|
215
|
+
h -= parseFloat(this._select.style("border-top-width"));
|
|
216
|
+
h -= parseFloat(this._select.style("border-bottom-width"));
|
|
217
|
+
if (this._autoWidth) this._measuredWidth = w;
|
|
218
|
+
if (this._autoHeight) this._measuredHeight = h;
|
|
219
|
+
if (this._autoWidth && this.schema.width !== w) {
|
|
220
|
+
this.width(w);
|
|
221
|
+
this._select.style("width", `${this.schema.width}px`).attr("width", `${this.schema.width}px`);
|
|
222
|
+
}
|
|
223
|
+
if (this._autoHeight && this.schema.height !== h) {
|
|
224
|
+
this.height(h);
|
|
225
|
+
this._select.style("height", `${this.schema.height}px`).attr("height", `${this.schema.height}px`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
638
229
|
Draws the visualization given the specified configuration.
|
|
639
230
|
@param callback Optional callback invoked after rendering completes.
|
|
640
|
-
*/
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
},
|
|
645
|
-
{
|
|
646
|
-
/**
|
|
231
|
+
*/ render(callback) {
|
|
232
|
+
return vizRender(this, callback);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
647
235
|
Serializes the most recently rendered output to an SVG string. Returns
|
|
648
236
|
`""` if the chart has not been rendered yet. Both backends support this:
|
|
649
237
|
the SVG backend returns its live `<svg>`, the canvas backend re-renders the
|
|
650
238
|
retained scene through a throwaway SVG backend. Primarily used for
|
|
651
239
|
server-side rendering (see `@d3plus/ssr`).
|
|
652
|
-
*/
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
return (_ref = (_this__sceneRenderer = this._sceneRenderer) === null || _this__sceneRenderer === void 0 ? void 0 : (_this__sceneRenderer_toSVGString = _this__sceneRenderer.toSVGString) === null || _this__sceneRenderer_toSVGString === void 0 ? void 0 : _this__sceneRenderer_toSVGString.call(_this__sceneRenderer)) !== null && _ref !== void 0 ? _ref : "";
|
|
657
|
-
}
|
|
658
|
-
},
|
|
659
|
-
{
|
|
660
|
-
/**
|
|
240
|
+
*/ toSVGString() {
|
|
241
|
+
return this._sceneRenderer?.toSVGString?.() ?? "";
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
661
244
|
Returns the underlying canvas element of the most recent render when the
|
|
662
245
|
canvas backend is active (`renderer("canvas")`), or `undefined` otherwise.
|
|
663
246
|
Server-side callers cast this to their native canvas to encode a raster
|
|
664
247
|
(see `@d3plus/ssr`).
|
|
665
|
-
*/
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
if (!arguments.length) return this._renderer;
|
|
675
|
-
this._renderer = _ === "canvas" ? "canvas" : "svg";
|
|
676
|
-
return this;
|
|
677
|
-
}
|
|
678
|
-
},
|
|
679
|
-
{
|
|
680
|
-
key: "renderMode",
|
|
681
|
-
value: function renderMode(_) {
|
|
682
|
-
if (!arguments.length) return this._renderMode || "full";
|
|
683
|
-
this._renderMode = _;
|
|
684
|
-
return this;
|
|
685
|
-
}
|
|
686
|
-
},
|
|
687
|
-
{
|
|
688
|
-
key: "renderScene",
|
|
689
|
-
value: /**
|
|
690
|
-
Public entry point that renders this chart through the @d3plus/render
|
|
691
|
-
pluggable backends. The compute pass happens via render() (in an svg
|
|
692
|
-
auto-created inside the target div); SvgRenderer/CanvasRenderer paints
|
|
693
|
-
the scene to the target. Returns `{renderer, scene}` so callers can
|
|
694
|
-
interact with the renderer (e.g. for picking) or read the scene data.
|
|
695
|
-
*/ function renderScene(target, opts) {
|
|
696
|
-
return _async_to_generator(function() {
|
|
697
|
-
var _this, kind;
|
|
698
|
-
return _ts_generator(this, function(_state) {
|
|
699
|
-
switch(_state.label){
|
|
700
|
-
case 0:
|
|
701
|
-
_this = this;
|
|
702
|
-
kind = (opts === null || opts === void 0 ? void 0 : opts.kind) || (this._renderer === "canvas" ? "canvas" : "svg");
|
|
703
|
-
this._sceneTarget = target;
|
|
704
|
-
this._renderer = kind;
|
|
705
|
-
this.select(target);
|
|
706
|
-
return [
|
|
707
|
-
4,
|
|
708
|
-
new Promise(function(resolve) {
|
|
709
|
-
return _this.render(function() {
|
|
710
|
-
return resolve();
|
|
711
|
-
});
|
|
712
|
-
})
|
|
713
|
-
];
|
|
714
|
-
case 1:
|
|
715
|
-
_state.sent();
|
|
716
|
-
return [
|
|
717
|
-
2,
|
|
718
|
-
{
|
|
719
|
-
renderer: this._sceneRenderer,
|
|
720
|
-
scene: this._lastSceneRendered
|
|
721
|
-
}
|
|
722
|
-
];
|
|
723
|
-
}
|
|
724
|
-
});
|
|
725
|
-
}).call(this);
|
|
726
|
-
}
|
|
727
|
-
},
|
|
728
|
-
{
|
|
729
|
-
/**
|
|
248
|
+
*/ toCanvas() {
|
|
249
|
+
return this._renderer === "canvas" ? this._sceneRenderer?.toCanvas?.() : undefined;
|
|
250
|
+
}
|
|
251
|
+
renderer(_) {
|
|
252
|
+
if (!arguments.length) return this._renderer;
|
|
253
|
+
this._renderer = _ === "canvas" ? "canvas" : "svg";
|
|
254
|
+
return this;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
730
257
|
Renders this chart through the @d3plus/render pluggable backends. Called
|
|
731
258
|
automatically by `render()`. The compute pass draws into `this._select`
|
|
732
259
|
(an auto-created svg INSIDE the user's target div) — that svg is the
|
|
733
260
|
off-stage detached compute svg. SvgRenderer mounts to the user's target
|
|
734
261
|
div (the parent), as a sibling to the detached compute svg. The compute
|
|
735
262
|
svg's children get cleared so only the scene output is visible.
|
|
736
|
-
*/
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
enterFromBody: this._resolvedEnterFromBody,
|
|
844
|
-
exitTo: this._resolvedExitTo,
|
|
845
|
-
exitToBody: this._resolvedExitToBody,
|
|
846
|
-
instantExitKey: this._resolvedInstantExitKey,
|
|
847
|
-
reunionEnterKey: this._resolvedReunionEnterKey,
|
|
848
|
-
reunionEnterFrom: this._resolvedReunionEnterFrom,
|
|
849
|
-
instantExitAll: this._resolvedInstantExitAll
|
|
850
|
-
});
|
|
851
|
-
this._resolvedEnterFrom = undefined;
|
|
852
|
-
this._resolvedEnterFromBody = undefined;
|
|
853
|
-
this._resolvedExitTo = undefined;
|
|
854
|
-
this._resolvedExitToBody = undefined;
|
|
855
|
-
this._resolvedInstantExitKey = undefined;
|
|
856
|
-
this._resolvedReunionEnterKey = undefined;
|
|
857
|
-
this._resolvedReunionEnterFrom = undefined;
|
|
858
|
-
this._resolvedInstantExitAll = undefined;
|
|
859
|
-
this._lastSceneRendered = scene;
|
|
860
|
-
// Canvas backend: the compute <svg> (`_select`) is an emptied overlay
|
|
861
|
-
// sitting on top of the <canvas>. An svg root hit-tests its whole box, so
|
|
862
|
-
// even empty it swallows the pointer events the canvas needs for
|
|
863
|
-
// tooltip/hover/legend picking — the symptom being "renders fine, no
|
|
864
|
-
// tooltips." Make the overlay transparent to pointer events so the canvas
|
|
865
|
-
// is the sole interaction surface. The only interactive DOM that still
|
|
866
|
-
// lives in this svg is the timeline's d3-brush (the canvas can't host the
|
|
867
|
-
// native brush handles), so re-enable events on just that group. On the
|
|
868
|
-
// SVG backend `_select` IS the scene host, so events must stay enabled
|
|
869
|
-
// (except while the zoom brush is active — see `applyZoomPointerEvents`).
|
|
870
|
-
applyZoomPointerEvents(this);
|
|
871
|
-
if (this._select && kind === "canvas") this._select.select("g.d3plus-viz-timeline").style("pointer-events", "auto");
|
|
872
|
-
if (kind === "canvas") bindCanvasZoom(this);
|
|
873
|
-
// The timeline brush (d3-brush DOM, mounted in `g.d3plus-viz-timeline` in
|
|
874
|
-
// the outer svg) must paint above the scene-rendered timeline buttons/ticks
|
|
875
|
-
// so its selection tint + handles sit on top of them (matching v3). The
|
|
876
|
-
// renderer appends its scene <svg> last, so without this the brush layer
|
|
877
|
-
// ends up behind it — the selection's translucent fill is then hidden by
|
|
878
|
-
// the opaque buttons and only the edge handles peek out.
|
|
879
|
-
if (kind === "svg") {
|
|
880
|
-
var host = userTarget && typeof userTarget.querySelector === "function" ? userTarget : null;
|
|
881
|
-
var tlGroup = host ? host.querySelector(":scope > g.d3plus-viz-timeline") : null;
|
|
882
|
-
if (tlGroup) host.appendChild(tlGroup);
|
|
883
|
-
// Likewise the zoom brush, so its selection box draws over the shapes.
|
|
884
|
-
var zoomBrush = host ? host.querySelector(":scope > g.d3plus-zoom-brush") : null;
|
|
885
|
-
if (zoomBrush && zoomBrush !== host.lastElementChild) host.appendChild(zoomBrush);
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
},
|
|
889
|
-
{
|
|
890
|
-
/**
|
|
263
|
+
*/ _drawSceneToTarget(durationOverride) {
|
|
264
|
+
const kind = this._renderer === "canvas" ? "canvas" : "svg";
|
|
265
|
+
const computeSvg = this._select && this._select.node ? this._select.node() : null;
|
|
266
|
+
if (!computeSvg) return;
|
|
267
|
+
// Mount renderer INSIDE the user's `_select` (svg or div). Tests like
|
|
268
|
+
// `svgA.querySelector('[data-key="viz-legend"]')` need the scene output
|
|
269
|
+
// to live inside the user's container, not as a sibling.
|
|
270
|
+
const mountTarget = mountTargetFor(kind, computeSvg);
|
|
271
|
+
const scene = this.toScene();
|
|
272
|
+
this._paintedScene = scene;
|
|
273
|
+
const w = this.schema.width || 400;
|
|
274
|
+
const h = this.schema.height || 300;
|
|
275
|
+
this._ensureSceneRenderer(kind, mountTarget, w, h);
|
|
276
|
+
// `durationOverride` defaults to the chart's `_duration` for normal
|
|
277
|
+
// re-renders. Interaction handlers (zoomed, hover, etc.) pass 0 to
|
|
278
|
+
// skip the transition machinery — animating every wheel/drag tick
|
|
279
|
+
// accumulates `setTimeout(duration+10)` per event.
|
|
280
|
+
const drawDuration = durationOverride !== undefined ? durationOverride : this._instantNextDraw ? 0 : this.schema.duration;
|
|
281
|
+
// A duration>0 render (drill-down, zoom, re-center) must win over any
|
|
282
|
+
// pending coalesced duration-0 repaint — otherwise that repaint fires on
|
|
283
|
+
// the next frame and interrupts this transition, snapping shapes to their
|
|
284
|
+
// final geometry.
|
|
285
|
+
if (drawDuration > 0 && this._sceneRepaintRAF != null) {
|
|
286
|
+
cancelAnimationFrame(this._sceneRepaintRAF);
|
|
287
|
+
this._sceneRepaintRAF = undefined;
|
|
288
|
+
}
|
|
289
|
+
// Mark the window during which an animated transition is in flight, so the
|
|
290
|
+
// pointer bridge can ignore interaction until it settles. A hover/click
|
|
291
|
+
// mid-transition would schedule a duration-0 repaint that interrupts the
|
|
292
|
+
// running transition and snaps it to its end (the glitchy jump). Matches
|
|
293
|
+
// the SvgRenderer/CanvasRenderer `duration + 10` end timer, plus a small
|
|
294
|
+
// buffer so events re-enable just after the paint completes.
|
|
295
|
+
if (drawDuration > 0) this._transitionEndsAt = Date.now() + drawDuration + 30;
|
|
296
|
+
// Order persistent motion trails in time by the current timeline period, so
|
|
297
|
+
// they grow only as playback moves forward and rewind when it steps back.
|
|
298
|
+
// Only when the timeline selects a single period (`brushing: false`): a range
|
|
299
|
+
// selection has no single "current time", which would scramble the step
|
|
300
|
+
// logic, so we withhold the sequence and trails fall back to ephemeral.
|
|
301
|
+
// Normalize to milliseconds via `date()` — the selection mixes Date objects
|
|
302
|
+
// (brush/initial) and raw period numbers (playback), which compare on wildly
|
|
303
|
+
// different scales otherwise, scrambling the forward/backward test.
|
|
304
|
+
const sel = this._timelineSelection;
|
|
305
|
+
const brushing = this._timelineClass ? this._timelineClass.schema.brushing !== false : true;
|
|
306
|
+
const sequence = !brushing && Array.isArray(sel) && sel.length ? Math.max(...sel.map((v)=>Number(date(Number(v))))) : undefined;
|
|
307
|
+
// A forward jump that skips periods (manual click, not single-step play) draws
|
|
308
|
+
// one coarse segment; compute the marks' real positions at the skipped periods
|
|
309
|
+
// so the trail bends through them (see render commitTrailCatchups).
|
|
310
|
+
const trailCatchup = sequence !== undefined && this._trailSeq !== undefined && sequence > this._trailSeq ? computeTrailCatchup(this, scene, this._trailSeq, sequence) : undefined;
|
|
311
|
+
if (sequence !== undefined) this._trailSeq = sequence;
|
|
312
|
+
this._sceneRenderer.drawScene(scene, {
|
|
313
|
+
duration: drawDuration,
|
|
314
|
+
sequence,
|
|
315
|
+
trailCatchup,
|
|
316
|
+
// The drill-down morph's resolved boxes for this draw, if a drill
|
|
317
|
+
// click armed one (resolveDrillMorph, run just before this method via
|
|
318
|
+
// runVizPipeline). One-shot: cleared right below so a later repaint
|
|
319
|
+
// that reaches this method by some OTHER path (a zoom/pan tick, a
|
|
320
|
+
// coalesced hover repaint, Rings' click-to-recenter) never inherits a
|
|
321
|
+
// stale box from an earlier drill click.
|
|
322
|
+
enterFrom: this._resolvedEnterFrom,
|
|
323
|
+
enterFromBody: this._resolvedEnterFromBody,
|
|
324
|
+
exitTo: this._resolvedExitTo,
|
|
325
|
+
exitToBody: this._resolvedExitToBody,
|
|
326
|
+
instantExitKey: this._resolvedInstantExitKey,
|
|
327
|
+
reunionEnterKey: this._resolvedReunionEnterKey,
|
|
328
|
+
reunionEnterFrom: this._resolvedReunionEnterFrom,
|
|
329
|
+
instantExitAll: this._resolvedInstantExitAll
|
|
330
|
+
});
|
|
331
|
+
this._resolvedEnterFrom = undefined;
|
|
332
|
+
this._resolvedEnterFromBody = undefined;
|
|
333
|
+
this._resolvedExitTo = undefined;
|
|
334
|
+
this._resolvedExitToBody = undefined;
|
|
335
|
+
this._resolvedInstantExitKey = undefined;
|
|
336
|
+
this._resolvedReunionEnterKey = undefined;
|
|
337
|
+
this._resolvedReunionEnterFrom = undefined;
|
|
338
|
+
this._resolvedInstantExitAll = undefined;
|
|
339
|
+
this._lastSceneRendered = scene;
|
|
340
|
+
// Canvas backend: the compute <svg> (`_select`) is an emptied overlay
|
|
341
|
+
// sitting on top of the <canvas>. An svg root hit-tests its whole box, so
|
|
342
|
+
// even empty it swallows the pointer events the canvas needs for
|
|
343
|
+
// tooltip/hover/legend picking — the symptom being "renders fine, no
|
|
344
|
+
// tooltips." Make the overlay transparent to pointer events so the canvas
|
|
345
|
+
// is the sole interaction surface. The only interactive DOM that still
|
|
346
|
+
// lives in this svg is the timeline's d3-brush (the canvas can't host the
|
|
347
|
+
// native brush handles), so re-enable events on just that group. On the
|
|
348
|
+
// SVG backend `_select` IS the scene host, so events must stay enabled
|
|
349
|
+
// (except while the zoom brush is active — see `applyZoomPointerEvents`).
|
|
350
|
+
applyZoomPointerEvents(this);
|
|
351
|
+
if (this._select && kind === "canvas") this._select.selectAll("g.d3plus-viz-timeline, g.d3plus-viz-brush").style("pointer-events", "auto");
|
|
352
|
+
if (kind === "canvas") bindCanvasZoom(this);
|
|
353
|
+
// The timeline brush (d3-brush DOM, mounted in `g.d3plus-viz-timeline` in
|
|
354
|
+
// the outer svg) must paint above the scene-rendered timeline buttons/ticks
|
|
355
|
+
// so its selection tint + handles sit on top of them (matching v3). The
|
|
356
|
+
// renderer appends its scene <svg> last, so without this the brush layer
|
|
357
|
+
// ends up behind it — the selection's translucent fill is then hidden by
|
|
358
|
+
// the opaque buttons and only the edge handles peek out.
|
|
359
|
+
if (kind === "svg") {
|
|
360
|
+
const host = typeof computeSvg.querySelector === "function" ? computeSvg : null;
|
|
361
|
+
const tlGroup = host ? host.querySelector(":scope > g.d3plus-viz-timeline") : null;
|
|
362
|
+
if (tlGroup) host.appendChild(tlGroup);
|
|
363
|
+
// Likewise the zoom brush and any chart-owned brush layer (`g.d3plus-viz-brush`), so their selections draw over the shapes.
|
|
364
|
+
host?.querySelectorAll(":scope > g.d3plus-zoom-brush, :scope > g.d3plus-viz-brush").forEach((layer)=>{
|
|
365
|
+
if (layer !== host.lastElementChild) host.appendChild(layer);
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
891
370
|
Resolves the `(d, i, x)` a picked scene node reports to interaction
|
|
892
371
|
handlers (tooltip, click, user `on` handlers). `pick.datum` is the raw
|
|
893
372
|
scene datum; for a Plot shape that's the wrapped record `{data, i}`, which
|
|
@@ -896,30 +375,79 @@ var Viz = /*#__PURE__*/ function(VizBase) {
|
|
|
896
375
|
multi-point shapes (Line/Area) so a series tooltip reflects the hovered
|
|
897
376
|
x rather than the whole-series aggregate.
|
|
898
377
|
@private
|
|
899
|
-
*/
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
var sourceDatum = rawDatum && rawDatum.data ? rawDatum.data : rawDatum;
|
|
904
|
-
var sourceIndex = rawDatum && typeof rawDatum.i === "number" ? rawDatum.i : (_pick_index = pick.index) !== null && _pick_index !== void 0 ? _pick_index : 0;
|
|
905
|
-
return {
|
|
906
|
-
d: sourceDatum,
|
|
907
|
-
i: sourceIndex,
|
|
908
|
-
x: rawDatum
|
|
909
|
-
};
|
|
910
|
-
}
|
|
911
|
-
},
|
|
912
|
-
{
|
|
913
|
-
/**
|
|
378
|
+
*/ _interactionDatum(pick, _event) {
|
|
379
|
+
return handlerDatum(pick.datum, pick.index ?? 0);
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
914
382
|
Pointer hook run by `_routeSceneEvent` before any handler routing, for
|
|
915
383
|
every event including ones over empty space. No-op here; Plot overrides
|
|
916
384
|
it to drive the shared multi-series tooltip and crosshair.
|
|
917
385
|
@private
|
|
918
|
-
*/
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
386
|
+
*/ _sharedHover(_event) {}
|
|
387
|
+
/**
|
|
388
|
+
The chart's small-multiple hooks (see `ChartDefinition.facet`). The base
|
|
389
|
+
chart has none: each panel draws the way the whole chart does.
|
|
390
|
+
@private
|
|
391
|
+
*/ _facetHooks() {
|
|
392
|
+
return {};
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
Reuses the scene renderer when it matches `kind` and `mountTarget`
|
|
396
|
+
(resizing it to `w` × `h`), or tears it down and mounts a fresh one
|
|
397
|
+
bridged to the chart's pointer handlers.
|
|
398
|
+
@private
|
|
399
|
+
*/ _ensureSceneRenderer(kind, mountTarget, w, h) {
|
|
400
|
+
// Reuse the renderer instance if it matches the kind, to avoid mount
|
|
401
|
+
// churn. `target()` is the public Renderer-interface method (no
|
|
402
|
+
// reaching into renderer-private slots). It's optional on the
|
|
403
|
+
// interface; third-party renderers without it fall through to
|
|
404
|
+
// remount on every draw — correct but with mount churn.
|
|
405
|
+
const currentContainer = this._sceneRenderer?.target ? this._sceneRenderer.target()?.container : undefined;
|
|
406
|
+
const containerChanged = this._sceneRenderer?.target ? currentContainer !== mountTarget : false;
|
|
407
|
+
if (!this._sceneRenderer || this._sceneRenderer.kind !== kind || containerChanged) {
|
|
408
|
+
// Tear down the outgoing renderer before mounting a fresh one. It owns
|
|
409
|
+
// its own DOM (canvas/svg + overlay host), pointer listeners, and
|
|
410
|
+
// transition timers; without this, switching kind (svg<->canvas) or
|
|
411
|
+
// container orphans that DOM in the user's element, stacking the old
|
|
412
|
+
// mode's output behind the new one and accumulating on every switch.
|
|
413
|
+
if (this._sceneRenderer && typeof this._sceneRenderer.destroy === "function") this._sceneRenderer.destroy();
|
|
414
|
+
const Ctor = kind === "canvas" ? CanvasRenderer : SvgRenderer;
|
|
415
|
+
this._sceneRenderer = new Ctor();
|
|
416
|
+
// `_scenePixelRatio`, when set (e.g. by @d3plus/ssr for hi-res PNG output),
|
|
417
|
+
// fixes the canvas backing-store scale; otherwise the renderer falls back
|
|
418
|
+
// to `devicePixelRatio`.
|
|
419
|
+
this._sceneRenderer.mount({
|
|
420
|
+
container: mountTarget,
|
|
421
|
+
width: w,
|
|
422
|
+
height: h,
|
|
423
|
+
pixelRatio: this._scenePixelRatio
|
|
424
|
+
});
|
|
425
|
+
// Bridge renderer pointer events → viz.schema.on handlers. Without this,
|
|
426
|
+
// tooltips never fire on the v4 scene-rendered path because
|
|
427
|
+
// `shape.on(evt, fn)` in plotPaint only wires d3-selection
|
|
428
|
+
// listeners on DOM nodes the scene renderer doesn't create.
|
|
429
|
+
// Renderer events carry the picked scene node; the routing lives in
|
|
430
|
+
// `_routeSceneEvent` (kept out of this method so the mount path stays
|
|
431
|
+
// readable). `_lastScenePick` remembers the most recently hovered node
|
|
432
|
+
// so `mouseleave` — fired with a null pick — can still tell the matching
|
|
433
|
+
// handlers which shape/legend item was left (so the tooltip clears).
|
|
434
|
+
this._lastScenePick = null;
|
|
435
|
+
this._sceneRenderer.on((event)=>this._routeSceneEvent(event));
|
|
436
|
+
} else {
|
|
437
|
+
this._sceneRenderer.resize(w, h);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
Routes a renderer pointer event to the chart's handlers. Over a
|
|
442
|
+
small-multiples panel, the handlers run with that panel's chart state in
|
|
443
|
+
place (see `facet/facetPanel.ts`), so code written for one chart reads the
|
|
444
|
+
panel under the pointer.
|
|
445
|
+
@private
|
|
446
|
+
*/ _routeSceneEvent(event) {
|
|
447
|
+
const viz = this;
|
|
448
|
+
withFacetPanel(viz, facetPanelAt(viz, event.point), ()=>this._dispatchSceneEvent(event));
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
923
451
|
Routes a renderer pointer event to the matching `viz.schema.on` handlers.
|
|
924
452
|
Bridges the v4 scene-rendered path (SvgRenderer/CanvasRenderer), where
|
|
925
453
|
compute-mode shapes mount no per-shape DOM, so `shape.on(evt, fn)`
|
|
@@ -928,99 +456,97 @@ var Viz = /*#__PURE__*/ function(VizBase) {
|
|
|
928
456
|
shape (+ shape-class-scoped) handlers, and chrome (axis/timeline/back) is
|
|
929
457
|
excluded. Split out of `_drawSceneToTarget` to keep that method small.
|
|
930
458
|
@private
|
|
931
|
-
*/
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
// swallow per-event errors so one bad handler doesn't
|
|
955
|
-
// break subsequent events.
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
};
|
|
959
|
-
if (event.type === "mouseleave") {
|
|
960
|
-
var lastPick = this._lastScenePick;
|
|
961
|
-
if (lastPick) {
|
|
962
|
-
fire("mouseleave.".concat(lastPick.isLegend ? "legend" : "shape"), lastPick.d, lastPick.i, lastPick.x);
|
|
963
|
-
if (!lastPick.isLegend && lastPick.shapeType) fire("mouseleave.".concat(lastPick.shapeType), lastPick.d, lastPick.i, lastPick.x);
|
|
964
|
-
fire("mouseleave", lastPick.d, lastPick.i, lastPick.x);
|
|
965
|
-
}
|
|
966
|
-
this._lastScenePick = null;
|
|
967
|
-
// Cleared here, then re-set by the enter/move the renderer fires
|
|
968
|
-
// synchronously when the pointer crosses to an adjacent node — so a
|
|
969
|
-
// shape→label hand-off leaves `_hoverDatum` pointing at the new node
|
|
970
|
-
// (same datum), which `mouseleave` reads to suppress a flicker.
|
|
971
|
-
this._hoverDatum = null;
|
|
972
|
-
return;
|
|
973
|
-
}
|
|
974
|
-
if (!pick || !pick.node) return;
|
|
975
|
-
// Scene nodes carry interaction metadata stamped by Viz.toScene.
|
|
976
|
-
var nodeAny = pick.node;
|
|
977
|
-
// Axis ticks/labels, the timeline, and Plot's trend lines are chrome —
|
|
978
|
-
// they carry data but are not chart shapes, so they must not fire shape
|
|
979
|
-
// tooltips/handlers (a trend line's own tooltip runs in `_sharedHover`).
|
|
980
|
-
if (nodeAny.interactionGroup === "axis" || nodeAny.interactionGroup === "timeline" || nodeAny.interactionGroup === "trend") return;
|
|
981
|
-
// Prefer the node's stamped interaction group (set by Viz.toScene), so
|
|
982
|
-
// legend swatches route to legend handlers on Canvas too — where the
|
|
983
|
-
// single canvas element has no per-shape DOM to walk. Fall back to SVG
|
|
984
|
-
// DOM ancestry for nodes the stamp didn't reach.
|
|
985
|
-
var target = event.nativeEvent && event.nativeEvent.target;
|
|
986
|
-
var isLegendNode = nodeAny.interactionGroup === "legend" || (target && typeof target.closest === "function" ? !!target.closest('[data-key="viz-legend"]') : false);
|
|
987
|
-
var suffix = isLegendNode ? "legend" : "shape";
|
|
988
|
-
var handlerKey = "".concat(event.type, ".").concat(suffix);
|
|
989
|
-
// Resolve the datum + index this pick reports to handlers, ONCE, and reuse
|
|
990
|
-
// it for every handler fired below so tooltip/click/user handlers agree on
|
|
991
|
-
// which datum the pointer is over. The base unwraps the node's raw datum to
|
|
992
|
-
// its source row; Plot overrides `_interactionDatum` to report the point
|
|
993
|
-
// nearest the cursor for multi-point shapes (Line/Area).
|
|
994
|
-
var _this__interactionDatum = this._interactionDatum(pick, event), sourceDatum = _this__interactionDatum.d, sourceIndex = _this__interactionDatum.i, rawDatum = _this__interactionDatum.x;
|
|
995
|
-
var shapeType = typeof nodeAny.shapeType === "string" ? nodeAny.shapeType : null;
|
|
996
|
-
this._lastScenePick = {
|
|
997
|
-
d: sourceDatum,
|
|
998
|
-
i: sourceIndex,
|
|
999
|
-
x: rawDatum,
|
|
1000
|
-
isLegend: isLegendNode,
|
|
1001
|
-
shapeType: shapeType,
|
|
1002
|
-
// The live picked node's own geometry, read synchronously by clickShape
|
|
1003
|
-
// (before the drill-down re-render replaces this frame) to arm the
|
|
1004
|
-
// forward drill-down morph.
|
|
1005
|
-
node: pick.node
|
|
1006
|
-
};
|
|
1007
|
-
this._hoverDatum = rawDatum;
|
|
1008
|
-
fire(handlerKey, sourceDatum, sourceIndex, rawDatum);
|
|
1009
|
-
// Shape-class-scoped handlers (`"click.Bar"`, `"mousemove.Circle"`). The
|
|
1010
|
-
// emitting shape stamps its type onto the node; on the scene path this is
|
|
1011
|
-
// the only place these fire (compute-mode shapes wire no DOM listeners).
|
|
1012
|
-
// Legend nodes are excluded so a legend swatch's shape type can't
|
|
1013
|
-
// masquerade as a chart-shape handler.
|
|
1014
|
-
if (!isLegendNode && shapeType) {
|
|
1015
|
-
fire("".concat(event.type, ".").concat(shapeType), sourceDatum, sourceIndex, rawDatum);
|
|
459
|
+
*/ _dispatchSceneEvent(event) {
|
|
460
|
+
// Ignore all pointer interaction while an animated transition (zoom,
|
|
461
|
+
// re-center, drill-down, entrance) is in flight. Hovering or clicking a
|
|
462
|
+
// shape mid-transition would fire a handler that schedules a duration-0
|
|
463
|
+
// repaint, interrupting the running transition and snapping it to its end
|
|
464
|
+
// — the glitchy jump. `_transitionEndsAt` is stamped by `_drawSceneToTarget`
|
|
465
|
+
// for the transition's duration; it lapses on its own, so interaction
|
|
466
|
+
// resumes the instant the transition settles.
|
|
467
|
+
// Runs for every event, picked or not, so a chart can track the pointer
|
|
468
|
+
// across empty space (Plot's shared tooltip + crosshair) — and ahead of
|
|
469
|
+
// the transition guard below, so leaving mid-transition still clears it.
|
|
470
|
+
this._sharedHover(event);
|
|
471
|
+
if (this._transitionEndsAt && Date.now() < this._transitionEndsAt) return;
|
|
472
|
+
const pick = event.pick;
|
|
473
|
+
// Dispatch helper shared by the live-pick path and the leave path.
|
|
474
|
+
const fire = (key, d, i, x)=>{
|
|
475
|
+
const fn = this.schema.on && this.schema.on[key];
|
|
476
|
+
if (typeof fn === "function") {
|
|
477
|
+
try {
|
|
478
|
+
fn.call(this, d, i, x, event.nativeEvent);
|
|
479
|
+
} catch {
|
|
480
|
+
// swallow per-event errors so one bad handler doesn't
|
|
481
|
+
// break subsequent events.
|
|
1016
482
|
}
|
|
1017
|
-
// Also fire the un-suffixed handler (e.g. "mousemove") so user-registered
|
|
1018
|
-
// global handlers see the event too.
|
|
1019
|
-
fire(event.type, sourceDatum, sourceIndex, rawDatum);
|
|
1020
483
|
}
|
|
1021
|
-
}
|
|
1022
|
-
{
|
|
1023
|
-
|
|
484
|
+
};
|
|
485
|
+
if (event.type === "mouseleave") {
|
|
486
|
+
const lastPick = this._lastScenePick;
|
|
487
|
+
if (lastPick) {
|
|
488
|
+
fire(`mouseleave.${lastPick.isLegend ? "legend" : "shape"}`, lastPick.d, lastPick.i, lastPick.x);
|
|
489
|
+
for (const t of lastPick.shapeTargets)fire(`mouseleave.${t.shapeType}`, t.d, t.i, t.x);
|
|
490
|
+
fire("mouseleave", lastPick.d, lastPick.i, lastPick.x);
|
|
491
|
+
}
|
|
492
|
+
this._lastScenePick = null;
|
|
493
|
+
// Cleared here, then re-set by the enter/move the renderer fires
|
|
494
|
+
// synchronously when the pointer crosses to an adjacent node — so a
|
|
495
|
+
// shape→label hand-off leaves `_hoverDatum` pointing at the new node
|
|
496
|
+
// (same datum), which `mouseleave` reads to suppress a flicker.
|
|
497
|
+
this._hoverDatum = null;
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
if (!pick || !pick.node) return;
|
|
501
|
+
// Scene nodes carry interaction metadata stamped by Viz.toScene.
|
|
502
|
+
const nodeAny = pick.node;
|
|
503
|
+
// Axis ticks/labels, the timeline, and Plot's trend lines are chrome —
|
|
504
|
+
// they carry data but are not chart shapes, so they must not fire shape
|
|
505
|
+
// tooltips/handlers (a trend line's own tooltip runs in `_sharedHover`).
|
|
506
|
+
if (nodeAny.interactionGroup === "axis" || nodeAny.interactionGroup === "timeline" || nodeAny.interactionGroup === "trend") return;
|
|
507
|
+
// Prefer the node's stamped interaction group (set by Viz.toScene), so
|
|
508
|
+
// legend swatches route to legend handlers on Canvas too — where the
|
|
509
|
+
// single canvas element has no per-shape DOM to walk. Fall back to SVG
|
|
510
|
+
// DOM ancestry for nodes the stamp didn't reach.
|
|
511
|
+
const target = event.nativeEvent && event.nativeEvent.target;
|
|
512
|
+
const isLegendNode = nodeAny.interactionGroup === "legend" || (target && typeof target.closest === "function" ? !!target.closest('[data-key="viz-legend"]') : false);
|
|
513
|
+
const suffix = isLegendNode ? "legend" : "shape";
|
|
514
|
+
const handlerKey = `${event.type}.${suffix}`;
|
|
515
|
+
// Resolve the datum + index this pick reports to handlers, ONCE, and reuse
|
|
516
|
+
// it for every handler fired below so tooltip/click/user handlers agree on
|
|
517
|
+
// which datum the pointer is over. The base unwraps the node's raw datum to
|
|
518
|
+
// its source row; Plot overrides `_interactionDatum` to report the point
|
|
519
|
+
// nearest the cursor for multi-point shapes (Line/Area).
|
|
520
|
+
const { d: sourceDatum, i: sourceIndex, x: rawDatum } = this._interactionDatum(pick, event);
|
|
521
|
+
// Shape-class-scoped handlers (`"click.Bar"`, `"mousemove.Circle"`): the
|
|
522
|
+
// node's own shape type, then any composite it is a part of (`"click.Box"`
|
|
523
|
+
// on a box's whisker). On the scene path this is the only place these fire
|
|
524
|
+
// (compute-mode shapes wire no DOM listeners). Legend nodes are excluded so
|
|
525
|
+
// a legend swatch's shape type can't masquerade as a chart-shape handler.
|
|
526
|
+
const shapeTargets = isLegendNode ? [] : shapeClassTargets(pick.node, {
|
|
527
|
+
d: sourceDatum,
|
|
528
|
+
i: sourceIndex,
|
|
529
|
+
x: rawDatum
|
|
530
|
+
});
|
|
531
|
+
this._lastScenePick = {
|
|
532
|
+
d: sourceDatum,
|
|
533
|
+
i: sourceIndex,
|
|
534
|
+
x: rawDatum,
|
|
535
|
+
isLegend: isLegendNode,
|
|
536
|
+
shapeTargets,
|
|
537
|
+
// The live picked node's own geometry, read synchronously by clickShape
|
|
538
|
+
// (before the drill-down re-render replaces this frame) to arm the
|
|
539
|
+
// forward drill-down morph.
|
|
540
|
+
node: pick.node
|
|
541
|
+
};
|
|
542
|
+
this._hoverDatum = rawDatum;
|
|
543
|
+
fire(handlerKey, sourceDatum, sourceIndex, rawDatum);
|
|
544
|
+
for (const t of shapeTargets)fire(`${event.type}.${t.shapeType}`, t.d, t.i, t.x);
|
|
545
|
+
// Also fire the un-suffixed handler (e.g. "mousemove") so user-registered
|
|
546
|
+
// global handlers see the event too.
|
|
547
|
+
fire(event.type, sourceDatum, sourceIndex, rawDatum);
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
1024
550
|
Coalesces interaction-driven scene repaints (hover/active dimming) into a
|
|
1025
551
|
single paint per animation frame. A fast pointer sweep across a dense
|
|
1026
552
|
chart fires a hover transition per shape crossed; painting each one
|
|
@@ -1028,70 +554,56 @@ var Viz = /*#__PURE__*/ function(VizBase) {
|
|
|
1028
554
|
thread (~200ms stalls) so the tooltip couldn't reposition and appeared
|
|
1029
555
|
stuck at its last spot. Only the latest hover state is visible, so the
|
|
1030
556
|
intermediate paints are wasted — collapse them to one rAF-scheduled draw.
|
|
1031
|
-
*/
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
}
|
|
1045
|
-
},
|
|
1046
|
-
{
|
|
1047
|
-
/**
|
|
557
|
+
*/ _scheduleSceneRepaint() {
|
|
558
|
+
if (!this._sceneRenderer) return;
|
|
559
|
+
if (typeof requestAnimationFrame !== "function") {
|
|
560
|
+
this._drawSceneToTarget(0);
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
if (this._sceneRepaintRAF != null) return;
|
|
564
|
+
this._sceneRepaintRAF = requestAnimationFrame(()=>{
|
|
565
|
+
this._sceneRepaintRAF = undefined;
|
|
566
|
+
this._drawSceneToTarget(0);
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
1048
570
|
Tears down the visualization: disconnects the ResizeObserver, stops listening for web font loads, and removes DOM event listeners. Call this when unmounting to avoid memory leaks.
|
|
1049
|
-
*/
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
if (this._visiblePoll) {
|
|
1064
|
-
this._visiblePoll = clearInterval(this._visiblePoll);
|
|
1065
|
-
}
|
|
1066
|
-
if (this._resizePoll) {
|
|
1067
|
-
this._resizePoll = clearTimeout(this._resizePoll);
|
|
1068
|
-
}
|
|
1069
|
-
if (this._scrollPoll) {
|
|
1070
|
-
this._scrollPoll = clearTimeout(this._scrollPoll);
|
|
1071
|
-
}
|
|
1072
|
-
(_this__visibleUnobserve = (_this1 = this)._visibleUnobserve) === null || _this__visibleUnobserve === void 0 ? void 0 : _this__visibleUnobserve.call(_this1);
|
|
1073
|
-
this._visibleUnobserve = undefined;
|
|
1074
|
-
(_this__unloadUnobserve = (_this2 = this)._unloadUnobserve) === null || _this__unloadUnobserve === void 0 ? void 0 : _this__unloadUnobserve.call(_this2);
|
|
1075
|
-
this._unloadUnobserve = undefined;
|
|
1076
|
-
if (this._sceneRepaintRAF != null) {
|
|
1077
|
-
if (typeof cancelAnimationFrame === "function") cancelAnimationFrame(this._sceneRepaintRAF);
|
|
1078
|
-
this._sceneRepaintRAF = undefined;
|
|
1079
|
-
}
|
|
1080
|
-
if (this.schema.scrollContainer) select(this.schema.scrollContainer).on("scroll.".concat(this._uuid), null);
|
|
1081
|
-
// Destroy the active scene renderer (clears its own pointer-rect
|
|
1082
|
-
// listeners, overlay host, canvas/svg DOM, timers).
|
|
1083
|
-
if (this._sceneRenderer && typeof this._sceneRenderer.destroy === "function") {
|
|
1084
|
-
this._sceneRenderer.destroy();
|
|
1085
|
-
this._sceneRenderer = undefined;
|
|
1086
|
-
}
|
|
1087
|
-
return this;
|
|
1088
|
-
}
|
|
571
|
+
*/ destroy() {
|
|
572
|
+
unregisterLink(this);
|
|
573
|
+
this._resizeObserver?.disconnect();
|
|
574
|
+
this._fontsUnsubscribe?.();
|
|
575
|
+
this._fontsUnsubscribe = undefined;
|
|
576
|
+
this._tooltipClass.data([]).render();
|
|
577
|
+
select("body").on(`touchstart.${this._uuid}`, null);
|
|
578
|
+
// Clear the visibility/resize/scroll poll timers + scroll listener
|
|
579
|
+
// so a destroyed chart doesn't keep firing intervals/timeouts that
|
|
580
|
+
// hold the entire viz instance alive. Without this, an SPA that
|
|
581
|
+
// mounts/unmounts charts on tab switches leaks the scene tree +
|
|
582
|
+
// a 200ms-interval timer per leaked chart.
|
|
583
|
+
if (this._visiblePoll) {
|
|
584
|
+
this._visiblePoll = clearInterval(this._visiblePoll);
|
|
1089
585
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
586
|
+
if (this._resizePoll) {
|
|
587
|
+
this._resizePoll = clearTimeout(this._resizePoll);
|
|
588
|
+
}
|
|
589
|
+
if (this._scrollPoll) {
|
|
590
|
+
this._scrollPoll = clearTimeout(this._scrollPoll);
|
|
591
|
+
}
|
|
592
|
+
this._visibleUnobserve?.();
|
|
593
|
+
this._visibleUnobserve = undefined;
|
|
594
|
+
this._unloadUnobserve?.();
|
|
595
|
+
this._unloadUnobserve = undefined;
|
|
596
|
+
if (this._sceneRepaintRAF != null) {
|
|
597
|
+
if (typeof cancelAnimationFrame === "function") cancelAnimationFrame(this._sceneRepaintRAF);
|
|
598
|
+
this._sceneRepaintRAF = undefined;
|
|
599
|
+
}
|
|
600
|
+
if (this.schema.scrollContainer) select(this.schema.scrollContainer).on(`scroll.${this._uuid}`, null);
|
|
601
|
+
// Destroy the active scene renderer (clears its own pointer-rect
|
|
602
|
+
// listeners, overlay host, canvas/svg DOM, timers).
|
|
603
|
+
if (this._sceneRenderer && typeof this._sceneRenderer.destroy === "function") {
|
|
604
|
+
this._sceneRenderer.destroy();
|
|
605
|
+
this._sceneRenderer = undefined;
|
|
606
|
+
}
|
|
607
|
+
return this;
|
|
608
|
+
}
|
|
609
|
+
}
|