@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,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
`emitLabels(opts)` — pure label scene emitter.
|
|
3
|
+
|
|
4
|
+
Given the same inputs a Shape would consume (data + per-datum x/y/width/
|
|
5
|
+
height/label/labelBounds accessors + labelConfig), returns the array of
|
|
6
|
+
text SceneNodes a chart's `emit()` would otherwise harvest by spinning up
|
|
7
|
+
a transient Shape in compute mode. Composes `buildLabelData` (pure label
|
|
8
|
+
record expansion) with `TextBox.toScene()` (pure scene-node production).
|
|
9
|
+
*/
|
|
10
|
+
import type { BuildLabelDataOpts } from "./buildLabelData.js";
|
|
11
|
+
import type { SceneNode } from "@d3plus/render";
|
|
12
|
+
export interface EmitLabelsOpts extends BuildLabelDataOpts {
|
|
13
|
+
/** TextBox config overrides (merged on top of Shape-equivalent defaults). */
|
|
14
|
+
labelConfig?: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export declare function emitLabels(opts: EmitLabelsOpts): SceneNode[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DataPoint } from "@d3plus/data";
|
|
2
|
+
import type { SceneNode, Transform } from "@d3plus/render";
|
|
3
|
+
type HitArea = ((d: DataPoint, i: number, aes: unknown) => Record<string, unknown>) | Record<string, unknown> | undefined;
|
|
4
|
+
/**
|
|
5
|
+
Builds the invisible, interactive "hit area" rect for a shape datum — a
|
|
6
|
+
transparent box that can extend past the shape's own geometry (e.g. a legend
|
|
7
|
+
swatch reaching across the padding to its label) so the space between them
|
|
8
|
+
stays one continuous hover target instead of firing mouseleave/mouseenter as
|
|
9
|
+
the pointer crosses the gap. Carries the shape's `datum` (so pointer handlers
|
|
10
|
+
treat it as the same item, and the `mouseleave` same-datum suppressor bridges
|
|
11
|
+
the swatch↔hit-area crossing) but a DISTINCT `key`: the hit-area and the
|
|
12
|
+
visible geometry are siblings, and the SVG keyed join can't hold two nodes
|
|
13
|
+
under one key — sharing it made the geometry re-enter (collapse→grow) on every
|
|
14
|
+
redraw (a "pulse" on e.g. every timeline step). Returns null when no
|
|
15
|
+
rect-style hitArea is configured; Line's path-style hitArea is covered by its
|
|
16
|
+
own geometry.
|
|
17
|
+
*/
|
|
18
|
+
export declare function hitAreaNode(hitArea: HitArea, d: DataPoint, i: number, aes: unknown, key: string | number, datum: DataPoint, name: string, transform: Transform): SceneNode | null;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DataPoint } from "@d3plus/data";
|
|
2
|
+
import type { SceneNode } from "@d3plus/render";
|
|
3
|
+
import type Image from "./Image.js";
|
|
4
|
+
/**
|
|
5
|
+
Ranks `data` by a `sort` layering comparator WITHOUT reordering it. Returns
|
|
6
|
+
`rank[i]` = the paint position of datum `i` (lower = painted first = behind),
|
|
7
|
+
which callers stamp onto each node's `z`; the render backends sort every
|
|
8
|
+
group's children ascending by `z` (stably). Returns null when there is no
|
|
9
|
+
comparator or nothing to reorder, so callers emit no `z` and the fast
|
|
10
|
+
append-order path is preserved.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sortRanks(data: DataPoint[], sortFn: ((a: DataPoint, b: DataPoint) => number) | null | undefined): number[] | null;
|
|
13
|
+
/**
|
|
14
|
+
Renders the per-datum background images collected during `Shape.toScene` as
|
|
15
|
+
flat sibling nodes. When `rank` is set (a `sort` comparator is active) every
|
|
16
|
+
returned node needs a `z` — otherwise the backend sort would collapse the
|
|
17
|
+
images to 0 and interleave them among the geometry — so they are placed
|
|
18
|
+
above all geometry (ranks span `0..dataLen-1`) while keeping their own order.
|
|
19
|
+
*/
|
|
20
|
+
export declare function emitBackgroundImages(bgClass: Image, imageData: DataPoint[], rank: number[] | null, dataLen: number): SceneNode[];
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Per-shape config types.
|
|
3
|
+
|
|
4
|
+
Every `Shape` subclass exposes a `.config(c)` method that accepts a
|
|
5
|
+
plain object whose keys match the class's accessor methods. The
|
|
6
|
+
interfaces below enumerate those keys + their types so users (and
|
|
7
|
+
chart-internal code) get autocomplete + compile-time validation
|
|
8
|
+
instead of `Record<string, unknown>` everywhere.
|
|
9
|
+
|
|
10
|
+
Pattern:
|
|
11
|
+
- `BaseShapeConfig` holds the ~40 keys every shape inherits from
|
|
12
|
+
`Shape` (fill, stroke, opacity, hover, label, etc.).
|
|
13
|
+
- Each shape adds its own keys via interface extension
|
|
14
|
+
(RectConfig adds width/height; CircleConfig adds r; etc.).
|
|
15
|
+
- The discriminated union `AnyShapeConfig` is what callers
|
|
16
|
+
composing a transient config object can use.
|
|
17
|
+
|
|
18
|
+
These types are **declarative** — they don't change runtime behavior.
|
|
19
|
+
Existing chart code that passes `Record<string, unknown>` still
|
|
20
|
+
works (TypeScript allows a Record where a Partial<Interface> is
|
|
21
|
+
expected if the keys overlap). The win is types AT THE BOUNDARY
|
|
22
|
+
for new code and editor autocomplete on existing call sites.
|
|
23
|
+
|
|
24
|
+
@module
|
|
25
|
+
*/
|
|
26
|
+
import type { DataPoint } from "@d3plus/data";
|
|
27
|
+
import type { AccessorFn } from "../utils/index.js";
|
|
28
|
+
/**
|
|
29
|
+
A value that can either be a function (called per-datum) or a literal
|
|
30
|
+
that wraps as `constant(_)`. Mirrors the runtime "const" coerce.
|
|
31
|
+
*/
|
|
32
|
+
export type ConstOrAccessor<T = unknown> = T | AccessorFn;
|
|
33
|
+
/**
|
|
34
|
+
A value that can be a function, a string key (wrapped in `accessor`),
|
|
35
|
+
or a literal (wrapped in `constant`). Mirrors the "accessor" coerce.
|
|
36
|
+
*/
|
|
37
|
+
export type StringOrAccessor<T = unknown> = T | string | AccessorFn;
|
|
38
|
+
/**
|
|
39
|
+
Common props inherited from `Shape` — every shape subclass accepts
|
|
40
|
+
these via `.config(...)` regardless of geometry.
|
|
41
|
+
*/
|
|
42
|
+
export interface BaseShapeConfig {
|
|
43
|
+
/** Data array driving the shape. */
|
|
44
|
+
data?: DataPoint[];
|
|
45
|
+
/** Predicate or null marking which data points are currently active. */
|
|
46
|
+
active?: ((d: DataPoint, i: number) => boolean) | null;
|
|
47
|
+
/** Opacity applied to non-active data points (default ~0.25). */
|
|
48
|
+
activeOpacity?: number;
|
|
49
|
+
/** Style overrides for active data points. */
|
|
50
|
+
activeStyle?: Record<string, unknown>;
|
|
51
|
+
/** ARIA label per datum (accessibility). */
|
|
52
|
+
ariaLabel?: ConstOrAccessor<string>;
|
|
53
|
+
/** Optional background image per datum (url or accessor returning a url). */
|
|
54
|
+
backgroundImage?: ConstOrAccessor<string>;
|
|
55
|
+
/** Discrete-axis key ("x" | "y") for charts that flip layout per axis. */
|
|
56
|
+
discrete?: "x" | "y";
|
|
57
|
+
/** Animation duration in ms. */
|
|
58
|
+
duration?: number;
|
|
59
|
+
/** Fill color or accessor returning one. */
|
|
60
|
+
fill?: ConstOrAccessor<string>;
|
|
61
|
+
/** Fill opacity (0..1). */
|
|
62
|
+
fillOpacity?: ConstOrAccessor<number>;
|
|
63
|
+
/** Predicate or null marking which data points are currently hovered. */
|
|
64
|
+
hover?: ((d: DataPoint, i: number) => boolean) | null;
|
|
65
|
+
/** Opacity applied to non-hovered data points. */
|
|
66
|
+
hoverOpacity?: number;
|
|
67
|
+
/** Style overrides for hovered data points. */
|
|
68
|
+
hoverStyle?: Record<string, unknown>;
|
|
69
|
+
/** Hit-area shape: function returning bounds or static bounds. */
|
|
70
|
+
hitArea?: ((d: DataPoint, i: number, aes: unknown) => Record<string, unknown>) | Record<string, unknown>;
|
|
71
|
+
/** Unique-id accessor per datum (used for keyed enter/update/exit). */
|
|
72
|
+
id?: AccessorFn;
|
|
73
|
+
/** Label text(s) per datum. False/undefined skips. */
|
|
74
|
+
label?: ConstOrAccessor<string | string[] | false>;
|
|
75
|
+
/** Label-bounds accessor (where to mount the label). */
|
|
76
|
+
labelBounds?: ((d: DataPoint, i: number, aes: unknown) => Record<string, unknown> | Record<string, unknown>[]) | Record<string, unknown>;
|
|
77
|
+
/** Label TextBox config (font, padding, etc.). */
|
|
78
|
+
labelConfig?: Record<string, unknown>;
|
|
79
|
+
/** Overall opacity (0..1). */
|
|
80
|
+
opacity?: ConstOrAccessor<number>;
|
|
81
|
+
/** SVG `pointer-events` attribute per datum. */
|
|
82
|
+
pointerEvents?: ConstOrAccessor<string>;
|
|
83
|
+
/** ARIA role per datum (accessibility). */
|
|
84
|
+
role?: ConstOrAccessor<string>;
|
|
85
|
+
/** Rotation in degrees per datum. */
|
|
86
|
+
rotate?: ConstOrAccessor<number>;
|
|
87
|
+
/** SVG `rx` (rect rounded-corner x) — applies to Rect/Bar. */
|
|
88
|
+
rx?: ConstOrAccessor<number>;
|
|
89
|
+
/** SVG `ry` (rect rounded-corner y) — applies to Rect/Bar. */
|
|
90
|
+
ry?: ConstOrAccessor<number>;
|
|
91
|
+
/** Scale factor (1 = identity). */
|
|
92
|
+
scale?: ConstOrAccessor<number>;
|
|
93
|
+
/** "full" runs the DOM enter/update/exit; "compute" skips DOM. */
|
|
94
|
+
renderMode?: "full" | "compute";
|
|
95
|
+
/** Where to mount the shape's DOM (CSS selector, element, or null). */
|
|
96
|
+
select?: string | HTMLElement | SVGElement | null;
|
|
97
|
+
/** SVG `shape-rendering` attribute per datum. */
|
|
98
|
+
shapeRendering?: ConstOrAccessor<string>;
|
|
99
|
+
/** d3-style sort comparator. */
|
|
100
|
+
sort?: ((a: DataPoint, b: DataPoint) => number) | null;
|
|
101
|
+
/** Stroke color. */
|
|
102
|
+
stroke?: ConstOrAccessor<string>;
|
|
103
|
+
/** SVG `stroke-dasharray`. */
|
|
104
|
+
strokeDasharray?: ConstOrAccessor<string>;
|
|
105
|
+
/** SVG `stroke-linecap`. */
|
|
106
|
+
strokeLinecap?: ConstOrAccessor<string>;
|
|
107
|
+
/** SVG `stroke-opacity`. */
|
|
108
|
+
strokeOpacity?: ConstOrAccessor<number>;
|
|
109
|
+
/** Stroke width in pixels. */
|
|
110
|
+
strokeWidth?: ConstOrAccessor<number>;
|
|
111
|
+
/** SVG `text-anchor` for labels. */
|
|
112
|
+
textAnchor?: ConstOrAccessor<string>;
|
|
113
|
+
/** Texture (per textures.js) — name string or full config. */
|
|
114
|
+
texture?: ConstOrAccessor<string | Record<string, unknown>>;
|
|
115
|
+
/** Default texture config merged into the per-datum texture. */
|
|
116
|
+
textureDefault?: Record<string, unknown>;
|
|
117
|
+
/** SVG `vector-effect` (e.g. "non-scaling-stroke"). */
|
|
118
|
+
vectorEffect?: ConstOrAccessor<string>;
|
|
119
|
+
/** Label vertical-align ("top"/"middle"/"bottom"). */
|
|
120
|
+
verticalAlign?: ConstOrAccessor<string>;
|
|
121
|
+
/** X position. */
|
|
122
|
+
x?: ConstOrAccessor<number>;
|
|
123
|
+
/** Y position. */
|
|
124
|
+
y?: ConstOrAccessor<number>;
|
|
125
|
+
/** Event handlers (Object.<event, handler>). */
|
|
126
|
+
on?: Record<string, (...args: unknown[]) => unknown>;
|
|
127
|
+
[key: string]: unknown;
|
|
128
|
+
}
|
|
129
|
+
/** Rect-specific config (width + height on top of base). */
|
|
130
|
+
export interface RectConfig extends BaseShapeConfig {
|
|
131
|
+
width?: ConstOrAccessor<number>;
|
|
132
|
+
height?: ConstOrAccessor<number>;
|
|
133
|
+
/** Sweep a tapering motion trail behind the rect as it moves between frames. */
|
|
134
|
+
trail?: boolean;
|
|
135
|
+
/** Steps of trail history to keep (number), or `true` for a long fading tail. */
|
|
136
|
+
trailPersist?: number | boolean;
|
|
137
|
+
}
|
|
138
|
+
/** Circle-specific config (radius). */
|
|
139
|
+
export interface CircleConfig extends BaseShapeConfig {
|
|
140
|
+
r?: ConstOrAccessor<number>;
|
|
141
|
+
/** Sweep a tapering motion trail behind the point as it moves between frames. */
|
|
142
|
+
trail?: boolean;
|
|
143
|
+
/** Steps of trail history to keep (number), or `true` for a long fading tail. */
|
|
144
|
+
trailPersist?: number | boolean;
|
|
145
|
+
}
|
|
146
|
+
/** Line-specific config (curve + defined). */
|
|
147
|
+
export interface LineConfig extends BaseShapeConfig {
|
|
148
|
+
curve?: ConstOrAccessor<string>;
|
|
149
|
+
defined?: AccessorFn;
|
|
150
|
+
}
|
|
151
|
+
/** Area-specific config (curve, defined, dual-edge x/y). */
|
|
152
|
+
export interface AreaConfig extends BaseShapeConfig {
|
|
153
|
+
curve?: ConstOrAccessor<string>;
|
|
154
|
+
/** Determines whether a data point is defined (a gap in the area when false). */
|
|
155
|
+
defined?: (d: DataPoint) => boolean;
|
|
156
|
+
x0?: ConstOrAccessor<number>;
|
|
157
|
+
x1?: ConstOrAccessor<number> | null;
|
|
158
|
+
y0?: ConstOrAccessor<number>;
|
|
159
|
+
y1?: ConstOrAccessor<number> | null;
|
|
160
|
+
}
|
|
161
|
+
/** Path-specific config (raw SVG path d string or generator). */
|
|
162
|
+
export interface PathConfig extends BaseShapeConfig {
|
|
163
|
+
d?: ConstOrAccessor<string>;
|
|
164
|
+
}
|
|
165
|
+
/** Bar-specific config (Rect + start/end coords). */
|
|
166
|
+
export interface BarConfig extends RectConfig {
|
|
167
|
+
x0?: ConstOrAccessor<number>;
|
|
168
|
+
x1?: ConstOrAccessor<number> | null;
|
|
169
|
+
y0?: ConstOrAccessor<number>;
|
|
170
|
+
y1?: ConstOrAccessor<number> | null;
|
|
171
|
+
}
|
|
172
|
+
/** Image-specific config (url + dimensions). */
|
|
173
|
+
export interface ImageConfig {
|
|
174
|
+
data?: DataPoint[];
|
|
175
|
+
duration?: number;
|
|
176
|
+
height?: ConstOrAccessor<number>;
|
|
177
|
+
id?: AccessorFn;
|
|
178
|
+
opacity?: ConstOrAccessor<number>;
|
|
179
|
+
pointerEvents?: ConstOrAccessor<string>;
|
|
180
|
+
select?: string | HTMLElement | SVGElement | null;
|
|
181
|
+
/** URL accessor returning the image src. */
|
|
182
|
+
url?: AccessorFn;
|
|
183
|
+
width?: ConstOrAccessor<number>;
|
|
184
|
+
x?: ConstOrAccessor<number>;
|
|
185
|
+
y?: ConstOrAccessor<number>;
|
|
186
|
+
}
|
|
187
|
+
/** Box-specific config (whisker + median + outliers; subset of Shape). */
|
|
188
|
+
export interface BoxConfig {
|
|
189
|
+
data?: DataPoint[];
|
|
190
|
+
medianConfig?: Record<string, unknown>;
|
|
191
|
+
/** Orientation: "vertical" or "horizontal". */
|
|
192
|
+
orient?: ConstOrAccessor<string>;
|
|
193
|
+
/** Outlier accessor (per-datum predicate). */
|
|
194
|
+
outlier?: ConstOrAccessor<string>;
|
|
195
|
+
outlierConfig?: Record<string, unknown>;
|
|
196
|
+
rectConfig?: Record<string, unknown>;
|
|
197
|
+
rectWidth?: ConstOrAccessor<number>;
|
|
198
|
+
select?: string | HTMLElement | SVGElement | null;
|
|
199
|
+
whiskerConfig?: Record<string, unknown>;
|
|
200
|
+
/** Whisker mode: single mode string/number or [low, high] pair. */
|
|
201
|
+
whiskerMode?: (string | number)[] | string | number;
|
|
202
|
+
x?: ConstOrAccessor<number>;
|
|
203
|
+
y?: ConstOrAccessor<number>;
|
|
204
|
+
[key: string]: unknown;
|
|
205
|
+
}
|
|
206
|
+
/** Whisker-specific config. */
|
|
207
|
+
export interface WhiskerConfig {
|
|
208
|
+
data?: DataPoint[];
|
|
209
|
+
/** End-cap shape name (e.g. "Rect"). */
|
|
210
|
+
endpoint?: ConstOrAccessor<string>;
|
|
211
|
+
endpointConfig?: Record<string, unknown>;
|
|
212
|
+
/** Whisker length in pixels. */
|
|
213
|
+
length?: ConstOrAccessor<number>;
|
|
214
|
+
lineConfig?: Record<string, unknown>;
|
|
215
|
+
orient?: ConstOrAccessor<string>;
|
|
216
|
+
select?: string | HTMLElement | SVGElement | null;
|
|
217
|
+
x?: ConstOrAccessor<number>;
|
|
218
|
+
y?: ConstOrAccessor<number>;
|
|
219
|
+
[key: string]: unknown;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
Union of every shape config — useful for code that composes
|
|
223
|
+
transient configs at runtime without knowing the shape ahead of
|
|
224
|
+
time (Plot's `shapeConfig`, axis decorators, etc.).
|
|
225
|
+
*/
|
|
226
|
+
export type AnyShapeConfig = BaseShapeConfig | RectConfig | CircleConfig | LineConfig | AreaConfig | PathConfig | BarConfig | ImageConfig | BoxConfig | WhiskerConfig;
|
|
@@ -3,13 +3,19 @@ import type { D3plusConfig } from "./D3plusConfig.js";
|
|
|
3
3
|
Provides shared configuration, event handling, and locale management inherited by all d3plus classes.
|
|
4
4
|
*/
|
|
5
5
|
export default class BaseClass {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/**
|
|
7
|
+
Post-coercion fluent storage (`.sum(...)`, `.x(...)`, …). `any` is
|
|
8
|
+
deliberate and load-bearing: `installFluent` coerces accessor/const
|
|
9
|
+
fields into functions, so call sites invoke `schema.fill(d, i)` and
|
|
10
|
+
index `schema.groupBy[i]`. It is NOT `D3plusConfig` (that describes
|
|
11
|
+
the pre-coercion user input). Typing it as a coerced `ResolvedSchema`
|
|
12
|
+
interface is the only way to drop the `any`; until then it stays.
|
|
13
|
+
*/
|
|
14
|
+
schema: Record<string, any>;
|
|
15
|
+
/** Chart-internal scratch (d3 layout instances, computed derived state). */
|
|
16
|
+
ctx: Record<string, unknown>;
|
|
10
17
|
_uuid: string;
|
|
11
18
|
_configDefault?: D3plusConfig;
|
|
12
|
-
_shapeConfig?: D3plusConfig;
|
|
13
19
|
/**
|
|
14
20
|
Invoked when creating a new class instance, and sets any default parameters.
|
|
15
21
|
@private
|
|
@@ -56,8 +62,8 @@ export default class BaseClass {
|
|
|
56
62
|
/**
|
|
57
63
|
Parent config used by the wrapper.
|
|
58
64
|
*/
|
|
59
|
-
parent():
|
|
60
|
-
parent(_:
|
|
65
|
+
parent(): unknown;
|
|
66
|
+
parent(_: unknown): this;
|
|
61
67
|
/**
|
|
62
68
|
Defines how informational text strings should be displayed. By default, this function will try to find the string in question (which is the first argument provided to this function) inside of an internally managed translation Object. If you'd like to override to use custom text, simply pass this method your own custom formatting function.
|
|
63
69
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Structural type for the d3 scales d3plus builds dynamically via
|
|
3
|
+
`scales[name]()`. A single field (`Axis._d3Scale`, `ColorScale._colorScale`,
|
|
4
|
+
a plot buffer scale) can hold a linear / log / time / band / point /
|
|
5
|
+
ordinal / threshold scale, whose concrete generic signatures are mutually
|
|
6
|
+
incompatible (`domain()` takes `number[]` vs `string[]` vs `Date[]`). This
|
|
7
|
+
captures the shared call surface instead, with scale-specific methods marked
|
|
8
|
+
optional — guard (`if (scale.ticks)`) before calling them.
|
|
9
|
+
|
|
10
|
+
`Out` is the scale's output: pixel positions (`number`) for axes and plot
|
|
11
|
+
buffers, color strings for color scales.
|
|
12
|
+
|
|
13
|
+
@module
|
|
14
|
+
*/
|
|
15
|
+
export interface D3Scale<Out = number> {
|
|
16
|
+
/** Maps a domain value to its output (pixel position or color). */
|
|
17
|
+
(value: number | string | Date): Out;
|
|
18
|
+
/** Current domain. */
|
|
19
|
+
domain(): unknown[];
|
|
20
|
+
/** Sets the domain. */
|
|
21
|
+
domain(domain: Iterable<number | string | Date>): D3Scale<Out>;
|
|
22
|
+
/** Current range. */
|
|
23
|
+
range(): Out[];
|
|
24
|
+
/** Sets the range. */
|
|
25
|
+
range(range: Iterable<Out>): D3Scale<Out>;
|
|
26
|
+
/** Returns an independent copy of the scale. */
|
|
27
|
+
copy(): D3Scale<Out>;
|
|
28
|
+
/** Continuous scales only: representative tick values. */
|
|
29
|
+
ticks?(count?: number): number[];
|
|
30
|
+
/** Continuous scales only: inverts an output value back to the domain. */
|
|
31
|
+
invert?(value: number): number;
|
|
32
|
+
/** Continuous scales only: get/set output clamping. */
|
|
33
|
+
clamp?(): boolean;
|
|
34
|
+
clamp?(clamp: boolean): D3Scale<Out>;
|
|
35
|
+
/** Band / point scales only: width of one band. */
|
|
36
|
+
bandwidth?(): number;
|
|
37
|
+
/** Band / point scales only: distance between band starts. */
|
|
38
|
+
step?(): number;
|
|
39
|
+
/** Band / point scales only: get/set padding. */
|
|
40
|
+
padding?(): number;
|
|
41
|
+
padding?(padding: number): D3Scale<Out>;
|
|
42
|
+
/** Band scales only: get/set inner padding. */
|
|
43
|
+
paddingInner?(): number;
|
|
44
|
+
paddingInner?(padding: number): D3Scale<Out>;
|
|
45
|
+
/** Band scales only: get/set outer padding. */
|
|
46
|
+
paddingOuter?(): number;
|
|
47
|
+
paddingOuter?(padding: number): D3Scale<Out>;
|
|
48
|
+
}
|