@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,21 +1,67 @@
|
|
|
1
1
|
import type { DataPoint } from "@d3plus/data";
|
|
2
|
+
import type VizBase from "../charts/viz/VizBase.js";
|
|
3
|
+
import type { AccessorFn } from "./AccessorFn.js";
|
|
2
4
|
type Position = "top" | "right" | "bottom" | "left";
|
|
3
5
|
type DataPointAccessor<T> = string | ((d: DataPoint) => T);
|
|
6
|
+
/** A config value that is either a constant or a `(datum, index)` accessor. */
|
|
7
|
+
type Accessor<T> = T | ((d: DataPoint, i?: number) => T);
|
|
4
8
|
type AxisScale = "auto" | "band" | "diverging" | "divergingLog" | "divergingPow" | "divergingSqrt" | "divergingSymlog" | "identity" | "implicit" | "jenks" | "linear" | "log" | "ordinal" | "point" | "pow" | "quantile" | "quantize" | "radial" | "sequential" | "sequentialLog" | "sequentialPow" | "sequentialQuantile" | "sequentialSqrt" | "sequentialSymlog" | "sqrt" | "symlog" | "threshold" | "time" | "utc";
|
|
5
9
|
export interface AxisConfig {
|
|
6
10
|
barConfig?: Record<string, string | number>;
|
|
11
|
+
/** Grid values of the axis. */
|
|
12
|
+
grid?: unknown[];
|
|
7
13
|
gridConfig?: Record<string, string | number>;
|
|
14
|
+
/** Grid size of the axis. */
|
|
15
|
+
gridSize?: number;
|
|
8
16
|
label?: string;
|
|
17
|
+
/** Visible tick labels of the axis. */
|
|
9
18
|
labels?: unknown[];
|
|
10
19
|
labelOffset?: false | number;
|
|
20
|
+
/** Maximum size allowed for the space that contains the axis tick labels and title. */
|
|
11
21
|
maxSize?: number;
|
|
22
|
+
/** Minimum size alloted for the space that contains the axis tick labels and title. */
|
|
23
|
+
minSize?: number;
|
|
24
|
+
/**
|
|
25
|
+
Scale range (in pixels) of the axis. The given array must have 2 values,
|
|
26
|
+
but one may be `undefined` to allow the default behavior for that value.
|
|
27
|
+
*/
|
|
28
|
+
range?: (number | undefined)[];
|
|
29
|
+
/** Scale of the axis. */
|
|
12
30
|
scale?: AxisScale;
|
|
31
|
+
/** Tick formatter. */
|
|
13
32
|
tickFormat?: (d: number | string) => string | number;
|
|
33
|
+
/** Tick values of the axis. */
|
|
14
34
|
ticks?: unknown[];
|
|
15
35
|
tickSize?: number;
|
|
36
|
+
/**
|
|
37
|
+
Defines a custom locale object to be used in time scales. Must include
|
|
38
|
+
`dateTime`, `date`, `time`, `periods`, `days`, `shortDays`, `months`, and
|
|
39
|
+
`shortMonths` (see
|
|
40
|
+
[d3-time-format](https://github.com/d3/d3-time-format/blob/master/README.md#timeFormatLocale)).
|
|
41
|
+
*/
|
|
42
|
+
timeLocale?: Record<string, unknown>;
|
|
43
|
+
/** Title of the axis. */
|
|
16
44
|
title?: string;
|
|
17
45
|
}
|
|
18
46
|
export interface TooltipConfig {
|
|
47
|
+
/** The inner HTML content of the arrow element, empty by default. */
|
|
48
|
+
arrow?: ((d: DataPoint) => string) | string;
|
|
49
|
+
/** The background color accessor for each tooltip. */
|
|
50
|
+
background?: ((d: DataPoint) => string) | string;
|
|
51
|
+
/** The border accessor for each tooltip. */
|
|
52
|
+
border?: ((d: DataPoint) => string) | string;
|
|
53
|
+
/** The border-radius accessor for each tooltip. */
|
|
54
|
+
borderRadius?: ((d: DataPoint) => string) | string;
|
|
55
|
+
/** The footer content accessor for each tooltip. */
|
|
56
|
+
footer?: ((d: DataPoint) => string) | string;
|
|
57
|
+
/** The max-width accessor for each tooltip. */
|
|
58
|
+
maxWidth?: ((d: DataPoint) => string | number) | string | number;
|
|
59
|
+
/** The min-width accessor for each tooltip. */
|
|
60
|
+
minWidth?: ((d: DataPoint) => string | number) | string | number;
|
|
61
|
+
/** The pixel offset between the tooltip and its anchor point. */
|
|
62
|
+
offset?: ((d: DataPoint) => number) | number;
|
|
63
|
+
/** The inner padding of each tooltip. */
|
|
64
|
+
padding?: ((d: DataPoint) => string | number) | string | number;
|
|
19
65
|
title?: ((d: DataPoint) => string) | string;
|
|
20
66
|
body?: ((d: DataPoint) => string) | string;
|
|
21
67
|
thead?: ((d: DataPoint) => [string, string][]) | Array<Array<((d: DataPoint, i?: number, x?: {
|
|
@@ -25,17 +71,141 @@ export interface TooltipConfig {
|
|
|
25
71
|
share: number;
|
|
26
72
|
}) => string) | string>>;
|
|
27
73
|
}
|
|
74
|
+
export interface TextBoxConfig {
|
|
75
|
+
/** The text content for each box. */
|
|
76
|
+
text?: Accessor<string>;
|
|
77
|
+
/** The font color as an accessor function or static string. Inferred from the DOM selection by default. */
|
|
78
|
+
fontColor?: Accessor<string>;
|
|
79
|
+
/** The font size in pixels. Inferred from the DOM selection by default. */
|
|
80
|
+
fontSize?: Accessor<number>;
|
|
81
|
+
/**
|
|
82
|
+
The font-family to use: a font name, a comma-separated list of fallbacks,
|
|
83
|
+
an array of fallbacks, or an accessor returning a string or array. The
|
|
84
|
+
first available font on the client is used.
|
|
85
|
+
*/
|
|
86
|
+
fontFamily?: Accessor<string | string[]>;
|
|
87
|
+
/** The font weight. Inferred from the DOM selection by default. */
|
|
88
|
+
fontWeight?: Accessor<string | number>;
|
|
89
|
+
/** The minimum font size in pixels, used when dynamically resizing fonts. */
|
|
90
|
+
fontMin?: number;
|
|
91
|
+
/** The maximum font size in pixels, used when dynamically resizing fonts. */
|
|
92
|
+
fontMax?: number;
|
|
93
|
+
/** Toggles font resizing — a static boolean, or an accessor returning a boolean. */
|
|
94
|
+
fontResize?: Accessor<boolean>;
|
|
95
|
+
/** The font opacity as an accessor function or static number between 0 and 1. */
|
|
96
|
+
fontOpacity?: Accessor<number>;
|
|
97
|
+
/** The font stroke color for the rendered text. */
|
|
98
|
+
fontStroke?: Accessor<string>;
|
|
99
|
+
/** The font stroke width for the rendered text. */
|
|
100
|
+
fontStrokeWidth?: Accessor<number>;
|
|
101
|
+
/** The line height, which is 1.2 times the font size by default. */
|
|
102
|
+
lineHeight?: Accessor<number>;
|
|
103
|
+
/** Restricts the maximum number of lines to wrap onto; null (unlimited) by default. */
|
|
104
|
+
maxLines?: Accessor<number | null>;
|
|
105
|
+
/** Whether text is allowed to overflow its bounding box. */
|
|
106
|
+
overflow?: Accessor<boolean>;
|
|
107
|
+
/**
|
|
108
|
+
Handles truncated lines, returning the new line value. Passed the line's
|
|
109
|
+
text and number; by default appends an ellipsis to every line except a
|
|
110
|
+
first word that cannot fit (which returns "").
|
|
111
|
+
*/
|
|
112
|
+
ellipsis?: (text: string, line: number) => string;
|
|
113
|
+
/** The padding as a CSS shorthand string or number. Defaults to 0. */
|
|
114
|
+
padding?: Accessor<string | number>;
|
|
115
|
+
/** The anchor point around which to rotate the text box. */
|
|
116
|
+
rotateAnchor?: Accessor<[number, number]>;
|
|
117
|
+
/** The word split function: given a string, returns it split into an array of words. */
|
|
118
|
+
split?: (text: string) => string[];
|
|
119
|
+
/** The width for each text box. */
|
|
120
|
+
width?: Accessor<number>;
|
|
121
|
+
/** The height for each text box. */
|
|
122
|
+
height?: Accessor<number>;
|
|
123
|
+
/** The x position (left edge) for each text box. */
|
|
124
|
+
x?: Accessor<number>;
|
|
125
|
+
/** The y position (top edge) for each text box. */
|
|
126
|
+
y?: Accessor<number>;
|
|
127
|
+
}
|
|
128
|
+
export interface TimelineConfig {
|
|
129
|
+
/** Brush event filter. */
|
|
130
|
+
brushFilter?: () => boolean;
|
|
131
|
+
/**
|
|
132
|
+
The minimum number of ticks that can be highlighted when using "ticks"
|
|
133
|
+
`buttonBehavior`. Helpful for x/y plots where selecting fewer than 2 time
|
|
134
|
+
periods is undesirable.
|
|
135
|
+
*/
|
|
136
|
+
brushMin?: number;
|
|
137
|
+
/** Toggles the horizontal alignment of the button timeline. */
|
|
138
|
+
buttonAlign?: "start" | "middle" | "end";
|
|
139
|
+
/** Toggles the style of the timeline. */
|
|
140
|
+
buttonBehavior?: "auto" | "buttons" | "ticks";
|
|
141
|
+
/** Button height. */
|
|
142
|
+
buttonHeight?: number;
|
|
143
|
+
/** Button padding. */
|
|
144
|
+
buttonPadding?: number;
|
|
145
|
+
/** Handle style. */
|
|
146
|
+
handleConfig?: Record<string, unknown>;
|
|
147
|
+
/** Handle size. */
|
|
148
|
+
handleSize?: number;
|
|
149
|
+
/**
|
|
150
|
+
Determines the visibility of the play button to the left of the timeline,
|
|
151
|
+
which cycles through the available periods at a rate set by `playButtonInterval`.
|
|
152
|
+
*/
|
|
153
|
+
playButton?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
The interval, in milliseconds, between periods when cycling via the play
|
|
156
|
+
button. Used only when the chart's `duration` is 0 (no transition);
|
|
157
|
+
otherwise playback steps once per `duration` so each step animates in full.
|
|
158
|
+
*/
|
|
159
|
+
playButtonInterval?: number;
|
|
160
|
+
/** The current selection. Defaults to the most recent period in the timeline. */
|
|
161
|
+
selection?: (Date | number)[] | Date | number | false;
|
|
162
|
+
/** Toggles the snapping value. */
|
|
163
|
+
snapping?: boolean;
|
|
164
|
+
}
|
|
165
|
+
export interface LegendConfig {
|
|
166
|
+
/** The active method for all shapes. */
|
|
167
|
+
active?: ((d: DataPoint, i?: number) => boolean) | false;
|
|
168
|
+
/** The hover method for all shapes. */
|
|
169
|
+
hover?: ((d: DataPoint, i?: number) => boolean) | false;
|
|
170
|
+
/** The shape type used for each legend entry. */
|
|
171
|
+
shape?: Accessor<string>;
|
|
172
|
+
}
|
|
173
|
+
export interface ColorScaleConfig {
|
|
174
|
+
/**
|
|
175
|
+
For a linear scale, the `[min, max]` values used by the color scale; values
|
|
176
|
+
outside this range map to the nearest color.
|
|
177
|
+
*/
|
|
178
|
+
domain?: number[];
|
|
179
|
+
/**
|
|
180
|
+
Formats the label for each bucket in a bucket-type scale ("jenks",
|
|
181
|
+
"quantile", …). Passed the bucket's start value, its index, the full
|
|
182
|
+
bucket array, and every data value used to build the buckets.
|
|
183
|
+
*/
|
|
184
|
+
bucketFormat?: (start: number, i: number, buckets: number[], values: number[]) => string;
|
|
185
|
+
/** Given a bucket's minimum and maximum values, returns the full label. */
|
|
186
|
+
bucketJoiner?: (min: string, max: string) => string;
|
|
187
|
+
}
|
|
28
188
|
export interface D3plusConfig {
|
|
29
189
|
/** Data array or URL string to load data from. */
|
|
30
190
|
data?: DataPoint[] | string;
|
|
31
191
|
/** Locale code used for text and number formatting. */
|
|
32
192
|
locale?: string;
|
|
193
|
+
/** The active callback function for highlighting shapes. */
|
|
194
|
+
active?: ((d: DataPoint, i: number) => boolean) | false | null;
|
|
33
195
|
/** Custom aggregation functions keyed by data property. */
|
|
34
196
|
aggs?: {
|
|
35
197
|
[k: string]: (d: DataPoint[]) => unknown;
|
|
36
198
|
};
|
|
199
|
+
/** Hides the SVG from assistive technology when true (`aria-hidden`). */
|
|
200
|
+
ariaHidden?: boolean;
|
|
37
201
|
/** Padding between bars in pixels. */
|
|
38
202
|
barPadding?: number;
|
|
203
|
+
/** The baseline for the x/y plot. */
|
|
204
|
+
baseline?: number;
|
|
205
|
+
/** Whether to cache the processed data between renders. */
|
|
206
|
+
cache?: boolean;
|
|
207
|
+
/** Treat a discrete color field as ordered: color it with a single-hue light→dark ramp instead of nominal categorical hues. */
|
|
208
|
+
colorOrdinal?: boolean;
|
|
39
209
|
/** Color scale key or custom color function. */
|
|
40
210
|
colorScale?: string | ((d: number) => string);
|
|
41
211
|
/** Configuration for the color scale component. */
|
|
@@ -48,43 +218,81 @@ export interface D3plusConfig {
|
|
|
48
218
|
colorMax?: string;
|
|
49
219
|
scale?: AxisScale;
|
|
50
220
|
};
|
|
51
|
-
/**
|
|
52
|
-
|
|
221
|
+
/** Whether the color scale uses the visualization's internal padding when positioning, or an accessor receiving the viz. */
|
|
222
|
+
colorScalePadding?: boolean | ((viz: VizBase) => boolean);
|
|
223
|
+
/** Position of the color scale, `false` to hide it, or an accessor returning either. */
|
|
224
|
+
colorScalePosition?: false | Position | (() => false | Position);
|
|
53
225
|
/** Column key for matrix-style layouts. */
|
|
54
226
|
column?: string;
|
|
227
|
+
/**
|
|
228
|
+
The confidence interval as `[lower, upper]` bounds — each given as an
|
|
229
|
+
accessor function or a static data key (e.g. `["lci", "hci"]`), or `false`
|
|
230
|
+
to disable.
|
|
231
|
+
*/
|
|
232
|
+
confidence?: [
|
|
233
|
+
string | ((d: DataPoint, i: number) => number),
|
|
234
|
+
string | ((d: DataPoint, i: number) => number)
|
|
235
|
+
] | false;
|
|
236
|
+
/** Maximum number of data points to render before downsampling. */
|
|
237
|
+
dataCutoff?: number;
|
|
55
238
|
/** Active depth level for nested groupings. */
|
|
56
239
|
depth?: number;
|
|
57
240
|
/** Sets orientation of main category axis. */
|
|
58
241
|
discrete?: "x" | "y";
|
|
59
242
|
/** Default duration of transitions, in milliseconds. */
|
|
60
243
|
duration?: number;
|
|
244
|
+
/** Predicate filtering which data points are included, or false to disable. */
|
|
245
|
+
filter?: ((d: DataPoint, i: number) => boolean) | false;
|
|
61
246
|
/** Allows removing specific geographies from topojson file to improve zoom. */
|
|
62
247
|
fitFilter?: number | string | ((d: Record<string, unknown>) => boolean);
|
|
63
248
|
/** Grouping key(s) or accessor function(s). */
|
|
64
249
|
groupBy?: string | string[] | ((d: DataPoint) => string | number) | ((d: DataPoint) => string | number)[];
|
|
65
250
|
/** Padding between groups of bars in pixels. */
|
|
66
251
|
groupPadding?: number;
|
|
252
|
+
/** Overall height of the visualization in pixels. */
|
|
253
|
+
height?: number;
|
|
254
|
+
/** Color for legend shapes whose grouping is hidden (via legend click), or a `(datum, index)` accessor. */
|
|
255
|
+
hiddenColor?: string | ((d: DataPoint, i: number) => string);
|
|
256
|
+
/** Opacity for legend labels whose grouping is hidden (via legend click), or a `(datum, index)` accessor. */
|
|
257
|
+
hiddenOpacity?: number | ((d: DataPoint, i: number) => number);
|
|
258
|
+
/** The hover callback function for highlighting shapes on mouseover. */
|
|
259
|
+
hover?: ((d: DataPoint, i: number) => boolean) | false | null;
|
|
260
|
+
/** Persistently emphasizes matching marks (keep color) and grays the rest. */
|
|
261
|
+
highlight?: ((d: DataPoint, i: number) => boolean) | false | null;
|
|
67
262
|
/** Label accessor for shapes. */
|
|
68
|
-
label?: string |
|
|
69
|
-
/**
|
|
70
|
-
|
|
263
|
+
label?: string | string[] | false | AccessorFn;
|
|
264
|
+
/**
|
|
265
|
+
Controls legend visibility. Pass `false` to hide it, `true` to always
|
|
266
|
+
show it, or a `(config, data) => boolean` accessor to decide dynamically
|
|
267
|
+
— the chart defaults use an accessor to auto-hide the legend when it
|
|
268
|
+
would be redundant.
|
|
269
|
+
*/
|
|
270
|
+
legend?: boolean | ((config: D3plusConfig, arr: DataPoint[]) => boolean);
|
|
71
271
|
/** Configuration for the legend component. */
|
|
72
272
|
legendConfig?: {
|
|
73
273
|
label?: DataPointAccessor<string>;
|
|
74
274
|
shapeConfig?: Record<string, string | number>;
|
|
75
275
|
};
|
|
76
|
-
/**
|
|
77
|
-
|
|
276
|
+
/** Inverts legend click behavior (click hides / shift-click solos, or the reverse), or an accessor receiving the viz. */
|
|
277
|
+
legendFilterInvert?: boolean | ((viz: VizBase) => boolean);
|
|
278
|
+
/** Whether the legend uses the visualization's internal padding when positioning, or an accessor receiving the viz. */
|
|
279
|
+
legendPadding?: boolean | ((viz: VizBase) => boolean);
|
|
280
|
+
/** Position of the legend, or an accessor returning it. */
|
|
281
|
+
legendPosition?: Position | (() => Position);
|
|
282
|
+
/** Custom sort comparator for legend items. */
|
|
283
|
+
legendSort?: (a: DataPoint, b: DataPoint) => number;
|
|
78
284
|
/** Tooltip configuration for legend items. */
|
|
79
285
|
legendTooltip?: TooltipConfig;
|
|
80
286
|
/** Whether to show labels on line charts. */
|
|
81
287
|
lineLabels?: boolean;
|
|
82
288
|
/** Whether to show the loading message. */
|
|
83
289
|
loadingMessage?: boolean;
|
|
84
|
-
/** Custom HTML content for the loading indicator. */
|
|
85
|
-
loadingHTML?: string;
|
|
290
|
+
/** Custom HTML content for the loading indicator, or a function receiving the viz instance. */
|
|
291
|
+
loadingHTML?: string | ((viz: VizBase) => string);
|
|
86
292
|
/** Metric key for the visualization. */
|
|
87
293
|
metric?: string;
|
|
294
|
+
/** Custom HTML content shown when no data is supplied, or a function receiving the viz instance. */
|
|
295
|
+
noDataHTML?: string | ((viz: VizBase) => string);
|
|
88
296
|
/** Ocean color for geomaps (any CSS value including 'transparent'). */
|
|
89
297
|
ocean?: string;
|
|
90
298
|
/** Event listeners keyed by event name. */
|
|
@@ -112,30 +320,53 @@ export interface D3plusConfig {
|
|
|
112
320
|
duration?: number;
|
|
113
321
|
[key: string]: unknown;
|
|
114
322
|
};
|
|
323
|
+
/**
|
|
324
|
+
A [sort comparator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)
|
|
325
|
+
that receives each shape class (e.g. "Circle", "Line") as its arguments.
|
|
326
|
+
Shapes are drawn in groups by type, so this defines the layering order for
|
|
327
|
+
all shapes of a given type.
|
|
328
|
+
*/
|
|
329
|
+
shapeSort?: (a: string, b: string) => number;
|
|
115
330
|
/** Size accessor key. */
|
|
116
331
|
size?: string;
|
|
117
332
|
/** Whether to stack series. */
|
|
118
333
|
stacked?: boolean;
|
|
119
334
|
/** Custom order for stacked series. */
|
|
120
335
|
stackOrder?: string[];
|
|
336
|
+
/** Subtitle text, or an accessor returning it. */
|
|
337
|
+
subtitle?: string | ((data: DataPoint[]) => string);
|
|
338
|
+
/** Whether the subtitle uses the visualization's internal padding when positioning, or an accessor receiving the viz. */
|
|
339
|
+
subtitlePadding?: boolean | ((viz: VizBase) => boolean);
|
|
121
340
|
/** Value accessor for treemaps and aggregation. */
|
|
122
341
|
sum?: DataPointAccessor<number>;
|
|
342
|
+
/** Accessible description applied to the root SVG (`<desc>`). */
|
|
343
|
+
svgDesc?: string;
|
|
344
|
+
/** Accessible title applied to the root SVG (`<title>`). */
|
|
345
|
+
svgTitle?: string;
|
|
123
346
|
/** Threshold value for grouping small slices. */
|
|
124
347
|
threshold?: number;
|
|
125
|
-
/** Label for the threshold group. */
|
|
126
|
-
thresholdName?: string;
|
|
348
|
+
/** Label for the threshold group, or a `(datum, index)` accessor. */
|
|
349
|
+
thresholdName?: string | ((d: DataPoint, i: number) => string);
|
|
127
350
|
/** URL to XYZ map tiles. */
|
|
128
351
|
tileUrl?: string;
|
|
129
352
|
/** Whether to show map tiles. */
|
|
130
353
|
tiles?: boolean;
|
|
131
354
|
/** Time key for temporal data. */
|
|
132
355
|
time?: string;
|
|
356
|
+
/** Predicate filtering which time slices are shown, or false to disable. */
|
|
357
|
+
timeFilter?: ((d: DataPoint, i: number) => boolean) | false;
|
|
358
|
+
/** Whether to show the timeline component. */
|
|
359
|
+
timeline?: boolean;
|
|
360
|
+
/** Whether the timeline uses the visualization's internal padding when positioning, or an accessor receiving the viz. */
|
|
361
|
+
timelinePadding?: boolean | ((viz: VizBase) => boolean);
|
|
133
362
|
/** Chart title or title accessor function. */
|
|
134
363
|
title?: string | ((data: DataPoint[]) => string);
|
|
135
364
|
/** CSS style configuration for the title. */
|
|
136
365
|
titleConfig?: Record<string, string | number>;
|
|
137
|
-
/** Whether
|
|
138
|
-
|
|
366
|
+
/** Whether the title uses the visualization's internal padding when positioning, or an accessor receiving the viz. */
|
|
367
|
+
titlePadding?: boolean | ((viz: VizBase) => boolean);
|
|
368
|
+
/** Whether to show tooltips, or a `(datum, index)` accessor deciding per mark. */
|
|
369
|
+
tooltip?: boolean | ((d: DataPoint, i: number) => boolean);
|
|
139
370
|
/** Configuration for the tooltip component. */
|
|
140
371
|
tooltipConfig?: TooltipConfig;
|
|
141
372
|
/** Path or object for the topojson data. */
|
|
@@ -144,22 +375,46 @@ export interface D3plusConfig {
|
|
|
144
375
|
topojsonFill?: string;
|
|
145
376
|
/** Accessor function for topojson feature IDs. */
|
|
146
377
|
topojsonId?: (obj: Record<string, unknown>) => string;
|
|
378
|
+
/** Whether the total uses the visualization's internal padding when positioning, or an accessor receiving the viz. */
|
|
379
|
+
totalPadding?: boolean | ((viz: VizBase) => boolean);
|
|
147
380
|
/** Value accessor for the visualization. */
|
|
148
381
|
value?: DataPointAccessor<number>;
|
|
382
|
+
/** Overall width of the visualization in pixels. */
|
|
383
|
+
width?: number;
|
|
149
384
|
/** Key, index, or accessor function for x-axis values. */
|
|
150
|
-
x?: string | number | ((
|
|
385
|
+
x?: string | number | ((d: DataPoint, i: number) => unknown);
|
|
151
386
|
/** Configuration for the x-axis. */
|
|
152
387
|
xConfig?: AxisConfig;
|
|
388
|
+
/** The x domain as an array. If either value is undefined, it is calculated from the data. */
|
|
389
|
+
xDomain?: (number | Date)[];
|
|
390
|
+
/** The x2 domain as an array. If either value is undefined, it is calculated from the data. */
|
|
391
|
+
x2Domain?: (number | Date)[];
|
|
153
392
|
/** Custom sort function for x-axis values. */
|
|
154
393
|
xSort?: (a: DataPoint, b: DataPoint) => number;
|
|
394
|
+
/** Defines a custom sorting comparator function for discrete x2 axes. */
|
|
395
|
+
x2Sort?: (a: DataPoint, b: DataPoint) => number;
|
|
155
396
|
/** Key, index, or accessor function for y-axis values. */
|
|
156
|
-
y?: string | number | ((
|
|
397
|
+
y?: string | number | ((d: DataPoint, i: number) => unknown);
|
|
157
398
|
/** Configuration for the y-axis. */
|
|
158
399
|
yConfig?: AxisConfig;
|
|
400
|
+
/** The y domain as an array. If either value is undefined, it is calculated from the data. */
|
|
401
|
+
yDomain?: (number | Date)[];
|
|
402
|
+
/** The y2 domain as an array. If either value is undefined, it is calculated from the data. */
|
|
403
|
+
y2Domain?: (number | Date)[];
|
|
159
404
|
/** Custom sort function for y-axis values. */
|
|
160
405
|
ySort?: (a: DataPoint, b: DataPoint) => number;
|
|
406
|
+
/** Defines a custom sorting comparator function for discrete y2 axes. */
|
|
407
|
+
y2Sort?: (a: DataPoint, b: DataPoint) => number;
|
|
161
408
|
/** Set to false to disable zooming on Geomap and Network. */
|
|
162
409
|
zoom?: boolean;
|
|
410
|
+
/** Multiplier applied to programmatic zoom steps. */
|
|
411
|
+
zoomFactor?: number;
|
|
412
|
+
/** Maximum zoom scale factor. */
|
|
413
|
+
zoomMax?: number;
|
|
414
|
+
/** Whether panning (drag) is enabled while zoomed. */
|
|
415
|
+
zoomPan?: boolean;
|
|
416
|
+
/** Whether scroll-wheel zooming is enabled. */
|
|
417
|
+
zoomScroll?: boolean;
|
|
163
418
|
/** Allows additional custom properties. */
|
|
164
419
|
[key: string]: unknown;
|
|
165
420
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DataPoint } from "@d3plus/data";
|
|
2
|
-
import { D3plusConfig } from "./D3plusConfig";
|
|
2
|
+
import { D3plusConfig } from "./D3plusConfig.js";
|
|
3
3
|
interface D3PlusWrapped {
|
|
4
4
|
__d3plus__?: boolean;
|
|
5
5
|
__d3plusParent__?: D3PlusWrapped;
|
|
@@ -13,9 +13,12 @@ interface ConfigObject extends D3plusConfig {
|
|
|
13
13
|
[key: string]: unknown;
|
|
14
14
|
}
|
|
15
15
|
export interface VizContext {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
schema: {
|
|
17
|
+
shapeConfig: ConfigObject;
|
|
18
|
+
duration?: number;
|
|
19
|
+
on?: Record<string, DataAccessor>;
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
};
|
|
19
22
|
[key: string]: unknown;
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
@@ -6,4 +6,6 @@ import type { DataPoint } from "@d3plus/data";
|
|
|
6
6
|
@param i
|
|
7
7
|
@private
|
|
8
8
|
*/
|
|
9
|
-
export default function getProp(this:
|
|
9
|
+
export default function getProp(this: {
|
|
10
|
+
schema: Record<string, (d: DataPoint, i: number) => DataPoint[keyof DataPoint]>;
|
|
11
|
+
}, type: string, d: DataPoint, i: number): DataPoint[keyof DataPoint];
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export type { AccessorFn } from "./AccessorFn.js";
|
|
2
2
|
export { default as accessor } from "./accessor.js";
|
|
3
3
|
export { default as BaseClass } from "./BaseClass.js";
|
|
4
|
-
export type { D3plusConfig, AxisConfig, TooltipConfig } from "./D3plusConfig.js";
|
|
4
|
+
export type { D3plusConfig, AxisConfig, ColorScaleConfig, LegendConfig, TextBoxConfig, TimelineConfig, TooltipConfig, } from "./D3plusConfig.js";
|
|
5
|
+
export type { D3Scale } from "./D3Scale.js";
|
|
5
6
|
export { default as configPrep } from "./configPrep.js";
|
|
6
7
|
export { default as constant } from "./constant.js";
|
|
7
8
|
export { default as getProp } from "./getProp.js";
|
|
9
|
+
export { paintComponentScene } from "./paintComponentScene.js";
|
|
8
10
|
export { default as RESET } from "./RESET.js";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Standalone scene paint for the BaseClass-derived components (Axis, Legend,
|
|
3
|
+
ColorScale).
|
|
4
|
+
|
|
5
|
+
When one of these components is composed inside a Viz it runs in
|
|
6
|
+
`renderMode("compute")` and the Viz reads its `toScene()` into the chart
|
|
7
|
+
scene — nothing here is used. When it is rendered on its own (e.g. the
|
|
8
|
+
`@d3plus/react` `<Axis>`/`<Legend>`/`<ColorScale>` wrappers, or a bare
|
|
9
|
+
`new Axis().select(svg).render()`), `render()` only computes layout; no
|
|
10
|
+
backend paints the resulting scene. This mounts an SvgRenderer into the
|
|
11
|
+
component's `_select` and draws its scene, reusing the renderer instance
|
|
12
|
+
across re-renders.
|
|
13
|
+
*/
|
|
14
|
+
import { SvgRenderer } from "@d3plus/render";
|
|
15
|
+
import type { GroupNode } from "@d3plus/render";
|
|
16
|
+
interface SceneComponent {
|
|
17
|
+
_select?: {
|
|
18
|
+
node: () => import("d3-selection").BaseType | null;
|
|
19
|
+
};
|
|
20
|
+
_sceneRenderer?: SvgRenderer;
|
|
21
|
+
schema: {
|
|
22
|
+
width?: number;
|
|
23
|
+
height?: number;
|
|
24
|
+
};
|
|
25
|
+
toScene: () => GroupNode;
|
|
26
|
+
}
|
|
27
|
+
export declare function paintComponentScene(instance: SceneComponent): void;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
*/
|
|
14
|
+
export * from "./index.js";
|
|
15
|
+
export * from "./internal.js";
|