@d3plus/core 3.1.6 → 4.1.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 +9924 -78528
- 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 +655 -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 +84 -35
- 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 +125 -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 +15 -10
- 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 +157 -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 +270 -15
- 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 +30966 -19051
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +5400 -2949
- package/umd/d3plus-core.js +17364 -10534
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +3494 -1877
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/configPrep.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\nimport { D3plusConfig } from \"./D3plusConfig\";\n\ninterface D3PlusWrapped {\n __d3plus__?: boolean;\n __d3plusParent__?: D3PlusWrapped;\n data?: DataPoint;\n feature?: DataPoint;\n i?: number;\n [key: string]: unknown;\n}\n\ntype DataAccessor = (\n d: DataPoint,\n i: number,\n s?: D3PlusWrapped,\n e?: Event,\n) => DataPoint[keyof DataPoint];\ntype ConfigValue =\n | DataAccessor\n | string\n | number\n | boolean\n | ConfigObject\n | ConfigValue[];\ninterface ConfigObject extends D3plusConfig {\n [key: string]: unknown;\n}\n\nexport interface VizContext {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/configPrep.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\nimport { D3plusConfig } from \"./D3plusConfig.js\";\n\ninterface D3PlusWrapped {\n __d3plus__?: boolean;\n __d3plusParent__?: D3PlusWrapped;\n data?: DataPoint;\n feature?: DataPoint;\n i?: number;\n [key: string]: unknown;\n}\n\ntype DataAccessor = (\n d: DataPoint,\n i: number,\n s?: D3PlusWrapped,\n e?: Event,\n) => DataPoint[keyof DataPoint];\ntype ConfigValue =\n | DataAccessor\n | string\n | number\n | boolean\n | ConfigObject\n | ConfigValue[];\ninterface ConfigObject extends D3plusConfig {\n [key: string]: unknown;\n}\n\nexport interface VizContext {\n schema: {\n shapeConfig: ConfigObject;\n duration?: number;\n on?: Record<string, DataAccessor>;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\n/**\n Preps a config object for d3plus data, and optionally bubbles up a specific nested type. When using this function, you must bind a d3plus class' `this` context.\n @param config The configuration object to parse.\n @param type The event classifier to user for \"on\" events. For example, the default event type of \"shape\" will apply all events in the \"on\" config object with that key, like \"click.shape\" and \"mouseleave.shape\", in addition to any gloval events like \"click\" and \"mouseleave\".\n @param nest An optional nested key to bubble up to the parent config level.\n*/\nexport default function configPrep(\n this: VizContext,\n config: ConfigObject = this.schema.shapeConfig,\n type: string = \"shape\",\n nest: string | false = false,\n): ConfigObject {\n const newConfig: ConfigObject = {\n duration: this.schema.duration,\n on: {},\n };\n\n const wrapFunction =\n (func: DataAccessor) =>\n (\n d: DataPoint | D3PlusWrapped,\n i: number,\n s?: D3PlusWrapped,\n e?: Event,\n ): DataPoint[keyof DataPoint] => {\n if (!func) return func as unknown as DataPoint[keyof DataPoint];\n let parent: D3PlusWrapped | undefined;\n while ((d as D3PlusWrapped).__d3plus__) {\n if (parent) (d as D3PlusWrapped).__d3plusParent__ = parent;\n parent = d as D3PlusWrapped;\n i = (d as D3PlusWrapped).i!;\n d = ((d as D3PlusWrapped).data || (d as D3PlusWrapped).feature)!;\n }\n return func.bind(this)(d as DataPoint, i, s || parent, e);\n };\n\n const parseEvents = (\n newObj: ConfigObject,\n on: Record<string, DataAccessor>,\n ): void => {\n for (const event in on) {\n if (\n ({}.hasOwnProperty.call(on, event) && !event.includes(\".\")) ||\n event.includes(`.${type}`)\n ) {\n (newObj.on as unknown as Record<string, DataAccessor>)[event] = wrapFunction(on[event]);\n }\n }\n };\n\n const arrayEval = (arr: ConfigValue[]): ConfigValue[] =>\n arr.map((d: ConfigValue) => {\n if (d instanceof Array) return arrayEval(d);\n else if (typeof d === \"object\")\n return keyEval({} as ConfigObject, d as ConfigObject);\n else if (typeof d === \"function\") return wrapFunction(d as DataAccessor);\n else return d;\n });\n\n const keyEval = (newObj: ConfigObject, obj: ConfigObject): ConfigObject => {\n for (const key in obj) {\n if ({}.hasOwnProperty.call(obj, key)) {\n if (key === \"on\")\n parseEvents(newObj, obj[key] as unknown as Record<string, DataAccessor>);\n else if (key === \"sort\")\n // `sort` is a two-argument layering comparator, not a per-datum\n // accessor — pass it through untouched so `wrapFunction` doesn't\n // rewrite it into a single-datum call (which would feed the index\n // as its second argument).\n newObj[key] = obj[key];\n else if (typeof obj[key] === \"function\") {\n newObj[key] = wrapFunction(obj[key] as DataAccessor);\n } else if (obj[key] instanceof Array) {\n newObj[key] = arrayEval(obj[key] as ConfigValue[]);\n } else if (typeof obj[key] === \"object\") {\n if (!newObj[key]) newObj[key] = {} as ConfigObject;\n (newObj[key] as ConfigObject).on = {};\n keyEval(newObj[key] as ConfigObject, obj[key] as ConfigObject);\n } else newObj[key] = obj[key];\n }\n }\n\n return newObj;\n };\n\n keyEval(newConfig, config);\n if (this.schema.on) parseEvents(newConfig, this.schema.on as unknown as Record<string, DataAccessor>);\n if (nest && config[nest]) {\n keyEval(newConfig, config[nest] as ConfigObject);\n if ((config[nest] as ConfigObject).on)\n parseEvents(newConfig, (config[nest] as ConfigObject).on as unknown as Record<string, DataAccessor>);\n }\n\n return newConfig;\n}\n"],"names":["configPrep","config","schema","shapeConfig","type","nest","newConfig","duration","on","wrapFunction","func","d","i","s","e","parent","__d3plus__","__d3plusParent__","data","feature","bind","parseEvents","newObj","event","hasOwnProperty","call","includes","arrayEval","arr","map","Array","keyEval","obj","key"],"mappings":";;;;;;;;;;;;AAuCA;;;;;AAKA,GACA,eAAe,SAASA;;QAEtBC,SAAAA,iEAAuB,IAAI,CAACC,MAAM,CAACC,WAAW,EAC9CC,OAAAA,iEAAe,SACfC,OAAAA,iEAAuB;IAEvB,IAAMC,YAA0B;QAC9BC,UAAU,IAAI,CAACL,MAAM,CAACK,QAAQ;QAC9BC,IAAI,CAAC;IACP;IAEA,IAAMC,eACJ,sBAACC;eACD,SACEC,GACAC,GACAC,GACAC;YAEA,IAAI,CAACJ,MAAM,OAAOA;YAClB,IAAIK;YACJ,MAAO,AAACJ,EAAoBK,UAAU,CAAE;gBACtC,IAAID,QAAQ,AAACJ,EAAoBM,gBAAgB,GAAGF;gBACpDA,SAASJ;gBACTC,IAAI,AAACD,EAAoBC,CAAC;gBAC1BD,IAAK,AAACA,EAAoBO,IAAI,IAAI,AAACP,EAAoBQ,OAAO;YAChE;YACA,OAAOT,KAAKU,IAAI,QAAOT,GAAgBC,GAAGC,KAAKE,QAAQD;QACzD;;IAEF,IAAMO,cAAc,qBAClBC,QACAd;QAEA,IAAK,IAAMe,SAASf,GAAI;YACtB,IACE,AAAC,CAAA,CAAC,CAAA,EAAEgB,cAAc,CAACC,IAAI,CAACjB,IAAIe,UAAU,CAACA,MAAMG,QAAQ,CAAC,QACtDH,MAAMG,QAAQ,CAAC,AAAC,IAAQ,OAALtB,QACnB;gBACCkB,OAAOd,EAAE,AAA4C,CAACe,MAAM,GAAGd,aAAaD,EAAE,CAACe,MAAM;YACxF;QACF;IACF;IAEA,IAAMI,YAAY,oBAACC;eACjBA,IAAIC,GAAG,CAAC,SAAClB;YACP,IAAIA,AAAC,YAADA,GAAamB,QAAO,OAAOH,UAAUhB;iBACpC,IAAI,CAAA,OAAOA,kCAAP,SAAOA,EAAAA,MAAM,UACpB,OAAOoB,QAAQ,CAAC,GAAmBpB;iBAChC,IAAI,OAAOA,MAAM,YAAY,OAAOF,aAAaE;iBACjD,OAAOA;QACd;;IAEF,IAAMoB,UAAU,kBAACT,QAAsBU;QACrC,IAAK,IAAMC,OAAOD,IAAK;YACrB,IAAI,CAAA,CAAC,CAAA,EAAER,cAAc,CAACC,IAAI,CAACO,KAAKC,MAAM;gBACpC,IAAIA,QAAQ,MACVZ,YAAYC,QAAQU,GAAG,CAACC,IAAI;qBACzB,IAAIA,QAAQ,QACf,gEAAgE;gBAChE,iEAAiE;gBACjE,kEAAkE;gBAClE,2BAA2B;gBAC3BX,MAAM,CAACW,IAAI,GAAGD,GAAG,CAACC,IAAI;qBACnB,IAAI,OAAOD,GAAG,CAACC,IAAI,KAAK,YAAY;oBACvCX,MAAM,CAACW,IAAI,GAAGxB,aAAauB,GAAG,CAACC,IAAI;gBACrC,OAAO,IAAID,AAAQ,YAARA,GAAG,CAACC,IAAI,EAAYH,QAAO;oBACpCR,MAAM,CAACW,IAAI,GAAGN,UAAUK,GAAG,CAACC,IAAI;gBAClC,OAAO,IAAI,SAAOD,GAAG,CAACC,IAAI,MAAK,UAAU;oBACvC,IAAI,CAACX,MAAM,CAACW,IAAI,EAAEX,MAAM,CAACW,IAAI,GAAG,CAAC;oBAChCX,MAAM,CAACW,IAAI,CAAkBzB,EAAE,GAAG,CAAC;oBACpCuB,QAAQT,MAAM,CAACW,IAAI,EAAkBD,GAAG,CAACC,IAAI;gBAC/C,OAAOX,MAAM,CAACW,IAAI,GAAGD,GAAG,CAACC,IAAI;YAC/B;QACF;QAEA,OAAOX;IACT;IAEAS,QAAQzB,WAAWL;IACnB,IAAI,IAAI,CAACC,MAAM,CAACM,EAAE,EAAEa,YAAYf,WAAW,IAAI,CAACJ,MAAM,CAACM,EAAE;IACzD,IAAIH,QAAQJ,MAAM,CAACI,KAAK,EAAE;QACxB0B,QAAQzB,WAAWL,MAAM,CAACI,KAAK;QAC/B,IAAI,AAACJ,MAAM,CAACI,KAAK,CAAkBG,EAAE,EACnCa,YAAYf,WAAW,AAACL,MAAM,CAACI,KAAK,CAAkBG,EAAE;IAC5D;IAEA,OAAOF;AACT"}
|
package/es/src/utils/getProp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/getProp.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\n\n/**\n @module getProp\n @param type\n @param d\n @param i\n @private\n*/\nexport default function getProp(\n this: Record<string, (d: DataPoint, i: number) => DataPoint[keyof DataPoint]
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/getProp.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\n\n/**\n @module getProp\n @param type\n @param d\n @param i\n @private\n*/\nexport default function getProp(\n this: {schema: Record<string, (d: DataPoint, i: number) => DataPoint[keyof DataPoint]>},\n type: string,\n d: DataPoint,\n i: number,\n): DataPoint[keyof DataPoint] {\n return d[type] || this.schema[type](d, i);\n}\n"],"names":["getProp","type","d","i","schema"],"mappings":"AAEA;;;;;;AAMA,GACA,eAAe,SAASA,QAEtBC,IAAY,EACZC,CAAY,EACZC,CAAS;IAET,OAAOD,CAAC,CAACD,KAAK,IAAI,IAAI,CAACG,MAAM,CAACH,KAAK,CAACC,GAAGC;AACzC"}
|
package/es/src/utils/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { default as BaseClass } from "./BaseClass.js";
|
|
|
3
3
|
export { default as configPrep } from "./configPrep.js";
|
|
4
4
|
export { default as constant } from "./constant.js";
|
|
5
5
|
export { default as getProp } from "./getProp.js";
|
|
6
|
+
export { paintComponentScene } from "./paintComponentScene.js";
|
|
6
7
|
export { default as RESET } from "./RESET.js";
|
|
7
8
|
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["export type {AccessorFn} from \"./AccessorFn.js\";\nexport {default as accessor} from \"./accessor.js\";\nexport {default as BaseClass} from \"./BaseClass.js\";\nexport type {D3plusConfig
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["export type {AccessorFn} from \"./AccessorFn.js\";\nexport {default as accessor} from \"./accessor.js\";\nexport {default as BaseClass} from \"./BaseClass.js\";\nexport type {\n D3plusConfig,\n AxisConfig,\n ColorScaleConfig,\n LegendConfig,\n TextBoxConfig,\n TimelineConfig,\n TooltipConfig,\n} from \"./D3plusConfig.js\";\nexport type {D3Scale} from \"./D3Scale.js\";\nexport {default as configPrep} from \"./configPrep.js\";\nexport {default as constant} from \"./constant.js\";\nexport {default as getProp} from \"./getProp.js\";\nexport {paintComponentScene} from \"./paintComponentScene.js\";\nexport {default as RESET} from \"./RESET.js\";\n"],"names":["default","accessor","BaseClass","configPrep","constant","getProp","paintComponentScene","RESET"],"mappings":"AACA,SAAQA,WAAWC,QAAQ,QAAO,gBAAgB;AAClD,SAAQD,WAAWE,SAAS,QAAO,iBAAiB;AAWpD,SAAQF,WAAWG,UAAU,QAAO,kBAAkB;AACtD,SAAQH,WAAWI,QAAQ,QAAO,gBAAgB;AAClD,SAAQJ,WAAWK,OAAO,QAAO,eAAe;AAChD,SAAQC,mBAAmB,QAAO,2BAA2B;AAC7D,SAAQN,WAAWO,KAAK,QAAO,aAAa"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
function _instanceof(left, right) {
|
|
2
|
+
"@swc/helpers - instanceof";
|
|
3
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
4
|
+
return !!right[Symbol.hasInstance](left);
|
|
5
|
+
} else {
|
|
6
|
+
return left instanceof right;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
Standalone scene paint for the BaseClass-derived components (Axis, Legend,
|
|
11
|
+
ColorScale).
|
|
12
|
+
|
|
13
|
+
When one of these components is composed inside a Viz it runs in
|
|
14
|
+
`renderMode("compute")` and the Viz reads its `toScene()` into the chart
|
|
15
|
+
scene — nothing here is used. When it is rendered on its own (e.g. the
|
|
16
|
+
`@d3plus/react` `<Axis>`/`<Legend>`/`<ColorScale>` wrappers, or a bare
|
|
17
|
+
`new Axis().select(svg).render()`), `render()` only computes layout; no
|
|
18
|
+
backend paints the resulting scene. This mounts an SvgRenderer into the
|
|
19
|
+
component's `_select` and draws its scene, reusing the renderer instance
|
|
20
|
+
across re-renders.
|
|
21
|
+
*/ import { SvgRenderer } from "@d3plus/render";
|
|
22
|
+
export function paintComponentScene(instance) {
|
|
23
|
+
var _instance_schema_width, _instance_schema_height;
|
|
24
|
+
var sel = instance._select;
|
|
25
|
+
var node = sel && typeof sel.node === "function" ? sel.node() : null;
|
|
26
|
+
if (!_instanceof(node, Element)) return;
|
|
27
|
+
var container = node;
|
|
28
|
+
var width = (_instance_schema_width = instance.schema.width) !== null && _instance_schema_width !== void 0 ? _instance_schema_width : 400;
|
|
29
|
+
var height = (_instance_schema_height = instance.schema.height) !== null && _instance_schema_height !== void 0 ? _instance_schema_height : 200;
|
|
30
|
+
if (!instance._sceneRenderer) {
|
|
31
|
+
instance._sceneRenderer = new SvgRenderer();
|
|
32
|
+
instance._sceneRenderer.mount({
|
|
33
|
+
container: container,
|
|
34
|
+
width: width,
|
|
35
|
+
height: height
|
|
36
|
+
});
|
|
37
|
+
} else {
|
|
38
|
+
instance._sceneRenderer.resize(width, height);
|
|
39
|
+
}
|
|
40
|
+
// Wrap the component's group in a synthetic root so the renderer reconciles
|
|
41
|
+
// it as a child (preserving the group's own key/transform); `drawScene`
|
|
42
|
+
// only iterates `scene.root.children`.
|
|
43
|
+
var scene = {
|
|
44
|
+
root: {
|
|
45
|
+
type: "group",
|
|
46
|
+
key: "root",
|
|
47
|
+
children: [
|
|
48
|
+
instance.toScene()
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
width: width,
|
|
52
|
+
height: height
|
|
53
|
+
};
|
|
54
|
+
instance._sceneRenderer.drawScene(scene, {
|
|
55
|
+
duration: 0
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=paintComponentScene.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/paintComponentScene.ts"],"sourcesContent":["/**\n Standalone scene paint for the BaseClass-derived components (Axis, Legend,\n ColorScale).\n\n When one of these components is composed inside a Viz it runs in\n `renderMode(\"compute\")` and the Viz reads its `toScene()` into the chart\n scene — nothing here is used. When it is rendered on its own (e.g. the\n `@d3plus/react` `<Axis>`/`<Legend>`/`<ColorScale>` wrappers, or a bare\n `new Axis().select(svg).render()`), `render()` only computes layout; no\n backend paints the resulting scene. This mounts an SvgRenderer into the\n component's `_select` and draws its scene, reusing the renderer instance\n across re-renders.\n*/\n\nimport {SvgRenderer} from \"@d3plus/render\";\nimport type {GroupNode, Scene} from \"@d3plus/render\";\n\ninterface SceneComponent {\n _select?: {node: () => import(\"d3-selection\").BaseType | null};\n _sceneRenderer?: SvgRenderer;\n schema: {width?: number; height?: number};\n toScene: () => GroupNode;\n}\n\nexport function paintComponentScene(instance: SceneComponent): void {\n const sel = instance._select;\n const node =\n sel && typeof sel.node === \"function\" ? sel.node() : null;\n if (!(node instanceof Element)) return;\n const container: Element = node;\n\n const width = instance.schema.width ?? 400;\n const height = instance.schema.height ?? 200;\n\n if (!instance._sceneRenderer) {\n instance._sceneRenderer = new SvgRenderer();\n instance._sceneRenderer.mount({container, width, height});\n } else {\n instance._sceneRenderer.resize(width, height);\n }\n\n // Wrap the component's group in a synthetic root so the renderer reconciles\n // it as a child (preserving the group's own key/transform); `drawScene`\n // only iterates `scene.root.children`.\n const scene: Scene = {\n root: {type: \"group\", key: \"root\", children: [instance.toScene()]},\n width,\n height,\n };\n instance._sceneRenderer.drawScene(scene, {duration: 0});\n}\n"],"names":["SvgRenderer","paintComponentScene","instance","sel","_select","node","Element","container","width","schema","height","_sceneRenderer","mount","resize","scene","root","type","key","children","toScene","drawScene","duration"],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;AAYA,GAEA,SAAQA,WAAW,QAAO,iBAAiB;AAU3C,OAAO,SAASC,oBAAoBC,QAAwB;QAO5CA,wBACCA;IAPf,IAAMC,MAAMD,SAASE,OAAO;IAC5B,IAAMC,OACJF,OAAO,OAAOA,IAAIE,IAAI,KAAK,aAAaF,IAAIE,IAAI,KAAK;IACvD,IAAI,CAAEA,AAAI,YAAJA,MAAgBC,UAAU;IAChC,IAAMC,YAAqBF;IAE3B,IAAMG,SAAQN,yBAAAA,SAASO,MAAM,CAACD,KAAK,cAArBN,oCAAAA,yBAAyB;IACvC,IAAMQ,UAASR,0BAAAA,SAASO,MAAM,CAACC,MAAM,cAAtBR,qCAAAA,0BAA0B;IAEzC,IAAI,CAACA,SAASS,cAAc,EAAE;QAC5BT,SAASS,cAAc,GAAG,IAAIX;QAC9BE,SAASS,cAAc,CAACC,KAAK,CAAC;YAACL,WAAAA;YAAWC,OAAAA;YAAOE,QAAAA;QAAM;IACzD,OAAO;QACLR,SAASS,cAAc,CAACE,MAAM,CAACL,OAAOE;IACxC;IAEA,4EAA4E;IAC5E,wEAAwE;IACxE,uCAAuC;IACvC,IAAMI,QAAe;QACnBC,MAAM;YAACC,MAAM;YAASC,KAAK;YAAQC,UAAU;gBAAChB,SAASiB,OAAO;aAAG;QAAA;QACjEX,OAAAA;QACAE,QAAAA;IACF;IACAR,SAASS,cAAc,CAACS,SAAS,CAACN,OAAO;QAACO,UAAU;IAAC;AACvD"}
|
package/es/umd-entry.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
UMD/CDN bundle entry — superset of the ESM entry.
|
|
3
|
+
|
|
4
|
+
The typed ESM API is intentionally curated: `@d3plus/core` exposes the
|
|
5
|
+
stable public surface (`./index.ts`) and the v4 pipeline lives behind the
|
|
6
|
+
opt-in `@d3plus/core/internal` subpath (`./internal.ts`). The standalone
|
|
7
|
+
UMD global (`window.d3plus`) has no `.d.ts` and is a convenience build, so
|
|
8
|
+
it carries both — advanced/browser consumers and the in-browser parity
|
|
9
|
+
tests can reach the pipeline through the same global.
|
|
10
|
+
|
|
11
|
+
This file is the rollup input for the UMD build only; it is not part of
|
|
12
|
+
the package's `exports` map.
|
|
13
|
+
*/ export * from "./index.js";
|
|
14
|
+
export * from "./internal.js";
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=umd-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../umd-entry.ts"],"sourcesContent":["/**\n UMD/CDN bundle entry — superset of the ESM entry.\n\n The typed ESM API is intentionally curated: `@d3plus/core` exposes the\n stable public surface (`./index.ts`) and the v4 pipeline lives behind the\n opt-in `@d3plus/core/internal` subpath (`./internal.ts`). The standalone\n UMD global (`window.d3plus`) has no `.d.ts` and is a convenience build, so\n it carries both — advanced/browser consumers and the in-browser parity\n tests can reach the pipeline through the same global.\n\n This file is the rollup input for the UMD build only; it is not part of\n the package's `exports` map.\n*/\nexport * from \"./index.js\";\nexport * from \"./internal.js\";\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;AAYA,GACA,cAAc,aAAa;AAC3B,cAAc,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d3plus/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -9,11 +9,15 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./types/index.d.ts",
|
|
11
11
|
"default": "./es/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./internal": {
|
|
14
|
+
"types": "./types/internal.d.ts",
|
|
15
|
+
"default": "./es/internal.js"
|
|
12
16
|
}
|
|
13
17
|
},
|
|
14
18
|
"browser": "./umd/d3plus-core.full.js",
|
|
15
19
|
"engines": {
|
|
16
|
-
"node": ">=
|
|
20
|
+
"node": ">=22"
|
|
17
21
|
},
|
|
18
22
|
"sideEffects": false,
|
|
19
23
|
"files": [
|
|
@@ -58,13 +62,14 @@
|
|
|
58
62
|
"open-color": "^1.9.1",
|
|
59
63
|
"textures": "^1.2.3",
|
|
60
64
|
"topojson-client": "^3.1.0",
|
|
61
|
-
"@d3plus/
|
|
62
|
-
"@d3plus/
|
|
63
|
-
"@d3plus/
|
|
64
|
-
"@d3plus/
|
|
65
|
-
"@d3plus/
|
|
66
|
-
"@d3plus/
|
|
67
|
-
"@d3plus/
|
|
65
|
+
"@d3plus/data": "4.1.0",
|
|
66
|
+
"@d3plus/dom": "4.1.0",
|
|
67
|
+
"@d3plus/format": "4.1.0",
|
|
68
|
+
"@d3plus/color": "4.1.0",
|
|
69
|
+
"@d3plus/text": "4.1.0",
|
|
70
|
+
"@d3plus/locales": "4.1.0",
|
|
71
|
+
"@d3plus/render": "4.1.0",
|
|
72
|
+
"@d3plus/math": "4.1.0"
|
|
68
73
|
},
|
|
69
74
|
"devDependencies": {
|
|
70
75
|
"playwright": "1.59.1"
|
|
@@ -74,7 +79,7 @@
|
|
|
74
79
|
"build:types": "tsc",
|
|
75
80
|
"build:umd": "node ../../scripts/build-umd.js",
|
|
76
81
|
"dev": "node ../../scripts/dev.js",
|
|
77
|
-
"test": "eslint index.ts src/**/*.ts && eslint --global=it test && mocha 'test/**/*-test.js'",
|
|
82
|
+
"test": "eslint index.ts internal.ts umd-entry.ts src/**/*.ts && eslint --global=it test && mocha 'test/**/*-test.js'",
|
|
78
83
|
"test:coverage": "c8 -r text -r lcov --src src mocha 'test/**/*-test.js'"
|
|
79
84
|
}
|
|
80
85
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -2,4 +2,6 @@ export { AreaPlot, BarChart, BoxWhisker, BumpChart, Donut, Geomap, LinePlot, Mat
|
|
|
2
2
|
export { Axis, AxisBottom, AxisLeft, AxisRight, AxisTop, ColorScale, Legend, Message, TextBox, Timeline, Tooltip, } from "./src/components/index.js";
|
|
3
3
|
export { Area, Bar, Box, Circle, Image, Line, Path, Rect, Shape, Whisker, } from "./src/shapes/index.js";
|
|
4
4
|
export { accessor, BaseClass, configPrep, constant, RESET, } from "./src/utils/index.js";
|
|
5
|
-
export type { D3plusConfig, AxisConfig, TooltipConfig, } from "./src/utils/index.js";
|
|
5
|
+
export type { D3plusConfig, AxisConfig, ColorScaleConfig, LegendConfig, TextBoxConfig, TimelineConfig, TooltipConfig, } from "./src/utils/index.js";
|
|
6
|
+
export type { AnyShapeConfig, AreaConfig, BarConfig, BaseShapeConfig, BoxConfig, CircleConfig, ConstOrAccessor, ImageConfig, LineConfig, PathConfig, RectConfig, StringOrAccessor, WhiskerConfig, } from "./src/shapes/shapeConfig.js";
|
|
7
|
+
export type { D3Selection, Margin, Padding, } from "./src/charts/viz/vizTypes.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
`@d3plus/core/internal` — the v4 scene-graph pipeline, exposed for
|
|
3
|
+
parity/regression tests and for advanced users building custom charts on
|
|
4
|
+
the `ChartDefinition` contract.
|
|
5
|
+
|
|
6
|
+
This surface is intentionally **not** part of the stable public API. The
|
|
7
|
+
chart classes, components, shapes, and config types in `@d3plus/core` are
|
|
8
|
+
the supported entry points and follow semver. Everything re-exported here
|
|
9
|
+
is implementation detail of the rendering pipeline and may change in any
|
|
10
|
+
minor release. Import it knowingly.
|
|
11
|
+
*/
|
|
12
|
+
export { applyGeomapLayout } from "./src/charts/Geomap/applyLayout.js";
|
|
13
|
+
export { applyMatrixLayout } from "./src/charts/Matrix/applyLayout.js";
|
|
14
|
+
export { applyNetworkLayout } from "./src/charts/Network/applyLayout.js";
|
|
15
|
+
export { applyRingsLayout } from "./src/charts/Rings/applyLayout.js";
|
|
16
|
+
export { applySankeyLayout } from "./src/charts/Sankey/applyLayout.js";
|
|
17
|
+
export { applyPackLayout } from "./src/charts/Pack/applyLayout.js";
|
|
18
|
+
export { applyPieLayout } from "./src/charts/Pie/applyLayout.js";
|
|
19
|
+
export { applyPriestleyLayout } from "./src/charts/Priestley/applyLayout.js";
|
|
20
|
+
export { applyRadarLayout } from "./src/charts/Radar/applyLayout.js";
|
|
21
|
+
export { applyRadialMatrixLayout } from "./src/charts/RadialMatrix/applyLayout.js";
|
|
22
|
+
export { applyTreeLayout } from "./src/charts/Tree/applyLayout.js";
|
|
23
|
+
export { applyTreemapLayout } from "./src/charts/Treemap/applyLayout.js";
|
|
24
|
+
export { geomapDef } from "./src/charts/Geomap/index.js";
|
|
25
|
+
export { matrixDef } from "./src/charts/Matrix/index.js";
|
|
26
|
+
export { networkDef } from "./src/charts/Network/index.js";
|
|
27
|
+
export { ringsDef } from "./src/charts/Rings/index.js";
|
|
28
|
+
export { sankeyDef } from "./src/charts/Sankey/index.js";
|
|
29
|
+
export { packDef } from "./src/charts/Pack/index.js";
|
|
30
|
+
export { pieDef } from "./src/charts/Pie/index.js";
|
|
31
|
+
export { priestleyDef } from "./src/charts/Priestley/index.js";
|
|
32
|
+
export { radarDef } from "./src/charts/Radar/index.js";
|
|
33
|
+
export { radialMatrixDef } from "./src/charts/RadialMatrix/index.js";
|
|
34
|
+
export { treeDef } from "./src/charts/Tree/index.js";
|
|
35
|
+
export { treemapDef } from "./src/charts/Treemap/index.js";
|
|
36
|
+
export { createFluent, installFluent } from "./src/fluent.js";
|
|
37
|
+
export { runStages } from "./src/charts/pipeline/stages.js";
|
|
38
|
+
export { runVizPipeline } from "./src/charts/pipeline/runVizPipeline.js";
|
|
39
|
+
export { resolveSpec } from "./src/charts/pipeline/resolveSpec.js";
|
|
40
|
+
export { vizDraw } from "./src/charts/pipeline/vizDraw.js";
|
|
41
|
+
export { vizDrawPure } from "./src/charts/pipeline/vizDrawPure.js";
|
|
42
|
+
export { vizPreDraw } from "./src/charts/pipeline/vizPreDraw.js";
|
|
43
|
+
export { vizPreDrawPure, vizPostThresholdCtx } from "./src/charts/pipeline/vizPreDrawPure.js";
|
|
44
|
+
export { plotEmit, plotPaint } from "./src/charts/features/plotPaint.js";
|
|
45
|
+
export { renderAxes } from "./src/charts/features/axes.js";
|
|
46
|
+
export { computeAxisLayout, measureAxis } from "./src/components/Axis/Axis.js";
|
|
47
|
+
export { backFeature, colorScaleFeature, legendFeature, runLayout, subtitleFeature, timelineFeature, titleFeature, totalFeature, } from "./src/charts/features/features.js";
|
|
48
|
+
export type { ResolvedSpec } from "./src/charts/pipeline/resolveSpec.js";
|
|
49
|
+
export type { VizContext } from "./src/charts/pipeline/vizContext.js";
|
|
50
|
+
export type { VizPreDrawResult } from "./src/charts/pipeline/vizPreDrawPure.js";
|
|
51
|
+
export type { PlotMeasureResult, PlotPaintContext } from "./src/charts/features/plotPaint.js";
|
|
52
|
+
export type { ShapeLike, VizLike } from "./src/charts/features/emitHelpers.js";
|
|
53
|
+
export type { VizInstance, VizRenderer } from "./src/charts/viz/vizTypes.js";
|
|
54
|
+
export type { AxisLayout, AxisLayoutResult } from "./src/components/Axis/Axis.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
AreaPlot — Plot with `baseline: 0`, `discrete: "x"`, `shape: "Area"`.
|
|
3
|
+
*/
|
|
4
|
+
import type { ChartDefinition } from "../definition/ChartDefinition.js";
|
|
5
|
+
export declare const areaPlotDef: ChartDefinition;
|
|
6
|
+
/**
|
|
7
|
+
Creates an area plot based on an array of data.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: new () => any;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
BarChart — Plot with `baseline: 0`, `discrete: "x"`, `shape: "Bar"`.
|
|
3
|
+
*/
|
|
4
|
+
import type { ChartDefinition } from "../definition/ChartDefinition.js";
|
|
5
|
+
export declare const barChartDef: ChartDefinition;
|
|
6
|
+
/**
|
|
7
|
+
Creates a bar chart based on an array of data.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: new () => any;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
BoxWhisker — Plot with `discrete: "x"`, `shape: "Box"`, plus a
|
|
3
|
+
tooltip-title accessor that walks through `__d3plus__` wrappers.
|
|
4
|
+
*/
|
|
5
|
+
import type { ChartDefinition } from "../definition/ChartDefinition.js";
|
|
6
|
+
export declare const boxWhiskerDef: ChartDefinition;
|
|
7
|
+
/**
|
|
8
|
+
Creates a simple box and whisker based on an array of data.
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: new () => any;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
BumpChart — Plot with `discrete: "x"`, `shape: "Line"`, and a
|
|
3
|
+
y2-mirroring configuration that draws labeled rank lines.
|
|
4
|
+
*/
|
|
5
|
+
import type { ChartDefinition } from "../definition/ChartDefinition.js";
|
|
6
|
+
export declare const bumpChartDef: ChartDefinition;
|
|
7
|
+
/**
|
|
8
|
+
Creates a bump chart based on an array of data.
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: new () => any;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
`ChartDefinition` — charts as *values*, not classes.
|
|
3
|
+
|
|
4
|
+
A chart in v4 is the def value `{name, fields?, ctx?, features, stages,
|
|
5
|
+
layoutStage?, emit, chartTransform?, setup?, thresholdFunction?}`. Each
|
|
6
|
+
chart's def lives next to its applyLayout + emit in `./<ChartName>/`;
|
|
7
|
+
`makeChart(def, Base?)` produces the chart class from the def.
|
|
8
|
+
*/
|
|
9
|
+
import type { SceneNode } from "@d3plus/render";
|
|
10
|
+
import type { FeatureModule } from "./features.js";
|
|
11
|
+
import type { TransformStage, VizContext } from "./stages.js";
|
|
12
|
+
import type { VizInstance } from "./vizTypes.js";
|
|
13
|
+
interface ChartDefinitionBase {
|
|
14
|
+
/** Stable name for tagging and class generation. */
|
|
15
|
+
name: string;
|
|
16
|
+
/** Chart-internal scratch seeded onto `viz.ctx.<key>` at construction. */
|
|
17
|
+
ctx?: Record<string, unknown>;
|
|
18
|
+
/**
|
|
19
|
+
Scalar defaults seeded onto `viz._<key>` at construction. Defs that
|
|
20
|
+
need instance slots keep them here; user-facing values otherwise go
|
|
21
|
+
in `fields[].default` and chart-internal scratch in `ctx`.
|
|
22
|
+
*/
|
|
23
|
+
defaults?: Record<string, unknown>;
|
|
24
|
+
/** Fluent accessor declarations; `makeChart` installs each as `viz.<key>()`. */
|
|
25
|
+
fields?: import("../fluent.js").ConfigField[];
|
|
26
|
+
/** Chart-level features composed in; order is layout order. */
|
|
27
|
+
features: FeatureModule[];
|
|
28
|
+
/**
|
|
29
|
+
Chart-specific layout stage run in `_draw` after the shared chart-shell
|
|
30
|
+
prep (`vizPreDrawPure`). If absent, `makeChart` doesn't invoke
|
|
31
|
+
`runChartDraw` — the chart relies on its parent's `_draw` only.
|
|
32
|
+
*/
|
|
33
|
+
layoutStage?: TransformStage;
|
|
34
|
+
/** Optional pure threshold algorithm (replaces `Viz._thresholdFunction`). */
|
|
35
|
+
thresholdFunction?: (viz: VizInstance, data: unknown[]) => unknown[];
|
|
36
|
+
/**
|
|
37
|
+
Optional chart-specific `_chartTransform` builder. Receives the viz
|
|
38
|
+
after the layout stage runs; returns the transform applied to the
|
|
39
|
+
chart scene. Default: margin-origin translation.
|
|
40
|
+
*/
|
|
41
|
+
chartTransform?: (viz: VizInstance) => import("@d3plus/render").Transform | undefined;
|
|
42
|
+
/**
|
|
43
|
+
Imperative per-instance setup hook — runs once after `applyDefinition`
|
|
44
|
+
seeds the chart. Use for event handler overrides and shadowed methods
|
|
45
|
+
that don't fit the declarative `fields`/`ctx` surface.
|
|
46
|
+
*/
|
|
47
|
+
setup?: (viz: VizInstance) => void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
A data-driven chart's emit: a pure function from a chart context (with
|
|
51
|
+
optional laid-out `shapeData`) to the scene nodes for one frame.
|
|
52
|
+
*/
|
|
53
|
+
export type ChartEmit = (ctx: VizContext & {
|
|
54
|
+
shapeData?: any[];
|
|
55
|
+
}) => SceneNode[];
|
|
56
|
+
/** Data-driven chart: `emit(ctx)` produces the scene nodes. */
|
|
57
|
+
export interface DataDrivenChartDefinition extends ChartDefinitionBase {
|
|
58
|
+
paintDriven?: false;
|
|
59
|
+
emit: ChartEmit;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
Paint-driven chart: `Plot._paint` populates `viz._chartScene` by calling
|
|
63
|
+
`plotPaint`, which builds the scene from the paint context assembled in
|
|
64
|
+
`drawPlot`. There is no `emit` step — `runChartDraw` refuses to drive
|
|
65
|
+
paint-driven defs (see runChartDraw.ts), so the scene is produced entirely
|
|
66
|
+
inside the Plot draw flow.
|
|
67
|
+
*/
|
|
68
|
+
export interface PaintDrivenChartDefinition extends ChartDefinitionBase {
|
|
69
|
+
paintDriven: true;
|
|
70
|
+
}
|
|
71
|
+
/** Discriminated union; use `isPaintDriven` to narrow. */
|
|
72
|
+
export type ChartDefinition = DataDrivenChartDefinition | PaintDrivenChartDefinition;
|
|
73
|
+
/** Type guard for the paint-driven variant. */
|
|
74
|
+
export declare function isPaintDriven(def: ChartDefinition): def is PaintDrivenChartDefinition;
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Donut — Pie with a centered inner radius.
|
|
3
|
+
|
|
4
|
+
Extends Pie; inherits its layout stage + emit. Only the inner-radius
|
|
5
|
+
closure and the default arc gap (`padPixel`) differ.
|
|
6
|
+
*/
|
|
7
|
+
import type { ChartDefinition } from "../definition/ChartDefinition.js";
|
|
8
|
+
export declare const donutDef: ChartDefinition;
|
|
9
|
+
/**
|
|
10
|
+
Extends the Pie visualization to create a donut chart.
|
|
11
|
+
*/
|
|
12
|
+
declare const _default: new () => any;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
`applyGeomapLayout` — Geomap's chart-specific layout stage. Runs
|
|
3
|
+
topojson → feature conversion + filter, builds the d3-geo path
|
|
4
|
+
generator, fits the projection, and stashes `geomapCtx` on `viz.ctx`.
|
|
5
|
+
*/
|
|
6
|
+
import type { TransformStage } from "../pipeline/stages.js";
|
|
7
|
+
export declare const applyGeomapLayout: TransformStage;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
`geomapEmit` — country Paths + point Circles using `geomapCtx`
|
|
3
|
+
stashed on `viz.ctx`. Emits flat SceneNodes directly (no transient
|
|
4
|
+
Shape compute pass).
|
|
5
|
+
*/
|
|
6
|
+
import type { ChartEmit } from "../definition/ChartDefinition.js";
|
|
7
|
+
export declare const geomapEmit: ChartEmit;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Geomap — d3-geo projection + tile rendering + topojson paths.
|
|
3
|
+
|
|
4
|
+
Implementation files in this folder:
|
|
5
|
+
- `applyLayout.ts` — topojson + projection + path/point compute.
|
|
6
|
+
- `emit.ts` — country Paths + point Circles.
|
|
7
|
+
*/
|
|
8
|
+
import type { ChartDefinition } from "../definition/ChartDefinition.js";
|
|
9
|
+
export declare const geomapDef: ChartDefinition;
|
|
10
|
+
/**
|
|
11
|
+
Creates a geographical map with zooming, panning, image tiles, and the ability to layer choropleth paths and coordinate points.
|
|
12
|
+
*/
|
|
13
|
+
declare const _default: new () => any;
|
|
14
|
+
export default _default;
|
|
@@ -18,6 +18,12 @@ export default class Geomap extends Viz {
|
|
|
18
18
|
_renderTiles(transform?: ReturnType<typeof zoomTransform>, duration?: number): void;
|
|
19
19
|
/**
|
|
20
20
|
Extends the draw behavior of the abstract Viz class.
|
|
21
|
+
|
|
22
|
+
DOM mount (svg container, ocean rect, tileGroup, zoomGroup) + zoom
|
|
23
|
+
behavior extent stay here — they're lifecycle, not layout. The actual
|
|
24
|
+
projection / fit-extent / per-feature path + point computation runs as
|
|
25
|
+
`applyGeomapLayout` on `geomapDef.stages` and writes `_geomapCtx`
|
|
26
|
+
back onto the viz, which `geomapDef.emit` consumes.
|
|
21
27
|
@private
|
|
22
28
|
*/
|
|
23
29
|
_draw(callback?: () => void): this;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
LinePlot — Plot with `discrete: "x"`, `shape: "Line"`.
|
|
3
|
+
*/
|
|
4
|
+
import type { ChartDefinition } from "../definition/ChartDefinition.js";
|
|
5
|
+
export declare const linePlotDef: ChartDefinition;
|
|
6
|
+
/**
|
|
7
|
+
Creates a line plot based on an array of data.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: new () => any;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
`applyMatrixLayout` — Matrix's chart-specific layout stage.
|
|
3
|
+
|
|
4
|
+
Two-pass axis layout: measure-only pass for padding, then compute-mode
|
|
5
|
+
render that absorbs row/column axis scenes into `_chartScene`. Stashes
|
|
6
|
+
`columnScale`/`rowScale`/`cellWidth`/`cellHeight` on `viz.ctx`.
|
|
7
|
+
*/
|
|
8
|
+
import type { TransformStage } from "../pipeline/stages.js";
|
|
9
|
+
export declare const applyMatrixLayout: TransformStage;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Matrix — row × column grid of cells.
|
|
3
|
+
|
|
4
|
+
Implementation files in this folder:
|
|
5
|
+
- `applyLayout.ts` — `TransformStage` that runs the row+column axes.
|
|
6
|
+
- `emit.ts` — Rect cells positioned by the stashed scales.
|
|
7
|
+
*/
|
|
8
|
+
import type { ChartDefinition } from "../definition/ChartDefinition.js";
|
|
9
|
+
export declare const matrixDef: ChartDefinition;
|
|
10
|
+
/**
|
|
11
|
+
Creates a simple rows/columns Matrix view of any dataset.
|
|
12
|
+
*/
|
|
13
|
+
declare const _default: new () => any;
|
|
14
|
+
export default _default;
|
|
@@ -32,19 +32,6 @@ export default class Matrix extends Viz {
|
|
|
32
32
|
A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the column labels.
|
|
33
33
|
*/
|
|
34
34
|
columnConfig(_?: Record<string, unknown>): this | Record<string, unknown>;
|
|
35
|
-
/**
|
|
36
|
-
A manual list of IDs to be used for columns.
|
|
37
|
-
*/
|
|
38
|
-
columnList(_?: DataPoint[keyof DataPoint][]): this | DataPoint[keyof DataPoint][];
|
|
39
|
-
/**
|
|
40
|
-
A sort comparator function that is run on the unique set of column values.
|
|
41
|
-
|
|
42
|
-
@example
|
|
43
|
-
function column(a, b) {
|
|
44
|
-
return a.localeCompare(b);
|
|
45
|
-
}
|
|
46
|
-
*/
|
|
47
|
-
columnSort(_?: (...args: unknown[]) => unknown): this | ((...args: unknown[]) => unknown);
|
|
48
35
|
/**
|
|
49
36
|
Determines which key in your data should be used for each row in the matrix. Can be either a String that matches a key used in every data point, or an accessor function that receives a data point and it's index in the data array, and is expected to return it's row value.
|
|
50
37
|
|
|
@@ -58,17 +45,4 @@ export default class Matrix extends Viz {
|
|
|
58
45
|
A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the row labels.
|
|
59
46
|
*/
|
|
60
47
|
rowConfig(_?: Record<string, unknown>): this | Record<string, unknown>;
|
|
61
|
-
/**
|
|
62
|
-
A manual list of IDs to be used for rows.
|
|
63
|
-
*/
|
|
64
|
-
rowList(_?: DataPoint[keyof DataPoint][]): this | DataPoint[keyof DataPoint][];
|
|
65
|
-
/**
|
|
66
|
-
A sort comparator function that is run on the unique set of row values.
|
|
67
|
-
|
|
68
|
-
@example
|
|
69
|
-
function row(a, b) {
|
|
70
|
-
return a.localeCompare(b);
|
|
71
|
-
}
|
|
72
|
-
*/
|
|
73
|
-
rowSort(_?: (...args: unknown[]) => unknown): this | ((...args: unknown[]) => unknown);
|
|
74
48
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
`applyNetworkLayout` — Network's chart-specific layout stage.
|
|
3
|
+
|
|
4
|
+
Resolves nodes + links into a single laid-out node array (running a
|
|
5
|
+
d3-force simulation only when fx/fy coords are missing), normalizes
|
|
6
|
+
link stroke sizes, and stashes `networkCtx` + node/link lookups on
|
|
7
|
+
`viz.ctx` for the click/hover handlers installed by `setup`.
|
|
8
|
+
*/
|
|
9
|
+
import type { TransformStage } from "../pipeline/stages.js";
|
|
10
|
+
export declare const applyNetworkLayout: TransformStage;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChartDefinition } from "../definition/ChartDefinition.js";
|
|
2
|
+
export declare const networkDef: ChartDefinition;
|
|
3
|
+
/**
|
|
4
|
+
Creates a network visualization based on a defined set of nodes and edges.
|
|
5
|
+
*/
|
|
6
|
+
declare const _default: new () => any;
|
|
7
|
+
export default _default;
|
|
@@ -28,18 +28,6 @@ export default class Network extends Viz {
|
|
|
28
28
|
@param f Array of link objects or a URL to load links from.
|
|
29
29
|
*/
|
|
30
30
|
links(_: any, f?: any): any;
|
|
31
|
-
/**
|
|
32
|
-
Defines the thickness of the links connecting each node. The value provided can be either a pixel Number to be used for all links, or an accessor function that returns a specific data value to be used in an automatically calculated linear scale.
|
|
33
|
-
*/
|
|
34
|
-
linkSize(_?: any): any;
|
|
35
|
-
/**
|
|
36
|
-
Defines the minimum pixel stroke width used in link sizing.
|
|
37
|
-
*/
|
|
38
|
-
linkSizeMin(_?: any): any;
|
|
39
|
-
/**
|
|
40
|
-
The type of [continuous d3-scale](https://github.com/d3/d3-scale#continuous-scales) used when calculating the pixel size of links in the network.
|
|
41
|
-
*/
|
|
42
|
-
linkSizeScale(_?: any): any;
|
|
43
31
|
/**
|
|
44
32
|
The node group accessor(s). This method overrides the default .groupBy() function from being used with the data passed to .nodes().
|
|
45
33
|
*/
|
|
@@ -55,18 +43,6 @@ export default class Network extends Viz {
|
|
|
55
43
|
The size accessor for each node in the network.
|
|
56
44
|
*/
|
|
57
45
|
size(_?: any): any;
|
|
58
|
-
/**
|
|
59
|
-
Defines the maximum pixel radius used in size scaling. By default, the maximum size is determined by half the distance of the two closest nodes.
|
|
60
|
-
*/
|
|
61
|
-
sizeMax(_?: any): any;
|
|
62
|
-
/**
|
|
63
|
-
Defines the minimum pixel radius used in size scaling.
|
|
64
|
-
*/
|
|
65
|
-
sizeMin(_?: any): any;
|
|
66
|
-
/**
|
|
67
|
-
The type of [continuous d3-scale](https://github.com/d3/d3-scale#continuous-scales) used when calculating the pixel size of nodes in the network.
|
|
68
|
-
*/
|
|
69
|
-
sizeScale(_?: any): any;
|
|
70
46
|
/**
|
|
71
47
|
The x position accessor for each node. The data passed to .data() takes priority over the .nodes() data array. By default, the x and y positions are determined dynamically based on default force layout properties.
|
|
72
48
|
*/
|