@d3plus/core 3.1.6 → 4.0.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 +9922 -78537
- package/es/index.js +8 -0
- package/es/index.js.map +1 -1
- package/es/internal.js +54 -0
- package/es/internal.js.map +1 -0
- package/es/src/charts/AreaPlot/index.js +36 -0
- package/es/src/charts/AreaPlot/index.js.map +1 -0
- package/es/src/charts/BarChart/index.js +48 -0
- package/es/src/charts/BarChart/index.js.map +1 -0
- package/es/src/charts/BoxWhisker/index.js +52 -0
- package/es/src/charts/BoxWhisker/index.js.map +1 -0
- package/es/src/charts/BumpChart/index.js +81 -0
- package/es/src/charts/BumpChart/index.js.map +1 -0
- package/es/src/charts/Donut/index.js +42 -0
- package/es/src/charts/Donut/index.js.map +1 -0
- package/es/src/charts/Geomap/applyLayout.js +208 -0
- package/es/src/charts/Geomap/applyLayout.js.map +1 -0
- package/es/src/charts/Geomap/emit.js +169 -0
- package/es/src/charts/Geomap/emit.js.map +1 -0
- package/es/src/charts/Geomap/index.js +521 -0
- package/es/src/charts/Geomap/index.js.map +1 -0
- package/es/src/charts/LinePlot/index.js +32 -0
- package/es/src/charts/LinePlot/index.js.map +1 -0
- package/es/src/charts/Matrix/applyLayout.js +92 -0
- package/es/src/charts/Matrix/applyLayout.js.map +1 -0
- package/es/src/charts/Matrix/emit.js +44 -0
- package/es/src/charts/Matrix/emit.js.map +1 -0
- package/es/src/charts/Matrix/index.js +154 -0
- package/es/src/charts/Matrix/index.js.map +1 -0
- package/es/src/charts/Network/applyLayout.js +322 -0
- package/es/src/charts/Network/applyLayout.js.map +1 -0
- package/es/src/charts/Network/emit.js +273 -0
- package/es/src/charts/Network/emit.js.map +1 -0
- package/es/src/charts/Network/index.js +422 -0
- package/es/src/charts/Network/index.js.map +1 -0
- package/es/src/charts/Pack/applyLayout.js +46 -0
- package/es/src/charts/Pack/applyLayout.js.map +1 -0
- package/es/src/charts/Pack/emit.js +116 -0
- package/es/src/charts/Pack/emit.js.map +1 -0
- package/es/src/charts/Pack/index.js +194 -0
- package/es/src/charts/Pack/index.js.map +1 -0
- package/es/src/charts/Pack/recursionCircles.js +18 -0
- package/es/src/charts/Pack/recursionCircles.js.map +1 -0
- package/es/src/charts/Pie/applyLayout.js +44 -0
- package/es/src/charts/Pie/applyLayout.js.map +1 -0
- package/es/src/charts/Pie/emit.js +111 -0
- package/es/src/charts/Pie/emit.js.map +1 -0
- package/es/src/charts/Pie/index.js +134 -0
- package/es/src/charts/Pie/index.js.map +1 -0
- package/es/src/charts/Plot/draw.js +424 -0
- package/es/src/charts/Plot/draw.js.map +1 -0
- package/es/src/charts/Plot/index.js +827 -0
- package/es/src/charts/Plot/index.js.map +1 -0
- package/es/src/charts/Plot/labelPlacement.js +36 -0
- package/es/src/charts/Plot/labelPlacement.js.map +1 -0
- package/es/src/charts/Plot/pipeline.js +594 -0
- package/es/src/charts/Plot/pipeline.js.map +1 -0
- package/es/src/charts/Plot/pipelineDomains.js +254 -0
- package/es/src/charts/Plot/pipelineDomains.js.map +1 -0
- package/es/src/charts/Plot/pipelineLineLabels.js +210 -0
- package/es/src/charts/Plot/pipelineLineLabels.js.map +1 -0
- package/es/src/charts/Plot/shapeDefaults.js +189 -0
- package/es/src/charts/Plot/shapeDefaults.js.map +1 -0
- package/es/src/charts/Plot/stackHelpers.js +52 -0
- package/es/src/charts/Plot/stackHelpers.js.map +1 -0
- package/es/src/charts/Priestley/applyLayout.js +121 -0
- package/es/src/charts/Priestley/applyLayout.js.map +1 -0
- package/es/src/charts/Priestley/emit.js +129 -0
- package/es/src/charts/Priestley/emit.js.map +1 -0
- package/es/src/charts/Priestley/index.js +97 -0
- package/es/src/charts/Priestley/index.js.map +1 -0
- package/es/src/charts/Radar/applyLayout.js +326 -0
- package/es/src/charts/Radar/applyLayout.js.map +1 -0
- package/es/src/charts/Radar/emit.js +28 -0
- package/es/src/charts/Radar/emit.js.map +1 -0
- package/es/src/charts/Radar/index.js +98 -0
- package/es/src/charts/Radar/index.js.map +1 -0
- package/es/src/charts/RadialMatrix/applyLayout.js +132 -0
- package/es/src/charts/RadialMatrix/applyLayout.js.map +1 -0
- package/es/src/charts/RadialMatrix/emit.js +33 -0
- package/es/src/charts/RadialMatrix/emit.js.map +1 -0
- package/es/src/charts/RadialMatrix/index.js +144 -0
- package/es/src/charts/RadialMatrix/index.js.map +1 -0
- package/es/src/charts/Rings/applyLayout.js +508 -0
- package/es/src/charts/Rings/applyLayout.js.map +1 -0
- package/es/src/charts/Rings/emit.js +222 -0
- package/es/src/charts/Rings/emit.js.map +1 -0
- package/es/src/charts/Rings/index.js +245 -0
- package/es/src/charts/Rings/index.js.map +1 -0
- package/es/src/charts/Sankey/applyLayout.js +107 -0
- package/es/src/charts/Sankey/applyLayout.js.map +1 -0
- package/es/src/charts/Sankey/emit.js +134 -0
- package/es/src/charts/Sankey/emit.js.map +1 -0
- package/es/src/charts/Sankey/index.js +219 -0
- package/es/src/charts/Sankey/index.js.map +1 -0
- package/es/src/charts/StackedArea/index.js +27 -0
- package/es/src/charts/StackedArea/index.js.map +1 -0
- package/es/src/charts/Tree/applyLayout.js +233 -0
- package/es/src/charts/Tree/applyLayout.js.map +1 -0
- package/es/src/charts/Tree/emit.js +257 -0
- package/es/src/charts/Tree/emit.js.map +1 -0
- package/es/src/charts/Tree/index.js +105 -0
- package/es/src/charts/Tree/index.js.map +1 -0
- package/es/src/charts/Treemap/applyLayout.js +85 -0
- package/es/src/charts/Treemap/applyLayout.js.map +1 -0
- package/es/src/charts/Treemap/emit.js +141 -0
- package/es/src/charts/Treemap/emit.js.map +1 -0
- package/es/src/charts/Treemap/index.js +177 -0
- package/es/src/charts/Treemap/index.js.map +1 -0
- package/es/src/charts/Treemap/thresholdFunction.js +112 -0
- package/es/src/charts/Treemap/thresholdFunction.js.map +1 -0
- package/es/src/charts/definition/ChartDefinition.js +12 -0
- package/es/src/charts/definition/ChartDefinition.js.map +1 -0
- package/es/src/charts/definition/applyDefinition.js +107 -0
- package/es/src/charts/definition/applyDefinition.js.map +1 -0
- package/es/src/charts/definition/makeChart.js +153 -0
- package/es/src/charts/definition/makeChart.js.map +1 -0
- package/es/src/charts/drawSteps/zoomControls.js +231 -96
- package/es/src/charts/drawSteps/zoomControls.js.map +1 -1
- package/es/src/charts/events/click.legend.js +2 -2
- package/es/src/charts/events/click.legend.js.map +1 -1
- package/es/src/charts/events/click.shape.js +5 -5
- package/es/src/charts/events/click.shape.js.map +1 -1
- package/es/src/charts/events/mouseenter.js +20 -1
- package/es/src/charts/events/mouseenter.js.map +1 -1
- package/es/src/charts/events/mouseleave.js +19 -4
- package/es/src/charts/events/mouseleave.js.map +1 -1
- package/es/src/charts/events/mousemove.legend.js +10 -10
- package/es/src/charts/events/mousemove.legend.js.map +1 -1
- package/es/src/charts/events/mousemove.shape.js +14 -8
- package/es/src/charts/events/mousemove.shape.js.map +1 -1
- package/es/src/charts/events/touchstart.body.js.map +1 -1
- package/es/src/charts/features/axes.js +432 -0
- package/es/src/charts/features/axes.js.map +1 -0
- package/es/src/charts/features/chartGeometry.js +66 -0
- package/es/src/charts/features/chartGeometry.js.map +1 -0
- package/es/src/charts/features/colorScaleBucket.js +92 -0
- package/es/src/charts/features/colorScaleBucket.js.map +1 -0
- package/es/src/charts/features/emitHelpers.js +217 -0
- package/es/src/charts/features/emitHelpers.js.map +1 -0
- package/es/src/charts/features/ensureZoomDom.js +71 -0
- package/es/src/charts/features/ensureZoomDom.js.map +1 -0
- package/es/src/charts/features/features.js +650 -0
- package/es/src/charts/features/features.js.map +1 -0
- package/es/src/charts/features/featuresLegend.js +180 -0
- package/es/src/charts/features/featuresLegend.js.map +1 -0
- package/es/src/charts/features/legendLabel.js +12 -0
- package/es/src/charts/features/legendLabel.js.map +1 -0
- package/es/src/charts/features/lineLabels.js +154 -0
- package/es/src/charts/features/lineLabels.js.map +1 -0
- package/es/src/charts/features/plotPaint.js +512 -0
- package/es/src/charts/features/plotPaint.js.map +1 -0
- package/es/src/charts/features/shapeEmit.js +273 -0
- package/es/src/charts/features/shapeEmit.js.map +1 -0
- package/es/src/charts/helpers/matrixData.js +3 -3
- package/es/src/charts/helpers/matrixData.js.map +1 -1
- package/es/src/charts/index.js +21 -21
- package/es/src/charts/index.js.map +1 -1
- package/es/src/charts/pipeline/resolveSpec.js +44 -0
- package/es/src/charts/pipeline/resolveSpec.js.map +1 -0
- package/es/src/charts/pipeline/runChartDraw.js +109 -0
- package/es/src/charts/pipeline/runChartDraw.js.map +1 -0
- package/es/src/charts/pipeline/runVizPipeline.js +84 -0
- package/es/src/charts/pipeline/runVizPipeline.js.map +1 -0
- package/es/src/charts/pipeline/stages.js +103 -0
- package/es/src/charts/pipeline/stages.js.map +1 -0
- package/es/src/charts/pipeline/vizContext.js +29 -0
- package/es/src/charts/pipeline/vizContext.js.map +1 -0
- package/es/src/charts/pipeline/vizDraw.js +37 -0
- package/es/src/charts/pipeline/vizDraw.js.map +1 -0
- package/es/src/charts/pipeline/vizDrawPure.js +174 -0
- package/es/src/charts/pipeline/vizDrawPure.js.map +1 -0
- package/es/src/charts/pipeline/vizPreDraw.js +145 -0
- package/es/src/charts/pipeline/vizPreDraw.js.map +1 -0
- package/es/src/charts/pipeline/vizPreDrawPure.js +279 -0
- package/es/src/charts/pipeline/vizPreDrawPure.js.map +1 -0
- package/es/src/charts/plotBuffers/Bar.js +4 -4
- package/es/src/charts/plotBuffers/Bar.js.map +1 -1
- package/es/src/charts/plotBuffers/Box.js +4 -4
- package/es/src/charts/plotBuffers/Box.js.map +1 -1
- package/es/src/charts/plotBuffers/Circle.js +2 -2
- package/es/src/charts/plotBuffers/Circle.js.map +1 -1
- package/es/src/charts/plotBuffers/Line.js +5 -5
- package/es/src/charts/plotBuffers/Line.js.map +1 -1
- package/es/src/charts/plotBuffers/Rect.js +2 -2
- package/es/src/charts/plotBuffers/Rect.js.map +1 -1
- package/es/src/charts/plotBuffers/discreteBuffer.js +1 -2
- package/es/src/charts/plotBuffers/discreteBuffer.js.map +1 -1
- package/es/src/charts/plotBuffers/numericBuffer.js +1 -2
- package/es/src/charts/plotBuffers/numericBuffer.js.map +1 -1
- package/es/src/charts/viz/Viz.js +985 -0
- package/es/src/charts/viz/Viz.js.map +1 -0
- package/es/src/charts/viz/VizBase.js +447 -0
- package/es/src/charts/viz/VizBase.js.map +1 -0
- package/es/src/charts/viz/VizBaseConfig.js +504 -0
- package/es/src/charts/viz/VizBaseConfig.js.map +1 -0
- package/es/src/charts/viz/interactionOpacity.js +247 -0
- package/es/src/charts/viz/interactionOpacity.js.map +1 -0
- package/es/src/charts/viz/ordinalColor.js +71 -0
- package/es/src/charts/viz/ordinalColor.js.map +1 -0
- package/es/src/charts/viz/trailCatchup.js +127 -0
- package/es/src/charts/viz/trailCatchup.js.map +1 -0
- package/es/src/charts/viz/vizDefaults.js +602 -0
- package/es/src/charts/viz/vizDefaults.js.map +1 -0
- package/es/src/charts/viz/vizRender.js +251 -0
- package/es/src/charts/viz/vizRender.js.map +1 -0
- package/es/src/charts/viz/vizTypes.js +28 -0
- package/es/src/charts/viz/vizTypes.js.map +1 -0
- package/es/src/components/Axis/Axis.js +691 -0
- package/es/src/components/Axis/Axis.js.map +1 -0
- package/es/src/components/Axis/AxisBottom.js.map +1 -0
- package/es/src/components/Axis/AxisLeft.js.map +1 -0
- package/es/src/components/Axis/AxisRight.js.map +1 -0
- package/es/src/components/Axis/AxisTop.js.map +1 -0
- package/es/src/components/Axis/axisLayout.js +208 -0
- package/es/src/components/Axis/axisLayout.js.map +1 -0
- package/es/src/components/Axis/axisLayoutLabels.js +177 -0
- package/es/src/components/Axis/axisLayoutLabels.js.map +1 -0
- package/es/src/components/Axis/axisLayoutScale.js +374 -0
- package/es/src/components/Axis/axisLayoutScale.js.map +1 -0
- package/es/src/components/Axis/axisRender.js +535 -0
- package/es/src/components/Axis/axisRender.js.map +1 -0
- package/es/src/components/ColorScale/ColorScale.js +506 -0
- package/es/src/components/ColorScale/ColorScale.js.map +1 -0
- package/es/src/components/ColorScale/colorScaleRender.js +277 -0
- package/es/src/components/ColorScale/colorScaleRender.js.map +1 -0
- package/es/src/components/ColorScale/colorScaleScale.js +274 -0
- package/es/src/components/ColorScale/colorScaleScale.js.map +1 -0
- package/es/src/components/Legend/Legend.js +445 -0
- package/es/src/components/Legend/Legend.js.map +1 -0
- package/es/src/components/Legend/legendConfig.js +87 -0
- package/es/src/components/Legend/legendConfig.js.map +1 -0
- package/es/src/components/Legend/legendRender.js +245 -0
- package/es/src/components/Legend/legendRender.js.map +1 -0
- package/es/src/components/Message.js.map +1 -1
- package/es/src/components/TextBox.js +639 -453
- package/es/src/components/TextBox.js.map +1 -1
- package/es/src/components/Timeline/Timeline.js +674 -0
- package/es/src/components/Timeline/Timeline.js.map +1 -0
- package/es/src/components/Timeline/timelineConfig.js +115 -0
- package/es/src/components/Timeline/timelineConfig.js.map +1 -0
- package/es/src/components/Timeline/timelineRender.js +267 -0
- package/es/src/components/Timeline/timelineRender.js.map +1 -0
- package/es/src/components/Tooltip.js +288 -249
- package/es/src/components/Tooltip.js.map +1 -1
- package/es/src/components/index.js +8 -8
- package/es/src/components/index.js.map +1 -1
- package/es/src/fluent.js +265 -0
- package/es/src/fluent.js.map +1 -0
- package/es/src/shapes/Area.js +96 -114
- package/es/src/shapes/Area.js.map +1 -1
- package/es/src/shapes/Bar.js +71 -86
- package/es/src/shapes/Bar.js.map +1 -1
- package/es/src/shapes/Box.js +295 -190
- package/es/src/shapes/Box.js.map +1 -1
- package/es/src/shapes/Circle.js +72 -31
- package/es/src/shapes/Circle.js.map +1 -1
- package/es/src/shapes/Image.js +164 -85
- package/es/src/shapes/Image.js.map +1 -1
- package/es/src/shapes/Line.js +51 -94
- package/es/src/shapes/Line.js.map +1 -1
- package/es/src/shapes/Path.js +33 -41
- package/es/src/shapes/Path.js.map +1 -1
- package/es/src/shapes/Rect.js +86 -37
- package/es/src/shapes/Rect.js.map +1 -1
- package/es/src/shapes/Shape.js +655 -678
- package/es/src/shapes/Shape.js.map +1 -1
- package/es/src/shapes/Whisker.js +156 -61
- package/es/src/shapes/Whisker.js.map +1 -1
- package/es/src/shapes/buildLabelData.js +70 -0
- package/es/src/shapes/buildLabelData.js.map +1 -0
- package/es/src/shapes/emitLabels.js +84 -0
- package/es/src/shapes/emitLabels.js.map +1 -0
- package/es/src/shapes/hitAreaNode.js +37 -0
- package/es/src/shapes/hitAreaNode.js.map +1 -0
- package/es/src/shapes/sceneSort.js +57 -0
- package/es/src/shapes/sceneSort.js.map +1 -0
- package/es/src/shapes/shapeConfig.js +31 -0
- package/es/src/shapes/shapeConfig.js.map +1 -0
- package/es/src/utils/BaseClass.js +35 -19
- package/es/src/utils/BaseClass.js.map +1 -1
- package/es/src/utils/D3Scale.js +16 -0
- package/es/src/utils/D3Scale.js.map +1 -0
- package/es/src/utils/D3plusConfig.js.map +1 -1
- package/es/src/utils/configPrep.js +8 -3
- package/es/src/utils/configPrep.js.map +1 -1
- package/es/src/utils/getProp.js +1 -1
- package/es/src/utils/getProp.js.map +1 -1
- package/es/src/utils/index.js +1 -0
- package/es/src/utils/index.js.map +1 -1
- package/es/src/utils/paintComponentScene.js +59 -0
- package/es/src/utils/paintComponentScene.js.map +1 -0
- package/es/umd-entry.js +16 -0
- package/es/umd-entry.js.map +1 -0
- package/package.json +14 -9
- package/types/index.d.ts +3 -1
- package/types/internal.d.ts +54 -0
- package/types/src/charts/AreaPlot/index.d.ts +10 -0
- package/types/src/charts/BarChart/index.d.ts +10 -0
- package/types/src/charts/BoxWhisker/index.d.ts +11 -0
- package/types/src/charts/BumpChart/index.d.ts +11 -0
- package/types/src/charts/ChartDefinition.d.ts +75 -0
- package/types/src/charts/Donut/index.d.ts +13 -0
- package/types/src/charts/Geomap/applyLayout.d.ts +7 -0
- package/types/src/charts/Geomap/emit.d.ts +7 -0
- package/types/src/charts/Geomap/index.d.ts +14 -0
- package/types/src/charts/Geomap.d.ts +6 -0
- package/types/src/charts/LinePlot/index.d.ts +10 -0
- package/types/src/charts/Matrix/applyLayout.d.ts +9 -0
- package/types/src/charts/Matrix/emit.d.ts +6 -0
- package/types/src/charts/Matrix/index.d.ts +14 -0
- package/types/src/charts/Matrix.d.ts +0 -26
- package/types/src/charts/Network/applyLayout.d.ts +10 -0
- package/types/src/charts/Network/emit.d.ts +6 -0
- package/types/src/charts/Network/index.d.ts +7 -0
- package/types/src/charts/Network.d.ts +0 -24
- package/types/src/charts/Pack/applyLayout.d.ts +16 -0
- package/types/src/charts/Pack/emit.d.ts +6 -0
- package/types/src/charts/Pack/index.d.ts +15 -0
- package/types/src/charts/Pack/recursionCircles.d.ts +7 -0
- package/types/src/charts/Pack.d.ts +0 -13
- package/types/src/charts/Pie/applyLayout.d.ts +8 -0
- package/types/src/charts/Pie/emit.d.ts +5 -0
- package/types/src/charts/Pie/index.d.ts +14 -0
- package/types/src/charts/Pie.d.ts +0 -27
- package/types/src/charts/Plot/draw.d.ts +2 -0
- package/types/src/charts/Plot/index.d.ts +167 -0
- package/types/src/charts/Plot/labelPlacement.d.ts +15 -0
- package/types/src/charts/Plot/pipeline.d.ts +70 -0
- package/types/src/charts/Plot/pipelineDomains.d.ts +2 -0
- package/types/src/charts/Plot/pipelineLineLabels.d.ts +2 -0
- package/types/src/charts/Plot/shapeDefaults.d.ts +64 -0
- package/types/src/charts/Plot/stackHelpers.d.ts +24 -0
- package/types/src/charts/Plot.d.ts +23 -72
- package/types/src/charts/Priestley/applyLayout.d.ts +21 -0
- package/types/src/charts/Priestley/emit.d.ts +6 -0
- package/types/src/charts/Priestley/index.d.ts +14 -0
- package/types/src/charts/Radar/applyLayout.d.ts +10 -0
- package/types/src/charts/Radar/emit.d.ts +7 -0
- package/types/src/charts/Radar/index.d.ts +14 -0
- package/types/src/charts/RadialMatrix/applyLayout.d.ts +11 -0
- package/types/src/charts/RadialMatrix/emit.d.ts +6 -0
- package/types/src/charts/RadialMatrix/index.d.ts +14 -0
- package/types/src/charts/RadialMatrix.d.ts +0 -15
- package/types/src/charts/Rings/applyLayout.d.ts +2 -0
- package/types/src/charts/Rings/emit.d.ts +7 -0
- package/types/src/charts/Rings/index.d.ts +15 -0
- package/types/src/charts/Rings.d.ts +0 -13
- package/types/src/charts/Sankey/applyLayout.d.ts +7 -0
- package/types/src/charts/Sankey/emit.d.ts +6 -0
- package/types/src/charts/Sankey/index.d.ts +7 -0
- package/types/src/charts/Sankey.d.ts +0 -4
- package/types/src/charts/StackedArea/index.d.ts +10 -0
- package/types/src/charts/Tree/applyLayout.d.ts +2 -0
- package/types/src/charts/Tree/emit.d.ts +7 -0
- package/types/src/charts/Tree/index.d.ts +14 -0
- package/types/src/charts/Tree.d.ts +0 -16
- package/types/src/charts/Treemap/applyLayout.d.ts +16 -0
- package/types/src/charts/Treemap/emit.d.ts +6 -0
- package/types/src/charts/Treemap/index.d.ts +18 -0
- package/types/src/charts/Treemap/thresholdFunction.d.ts +25 -0
- package/types/src/charts/Treemap.d.ts +4 -13
- package/types/src/charts/Viz.d.ts +49 -361
- package/types/src/charts/VizBase.d.ts +158 -0
- package/types/src/charts/VizBaseConfig.d.ts +148 -0
- package/types/src/charts/applyDefinition.d.ts +13 -0
- package/types/src/charts/axes.d.ts +134 -0
- package/types/src/charts/chartGeometry.d.ts +58 -0
- package/types/src/charts/definition/ChartDefinition.d.ts +84 -0
- package/types/src/charts/definition/applyDefinition.d.ts +13 -0
- package/types/src/charts/definition/makeChart.d.ts +22 -0
- package/types/src/charts/drawSteps/zoomControls.d.ts +25 -5
- package/types/src/charts/emitHelpers.d.ts +122 -0
- package/types/src/charts/ensureZoomDom.d.ts +39 -0
- package/types/src/charts/events/click.legend.d.ts +1 -1
- package/types/src/charts/events/click.shape.d.ts +1 -1
- package/types/src/charts/events/mouseenter.d.ts +1 -1
- package/types/src/charts/events/mouseleave.d.ts +1 -1
- package/types/src/charts/events/mousemove.legend.d.ts +1 -1
- package/types/src/charts/events/mousemove.shape.d.ts +1 -1
- package/types/src/charts/events/touchstart.body.d.ts +1 -1
- package/types/src/charts/factories.d.ts +73 -0
- package/types/src/charts/features/axes.d.ts +134 -0
- package/types/src/charts/features/chartGeometry.d.ts +58 -0
- package/types/src/charts/features/colorScaleBucket.d.ts +43 -0
- package/types/src/charts/features/colorScaleBucketShare.d.ts +16 -0
- package/types/src/charts/features/emitHelpers.d.ts +123 -0
- package/types/src/charts/features/ensureZoomDom.d.ts +39 -0
- package/types/src/charts/features/features.d.ts +152 -0
- package/types/src/charts/features/featuresLegend.d.ts +12 -0
- package/types/src/charts/features/legendLabel.d.ts +11 -0
- package/types/src/charts/features/lineLabels.d.ts +40 -0
- package/types/src/charts/features/plotPaint.d.ts +233 -0
- package/types/src/charts/features/shapeEmit.d.ts +61 -0
- package/types/src/charts/features.d.ts +152 -0
- package/types/src/charts/featuresLegend.d.ts +12 -0
- package/types/src/charts/helpers/matrixData.d.ts +1 -1
- package/types/src/charts/index.d.ts +21 -21
- package/types/src/charts/legendLabel.d.ts +11 -0
- package/types/src/charts/lineLabels.d.ts +40 -0
- package/types/src/charts/makeChart.d.ts +22 -0
- package/types/src/charts/pipeline/resolveSpec.d.ts +51 -0
- package/types/src/charts/pipeline/runChartDraw.d.ts +38 -0
- package/types/src/charts/pipeline/runVizPipeline.d.ts +31 -0
- package/types/src/charts/pipeline/stages.d.ts +160 -0
- package/types/src/charts/pipeline/vizContext.d.ts +45 -0
- package/types/src/charts/pipeline/vizDraw.d.ts +25 -0
- package/types/src/charts/pipeline/vizDrawPure.d.ts +46 -0
- package/types/src/charts/pipeline/vizPreDraw.d.ts +22 -0
- package/types/src/charts/pipeline/vizPreDrawPure.d.ts +68 -0
- package/types/src/charts/plotBuffers/Bar.d.ts +6 -5
- package/types/src/charts/plotBuffers/Box.d.ts +6 -5
- package/types/src/charts/plotBuffers/Circle.d.ts +6 -5
- package/types/src/charts/plotBuffers/Line.d.ts +6 -5
- package/types/src/charts/plotBuffers/Rect.d.ts +6 -5
- package/types/src/charts/plotBuffers/discreteBuffer.d.ts +2 -1
- package/types/src/charts/plotBuffers/numericBuffer.d.ts +2 -1
- package/types/src/charts/plotPaint.d.ts +233 -0
- package/types/src/charts/resolveSpec.d.ts +50 -0
- package/types/src/charts/runChartDraw.d.ts +38 -0
- package/types/src/charts/runVizPipeline.d.ts +31 -0
- package/types/src/charts/shapeEmit.d.ts +61 -0
- package/types/src/charts/stages.d.ts +117 -0
- package/types/src/charts/viz/Viz.d.ts +111 -0
- package/types/src/charts/viz/VizBase.d.ts +160 -0
- package/types/src/charts/viz/VizBaseConfig.d.ts +156 -0
- package/types/src/charts/viz/interactionOpacity.d.ts +23 -0
- package/types/src/charts/viz/ordinalColor.d.ts +14 -0
- package/types/src/charts/viz/trailCatchup.d.ts +14 -0
- package/types/src/charts/viz/vizDefaults.d.ts +8 -0
- package/types/src/charts/viz/vizRender.d.ts +8 -0
- package/types/src/charts/viz/vizTypes.d.ts +250 -0
- package/types/src/charts/vizContext.d.ts +46 -0
- package/types/src/charts/vizDefaults.d.ts +8 -0
- package/types/src/charts/vizDraw.d.ts +25 -0
- package/types/src/charts/vizDrawPure.d.ts +17 -0
- package/types/src/charts/vizPreDraw.d.ts +22 -0
- package/types/src/charts/vizPreDrawPure.d.ts +40 -0
- package/types/src/charts/vizRender.d.ts +8 -0
- package/types/src/charts/vizTypes.d.ts +202 -0
- package/types/src/components/Axis/Axis.d.ts +182 -0
- package/types/src/components/Axis/AxisBottom.d.ts +11 -0
- package/types/src/components/Axis/AxisLeft.d.ts +11 -0
- package/types/src/components/Axis/AxisRight.d.ts +11 -0
- package/types/src/components/Axis/AxisTop.d.ts +11 -0
- package/types/src/components/Axis/axisLayout.d.ts +29 -0
- package/types/src/components/Axis/axisLayoutLabels.d.ts +70 -0
- package/types/src/components/Axis/axisLayoutScale.d.ts +14 -0
- package/types/src/components/Axis/axisRender.d.ts +68 -0
- package/types/src/components/Axis.d.ts +68 -194
- package/types/src/components/ColorScale/ColorScale.d.ts +100 -0
- package/types/src/components/ColorScale/colorScaleRender.d.ts +15 -0
- package/types/src/components/ColorScale/colorScaleScale.d.ts +19 -0
- package/types/src/components/ColorScale.d.ts +1 -129
- package/types/src/components/Legend/Legend.d.ts +95 -0
- package/types/src/components/Legend/legendConfig.d.ts +7 -0
- package/types/src/components/Legend/legendRender.d.ts +16 -0
- package/types/src/components/Legend.d.ts +9 -73
- package/types/src/components/TextBox.d.ts +25 -218
- package/types/src/components/Timeline/Timeline.d.ts +118 -0
- package/types/src/components/Timeline/timelineConfig.d.ts +6 -0
- package/types/src/components/Timeline/timelineRender.d.ts +24 -0
- package/types/src/components/Timeline.d.ts +7 -81
- package/types/src/components/Tooltip.d.ts +20 -200
- package/types/src/components/axisLayout.d.ts +27 -0
- package/types/src/components/axisLayoutLabels.d.ts +42 -0
- package/types/src/components/axisLayoutScale.d.ts +12 -0
- package/types/src/components/axisRender.d.ts +65 -0
- package/types/src/components/colorScaleRender.d.ts +15 -0
- package/types/src/components/colorScaleScale.d.ts +19 -0
- package/types/src/components/index.d.ts +8 -8
- package/types/src/components/legendConfig.d.ts +7 -0
- package/types/src/components/legendRender.d.ts +16 -0
- package/types/src/components/timelineConfig.d.ts +6 -0
- package/types/src/components/timelineRender.d.ts +14 -0
- package/types/src/fluent.d.ts +94 -0
- package/types/src/shapes/Area.d.ts +15 -27
- package/types/src/shapes/Bar.d.ts +13 -33
- package/types/src/shapes/Box.d.ts +17 -56
- package/types/src/shapes/Circle.d.ts +11 -17
- package/types/src/shapes/Image.d.ts +18 -84
- package/types/src/shapes/Line.d.ts +12 -22
- package/types/src/shapes/Path.d.ts +12 -19
- package/types/src/shapes/Rect.d.ts +11 -27
- package/types/src/shapes/Shape.d.ts +46 -257
- package/types/src/shapes/Whisker.d.ts +15 -42
- package/types/src/shapes/buildLabelData.d.ts +50 -0
- package/types/src/shapes/emitLabels.d.ts +16 -0
- package/types/src/shapes/hitAreaNode.d.ts +19 -0
- package/types/src/shapes/sceneSort.d.ts +20 -0
- package/types/src/shapes/shapeConfig.d.ts +226 -0
- package/types/src/utils/BaseClass.d.ts +13 -7
- package/types/src/utils/D3Scale.d.ts +48 -0
- package/types/src/utils/D3plusConfig.d.ts +230 -3
- package/types/src/utils/configPrep.d.ts +7 -4
- package/types/src/utils/getProp.d.ts +3 -1
- package/types/src/utils/index.d.ts +3 -1
- package/types/src/utils/paintComponentScene.d.ts +28 -0
- package/types/umd-entry.d.ts +15 -0
- package/umd/d3plus-core.full.js +31148 -19484
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +5309 -2944
- package/umd/d3plus-core.js +17379 -10578
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +3470 -1876
- package/es/src/charts/AreaPlot.js +0 -85
- package/es/src/charts/AreaPlot.js.map +0 -1
- package/es/src/charts/BarChart.js +0 -92
- package/es/src/charts/BarChart.js.map +0 -1
- package/es/src/charts/BoxWhisker.js +0 -92
- package/es/src/charts/BoxWhisker.js.map +0 -1
- package/es/src/charts/BumpChart.js +0 -147
- package/es/src/charts/BumpChart.js.map +0 -1
- package/es/src/charts/Donut.js +0 -84
- package/es/src/charts/Donut.js.map +0 -1
- package/es/src/charts/Geomap.js +0 -766
- package/es/src/charts/Geomap.js.map +0 -1
- package/es/src/charts/LinePlot.js +0 -83
- package/es/src/charts/LinePlot.js.map +0 -1
- package/es/src/charts/Matrix.js +0 -341
- package/es/src/charts/Matrix.js.map +0 -1
- package/es/src/charts/Network.js +0 -796
- package/es/src/charts/Network.js.map +0 -1
- package/es/src/charts/Pack.js +0 -308
- package/es/src/charts/Pack.js.map +0 -1
- package/es/src/charts/Pie.js +0 -232
- package/es/src/charts/Pie.js.map +0 -1
- package/es/src/charts/Plot.js +0 -2114
- package/es/src/charts/Plot.js.map +0 -1
- package/es/src/charts/Priestley.js +0 -296
- package/es/src/charts/Priestley.js.map +0 -1
- package/es/src/charts/Radar.js +0 -420
- package/es/src/charts/Radar.js.map +0 -1
- package/es/src/charts/RadialMatrix.js +0 -383
- package/es/src/charts/RadialMatrix.js.map +0 -1
- package/es/src/charts/Rings.js +0 -788
- package/es/src/charts/Rings.js.map +0 -1
- package/es/src/charts/Sankey.js +0 -461
- package/es/src/charts/Sankey.js.map +0 -1
- package/es/src/charts/StackedArea.js +0 -80
- package/es/src/charts/StackedArea.js.map +0 -1
- package/es/src/charts/Tree.js +0 -347
- package/es/src/charts/Tree.js.map +0 -1
- package/es/src/charts/Treemap.js +0 -454
- package/es/src/charts/Treemap.js.map +0 -1
- package/es/src/charts/Viz.js +0 -1832
- package/es/src/charts/Viz.js.map +0 -1
- package/es/src/charts/drawSteps/drawAttribution.js +0 -16
- package/es/src/charts/drawSteps/drawAttribution.js.map +0 -1
- package/es/src/charts/drawSteps/drawBack.js +0 -24
- package/es/src/charts/drawSteps/drawBack.js.map +0 -1
- package/es/src/charts/drawSteps/drawColorScale.js +0 -75
- package/es/src/charts/drawSteps/drawColorScale.js.map +0 -1
- package/es/src/charts/drawSteps/drawLegend.js +0 -122
- package/es/src/charts/drawSteps/drawLegend.js.map +0 -1
- package/es/src/charts/drawSteps/drawSubtitle.js +0 -31
- package/es/src/charts/drawSteps/drawSubtitle.js.map +0 -1
- package/es/src/charts/drawSteps/drawTimeline.js +0 -85
- package/es/src/charts/drawSteps/drawTimeline.js.map +0 -1
- package/es/src/charts/drawSteps/drawTitle.js +0 -31
- package/es/src/charts/drawSteps/drawTitle.js.map +0 -1
- package/es/src/charts/drawSteps/drawTotal.js +0 -32
- package/es/src/charts/drawSteps/drawTotal.js.map +0 -1
- package/es/src/components/Axis.js +0 -1457
- package/es/src/components/Axis.js.map +0 -1
- package/es/src/components/AxisBottom.js.map +0 -1
- package/es/src/components/AxisLeft.js.map +0 -1
- package/es/src/components/AxisRight.js.map +0 -1
- package/es/src/components/AxisTop.js.map +0 -1
- package/es/src/components/ColorScale.js +0 -843
- package/es/src/components/ColorScale.js.map +0 -1
- package/es/src/components/Legend.js +0 -622
- package/es/src/components/Legend.js.map +0 -1
- package/es/src/components/Timeline.js +0 -695
- package/es/src/components/Timeline.js.map +0 -1
- /package/es/src/components/{AxisBottom.js → Axis/AxisBottom.js} +0 -0
- /package/es/src/components/{AxisLeft.js → Axis/AxisLeft.js} +0 -0
- /package/es/src/components/{AxisRight.js → Axis/AxisRight.js} +0 -0
- /package/es/src/components/{AxisTop.js → Axis/AxisTop.js} +0 -0
|
@@ -0,0 +1,985 @@
|
|
|
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
|
+
import { select } from "d3-selection";
|
|
321
|
+
import { date, getSize } from "@d3plus/dom";
|
|
322
|
+
import { computeTrailCatchup } from "./trailCatchup.js";
|
|
323
|
+
import { CanvasRenderer, SvgRenderer } from "@d3plus/render";
|
|
324
|
+
import VizBase from "./VizBase.js";
|
|
325
|
+
import { applyColorScaleBucketOpacity, applyInteractionOpacity } from "./interactionOpacity.js";
|
|
326
|
+
import { initVizDefaults } from "./vizDefaults.js";
|
|
327
|
+
import { vizRender } from "./vizRender.js";
|
|
328
|
+
import { vizDraw } from "../pipeline/vizDraw.js";
|
|
329
|
+
import { vizPreDraw } from "../pipeline/vizPreDraw.js";
|
|
330
|
+
/**
|
|
331
|
+
Stamps `interactionGroup` onto a component's scene subtree so the pointer
|
|
332
|
+
bridge can route its nodes to component-scoped handlers (e.g. legend) on
|
|
333
|
+
every backend — including Canvas, where there is no per-shape DOM to walk.
|
|
334
|
+
*/ function tagInteractionGroup(node, group) {
|
|
335
|
+
node.interactionGroup = group;
|
|
336
|
+
var kids = node.children;
|
|
337
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
338
|
+
if (kids) try {
|
|
339
|
+
for(var _iterator = kids[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
340
|
+
var child = _step.value;
|
|
341
|
+
tagInteractionGroup(child, group);
|
|
342
|
+
}
|
|
343
|
+
} catch (err) {
|
|
344
|
+
_didIteratorError = true;
|
|
345
|
+
_iteratorError = err;
|
|
346
|
+
} finally{
|
|
347
|
+
try {
|
|
348
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
349
|
+
_iterator.return();
|
|
350
|
+
}
|
|
351
|
+
} finally{
|
|
352
|
+
if (_didIteratorError) {
|
|
353
|
+
throw _iteratorError;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
Resolves the element a renderer mounts into. A `<canvas>` cannot paint inside
|
|
360
|
+
an `<svg>`, so when the scene target is the compute svg, the canvas mounts
|
|
361
|
+
into that svg's parent (the user's element); the emptied, position:absolute
|
|
362
|
+
compute svg overlays the same top-left box. SVG mounts into the target as-is.
|
|
363
|
+
*/ function mountTargetFor(kind, target) {
|
|
364
|
+
var _target_parentNode;
|
|
365
|
+
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;
|
|
366
|
+
return target;
|
|
367
|
+
}
|
|
368
|
+
var Viz = /*#__PURE__*/ function(VizBase) {
|
|
369
|
+
"use strict";
|
|
370
|
+
_inherits(Viz, VizBase);
|
|
371
|
+
function Viz() {
|
|
372
|
+
_class_call_check(this, Viz);
|
|
373
|
+
var _this;
|
|
374
|
+
_this = _call_super(this, Viz);
|
|
375
|
+
initVizDefaults(_this);
|
|
376
|
+
return _this;
|
|
377
|
+
}
|
|
378
|
+
_create_class(Viz, [
|
|
379
|
+
{
|
|
380
|
+
/**
|
|
381
|
+
Called by draw before anything is drawn. Formats the data and performs preparations for draw.
|
|
382
|
+
@private
|
|
383
|
+
*/ key: "_preDraw",
|
|
384
|
+
value: function _preDraw() {
|
|
385
|
+
vizPreDraw(this);
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
/**
|
|
390
|
+
Composes a backend-agnostic scene graph from the shapes/features produced
|
|
391
|
+
by the most recent render. Combines:
|
|
392
|
+
- `_chartScene` (cells from `chartDef.emit`, or `Plot._paint` for the
|
|
393
|
+
paint-driven Plot family) wrapped in viz-chart-cells
|
|
394
|
+
- `_shapes` (still used by some charts) — each shape's toScene
|
|
395
|
+
- chart-level components (Legend/ColorScale/Timeline) via their toScene
|
|
396
|
+
- `_featurePanels` (from FeatureModule layouts) wrapped in viz-features
|
|
397
|
+
*/ key: "toScene",
|
|
398
|
+
value: function toScene() {
|
|
399
|
+
var children = [];
|
|
400
|
+
// Chart cells stashed on _chartScene — via `chartDef.emit(ctx)` for
|
|
401
|
+
// data-driven charts, or `Plot._paint` for the paint-driven Plot family.
|
|
402
|
+
// Wraps in two groups when a zoom transform is active:
|
|
403
|
+
// viz-chart-cells (chart-positioning transform)
|
|
404
|
+
// viz-zoom (zoom transform — pan/scale from d3-zoom)
|
|
405
|
+
// … chart scene children
|
|
406
|
+
// This lets zoom apply to the chart content WITHOUT moving legend/
|
|
407
|
+
// title/total/etc. (which live in sibling viz-* groups, not under
|
|
408
|
+
// viz-chart-cells).
|
|
409
|
+
if (this._chartScene && this._chartScene.length) {
|
|
410
|
+
var _this__zoomTransform;
|
|
411
|
+
var sliced = applyInteractionOpacity(this._chartScene, this);
|
|
412
|
+
// Always emit the viz-zoom group (identity transform when no zoom is
|
|
413
|
+
// active) so its key is stable across the first zoom. Otherwise the first
|
|
414
|
+
// zoom adds a brand-new group → the renderer treats the chart cells as
|
|
415
|
+
// exit+enter (teardown/rebuild) instead of tweening the group transform,
|
|
416
|
+
// so the zoom snaps in instead of animating.
|
|
417
|
+
var zoomNode = [
|
|
418
|
+
{
|
|
419
|
+
type: "group",
|
|
420
|
+
key: "viz-zoom",
|
|
421
|
+
transform: (_this__zoomTransform = this._zoomTransform) !== null && _this__zoomTransform !== void 0 ? _this__zoomTransform : {
|
|
422
|
+
x: 0,
|
|
423
|
+
y: 0,
|
|
424
|
+
scale: 1
|
|
425
|
+
},
|
|
426
|
+
children: sliced
|
|
427
|
+
}
|
|
428
|
+
];
|
|
429
|
+
children.push(_object_spread_props(_object_spread({
|
|
430
|
+
type: "group",
|
|
431
|
+
key: "viz-chart-cells"
|
|
432
|
+
}, this._chartTransform ? {
|
|
433
|
+
transform: this._chartTransform
|
|
434
|
+
} : {}, this._chartClip ? {
|
|
435
|
+
clip: this._chartClip
|
|
436
|
+
} : {}), {
|
|
437
|
+
children: zoomNode
|
|
438
|
+
}));
|
|
439
|
+
}
|
|
440
|
+
// `_shapes` collection (Treemap/Pack/etc. route through `_chartScene`
|
|
441
|
+
// instead, as does Plot's `absorbShapeIntoChartScene`). Any caller
|
|
442
|
+
// pushing into `_shapes` gets its `toScene()` walked here; we read the
|
|
443
|
+
// shape's `_select` transform via d3's transform baseVal if present,
|
|
444
|
+
// otherwise emit without a transform.
|
|
445
|
+
(this._shapes || []).forEach(function(shape, si) {
|
|
446
|
+
if (!shape || typeof shape.toScene !== "function") return;
|
|
447
|
+
var group = shape.toScene();
|
|
448
|
+
var transform;
|
|
449
|
+
var sel = shape._select;
|
|
450
|
+
if (sel && typeof sel.attr === "function") {
|
|
451
|
+
// Parse `translate(x, y)` from the selection's transform attr.
|
|
452
|
+
// Falls back to undefined for non-translate transforms — the
|
|
453
|
+
// `_shapes` path only uses translate.
|
|
454
|
+
var t = sel.attr("transform");
|
|
455
|
+
if (typeof t === "string") {
|
|
456
|
+
var m = t.match(/translate\(\s*(-?[\d.]+)[, ]\s*(-?[\d.]+)\s*\)/);
|
|
457
|
+
if (m) transform = {
|
|
458
|
+
x: parseFloat(m[1]),
|
|
459
|
+
y: parseFloat(m[2])
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
children.push(_object_spread_props(_object_spread({
|
|
464
|
+
type: "group",
|
|
465
|
+
key: "".concat(group.key || "shape", "-").concat(si)
|
|
466
|
+
}, transform ? {
|
|
467
|
+
transform: transform
|
|
468
|
+
} : {}), {
|
|
469
|
+
children: group.children
|
|
470
|
+
}));
|
|
471
|
+
});
|
|
472
|
+
// Chart-level components that have their own toScene.
|
|
473
|
+
var components = [
|
|
474
|
+
[
|
|
475
|
+
"legend",
|
|
476
|
+
this._legendClass
|
|
477
|
+
],
|
|
478
|
+
[
|
|
479
|
+
"colorScale",
|
|
480
|
+
this._colorScaleClass
|
|
481
|
+
],
|
|
482
|
+
[
|
|
483
|
+
"timeline",
|
|
484
|
+
this._timelineClass
|
|
485
|
+
]
|
|
486
|
+
];
|
|
487
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
488
|
+
try {
|
|
489
|
+
for(var _iterator = components[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
490
|
+
var _step_value = _sliced_to_array(_step.value, 2), name = _step_value[0], comp = _step_value[1];
|
|
491
|
+
if (comp && typeof comp.toScene === "function" && comp._select && typeof comp._select.node === "function" && comp._select.node()) {
|
|
492
|
+
var compScene = comp.toScene();
|
|
493
|
+
// Tag the legend subtree so its swatches route to legend handlers via
|
|
494
|
+
// the node stamp (renderer-independent), not just SVG DOM ancestry.
|
|
495
|
+
if (name === "legend") {
|
|
496
|
+
tagInteractionGroup(compScene, "legend");
|
|
497
|
+
// Hovering a legend swatch dims the others, like the chart marks:
|
|
498
|
+
// run the legend subtree through the same interaction-opacity pass
|
|
499
|
+
// (a no-op when no hover/active predicate is set).
|
|
500
|
+
compScene = applyInteractionOpacity([
|
|
501
|
+
compScene
|
|
502
|
+
], this)[0];
|
|
503
|
+
} else if (name === "colorScale") {
|
|
504
|
+
compScene = applyColorScaleBucketOpacity([
|
|
505
|
+
compScene
|
|
506
|
+
], this)[0];
|
|
507
|
+
} else if (name === "timeline") tagInteractionGroup(compScene, "timeline");
|
|
508
|
+
children.push({
|
|
509
|
+
type: "group",
|
|
510
|
+
key: "viz-".concat(name),
|
|
511
|
+
children: [
|
|
512
|
+
compScene
|
|
513
|
+
]
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
} catch (err) {
|
|
518
|
+
_didIteratorError = true;
|
|
519
|
+
_iteratorError = err;
|
|
520
|
+
} finally{
|
|
521
|
+
try {
|
|
522
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
523
|
+
_iterator.return();
|
|
524
|
+
}
|
|
525
|
+
} finally{
|
|
526
|
+
if (_didIteratorError) {
|
|
527
|
+
throw _iteratorError;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
// E2: FeatureModule.layout() panels (title/subtitle/total/back).
|
|
532
|
+
if (this._featurePanels && this._featurePanels.length) {
|
|
533
|
+
var panels = this._featurePanels.slice();
|
|
534
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
535
|
+
try {
|
|
536
|
+
// Tag the back-button panel so the pointer bridge can route its click.
|
|
537
|
+
for(var _iterator1 = panels[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
538
|
+
var panel = _step1.value;
|
|
539
|
+
if (panel && typeof panel.key === "string" && panel.key.toLowerCase().includes("back")) tagInteractionGroup(panel, "back");
|
|
540
|
+
}
|
|
541
|
+
} catch (err) {
|
|
542
|
+
_didIteratorError1 = true;
|
|
543
|
+
_iteratorError1 = err;
|
|
544
|
+
} finally{
|
|
545
|
+
try {
|
|
546
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
547
|
+
_iterator1.return();
|
|
548
|
+
}
|
|
549
|
+
} finally{
|
|
550
|
+
if (_didIteratorError1) {
|
|
551
|
+
throw _iteratorError1;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
children.push({
|
|
556
|
+
type: "group",
|
|
557
|
+
key: "viz-features",
|
|
558
|
+
children: panels
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
return {
|
|
562
|
+
width: this.schema.width,
|
|
563
|
+
height: this.schema.height,
|
|
564
|
+
root: {
|
|
565
|
+
type: "group",
|
|
566
|
+
key: "viz-root",
|
|
567
|
+
children: children
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
/**
|
|
574
|
+
Called by render once all checks are passed.
|
|
575
|
+
@private
|
|
576
|
+
*/ key: "_draw",
|
|
577
|
+
value: function _draw() {
|
|
578
|
+
vizDraw(this);
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
/**
|
|
583
|
+
* Applies the threshold algorithm according to the type of chart used.
|
|
584
|
+
* @param {Array} data The data to process.
|
|
585
|
+
* @private
|
|
586
|
+
*/ key: "_thresholdFunction",
|
|
587
|
+
value: function _thresholdFunction(data, _tree) {
|
|
588
|
+
return data;
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
/**
|
|
593
|
+
* Detects width and height and sets SVG properties
|
|
594
|
+
* @private
|
|
595
|
+
*/ key: "_setSVGSize",
|
|
596
|
+
value: function _setSVGSize(width, height) {
|
|
597
|
+
var _ref = _sliced_to_array(width && height ? [
|
|
598
|
+
width,
|
|
599
|
+
height
|
|
600
|
+
] : getSize(this._select.node().parentNode), 2), w = _ref[0], h = _ref[1];
|
|
601
|
+
w -= parseFloat(this._select.style("border-left-width"));
|
|
602
|
+
w -= parseFloat(this._select.style("border-right-width"));
|
|
603
|
+
h -= parseFloat(this._select.style("border-top-width"));
|
|
604
|
+
h -= parseFloat(this._select.style("border-bottom-width"));
|
|
605
|
+
if (this._autoWidth && this.schema.width !== w) {
|
|
606
|
+
this.width(w);
|
|
607
|
+
this._select.style("width", "".concat(this.schema.width, "px")).attr("width", "".concat(this.schema.width, "px"));
|
|
608
|
+
}
|
|
609
|
+
if (this._autoHeight && this.schema.height !== h) {
|
|
610
|
+
this.height(h);
|
|
611
|
+
this._select.style("height", "".concat(this.schema.height, "px")).attr("height", "".concat(this.schema.height, "px"));
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
/**
|
|
617
|
+
Draws the visualization given the specified configuration.
|
|
618
|
+
@param callback Optional callback invoked after rendering completes.
|
|
619
|
+
*/ key: "render",
|
|
620
|
+
value: function render(callback) {
|
|
621
|
+
return vizRender(this, callback);
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
key: "renderer",
|
|
626
|
+
value: function renderer(_) {
|
|
627
|
+
if (!arguments.length) return this._renderer;
|
|
628
|
+
this._renderer = _ === "canvas" ? "canvas" : "svg";
|
|
629
|
+
return this;
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
key: "renderMode",
|
|
634
|
+
value: function renderMode(_) {
|
|
635
|
+
if (!arguments.length) return this._renderMode || "full";
|
|
636
|
+
this._renderMode = _;
|
|
637
|
+
return this;
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
key: "renderScene",
|
|
642
|
+
value: /**
|
|
643
|
+
Public entry point that renders this chart through the @d3plus/render
|
|
644
|
+
pluggable backends. The compute pass happens via render() (in an svg
|
|
645
|
+
auto-created inside the target div); SvgRenderer/CanvasRenderer paints
|
|
646
|
+
the scene to the target. Returns `{renderer, scene}` so callers can
|
|
647
|
+
interact with the renderer (e.g. for picking) or read the scene data.
|
|
648
|
+
*/ function renderScene(target, opts) {
|
|
649
|
+
return _async_to_generator(function() {
|
|
650
|
+
var _this, kind;
|
|
651
|
+
return _ts_generator(this, function(_state) {
|
|
652
|
+
switch(_state.label){
|
|
653
|
+
case 0:
|
|
654
|
+
_this = this;
|
|
655
|
+
kind = (opts === null || opts === void 0 ? void 0 : opts.kind) || (this._renderer === "canvas" ? "canvas" : "svg");
|
|
656
|
+
this._sceneTarget = target;
|
|
657
|
+
this._renderer = kind;
|
|
658
|
+
this.select(target);
|
|
659
|
+
return [
|
|
660
|
+
4,
|
|
661
|
+
new Promise(function(resolve) {
|
|
662
|
+
return _this.render(function() {
|
|
663
|
+
return resolve();
|
|
664
|
+
});
|
|
665
|
+
})
|
|
666
|
+
];
|
|
667
|
+
case 1:
|
|
668
|
+
_state.sent();
|
|
669
|
+
return [
|
|
670
|
+
2,
|
|
671
|
+
{
|
|
672
|
+
renderer: this._sceneRenderer,
|
|
673
|
+
scene: this._lastSceneRendered
|
|
674
|
+
}
|
|
675
|
+
];
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
}).call(this);
|
|
679
|
+
}
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
/**
|
|
683
|
+
Renders this chart through the @d3plus/render pluggable backends. Called
|
|
684
|
+
automatically by `render()`. The compute pass draws into `this._select`
|
|
685
|
+
(an auto-created svg INSIDE the user's target div) — that svg is the
|
|
686
|
+
off-stage detached compute svg. SvgRenderer mounts to the user's target
|
|
687
|
+
div (the parent), as a sibling to the detached compute svg. The compute
|
|
688
|
+
svg's children get cleared so only the scene output is visible.
|
|
689
|
+
*/ key: "_drawSceneToTarget",
|
|
690
|
+
value: function _drawSceneToTarget(durationOverride) {
|
|
691
|
+
var _this = this;
|
|
692
|
+
var _Math;
|
|
693
|
+
var _this__sceneRenderer, _this__sceneRenderer_target, _this__sceneRenderer1;
|
|
694
|
+
var kind = this._renderer === "canvas" ? "canvas" : "svg";
|
|
695
|
+
var computeSvg = this._select && this._select.node ? this._select.node() : null;
|
|
696
|
+
if (!computeSvg) return;
|
|
697
|
+
// Mount renderer INSIDE the user's `_select` (svg or div). Tests like
|
|
698
|
+
// `svgA.querySelector('[data-key="viz-legend"]')` need the scene output
|
|
699
|
+
// to live inside the user's container, not as a sibling.
|
|
700
|
+
var userTarget = this._sceneTarget || computeSvg;
|
|
701
|
+
if (!userTarget) return;
|
|
702
|
+
var mountTarget = mountTargetFor(kind, userTarget);
|
|
703
|
+
var scene = this.toScene();
|
|
704
|
+
var w = this.schema.width || 400;
|
|
705
|
+
var h = this.schema.height || 300;
|
|
706
|
+
// Reuse the renderer instance if it matches the kind, to avoid mount
|
|
707
|
+
// churn. `target()` is the public Renderer-interface method (no
|
|
708
|
+
// reaching into renderer-private slots). It's optional on the
|
|
709
|
+
// interface; third-party renderers without it fall through to
|
|
710
|
+
// remount on every draw — correct but with mount churn.
|
|
711
|
+
var currentContainer = ((_this__sceneRenderer = this._sceneRenderer) === null || _this__sceneRenderer === void 0 ? void 0 : _this__sceneRenderer.target) ? (_this__sceneRenderer_target = this._sceneRenderer.target()) === null || _this__sceneRenderer_target === void 0 ? void 0 : _this__sceneRenderer_target.container : undefined;
|
|
712
|
+
var containerChanged = ((_this__sceneRenderer1 = this._sceneRenderer) === null || _this__sceneRenderer1 === void 0 ? void 0 : _this__sceneRenderer1.target) ? currentContainer !== mountTarget : false;
|
|
713
|
+
if (!this._sceneRenderer || this._sceneRenderer.kind !== kind || containerChanged) {
|
|
714
|
+
// Tear down the outgoing renderer before mounting a fresh one. It owns
|
|
715
|
+
// its own DOM (canvas/svg + overlay host), pointer listeners, and
|
|
716
|
+
// transition timers; without this, switching kind (svg<->canvas) or
|
|
717
|
+
// container orphans that DOM in the user's element, stacking the old
|
|
718
|
+
// mode's output behind the new one and accumulating on every switch.
|
|
719
|
+
if (this._sceneRenderer && typeof this._sceneRenderer.destroy === "function") this._sceneRenderer.destroy();
|
|
720
|
+
var Ctor = kind === "canvas" ? CanvasRenderer : SvgRenderer;
|
|
721
|
+
this._sceneRenderer = new Ctor();
|
|
722
|
+
this._sceneRenderer.mount({
|
|
723
|
+
container: mountTarget,
|
|
724
|
+
width: w,
|
|
725
|
+
height: h
|
|
726
|
+
});
|
|
727
|
+
// Bridge renderer pointer events → viz.schema.on handlers. Without this,
|
|
728
|
+
// tooltips never fire on the v4 scene-rendered path because
|
|
729
|
+
// `shape.on(evt, fn)` in plotPaint only wires d3-selection
|
|
730
|
+
// listeners on DOM nodes the scene renderer doesn't create.
|
|
731
|
+
// Renderer events carry the picked scene node; the routing lives in
|
|
732
|
+
// `_routeSceneEvent` (kept out of this method so the mount path stays
|
|
733
|
+
// readable). `_lastScenePick` remembers the most recently hovered node
|
|
734
|
+
// so `mouseleave` — fired with a null pick — can still tell the matching
|
|
735
|
+
// handlers which shape/legend item was left (so the tooltip clears).
|
|
736
|
+
this._lastScenePick = null;
|
|
737
|
+
this._sceneRenderer.on(function(event) {
|
|
738
|
+
return _this._routeSceneEvent(event);
|
|
739
|
+
});
|
|
740
|
+
} else {
|
|
741
|
+
this._sceneRenderer.resize(w, h);
|
|
742
|
+
}
|
|
743
|
+
// `durationOverride` defaults to the chart's `_duration` for normal
|
|
744
|
+
// re-renders. Interaction handlers (zoomed, hover, etc.) pass 0 to
|
|
745
|
+
// skip the transition machinery — animating every wheel/drag tick
|
|
746
|
+
// accumulates `setTimeout(duration+10)` per event.
|
|
747
|
+
var drawDuration = durationOverride !== undefined ? durationOverride : this.schema.duration;
|
|
748
|
+
// A duration>0 render (drill-down, zoom, re-center) must win over any
|
|
749
|
+
// pending coalesced duration-0 repaint — otherwise that repaint fires on
|
|
750
|
+
// the next frame and interrupts this transition, snapping shapes to their
|
|
751
|
+
// final geometry.
|
|
752
|
+
if (drawDuration > 0 && this._sceneRepaintRAF != null) {
|
|
753
|
+
cancelAnimationFrame(this._sceneRepaintRAF);
|
|
754
|
+
this._sceneRepaintRAF = undefined;
|
|
755
|
+
}
|
|
756
|
+
// Mark the window during which an animated transition is in flight, so the
|
|
757
|
+
// pointer bridge can ignore interaction until it settles. A hover/click
|
|
758
|
+
// mid-transition would schedule a duration-0 repaint that interrupts the
|
|
759
|
+
// running transition and snaps it to its end (the glitchy jump). Matches
|
|
760
|
+
// the SvgRenderer/CanvasRenderer `duration + 10` end timer, plus a small
|
|
761
|
+
// buffer so events re-enable just after the paint completes.
|
|
762
|
+
if (drawDuration > 0) this._transitionEndsAt = Date.now() + drawDuration + 30;
|
|
763
|
+
// Order persistent motion trails in time by the current timeline period, so
|
|
764
|
+
// they grow only as playback moves forward and rewind when it steps back.
|
|
765
|
+
// Only when the timeline selects a single period (`brushing: false`): a range
|
|
766
|
+
// selection has no single "current time", which would scramble the step
|
|
767
|
+
// logic, so we withhold the sequence and trails fall back to ephemeral.
|
|
768
|
+
// Normalize to milliseconds via `date()` — the selection mixes Date objects
|
|
769
|
+
// (brush/initial) and raw period numbers (playback), which compare on wildly
|
|
770
|
+
// different scales otherwise, scrambling the forward/backward test.
|
|
771
|
+
var sel = this._timelineSelection;
|
|
772
|
+
var brushing = this._timelineClass ? this._timelineClass.schema.brushing !== false : true;
|
|
773
|
+
var sequence = !brushing && Array.isArray(sel) && sel.length ? (_Math = Math).max.apply(_Math, _to_consumable_array(sel.map(function(v) {
|
|
774
|
+
return Number(date(Number(v)));
|
|
775
|
+
}))) : undefined;
|
|
776
|
+
// A forward jump that skips periods (manual click, not single-step play) draws
|
|
777
|
+
// one coarse segment; compute the marks' real positions at the skipped periods
|
|
778
|
+
// so the trail bends through them (see render commitTrailCatchups).
|
|
779
|
+
var trailCatchup = sequence !== undefined && this._trailSeq !== undefined && sequence > this._trailSeq ? computeTrailCatchup(this, scene, this._trailSeq, sequence) : undefined;
|
|
780
|
+
if (sequence !== undefined) this._trailSeq = sequence;
|
|
781
|
+
this._sceneRenderer.drawScene(scene, {
|
|
782
|
+
duration: drawDuration,
|
|
783
|
+
sequence: sequence,
|
|
784
|
+
trailCatchup: trailCatchup
|
|
785
|
+
});
|
|
786
|
+
this._lastSceneRendered = scene;
|
|
787
|
+
// Canvas backend: the compute <svg> (`_select`) is an emptied overlay
|
|
788
|
+
// sitting on top of the <canvas>. An svg root hit-tests its whole box, so
|
|
789
|
+
// even empty it swallows the pointer events the canvas needs for
|
|
790
|
+
// tooltip/hover/legend picking — the symptom being "renders fine, no
|
|
791
|
+
// tooltips." Make the overlay transparent to pointer events so the canvas
|
|
792
|
+
// is the sole interaction surface. The only interactive DOM that still
|
|
793
|
+
// lives in this svg is the timeline's d3-brush (the canvas can't host the
|
|
794
|
+
// native brush handles), so re-enable events on just that group. On the
|
|
795
|
+
// SVG backend `_select` IS the scene host, so events must stay enabled.
|
|
796
|
+
if (this._select) {
|
|
797
|
+
this._select.style("pointer-events", kind === "canvas" ? "none" : null);
|
|
798
|
+
if (this._container) this._container.style("pointer-events", kind === "canvas" ? "none" : null);
|
|
799
|
+
if (kind === "canvas") this._select.select("g.d3plus-viz-timeline").style("pointer-events", "auto");
|
|
800
|
+
}
|
|
801
|
+
// The timeline brush (d3-brush DOM, mounted in `g.d3plus-viz-timeline` in
|
|
802
|
+
// the outer svg) must paint above the scene-rendered timeline buttons/ticks
|
|
803
|
+
// so its selection tint + handles sit on top of them (matching v3). The
|
|
804
|
+
// renderer appends its scene <svg> last, so without this the brush layer
|
|
805
|
+
// ends up behind it — the selection's translucent fill is then hidden by
|
|
806
|
+
// the opaque buttons and only the edge handles peek out.
|
|
807
|
+
if (kind === "svg") {
|
|
808
|
+
var host = userTarget && typeof userTarget.querySelector === "function" ? userTarget : null;
|
|
809
|
+
var tlGroup = host ? host.querySelector(":scope > g.d3plus-viz-timeline") : null;
|
|
810
|
+
if (tlGroup) host.appendChild(tlGroup);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
/**
|
|
816
|
+
Routes a renderer pointer event to the matching `viz.schema.on` handlers.
|
|
817
|
+
Bridges the v4 scene-rendered path (SvgRenderer/CanvasRenderer), where
|
|
818
|
+
compute-mode shapes mount no per-shape DOM, so `shape.on(evt, fn)`
|
|
819
|
+
listeners never fire. We look up the appropriate `on` key from the picked
|
|
820
|
+
scene node: legend swatches route to legend handlers, chart shapes to
|
|
821
|
+
shape (+ shape-class-scoped) handlers, and chrome (axis/timeline/back) is
|
|
822
|
+
excluded. Split out of `_drawSceneToTarget` to keep that method small.
|
|
823
|
+
@private
|
|
824
|
+
*/ key: "_routeSceneEvent",
|
|
825
|
+
value: function _routeSceneEvent(event) {
|
|
826
|
+
var _this = this;
|
|
827
|
+
var _pick_index;
|
|
828
|
+
// Ignore all pointer interaction while an animated transition (zoom,
|
|
829
|
+
// re-center, drill-down, entrance) is in flight. Hovering or clicking a
|
|
830
|
+
// shape mid-transition would fire a handler that schedules a duration-0
|
|
831
|
+
// repaint, interrupting the running transition and snapping it to its end
|
|
832
|
+
// — the glitchy jump. `_transitionEndsAt` is stamped by `_drawSceneToTarget`
|
|
833
|
+
// for the transition's duration; it lapses on its own, so interaction
|
|
834
|
+
// resumes the instant the transition settles.
|
|
835
|
+
if (this._transitionEndsAt && Date.now() < this._transitionEndsAt) return;
|
|
836
|
+
var pick = event.pick;
|
|
837
|
+
// Dispatch helper shared by the live-pick path and the leave path.
|
|
838
|
+
var fire = function fire(key, d, i, x) {
|
|
839
|
+
var fn = _this.schema.on && _this.schema.on[key];
|
|
840
|
+
if (typeof fn === "function") {
|
|
841
|
+
try {
|
|
842
|
+
fn.call(_this, d, i, x, event.nativeEvent);
|
|
843
|
+
} catch (unused) {
|
|
844
|
+
// swallow per-event errors so one bad handler doesn't
|
|
845
|
+
// break subsequent events.
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
};
|
|
849
|
+
if (event.type === "mouseleave") {
|
|
850
|
+
var lastPick = this._lastScenePick;
|
|
851
|
+
if (lastPick) {
|
|
852
|
+
fire("mouseleave.".concat(lastPick.isLegend ? "legend" : "shape"), lastPick.d, lastPick.i, lastPick.x);
|
|
853
|
+
if (!lastPick.isLegend && lastPick.shapeType) fire("mouseleave.".concat(lastPick.shapeType), lastPick.d, lastPick.i, lastPick.x);
|
|
854
|
+
fire("mouseleave", lastPick.d, lastPick.i, lastPick.x);
|
|
855
|
+
}
|
|
856
|
+
this._lastScenePick = null;
|
|
857
|
+
// Cleared here, then re-set by the enter/move the renderer fires
|
|
858
|
+
// synchronously when the pointer crosses to an adjacent node — so a
|
|
859
|
+
// shape→label hand-off leaves `_hoverDatum` pointing at the new node
|
|
860
|
+
// (same datum), which `mouseleave` reads to suppress a flicker.
|
|
861
|
+
this._hoverDatum = null;
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
if (!pick || !pick.node) return;
|
|
865
|
+
// Scene nodes carry interaction metadata stamped by Viz.toScene.
|
|
866
|
+
var nodeAny = pick.node;
|
|
867
|
+
// Back-button panel: its d3-selection click listener never fires in the
|
|
868
|
+
// scene path (it's a plain text node), so route its click here to pop
|
|
869
|
+
// the drill-down history / step up a level.
|
|
870
|
+
if (nodeAny.interactionGroup === "back") {
|
|
871
|
+
if (event.type === "click") {
|
|
872
|
+
var self = this;
|
|
873
|
+
if (self._history.length) self.config(self._history.pop()).render();
|
|
874
|
+
else self.depth(self._drawDepth - 1).filter(false).render();
|
|
875
|
+
}
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
// Axis ticks/labels and the timeline are chrome — they carry data but
|
|
879
|
+
// are not chart shapes, so they must not fire shape tooltips/handlers.
|
|
880
|
+
if (nodeAny.interactionGroup === "axis" || nodeAny.interactionGroup === "timeline") return;
|
|
881
|
+
// Prefer the node's stamped interaction group (set by Viz.toScene), so
|
|
882
|
+
// legend swatches route to legend handlers on Canvas too — where the
|
|
883
|
+
// single canvas element has no per-shape DOM to walk. Fall back to SVG
|
|
884
|
+
// DOM ancestry for nodes the stamp didn't reach.
|
|
885
|
+
var target = event.nativeEvent && event.nativeEvent.target;
|
|
886
|
+
var isLegendNode = nodeAny.interactionGroup === "legend" || (target && typeof target.closest === "function" ? !!target.closest('[data-key="viz-legend"]') : false);
|
|
887
|
+
var suffix = isLegendNode ? "legend" : "shape";
|
|
888
|
+
var handlerKey = "".concat(event.type, ".").concat(suffix);
|
|
889
|
+
// Resolve the source datum + index. `pick.datum` is the raw scene datum
|
|
890
|
+
// (which Shape._sceneXxx populated). For Plot shapes that's the wrapped
|
|
891
|
+
// record; the handlers expect `(d.data, d.i, x, event)`.
|
|
892
|
+
var rawDatum = pick.datum;
|
|
893
|
+
var sourceDatum = rawDatum && rawDatum.data ? rawDatum.data : rawDatum;
|
|
894
|
+
var sourceIndex = rawDatum && typeof rawDatum.i === "number" ? rawDatum.i : (_pick_index = pick.index) !== null && _pick_index !== void 0 ? _pick_index : 0;
|
|
895
|
+
var shapeType = typeof nodeAny.shapeType === "string" ? nodeAny.shapeType : null;
|
|
896
|
+
this._lastScenePick = {
|
|
897
|
+
d: sourceDatum,
|
|
898
|
+
i: sourceIndex,
|
|
899
|
+
x: rawDatum,
|
|
900
|
+
isLegend: isLegendNode,
|
|
901
|
+
shapeType: shapeType
|
|
902
|
+
};
|
|
903
|
+
this._hoverDatum = rawDatum;
|
|
904
|
+
fire(handlerKey, sourceDatum, sourceIndex, rawDatum);
|
|
905
|
+
// Shape-class-scoped handlers (`"click.Bar"`, `"mousemove.Circle"`). The
|
|
906
|
+
// emitting shape stamps its type onto the node; on the scene path this is
|
|
907
|
+
// the only place these fire (compute-mode shapes wire no DOM listeners).
|
|
908
|
+
// Legend nodes are excluded so a legend swatch's shape type can't
|
|
909
|
+
// masquerade as a chart-shape handler.
|
|
910
|
+
if (!isLegendNode && shapeType) {
|
|
911
|
+
fire("".concat(event.type, ".").concat(shapeType), sourceDatum, sourceIndex, rawDatum);
|
|
912
|
+
}
|
|
913
|
+
// Also fire the un-suffixed handler (e.g. "mousemove") so user-registered
|
|
914
|
+
// global handlers see the event too.
|
|
915
|
+
fire(event.type, sourceDatum, sourceIndex, rawDatum);
|
|
916
|
+
}
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
/**
|
|
920
|
+
Coalesces interaction-driven scene repaints (hover/active dimming) into a
|
|
921
|
+
single paint per animation frame. A fast pointer sweep across a dense
|
|
922
|
+
chart fires a hover transition per shape crossed; painting each one
|
|
923
|
+
synchronously rebuilt the whole scene back-to-back, saturating the main
|
|
924
|
+
thread (~200ms stalls) so the tooltip couldn't reposition and appeared
|
|
925
|
+
stuck at its last spot. Only the latest hover state is visible, so the
|
|
926
|
+
intermediate paints are wasted — collapse them to one rAF-scheduled draw.
|
|
927
|
+
*/ key: "_scheduleSceneRepaint",
|
|
928
|
+
value: function _scheduleSceneRepaint() {
|
|
929
|
+
var _this = this;
|
|
930
|
+
if (!this._sceneRenderer) return;
|
|
931
|
+
if (typeof requestAnimationFrame !== "function") {
|
|
932
|
+
this._drawSceneToTarget(0);
|
|
933
|
+
return;
|
|
934
|
+
}
|
|
935
|
+
if (this._sceneRepaintRAF != null) return;
|
|
936
|
+
this._sceneRepaintRAF = requestAnimationFrame(function() {
|
|
937
|
+
_this._sceneRepaintRAF = undefined;
|
|
938
|
+
_this._drawSceneToTarget(0);
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
/**
|
|
944
|
+
Tears down the visualization: disconnects the ResizeObserver and removes DOM event listeners. Call this when unmounting to avoid memory leaks.
|
|
945
|
+
*/ key: "destroy",
|
|
946
|
+
value: function destroy() {
|
|
947
|
+
this._resizeObserver.disconnect();
|
|
948
|
+
this._tooltipClass.data([]).render();
|
|
949
|
+
select("body").on("touchstart.".concat(this._uuid), null);
|
|
950
|
+
// Clear the visibility/resize/scroll poll timers + scroll listener
|
|
951
|
+
// so a destroyed chart doesn't keep firing intervals/timeouts that
|
|
952
|
+
// hold the entire viz instance alive. Without this, an SPA that
|
|
953
|
+
// mounts/unmounts charts on tab switches leaks the scene tree +
|
|
954
|
+
// a 200ms-interval timer per leaked chart.
|
|
955
|
+
if (this._visiblePoll) {
|
|
956
|
+
this._visiblePoll = clearInterval(this._visiblePoll);
|
|
957
|
+
}
|
|
958
|
+
if (this._resizePoll) {
|
|
959
|
+
this._resizePoll = clearTimeout(this._resizePoll);
|
|
960
|
+
}
|
|
961
|
+
if (this._scrollPoll) {
|
|
962
|
+
this._scrollPoll = clearTimeout(this._scrollPoll);
|
|
963
|
+
}
|
|
964
|
+
if (this._sceneRepaintRAF != null) {
|
|
965
|
+
if (typeof cancelAnimationFrame === "function") cancelAnimationFrame(this._sceneRepaintRAF);
|
|
966
|
+
this._sceneRepaintRAF = undefined;
|
|
967
|
+
}
|
|
968
|
+
select(this.schema.scrollContainer).on("scroll.".concat(this._uuid), null);
|
|
969
|
+
// Destroy the active scene renderer (clears its own pointer-rect
|
|
970
|
+
// listeners, overlay host, canvas/svg DOM, timers).
|
|
971
|
+
if (this._sceneRenderer && typeof this._sceneRenderer.destroy === "function") {
|
|
972
|
+
this._sceneRenderer.destroy();
|
|
973
|
+
this._sceneRenderer = undefined;
|
|
974
|
+
}
|
|
975
|
+
return this;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
]);
|
|
979
|
+
return Viz;
|
|
980
|
+
}(VizBase);
|
|
981
|
+
/**
|
|
982
|
+
Creates an x/y plot based on an array of data. See [this example](https://d3plus.org/examples/d3plus-treemap/getting-started/) for help getting started using the treemap generator.
|
|
983
|
+
*/ export { Viz as default };
|
|
984
|
+
|
|
985
|
+
//# sourceMappingURL=Viz.js.map
|