@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,182 @@
|
|
|
1
|
+
import { transition } from "d3-transition";
|
|
2
|
+
import type { D3Selection } from "@d3plus/dom";
|
|
3
|
+
import type { GroupNode } from "@d3plus/render";
|
|
4
|
+
import type { SvgRenderer } from "@d3plus/render";
|
|
5
|
+
import { TextBox } from "../index.js";
|
|
6
|
+
import type Shape from "../../shapes/Shape.js";
|
|
7
|
+
import { BaseClass } from "../../utils/index.js";
|
|
8
|
+
import type { D3Scale } from "../../utils/index.js";
|
|
9
|
+
/**
|
|
10
|
+
Creates an SVG scale based on an array of data.
|
|
11
|
+
*/
|
|
12
|
+
export default class Axis extends BaseClass {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
_select: D3Selection;
|
|
15
|
+
_data: unknown[];
|
|
16
|
+
_labelRotation: boolean | undefined;
|
|
17
|
+
_margin: Record<string, number>;
|
|
18
|
+
_outerBounds: Record<string, number>;
|
|
19
|
+
_position: {
|
|
20
|
+
horizontal: boolean;
|
|
21
|
+
width: string;
|
|
22
|
+
height: string;
|
|
23
|
+
x: string;
|
|
24
|
+
y: string;
|
|
25
|
+
opposite: string;
|
|
26
|
+
};
|
|
27
|
+
_tickUnit: number;
|
|
28
|
+
_titleClass: TextBox;
|
|
29
|
+
_tickShape?: Shape;
|
|
30
|
+
_gridLineData?: {
|
|
31
|
+
id: unknown;
|
|
32
|
+
}[];
|
|
33
|
+
_d3Scale: D3Scale | null;
|
|
34
|
+
_d3ScaleNegative: D3Scale | null;
|
|
35
|
+
_group: D3Selection;
|
|
36
|
+
_lastScale: ((d: unknown) => number) | undefined;
|
|
37
|
+
_availableTicks: unknown[];
|
|
38
|
+
_visibleTicks: unknown[];
|
|
39
|
+
_transition: ReturnType<typeof transition>;
|
|
40
|
+
_userFormat: ((d: unknown) => string) | false | undefined;
|
|
41
|
+
_sceneRenderer?: SvgRenderer;
|
|
42
|
+
_managesOwnScenePaint?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
Invoked when creating a new class instance, and sets any default parameters.
|
|
45
|
+
@private
|
|
46
|
+
*/
|
|
47
|
+
constructor();
|
|
48
|
+
/**
|
|
49
|
+
Returns the scale's domain, taking into account negative and positive log scales.
|
|
50
|
+
@private
|
|
51
|
+
*/
|
|
52
|
+
_getDomain(): unknown[];
|
|
53
|
+
/**
|
|
54
|
+
Returns a value's scale position, taking into account negative and positive log scales.
|
|
55
|
+
@param d @private
|
|
56
|
+
*/
|
|
57
|
+
_getPosition(d: unknown): number;
|
|
58
|
+
/**
|
|
59
|
+
Returns the scale's range, taking into account negative and positive log scales.
|
|
60
|
+
@private
|
|
61
|
+
*/
|
|
62
|
+
_getRange(): unknown[];
|
|
63
|
+
/**
|
|
64
|
+
Returns the scale's labels, taking into account negative and positive log scales.
|
|
65
|
+
@private
|
|
66
|
+
*/
|
|
67
|
+
_getLabels(): unknown[];
|
|
68
|
+
/**
|
|
69
|
+
Returns the scale's ticks, taking into account negative and positive log scales.
|
|
70
|
+
@private
|
|
71
|
+
*/
|
|
72
|
+
_getTicks(): unknown[];
|
|
73
|
+
/**
|
|
74
|
+
Produces a backend-agnostic scene graph for this axis with no DOM dependency:
|
|
75
|
+
gridlines + domain bar emitted natively, tick marks/labels composed from the
|
|
76
|
+
tick Shape's toScene(), and the title from the title TextBox's toScene().
|
|
77
|
+
*/
|
|
78
|
+
toScene(): GroupNode;
|
|
79
|
+
/**
|
|
80
|
+
Renders the current Axis to the page.
|
|
81
|
+
@param callback Optional callback invoked after rendering completes.
|
|
82
|
+
*/
|
|
83
|
+
render(callback?: (...args: unknown[]) => unknown): this;
|
|
84
|
+
/**
|
|
85
|
+
Axis line style.
|
|
86
|
+
*/
|
|
87
|
+
barConfig(): Record<string, unknown>;
|
|
88
|
+
barConfig(_: Record<string, unknown>): this;
|
|
89
|
+
/**
|
|
90
|
+
An array of data points, which helps determine which ticks should be shown and which time resolution should be displayed.
|
|
91
|
+
*/
|
|
92
|
+
data(): unknown[];
|
|
93
|
+
data(_: unknown[]): this;
|
|
94
|
+
/**
|
|
95
|
+
Grid config of the axis.
|
|
96
|
+
*/
|
|
97
|
+
gridConfig(): Record<string, unknown>;
|
|
98
|
+
gridConfig(_: Record<string, unknown>): this;
|
|
99
|
+
/**
|
|
100
|
+
Whether to rotate horizontal axis labels -90 degrees.
|
|
101
|
+
*/
|
|
102
|
+
labelRotation(): boolean | undefined;
|
|
103
|
+
labelRotation(_: boolean): this;
|
|
104
|
+
/**
|
|
105
|
+
The orientation of the shape.
|
|
106
|
+
*/
|
|
107
|
+
orient(): string;
|
|
108
|
+
orient(_: string): this;
|
|
109
|
+
/**
|
|
110
|
+
Returns the outer bounds of the axis content. Must be called after rendering.
|
|
111
|
+
@example
|
|
112
|
+
{"width": 180, "height": 24, "x": 10, "y": 20}
|
|
113
|
+
*/
|
|
114
|
+
outerBounds(): Record<string, number>;
|
|
115
|
+
/**
|
|
116
|
+
Runs the layout pass only — scale construction, tick selection, label
|
|
117
|
+
textWrap, and outerBounds — with **no DOM access**. After it returns,
|
|
118
|
+
`outerBounds()` / `_d3Scale` / `_getPosition()` are populated exactly as
|
|
119
|
+
they would be after a full `render()`, but no `<svg>`, `<g>`, tick shapes,
|
|
120
|
+
or label TextBoxes are created. Answers "how much room will this axis
|
|
121
|
+
need?" without rendering; Plot uses it to size its test-axes. Delegates to
|
|
122
|
+
the standalone `measureAxis(axis)` in axisLayout.ts, so callers can run
|
|
123
|
+
layout without owning an Axis instance.
|
|
124
|
+
*/
|
|
125
|
+
measure(): this;
|
|
126
|
+
/**
|
|
127
|
+
The SVG container element as a d3 selector or DOM element.
|
|
128
|
+
|
|
129
|
+
Passing `null` or `undefined` deliberately leaves the axis unmounted
|
|
130
|
+
— `renderMode("compute")` plus `select(null)` produces a
|
|
131
|
+
scene-only axis (no detached SVG fallback). This is the formal
|
|
132
|
+
contract callers in `plotPaint` use to compute axis layout without
|
|
133
|
+
mounting DOM.
|
|
134
|
+
*/
|
|
135
|
+
select(): D3Selection;
|
|
136
|
+
select(_: string | HTMLElement | null | undefined): this;
|
|
137
|
+
/**
|
|
138
|
+
Tick style of the axis.
|
|
139
|
+
*/
|
|
140
|
+
shapeConfig(): Record<string, unknown>;
|
|
141
|
+
shapeConfig(_: Record<string, unknown>): this;
|
|
142
|
+
/**
|
|
143
|
+
Title configuration of the axis.
|
|
144
|
+
*/
|
|
145
|
+
titleConfig(): Record<string, unknown>;
|
|
146
|
+
titleConfig(_: Record<string, unknown>): this;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
Pure-function entry point for axis layout. Given a fully configured
|
|
150
|
+
`Axis` instance, runs the layout pass (no DOM) and returns a fresh result
|
|
151
|
+
bag — bounds, the d3 scale(s), a `getPosition` projector, plus the
|
|
152
|
+
laid-out tick state.
|
|
153
|
+
|
|
154
|
+
Callers who don't want to manage an Axis instance long-term can build
|
|
155
|
+
one on the fly, call this, and discard:
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
const axis = new AxisBottom()
|
|
159
|
+
.domain([0, 100])
|
|
160
|
+
.width(800).height(400)
|
|
161
|
+
.data(data)
|
|
162
|
+
.config(userAxisConfig);
|
|
163
|
+
const layout = computeAxisLayout(axis);
|
|
164
|
+
// layout.bounds, layout.getPosition, layout.d3Scale all populated.
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
This is the "no temp DOM, no test svg" path Plot's `_xTest`/`_yTest`
|
|
168
|
+
consume — see Plot._draw. Internally this is a thin wrapper over
|
|
169
|
+
`axis.measure()` returning a frozen snapshot of the laid-out state.
|
|
170
|
+
*/
|
|
171
|
+
export interface AxisLayout {
|
|
172
|
+
bounds: Record<string, number>;
|
|
173
|
+
d3Scale: D3Scale | null;
|
|
174
|
+
d3ScaleNegative: D3Scale | null;
|
|
175
|
+
getPosition: (d: unknown) => number;
|
|
176
|
+
availableTicks: unknown[];
|
|
177
|
+
visibleTicks: unknown[];
|
|
178
|
+
margin: Record<string, number>;
|
|
179
|
+
}
|
|
180
|
+
export declare function computeAxisLayout(axis: Axis): AxisLayout;
|
|
181
|
+
export { measureAxis } from "./axisLayout.js";
|
|
182
|
+
export type { AxisLayoutResult } from "./axisLayout.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as Axis } from "./Axis.js";
|
|
2
|
+
/**
|
|
3
|
+
Shorthand method for creating an axis where the ticks are drawn below the horizontal domain path. Extends all functionality of the base [Axis](#Axis) class.
|
|
4
|
+
*/
|
|
5
|
+
export default class AxisBottom extends Axis {
|
|
6
|
+
/**
|
|
7
|
+
Invoked when creating a new class instance, and overrides any default parameters inherited from Axis.
|
|
8
|
+
@private
|
|
9
|
+
*/
|
|
10
|
+
constructor();
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as Axis } from "./Axis.js";
|
|
2
|
+
/**
|
|
3
|
+
Shorthand method for creating an axis where the ticks are drawn to the left of the vertical domain path. Extends all functionality of the base [Axis](#Axis) class.
|
|
4
|
+
*/
|
|
5
|
+
export default class AxisLeft extends Axis {
|
|
6
|
+
/**
|
|
7
|
+
Invoked when creating a new class instance, and overrides any default parameters inherited from Axis.
|
|
8
|
+
@private
|
|
9
|
+
*/
|
|
10
|
+
constructor();
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as Axis } from "./Axis.js";
|
|
2
|
+
/**
|
|
3
|
+
Shorthand method for creating an axis where the ticks are drawn to the right of the vertical domain path. Extends all functionality of the base [Axis](#Axis) class.
|
|
4
|
+
*/
|
|
5
|
+
export default class AxisRight extends Axis {
|
|
6
|
+
/**
|
|
7
|
+
Invoked when creating a new class instance, and overrides any default parameters inherited from Axis.
|
|
8
|
+
@private
|
|
9
|
+
*/
|
|
10
|
+
constructor();
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as Axis } from "./Axis.js";
|
|
2
|
+
/**
|
|
3
|
+
Shorthand method for creating an axis where the ticks are drawn above the vertical domain path. Extends all functionality of the base [Axis](#Axis) class.
|
|
4
|
+
*/
|
|
5
|
+
export default class AxisTop extends Axis {
|
|
6
|
+
/**
|
|
7
|
+
Invoked when creating a new class instance, and overrides any default parameters inherited from Axis.
|
|
8
|
+
@private
|
|
9
|
+
*/
|
|
10
|
+
constructor();
|
|
11
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type Axis from "./Axis.js";
|
|
2
|
+
import type { AxisTextDatum, TickGet } from "./axisLayoutLabels.js";
|
|
3
|
+
/**
|
|
4
|
+
Result of `measureAxis()`. Holds layout artifacts the paint phase of
|
|
5
|
+
`Axis.render()` (and any caller that wants to construct a paint loop)
|
|
6
|
+
needs to consume. Most layout state also mutates onto the input `axis`
|
|
7
|
+
(`_d3Scale`, `_outerBounds`, `_margin`, etc.) so instance methods and
|
|
8
|
+
callers reading those slots stay in sync.
|
|
9
|
+
*/
|
|
10
|
+
export interface AxisLayoutResult {
|
|
11
|
+
ticks: unknown[];
|
|
12
|
+
labels: unknown[];
|
|
13
|
+
range: number[];
|
|
14
|
+
textData: AxisTextDatum[];
|
|
15
|
+
tickFormat: (d: unknown) => string;
|
|
16
|
+
hBuff: number;
|
|
17
|
+
wBuff: number;
|
|
18
|
+
tickGet: TickGet;
|
|
19
|
+
labelHeight: number;
|
|
20
|
+
bounds: Record<string, number>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
The standalone axis layout pass. Accepts any object satisfying the
|
|
24
|
+
Axis-instance shape (the production `Axis` class is the canonical input).
|
|
25
|
+
Pure compute — no DOM, no rendering. Mutates the input to set
|
|
26
|
+
`_d3Scale`/`_outerBounds`/`_margin`/etc. for callers that read those off
|
|
27
|
+
the instance afterward.
|
|
28
|
+
*/
|
|
29
|
+
export declare function measureAxis(axis: Axis): AxisLayoutResult;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type Axis from "./Axis.js";
|
|
2
|
+
/** Resolves a tick's pixel size from the shape config (or a constant). */
|
|
3
|
+
export type TickGet = (d?: {
|
|
4
|
+
tick?: boolean;
|
|
5
|
+
id?: unknown;
|
|
6
|
+
}, i?: number) => number;
|
|
7
|
+
/**
|
|
8
|
+
One measured axis label. Built incrementally: the base fields come from the
|
|
9
|
+
label-mapping pass, `space`/`lines`/`widths`/`width`/`height` are filled by
|
|
10
|
+
`calculateLabelSize`, and `truncated`/`offset` by the collision passes.
|
|
11
|
+
*/
|
|
12
|
+
export interface AxisTextDatum {
|
|
13
|
+
d: unknown;
|
|
14
|
+
i: number;
|
|
15
|
+
fF: string;
|
|
16
|
+
fP: number;
|
|
17
|
+
fS: number;
|
|
18
|
+
lineHeight: number;
|
|
19
|
+
position: number;
|
|
20
|
+
rotate?: boolean;
|
|
21
|
+
space: number;
|
|
22
|
+
lines: string[];
|
|
23
|
+
widths: number[];
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
truncated?: boolean;
|
|
27
|
+
offset?: number;
|
|
28
|
+
}
|
|
29
|
+
interface LabelLayoutCtx {
|
|
30
|
+
horizontal: boolean;
|
|
31
|
+
hBuff: number;
|
|
32
|
+
p: number;
|
|
33
|
+
tickFormat: (d: unknown) => string;
|
|
34
|
+
}
|
|
35
|
+
/** Applies the axis title's wrapped height to the orient-side margin. */
|
|
36
|
+
export declare function applyTitleMargin(axis: Axis, ctx: {
|
|
37
|
+
range: number[];
|
|
38
|
+
p: number;
|
|
39
|
+
height: string;
|
|
40
|
+
margin: Record<string, number>;
|
|
41
|
+
}): void;
|
|
42
|
+
/** Resolves the tick height/width buffers from the shape config. */
|
|
43
|
+
export declare function computeBuffers(axis: Axis, _ticks: unknown[], tickGet: TickGet, height: string): {
|
|
44
|
+
hBuff: number;
|
|
45
|
+
wBuff: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
Measures every label, computes per-label space, sizes via `textWrap`, and
|
|
49
|
+
resolves truncation (and optional offset). Returns the `textData` array.
|
|
50
|
+
*/
|
|
51
|
+
export declare function createTextData(axis: Axis, ctx: LabelLayoutCtx & {
|
|
52
|
+
labels: unknown[];
|
|
53
|
+
rangeOuter: number[];
|
|
54
|
+
offset?: number;
|
|
55
|
+
}): AxisTextDatum[];
|
|
56
|
+
/** Derives `_outerBounds` + axis margins from the measured text data. */
|
|
57
|
+
export declare function computeAxisBounds(axis: Axis, ctx: {
|
|
58
|
+
textData: AxisTextDatum[];
|
|
59
|
+
rangeOuter: number[];
|
|
60
|
+
hBuff: number;
|
|
61
|
+
horizontal: boolean;
|
|
62
|
+
p: number;
|
|
63
|
+
width: string;
|
|
64
|
+
height: string;
|
|
65
|
+
x: string;
|
|
66
|
+
y: string;
|
|
67
|
+
opposite: string;
|
|
68
|
+
margin: Record<string, number>;
|
|
69
|
+
}): Record<string, number>;
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type Axis from "./Axis.js";
|
|
2
|
+
import type { TickGet } from "./axisLayoutLabels.js";
|
|
3
|
+
/** Builds the tick label formatter (user-supplied or scale-derived). */
|
|
4
|
+
export declare function buildTickFormat(axis: Axis, timeLocaleObj: Record<string, unknown>, getTicks: () => unknown[]): (d: unknown) => string;
|
|
5
|
+
/**
|
|
6
|
+
Builds the scale, applies rounding/log adjustments, resolves ticks/labels,
|
|
7
|
+
and filters colliding ticks. Mutates `axis` and returns the layout locals
|
|
8
|
+
the caller threads through the rest of `measureAxis`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function setAxisScale(axis: Axis, rangeOuter: number[], tickGet: TickGet, newRangeArg?: number[]): {
|
|
11
|
+
range: number[];
|
|
12
|
+
ticks: unknown[];
|
|
13
|
+
labels: unknown[];
|
|
14
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { D3Selection } from "@d3plus/dom";
|
|
2
|
+
import type { GroupNode, Paint } from "@d3plus/render";
|
|
3
|
+
import type { AxisTextDatum } from "./axisLayoutLabels.js";
|
|
4
|
+
import type { D3Scale } from "../../utils/index.js";
|
|
5
|
+
import type Axis from "./Axis.js";
|
|
6
|
+
export declare const isNegative: (d: number) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Calculates ticks from a given scale (negative and/or positive)
|
|
9
|
+
* @param {scale} scale A d3-scale object
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
export declare function calculateTicks(this: Axis, scale: D3Scale, minorTicks?: boolean): unknown[];
|
|
13
|
+
/** Laid-out artifacts produced by `measureAxis` that the paint phase consumes. */
|
|
14
|
+
export interface AxisMeasure {
|
|
15
|
+
ticks: unknown[];
|
|
16
|
+
labels: unknown[];
|
|
17
|
+
range: number[];
|
|
18
|
+
textData: AxisTextDatum[];
|
|
19
|
+
tickFormat: (d: unknown) => string;
|
|
20
|
+
hBuff: number;
|
|
21
|
+
labelHeight: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
Builds the per-tick config array consumed by the tick Shape. Extracted from
|
|
25
|
+
`Axis.render` so the render method stays under the per-function line budget;
|
|
26
|
+
behavior is identical.
|
|
27
|
+
@private
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildTickData(axis: Axis, measure: AxisMeasure): Record<string, unknown>[];
|
|
30
|
+
/**
|
|
31
|
+
Instantiates and renders the compute-mode tick Shape from `tickData`.
|
|
32
|
+
Extracted from `Axis.render`; behavior is identical.
|
|
33
|
+
@private
|
|
34
|
+
*/
|
|
35
|
+
export declare function configureTickShape(axis: Axis, tickData: Record<string, unknown>[]): void;
|
|
36
|
+
/**
|
|
37
|
+
Renders the axis title TextBox in compute mode. Extracted from
|
|
38
|
+
`Axis.render`; behavior is identical.
|
|
39
|
+
@private
|
|
40
|
+
*/
|
|
41
|
+
export declare function renderAxisTitle(axis: Axis, measure: AxisMeasure, group: D3Selection | null): void;
|
|
42
|
+
/**
|
|
43
|
+
Converts an attribute-style config (e.g. gridConfig, barConfig) into a Paint.
|
|
44
|
+
@private
|
|
45
|
+
*/
|
|
46
|
+
export declare function configToPaint(axis: Axis, cfg: Record<string, unknown>, datum?: unknown, index?: number): Paint;
|
|
47
|
+
/**
|
|
48
|
+
Replicates _gridPosition's math to compute each gridline's endpoints in the
|
|
49
|
+
axis's internal coordinate space.
|
|
50
|
+
@private
|
|
51
|
+
*/
|
|
52
|
+
export declare function gridLinePoints(axis: Axis): {
|
|
53
|
+
points: [number, number][];
|
|
54
|
+
}[];
|
|
55
|
+
/**
|
|
56
|
+
Replicates _barPosition's math to compute the domain-bar endpoints.
|
|
57
|
+
@private
|
|
58
|
+
*/
|
|
59
|
+
export declare function barLinePoints(axis: Axis): {
|
|
60
|
+
points: [number, number][];
|
|
61
|
+
} | null;
|
|
62
|
+
/**
|
|
63
|
+
Produces a backend-agnostic scene graph for the axis with no DOM dependency:
|
|
64
|
+
gridlines + domain bar emitted natively, tick marks/labels composed from the
|
|
65
|
+
tick Shape's toScene(), and the title from the title TextBox's toScene().
|
|
66
|
+
@private
|
|
67
|
+
*/
|
|
68
|
+
export declare function axisToScene(axis: Axis): GroupNode;
|