@d3plus/core 4.3.0 → 4.6.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 +7406 -3676
- package/es/index.js +3 -3
- package/es/index.js.map +1 -1
- package/es/internal.js +13 -2
- package/es/internal.js.map +1 -1
- package/es/src/charts/AreaPlot/index.js +1 -2
- package/es/src/charts/AreaPlot/index.js.map +1 -1
- package/es/src/charts/BarChart/index.js +9 -3
- package/es/src/charts/BarChart/index.js.map +1 -1
- package/es/src/charts/BoxWhisker/index.js +6 -2
- package/es/src/charts/BoxWhisker/index.js.map +1 -1
- package/es/src/charts/BumpChart/index.js +1 -2
- package/es/src/charts/BumpChart/index.js.map +1 -1
- package/es/src/charts/Chord/applyLayout.js +205 -0
- package/es/src/charts/Chord/applyLayout.js.map +1 -0
- package/es/src/charts/Chord/emit.js +220 -0
- package/es/src/charts/Chord/emit.js.map +1 -0
- package/es/src/charts/Chord/index.js +249 -0
- package/es/src/charts/Chord/index.js.map +1 -0
- package/es/src/charts/Geomap/applyLayout.js +17 -10
- package/es/src/charts/Geomap/applyLayout.js.map +1 -1
- package/es/src/charts/Geomap/basemapTheme.js +78 -0
- package/es/src/charts/Geomap/basemapTheme.js.map +1 -0
- package/es/src/charts/Geomap/emit.js +18 -9
- package/es/src/charts/Geomap/emit.js.map +1 -1
- package/es/src/charts/Geomap/index.js +74 -105
- package/es/src/charts/Geomap/index.js.map +1 -1
- package/es/src/charts/Histogram/binData.js +225 -0
- package/es/src/charts/Histogram/binData.js.map +1 -0
- package/es/src/charts/Histogram/index.js +271 -0
- package/es/src/charts/Histogram/index.js.map +1 -0
- package/es/src/charts/LinePlot/index.js +1 -2
- package/es/src/charts/LinePlot/index.js.map +1 -1
- package/es/src/charts/Matrix/emit.js +6 -0
- package/es/src/charts/Matrix/emit.js.map +1 -1
- package/es/src/charts/Matrix/index.js +1 -2
- package/es/src/charts/Matrix/index.js.map +1 -1
- package/es/src/charts/Network/applyLayout.js +52 -4
- package/es/src/charts/Network/applyLayout.js.map +1 -1
- package/es/src/charts/Network/emit.js +61 -27
- package/es/src/charts/Network/emit.js.map +1 -1
- package/es/src/charts/Network/index.js +40 -55
- package/es/src/charts/Network/index.js.map +1 -1
- package/es/src/charts/Pack/emit.js +40 -2
- package/es/src/charts/Pack/emit.js.map +1 -1
- package/es/src/charts/Pack/index.js +14 -2
- package/es/src/charts/Pack/index.js.map +1 -1
- package/es/src/charts/Pie/applyLayout.js +20 -2
- package/es/src/charts/Pie/applyLayout.js.map +1 -1
- package/es/src/charts/Pie/emit.js +277 -32
- package/es/src/charts/Pie/emit.js.map +1 -1
- package/es/src/charts/Pie/index.js +47 -3
- package/es/src/charts/Pie/index.js.map +1 -1
- package/es/src/charts/Plot/discreteSpan.js +42 -0
- package/es/src/charts/Plot/discreteSpan.js.map +1 -0
- package/es/src/charts/Plot/draw.js +3 -1
- package/es/src/charts/Plot/draw.js.map +1 -1
- package/es/src/charts/Plot/index.js +152 -17
- package/es/src/charts/Plot/index.js.map +1 -1
- package/es/src/charts/Plot/pipeline.js +48 -22
- package/es/src/charts/Plot/pipeline.js.map +1 -1
- package/es/src/charts/Plot/pipelineDomains.js +84 -8
- package/es/src/charts/Plot/pipelineDomains.js.map +1 -1
- package/es/src/charts/Plot/plotZoom.js +278 -0
- package/es/src/charts/Plot/plotZoom.js.map +1 -0
- package/es/src/charts/Plot/shapeDefaults.js +3 -3
- package/es/src/charts/Plot/shapeDefaults.js.map +1 -1
- package/es/src/charts/Plot/sharedHover.js +431 -0
- package/es/src/charts/Plot/sharedHover.js.map +1 -0
- package/es/src/charts/Plot/sharedHoverScene.js +230 -0
- package/es/src/charts/Plot/sharedHoverScene.js.map +1 -0
- package/es/src/charts/Plot/sharedTooltip.js +163 -0
- package/es/src/charts/Plot/sharedTooltip.js.map +1 -0
- package/es/src/charts/Plot/stackShareLabels.js +137 -0
- package/es/src/charts/Plot/stackShareLabels.js.map +1 -0
- package/es/src/charts/Plot/stackShareTooltip.js +31 -0
- package/es/src/charts/Plot/stackShareTooltip.js.map +1 -0
- package/es/src/charts/Plot/trendLines.js +367 -0
- package/es/src/charts/Plot/trendLines.js.map +1 -0
- package/es/src/charts/Plot/trendScene.js +220 -0
- package/es/src/charts/Plot/trendScene.js.map +1 -0
- package/es/src/charts/Plot/trendTooltip.js +160 -0
- package/es/src/charts/Plot/trendTooltip.js.map +1 -0
- package/es/src/charts/Priestley/emit.js +36 -3
- package/es/src/charts/Priestley/emit.js.map +1 -1
- package/es/src/charts/Priestley/index.js +1 -2
- package/es/src/charts/Priestley/index.js.map +1 -1
- package/es/src/charts/Radar/emit.js +4 -1
- package/es/src/charts/Radar/emit.js.map +1 -1
- package/es/src/charts/Radar/index.js +16 -4
- package/es/src/charts/Radar/index.js.map +1 -1
- package/es/src/charts/RadialMatrix/emit.js +6 -0
- package/es/src/charts/RadialMatrix/emit.js.map +1 -1
- package/es/src/charts/RadialMatrix/index.js +18 -3
- package/es/src/charts/RadialMatrix/index.js.map +1 -1
- package/es/src/charts/Rings/applyLayout.js +72 -116
- package/es/src/charts/Rings/applyLayout.js.map +1 -1
- package/es/src/charts/Rings/emit.js +75 -10
- package/es/src/charts/Rings/emit.js.map +1 -1
- package/es/src/charts/Rings/index.js +24 -5
- package/es/src/charts/Rings/index.js.map +1 -1
- package/es/src/charts/Rings/ringsSizing.js +189 -0
- package/es/src/charts/Rings/ringsSizing.js.map +1 -0
- package/es/src/charts/Sankey/emit.js +55 -11
- package/es/src/charts/Sankey/emit.js.map +1 -1
- package/es/src/charts/Sankey/index.js +8 -2
- package/es/src/charts/Sankey/index.js.map +1 -1
- package/es/src/charts/StackedArea/index.js +9 -3
- package/es/src/charts/StackedArea/index.js.map +1 -1
- package/es/src/charts/Tree/emit.js +10 -4
- package/es/src/charts/Tree/emit.js.map +1 -1
- package/es/src/charts/Tree/index.js +6 -5
- package/es/src/charts/Tree/index.js.map +1 -1
- package/es/src/charts/Treemap/emit.js +56 -3
- package/es/src/charts/Treemap/emit.js.map +1 -1
- package/es/src/charts/Treemap/index.js +1 -2
- package/es/src/charts/Treemap/index.js.map +1 -1
- package/es/src/charts/definition/ChartDefinition.js.map +1 -1
- package/es/src/charts/definition/makeChart.js +8 -1
- package/es/src/charts/definition/makeChart.js.map +1 -1
- package/es/src/charts/drawSteps/backControl.js +85 -0
- package/es/src/charts/drawSteps/backControl.js.map +1 -0
- package/es/src/charts/drawSteps/bottomRightControls.js +193 -0
- package/es/src/charts/drawSteps/bottomRightControls.js.map +1 -0
- package/es/src/charts/drawSteps/bottomRightControlsMarkup.js +161 -0
- package/es/src/charts/drawSteps/bottomRightControlsMarkup.js.map +1 -0
- package/es/src/charts/drawSteps/controlButtonStyle.js +108 -0
- package/es/src/charts/drawSteps/controlButtonStyle.js.map +1 -0
- package/es/src/charts/drawSteps/minimap.js +395 -0
- package/es/src/charts/drawSteps/minimap.js.map +1 -0
- package/es/src/charts/drawSteps/minimapMarkup.js +147 -0
- package/es/src/charts/drawSteps/minimapMarkup.js.map +1 -0
- package/es/src/charts/drawSteps/searchControls.js +358 -0
- package/es/src/charts/drawSteps/searchControls.js.map +1 -0
- package/es/src/charts/drawSteps/searchControlsMarkup.js +430 -0
- package/es/src/charts/drawSteps/searchControlsMarkup.js.map +1 -0
- package/es/src/charts/drawSteps/tableView.js +173 -0
- package/es/src/charts/drawSteps/tableView.js.map +1 -0
- package/es/src/charts/drawSteps/tableViewControl.js +39 -0
- package/es/src/charts/drawSteps/tableViewControl.js.map +1 -0
- package/es/src/charts/drawSteps/tableViewMarkup.js +647 -0
- package/es/src/charts/drawSteps/tableViewMarkup.js.map +1 -0
- package/es/src/charts/drawSteps/topLeftControls.js +73 -0
- package/es/src/charts/drawSteps/topLeftControls.js.map +1 -0
- package/es/src/charts/drawSteps/topLeftControlsMarkup.js +227 -0
- package/es/src/charts/drawSteps/topLeftControlsMarkup.js.map +1 -0
- package/es/src/charts/drawSteps/zoomControls.js +317 -175
- package/es/src/charts/drawSteps/zoomControls.js.map +1 -1
- package/es/src/charts/drawSteps/zoomControlsMarkup.js +280 -0
- package/es/src/charts/drawSteps/zoomControlsMarkup.js.map +1 -0
- package/es/src/charts/events/click.shape.js +24 -1
- package/es/src/charts/events/click.shape.js.map +1 -1
- package/es/src/charts/events/mouseenter.js +3 -0
- package/es/src/charts/events/mouseenter.js.map +1 -1
- package/es/src/charts/events/mouseleave.js +3 -0
- package/es/src/charts/events/mouseleave.js.map +1 -1
- package/es/src/charts/events/mousemove.shape.js +2 -0
- package/es/src/charts/events/mousemove.shape.js.map +1 -1
- package/es/src/charts/features/attributionFeature.js +137 -0
- package/es/src/charts/features/attributionFeature.js.map +1 -0
- package/es/src/charts/features/axes.js +24 -9
- package/es/src/charts/features/axes.js.map +1 -1
- package/es/src/charts/features/chartGeometry.js +16 -2
- package/es/src/charts/features/chartGeometry.js.map +1 -1
- package/es/src/charts/features/edgeArrows.js +155 -0
- package/es/src/charts/features/edgeArrows.js.map +1 -0
- package/es/src/charts/features/emitHelpers.js +32 -0
- package/es/src/charts/features/emitHelpers.js.map +1 -1
- package/es/src/charts/features/ensureZoomDom.js +63 -12
- package/es/src/charts/features/ensureZoomDom.js.map +1 -1
- package/es/src/charts/features/features.js +89 -112
- package/es/src/charts/features/features.js.map +1 -1
- package/es/src/charts/features/featuresLegend.js +53 -17
- package/es/src/charts/features/featuresLegend.js.map +1 -1
- package/es/src/charts/features/plotPaint.js +81 -29
- package/es/src/charts/features/plotPaint.js.map +1 -1
- package/es/src/charts/features/shapeEmit.js +20 -2
- package/es/src/charts/features/shapeEmit.js.map +1 -1
- package/es/src/charts/features/zoomExtent.js +185 -0
- package/es/src/charts/features/zoomExtent.js.map +1 -0
- package/es/src/charts/helpers/tileAttributions.js +26 -0
- package/es/src/charts/helpers/tileAttributions.js.map +1 -1
- package/es/src/charts/index.js +2 -0
- package/es/src/charts/index.js.map +1 -1
- package/es/src/charts/pipeline/drillMorph.js +159 -0
- package/es/src/charts/pipeline/drillMorph.js.map +1 -0
- package/es/src/charts/pipeline/runChartDraw.js +35 -1
- package/es/src/charts/pipeline/runChartDraw.js.map +1 -1
- package/es/src/charts/pipeline/runVizPipeline.js +49 -15
- package/es/src/charts/pipeline/runVizPipeline.js.map +1 -1
- package/es/src/charts/pipeline/vizDrawPure.js +52 -6
- package/es/src/charts/pipeline/vizDrawPure.js.map +1 -1
- package/es/src/charts/viz/Viz.js +103 -59
- package/es/src/charts/viz/Viz.js.map +1 -1
- package/es/src/charts/viz/VizBase.js +186 -5
- package/es/src/charts/viz/VizBase.js.map +1 -1
- package/es/src/charts/viz/VizBaseConfig.js +41 -3
- package/es/src/charts/viz/VizBaseConfig.js.map +1 -1
- package/es/src/charts/viz/ordinalColor.js +2 -2
- package/es/src/charts/viz/ordinalColor.js.map +1 -1
- package/es/src/charts/viz/vizDefaults.js +270 -58
- package/es/src/charts/viz/vizDefaults.js.map +1 -1
- package/es/src/charts/viz/vizRender.js +54 -4
- package/es/src/charts/viz/vizRender.js.map +1 -1
- package/es/src/charts/viz/vizTypes.js.map +1 -1
- package/es/src/charts/viz/vizVisibility.js +145 -0
- package/es/src/charts/viz/vizVisibility.js.map +1 -0
- package/es/src/components/Axis/Axis.js +18 -9
- package/es/src/components/Axis/Axis.js.map +1 -1
- package/es/src/components/Axis/axisLayoutLabels.js +2 -1
- package/es/src/components/Axis/axisLayoutLabels.js.map +1 -1
- package/es/src/components/Axis/axisRender.js +5 -1
- package/es/src/components/Axis/axisRender.js.map +1 -1
- package/es/src/components/ColorScale/ColorScale.js +11 -11
- package/es/src/components/ColorScale/ColorScale.js.map +1 -1
- package/es/src/components/ColorScale/colorScaleScale.js +22 -10
- package/es/src/components/ColorScale/colorScaleScale.js.map +1 -1
- package/es/src/components/Legend/Legend.js +8 -5
- package/es/src/components/Legend/Legend.js.map +1 -1
- package/es/src/components/Legend/legendConfig.js +87 -21
- package/es/src/components/Legend/legendConfig.js.map +1 -1
- package/es/src/components/Legend/legendRender.js +29 -22
- package/es/src/components/Legend/legendRender.js.map +1 -1
- package/es/src/components/SizeLegend/SizeLegend.js +411 -0
- package/es/src/components/SizeLegend/SizeLegend.js.map +1 -0
- package/es/src/components/SizeLegend/sizeLegendLayout.js +285 -0
- package/es/src/components/SizeLegend/sizeLegendLayout.js.map +1 -0
- package/es/src/components/Timeline/timelineConfig.js +8 -4
- package/es/src/components/Timeline/timelineConfig.js.map +1 -1
- package/es/src/components/Timeline/timelineRender.js +1 -2
- package/es/src/components/Timeline/timelineRender.js.map +1 -1
- package/es/src/components/Tooltip.js +27 -7
- package/es/src/components/Tooltip.js.map +1 -1
- package/es/src/components/index.js +1 -0
- package/es/src/components/index.js.map +1 -1
- package/es/src/shapes/Box.js +4 -2
- package/es/src/shapes/Box.js.map +1 -1
- package/es/src/shapes/Shape.js +1 -1
- package/es/src/shapes/Shape.js.map +1 -1
- package/es/src/shapes/Whisker.js +3 -2
- package/es/src/shapes/Whisker.js.map +1 -1
- package/es/src/shapes/validateShapeConfig.js +141 -0
- package/es/src/shapes/validateShapeConfig.js.map +1 -0
- package/es/src/utils/BaseClass.js +134 -4
- package/es/src/utils/BaseClass.js.map +1 -1
- package/es/src/utils/D3plusConfig.js.map +1 -1
- package/es/src/utils/configDefault.js +17 -0
- package/es/src/utils/configDefault.js.map +1 -0
- package/es/src/utils/configPrep.js +2 -1
- package/es/src/utils/configPrep.js.map +1 -1
- package/es/src/utils/configWarnings.js +37 -0
- package/es/src/utils/configWarnings.js.map +1 -0
- package/es/src/utils/index.js +1 -0
- package/es/src/utils/index.js.map +1 -1
- package/package.json +13 -11
- package/types/index.d.ts +4 -4
- package/types/internal.d.ts +16 -2
- package/types/src/charts/BarChart/index.d.ts +2 -1
- package/types/src/charts/Chord/applyLayout.d.ts +43 -0
- package/types/src/charts/Chord/emit.d.ts +10 -0
- package/types/src/charts/Chord/index.d.ts +19 -0
- package/types/src/charts/Geomap/applyLayout.d.ts +9 -1
- package/types/src/charts/Geomap/basemapTheme.d.ts +35 -0
- package/types/src/charts/Histogram/binData.d.ts +37 -0
- package/types/src/charts/Histogram/index.d.ts +14 -0
- package/types/src/charts/Network/applyLayout.d.ts +8 -0
- package/types/src/charts/Plot/discreteSpan.d.ts +9 -0
- package/types/src/charts/Plot/index.d.ts +51 -3
- package/types/src/charts/Plot/pipeline.d.ts +14 -0
- package/types/src/charts/Plot/plotZoom.d.ts +65 -0
- package/types/src/charts/Plot/sharedHover.d.ts +79 -0
- package/types/src/charts/Plot/sharedHoverScene.d.ts +11 -0
- package/types/src/charts/Plot/sharedTooltip.d.ts +26 -0
- package/types/src/charts/Plot/stackShareLabels.d.ts +21 -0
- package/types/src/charts/Plot/stackShareTooltip.d.ts +9 -0
- package/types/src/charts/Plot/trendLines.d.ts +70 -0
- package/types/src/charts/Plot/trendScene.d.ts +18 -0
- package/types/src/charts/Plot/trendTooltip.d.ts +19 -0
- package/types/src/charts/Rings/applyLayout.d.ts +9 -0
- package/types/src/charts/Rings/ringsSizing.d.ts +49 -0
- package/types/src/charts/StackedArea/index.d.ts +2 -1
- package/types/src/charts/definition/ChartDefinition.d.ts +33 -1
- package/types/src/charts/definition/makeChart.d.ts +2 -1
- package/types/src/charts/drawSteps/backControl.d.ts +29 -0
- package/types/src/charts/drawSteps/bottomRightControls.d.ts +26 -0
- package/types/src/charts/drawSteps/bottomRightControlsMarkup.d.ts +108 -0
- package/types/src/charts/drawSteps/controlButtonStyle.d.ts +45 -0
- package/types/src/charts/drawSteps/minimap.d.ts +19 -0
- package/types/src/charts/drawSteps/minimapMarkup.d.ts +45 -0
- package/types/src/charts/drawSteps/searchControls.d.ts +3 -0
- package/types/src/charts/drawSteps/searchControlsMarkup.d.ts +111 -0
- package/types/src/charts/drawSteps/tableView.d.ts +23 -0
- package/types/src/charts/drawSteps/tableViewControl.d.ts +21 -0
- package/types/src/charts/drawSteps/tableViewMarkup.d.ts +119 -0
- package/types/src/charts/drawSteps/topLeftControls.d.ts +32 -0
- package/types/src/charts/drawSteps/topLeftControlsMarkup.d.ts +72 -0
- package/types/src/charts/drawSteps/zoomControls.d.ts +48 -8
- package/types/src/charts/drawSteps/zoomControlsMarkup.d.ts +138 -0
- package/types/src/charts/features/attributionFeature.d.ts +21 -0
- package/types/src/charts/features/axes.d.ts +1 -1
- package/types/src/charts/features/chartGeometry.d.ts +9 -3
- package/types/src/charts/features/edgeArrows.d.ts +92 -0
- package/types/src/charts/features/emitHelpers.d.ts +19 -0
- package/types/src/charts/features/ensureZoomDom.d.ts +6 -2
- package/types/src/charts/features/features.d.ts +32 -17
- package/types/src/charts/features/featuresLegend.d.ts +15 -0
- package/types/src/charts/features/plotPaint.d.ts +40 -2
- package/types/src/charts/features/zoomExtent.d.ts +25 -0
- package/types/src/charts/index.d.ts +2 -0
- package/types/src/charts/pipeline/drillMorph.d.ts +29 -0
- package/types/src/charts/pipeline/runVizPipeline.d.ts +14 -3
- package/types/src/charts/viz/Viz.d.ts +18 -1
- package/types/src/charts/viz/VizBase.d.ts +99 -4
- package/types/src/charts/viz/VizBaseConfig.d.ts +25 -3
- package/types/src/charts/viz/vizDefaults.d.ts +155 -0
- package/types/src/charts/viz/vizTypes.d.ts +204 -4
- package/types/src/charts/viz/vizVisibility.d.ts +34 -0
- package/types/src/components/Axis/Axis.d.ts +2 -0
- package/types/src/components/Legend/legendRender.d.ts +8 -2
- package/types/src/components/SizeLegend/SizeLegend.d.ts +107 -0
- package/types/src/components/SizeLegend/sizeLegendLayout.d.ts +101 -0
- package/types/src/components/Tooltip.d.ts +18 -3
- package/types/src/components/index.d.ts +1 -0
- package/types/src/shapes/validateShapeConfig.d.ts +10 -0
- package/types/src/utils/BaseClass.d.ts +15 -1
- package/types/src/utils/D3plusConfig.d.ts +200 -8
- package/types/src/utils/configDefault.d.ts +11 -0
- package/types/src/utils/configWarnings.d.ts +28 -0
- package/types/src/utils/index.d.ts +2 -1
- package/umd/d3plus-core.full.js +44507 -35766
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +7073 -4410
- package/umd/d3plus-core.js +16718 -9634
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +4615 -2322
|
@@ -73,6 +73,17 @@ export declare function paintFromShapeConfig(sc: Record<string, unknown>, d: Dat
|
|
|
73
73
|
opacity?: number;
|
|
74
74
|
vectorEffect?: "none" | "non-scaling-stroke";
|
|
75
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
Resolve a layout node's `drawLabel` text, unwrapping the `{data, i}`
|
|
78
|
+
wrapper the emit-side layout nodes carry (Network/Rings/Sankey/Tree
|
|
79
|
+
convention — same unwrap `paintFromShapeConfig` callers already do).
|
|
80
|
+
*/
|
|
81
|
+
export declare function drawNodeLabel(viz: {
|
|
82
|
+
_drawLabel: (d: DataPoint, i: number) => string;
|
|
83
|
+
}, d: DataPoint & {
|
|
84
|
+
data?: DataPoint;
|
|
85
|
+
i?: number;
|
|
86
|
+
}, i: number): string;
|
|
76
87
|
/**
|
|
77
88
|
Apply a shape-config object to a chart-specific shape key, returning the
|
|
78
89
|
configPrep-massaged object suitable for `.config(...)`. Equivalent to
|
|
@@ -86,6 +97,14 @@ export declare function paintFromShapeConfig(sc: Record<string, unknown>, d: Dat
|
|
|
86
97
|
uses `"edge"` instead.
|
|
87
98
|
*/
|
|
88
99
|
export declare function shapeConfigFor(viz: VizLike, shapeKey: string, config?: Record<string, unknown>, kind?: string): Record<string, unknown>;
|
|
100
|
+
/**
|
|
101
|
+
The user's label config for one shape kind — `shapeConfig.labelConfig`
|
|
102
|
+
overlaid with `shapeConfig[shapeKey].labelConfig`, data-wrapped the same
|
|
103
|
+
way the Shape path wraps it. Spread it over a chart's own label defaults so
|
|
104
|
+
user settings (including `fontFamily()`) win. Library-seeded defaults are
|
|
105
|
+
left out so they don't override the chart's.
|
|
106
|
+
*/
|
|
107
|
+
export declare function userLabelConfig(viz: VizLike, shapeKey: string): Record<string, unknown>;
|
|
89
108
|
/**
|
|
90
109
|
Run `shape.render()` in compute mode and collect the resulting scene
|
|
91
110
|
nodes — shape children and/or label children — in a single flat array.
|
|
@@ -22,9 +22,13 @@
|
|
|
22
22
|
it's the documented home for the imperative half of v4 zoom.
|
|
23
23
|
*/
|
|
24
24
|
import type { VizInstance as Viz } from "../viz/vizTypes.js";
|
|
25
|
-
export type ZoomDomKind = "network" | "geomap";
|
|
25
|
+
export type ZoomDomKind = "network" | "geomap" | "generic";
|
|
26
26
|
interface SetupOpts {
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
"network" or "geomap" — picks the css class + behavior tweaks. "generic"
|
|
29
|
+
is the bare surface (zoom group + brush host) every other chart gets
|
|
30
|
+
when `zoom` is enabled.
|
|
31
|
+
*/
|
|
28
32
|
kind: ZoomDomKind;
|
|
29
33
|
/** Chart-area width (margin-adjusted). */
|
|
30
34
|
width: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SceneNode } from "@d3plus/render";
|
|
2
2
|
import type { VizContext } from "../pipeline/stages.js";
|
|
3
|
+
import type { VizInstance } from "../viz/vizTypes.js";
|
|
3
4
|
/** A margin claim, in pixels along each side. Unclaimed sides default to 0. */
|
|
4
5
|
export interface MarginClaim {
|
|
5
6
|
top?: number;
|
|
@@ -102,6 +103,36 @@ export declare function sanitizePosition(raw: unknown): PanelPosition;
|
|
|
102
103
|
the math first, then improve.
|
|
103
104
|
*/
|
|
104
105
|
export declare function runLayout(ctx: VizContext, features: FeatureModule[], baseMargin?: Required<MarginClaim>): LayoutResult;
|
|
106
|
+
/**
|
|
107
|
+
How far content starting `top` px down the chart, whose right edge sits
|
|
108
|
+
`right` px in from the chart's right edge, must pull in its right edge to
|
|
109
|
+
clear the zoom-control panel pinned to the chart's top-right corner. Zero
|
|
110
|
+
when the chart shows no controls or the content starts below them.
|
|
111
|
+
*/
|
|
112
|
+
export declare function zoomControlsInset(viz: VizInstance, top: number, right: number): number;
|
|
113
|
+
/**
|
|
114
|
+
The left-side mirror of `zoomControlsInset`: how far content starting
|
|
115
|
+
`top` px down the chart, whose left edge sits `left` px in from the
|
|
116
|
+
chart's left edge, must pull in to clear the shared top-left controls
|
|
117
|
+
panel (back / table-view / search). Zero when nothing is showing there
|
|
118
|
+
or content starts below the panel's height.
|
|
119
|
+
*/
|
|
120
|
+
export declare function topLeftControlsInset(viz: VizInstance, top: number, left: number): number;
|
|
121
|
+
/**
|
|
122
|
+
The combined left+right corner-panel insets for content starting `top`
|
|
123
|
+
px down the chart, plus the single symmetric amount CENTERED content
|
|
124
|
+
should inset both sides by to stay centered on the full chart width even
|
|
125
|
+
when only one corner has something to avoid (the larger of the two —
|
|
126
|
+
see `textBlockLayout`'s doc comment for why). Shared by `textBlockLayout`
|
|
127
|
+
(title/subtitle/total) and the legend's own top-position layout
|
|
128
|
+
(`featuresLegend.ts`), which independently needed this exact same
|
|
129
|
+
"combine the two corners' insets" math before this existed.
|
|
130
|
+
*/
|
|
131
|
+
export declare function cornerInsets(viz: VizInstance, top: number, left: number, right: number): {
|
|
132
|
+
left: number;
|
|
133
|
+
right: number;
|
|
134
|
+
symmetric: number;
|
|
135
|
+
};
|
|
105
136
|
/**
|
|
106
137
|
Title as a FeatureModule. Uses `_titleClass._textData()` for height
|
|
107
138
|
(pure compute, no DOM) and returns the margin claim explicitly.
|
|
@@ -109,12 +140,6 @@ export declare function runLayout(ctx: VizContext, features: FeatureModule[], ba
|
|
|
109
140
|
export declare const titleFeature: FeatureModule;
|
|
110
141
|
/** Converts `drawSubtitle.ts` to a FeatureModule. Mirrors titleFeature. */
|
|
111
142
|
export declare const subtitleFeature: FeatureModule;
|
|
112
|
-
/**
|
|
113
|
-
Converts `drawBack.ts` to a FeatureModule. Visible only when there are
|
|
114
|
-
drill-down history entries; emits a "← Back" TextNode at the chart's
|
|
115
|
-
top-left and claims its line height + padding × 2 from `margin.top`.
|
|
116
|
-
*/
|
|
117
|
-
export declare const backFeature: FeatureModule;
|
|
118
143
|
export { legendFeature } from "./featuresLegend.js";
|
|
119
144
|
/**
|
|
120
145
|
Converts `drawTimeline.ts` to a FeatureModule.
|
|
@@ -133,17 +158,7 @@ export declare const timelineFeature: FeatureModule;
|
|
|
133
158
|
claims margin along its position side.
|
|
134
159
|
*/
|
|
135
160
|
export declare const colorScaleFeature: FeatureModule;
|
|
136
|
-
|
|
137
|
-
Converts `drawAttribution.ts` to a FeatureModule.
|
|
138
|
-
|
|
139
|
-
Attribution is an HTML `<div>` overlay positioned absolutely outside the SVG
|
|
140
|
-
plane — it doesn't fit naturally as a SceneNode in the chart scene graph.
|
|
141
|
-
Rather than encode an HTML overlay into the scene graph, this feature runs
|
|
142
|
-
the DOM-creating side effect imperatively from inside `layout()`, so
|
|
143
|
-
invocation is funneled through `runLayout` for consistency with the
|
|
144
|
-
other features. It claims zero margin and emits no panel.
|
|
145
|
-
*/
|
|
146
|
-
export declare const attributionFeature: FeatureModule;
|
|
161
|
+
export { attributionFeature } from "./attributionFeature.js";
|
|
147
162
|
/**
|
|
148
163
|
Converts `drawTotal.ts` to a FeatureModule. Slightly different from title/
|
|
149
164
|
subtitle: the text comes from `sum()` over the filtered data when `_total`
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
import type { DataPoint } from "@d3plus/data";
|
|
1
2
|
import type { FeatureModule } from "./features.js";
|
|
3
|
+
import type { VizInstance } from "../viz/vizTypes.js";
|
|
4
|
+
interface LegendData {
|
|
5
|
+
legendData: DataPoint[];
|
|
6
|
+
legendKey: (d: DataPoint, i: number) => string;
|
|
7
|
+
getAttr: (d: DataPoint, i: number, attr: string) => string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
Rolls filtered legend data up by paint attributes, sorts it, and computes
|
|
11
|
+
`viz._legendDepth` (the lowest groupBy level whose values are unique).
|
|
12
|
+
Returns the `legendData` array plus the `fill`/`getAttr` accessors the
|
|
13
|
+
render step reuses.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildLegendData(viz: VizInstance): LegendData;
|
|
2
16
|
/**
|
|
3
17
|
Converts `drawLegend.ts` to a FeatureModule.
|
|
4
18
|
|
|
@@ -10,3 +24,4 @@ import type { FeatureModule } from "./features.js";
|
|
|
10
24
|
scene composition for Legend happens via Viz.toScene's `components` array.
|
|
11
25
|
*/
|
|
12
26
|
export declare const legendFeature: FeatureModule;
|
|
27
|
+
export {};
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
destructure block below for the full schema.
|
|
12
12
|
*/
|
|
13
13
|
import type { DataPoint } from "@d3plus/data";
|
|
14
|
-
import type { SceneNode } from "@d3plus/render";
|
|
14
|
+
import type { ClipShape, SceneNode } from "@d3plus/render";
|
|
15
15
|
import type Axis from "../../components/Axis/Axis.js";
|
|
16
|
+
import * as shapes from "../../shapes/index.js";
|
|
16
17
|
import type { VizInstance as Viz } from "../viz/vizTypes.js";
|
|
17
18
|
/** An axis position function: maps a domain value to a pixel coordinate. */
|
|
18
19
|
export type PlotAxisFn = (d: unknown, axis?: string) => number;
|
|
@@ -52,6 +53,12 @@ export interface PlotDatum {
|
|
|
52
53
|
hci?: number;
|
|
53
54
|
[key: string]: unknown;
|
|
54
55
|
}
|
|
56
|
+
/** A user annotation: a shape key plus its config, optionally z-layered. */
|
|
57
|
+
export interface Annotation {
|
|
58
|
+
shape: string;
|
|
59
|
+
layer?: string;
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
}
|
|
55
62
|
/**
|
|
56
63
|
Cross-phase locals threaded from `Plot._draw` (and its extracted pipeline
|
|
57
64
|
stages) into `plotPaint` — the contract any consumer of `plotPaint` must
|
|
@@ -155,6 +162,8 @@ export interface PlotPaintContext {
|
|
|
155
162
|
barLabels: string[];
|
|
156
163
|
showLineLabels: boolean;
|
|
157
164
|
stackGroup: unknown;
|
|
165
|
+
/** Per-axis config a zoom repaint layers over each production axis (see `Plot/plotZoom.ts`). */
|
|
166
|
+
zoomAxes?: Partial<Record<"x" | "x2" | "y" | "y2", Record<string, unknown>>>;
|
|
158
167
|
}
|
|
159
168
|
/**
|
|
160
169
|
Result of the MEASURE phase of plotPaint. Captures everything the EMIT
|
|
@@ -207,6 +216,24 @@ export interface PlotMeasureResult {
|
|
|
207
216
|
yOffset: number;
|
|
208
217
|
labelPositions: Record<string, number>;
|
|
209
218
|
}
|
|
219
|
+
/**
|
|
220
|
+
Wraps one annotation's scene in its OWN stable-keyed group, keeping the
|
|
221
|
+
shape's node group and label group as distinct sub-groups (rather than
|
|
222
|
+
flattening them into the chart-cell siblings, as `collectComputed` would).
|
|
223
|
+
|
|
224
|
+
The per-annotation `key` scopes the renderer's keyed join: ids reused
|
|
225
|
+
across different annotation shapes (e.g. "curve-mask" on both a Circle and
|
|
226
|
+
a Rect) no longer collide into one sibling list, so each annotation's nodes
|
|
227
|
+
match old→new by id frame-to-frame and TWEEN instead of exit/entering. The
|
|
228
|
+
subtree is marked inert (annotations never show tooltips).
|
|
229
|
+
*/
|
|
230
|
+
export declare function collectAnnotationGroup(inst: shapes.Shape, key: string): SceneNode | null;
|
|
231
|
+
/**
|
|
232
|
+
Renders one annotation in compute mode: the annotation's own config, with
|
|
233
|
+
positions mapped from data space through the plot's axis functions — the
|
|
234
|
+
same mapping user `annotations` get.
|
|
235
|
+
*/
|
|
236
|
+
export declare function renderPlotAnnotation(viz: Viz, annotation: Annotation, x: PlotAxisFn, y: PlotAxisFn, domains: Record<string, unknown[]>, yOffset: number): shapes.Shape;
|
|
210
237
|
/**
|
|
211
238
|
EMIT phase of plotPaint. Takes the `PlotMeasureResult` from
|
|
212
239
|
`renderAxes` and produces ALL the scene nodes: background rect,
|
|
@@ -215,7 +242,9 @@ export interface PlotMeasureResult {
|
|
|
215
242
|
Returns the flat `SceneNode[]` array that the caller (`Plot._paint`)
|
|
216
243
|
merges into `_chartScene`.
|
|
217
244
|
*/
|
|
218
|
-
export declare function plotEmit(viz: Viz, pCtx: PlotPaintContext, mCtx: PlotMeasureResult): SceneNode[];
|
|
245
|
+
export declare function plotEmit(viz: Viz, pCtx: PlotPaintContext, mCtx: PlotMeasureResult, clip?: ClipShape): SceneNode[];
|
|
246
|
+
/** Key of the group `plotEmit` wraps a zoomable plot's non-axis content in. */
|
|
247
|
+
export declare const PLOT_ZOOM_CONTENT_KEY = "plot-zoom-content";
|
|
219
248
|
/**
|
|
220
249
|
Plot paint phase as a free function — orchestrates the axis render +
|
|
221
250
|
EMIT.
|
|
@@ -231,3 +260,12 @@ export declare function plotEmit(viz: Viz, pCtx: PlotPaintContext, mCtx: PlotMea
|
|
|
231
260
|
@param pCtx Cross-phase locals produced by `Plot._draw`.
|
|
232
261
|
*/
|
|
233
262
|
export declare function plotPaint(viz: Viz, pCtx: PlotPaintContext): SceneNode[];
|
|
263
|
+
/**
|
|
264
|
+
`plotPaint` that also returns the solved axis layout, and accepts a
|
|
265
|
+
`frozen` layout to repaint against (plus a clip for the plot content) —
|
|
266
|
+
how a zoom repaints the plot with rescaled domains.
|
|
267
|
+
*/
|
|
268
|
+
export declare function plotPaintMeasured(viz: Viz, pCtx: PlotPaintContext, frozen?: PlotMeasureResult, clip?: ClipShape): {
|
|
269
|
+
nodes: SceneNode[];
|
|
270
|
+
layout: PlotMeasureResult;
|
|
271
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Automatic maximum zoom scale (#85): how far a chart can zoom depends on
|
|
3
|
+
what it draws. A network of a few large nodes needs little zoom, while a
|
|
4
|
+
detailed map should be able to zoom all the way into its smallest path.
|
|
5
|
+
|
|
6
|
+
@module
|
|
7
|
+
*/
|
|
8
|
+
import type { SceneNode } from "@d3plus/render";
|
|
9
|
+
/**
|
|
10
|
+
The zoom scale at which the chart's smallest data shape fills the chart
|
|
11
|
+
area (less `padding` on each side, matching `zoomToBounds`), floored at 1.
|
|
12
|
+
|
|
13
|
+
Data shapes are the top-level datum-bearing nodes of `_chartScene` (a
|
|
14
|
+
Line/Area series is measured per segment — see `nodeSizes`). Chart
|
|
15
|
+
decorations (axes, gridlines, radar spokes, …) are nested in groups, text
|
|
16
|
+
labels scale with the shapes they annotate, and `::hit` nodes duplicate
|
|
17
|
+
the geometry of the shape they belong to, so none of those are measured.
|
|
18
|
+
|
|
19
|
+
@param nodes The chart's `_chartScene`.
|
|
20
|
+
@param width Chart-area width.
|
|
21
|
+
@param height Chart-area height.
|
|
22
|
+
@param padding Pixel padding kept around a shape zoomed to fill the area.
|
|
23
|
+
@param baseScale Any scale the chart's own transform already applies.
|
|
24
|
+
*/
|
|
25
|
+
export declare function autoZoomMax(nodes: SceneNode[], width: number, height: number, padding: number, baseScale?: number): number;
|
|
@@ -2,8 +2,10 @@ export { default as AreaPlot } from "./AreaPlot/index.js";
|
|
|
2
2
|
export { default as BarChart } from "./BarChart/index.js";
|
|
3
3
|
export { default as BoxWhisker } from "./BoxWhisker/index.js";
|
|
4
4
|
export { default as BumpChart } from "./BumpChart/index.js";
|
|
5
|
+
export { default as Chord } from "./Chord/index.js";
|
|
5
6
|
export { default as Donut } from "./Donut/index.js";
|
|
6
7
|
export { default as Geomap } from "./Geomap/index.js";
|
|
8
|
+
export { default as Histogram } from "./Histogram/index.js";
|
|
7
9
|
export { default as LinePlot } from "./LinePlot/index.js";
|
|
8
10
|
export { default as Matrix } from "./Matrix/index.js";
|
|
9
11
|
export { default as Network } from "./Network/index.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
`resolveDrillMorph(viz)` — resolves the one-shot drill-down morph state
|
|
3
|
+
armed by `clickShape`'s forward capture or a Back click's reunion lookup
|
|
4
|
+
(see `events/click.shape.ts`, `viz/vizDefaults.ts`, `viz/Viz.ts`) into the
|
|
5
|
+
`_resolvedEnterFrom`/`_resolvedExitTo` boxes `_drawSceneToTarget` passes to
|
|
6
|
+
`drawScene`, using the *current* draw's `_bodyRect`/`_chartScene` — the
|
|
7
|
+
ones the layout/paint step just produced.
|
|
8
|
+
|
|
9
|
+
Chart-family-agnostic: every emitted rect/circle node already carries
|
|
10
|
+
`.datum`/`.index` (Treemap/Pack hand-built, or Plot's Shape-based), so the
|
|
11
|
+
Back-click reunion lookup needs no per-chart code — beyond unwrapping the
|
|
12
|
+
datum the same way every other interaction handler does (see
|
|
13
|
+
`unwrapDatum` below). Call once per draw, after `_draw()`/post-draw
|
|
14
|
+
features and before `_drawSceneToTarget()` (`runVizPipeline`) — by then
|
|
15
|
+
`_bodyRect`/`_chartScene` reflect the new frame, and both pending fields
|
|
16
|
+
are cleared unconditionally so a later, unrelated repaint (hover, resize,
|
|
17
|
+
legend toggle) never inherits a stale morph.
|
|
18
|
+
*/
|
|
19
|
+
import type { SceneNode, TransitionRect } from "@d3plus/render";
|
|
20
|
+
import type { VizInstance as Viz } from "../viz/vizTypes.js";
|
|
21
|
+
/**
|
|
22
|
+
A flip-eligible node's geometry as a plain bounding box — every type
|
|
23
|
+
`isFlipEligible` (render package) approves: rect, circle, the `AreaNode`
|
|
24
|
+
type, and a `path` node stamped `shapeType: "Area"` (StackedArea/
|
|
25
|
+
AreaPlot's actual band representation). Shared with `click.shape.ts`'s
|
|
26
|
+
forward capture, which needs the identical conversion for the clicked node.
|
|
27
|
+
*/
|
|
28
|
+
export declare function nodeRect(node: SceneNode): TransitionRect | null;
|
|
29
|
+
export declare function resolveDrillMorph(viz: Viz): void;
|
|
@@ -15,17 +15,28 @@
|
|
|
15
15
|
1. `viz._preDraw()` — data filtering + legend-data + drawDepth
|
|
16
16
|
2. `viz._draw()` — chart-specific layout + scene absorption
|
|
17
17
|
3. `zoomControls(viz)` — zoom HTML overlay (architectural carve-out)
|
|
18
|
-
4. `
|
|
19
|
-
5. `
|
|
18
|
+
4. `minimapFeature.layout(viz)` — zoomed-chart viewport indicator
|
|
19
|
+
5. `topLeftControlsFeature.layout(viz)` — back/table-view/search panel
|
|
20
|
+
5b. `bottomRightControlsFeature.layout(viz)` — size-legend corner panel
|
|
21
|
+
6. `attributionFeature.layout(viz)` — bottom-right attribution panel
|
|
22
|
+
7. `tableViewFeature.layout(viz)` — chart-sized data-table overlay
|
|
23
|
+
8. `viz._drawSceneToTarget()` — paint scene via SvgRenderer/CanvasRenderer
|
|
20
24
|
|
|
21
25
|
Future work:
|
|
22
26
|
- Extract a `ResolvedSpec` so step 1 takes (config) not (this).
|
|
23
27
|
- Decouple step 2 so it takes (ctx) not (this); stages already follow
|
|
24
28
|
this pattern but `_draw` itself doesn't.
|
|
25
|
-
- Replace step
|
|
29
|
+
- Replace step 8's `this._sceneRenderer` slot with a returned handle
|
|
26
30
|
so callers can pick/destroy/diff without instance lookup.
|
|
27
31
|
|
|
28
32
|
@param viz A Viz instance (or any subclass: Plot, Treemap, Pack, …).
|
|
29
33
|
*/
|
|
30
34
|
import type { VizInstance as Viz } from "../viz/vizTypes.js";
|
|
31
35
|
export declare function runVizPipeline(viz: Viz): void;
|
|
36
|
+
/**
|
|
37
|
+
Runs the post-draw features (see above) and appends their panels. Anything
|
|
38
|
+
that re-runs `viz._draw()` outside this pipeline — Rings re-centering on a
|
|
39
|
+
click, say — must call this after it: `_draw()` resets the feature panels,
|
|
40
|
+
so skipping it drops the corner controls, size legend, and attribution.
|
|
41
|
+
*/
|
|
42
|
+
export declare function runPostDrawFeatures(viz: Viz): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DataPoint } from "@d3plus/data";
|
|
2
2
|
import type { PickResult, Renderer, Scene, SceneEvent } from "@d3plus/render";
|
|
3
3
|
import VizBase from "./VizBase.js";
|
|
4
|
+
import type { SizeLegendScale } from "../../components/SizeLegend/sizeLegendLayout.js";
|
|
4
5
|
/**
|
|
5
6
|
Creates an x/y plot based on an array of data. See [this example](https://d3plus.org/examples/d3plus-treemap/getting-started/) for help getting started using the treemap generator.
|
|
6
7
|
*/
|
|
@@ -30,6 +31,15 @@ export default class Viz extends VizBase {
|
|
|
30
31
|
@private
|
|
31
32
|
*/
|
|
32
33
|
_draw(): void;
|
|
34
|
+
/**
|
|
35
|
+
The chart's size-legend radius scale (see `ChartDefinition.sizeLegendScale`).
|
|
36
|
+
Charts that size marks override this; the base chart sizes nothing.
|
|
37
|
+
@private
|
|
38
|
+
*/
|
|
39
|
+
_sizeLegendScale(_available: {
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
}): SizeLegendScale | null;
|
|
33
43
|
/**
|
|
34
44
|
* Applies the threshold algorithm according to the type of chart used.
|
|
35
45
|
* @param {Array} data The data to process.
|
|
@@ -113,6 +123,13 @@ export default class Viz extends VizBase {
|
|
|
113
123
|
i: number;
|
|
114
124
|
x: unknown;
|
|
115
125
|
};
|
|
126
|
+
/**
|
|
127
|
+
Pointer hook run by `_routeSceneEvent` before any handler routing, for
|
|
128
|
+
every event including ones over empty space. No-op here; Plot overrides
|
|
129
|
+
it to drive the shared multi-series tooltip and crosshair.
|
|
130
|
+
@private
|
|
131
|
+
*/
|
|
132
|
+
_sharedHover(_event: SceneEvent): void;
|
|
116
133
|
/**
|
|
117
134
|
Routes a renderer pointer event to the matching `viz.schema.on` handlers.
|
|
118
135
|
Bridges the v4 scene-rendered path (SvgRenderer/CanvasRenderer), where
|
|
@@ -135,7 +152,7 @@ export default class Viz extends VizBase {
|
|
|
135
152
|
*/
|
|
136
153
|
_scheduleSceneRepaint(): void;
|
|
137
154
|
/**
|
|
138
|
-
Tears down the visualization: disconnects the ResizeObserver and removes DOM event listeners. Call this when unmounting to avoid memory leaks.
|
|
155
|
+
Tears down the visualization: disconnects the ResizeObserver, stops listening for web font loads, and removes DOM event listeners. Call this when unmounting to avoid memory leaks.
|
|
139
156
|
*/
|
|
140
157
|
destroy(): this;
|
|
141
158
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { select } from "d3-selection";
|
|
2
2
|
import type { DataPoint } from "@d3plus/data";
|
|
3
3
|
import type { D3plusConfig } from "../../utils/index.js";
|
|
4
|
+
import type { ZoomControlIcons } from "../drawSteps/zoomControlsMarkup.js";
|
|
5
|
+
import type { SizeLegendScale, SizeLegendSize } from "../../components/SizeLegend/sizeLegendLayout.js";
|
|
4
6
|
import VizBaseConfig from "./VizBaseConfig.js";
|
|
5
7
|
/**
|
|
6
8
|
Second half of the fluent config accessors shared by every Viz chart
|
|
7
|
-
(`loadingHTML` through `
|
|
9
|
+
(`loadingHTML` through `tableViewPageSize`), extending `VizBaseConfig` which
|
|
8
10
|
holds the first half. Split purely so each file stays under the
|
|
9
11
|
`max-lines` budget; the methods remain real prototype methods, so
|
|
10
12
|
`BaseClass.config()` reflection and polymorphic `this` chaining are
|
|
@@ -27,6 +29,26 @@ export default class VizBase extends VizBaseConfig {
|
|
|
27
29
|
Defines the CSS style properties for the status message that is displayed when loading AJAX requests and displaying errors.
|
|
28
30
|
*/
|
|
29
31
|
messageStyle(_?: Record<string, unknown>): this | Record<string, unknown>;
|
|
32
|
+
/**
|
|
33
|
+
An additional CSS class name (or space-separated list of class names) applied to the minimap's outer box, viewport box, and zoom-level label, alongside their fixed `d3plus-minimap` / `d3plus-minimap-viewport` / `d3plus-minimap-label` classes. Setting this automatically disables d3plus's built-in inline `minimapStyle`/`minimapViewportStyle`/`minimapViewportStyleActive`/`minimapLabelStyle` defaults (as long as you haven't already customized them yourself), so a host page's own styling applies through the cascade with no other configuration needed.
|
|
34
|
+
*/
|
|
35
|
+
minimapClassName(_?: string): this | string;
|
|
36
|
+
/**
|
|
37
|
+
An object containing CSS key/value pairs that is used to style the minimap's zoom-level text label (e.g. "2x"). Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.minimapClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
38
|
+
*/
|
|
39
|
+
minimapLabelStyle(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
40
|
+
/**
|
|
41
|
+
An object containing CSS key/value pairs that is used to style the minimap's outer box (the full-scene overview). Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.minimapClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
42
|
+
*/
|
|
43
|
+
minimapStyle(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
44
|
+
/**
|
|
45
|
+
An object containing CSS key/value pairs that is used to style the minimap's draggable viewport box in its resting state. Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.minimapClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
46
|
+
*/
|
|
47
|
+
minimapViewportStyle(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
48
|
+
/**
|
|
49
|
+
An object containing CSS key/value pairs that is used to style the minimap's draggable viewport box while it's being dragged. Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.minimapClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
50
|
+
*/
|
|
51
|
+
minimapViewportStyleActive(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
30
52
|
/**
|
|
31
53
|
The inner HTML of the status message displayed when no data is supplied to the visualization. Must be a valid HTML string or a function that, when passed this Viz instance, returns a valid HTML string.
|
|
32
54
|
*/
|
|
@@ -39,6 +61,35 @@ export default class VizBase extends VizBaseConfig {
|
|
|
39
61
|
If using scroll or visibility detection, this method allow a custom override of the element to which the scroll detection function gets attached.
|
|
40
62
|
*/
|
|
41
63
|
scrollContainer(_?: string | HTMLElement | Window): this | string | HTMLElement | Window;
|
|
64
|
+
/**
|
|
65
|
+
Resolves the string the search box matches its typed term against, for
|
|
66
|
+
a given datum. Defaults to the mark's resolved on-screen label
|
|
67
|
+
(`viz._drawLabel`) — the same text the user reads on the chart.
|
|
68
|
+
Override it to match against something else instead, e.g. a data
|
|
69
|
+
field that isn't shown as the label.
|
|
70
|
+
|
|
71
|
+
This is checked alongside, not instead of, every level of the datum's
|
|
72
|
+
own groupBy hierarchy — searching a leaf's label also matches its
|
|
73
|
+
ancestor group's cell/legend entry, and vice versa, regardless of
|
|
74
|
+
this accessor's override.
|
|
75
|
+
*/
|
|
76
|
+
searchAccessor(_?: (d: DataPoint, i: number) => string): this | ((d: DataPoint, i: number) => string);
|
|
77
|
+
/**
|
|
78
|
+
An additional CSS class name (or space-separated list of class names) applied to the search toggle button and input, alongside their fixed `search-control` classes. Setting this automatically disables d3plus's built-in inline `searchControlStyle`/`searchControlStyleActive`/`searchControlStyleHover` defaults (as long as you haven't already customized them yourself), so a host page's own button styling — Tailwind, Bootstrap, a design system — applies through the cascade with no other configuration needed.
|
|
79
|
+
*/
|
|
80
|
+
searchControlClassName(_?: string): this | string;
|
|
81
|
+
/**
|
|
82
|
+
An object containing CSS key/value pairs that is used to style the search toggle button. Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.searchControlClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
83
|
+
*/
|
|
84
|
+
searchControlStyle(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
85
|
+
/**
|
|
86
|
+
An object containing CSS key/value pairs that is used to style the search toggle button while open. Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.searchControlClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
87
|
+
*/
|
|
88
|
+
searchControlStyleActive(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
89
|
+
/**
|
|
90
|
+
An object containing CSS key/value pairs that is used to style the search toggle button on hover. Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.searchControlClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
91
|
+
*/
|
|
92
|
+
searchControlStyleHover(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
42
93
|
/**
|
|
43
94
|
The SVG container element as a d3 selector or DOM element. Defaults to `undefined`.
|
|
44
95
|
*/
|
|
@@ -52,6 +103,18 @@ export default class VizBase extends VizBaseConfig {
|
|
|
52
103
|
*/
|
|
53
104
|
shapeConfig(): D3plusConfig;
|
|
54
105
|
shapeConfig(_: D3plusConfig): this;
|
|
106
|
+
/**
|
|
107
|
+
Whether to display the size legend: a nested-circle key, in the chart's bottom-right corner, for charts that size their marks with a `size` accessor (bubble plots, Geomap points via `pointSize`, Network, Rings). By default it shows whenever marks are sized by more than one value, unless it would take up more than a third of the chart's width or height. Pass `true` to always show it, `false` to hide it, or a function that receives the resolved chart config, the radius scale, and the legend's measured `{width, height, availableWidth, availableHeight}`, and returns a boolean.
|
|
108
|
+
*/
|
|
109
|
+
sizeLegend(_?: boolean | ((config: Record<string, unknown>, scale: SizeLegendScale, size: SizeLegendSize) => boolean)): this | boolean | ((config: Record<string, unknown>, scale: SizeLegendScale, size: SizeLegendSize) => boolean);
|
|
110
|
+
/**
|
|
111
|
+
Configuration object passed to the size legend's config method: `values` (an array of values to draw, or how many to pick), `tickFormat`, `title` (defaults to the `size` key when `size` is set to a string), `shapeConfig`, `lineConfig`, `labelConfig`, `titleConfig`, `padding`, `lineLength`, and `labelPadding`.
|
|
112
|
+
*/
|
|
113
|
+
sizeLegendConfig(_?: Record<string, unknown>): this | Record<string, unknown>;
|
|
114
|
+
/**
|
|
115
|
+
Which margin the size legend claims in the chart's bottom-right corner. `"right"` (the default) widens the right margin, so the chart keeps its full height and the legend sits at the bottom of the right column, below any right-side legend or colorScale. `"bottom"` deepens the bottom margin instead, so the chart keeps its full width and any bottom legend or colorScale narrows to sit beside it.
|
|
116
|
+
*/
|
|
117
|
+
sizeLegendPosition(_?: "right" | "bottom"): this | "right" | "bottom";
|
|
55
118
|
/**
|
|
56
119
|
Accessor function or string for the visualization's subtitle.
|
|
57
120
|
*/
|
|
@@ -142,19 +205,51 @@ export default class VizBase extends VizBaseConfig {
|
|
|
142
205
|
*/
|
|
143
206
|
zoomBrushSelectionStyle(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
144
207
|
/**
|
|
145
|
-
An
|
|
208
|
+
An additional CSS class name (or space-separated list of class names) applied to each zoom control button, alongside the fixed `zoom-control` / `zoom-in` / `zoom-out` / `zoom-reset` / `zoom-brush` classes. Setting this automatically disables d3plus's built-in inline `zoomControlStyle`/`zoomControlStyleActive`/`zoomControlStyleHover` defaults (as long as you haven't already customized them yourself), so a host page's own button styling — Tailwind, Bootstrap, a design system — applies through the cascade with no other configuration needed.
|
|
209
|
+
*/
|
|
210
|
+
zoomControlClassName(_?: string): this | string;
|
|
211
|
+
/**
|
|
212
|
+
Overrides one or more of the four built-in zoom-control icons (`zoomIn`, `zoomOut`, `zoomReset`, `zoomBrush`), which otherwise render as inline SVGs. Each value is either an HTML string — used as the button's content in place of the built-in icon — or a mount function, `(el: HTMLElement) => void | (() => void)`, called once with the button's reserved icon slot (a 12x12px element) so you can mount anything imperative into it: a React tree (`createRoot(el).render(<Icon/>)`), a Vue app, a canvas sprite, a brand `<img>`. Return a cleanup function from the mount function if there's teardown to do; it runs right before that slot is discarded — which happens whenever the whole button panel's markup regenerates (a `.locale(...)` change, a `zoomControlClassName` change, or the brush toggle switching), not just once per chart.
|
|
213
|
+
*/
|
|
214
|
+
zoomControlIcons(_?: ZoomControlIcons): this | ZoomControlIcons | undefined;
|
|
215
|
+
/**
|
|
216
|
+
An object containing CSS key/value pairs that is used to style each zoom control button (`.zoom-in`, `.zoom-out`, `.zoom-reset`, and `.zoom-brush`). Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.zoomControlClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
146
217
|
*/
|
|
147
218
|
zoomControlStyle(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
148
219
|
/**
|
|
149
|
-
An object containing CSS key/value pairs that is used to style each zoom control button when active (`.zoom-in`, `.zoom-out`, `.zoom-reset`, and `.zoom-brush`). Passing `false` will remove all default styling.
|
|
220
|
+
An object containing CSS key/value pairs that is used to style each zoom control button when active (`.zoom-in`, `.zoom-out`, `.zoom-reset`, and `.zoom-brush`). Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.zoomControlClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
150
221
|
*/
|
|
151
222
|
zoomControlStyleActive(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
152
223
|
/**
|
|
153
|
-
An object containing CSS key/value pairs that is used to style each zoom control button on hover (`.zoom-in`, `.zoom-out`, `.zoom-reset`, and `.zoom-brush`). Passing `false` will remove all default styling.
|
|
224
|
+
An object containing CSS key/value pairs that is used to style each zoom control button on hover (`.zoom-in`, `.zoom-out`, `.zoom-reset`, and `.zoom-brush`). Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.zoomControlClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
154
225
|
*/
|
|
155
226
|
zoomControlStyleHover(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
156
227
|
/**
|
|
157
228
|
A pixel value to be used to pad all sides of a zoomed area.
|
|
158
229
|
*/
|
|
159
230
|
zoomPadding(_?: number): this | number;
|
|
231
|
+
/**
|
|
232
|
+
An additional CSS class name (or space-separated list of class names) applied to the `<table>` element the table-view toggle renders, alongside the fixed `d3plus-table-view-table` class. Lets a host page style the data table with its own table styling (Tailwind, Bootstrap, a design system) via descendant selectors.
|
|
233
|
+
*/
|
|
234
|
+
tableViewClassName(_?: string): this | string;
|
|
235
|
+
/**
|
|
236
|
+
An additional CSS class name (or space-separated list of class names) applied to the table-view toggle button, alongside the fixed `table-view-control`/`table-view-toggle` classes. Setting this automatically disables d3plus's built-in inline `tableViewControlStyle`/`tableViewControlStyleActive`/`tableViewControlStyleHover` defaults (as long as you haven't already customized them yourself), so a host page's own button styling applies through the cascade with no other configuration needed.
|
|
237
|
+
*/
|
|
238
|
+
tableViewControlClassName(_?: string): this | string;
|
|
239
|
+
/**
|
|
240
|
+
An object containing CSS key/value pairs that is used to style the table-view toggle button. Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.tableViewControlClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
241
|
+
*/
|
|
242
|
+
tableViewControlStyle(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
243
|
+
/**
|
|
244
|
+
An object containing CSS key/value pairs that is used to style the table-view toggle button while it is active (showing the data table). Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.tableViewControlClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
245
|
+
*/
|
|
246
|
+
tableViewControlStyleActive(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
247
|
+
/**
|
|
248
|
+
An object containing CSS key/value pairs that is used to style the table-view toggle button on hover. Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.tableViewControlClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
249
|
+
*/
|
|
250
|
+
tableViewControlStyleHover(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
251
|
+
/**
|
|
252
|
+
The number of data-table rows shown per page while in table view. Set to `false` (or any non-positive number) to disable pagination and show every row on one page.
|
|
253
|
+
*/
|
|
254
|
+
tableViewPageSize(_?: number | false): this | number | false;
|
|
160
255
|
}
|
|
@@ -22,14 +22,30 @@ export default class VizBaseConfig extends BaseClass {
|
|
|
22
22
|
Sets text to be shown positioned absolute on top of the visualization in the bottom-right corner. This is most often used in Geomaps to display the copyright of map tiles. The text is rendered as HTML, so any valid HTML string will render as expected (eg. anchor links work).
|
|
23
23
|
*/
|
|
24
24
|
attribution(_?: string | boolean): this | string | boolean;
|
|
25
|
+
/**
|
|
26
|
+
Overrides the "ⓘ" icon a long attribution collapses to (see `attribution`), which otherwise renders as an inline SVG. Accepts an HTML string — used as the toggle button's content — or a mount function, `(el: HTMLElement) => void | (() => void)`, called once with the button's reserved icon slot so a live component (a React tree via `createRoot(el).render(...)`, or anything else imperative) can be mounted into it. A returned cleanup function runs right before that slot is discarded, which happens whenever the credit's markup regenerates (its text or theme changes), not just once per chart.
|
|
27
|
+
*/
|
|
28
|
+
attributionIcon(_?: string | ((el: HTMLElement) => void | (() => void))): this | string | ((el: HTMLElement) => void | (() => void)) | undefined;
|
|
25
29
|
/**
|
|
26
30
|
Configuration object for the attribution style.
|
|
27
31
|
*/
|
|
28
32
|
attributionStyle(_?: Record<string, unknown>): this | Record<string, unknown>;
|
|
29
33
|
/**
|
|
30
|
-
Configuration object for the back button.
|
|
34
|
+
Configuration object for the back button. Superseded by
|
|
35
|
+
`.backControlStyle()`/`.backControlClassName()` for the button's
|
|
36
|
+
appearance (it renders as a real `<button>`, like the zoom/search
|
|
37
|
+
controls, not a configurable text node) — kept for backwards
|
|
38
|
+
compatibility, but no longer affects how the button looks.
|
|
31
39
|
*/
|
|
32
40
|
backConfig(_?: Record<string, unknown>): this | Record<string, unknown>;
|
|
41
|
+
/**
|
|
42
|
+
An additional CSS class name (or space-separated list of class names) applied to the back button, alongside its fixed `back-control` class. Setting this automatically disables d3plus's built-in inline `backControlStyle` default (as long as you haven't already customized it yourself), so a host page's own button styling — Tailwind, Bootstrap, a design system — applies through the cascade with no other configuration needed.
|
|
43
|
+
*/
|
|
44
|
+
backControlClassName(_?: string): this | string;
|
|
45
|
+
/**
|
|
46
|
+
An object containing CSS key/value pairs that is used to style the back button. Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.backControlClassName(...)` is set, unless you've explicitly customized this yourself.
|
|
47
|
+
*/
|
|
48
|
+
backControlStyle(_?: Record<string, unknown> | false): this | Record<string, unknown> | false;
|
|
33
49
|
/**
|
|
34
50
|
Defines the main color to be used for each data point in a visualization. Can be either an accessor function or a string key to reference in each data point. If a color value is returned, it will be used as is. If a string is returned, a unique color will be assigned based on the string.
|
|
35
51
|
*/
|
|
@@ -83,9 +99,13 @@ export default class VizBaseConfig extends BaseClass {
|
|
|
83
99
|
*/
|
|
84
100
|
detectVisible(_?: boolean): this | boolean;
|
|
85
101
|
/**
|
|
86
|
-
The interval, in milliseconds, for checking if the visualization is visible on the page.
|
|
102
|
+
The interval, in milliseconds, for checking if the visualization is visible on the page. When `detectVisible` defers a render until the visualization scrolls into view, this is also how long it must stay in view before it renders, so visualizations scrolled past quickly are never drawn.
|
|
87
103
|
*/
|
|
88
104
|
detectVisibleInterval(_?: number): this | number;
|
|
105
|
+
/**
|
|
106
|
+
When `true` (the default) and `detectVisible` is enabled, the Viz releases its DOM and scene while it is scrolled out of view and redraws when it returns, keeping the page light when there are many visualizations. Data and configuration are retained; interaction state such as zoom or selection is not, so set this to `false` to keep it. With `detectVisible` enabled, each chart's `<svg>` is also given `content-visibility: auto`, so the browser skips rendering its contents while it is far off-screen (this matters most when this is `false` and charts are kept). For a larger saving you can also apply `content-visibility: auto` and a `contain-intrinsic-size` to the container element yourself; that adds paint containment to an element you own, so it is not done automatically. Requires `IntersectionObserver`.
|
|
107
|
+
*/
|
|
108
|
+
detectVisibleUnload(_?: boolean): this | boolean;
|
|
89
109
|
/**
|
|
90
110
|
Shows a button that allows for downloading the current visualization.
|
|
91
111
|
*/
|
|
@@ -127,7 +147,9 @@ export default class VizBaseConfig extends BaseClass {
|
|
|
127
147
|
*/
|
|
128
148
|
highlight(_?: ((d: DataPoint, i: number) => boolean) | false): this | ((d: DataPoint, i: number) => boolean) | false | undefined;
|
|
129
149
|
/**
|
|
130
|
-
Accessor function or
|
|
150
|
+
Accessor function, or a constant string applied to every data point's
|
|
151
|
+
label (unlike `value`/`nodeId`/etc., a string here is not treated as a
|
|
152
|
+
per-datum object key — pass a function for that).
|
|
131
153
|
*/
|
|
132
154
|
label(_?: string | ((d: DataPoint, i: number) => string)): this | string | ((d: DataPoint, i: number) => string);
|
|
133
155
|
/**
|