@d3plus/core 4.10.0 → 4.12.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/es/index.js +1 -1
- package/es/internal.js +178 -9
- package/es/src/charts/Alluvial/aggregate.js +145 -0
- package/es/src/charts/Alluvial/applyLayout.js +125 -0
- package/es/src/charts/Alluvial/dimensions.js +56 -0
- package/es/src/charts/Alluvial/emit.js +73 -0
- package/es/src/charts/Alluvial/hover.js +101 -0
- package/es/src/charts/Alluvial/index.js +176 -0
- package/es/src/charts/Alluvial/layout.js +137 -0
- package/es/src/charts/Alluvial/meta.js +57 -0
- package/es/src/charts/Alluvial/titles.js +101 -0
- package/es/src/charts/ArcDiagram/applyLayout.js +386 -0
- package/es/src/charts/ArcDiagram/arcGeometry.js +275 -0
- package/es/src/charts/ArcDiagram/arcLabels.js +171 -0
- package/es/src/charts/ArcDiagram/arcLoops.js +78 -0
- package/es/src/charts/ArcDiagram/emit.js +192 -0
- package/es/src/charts/ArcDiagram/events.js +148 -0
- package/es/src/charts/ArcDiagram/index.js +217 -0
- package/es/src/charts/BarChart/index.js +12 -7
- package/es/src/charts/BoxWhisker/index.js +22 -0
- package/es/src/charts/BubbleChart/emit.js +31 -0
- package/es/src/charts/BubbleChart/index.js +54 -0
- package/es/src/charts/Calendar/emit.js +1 -1
- package/es/src/charts/Calendar/index.js +5 -2
- package/es/src/charts/Candlestick/buffer.js +6 -4
- package/es/src/charts/Candlestick/index.js +6 -11
- package/es/src/charts/Chord/applyLayout.js +56 -69
- package/es/src/charts/Chord/emit.js +55 -24
- package/es/src/charts/Chord/index.js +14 -10
- package/es/src/charts/Chord/labels.js +105 -0
- package/es/src/charts/Donut/index.js +5 -11
- package/es/src/charts/Dumbbell/index.js +2 -4
- package/es/src/charts/Gantt/applyLayout.js +160 -0
- package/es/src/charts/Gantt/emit.js +142 -0
- package/es/src/charts/Gantt/ganttDecor.js +207 -0
- package/es/src/charts/Gantt/ganttGeometry.js +107 -0
- package/es/src/charts/Gantt/ganttLabels.js +85 -0
- package/es/src/charts/Gantt/ganttRows.js +111 -0
- package/es/src/charts/Gantt/ganttTooltip.js +136 -0
- package/es/src/charts/Gantt/index.js +219 -0
- package/es/src/charts/Geomap/applyLayout.js +90 -49
- package/es/src/charts/Geomap/basemapTheme.js +3 -48
- package/es/src/charts/Geomap/emit.js +19 -2
- package/es/src/charts/Geomap/flowEmit.js +137 -0
- package/es/src/charts/Geomap/flowEvents.js +86 -0
- package/es/src/charts/Geomap/flowFields.js +91 -0
- package/es/src/charts/Geomap/flowGeometry.js +225 -0
- package/es/src/charts/Geomap/flowLinks.js +239 -0
- package/es/src/charts/Geomap/geoCache.js +180 -0
- package/es/src/charts/Geomap/globeKeys.js +131 -0
- package/es/src/charts/Geomap/globeRotate.js +208 -0
- package/es/src/charts/Geomap/index.js +51 -16
- package/es/src/charts/Geomap/pointLabels.js +107 -0
- package/es/src/charts/Hexbin/binning.js +103 -0
- package/es/src/charts/Hexbin/buffer.js +33 -0
- package/es/src/charts/Hexbin/contourLabels.js +234 -0
- package/es/src/charts/Hexbin/contours.js +48 -0
- package/es/src/charts/Hexbin/emit.js +142 -0
- package/es/src/charts/Hexbin/index.js +206 -0
- package/es/src/charts/Hexbin/layers.js +212 -0
- package/es/src/charts/Hexbin/settings.js +86 -0
- package/es/src/charts/Hexbin/tooltip.js +77 -0
- package/es/src/charts/Histogram/binData.js +31 -4
- package/es/src/charts/Histogram/index.js +32 -15
- package/es/src/charts/Histogram/labels.js +18 -0
- package/es/src/charts/Icicle/index.js +6 -4
- package/es/src/charts/LinePlot/index.js +7 -0
- package/es/src/charts/Marimekko/index.js +7 -4
- package/es/src/charts/Matrix/applyLayout.js +20 -9
- package/es/src/charts/Matrix/index.js +19 -1
- package/es/src/charts/Network/applyLayout.js +171 -96
- package/es/src/charts/Network/bundle.js +82 -0
- package/es/src/charts/Network/clusterLabels.js +423 -0
- package/es/src/charts/Network/clusters.js +290 -0
- package/es/src/charts/Network/emit.js +257 -75
- package/es/src/charts/Network/graph.js +146 -0
- package/es/src/charts/Network/graphFluent.js +81 -0
- package/es/src/charts/Network/index.js +91 -106
- package/es/src/charts/Network/minNodeDistance.js +64 -0
- package/es/src/charts/Network/polygonRows.js +44 -0
- package/es/src/charts/Pack/applyLayout.js +16 -5
- package/es/src/charts/Pack/emit.js +15 -8
- package/es/src/charts/Pack/groupRows.js +61 -0
- package/es/src/charts/Pack/index.js +8 -1
- package/es/src/charts/Pack/neutralPaint.js +20 -0
- package/es/src/charts/Pack/nodeNames.js +35 -0
- package/es/src/charts/ParallelCoordinates/axes.js +22 -22
- package/es/src/charts/ParallelCoordinates/chrome.js +18 -0
- package/es/src/charts/ParallelCoordinates/index.js +3 -1
- package/es/src/charts/ParallelCoordinates/titles.js +17 -9
- package/es/src/charts/Pie/applyLayout.js +86 -27
- package/es/src/charts/Pie/arcFit.js +152 -0
- package/es/src/charts/Pie/curvedLabels.js +134 -0
- package/es/src/charts/Pie/emit.js +51 -96
- package/es/src/charts/Pie/index.js +74 -31
- package/es/src/charts/Pie/labelRoom.js +154 -0
- package/es/src/charts/Pie/outsideLabels.js +224 -0
- package/es/src/charts/Pie/outsideNodes.js +267 -0
- package/es/src/charts/Pie/pieLabels.js +137 -0
- package/es/src/charts/Pie/sectorBox.js +223 -0
- package/es/src/charts/Pie/straightLabels.js +96 -0
- package/es/src/charts/Pie/straightLayout.js +215 -0
- package/es/src/charts/Plot/alongLegend.js +76 -0
- package/es/src/charts/Plot/areaEnter.js +68 -0
- package/es/src/charts/Plot/areaLabelsAlong.js +333 -0
- package/es/src/charts/Plot/axisHoverScene.js +2 -1
- package/es/src/charts/Plot/axisValues.js +43 -0
- package/es/src/charts/Plot/barWidth.js +59 -11
- package/es/src/charts/Plot/circleLabels.js +98 -0
- package/es/src/charts/Plot/connectGaps.js +237 -0
- package/es/src/charts/Plot/connectGapsScene.js +188 -0
- package/es/src/charts/Plot/draw.js +34 -14
- package/es/src/charts/Plot/fillBetween.js +2 -1
- package/es/src/charts/Plot/forecastScene.js +3 -4
- package/es/src/charts/Plot/index.js +19 -17
- package/es/src/charts/Plot/labelPlacement.js +1 -1
- package/es/src/charts/Plot/lineLabelEmit.js +82 -0
- package/es/src/charts/Plot/lineLabelSides.js +51 -0
- package/es/src/charts/Plot/lineLabelSpread.js +65 -0
- package/es/src/charts/Plot/lineLabelsAlong.js +282 -0
- package/es/src/charts/Plot/lineMarkerKeys.js +19 -0
- package/es/src/charts/Plot/pipeline.js +66 -19
- package/es/src/charts/Plot/pipelineAxisLayout.js +5 -1
- package/es/src/charts/Plot/pipelineDomains.js +16 -3
- package/es/src/charts/Plot/pipelineLineLabels.js +144 -52
- package/es/src/charts/Plot/pipelineScales.js +40 -8
- package/es/src/charts/Plot/plotFacet.js +12 -1
- package/es/src/charts/Plot/plotInit.js +40 -5
- package/es/src/charts/Plot/plotRangeBreaks.js +85 -0
- package/es/src/charts/Plot/referenceDomains.js +133 -0
- package/es/src/charts/Plot/shapeDefaults.js +10 -5
- package/es/src/charts/Plot/shapeLabelLegend.js +67 -0
- package/es/src/charts/Plot/sharedHover.js +2 -1
- package/es/src/charts/Plot/sharedTooltip.js +13 -3
- package/es/src/charts/Plot/stackLegendOrder.js +176 -0
- package/es/src/charts/Plot/trendLabels.js +183 -0
- package/es/src/charts/Plot/trendLines.js +1 -0
- package/es/src/charts/Plot/trendScene.js +6 -3
- package/es/src/charts/Plot/trendTooltip.js +5 -1
- package/es/src/charts/PolarArea/index.js +4 -3
- package/es/src/charts/Priestley/applyLayout.js +21 -23
- package/es/src/charts/Priestley/index.js +4 -37
- package/es/src/charts/Priestley/timeAxis.js +103 -0
- package/es/src/charts/Pyramid/gutter.js +52 -16
- package/es/src/charts/Pyramid/index.js +55 -7
- package/es/src/charts/Pyramid/scene.js +4 -4
- package/es/src/charts/Radar/applyLayout.js +31 -33
- package/es/src/charts/Radar/axisDecorations.js +62 -13
- package/es/src/charts/Radar/curvedLabels.js +228 -0
- package/es/src/charts/Radar/emit.js +30 -15
- package/es/src/charts/Radar/index.js +43 -5
- package/es/src/charts/Radar/points.js +85 -0
- package/es/src/charts/RadialBar/curvedLabels.js +111 -0
- package/es/src/charts/RadialBar/emit.js +9 -1
- package/es/src/charts/RadialBar/index.js +26 -9
- package/es/src/charts/RadialBar/trackLayout.js +43 -13
- package/es/src/charts/RadialMatrix/applyLayout.js +115 -31
- package/es/src/charts/RadialMatrix/index.js +18 -9
- package/es/src/charts/Rings/applyLayout.js +39 -161
- package/es/src/charts/Rings/emit.js +219 -63
- package/es/src/charts/Rings/index.js +88 -32
- package/es/src/charts/Rings/ringsCurves.js +156 -0
- package/es/src/charts/Rings/ringsGraph.js +28 -9
- package/es/src/charts/Rings/ringsLoops.js +73 -0
- package/es/src/charts/Rings/ringsParallel.js +183 -0
- package/es/src/charts/Rings/ringsPlacement.js +152 -0
- package/es/src/charts/Rings/ringsSizing.js +61 -38
- package/es/src/charts/Sankey/applyLayout.js +130 -39
- package/es/src/charts/Sankey/circularLayout.js +208 -0
- package/es/src/charts/Sankey/circularLinks.js +301 -0
- package/es/src/charts/Sankey/emit.js +164 -94
- package/es/src/charts/Sankey/index.js +78 -75
- package/es/src/charts/Sankey/labels.js +80 -0
- package/es/src/charts/Sankey/ribbons.js +88 -0
- package/es/src/charts/Sankey/sankeyCycles.js +117 -0
- package/es/src/charts/Sankey/sankeyLayout.js +8 -3
- package/es/src/charts/Sankey/sankeyLinks.js +47 -0
- package/es/src/charts/Scatter/index.js +25 -0
- package/es/src/charts/SlopeChart/index.js +116 -0
- package/es/src/charts/SlopeChart/slope.js +95 -0
- package/es/src/charts/Streamgraph/index.js +51 -0
- package/es/src/charts/Sunburst/curvedLabels.js +74 -0
- package/es/src/charts/Sunburst/emit.js +83 -64
- package/es/src/charts/Sunburst/index.js +16 -4
- package/es/src/charts/Tree/applyLayout.js +44 -14
- package/es/src/charts/Tree/emit.js +5 -5
- package/es/src/charts/Tree/index.js +12 -18
- package/es/src/charts/Tree/keys.js +33 -0
- package/es/src/charts/Tree/nodeLabel.js +15 -0
- package/es/src/charts/Treemap/emitGroupHeaders.js +3 -5
- package/es/src/charts/Treemap/index.js +2 -5
- package/es/src/charts/Violin/inner.js +3 -5
- package/es/src/charts/definition/makeChart.js +14 -2
- package/es/src/charts/drawSteps/backControl.js +17 -5
- package/es/src/charts/drawSteps/gestureHover.js +79 -0
- package/es/src/charts/drawSteps/minimap.js +10 -25
- package/es/src/charts/drawSteps/minimapMarkup.js +25 -9
- package/es/src/charts/drawSteps/searchControls.js +2 -1
- package/es/src/charts/drawSteps/searchControlsMarkup.js +11 -2
- package/es/src/charts/drawSteps/tableViewMarkup.js +17 -10
- package/es/src/charts/drawSteps/zoomActions.js +36 -0
- package/es/src/charts/drawSteps/zoomControls.js +52 -23
- package/es/src/charts/drawSteps/zoomControlsMarkup.js +23 -4
- package/es/src/charts/drawSteps/zoomDrag.js +188 -0
- package/es/src/charts/drawSteps/zoomFit.js +69 -0
- package/es/src/charts/events/click.legend.js +11 -4
- package/es/src/charts/events/click.shape.js +13 -4
- package/es/src/charts/events/mouseenter.js +6 -16
- package/es/src/charts/events/mouseleave.js +9 -2
- package/es/src/charts/events/mousemove.legend.js +28 -32
- package/es/src/charts/events/mousemove.shape.js +45 -42
- package/es/src/charts/facet/drawFacets.js +14 -5
- package/es/src/charts/features/annotationFrame.js +179 -0
- package/es/src/charts/features/annotationText.js +83 -0
- package/es/src/charts/features/annotationTypes.js +10 -0
- package/es/src/charts/features/attributionFeature.js +6 -11
- package/es/src/charts/features/axes.js +17 -5
- package/es/src/charts/features/axesFinal.js +10 -3
- package/es/src/charts/features/axesMeasure.js +33 -12
- package/es/src/charts/features/axisTooltip.js +138 -0
- package/es/src/charts/features/calloutLayout.js +121 -0
- package/es/src/charts/features/calloutScene.js +155 -0
- package/es/src/charts/features/centerLabel.js +177 -0
- package/es/src/charts/features/chartGeometry.js +1 -1
- package/es/src/charts/features/circleLabelPlacement.js +297 -0
- package/es/src/charts/features/circleLabels.js +207 -0
- package/es/src/charts/features/colorScaleBivariate.js +83 -0
- package/es/src/charts/features/colorScaleBucket.js +20 -1
- package/es/src/charts/features/colorScaleHover.js +33 -7
- package/es/src/charts/features/colorScaleLimit.js +73 -0
- package/es/src/charts/features/colorScaleTooltip.js +77 -0
- package/es/src/charts/features/colorScaleTop.js +61 -0
- package/es/src/charts/features/colorScaleValue.js +97 -0
- package/es/src/charts/features/curvedArrows.js +191 -0
- package/es/src/charts/features/depthKey.js +26 -0
- package/es/src/charts/features/edgeArrows.js +220 -5
- package/es/src/charts/features/edgeBundling.js +442 -0
- package/es/src/charts/features/edgeBundlingSmooth.js +117 -0
- package/es/src/charts/features/ensureZoomDom.js +32 -8
- package/es/src/charts/features/features.js +32 -14
- package/es/src/charts/features/featuresColorScale.js +75 -20
- package/es/src/charts/features/featuresLegend.js +15 -24
- package/es/src/charts/features/hoverTicks.js +41 -0
- package/es/src/charts/features/idleQueue.js +72 -0
- package/es/src/charts/features/legendKeys.js +64 -0
- package/es/src/charts/features/lineLabels.js +55 -46
- package/es/src/charts/features/linkBundle.js +19 -0
- package/es/src/charts/features/linkColor.js +72 -0
- package/es/src/charts/features/linkFields.js +86 -0
- package/es/src/charts/features/linkFocus.js +118 -0
- package/es/src/charts/features/linkInteraction.js +364 -0
- package/es/src/charts/features/linkKeys.js +20 -0
- package/es/src/charts/features/linkLabelGeometry.js +209 -0
- package/es/src/charts/features/linkLabelPath.js +162 -0
- package/es/src/charts/features/linkLabels.js +340 -0
- package/es/src/charts/features/linkWidths.js +32 -0
- package/es/src/charts/features/networkMeasures.js +241 -0
- package/es/src/charts/features/nodeStats.js +309 -0
- package/es/src/charts/features/pathLabelGeometry.js +232 -0
- package/es/src/charts/features/pathLabels.js +50 -0
- package/es/src/charts/features/plotAnnotations.js +68 -17
- package/es/src/charts/features/plotEndLabels.js +28 -7
- package/es/src/charts/features/plotPaint.js +46 -12
- package/es/src/charts/features/polyline.js +129 -0
- package/es/src/charts/features/referenceAnnotations.js +403 -0
- package/es/src/charts/features/referenceLabelPlacement.js +106 -0
- package/es/src/charts/features/ringLabelNodes.js +93 -0
- package/es/src/charts/features/ringLabels.js +222 -0
- package/es/src/charts/features/sceneBounds.js +26 -6
- package/es/src/charts/features/selfLoops.js +306 -0
- package/es/src/charts/features/shapeEmit.js +54 -32
- package/es/src/charts/features/sharedFields.js +15 -2
- package/es/src/charts/features/textHalo.js +30 -0
- package/es/src/charts/index.js +8 -0
- package/es/src/charts/partition/chartFields.js +14 -5
- package/es/src/charts/partition/interaction.js +19 -10
- package/es/src/charts/partition/zoom.js +7 -6
- package/es/src/charts/pipeline/insetPlacement.js +22 -9
- package/es/src/charts/pipeline/preDrawData.js +46 -3
- package/es/src/charts/pipeline/runVizPipeline.js +5 -0
- package/es/src/charts/pipeline/vizPreDraw.js +5 -3
- package/es/src/charts/plotBuffers/discreteBuffer.js +7 -4
- package/es/src/charts/polar/chrome.js +81 -9
- package/es/src/charts/polar/config.js +6 -3
- package/es/src/charts/polar/wedgeLayout.js +2 -1
- package/es/src/charts/viz/Viz.js +61 -49
- package/es/src/charts/viz/VizBase.js +57 -14
- package/es/src/charts/viz/backgroundInk.js +23 -7
- package/es/src/charts/viz/emphasis.js +14 -0
- package/es/src/charts/viz/fillStroke.js +10 -0
- package/es/src/charts/viz/focusRing.js +104 -0
- package/es/src/charts/viz/focusTargets.js +208 -0
- package/es/src/charts/viz/history.js +74 -0
- package/es/src/charts/viz/interactionOpacity.js +115 -32
- package/es/src/charts/viz/keyboardNav.js +297 -0
- package/es/src/charts/viz/keyboardNavHost.js +95 -0
- package/es/src/charts/viz/loaderFormat.js +114 -0
- package/es/src/charts/viz/missingFields.js +2 -1
- package/es/src/charts/viz/mountTarget.js +9 -0
- package/es/src/charts/viz/nearestHover.js +183 -0
- package/es/src/charts/viz/nearestHoverSurface.js +92 -0
- package/es/src/charts/viz/ordinalColor.js +14 -12
- package/es/src/charts/viz/pageTheme.js +83 -0
- package/es/src/charts/viz/pointTooltipAnchor.js +59 -0
- package/es/src/charts/viz/pointVoronoi.js +124 -0
- package/es/src/charts/viz/reducedMotion.js +27 -0
- package/es/src/charts/viz/reportDrawError.js +15 -0
- package/es/src/charts/viz/setCursor.js +29 -0
- package/es/src/charts/viz/tooltipEnabled.js +38 -0
- package/es/src/charts/viz/userClick.js +34 -0
- package/es/src/charts/viz/vizDataPolling.js +8 -4
- package/es/src/charts/viz/vizDefaults.js +28 -57
- package/es/src/charts/viz/vizFields.js +41 -1
- package/es/src/charts/viz/vizRender.js +76 -31
- package/es/src/charts/viz/vizTheme.js +96 -0
- package/es/src/charts/viz/vizVisibility.js +26 -2
- package/es/src/components/Axis/Axis.js +35 -2
- package/es/src/components/Axis/AxisBottom.js +1 -0
- package/es/src/components/Axis/AxisLeft.js +1 -0
- package/es/src/components/Axis/AxisRight.js +1 -0
- package/es/src/components/Axis/AxisTop.js +1 -0
- package/es/src/components/Axis/axisBreak.js +33 -8
- package/es/src/components/Axis/axisDefaults.js +16 -9
- package/es/src/components/Axis/axisLabelKinds.js +36 -0
- package/es/src/components/Axis/axisLabelLineHeight.js +19 -0
- package/es/src/components/Axis/axisLabelRoom.js +37 -0
- package/es/src/components/Axis/axisLabelSize.js +171 -0
- package/es/src/components/Axis/axisLabelThinning.js +98 -4
- package/es/src/components/Axis/axisLayout.js +71 -46
- package/es/src/components/Axis/axisLayoutLabels.js +82 -140
- package/es/src/components/Axis/axisLayoutScale.js +16 -11
- package/es/src/components/Axis/axisLimit.js +27 -0
- package/es/src/components/Axis/axisMaxSize.js +39 -0
- package/es/src/components/Axis/axisRangeBreaks.js +77 -0
- package/es/src/components/Axis/axisRender.js +20 -8
- package/es/src/components/Axis/axisRounding.js +16 -1
- package/es/src/components/Axis/axisScene.js +11 -2
- package/es/src/components/Axis/axisTitle.js +53 -0
- package/es/src/components/Axis/axisTooltipTargets.js +128 -0
- package/es/src/components/Axis/brokenTimeScale.js +196 -0
- package/es/src/components/Axis/rangeBreaks.js +201 -0
- package/es/src/components/Axis/timeValues.js +19 -4
- package/es/src/components/ColorScale/ColorScale.js +77 -27
- package/es/src/components/ColorScale/bivariateRender.js +353 -0
- package/es/src/components/ColorScale/bivariateScale.js +150 -0
- package/es/src/components/ColorScale/bucketBounds.js +32 -3
- package/es/src/components/ColorScale/colorScaleHoverMark.js +3 -3
- package/es/src/components/ColorScale/colorScaleRender.js +32 -2
- package/es/src/components/ColorScale/colorScaleScale.js +28 -15
- package/es/src/components/ColorScale/colorScaleSwatchTooltips.js +77 -0
- package/es/src/components/Legend/Legend.js +13 -2
- package/es/src/components/Legend/legendConfig.js +2 -6
- package/es/src/components/Legend/legendCut.js +108 -0
- package/es/src/components/Legend/legendRender.js +38 -13
- package/es/src/components/SizeLegend/SizeLegend.js +1 -0
- package/es/src/components/TextBox.js +34 -67
- package/es/src/components/Timeline/Timeline.js +12 -3
- package/es/src/components/Timeline/timelineConfig.js +20 -10
- package/es/src/components/Timeline/timelineMode.js +26 -0
- package/es/src/components/Timeline/timelineRender.js +9 -4
- package/es/src/components/Tooltip.js +15 -5
- package/es/src/components/fontStack.js +20 -0
- package/es/src/components/textBoxLayout.js +58 -21
- package/es/src/components/textBoxPath.js +73 -0
- package/es/src/components/textBoxScene.js +226 -0
- package/es/src/components/textBoxWords.js +70 -0
- package/es/src/components/textEllipsis.js +7 -0
- package/es/src/components/tooltipDom.js +8 -5
- package/es/src/fluent.js +48 -0
- package/es/src/shapes/Area.js +1 -0
- package/es/src/shapes/Bar.js +1 -0
- package/es/src/shapes/Box.js +1 -0
- package/es/src/shapes/Circle.js +1 -0
- package/es/src/shapes/Line.js +1 -0
- package/es/src/shapes/Path.js +1 -0
- package/es/src/shapes/Rect.js +1 -0
- package/es/src/shapes/Shape.js +1 -0
- package/es/src/shapes/Whisker.js +1 -0
- package/es/src/utils/BaseClass.js +30 -12
- package/es/src/utils/configPrep.js +2 -1
- package/es/src/utils/configValue.js +9 -0
- package/es/src/utils/constant.js +13 -1
- package/es/src/utils/displayName.js +12 -0
- package/es/src/utils/theme.js +190 -0
- package/es/src/utils/themeInk.js +68 -0
- package/package.json +14 -11
- package/types/index.d.ts +6 -2
- package/types/internal.d.ts +268 -9
- package/types/src/charts/Alluvial/aggregate.d.ts +98 -0
- package/types/src/charts/Alluvial/applyLayout.d.ts +67 -0
- package/types/src/charts/Alluvial/dimensions.d.ts +40 -0
- package/types/src/charts/Alluvial/emit.d.ts +9 -0
- package/types/src/charts/Alluvial/hover.d.ts +31 -0
- package/types/src/charts/Alluvial/index.d.ts +27 -0
- package/types/src/charts/Alluvial/layout.d.ts +70 -0
- package/types/src/charts/Alluvial/meta.d.ts +54 -0
- package/types/src/charts/Alluvial/titles.d.ts +46 -0
- package/types/src/charts/ArcDiagram/applyLayout.d.ts +70 -0
- package/types/src/charts/ArcDiagram/arcGeometry.d.ts +150 -0
- package/types/src/charts/ArcDiagram/arcLabels.d.ts +89 -0
- package/types/src/charts/ArcDiagram/arcLoops.d.ts +48 -0
- package/types/src/charts/ArcDiagram/emit.d.ts +24 -0
- package/types/src/charts/ArcDiagram/events.d.ts +29 -0
- package/types/src/charts/ArcDiagram/index.d.ts +28 -0
- package/types/src/charts/BubbleChart/emit.d.ts +20 -0
- package/types/src/charts/BubbleChart/index.d.ts +16 -0
- package/types/src/charts/Chord/applyLayout.d.ts +3 -0
- package/types/src/charts/Chord/labels.d.ts +66 -0
- package/types/src/charts/Donut/index.d.ts +2 -1
- package/types/src/charts/Gantt/applyLayout.d.ts +64 -0
- package/types/src/charts/Gantt/emit.d.ts +17 -0
- package/types/src/charts/Gantt/ganttDecor.d.ts +41 -0
- package/types/src/charts/Gantt/ganttGeometry.d.ts +57 -0
- package/types/src/charts/Gantt/ganttLabels.d.ts +41 -0
- package/types/src/charts/Gantt/ganttRows.d.ts +84 -0
- package/types/src/charts/Gantt/ganttTooltip.d.ts +57 -0
- package/types/src/charts/Gantt/index.d.ts +36 -0
- package/types/src/charts/Geomap/applyLayout.d.ts +8 -0
- package/types/src/charts/Geomap/basemapTheme.d.ts +2 -19
- package/types/src/charts/Geomap/emit.d.ts +2 -2
- package/types/src/charts/Geomap/flowEmit.d.ts +36 -0
- package/types/src/charts/Geomap/flowEvents.d.ts +20 -0
- package/types/src/charts/Geomap/flowFields.d.ts +7 -0
- package/types/src/charts/Geomap/flowGeometry.d.ts +91 -0
- package/types/src/charts/Geomap/flowLinks.d.ts +97 -0
- package/types/src/charts/Geomap/geoCache.d.ts +47 -0
- package/types/src/charts/Geomap/globeKeys.d.ts +41 -0
- package/types/src/charts/Geomap/globeRotate.d.ts +70 -0
- package/types/src/charts/Geomap/index.d.ts +3 -0
- package/types/src/charts/Geomap/pointLabels.d.ts +24 -0
- package/types/src/charts/Hexbin/binning.d.ts +64 -0
- package/types/src/charts/Hexbin/buffer.d.ts +18 -0
- package/types/src/charts/Hexbin/contourLabels.d.ts +95 -0
- package/types/src/charts/Hexbin/contours.d.ts +48 -0
- package/types/src/charts/Hexbin/emit.d.ts +23 -0
- package/types/src/charts/Hexbin/index.d.ts +25 -0
- package/types/src/charts/Hexbin/layers.d.ts +94 -0
- package/types/src/charts/Hexbin/settings.d.ts +122 -0
- package/types/src/charts/Hexbin/tooltip.d.ts +26 -0
- package/types/src/charts/Histogram/binData.d.ts +20 -1
- package/types/src/charts/Histogram/index.d.ts +3 -2
- package/types/src/charts/Histogram/labels.d.ts +7 -0
- package/types/src/charts/Marimekko/index.d.ts +2 -1
- package/types/src/charts/Matrix/applyLayout.d.ts +4 -2
- package/types/src/charts/Network/applyLayout.d.ts +11 -0
- package/types/src/charts/Network/bundle.d.ts +69 -0
- package/types/src/charts/Network/clusterLabels.d.ts +112 -0
- package/types/src/charts/Network/clusters.d.ts +115 -0
- package/types/src/charts/Network/graph.d.ts +73 -0
- package/types/src/charts/Network/graphFluent.d.ts +20 -0
- package/types/src/charts/Network/minNodeDistance.d.ts +18 -0
- package/types/src/charts/Network/polygonRows.d.ts +29 -0
- package/types/src/charts/Pack/applyLayout.d.ts +2 -0
- package/types/src/charts/Pack/groupRows.d.ts +46 -0
- package/types/src/charts/Pack/index.d.ts +3 -0
- package/types/src/charts/Pack/neutralPaint.d.ts +14 -0
- package/types/src/charts/Pack/nodeNames.d.ts +23 -0
- package/types/src/charts/ParallelCoordinates/chrome.d.ts +12 -0
- package/types/src/charts/ParallelCoordinates/index.d.ts +1 -0
- package/types/src/charts/ParallelCoordinates/titles.d.ts +7 -2
- package/types/src/charts/Pie/applyLayout.d.ts +31 -3
- package/types/src/charts/Pie/arcFit.d.ts +63 -0
- package/types/src/charts/Pie/curvedLabels.d.ts +57 -0
- package/types/src/charts/Pie/labelRoom.d.ts +83 -0
- package/types/src/charts/Pie/outsideLabels.d.ts +119 -0
- package/types/src/charts/Pie/outsideNodes.d.ts +93 -0
- package/types/src/charts/Pie/pieLabels.d.ts +85 -0
- package/types/src/charts/Pie/sectorBox.d.ts +95 -0
- package/types/src/charts/Pie/straightLabels.d.ts +24 -0
- package/types/src/charts/Pie/straightLayout.d.ts +88 -0
- package/types/src/charts/Plot/alongLegend.d.ts +42 -0
- package/types/src/charts/Plot/areaEnter.d.ts +34 -0
- package/types/src/charts/Plot/areaLabelsAlong.d.ts +119 -0
- package/types/src/charts/Plot/axisValues.d.ts +24 -0
- package/types/src/charts/Plot/barWidth.d.ts +38 -4
- package/types/src/charts/Plot/circleLabels.d.ts +29 -0
- package/types/src/charts/Plot/connectGaps.d.ts +99 -0
- package/types/src/charts/Plot/connectGapsScene.d.ts +55 -0
- package/types/src/charts/Plot/forecastScene.d.ts +5 -0
- package/types/src/charts/Plot/index.d.ts +16 -15
- package/types/src/charts/Plot/lineLabelEmit.d.ts +48 -0
- package/types/src/charts/Plot/lineLabelSides.d.ts +50 -0
- package/types/src/charts/Plot/lineLabelSpread.d.ts +15 -0
- package/types/src/charts/Plot/lineLabelsAlong.d.ts +116 -0
- package/types/src/charts/Plot/lineMarkerKeys.d.ts +11 -0
- package/types/src/charts/Plot/pipeline.d.ts +15 -1
- package/types/src/charts/Plot/pipelineLineLabels.d.ts +68 -0
- package/types/src/charts/Plot/plotFacet.d.ts +5 -0
- package/types/src/charts/Plot/plotInit.d.ts +14 -0
- package/types/src/charts/Plot/plotRangeBreaks.d.ts +35 -0
- package/types/src/charts/Plot/referenceDomains.d.ts +49 -0
- package/types/src/charts/Plot/shapeLabelLegend.d.ts +19 -0
- package/types/src/charts/Plot/sharedTooltip.d.ts +7 -1
- package/types/src/charts/Plot/stackLegendOrder.d.ts +83 -0
- package/types/src/charts/Plot/trendLabels.d.ts +73 -0
- package/types/src/charts/Plot/trendTooltip.d.ts +6 -0
- package/types/src/charts/Priestley/timeAxis.d.ts +79 -0
- package/types/src/charts/Pyramid/gutter.d.ts +28 -6
- package/types/src/charts/Pyramid/scene.d.ts +1 -1
- package/types/src/charts/Radar/applyLayout.d.ts +2 -3
- package/types/src/charts/Radar/axisDecorations.d.ts +12 -4
- package/types/src/charts/Radar/curvedLabels.d.ts +129 -0
- package/types/src/charts/Radar/emit.d.ts +5 -2
- package/types/src/charts/Radar/index.d.ts +7 -2
- package/types/src/charts/Radar/points.d.ts +50 -0
- package/types/src/charts/RadialBar/curvedLabels.d.ts +31 -0
- package/types/src/charts/RadialBar/trackLayout.d.ts +34 -3
- package/types/src/charts/RadialMatrix/applyLayout.d.ts +6 -4
- package/types/src/charts/Rings/emit.d.ts +72 -0
- package/types/src/charts/Rings/index.d.ts +4 -2
- package/types/src/charts/Rings/ringsCurves.d.ts +50 -0
- package/types/src/charts/Rings/ringsGraph.d.ts +39 -7
- package/types/src/charts/Rings/ringsLoops.d.ts +13 -0
- package/types/src/charts/Rings/ringsParallel.d.ts +45 -0
- package/types/src/charts/Rings/ringsPlacement.d.ts +47 -0
- package/types/src/charts/Rings/ringsSizing.d.ts +36 -9
- package/types/src/charts/Sankey/circularLayout.d.ts +103 -0
- package/types/src/charts/Sankey/circularLinks.d.ts +178 -0
- package/types/src/charts/Sankey/emit.d.ts +58 -0
- package/types/src/charts/Sankey/labels.d.ts +19 -0
- package/types/src/charts/Sankey/ribbons.d.ts +36 -0
- package/types/src/charts/Sankey/sankeyCycles.d.ts +24 -0
- package/types/src/charts/Sankey/sankeyLayout.d.ts +6 -0
- package/types/src/charts/Sankey/sankeyLinks.d.ts +36 -0
- package/types/src/charts/Scatter/index.d.ts +15 -0
- package/types/src/charts/SlopeChart/index.d.ts +43 -0
- package/types/src/charts/SlopeChart/slope.d.ts +43 -0
- package/types/src/charts/Streamgraph/index.d.ts +28 -0
- package/types/src/charts/Sunburst/curvedLabels.d.ts +56 -0
- package/types/src/charts/Tree/applyLayout.d.ts +20 -0
- package/types/src/charts/Tree/keys.d.ts +25 -0
- package/types/src/charts/Tree/nodeLabel.d.ts +11 -0
- package/types/src/charts/definition/ChartDefinition.d.ts +26 -0
- package/types/src/charts/definition/makeChart.d.ts +3 -2
- package/types/src/charts/drawSteps/backControl.d.ts +7 -22
- package/types/src/charts/drawSteps/gestureHover.d.ts +33 -0
- package/types/src/charts/drawSteps/minimapMarkup.d.ts +5 -4
- package/types/src/charts/drawSteps/tableViewMarkup.d.ts +3 -1
- package/types/src/charts/drawSteps/zoomActions.d.ts +30 -0
- package/types/src/charts/drawSteps/zoomControls.d.ts +15 -0
- package/types/src/charts/drawSteps/zoomControlsMarkup.d.ts +16 -1
- package/types/src/charts/drawSteps/zoomDrag.d.ts +71 -0
- package/types/src/charts/drawSteps/zoomFit.d.ts +30 -0
- package/types/src/charts/drawSteps/zoomGesture.d.ts +32 -0
- package/types/src/charts/events/click.legend.d.ts +2 -1
- package/types/src/charts/facet/facetConfig.d.ts +4 -2
- package/types/src/charts/features/annotationFrame.d.ts +108 -0
- package/types/src/charts/features/annotationText.d.ts +57 -0
- package/types/src/charts/features/annotationTypes.d.ts +161 -0
- package/types/src/charts/features/axesMeasure.d.ts +4 -0
- package/types/src/charts/features/axisTooltip.d.ts +49 -0
- package/types/src/charts/features/calloutLayout.d.ts +78 -0
- package/types/src/charts/features/calloutScene.d.ts +40 -0
- package/types/src/charts/features/centerLabel.d.ts +75 -0
- package/types/src/charts/features/chartGeometry.d.ts +1 -1
- package/types/src/charts/features/circleLabelPlacement.d.ts +97 -0
- package/types/src/charts/features/circleLabels.d.ts +130 -0
- package/types/src/charts/features/colorScaleBivariate.d.ts +50 -0
- package/types/src/charts/features/colorScaleBucket.d.ts +10 -0
- package/types/src/charts/features/colorScaleHover.d.ts +13 -3
- package/types/src/charts/features/colorScaleLimit.d.ts +60 -0
- package/types/src/charts/features/colorScaleTooltip.d.ts +43 -0
- package/types/src/charts/features/colorScaleTop.d.ts +30 -0
- package/types/src/charts/features/colorScaleValue.d.ts +35 -0
- package/types/src/charts/features/curvedArrows.d.ts +119 -0
- package/types/src/charts/features/depthKey.d.ts +19 -0
- package/types/src/charts/features/edgeArrows.d.ts +103 -4
- package/types/src/charts/features/edgeBundling.d.ts +86 -0
- package/types/src/charts/features/edgeBundlingSmooth.d.ts +29 -0
- package/types/src/charts/features/ensureZoomDom.d.ts +19 -1
- package/types/src/charts/features/featuresLegend.d.ts +4 -3
- package/types/src/charts/features/hoverTicks.d.ts +30 -0
- package/types/src/charts/features/idleQueue.d.ts +46 -0
- package/types/src/charts/features/legendKeys.d.ts +34 -0
- package/types/src/charts/features/lineLabels.d.ts +15 -12
- package/types/src/charts/features/linkBundle.d.ts +16 -0
- package/types/src/charts/features/linkColor.d.ts +48 -0
- package/types/src/charts/features/linkFields.d.ts +16 -0
- package/types/src/charts/features/linkFocus.d.ts +51 -0
- package/types/src/charts/features/linkInteraction.d.ts +192 -0
- package/types/src/charts/features/linkKeys.d.ts +11 -0
- package/types/src/charts/features/linkLabelGeometry.d.ts +67 -0
- package/types/src/charts/features/linkLabelPath.d.ts +85 -0
- package/types/src/charts/features/linkLabels.d.ts +77 -0
- package/types/src/charts/features/linkWidths.d.ts +19 -0
- package/types/src/charts/features/networkMeasures.d.ts +53 -0
- package/types/src/charts/features/nodeStats.d.ts +93 -0
- package/types/src/charts/features/pathLabelGeometry.d.ts +99 -0
- package/types/src/charts/features/pathLabels.d.ts +41 -0
- package/types/src/charts/features/plotAnnotations.d.ts +23 -8
- package/types/src/charts/features/plotEndLabels.d.ts +14 -1
- package/types/src/charts/features/plotPaint.d.ts +17 -0
- package/types/src/charts/features/polyline.d.ts +32 -0
- package/types/src/charts/features/referenceAnnotations.d.ts +130 -0
- package/types/src/charts/features/referenceLabelPlacement.d.ts +58 -0
- package/types/src/charts/features/ringLabelNodes.d.ts +63 -0
- package/types/src/charts/features/ringLabels.d.ts +164 -0
- package/types/src/charts/features/sceneBounds.d.ts +6 -0
- package/types/src/charts/features/selfLoops.d.ts +165 -0
- package/types/src/charts/features/shapeEmit.d.ts +3 -1
- package/types/src/charts/features/sharedFields.d.ts +11 -2
- package/types/src/charts/features/textHalo.d.ts +15 -0
- package/types/src/charts/index.d.ts +8 -0
- package/types/src/charts/partition/chartFields.d.ts +6 -1
- package/types/src/charts/partition/interaction.d.ts +6 -3
- package/types/src/charts/partition/zoom.d.ts +4 -4
- package/types/src/charts/pipeline/insetPlacement.d.ts +6 -0
- package/types/src/charts/pipeline/preDrawData.d.ts +14 -1
- package/types/src/charts/pipeline/stages.d.ts +7 -0
- package/types/src/charts/plotBuffers/discreteBuffer.d.ts +0 -5
- package/types/src/charts/polar/chrome.d.ts +19 -6
- package/types/src/charts/viz/Viz.d.ts +25 -4
- package/types/src/charts/viz/VizBase.d.ts +37 -8
- package/types/src/charts/viz/backgroundInk.d.ts +19 -4
- package/types/src/charts/viz/emphasis.d.ts +17 -0
- package/types/src/charts/viz/fillStroke.d.ts +7 -0
- package/types/src/charts/viz/focusRing.d.ts +25 -0
- package/types/src/charts/viz/focusTargets.d.ts +56 -0
- package/types/src/charts/viz/history.d.ts +35 -0
- package/types/src/charts/viz/keyboardNav.d.ts +55 -0
- package/types/src/charts/viz/keyboardNavHost.d.ts +53 -0
- package/types/src/charts/viz/loaderFormat.d.ts +78 -0
- package/types/src/charts/viz/mountTarget.d.ts +7 -0
- package/types/src/charts/viz/nearestHover.d.ts +75 -0
- package/types/src/charts/viz/nearestHoverSurface.d.ts +21 -0
- package/types/src/charts/viz/ordinalColor.d.ts +10 -8
- package/types/src/charts/viz/pageTheme.d.ts +34 -0
- package/types/src/charts/viz/pointTooltipAnchor.d.ts +36 -0
- package/types/src/charts/viz/pointVoronoi.d.ts +65 -0
- package/types/src/charts/viz/reducedMotion.d.ts +25 -0
- package/types/src/charts/viz/reportDrawError.d.ts +12 -0
- package/types/src/charts/viz/setCursor.d.ts +26 -0
- package/types/src/charts/viz/tooltipEnabled.d.ts +31 -0
- package/types/src/charts/viz/userClick.d.ts +35 -0
- package/types/src/charts/viz/vizDefaults.d.ts +0 -9
- package/types/src/charts/viz/vizFields.d.ts +37 -0
- package/types/src/charts/viz/vizRender.d.ts +2 -1
- package/types/src/charts/viz/vizTheme.d.ts +40 -0
- package/types/src/charts/viz/vizTypes.d.ts +100 -7
- package/types/src/charts/viz/vizVisibility.d.ts +13 -0
- package/types/src/components/Axis/Axis.d.ts +34 -3
- package/types/src/components/Axis/AxisBottom.d.ts +1 -0
- package/types/src/components/Axis/AxisLeft.d.ts +1 -0
- package/types/src/components/Axis/AxisRight.d.ts +1 -0
- package/types/src/components/Axis/AxisTop.d.ts +1 -0
- package/types/src/components/Axis/axisBreak.d.ts +21 -3
- package/types/src/components/Axis/axisDefaults.d.ts +12 -0
- package/types/src/components/Axis/axisLabelKinds.d.ts +22 -0
- package/types/src/components/Axis/axisLabelLineHeight.d.ts +27 -0
- package/types/src/components/Axis/axisLabelRoom.d.ts +17 -0
- package/types/src/components/Axis/axisLabelSize.d.ts +82 -0
- package/types/src/components/Axis/axisLabelThinning.d.ts +38 -2
- package/types/src/components/Axis/axisLayout.d.ts +9 -2
- package/types/src/components/Axis/axisLayoutLabels.d.ts +28 -33
- package/types/src/components/Axis/axisLayoutScale.d.ts +3 -1
- package/types/src/components/Axis/axisLimit.d.ts +18 -0
- package/types/src/components/Axis/axisMaxSize.d.ts +48 -0
- package/types/src/components/Axis/axisRangeBreaks.d.ts +25 -0
- package/types/src/components/Axis/axisRounding.d.ts +8 -0
- package/types/src/components/Axis/axisTitle.d.ts +30 -0
- package/types/src/components/Axis/axisTooltipTargets.d.ts +82 -0
- package/types/src/components/Axis/brokenTimeScale.d.ts +51 -0
- package/types/src/components/Axis/rangeBreaks.d.ts +82 -0
- package/types/src/components/Axis/timeValues.d.ts +1 -1
- package/types/src/components/ColorScale/ColorScale.d.ts +22 -11
- package/types/src/components/ColorScale/bivariateRender.d.ts +53 -0
- package/types/src/components/ColorScale/bivariateScale.d.ts +92 -0
- package/types/src/components/ColorScale/bucketBounds.d.ts +15 -1
- package/types/src/components/ColorScale/colorScaleSwatchTooltips.d.ts +48 -0
- package/types/src/components/Legend/Legend.d.ts +6 -0
- package/types/src/components/Legend/legendCut.d.ts +31 -0
- package/types/src/components/Legend/legendRender.d.ts +6 -1
- package/types/src/components/SizeLegend/SizeLegend.d.ts +1 -0
- package/types/src/components/TextBox.d.ts +5 -0
- package/types/src/components/Timeline/Timeline.d.ts +1 -0
- package/types/src/components/Timeline/timelineConfig.d.ts +5 -0
- package/types/src/components/Timeline/timelineMode.d.ts +17 -0
- package/types/src/components/Tooltip.d.ts +4 -3
- package/types/src/components/fontStack.d.ts +10 -0
- package/types/src/components/textBoxLayout.d.ts +18 -9
- package/types/src/components/textBoxPath.d.ts +59 -0
- package/types/src/components/textBoxScene.d.ts +51 -0
- package/types/src/components/textBoxWords.d.ts +33 -0
- package/types/src/components/textEllipsis.d.ts +6 -0
- package/types/src/fluent.d.ts +18 -0
- package/types/src/shapes/Area.d.ts +1 -0
- package/types/src/shapes/Bar.d.ts +1 -0
- package/types/src/shapes/Box.d.ts +1 -0
- package/types/src/shapes/Circle.d.ts +1 -0
- package/types/src/shapes/Line.d.ts +1 -0
- package/types/src/shapes/Path.d.ts +1 -0
- package/types/src/shapes/Rect.d.ts +1 -0
- package/types/src/shapes/Shape.d.ts +1 -0
- package/types/src/shapes/Whisker.d.ts +1 -0
- package/types/src/shapes/emitLabels.d.ts +1 -1
- package/types/src/utils/BaseClass.d.ts +9 -0
- package/types/src/utils/D3plusConfig.d.ts +1093 -266
- package/types/src/utils/configPrep.d.ts +2 -0
- package/types/src/utils/configValue.d.ts +8 -0
- package/types/src/utils/constant.d.ts +8 -0
- package/types/src/utils/displayName.d.ts +10 -0
- package/types/src/utils/index.d.ts +1 -1
- package/types/src/utils/theme.d.ts +170 -0
- package/types/src/utils/themeInk.d.ts +56 -0
- package/types/umd-entry.d.ts +4 -0
- package/umd/d3plus-core.full.js +72239 -41465
- package/umd/d3plus-core.full.min.js +2 -2
- package/umd/d3plus-core.js +46249 -19519
- package/umd/d3plus-core.min.js +2 -2
- package/es/src/components/Axis/gridStroke.js +0 -10
- package/types/src/components/Axis/gridStroke.d.ts +0 -8
|
@@ -2,16 +2,27 @@ import type { ColorDefaults } from "@d3plus/color";
|
|
|
2
2
|
import type { DataPoint } from "@d3plus/data";
|
|
3
3
|
import type VizBase from "../charts/viz/VizBase.js";
|
|
4
4
|
import type { LinkOption } from "../charts/viz/linkGroup.js";
|
|
5
|
+
import type { BarShareInfo } from "../charts/Plot/barWidth.js";
|
|
6
|
+
import type { ConnectGaps } from "../charts/Plot/connectGaps.js";
|
|
7
|
+
import type { SlopeColorSetting } from "../charts/SlopeChart/slope.js";
|
|
8
|
+
import type { LineLabelConfig, LineLabelsSetting } from "../charts/Plot/lineLabelSides.js";
|
|
5
9
|
import type { FacetConfig } from "../charts/facet/facetConfig.js";
|
|
6
10
|
import type { BrushSelection } from "../charts/ParallelCoordinates/brushFilter.js";
|
|
7
11
|
import type { DimensionOptions } from "../charts/ParallelCoordinates/dimensions.js";
|
|
12
|
+
import type { AlluvialDimensionInput } from "../charts/Alluvial/dimensions.js";
|
|
8
13
|
import type { AccessorFn } from "./AccessorFn.js";
|
|
14
|
+
import type { ThemeSetting } from "./theme.js";
|
|
9
15
|
import type { ConstOrAccessor, CssColor, Orient, SideOrient } from "../shapes/shapeConfig.js";
|
|
10
16
|
import type { SizeLegendLineConfig, SizeLegendShapeConfig, SizeLegendTextConfig } from "../components/SizeLegend/SizeLegend.js";
|
|
11
17
|
import type { SizeLegendScale, SizeLegendSize } from "../components/SizeLegend/sizeLegendLayout.js";
|
|
12
18
|
import type { ColorScaleTypeSetting } from "../components/ColorScale/colorScaleType.js";
|
|
13
19
|
import type { ColorScaleHoverMarkConfig } from "../components/ColorScale/colorScaleHoverMark.js";
|
|
20
|
+
import type { ReferenceBandConfig, ReferenceLineConfig } from "../charts/features/annotationTypes.js";
|
|
21
|
+
import type { RangeBreakRule } from "../components/Axis/rangeBreaks.js";
|
|
22
|
+
import type { BinValueOption, ContourConfig, ContoursOption, PointConfig } from "../charts/Hexbin/settings.js";
|
|
14
23
|
type Position = "top" | "right" | "bottom" | "left";
|
|
24
|
+
/** One variable of a bivariate `colorScale`: a data key, or an accessor returning a number. */
|
|
25
|
+
export type ColorScaleField = string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint]);
|
|
15
26
|
/** A legend or colorScale side, or `"auto"` to let the chart choose (inside the chart when it fits, else right on wide charts and bottom otherwise). */
|
|
16
27
|
type PanelPosition = Position | "auto";
|
|
17
28
|
type DataPointAccessor<T> = string | ((d: DataPoint) => T);
|
|
@@ -21,76 +32,63 @@ type AxisScale = "auto" | "band" | "diverging" | "divergingLog" | "divergingPow"
|
|
|
21
32
|
export interface AxisConfig {
|
|
22
33
|
barConfig?: Record<string, string | number>;
|
|
23
34
|
/**
|
|
24
|
-
The axis's domain: `[min, max]` on a continuous axis, or the
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
`xDomain`/`yDomain`: it wins over them, isn't stretched to the
|
|
29
|
-
chart's `baseline`, and isn't rounded by Plot's own "outside"
|
|
30
|
-
default. In `xConfig`/`yConfig`, one with a single end set (`[min]`
|
|
31
|
-
or `[undefined, max]`) on a continuous axis works exactly like
|
|
32
|
-
`yDomain([min])` instead: it pins that end, and the data fills the
|
|
33
|
-
other, rounded as `rounding` says.
|
|
35
|
+
The axis's domain: `[min, max]` on a continuous axis, or the categories
|
|
36
|
+
to show on a discrete one. In a Plot it overrides `xDomain`/`yDomain`
|
|
37
|
+
and isn't rounded unless `rounding` says so; a single end (`[min]` or
|
|
38
|
+
`[undefined, max]`) pins that end like `yDomain([min])`.
|
|
34
39
|
*/
|
|
35
40
|
domain?: (number | string | Date | undefined)[];
|
|
36
41
|
/**
|
|
37
|
-
The
|
|
38
|
-
|
|
39
|
-
a value, set the chart's `baseline` instead, which sets the axis's
|
|
40
|
-
minimum exactly like `yDomain([n])`, break back to this tick included.
|
|
42
|
+
The tick the axis's `baselineBreak` returns to. Defaults to `0`. To start
|
|
43
|
+
a Plot's value axis at a value, set the chart's `baseline` instead.
|
|
41
44
|
*/
|
|
42
45
|
baseline?: number;
|
|
43
46
|
/**
|
|
44
|
-
When
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
value domain (`yDomain`/`yConfig.domain`, or the x versions for
|
|
51
|
-
horizontal charts), and bars and areas start at the baseline tick,
|
|
52
|
-
with the break's gap cut across them (`baselineBreakConfig`'s
|
|
53
|
-
`mask`); turned off, a `yDomain` stretches to reach the baseline while a
|
|
54
|
-
`yConfig.domain` is kept and cuts its bars off at the axis. Defaults
|
|
55
|
-
to `true` for the Plots whose marks grow from `0`, such as BarChart,
|
|
56
|
-
AreaPlot, Histogram, and Lollipop (each chart lists its own default),
|
|
57
|
-
and `false` for other Plots and a standalone Axis.
|
|
47
|
+
When a linear value axis's domain stops short of the `baseline` (e.g.
|
|
48
|
+
`[1100, 2100]` with a baseline of `0`), keeps the baseline tick and
|
|
49
|
+
breaks the axis between it and the domain, styled by
|
|
50
|
+
`baselineBreakConfig`. Turned off, a Plot's `yDomain` stretches to the
|
|
51
|
+
baseline instead. Defaults to `true` for Plots whose marks grow from `0`
|
|
52
|
+
(BarChart, AreaPlot, Histogram, Lollipop), else `false`.
|
|
58
53
|
*/
|
|
59
54
|
baselineBreak?: boolean;
|
|
60
55
|
/**
|
|
61
|
-
Style of the baseline break: `space` (pixels
|
|
62
|
-
tick and the
|
|
63
|
-
|
|
64
|
-
`
|
|
65
|
-
|
|
66
|
-
(
|
|
67
|
-
`
|
|
68
|
-
foot of each mark, perpendicular to the axis, default `true`; they take
|
|
69
|
-
the axis line's `barConfig` style), `lineConfig` (those lines'
|
|
70
|
-
`stroke`, `stroke-width`, and other line styles, layered over the axis
|
|
71
|
-
line style), `mask` (whether a Plot cuts the gap between the two
|
|
72
|
-
lines straight across the shapes, default `true`), plus `stroke`,
|
|
73
|
-
`stroke-width`, and the other line styles `barConfig` takes, for the
|
|
74
|
-
marks.
|
|
56
|
+
Style of the baseline break: `space` (axis pixels between the baseline
|
|
57
|
+
tick and the domain, default `36`), `gap` (pixels between the two marks,
|
|
58
|
+
default `5`), `size` (mark length, default `10`), `angle` (mark tilt in
|
|
59
|
+
degrees, default `30`), `lines` (whether a Plot draws lines across the
|
|
60
|
+
plot at the break, default `true`), `lineConfig` (their style), `mask`
|
|
61
|
+
(whether a Plot cuts the gap across its shapes, default `true`), and
|
|
62
|
+
`stroke`, `stroke-width`, and other line styles for the marks.
|
|
75
63
|
*/
|
|
76
64
|
baselineBreakConfig?: Record<string, string | number | boolean | Record<string, string | number>>;
|
|
77
65
|
/**
|
|
78
|
-
Value ranges to remove from a linear axis: one `[start, end]` pair
|
|
79
|
-
list of them
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
on either side keep one shared scale. Reversed pairs are flipped,
|
|
83
|
-
overlapping ones merged, and ranges that don't lie strictly inside the
|
|
84
|
-
domain (or that don't leave room for the data) are ignored. Only
|
|
85
|
-
positions change — tooltips and labels still show the real values.
|
|
66
|
+
Value ranges to remove from a linear axis: one `[start, end]` pair or a
|
|
67
|
+
list of them. Each collapses to a short marked gap (styled by
|
|
68
|
+
`breakConfig`); values either side share one scale, and tooltips still
|
|
69
|
+
show real values. Ranges outside the domain are ignored.
|
|
86
70
|
*/
|
|
87
71
|
break?: false | [number, number] | [number, number][];
|
|
88
72
|
/**
|
|
89
73
|
Style of the ranges set with `break`: the same `space`, `gap`, `size`,
|
|
90
74
|
`angle`, `lines`, `lineConfig`, `mask`, and mark line styles, with the
|
|
91
|
-
same defaults, as `baselineBreakConfig
|
|
75
|
+
same defaults, as `baselineBreakConfig`, plus `spaceMin`: the least
|
|
76
|
+
`space` a break shrinks to on an axis too short for it (by default it
|
|
77
|
+
is dropped instead).
|
|
92
78
|
*/
|
|
93
79
|
breakConfig?: Record<string, string | number | boolean | Record<string, string | number>>;
|
|
80
|
+
/**
|
|
81
|
+
Stretches of time to hide from a time axis (weekends, nights, holidays),
|
|
82
|
+
so the data closes up around them: one rule or a list of them.
|
|
83
|
+
`"weekends"`; `{days: [5, 6]}` (0 is Sunday); `{hours: [17, 9]}`, daily,
|
|
84
|
+
wrapping past midnight (`9.5` is 9:30); `{values: [date, …]}`, whole
|
|
85
|
+
days; or `{bounds: [start, end]}`, one range. Rules use local time. A
|
|
86
|
+
rule's `marker` draws the `break` marker at the gap (on by default for
|
|
87
|
+
`bounds` only).
|
|
88
|
+
@example
|
|
89
|
+
{rangeBreaks: ["weekends", {hours: [16, 9.5]}, {values: ["2024-07-04"]}]}
|
|
90
|
+
*/
|
|
91
|
+
rangeBreaks?: false | RangeBreakRule | RangeBreakRule[];
|
|
94
92
|
/** Grid values of the axis. */
|
|
95
93
|
grid?: unknown[];
|
|
96
94
|
gridConfig?: Record<string, string | number>;
|
|
@@ -106,15 +104,10 @@ export interface AxisConfig {
|
|
|
106
104
|
labels?: unknown[];
|
|
107
105
|
labelOffset?: false | number;
|
|
108
106
|
/**
|
|
109
|
-
Whether to rotate the axis labels
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
across from its tick, and wrapping onto up to three lines when its
|
|
114
|
-
neighbors leave room. Left `undefined` (the default), a horizontal
|
|
115
|
-
axis of categories slants its labels 30 degrees when they would not
|
|
116
|
-
fit flat, or stands them at -90 when they are too crowded to slant.
|
|
117
|
-
See Axis's `labelRotation`.
|
|
107
|
+
Whether to rotate the axis labels: `true` rotates them -90 degrees,
|
|
108
|
+
`false` keeps them flat, and a number rotates them that many degrees
|
|
109
|
+
clockwise (`-45` rises to the right). Unset (the default), a horizontal
|
|
110
|
+
axis of categories slants its labels when they don't fit flat.
|
|
118
111
|
*/
|
|
119
112
|
labelRotation?: boolean | number;
|
|
120
113
|
/**
|
|
@@ -123,8 +116,18 @@ export interface AxisConfig {
|
|
|
123
116
|
line; zooming pins a rescaled axis this way so it doesn't shift.
|
|
124
117
|
*/
|
|
125
118
|
fixedSize?: number;
|
|
126
|
-
/**
|
|
127
|
-
|
|
119
|
+
/**
|
|
120
|
+
Maximum size allowed for the space that contains the axis tick labels
|
|
121
|
+
and title: a number of pixels, or a function that is given the room the
|
|
122
|
+
axis has across its labels and returns that maximum. The room is a
|
|
123
|
+
horizontal axis's `height` or a vertical axis's `width`; in a chart, it
|
|
124
|
+
is the chart's height (for a horizontal axis) or width (for a vertical
|
|
125
|
+
one) inside its margins. A chart can call the function more than once
|
|
126
|
+
in a draw, so it should depend only on its argument.
|
|
127
|
+
@example
|
|
128
|
+
{maxSize: size => size / 3}
|
|
129
|
+
*/
|
|
130
|
+
maxSize?: number | ((size: number) => number);
|
|
128
131
|
/** Minimum size alloted for the space that contains the axis tick labels and title. */
|
|
129
132
|
minSize?: number;
|
|
130
133
|
/**
|
|
@@ -139,18 +142,11 @@ export interface AxisConfig {
|
|
|
139
142
|
*/
|
|
140
143
|
rotatedTickFormat?: (d: number | string) => string | number;
|
|
141
144
|
/**
|
|
142
|
-
How a linear or log axis rounds its domain to "nice" values:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
full `domain`, which is rounded only when asked for here. With a
|
|
148
|
-
user domain on a Plot (`xDomain`/`yDomain`, `baseline`, or a
|
|
149
|
-
one-sided `domain` here) only an end left open is rounded:
|
|
150
|
-
`yDomain([n])` keeps `n` exactly and rounds the far end where the
|
|
151
|
-
axis would with no domain set, and "none" leaves that end at the
|
|
152
|
-
data. A `yDomain` with both ends set isn't rounded unless `rounding`
|
|
153
|
-
is set here.
|
|
145
|
+
How a linear or log axis rounds its domain to "nice" values: "outside"
|
|
146
|
+
widens each end past the data, "inside" pulls each end in, and "none"
|
|
147
|
+
keeps it as given. Defaults to "none" on an Axis and "outside" in a
|
|
148
|
+
Plot. A Plot only rounds the ends a user domain leaves open, unless
|
|
149
|
+
`rounding` is set here.
|
|
154
150
|
*/
|
|
155
151
|
rounding?: "none" | "outside" | "inside";
|
|
156
152
|
/** Scale of the axis. */
|
|
@@ -197,11 +193,62 @@ export interface AxisConfig {
|
|
|
197
193
|
[d3-time-format](https://github.com/d3/d3-time-format/blob/master/README.md#timeFormatLocale)).
|
|
198
194
|
*/
|
|
199
195
|
timeLocale?: Record<string, unknown>;
|
|
196
|
+
/**
|
|
197
|
+
The tooltip shown when a tick label is hovered, in a chart: its text
|
|
198
|
+
(the same on every tick), a function that receives the tick's value (as
|
|
199
|
+
`tickFormat` does) and its index and returns the text, or a tooltip
|
|
200
|
+
config (as `tooltipConfig`) whose accessors receive the same. The index
|
|
201
|
+
counts the axis's labels from the start of its domain (0 is the bottom
|
|
202
|
+
label of a y axis, the left one of an x axis). Unset (the default) or
|
|
203
|
+
when the function returns nothing, a label cut short with an ellipsis
|
|
204
|
+
shows its whole text; `false`, set or returned, shows no tooltip.
|
|
205
|
+
@example
|
|
206
|
+
{tickTooltip: value => notes[value]}
|
|
207
|
+
*/
|
|
208
|
+
tickTooltip?: string | ((value: number | string, index: number) => string | false | void) | AxisTooltipConfig<[value: number | string, index: number]> | false;
|
|
200
209
|
/** Title of the axis. */
|
|
201
210
|
title?: string;
|
|
202
211
|
/** Title configuration of the axis. */
|
|
203
212
|
titleConfig?: Record<string, unknown>;
|
|
213
|
+
/**
|
|
214
|
+
The tooltip shown when the axis title is hovered, in a chart: the
|
|
215
|
+
tooltip's text, a function that receives the title and returns it, or a
|
|
216
|
+
tooltip config (as `tooltipConfig`) whose accessors receive the title.
|
|
217
|
+
Unset (the default) or when the function returns nothing, a title cut
|
|
218
|
+
short with an ellipsis shows its whole text; `false`, set or returned,
|
|
219
|
+
shows no tooltip.
|
|
220
|
+
@example
|
|
221
|
+
{title: "GDP per capita", titleTooltip: "Constant 2015 US$"}
|
|
222
|
+
*/
|
|
223
|
+
titleTooltip?: string | ((title: string) => string | false | void) | AxisTooltipConfig<[title: string]> | false;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
The `groupBy` levels a `tooltip` accessor receives as its third argument,
|
|
227
|
+
and whether it is asked about a legend entry.
|
|
228
|
+
*/
|
|
229
|
+
export interface TooltipLevels {
|
|
230
|
+
/**
|
|
231
|
+
The `groupBy` level, from 0, the hovered item stands for: the level the
|
|
232
|
+
chart draws, or the item's own level where a chart draws several at
|
|
233
|
+
once (a Sunburst or Icicle node, a Tree node, a Treemap group header).
|
|
234
|
+
A legend entry stands for the level its label is read from.
|
|
235
|
+
*/
|
|
236
|
+
depth: number;
|
|
237
|
+
/** The deepest `groupBy` level: `groupBy.length - 1`. */
|
|
238
|
+
maxDepth: number;
|
|
239
|
+
/** Whether the hovered item is a legend entry, not a mark. */
|
|
240
|
+
legend: boolean;
|
|
204
241
|
}
|
|
242
|
+
/** `T` with every accessor in it called with `Args`. */
|
|
243
|
+
type WithAccessorArgs<T, Args extends unknown[]> = T extends (...args: never[]) => infer R ? (...args: Args) => R : T extends Array<infer U> ? Array<WithAccessorArgs<U, Args>> : T;
|
|
244
|
+
/**
|
|
245
|
+
A tooltip config for an axis label (see `titleTooltip` and
|
|
246
|
+
`tickTooltip`): a `TooltipConfig` whose accessors are called with `Args`
|
|
247
|
+
in place of a data point.
|
|
248
|
+
*/
|
|
249
|
+
export type AxisTooltipConfig<Args extends unknown[]> = {
|
|
250
|
+
[K in keyof TooltipConfig]: WithAccessorArgs<TooltipConfig[K], Args>;
|
|
251
|
+
};
|
|
205
252
|
export interface TooltipConfig {
|
|
206
253
|
/** The inner HTML content of the arrow element, empty by default. */
|
|
207
254
|
arrow?: ((d: DataPoint) => string) | string;
|
|
@@ -289,12 +336,24 @@ export interface TextBoxConfig {
|
|
|
289
336
|
overflow?: Accessor<boolean>;
|
|
290
337
|
/**
|
|
291
338
|
Handles truncated lines, returning the new line value. Passed the line's
|
|
292
|
-
text and number; by default
|
|
293
|
-
first word that cannot fit
|
|
339
|
+
text and number; by default drops the line's trailing periods, commas,
|
|
340
|
+
and spaces and appends "...", except for a first word that cannot fit
|
|
341
|
+
(which returns ""). The ended line is measured, and words come off its
|
|
342
|
+
end until it fits the box.
|
|
294
343
|
*/
|
|
295
344
|
ellipsis?: (text: string, line: number) => string;
|
|
345
|
+
/**
|
|
346
|
+
Lets truncated text cut a word: the word that did not fit (or a first
|
|
347
|
+
word wider than the box) is cut to the longest start that fits with the
|
|
348
|
+
`ellipsis`, by whole characters, so emoji and accented letters are never
|
|
349
|
+
split. Defaults to `false`, which only breaks between words, and draws
|
|
350
|
+
nothing when the first word does not fit.
|
|
351
|
+
*/
|
|
352
|
+
truncateWord?: Accessor<boolean>;
|
|
296
353
|
/** The padding as a CSS shorthand string or number. Defaults to 0. */
|
|
297
354
|
padding?: Accessor<string | number>;
|
|
355
|
+
/** The rotation of each text box, in degrees about its `rotateAnchor`. */
|
|
356
|
+
rotate?: Accessor<number>;
|
|
298
357
|
/** The anchor point around which to rotate the text box. */
|
|
299
358
|
rotateAnchor?: Accessor<[number, number]>;
|
|
300
359
|
/** The word split function: given a string, returns it split into an array of words. */
|
|
@@ -307,12 +366,83 @@ export interface TextBoxConfig {
|
|
|
307
366
|
x?: Accessor<number>;
|
|
308
367
|
/** The y position (top edge) for each text box. */
|
|
309
368
|
y?: Accessor<number>;
|
|
369
|
+
/**
|
|
370
|
+
The horizontal alignment of each line in its box. `"start"`,
|
|
371
|
+
`"middle"`, and `"end"` align lines to the box's start edge, center, or
|
|
372
|
+
end edge (the start is the right edge in right-to-left text).
|
|
373
|
+
`"justify"` spreads each line's words across the box, or its characters
|
|
374
|
+
in CJK text, leaving a paragraph's last line and any line that ends at a
|
|
375
|
+
newline start-aligned. A percentage such as `"25%"` places each line
|
|
376
|
+
that share of the way across the box, so `"0%"`, `"50%"`, and `"100%"`
|
|
377
|
+
match start, middle, and end; percentages follow the writing direction.
|
|
378
|
+
*/
|
|
379
|
+
textAnchor?: Accessor<"start" | "middle" | "end" | "justify" | `${number}%`>;
|
|
380
|
+
/**
|
|
381
|
+
An SVG path `d` (or a `(datum, index)` accessor returning one) for the
|
|
382
|
+
text to follow, in coordinates relative to the box's `x` and `y`. The
|
|
383
|
+
text is drawn as one line with its baseline on the path, wrapped to the
|
|
384
|
+
path's length past `startOffset` (and cut short with the `ellipsis` and
|
|
385
|
+
`truncateWord`). `textAnchor` places it along that stretch of path:
|
|
386
|
+
`"middle"` centers it, `"end"` ends it at the path's end, a percentage
|
|
387
|
+
places it that share along, and `"justify"` reads as `"start"`, since
|
|
388
|
+
the one line ends its paragraph. Falsy draws the text in its box.
|
|
389
|
+
*/
|
|
390
|
+
textPath?: Accessor<string | false | null>;
|
|
391
|
+
/**
|
|
392
|
+
Where along the `textPath` the text's room begins: a distance in pixels,
|
|
393
|
+
or a percentage of the path's length such as `"25%"`. Defaults to 0.
|
|
394
|
+
*/
|
|
395
|
+
startOffset?: Accessor<number | `${number}%`>;
|
|
396
|
+
/**
|
|
397
|
+
Which side of the `textPath` the text sits on, read in the path's
|
|
398
|
+
direction: `"left"` (the default) follows the path as drawn, with the
|
|
399
|
+
text above a left-to-right path, and `"right"` follows it backwards, so
|
|
400
|
+
the text sits on its other side.
|
|
401
|
+
*/
|
|
402
|
+
side?: Accessor<"left" | "right">;
|
|
403
|
+
/**
|
|
404
|
+
Draws a transparent rect behind each box, so a hover or click anywhere
|
|
405
|
+
in the box (padding included), not just on its glyphs, reaches the
|
|
406
|
+
box's datum. `true`, or `{padding}` (a number or CSS shorthand) to
|
|
407
|
+
reach further than the box. Text on a path gets the path's bounds grown
|
|
408
|
+
by a font size. Defaults to `false`.
|
|
409
|
+
*/
|
|
410
|
+
hitbox?: Accessor<boolean | {
|
|
411
|
+
padding?: number | string;
|
|
412
|
+
}>;
|
|
413
|
+
/** The vertical alignment of the lines in each box. */
|
|
414
|
+
verticalAlign?: Accessor<"top" | "middle" | "bottom">;
|
|
415
|
+
/** Whether the text receives pointer events (`"none"` lets them through to what is underneath). */
|
|
416
|
+
pointerEvents?: Accessor<"auto" | "none">;
|
|
417
|
+
/**
|
|
418
|
+
The inline HTML tags to draw as styles: a map of tag names to CSS
|
|
419
|
+
declarations, `true` for the defaults (`<b>`, `<strong>`, `<i>`, `<em>`),
|
|
420
|
+
or `false` to draw tags as text.
|
|
421
|
+
*/
|
|
422
|
+
html?: boolean | Record<string, string>;
|
|
310
423
|
/** The outline text wraps within, `"square"` or `"circle"`, or a `(datum, index)` accessor. */
|
|
311
424
|
shape?: "square" | "circle" | ((d: DataPoint, i: number) => "square" | "circle");
|
|
312
425
|
}
|
|
313
426
|
export interface TimelineConfig {
|
|
427
|
+
/**
|
|
428
|
+
The cursor shown over the timeline's brush area, where a click or drag
|
|
429
|
+
picks periods: a CSS cursor, or a function given how the timeline is
|
|
430
|
+
drawn (`"ticks"` or `"buttons"`) that returns one. Defaults to
|
|
431
|
+
`"pointer"`. The handles keep `ew-resize` and the selected range
|
|
432
|
+
`move`; `handleConfig` and `selectionConfig` take a `cursor` too.
|
|
433
|
+
@example
|
|
434
|
+
{brushCursor: mode => (mode === "buttons" ? "pointer" : "crosshair")}
|
|
435
|
+
*/
|
|
436
|
+
brushCursor?: string | ((mode: "ticks" | "buttons") => string);
|
|
314
437
|
/** Brush event filter. */
|
|
315
438
|
brushFilter?: () => boolean;
|
|
439
|
+
/**
|
|
440
|
+
Stretches of time the timeline hides, as an axis config's
|
|
441
|
+
`rangeBreaks` takes them. By default the timeline takes the rules of
|
|
442
|
+
the axis that plots the chart's `time` values (such as
|
|
443
|
+
`xConfig.rangeBreaks`); set this to use others, or `false` for none.
|
|
444
|
+
*/
|
|
445
|
+
rangeBreaks?: false | RangeBreakRule | RangeBreakRule[];
|
|
316
446
|
/**
|
|
317
447
|
The maximum number of ticks (or buttons) a selection can span; unlimited
|
|
318
448
|
by default. A wider brush is pulled in to it on release, keeping the end
|
|
@@ -333,7 +463,16 @@ export interface TimelineConfig {
|
|
|
333
463
|
brushMin?: number;
|
|
334
464
|
/** Toggles the horizontal alignment of the button timeline. */
|
|
335
465
|
buttonAlign?: "start" | "middle" | "end";
|
|
336
|
-
/**
|
|
466
|
+
/**
|
|
467
|
+
How the timeline draws its periods: `"ticks"` along an axis,
|
|
468
|
+
`"buttons"` in a row, or `"auto"` (the default), which draws buttons
|
|
469
|
+
when every label fits and ticks otherwise, and checks again whenever
|
|
470
|
+
the chart redraws. The timeline's group carries a class naming the
|
|
471
|
+
result, for page CSS: `d3plus-viz-timeline-ticks` or
|
|
472
|
+
`d3plus-viz-timeline-buttons` on a chart's `g.d3plus-viz-timeline`, and
|
|
473
|
+
`d3plus-Timeline-ticks` or `d3plus-Timeline-buttons` on the Timeline's
|
|
474
|
+
own group.
|
|
475
|
+
*/
|
|
337
476
|
buttonBehavior?: "auto" | "buttons" | "ticks";
|
|
338
477
|
/** Button height. */
|
|
339
478
|
buttonHeight?: number;
|
|
@@ -343,6 +482,21 @@ export interface TimelineConfig {
|
|
|
343
482
|
handleConfig?: Record<string, unknown>;
|
|
344
483
|
/** Handle size. */
|
|
345
484
|
handleSize?: number;
|
|
485
|
+
/**
|
|
486
|
+
Listeners for the brush's `start`, `brush` and `end` events. On a chart,
|
|
487
|
+
`end` receives the period the viewer picked once a click, drag or
|
|
488
|
+
playback step settles (a Date, or `[start, end]` Dates for a range),
|
|
489
|
+
and `brush` receives it, snapped to whole periods, as a drag moves
|
|
490
|
+
(with `brushing` on and `snapping` off, the last committed one);
|
|
491
|
+
`start` receives the d3-brush event.
|
|
492
|
+
@example
|
|
493
|
+
{on: {end: period => console.log(period)}}
|
|
494
|
+
*/
|
|
495
|
+
on?: {
|
|
496
|
+
start?: (event: unknown) => void;
|
|
497
|
+
brush?: (selection: Date | Date[]) => void;
|
|
498
|
+
end?: (selection: Date | Date[]) => void;
|
|
499
|
+
};
|
|
346
500
|
/**
|
|
347
501
|
Determines the visibility of the play button to the left of the timeline,
|
|
348
502
|
which cycles through the available periods at a rate set by `playButtonInterval`.
|
|
@@ -354,7 +508,11 @@ export interface TimelineConfig {
|
|
|
354
508
|
otherwise playback steps once per `duration` so each step animates in full.
|
|
355
509
|
*/
|
|
356
510
|
playButtonInterval?: number;
|
|
357
|
-
/**
|
|
511
|
+
/**
|
|
512
|
+
The current selection. Defaults to the most recent period in the
|
|
513
|
+
timeline. On a chart it is where the timeline starts, and the chart
|
|
514
|
+
starts on the same period(s); the viewer's picks replace it.
|
|
515
|
+
*/
|
|
358
516
|
selection?: (Date | number)[] | Date | number | false;
|
|
359
517
|
/**
|
|
360
518
|
Whether to run the timeline from its latest period to its earliest.
|
|
@@ -425,9 +583,102 @@ export interface TrendLineConfig {
|
|
|
425
583
|
strokeWidth?: number;
|
|
426
584
|
/** Line dash pattern. Defaults to `"6 4"`. */
|
|
427
585
|
strokeDasharray?: string;
|
|
586
|
+
/**
|
|
587
|
+
Labels each trend line along its path, near its end, in the line's
|
|
588
|
+
color: `true` names the series, `"equation"` shows its fitted equation
|
|
589
|
+
and R², and a function of the fit (`label`, `color`, and `fit` with
|
|
590
|
+
`coefficients` and `r2`) returns any text. Defaults to `"equation"`;
|
|
591
|
+
`false` turns labels off.
|
|
592
|
+
*/
|
|
593
|
+
label?: boolean | "equation" | ((fit: {
|
|
594
|
+
label: string;
|
|
595
|
+
color: string;
|
|
596
|
+
fit: {
|
|
597
|
+
coefficients: number[];
|
|
598
|
+
r2: number;
|
|
599
|
+
type: string;
|
|
600
|
+
};
|
|
601
|
+
}) => string | false | null | undefined);
|
|
602
|
+
/** TextBox config for the trend line labels, such as `fontSize` (default 11) or `fontColor`. */
|
|
603
|
+
labelConfig?: Record<string, unknown>;
|
|
428
604
|
/** Other Line shape config. */
|
|
429
605
|
[key: string]: unknown;
|
|
430
606
|
}
|
|
607
|
+
/** The `linkLabelConfig` options. */
|
|
608
|
+
export interface LinkLabelConfig {
|
|
609
|
+
/**
|
|
610
|
+
`"along"` runs text along its link, kept upright: on a curved link
|
|
611
|
+
(a Rings spline, an ArcDiagram arc, a self-loop, a bundled edge, a
|
|
612
|
+
Geomap flow arc, a Sankey band), the text follows the curve over a
|
|
613
|
+
pad that curves with it, and is cut short with an ellipsis where the
|
|
614
|
+
curve has too little room. `"horizontal"` keeps it level.
|
|
615
|
+
*/
|
|
616
|
+
rotate?: "along" | "horizontal";
|
|
617
|
+
fontSize?: number;
|
|
618
|
+
/** The pad around the text, in pixels. */
|
|
619
|
+
padding?: number;
|
|
620
|
+
/** The opacity of the pad, which takes the chart's background color. */
|
|
621
|
+
backgroundOpacity?: number;
|
|
622
|
+
/**
|
|
623
|
+
The tightest bend an `"along"` label follows, as a radius in ems of
|
|
624
|
+
`fontSize`. A label is cut short of a tighter bend, and keeps a
|
|
625
|
+
straight label when too little of the curve is left for a few
|
|
626
|
+
letters, as on a small self-loop. Defaults to `2`.
|
|
627
|
+
*/
|
|
628
|
+
minRadius?: number;
|
|
629
|
+
/** Any other TextBox setting, such as `fontColor`, `fontFamily`, or `fontWeight`. */
|
|
630
|
+
[key: string]: unknown;
|
|
631
|
+
}
|
|
632
|
+
/** The `linkBundleConfig` options. */
|
|
633
|
+
export interface LinkBundleConfig {
|
|
634
|
+
/**
|
|
635
|
+
How closely each link keeps to its bundle, from `0` (drawn straight)
|
|
636
|
+
to `1` (fully bundled). Defaults to `0.85`.
|
|
637
|
+
*/
|
|
638
|
+
strength?: number;
|
|
639
|
+
/**
|
|
640
|
+
How many times the points along each link double as the bundling
|
|
641
|
+
settles (finer bends, more work). Defaults to `6`.
|
|
642
|
+
*/
|
|
643
|
+
cycles?: number;
|
|
644
|
+
/**
|
|
645
|
+
The simulation steps in the first cycle; each later cycle takes two
|
|
646
|
+
thirds as many. Defaults to `50`.
|
|
647
|
+
*/
|
|
648
|
+
iterations?: number;
|
|
649
|
+
/**
|
|
650
|
+
How alike two links must be, from `0` to `1`, to pull on each other:
|
|
651
|
+
the product of how parallel they are, how alike their lengths are,
|
|
652
|
+
how near they are, and how much each lies alongside the other. Lower
|
|
653
|
+
values bundle more links. Defaults to `0.4`.
|
|
654
|
+
*/
|
|
655
|
+
compatibility?: number;
|
|
656
|
+
/**
|
|
657
|
+
Whether each bundled link is drawn as a smooth curve (`true`, the
|
|
658
|
+
default) or as straight runs between its bend points.
|
|
659
|
+
*/
|
|
660
|
+
smoothing?: boolean;
|
|
661
|
+
}
|
|
662
|
+
/** The `clusterConfig.labelConfig` options. */
|
|
663
|
+
export interface ClusterLabelConfig {
|
|
664
|
+
/** The largest font size a cluster name takes, in pixels. Defaults to `16`. */
|
|
665
|
+
fontMax?: number;
|
|
666
|
+
/** The smallest font size a cluster name may shrink to before it is left off, in pixels. Defaults to `10`. */
|
|
667
|
+
fontMin?: number;
|
|
668
|
+
/** The space kept clear around each name, in pixels. Defaults to `4`. */
|
|
669
|
+
padding?: number;
|
|
670
|
+
/** Any other TextBox setting, such as `fontColor` (defaults to the chart's text color), `fontFamily`, `fontOpacity`, or `fontWeight`. */
|
|
671
|
+
[key: string]: unknown;
|
|
672
|
+
}
|
|
673
|
+
/** The `clusterConfig` options. */
|
|
674
|
+
export interface ClusterConfig {
|
|
675
|
+
/** The most clusters to keep. When there are more, the smallest joins the cluster it shares the most link weight with (or, when it has no links to another cluster, the largest), until there are this many. Defaults to `12`, the palette's distinct colors. */
|
|
676
|
+
max?: number;
|
|
677
|
+
/** Names each cluster from its most-connected node's row, its index (0 is the largest), and its members' rows. Defaults to "{node} cluster", translated, with the node's label. */
|
|
678
|
+
label?: (d: DataPoint, i: number, nodes: DataPoint[]) => string;
|
|
679
|
+
/** Styles the cluster names a Network draws inside its clusters, or `false` for none. */
|
|
680
|
+
labelConfig?: ClusterLabelConfig | false;
|
|
681
|
+
}
|
|
431
682
|
export interface ColorScaleConfig {
|
|
432
683
|
/** The scale's colors: one color, expanded into a light→dark ramp, or an array of colors to step through. */
|
|
433
684
|
color?: string | string[];
|
|
@@ -436,6 +687,12 @@ export interface ColorScaleConfig {
|
|
|
436
687
|
outside this range map to the nearest color.
|
|
437
688
|
*/
|
|
438
689
|
domain?: number[];
|
|
690
|
+
/**
|
|
691
|
+
Draws a bucket-type scale ("jenks", "quantile", …) as one bar with an
|
|
692
|
+
axis along it, labeled where the buckets start, instead of a labeled
|
|
693
|
+
swatch for each bucket. Defaults to `false`.
|
|
694
|
+
*/
|
|
695
|
+
bucketAxis?: boolean;
|
|
439
696
|
/**
|
|
440
697
|
Formats the label for each bucket in a bucket-type scale ("jenks",
|
|
441
698
|
"quantile", …). Passed the bucket's start value, its index, the full
|
|
@@ -456,34 +713,44 @@ export interface ColorScaleConfig {
|
|
|
456
713
|
*/
|
|
457
714
|
scale?: ColorScaleTypeSetting;
|
|
458
715
|
/**
|
|
459
|
-
Whether hovering a
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
end). A bucketed bar (`bucketAxis`) also outlines the value's bucket.
|
|
464
|
-
A scale drawn as discrete swatches gets no mark; the value's swatch
|
|
465
|
-
stays lit and the others dim instead. On charts whose shape hover is
|
|
466
|
-
off (`hoverOpacity: 1`, as on Geomap and Calendar or past
|
|
467
|
-
`dataCutoff`), that swatch highlight comes from this option too, so
|
|
468
|
-
`false` turns it off there. Defaults to `true`.
|
|
716
|
+
Whether hovering a shape marks its value on the color scale: a tick and
|
|
717
|
+
a badge with the value (and, on a `bucketAxis`, an outline around its
|
|
718
|
+
bucket). A swatch scale lights the value's swatch instead. Defaults to
|
|
719
|
+
`true`.
|
|
469
720
|
*/
|
|
470
721
|
hoverMark?: boolean;
|
|
471
722
|
/**
|
|
472
|
-
|
|
473
|
-
(
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
`
|
|
484
|
-
hovered value.
|
|
723
|
+
Holds the palest step of a single-hue ramp darker on a light theme
|
|
724
|
+
(`colorRamp`'s `ordinal` option), so the lowest values still read as
|
|
725
|
+
thin lines against the background instead of fading into it. Dark
|
|
726
|
+
themes keep their ramps. Defaults to `false`.
|
|
727
|
+
*/
|
|
728
|
+
ordinalRamp?: boolean;
|
|
729
|
+
/**
|
|
730
|
+
Styles the `hoverMark`: `tickConfig` (`stroke`, `strokeWidth`, `length`),
|
|
731
|
+
`badgeConfig` (`fill`, `stroke`, `strokeWidth`, `fontColor`,
|
|
732
|
+
`fontFamily`, `fontSize`, `fontWeight`, `padding`, `rx`), and
|
|
733
|
+
`outlineConfig`, the bucket outline on a `bucketAxis` bar (`stroke`,
|
|
734
|
+
`strokeWidth`). Each is a value or a function of the hovered value.
|
|
485
735
|
*/
|
|
486
736
|
hoverMarkConfig?: ColorScaleHoverMarkConfig;
|
|
737
|
+
/**
|
|
738
|
+
Draws the scale as a bivariate key: each row's `value` is a pair of
|
|
739
|
+
numbers, and a chart sets this when its `colorScale` names two fields.
|
|
740
|
+
Defaults to `false`.
|
|
741
|
+
*/
|
|
742
|
+
bivariate?: boolean;
|
|
743
|
+
/** How many quantile bins a bivariate scale splits each variable into, from `2` to `4`. Defaults to `3`. */
|
|
744
|
+
bivariateBuckets?: number;
|
|
745
|
+
/**
|
|
746
|
+
A bivariate scale's colors: a square grid, row-major from the low/low
|
|
747
|
+
corner, each row one bin of the second variable and each column one bin
|
|
748
|
+
of the first. A grid of another size than `bivariateBuckets` is blended
|
|
749
|
+
to fit. Defaults to Joshua Stevens' blue–red 3×3 scheme.
|
|
750
|
+
*/
|
|
751
|
+
bivariateColors?: string[];
|
|
752
|
+
/** A bivariate key's names for its two variables, in `colorScale` order. Defaults to the two field names. */
|
|
753
|
+
bivariateLabels?: [string, string];
|
|
487
754
|
}
|
|
488
755
|
/** `colorDefaults` input: any subset of the color defaults, with `scale` also accepting an array of colors. */
|
|
489
756
|
export type ColorDefaultsConfig = Partial<Omit<ColorDefaults, "scale">> & {
|
|
@@ -511,6 +778,24 @@ export interface SaveControlConfig {
|
|
|
511
778
|
/** Other options are passed to html-to-image when saving a PNG or JPG, such as `pixelRatio` or `quality`. */
|
|
512
779
|
[key: string]: unknown;
|
|
513
780
|
}
|
|
781
|
+
/** Styles the ring keyboard navigation draws around the focused mark. Each is a value or a `(d, i) => value` accessor of the focused data row. */
|
|
782
|
+
export interface KeyboardNavConfig {
|
|
783
|
+
/** The ring's color. Defaults to the ink that reads against the chart's background (dark on a light page, light on a dark one). */
|
|
784
|
+
stroke?: string | ((d: DataPoint, i: number) => string);
|
|
785
|
+
/** The ring's width in pixels. Defaults to `2`. */
|
|
786
|
+
strokeWidth?: number | ((d: DataPoint, i: number) => number);
|
|
787
|
+
/** Space between the mark and a rectangular or circular ring, in pixels. Defaults to `2`. A path (a pie wedge, a map region) is outlined along its own edge. */
|
|
788
|
+
padding?: number | ((d: DataPoint, i: number) => number);
|
|
789
|
+
}
|
|
790
|
+
/** Fits and styles circle labels (see `labelPosition`). The TextBox keys style labels drawn beside their circles. */
|
|
791
|
+
export interface PointLabelConfig extends Omit<TextBoxConfig, "fontMin" | "fontSize" | "padding"> {
|
|
792
|
+
/** The smallest font size, in pixels, of a label inside its circle under `"auto"` (default `10`). */
|
|
793
|
+
fontMin?: number;
|
|
794
|
+
/** The font size, in pixels, of a label beside its circle (default `11`). */
|
|
795
|
+
fontSize?: number;
|
|
796
|
+
/** The space, in pixels, between a circle's edge and a label beside it (default `3`). */
|
|
797
|
+
padding?: number;
|
|
798
|
+
}
|
|
514
799
|
export interface D3plusConfig {
|
|
515
800
|
/** Data array or URL string to load data from. */
|
|
516
801
|
data?: DataPoint[] | string;
|
|
@@ -531,6 +816,14 @@ export interface D3plusConfig {
|
|
|
531
816
|
aggs?: {
|
|
532
817
|
[k: string]: (d: DataPoint[]) => unknown;
|
|
533
818
|
};
|
|
819
|
+
/**
|
|
820
|
+
Which side of ArcDiagram's line the arcs take: `"above"` (the default),
|
|
821
|
+
`"below"`, or `"both"`, where a link running forward along the line
|
|
822
|
+
(its source before its target) arcs above and one running backward arcs
|
|
823
|
+
below. On a vertical line, "above" is its right side. Node labels sit
|
|
824
|
+
on the other side of the line (below it with `"both"`).
|
|
825
|
+
*/
|
|
826
|
+
arcSide?: "above" | "below" | "both";
|
|
534
827
|
/** Hides the SVG from assistive technology when true (`aria-hidden`). */
|
|
535
828
|
ariaHidden?: boolean;
|
|
536
829
|
/**
|
|
@@ -549,15 +842,9 @@ export interface D3plusConfig {
|
|
|
549
842
|
shapeConfig?: Record<string, unknown>;
|
|
550
843
|
};
|
|
551
844
|
/**
|
|
552
|
-
Whether hovering a Plot's mark draws a dashed guide
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
`tickFormat` when set). `"x"` or `"y"` draws them for that direction
|
|
556
|
-
only (each including its secondary axis). A bar is badged on its value
|
|
557
|
-
axis only. With a discrete axis, the shared tooltip's crosshair is that
|
|
558
|
-
axis's guide, and the value axis follows the hovered series' point (or
|
|
559
|
-
the one nearest the pointer). Defaults to `true` (`"x"` on BumpChart,
|
|
560
|
-
whose y axes label series rather than values).
|
|
845
|
+
Whether hovering a Plot's mark draws a dashed guide to each axis with a
|
|
846
|
+
badge showing its value there. `"x"` or `"y"` limits it to that
|
|
847
|
+
direction. Defaults to `true` (`"x"` on BumpChart and Streamgraph).
|
|
561
848
|
*/
|
|
562
849
|
axisHover?: boolean | "x" | "y";
|
|
563
850
|
/**
|
|
@@ -605,53 +892,35 @@ export interface D3plusConfig {
|
|
|
605
892
|
barWidth?: string | false | ((d: DataPoint, i?: number) => number);
|
|
606
893
|
/**
|
|
607
894
|
BarChart/Marimekko with `barWidth`: whether each category's axis label
|
|
608
|
-
also shows its bar's share of the total width
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
the axis breaks back to a `0`
|
|
628
|
-
tick and bars run through the break, with its gap cut across them,
|
|
629
|
-
and with it off the axis
|
|
630
|
-
stretches down to `0`. As with `yDomain([n])`, only `n` is
|
|
631
|
-
pinned: the far end comes from the data and is rounded where the
|
|
632
|
-
axis would round it with no domain set (left at the data when the
|
|
633
|
-
axis config's `rounding` is "none"), and marks for values past `n`
|
|
634
|
-
stop at the axis's edge.
|
|
635
|
-
When every value sits at or below `n`, it ends the axis instead,
|
|
636
|
-
like `yDomain([undefined, n])`. A bound given in
|
|
637
|
-
`yDomain`/`xDomain` wins.
|
|
895
|
+
also shows its bar's share of the total width ("Retail" over "50%").
|
|
896
|
+
`"opposite"` puts the shares on the axis across from the names (styled
|
|
897
|
+
with `x2Config`/`y2Config`). `barWidthShareFormat` changes the text.
|
|
898
|
+
Defaults to `"opposite"` for Marimekko, `false` for BarChart.
|
|
899
|
+
*/
|
|
900
|
+
barWidthShare?: boolean | "opposite";
|
|
901
|
+
/**
|
|
902
|
+
BarChart/Marimekko with `barWidthShare`: returns each bar's width-share
|
|
903
|
+
label. Called with the merge of the bar's rows' data (numbers summed
|
|
904
|
+
unless `aggs` says otherwise) and the bar's `{share, size, total,
|
|
905
|
+
text}`: its share of the total width (0–1), its width measure, every
|
|
906
|
+
bar's combined width, and the default label (such as "23%"). The
|
|
907
|
+
tooltip keeps showing the share.
|
|
908
|
+
*/
|
|
909
|
+
barWidthShareFormat?: (d: DataPoint, info: BarShareInfo) => unknown;
|
|
910
|
+
/**
|
|
911
|
+
Starts a Plot's value axis at a value, like `yDomain([n])` (or
|
|
912
|
+
`xDomain([n])` for horizontal charts); the far end comes from the data.
|
|
913
|
+
Bars, areas, and stems still grow from `0`, so with `baselineBreak` on
|
|
914
|
+
the axis breaks back to a `0` tick. A bound in `yDomain`/`xDomain` wins.
|
|
638
915
|
*/
|
|
639
916
|
baseline?: number;
|
|
640
917
|
/**
|
|
641
|
-
When
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
value domain (`yDomain`/`yConfig.domain`, or the x versions for
|
|
648
|
-
horizontal charts), and bars and areas start at the baseline tick,
|
|
649
|
-
with the break's gap cut across them (`baselineBreakConfig`'s
|
|
650
|
-
`mask`); turned off, a `yDomain` stretches to reach the baseline while a
|
|
651
|
-
`yConfig.domain` is kept and cuts its bars off at the axis. Defaults
|
|
652
|
-
to `true` for the Plots whose marks grow from `0`, such as BarChart,
|
|
653
|
-
AreaPlot, Histogram, and Lollipop (each chart lists its own default),
|
|
654
|
-
and `false` for other Plots and a standalone Axis.
|
|
918
|
+
When a linear value axis's domain stops short of the `baseline` (e.g.
|
|
919
|
+
`[1100, 2100]` with a baseline of `0`), keeps the baseline tick and
|
|
920
|
+
breaks the axis between it and the domain, styled by
|
|
921
|
+
`baselineBreakConfig`. Turned off, a Plot's `yDomain` stretches to the
|
|
922
|
+
baseline instead. Defaults to `true` for Plots whose marks grow from `0`
|
|
923
|
+
(BarChart, AreaPlot, Histogram, Lollipop), else `false`.
|
|
655
924
|
*/
|
|
656
925
|
baselineBreak?: boolean;
|
|
657
926
|
/** Bullet: the qualitative ranges behind each measure, as threshold values (`[60, 85]`) or band objects (`{min, max, color}`), or a `(d, i) => bands` accessor for per-row bands. */
|
|
@@ -664,6 +933,25 @@ export interface D3plusConfig {
|
|
|
664
933
|
max?: number;
|
|
665
934
|
color?: string;
|
|
666
935
|
})[]);
|
|
936
|
+
/**
|
|
937
|
+
Hexbin: the bin shape, `"hex"` (default) for hexagons or `"square"`
|
|
938
|
+
for squares, or `false` to draw no bins (for contours alone).
|
|
939
|
+
*/
|
|
940
|
+
binShape?: "hex" | "square" | false;
|
|
941
|
+
/**
|
|
942
|
+
Hexbin: the bin size in pixels, a hexagon's radius or a square's side.
|
|
943
|
+
Bins keep this size at any zoom: the observations are binned again for
|
|
944
|
+
each view, and the colorScale refits to the bins in view. Defaults to
|
|
945
|
+
`12`.
|
|
946
|
+
*/
|
|
947
|
+
binSize?: number;
|
|
948
|
+
/**
|
|
949
|
+
Hexbin: what each bin measures, which its color shows. `"count"`
|
|
950
|
+
(default) is the number of observations in the bin; `{value, agg,
|
|
951
|
+
label}` is the `"sum"` (default) or `"mean"` of `value` (a data key or
|
|
952
|
+
accessor) over the bin's observations, named `label` in the tooltip.
|
|
953
|
+
*/
|
|
954
|
+
binValue?: BinValueOption;
|
|
667
955
|
/** Candlestick: the share of each period's room its candle body (or OHLC ticks) spans, from 0 to 1. Defaults to `0.7`. */
|
|
668
956
|
bodyWidth?: number;
|
|
669
957
|
/** BoxWhisker: accessor or data key for each summary row's upper whisker end. See `boxMedian`. */
|
|
@@ -683,6 +971,8 @@ export interface D3plusConfig {
|
|
|
683
971
|
boxMin?: string | ((d: DataPoint, i: number) => number);
|
|
684
972
|
/** BoxWhisker: accessor or data key for each summary row's outliers, an array of values drawn as points past the whiskers. Used only with the other box statistics; see `boxMedian`. */
|
|
685
973
|
boxOutliers?: string | ((d: DataPoint, i: number) => number[]);
|
|
974
|
+
/** Alluvial: the fill opacity of the bands between columns (default `0.5`). */
|
|
975
|
+
bandOpacity?: number;
|
|
686
976
|
/** BoxWhisker: accessor or data key for each summary row's lower quartile, where its box starts. See `boxMedian`. */
|
|
687
977
|
boxQ1?: string | ((d: DataPoint, i: number) => number);
|
|
688
978
|
/** BoxWhisker: accessor or data key for each summary row's upper quartile, where its box ends. See `boxMedian`. */
|
|
@@ -709,7 +999,15 @@ export interface D3plusConfig {
|
|
|
709
999
|
brushing?: boolean;
|
|
710
1000
|
/** Bullet: the most each bullet's band can be thick, in pixels (default 40); raise it to let rows fill a tall chart. */
|
|
711
1001
|
bulletSize?: number;
|
|
712
|
-
/**
|
|
1002
|
+
/**
|
|
1003
|
+
Whether the chart uses the data cache that every chart on the page
|
|
1004
|
+
shares for the files fetched by `data`, `links`, `nodes`, `topojson`,
|
|
1005
|
+
and `fitObject`, so charts loading the same URL share one request and
|
|
1006
|
+
loading it again, or changing a formatter, needs none. The cache uses
|
|
1007
|
+
up to about 50 MB of memory, dropping the least recently used files
|
|
1008
|
+
first. Defaults to `true`; `false` fetches on every load.
|
|
1009
|
+
`clearDataCache()` from `@d3plus/data` empties the cache.
|
|
1010
|
+
*/
|
|
713
1011
|
cache?: boolean;
|
|
714
1012
|
/** Calendar: styles the weekday, month, and year labels (`fontColor`, `fontFamily`, `fontSize`, default `11`, and `fontWeight`). */
|
|
715
1013
|
calendarLabelConfig?: {
|
|
@@ -722,6 +1020,50 @@ export interface D3plusConfig {
|
|
|
722
1020
|
cellPadding?: number;
|
|
723
1021
|
/** Calendar: each cell's corner radius, in pixels (kept below a third of the cell). Defaults to `2`. */
|
|
724
1022
|
cellRadius?: number;
|
|
1023
|
+
/**
|
|
1024
|
+
Pie (when `innerRadius` leaves a hole, as in a Donut), Sunburst and
|
|
1025
|
+
RadialBar: text drawn in the chart's empty middle. `true` draws the sum
|
|
1026
|
+
of every drawn row's value (Sunburst's `sum`), formatted the way the
|
|
1027
|
+
tooltips format values; a string draws that string; a function
|
|
1028
|
+
receives the drawn rows (after filters and hidden legend entries) and
|
|
1029
|
+
their total and returns the text. The text wraps and shrinks to fit
|
|
1030
|
+
the hole (see `centerLabelConfig`) and is left out when it can't fit
|
|
1031
|
+
whole, or, on a Sunburst, once a click zooms into a node. Defaults to
|
|
1032
|
+
`false`.
|
|
1033
|
+
*/
|
|
1034
|
+
centerLabel?: boolean | string | ((data: DataPoint[], total: number) => string | false);
|
|
1035
|
+
/**
|
|
1036
|
+
Pie, Sunburst and RadialBar: styles the `centerLabel` with TextBox keys
|
|
1037
|
+
(`fontColor`, `fontFamily`, `fontWeight`, `lineHeight`, `padding`, …).
|
|
1038
|
+
The text shrinks from `fontMax` (default `40`) to fit the hole, down to
|
|
1039
|
+
`fontMin` (default `10`); a `fontSize` fixes its size instead. Defaults
|
|
1040
|
+
to the chart's text color and `padding: 5`. Merged into the current
|
|
1041
|
+
config.
|
|
1042
|
+
*/
|
|
1043
|
+
centerLabelConfig?: TextBoxConfig;
|
|
1044
|
+
/**
|
|
1045
|
+
Sankey: draws links that loop back to a node they left (A → B → A, or a
|
|
1046
|
+
node to itself) as bands that run in a lane above or below the nodes.
|
|
1047
|
+
`false` leaves them out, with a warning. Defaults to `true`.
|
|
1048
|
+
*/
|
|
1049
|
+
circularLinks?: boolean;
|
|
1050
|
+
/**
|
|
1051
|
+
Network and ArcDiagram: colors each node by its cluster (found with the
|
|
1052
|
+
Louvain method, weighted by `linkSize`), named after its most-connected
|
|
1053
|
+
node and listed in the legend; clicking a cluster zooms to it. Applies
|
|
1054
|
+
only while the chart's color is its default. Defaults to `true`.
|
|
1055
|
+
*/
|
|
1056
|
+
cluster?: boolean;
|
|
1057
|
+
/**
|
|
1058
|
+
Network and ArcDiagram: names and styles the clusters (see `cluster`).
|
|
1059
|
+
`label` names each cluster: it receives the row of the cluster's
|
|
1060
|
+
most-connected node, the cluster's index (0 is the largest), and every
|
|
1061
|
+
member's row. `max` is the most clusters to keep (default `12`): while
|
|
1062
|
+
there are more, the smallest joins the cluster it shares the most link
|
|
1063
|
+
weight with, or the largest when it has none. `labelConfig` styles the
|
|
1064
|
+
names a Network draws inside its clusters, or `false` draws none.
|
|
1065
|
+
*/
|
|
1066
|
+
clusterConfig?: ClusterConfig;
|
|
725
1067
|
/**
|
|
726
1068
|
Candlestick: accessor or data key for each period's closing value
|
|
727
1069
|
(default `"close"`). It is the chart's `y`: setting `y` sets it.
|
|
@@ -733,21 +1075,56 @@ export interface D3plusConfig {
|
|
|
733
1075
|
When the color is a category that isn't one of the `groupBy` levels (for example, points grouped by `"country"` and colored by `"region"`), the legend shows one entry per category, labelled by the category. Clicking, shift+clicking, or hovering an entry hides, solos, or highlights every item in that category.
|
|
734
1076
|
*/
|
|
735
1077
|
color?: string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint]) | false;
|
|
1078
|
+
/**
|
|
1079
|
+
Alluvial: the column whose categories color the bands — a column index,
|
|
1080
|
+
or a dimension's data key or title (default `0`, the first column). Each
|
|
1081
|
+
row's band keeps its category's color through every column, and the
|
|
1082
|
+
legend lists that column's categories.
|
|
1083
|
+
*/
|
|
1084
|
+
colorBy?: number | string;
|
|
736
1085
|
/** Overrides for the default colors used for data fills and legible text (see `colorDefaults` in @d3plus/color). */
|
|
737
1086
|
colorDefaults?: ColorDefaultsConfig;
|
|
738
1087
|
/** Treat a discrete color field as ordered: color it with a single-hue light→dark ramp instead of nominal categorical hues. */
|
|
739
1088
|
colorOrdinal?: boolean;
|
|
740
1089
|
/**
|
|
741
|
-
Defines the value to be used for a color scale. Can be either an accessor function or a string key to reference in each data point.
|
|
1090
|
+
Defines the value to be used for a color scale. Can be either an accessor function or a string key to reference in each data point. Two of them (`["a", "b"]`) make a bivariate scale: each variable is split into quantile bins, the pair of bins picks a color from a grid, and the key is that grid turned into a diamond (see `colorScaleConfig.bivariateBuckets`, `bivariateColors`, and `bivariateLabels`). A row missing either value gets no colorScale color.
|
|
742
1091
|
*/
|
|
743
|
-
colorScale?: string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint]) | false;
|
|
1092
|
+
colorScale?: string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint]) | [ColorScaleField, ColorScaleField] | false;
|
|
744
1093
|
/** A pass-through to the config method of ColorScale. */
|
|
745
1094
|
colorScaleConfig?: {
|
|
1095
|
+
/** Configures the axis that labels a gradient or `bucketAxis` scale: `labels` lists the values it labels, `ticks` the values it marks, and `tickFormat` writes their text. Along a side of the chart, the whole scale (its bar, ticks, labels and title) takes at most a third of the chart's width (a scale at the left or right) or height (top or bottom), leaving out its title, and then its labels, when they don't fit; `maxSize` sets the room for the axis's labels and title instead. On a scale drawn as swatches, `title` and `titleTooltip` apply to the swatches' title, and `tickTooltip` to each swatch's label, given the value and index of the label at that bucket's start on a `bucketAxis` bar. */
|
|
746
1096
|
axisConfig?: AxisConfig;
|
|
1097
|
+
/** Draws a bucket-type scale as one bar with an axis along it instead of a labeled swatch for each bucket (see `ColorScaleConfig.bucketAxis`). Defaults to `false`. */
|
|
1098
|
+
bucketAxis?: boolean;
|
|
1099
|
+
/** Formats the label for each bucket in a bucket-type scale (see `ColorScaleConfig.bucketFormat`). */
|
|
1100
|
+
bucketFormat?: ColorScaleConfig["bucketFormat"];
|
|
1101
|
+
/** Given a bucket's minimum and maximum labels, returns the full label (see `ColorScaleConfig.bucketJoiner`). */
|
|
1102
|
+
bucketJoiner?: ColorScaleConfig["bucketJoiner"];
|
|
1103
|
+
/** How many buckets a bucket-type scale splits its values into, or the value each bucket starts at. Defaults to `5`. */
|
|
1104
|
+
buckets?: number | number[];
|
|
1105
|
+
/** Splits a diverging scale evenly on either side of its `midpoint`. Defaults to `true`. */
|
|
747
1106
|
centered?: boolean;
|
|
748
|
-
colors
|
|
1107
|
+
/** The scale's colors (see `ColorScaleConfig.color`). */
|
|
1108
|
+
color?: ColorScaleConfig["color"];
|
|
1109
|
+
/** The `[min, max]` values a linear scale spans (see `ColorScaleConfig.domain`). */
|
|
1110
|
+
domain?: number[];
|
|
1111
|
+
/** The value a diverging scale turns at. Defaults to `0`. */
|
|
1112
|
+
midpoint?: number;
|
|
1113
|
+
/** The thickness of a gradient's or a `bucketAxis` scale's bar, in pixels. Defaults to `10`. */
|
|
1114
|
+
size?: number;
|
|
1115
|
+
/** The space around the scale, in pixels. Defaults to `5`. */
|
|
1116
|
+
padding?: number;
|
|
1117
|
+
/** Styles the bar of a gradient or a `bucketAxis` scale, as a Rect config (`stroke`, `strokeWidth`, …). */
|
|
1118
|
+
rectConfig?: Record<string, unknown>;
|
|
1119
|
+
/** A scale at the left or right takes at most this many pixels of the chart's width, in place of a third of it. At the top or bottom, it is the scale's length, in place of `colorScaleMaxSize`. */
|
|
1120
|
+
width?: number;
|
|
1121
|
+
/** A scale at the top or bottom takes at most this many pixels of the chart's height, in place of a third of it. At the left or right, it is the scale's length, in place of `colorScaleMaxSize`. */
|
|
1122
|
+
height?: number;
|
|
1123
|
+
/** The negative pole of a diverging scale, and the hue of an all-negative ramp. Defaults to `colorDefaults.off`, or the theme's `colorScale.min` on a dark or custom theme. */
|
|
749
1124
|
colorMin?: CssColor;
|
|
1125
|
+
/** The midpoint of a diverging scale. Defaults to `colorDefaults.light`, or the theme's `colorScale.mid` on a dark or custom theme. */
|
|
750
1126
|
colorMid?: CssColor;
|
|
1127
|
+
/** The high end of a single-hue ramp and the positive pole of a diverging scale. Defaults to `colorDefaults.sequential`, or the theme's `colorScale.max` on a dark or custom theme. On a dark theme every ramp runs from a dim tint near the background up to this color. */
|
|
751
1128
|
colorMax?: CssColor;
|
|
752
1129
|
/** The kind of scale, or a function that picks one from the colorScale values on each render (see `ColorScaleConfig.scale`). Defaults to `"jenks"`. */
|
|
753
1130
|
scale?: ColorScaleTypeSetting;
|
|
@@ -755,6 +1132,16 @@ export interface D3plusConfig {
|
|
|
755
1132
|
hoverMark?: boolean;
|
|
756
1133
|
/** Styles the hover mark (see `ColorScaleConfig.hoverMarkConfig`). */
|
|
757
1134
|
hoverMarkConfig?: ColorScaleHoverMarkConfig;
|
|
1135
|
+
/** Configures the Legend that draws a bucket-type scale as a swatch for each bucket. Along a side of the chart, the swatches, their labels and title take at most a third of the chart's width (a scale at the left or right) or height (top or bottom): the title and labels wrap onto more lines, and when they still don't fit, the title is left out and then the labels are cut short. Its `width` (left or right) or `height` (top or bottom) sets another limit. */
|
|
1136
|
+
legendConfig?: Record<string, unknown>;
|
|
1137
|
+
/** How many quantile bins a bivariate `colorScale` splits each variable into, from `2` to `4`. Defaults to `3`. */
|
|
1138
|
+
bivariateBuckets?: number;
|
|
1139
|
+
/** A bivariate `colorScale`'s colors (see `ColorScaleConfig.bivariateColors`). Defaults to Joshua Stevens' blue–red 3×3 scheme. */
|
|
1140
|
+
bivariateColors?: string[];
|
|
1141
|
+
/** A bivariate key's names for its two variables. Defaults to the two field names. */
|
|
1142
|
+
bivariateLabels?: [string, string];
|
|
1143
|
+
/** Holds the palest step of a light theme's single-hue ramp darker (see `ColorScaleConfig.ordinalRamp`). Defaults to `true` when links are colored by number (`linkColor`), so the lowest-valued links still read as lines, and `false` otherwise. */
|
|
1144
|
+
ordinalRamp?: boolean;
|
|
758
1145
|
};
|
|
759
1146
|
/**
|
|
760
1147
|
The maximum pixel size for drawing the color scale: width for horizontal scales and height for vertical scales.
|
|
@@ -791,19 +1178,21 @@ export interface D3plusConfig {
|
|
|
791
1178
|
*/
|
|
792
1179
|
confidence?: ConfidenceBandSetting | ConfidenceBandSetting[] | false;
|
|
793
1180
|
/**
|
|
794
|
-
Styles the `confidence` interval: a line's band (
|
|
795
|
-
error bar (
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
false` leaves the bounds out of tooltips.
|
|
799
|
-
`bandOpacity` sets how each band looks where it is the innermost band
|
|
800
|
-
drawn — an array ramps from the outermost band to the innermost
|
|
801
|
-
(default `[0.15, 0.6]`), a number gives every band that opacity — in
|
|
802
|
-
place of `fillOpacity`. Accepted keys: any Area or Path key,
|
|
803
|
-
`bandOpacity`, `capWidth`, `tooltip`, `Area` (Area keys), and `Bar`
|
|
804
|
-
(Path keys and `capWidth`); any other key logs a warning.
|
|
1181
|
+
Styles the `confidence` interval: a line's band (Area keys) or a bar's
|
|
1182
|
+
error bar (Path keys, plus `capWidth`, in pixels or a percentage of the
|
|
1183
|
+
bar). Keys under `Area` or `Bar` apply to that shape only.
|
|
1184
|
+
`bandOpacity` ramps nested bands' opacity (default `[0.15, 0.6]`), and
|
|
1185
|
+
`tooltip: false` leaves the bounds out of tooltips.
|
|
805
1186
|
*/
|
|
806
1187
|
confidenceConfig?: Record<string, unknown>;
|
|
1188
|
+
/**
|
|
1189
|
+
How a line crosses a missing value (a skipped step, or a `null`/`NaN`
|
|
1190
|
+
value): `true` (the default) or `"solid"` draws straight through,
|
|
1191
|
+
`false` breaks the line, and `"dashed"` breaks it and bridges the gap
|
|
1192
|
+
with a short dash. An object styles the bridge: `stroke`,
|
|
1193
|
+
`strokeDasharray` (default `"2 4"`), `strokeWidth`, and `opacity`.
|
|
1194
|
+
*/
|
|
1195
|
+
connectGaps?: ConnectGaps;
|
|
807
1196
|
/** Funnel: fills the gap between consecutive stages with a neck joining their widths. */
|
|
808
1197
|
connector?: boolean;
|
|
809
1198
|
/**
|
|
@@ -814,6 +1203,26 @@ export interface D3plusConfig {
|
|
|
814
1203
|
optionally a function of the row the connector leaves and its index.
|
|
815
1204
|
*/
|
|
816
1205
|
connectorConfig?: Record<string, unknown>;
|
|
1206
|
+
/**
|
|
1207
|
+
Hexbin contour options: `bandwidth` (density kernel standard deviation,
|
|
1208
|
+
px, default `20`), `thresholds` (a level count, default `8`, or the
|
|
1209
|
+
levels themselves), `strokeWidth` (`"lines"` outline width, default
|
|
1210
|
+
`1.5`), `fillOpacity` (top `"filled"` level, default `0.8`), `labels`
|
|
1211
|
+
(write each level's value along its lines, default `true`),
|
|
1212
|
+
`labelSpacing` (px between labels on a line, default `"auto"`),
|
|
1213
|
+
`labelStep` (label every n-th level, default `"auto"`), `labelConfig`
|
|
1214
|
+
(TextBox config), and `levelFormat`.
|
|
1215
|
+
*/
|
|
1216
|
+
contourConfig?: ContourConfig;
|
|
1217
|
+
/**
|
|
1218
|
+
Hexbin: draws density contours. `"lines"` (or `true`) outlines each
|
|
1219
|
+
density level in its color, and `"filled"` fills the levels with an
|
|
1220
|
+
opacity ramp. Levels are in observations per bin (the count a bin
|
|
1221
|
+
would hold there), so contours share the bins' colorScale. Over bins,
|
|
1222
|
+
contour lines take the chart's text color and leave hover to the bins.
|
|
1223
|
+
Defaults to `false`.
|
|
1224
|
+
*/
|
|
1225
|
+
contours?: ContoursOption;
|
|
817
1226
|
/** Funnel: the conversion rates each stage's label shows: `"first"`, `"previous"`, `"both"` (or `true`), or `false`. */
|
|
818
1227
|
conversion?: boolean | "first" | "previous" | "both" | ("first" | "previous")[];
|
|
819
1228
|
/**
|
|
@@ -831,7 +1240,18 @@ export interface D3plusConfig {
|
|
|
831
1240
|
/** Maximum number of data points to render before downsampling. */
|
|
832
1241
|
dataCutoff?: number;
|
|
833
1242
|
/**
|
|
834
|
-
|
|
1243
|
+
Transforms `data` before it is drawn: receives the loaded file (or the
|
|
1244
|
+
Array passed as `data`) and returns the rows to draw, or a config object
|
|
1245
|
+
holding them as `data` (its other keys are applied to the chart). Also
|
|
1246
|
+
set by `data(url, format)`.
|
|
1247
|
+
*/
|
|
1248
|
+
dataFormat?: (data: DataPoint[]) => DataPoint[] | Record<string, unknown>;
|
|
1249
|
+
/**
|
|
1250
|
+
When `data` comes from a URL, re-fetches it every this many milliseconds
|
|
1251
|
+
and redraws when it changes, keeping hover, zoom, and legend state.
|
|
1252
|
+
Polling pauses while the tab (or, with `detectVisible`, the chart) is
|
|
1253
|
+
hidden, and a failed request keeps the last data. Only `data` is polled.
|
|
1254
|
+
Defaults to `false` (load once).
|
|
835
1255
|
*/
|
|
836
1256
|
dataPollingInterval?: number | false;
|
|
837
1257
|
/**
|
|
@@ -864,6 +1284,20 @@ export interface D3plusConfig {
|
|
|
864
1284
|
shape to the full width (Violin) or height (Ridgeline).
|
|
865
1285
|
*/
|
|
866
1286
|
densityScale?: "area" | "count" | "width";
|
|
1287
|
+
/**
|
|
1288
|
+
Gantt: accessor or data key for each task's predecessors, the ids (by
|
|
1289
|
+
`groupBy`) of the tasks it waits on, as an array or a comma-separated
|
|
1290
|
+
string (default `"dependencies"`). Each draws an elbow arrow from the
|
|
1291
|
+
predecessor's end to the task's start.
|
|
1292
|
+
*/
|
|
1293
|
+
dependencies?: string | ((d: DataPoint, i: number) => unknown) | false;
|
|
1294
|
+
/** Gantt: styles the dependency arrows: `stroke` (the chart's text color by default), `strokeWidth` (1), `strokeOpacity` (0.55), and `arrowSize` (6, in pixels). */
|
|
1295
|
+
dependencyConfig?: {
|
|
1296
|
+
stroke?: string;
|
|
1297
|
+
strokeWidth?: number;
|
|
1298
|
+
strokeOpacity?: number;
|
|
1299
|
+
arrowSize?: number;
|
|
1300
|
+
};
|
|
867
1301
|
/** Active depth level for nested groupings. */
|
|
868
1302
|
depth?: number;
|
|
869
1303
|
/**
|
|
@@ -883,28 +1317,57 @@ export interface D3plusConfig {
|
|
|
883
1317
|
*/
|
|
884
1318
|
detectVisibleInterval?: number;
|
|
885
1319
|
/**
|
|
886
|
-
|
|
1320
|
+
With `detectVisible` on, releases the chart's DOM and scene while it is
|
|
1321
|
+
scrolled out of view and redraws it when it returns, keeping pages with
|
|
1322
|
+
many charts light. Data and config are kept; zoom and selection are not,
|
|
1323
|
+
so set `false` to keep them. Defaults to `true`.
|
|
887
1324
|
*/
|
|
888
1325
|
detectVisibleUnload?: boolean;
|
|
889
1326
|
/**
|
|
890
1327
|
ParallelCoordinates: per-dimension options, keyed by dimension — `domain`
|
|
891
1328
|
(either end of a numeric domain may be `undefined`), `reverse`, `title`,
|
|
892
|
-
and any Axis config (`tickFormat`, `ticks`, `scale`,
|
|
1329
|
+
and any Axis config (`tickFormat`, `ticks`, `scale`, `tickTooltip`,
|
|
1330
|
+
`titleTooltip`, …).
|
|
893
1331
|
*/
|
|
894
1332
|
dimensionConfig?: Record<string, DimensionOptions>;
|
|
1333
|
+
/**
|
|
1334
|
+
Alluvial: styles the column titles drawn above each column (any TextBox
|
|
1335
|
+
config), and takes a `titleTooltip`: the tooltip shown when a title is
|
|
1336
|
+
hovered, as its text, a function that receives the title and returns it,
|
|
1337
|
+
or a tooltip config (as `tooltipConfig`) whose accessors receive the
|
|
1338
|
+
title. Unset (the default) or when the
|
|
1339
|
+
function returns nothing, a title cut short with an ellipsis shows its
|
|
1340
|
+
whole text; `false`, set or returned, shows no tooltip.
|
|
1341
|
+
@example
|
|
1342
|
+
{maxLines: 1, titleTooltip: title => notes[title]}
|
|
1343
|
+
*/
|
|
1344
|
+
dimensionTitleConfig?: Record<string, unknown> & {
|
|
1345
|
+
titleTooltip?: string | ((title: string) => string | false | void) | AxisTooltipConfig<[title: string]> | false;
|
|
1346
|
+
};
|
|
895
1347
|
/**
|
|
896
1348
|
ParallelCoordinates: the data keys to draw an axis for, in order.
|
|
897
1349
|
Defaults to every numeric key except the `groupBy` keys and `id`; a key
|
|
898
1350
|
whose values aren't all numbers gets a categorical axis.
|
|
1351
|
+
|
|
1352
|
+
Alluvial: the categorical dimensions, one column each, left to right —
|
|
1353
|
+
data keys, accessor functions `(d, i) => category`, or `{value, title}`
|
|
1354
|
+
objects. A key is its column's title; a bare accessor has none. Rows
|
|
1355
|
+
missing a category on any dimension (`undefined`, `null`, or `""`) are
|
|
1356
|
+
left out.
|
|
899
1357
|
*/
|
|
900
|
-
dimensions?:
|
|
1358
|
+
dimensions?: AlluvialDimensionInput[];
|
|
901
1359
|
/** Sets orientation of main category axis. */
|
|
902
1360
|
discrete?: "x" | "y" | "radius" | "angle";
|
|
903
1361
|
/** Candlestick: the color of periods that closed below their open, or an accessor of the row. Defaults to red. */
|
|
904
1362
|
downColor?: string | ((d: DataPoint, i: number) => string);
|
|
905
1363
|
/** Default duration of transitions, in milliseconds. */
|
|
906
1364
|
duration?: number;
|
|
907
|
-
/**
|
|
1365
|
+
/**
|
|
1366
|
+
Priestley and Gantt: accessor or data key for each row's end (default
|
|
1367
|
+
`"end"`). A key also aggregates grouped rows by their latest end.
|
|
1368
|
+
*/
|
|
1369
|
+
end?: string | ((d: DataPoint, i: number) => unknown);
|
|
1370
|
+
/** Calendar: the fill of days without a value. Defaults to the theme's `colorScale.missing` when it sets one, else a faint tint of the chart's text color, legible on light and dark backgrounds. */
|
|
908
1371
|
emptyFill?: string;
|
|
909
1372
|
/** Splits the chart into small multiples: one equally sized panel per distinct value of this data key or accessor, sharing one legend, color scale, title, and timeline. `false` draws a single chart. */
|
|
910
1373
|
facet?: string | ((d: DataPoint, i: number) => unknown) | false;
|
|
@@ -936,48 +1399,29 @@ export interface D3plusConfig {
|
|
|
936
1399
|
/** Allows removing specific geographies from topojson file to improve zoom. */
|
|
937
1400
|
fitFilter?: number | string | ((d: Record<string, unknown>) => boolean);
|
|
938
1401
|
/**
|
|
939
|
-
Marks a forecast:
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
`
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
backdrop starts at the earliest of those. `"auto"` (or `true`) flags
|
|
946
|
-
the rows whose `confidence` bounds spread away from their line. A
|
|
947
|
-
discrete-axis value (a date or year on a time axis) starts the
|
|
948
|
-
forecast there. Unset (the default), only a trend line projection
|
|
949
|
-
(`trendLineConfig.projection`) is marked, from the last fitted value;
|
|
950
|
-
`false` marks nothing, not even a projection. On bar charts the
|
|
951
|
-
backdrop starts at the edge of the first forecast bar, and bars keep
|
|
952
|
-
their own styles. Defaults to `"auto"` on a FanChart.
|
|
1402
|
+
Marks a forecast: a shaded backdrop, a rule, and a "Forecast" label over
|
|
1403
|
+
the forecast stretch, with lines dashed there (see `forecastConfig`).
|
|
1404
|
+
A function flags the forecast rows; `"auto"` (or `true`) flags rows whose
|
|
1405
|
+
`confidence` bounds spread from their line; a discrete-axis value starts
|
|
1406
|
+
the forecast there; `false` marks nothing. Unset (the default), only a
|
|
1407
|
+
trend line projection is marked. Defaults to `"auto"` on a FanChart.
|
|
953
1408
|
|
|
954
|
-
Bullet: each row's forecast (or other comparative measure), drawn as
|
|
955
|
-
|
|
956
|
-
|
|
1409
|
+
Bullet: each row's forecast (or other comparative measure), drawn as a
|
|
1410
|
+
paler bar behind the measure: a data key, an accessor, a number, or
|
|
1411
|
+
`false`.
|
|
957
1412
|
*/
|
|
958
1413
|
forecast?: boolean | "auto" | number | string | Date | ((d: DataPoint, i: number) => boolean | number);
|
|
959
1414
|
/**
|
|
960
|
-
Styles
|
|
961
|
-
|
|
962
|
-
`
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
`
|
|
967
|
-
line's forecast stretch (default `"6 4"`; `false` keeps lines solid).
|
|
968
|
-
Colors default to the chart's text color for its background. The
|
|
969
|
-
backdrop is chart chrome with no data row, so `shapeConfig.texture`
|
|
970
|
-
and `shapeConfig.backgroundImage` leave it plain; give it its own
|
|
971
|
-
`texture` (a textures.js name or config, drawn in the backdrop's color
|
|
972
|
-
over its shade at `textureOpacity`, default `0.3`, with
|
|
973
|
-
`textureDefault`) or `backgroundImage` (a URL,
|
|
974
|
-
fit by `backgroundImageFit`, `"cover"` or `"contain"`). Both are off
|
|
975
|
-
by default.
|
|
1415
|
+
Styles the `forecast` marker: the backdrop's `fill` and `fillOpacity`
|
|
1416
|
+
(default `0.05`), the rule's `stroke`, `strokeWidth`, `strokeOpacity`,
|
|
1417
|
+
and `strokeDasharray`, the `label` text (default "Forecast"; `false`
|
|
1418
|
+
hides it) and its font keys, `lineDasharray` for each line's forecast
|
|
1419
|
+
stretch (default `"6 4"`; `false` keeps lines solid), and an optional
|
|
1420
|
+
`texture` or `backgroundImage` for the backdrop. `fill: false` or
|
|
1421
|
+
`stroke: false` hides the backdrop or rule.
|
|
976
1422
|
|
|
977
|
-
Bullet: the forecast bar's `size` (a
|
|
978
|
-
|
|
979
|
-
`backgroundImage`/`backgroundImageFit`, each a value or a `(d, i)`
|
|
980
|
-
accessor.
|
|
1423
|
+
Bullet: the forecast bar's `size` (a share of the band), `opacity`,
|
|
1424
|
+
`fill`, `texture`, and `backgroundImage`/`backgroundImageFit`.
|
|
981
1425
|
*/
|
|
982
1426
|
forecastConfig?: Record<string, unknown>;
|
|
983
1427
|
/**
|
|
@@ -988,6 +1432,12 @@ export interface D3plusConfig {
|
|
|
988
1432
|
order. A `ySort`/`xSort` comparator on the category axis takes precedence.
|
|
989
1433
|
*/
|
|
990
1434
|
gapSort?: false | "ascending" | "descending";
|
|
1435
|
+
/**
|
|
1436
|
+
Gantt: accessor or data key for each task's group, such as its project
|
|
1437
|
+
phase. Grouped tasks sit under a header row naming the group, with a
|
|
1438
|
+
bracket spanning its tasks.
|
|
1439
|
+
*/
|
|
1440
|
+
group?: string | ((d: DataPoint, i: number) => unknown) | false;
|
|
991
1441
|
/** Grouping key(s) or accessor function(s). */
|
|
992
1442
|
groupBy?: string | string[] | ((d: DataPoint) => string | number) | ((d: DataPoint) => string | number)[];
|
|
993
1443
|
/**
|
|
@@ -1039,6 +1489,12 @@ export interface D3plusConfig {
|
|
|
1039
1489
|
hiddenOpacity?: number | ((d: DataPoint, i: number) => number);
|
|
1040
1490
|
/** The hover callback function for highlighting shapes on mouseover. */
|
|
1041
1491
|
hover?: ((d: DataPoint, i: number) => boolean) | false | null;
|
|
1492
|
+
/**
|
|
1493
|
+
How close (px) the pointer must come to a point mark (scatter and
|
|
1494
|
+
bubble points, Network nodes, Geomap points, Radar dots) to hover it, so small
|
|
1495
|
+
points are easy to reach. Defaults to `20`; `0` turns it off.
|
|
1496
|
+
*/
|
|
1497
|
+
hoverDistance?: number;
|
|
1042
1498
|
/** Candlestick: accessor or data key for each period's highest value (default `"high"`). */
|
|
1043
1499
|
high?: string | ((d: DataPoint, i: number) => number);
|
|
1044
1500
|
/** Persistently emphasizes matching marks (keep color) and grays the rest. */
|
|
@@ -1064,6 +1520,15 @@ export interface D3plusConfig {
|
|
|
1064
1520
|
quartiles?: Record<string, unknown>;
|
|
1065
1521
|
points?: Record<string, unknown>;
|
|
1066
1522
|
};
|
|
1523
|
+
/**
|
|
1524
|
+
Lets keyboard users move between the chart's marks: the chart is one Tab
|
|
1525
|
+
stop, the arrow keys move to the nearest mark in that direction, Home and
|
|
1526
|
+
End jump to the ends, Enter or Space click the focused mark, and Escape
|
|
1527
|
+
clears it. Defaults to `true`; `false` removes the Tab stop.
|
|
1528
|
+
*/
|
|
1529
|
+
keyboardNav?: boolean;
|
|
1530
|
+
/** Styles the focus ring around the mark keyboard navigation has focused (see `KeyboardNavConfig`). */
|
|
1531
|
+
keyboardNavConfig?: KeyboardNavConfig;
|
|
1067
1532
|
/**
|
|
1068
1533
|
Accessor function, or a constant string applied to every data point's
|
|
1069
1534
|
label (unlike `value`/`nodeId`/etc., a string here is not treated as a
|
|
@@ -1071,7 +1536,40 @@ export interface D3plusConfig {
|
|
|
1071
1536
|
*/
|
|
1072
1537
|
label?: string | string[] | false | AccessorFn;
|
|
1073
1538
|
/**
|
|
1074
|
-
|
|
1539
|
+
Gantt: the most the task label column may take: a share of the chart's
|
|
1540
|
+
width when 1 or below (default `0.3`), else pixels. The column fits the
|
|
1541
|
+
widest label up to it, wrapping or truncating longer ones; `0` hides it.
|
|
1542
|
+
*/
|
|
1543
|
+
labelWidth?: number;
|
|
1544
|
+
/**
|
|
1545
|
+
Where each shape's label goes: `"auto"`, `"along"`, `"inside"`, or
|
|
1546
|
+
`"outside"`, or a `(d, i) => string` accessor. `"auto"` picks
|
|
1547
|
+
whichever fits best per shape, and a label with no room is left out.
|
|
1548
|
+
|
|
1549
|
+
- Rings (Pie, Donut, Sunburst, Chord, RadialBar) and polar charts
|
|
1550
|
+
(Radar, PolarArea, RadialMatrix): `"along"` curves the name along its
|
|
1551
|
+
arc. `"inside"` keeps it straight; on a Pie or Donut, `"outside"`
|
|
1552
|
+
moves it beside the ring with a leader line.
|
|
1553
|
+
- Bars: inside or outside the bar. `"auto"` goes outside when the bar
|
|
1554
|
+
is short. Stacked bars always label inside.
|
|
1555
|
+
- Circles (Plot points, Network nodes, Geomap points): inside the
|
|
1556
|
+
circle, or beside it when it doesn't fit (`"outside"` always beside).
|
|
1557
|
+
- Stacked areas: `"auto"` and `"along"` run each name along its band;
|
|
1558
|
+
`"inside"` puts it in the band's largest box.
|
|
1559
|
+
|
|
1560
|
+
When every stacked area or RadialBar track is named along its shape,
|
|
1561
|
+
the default legend hides. Defaults to `"auto"`.
|
|
1562
|
+
*/
|
|
1563
|
+
labelPosition?: "auto" | "along" | "inside" | "outside" | ((d: DataPoint, i: number) => "auto" | "along" | "inside" | "outside");
|
|
1564
|
+
/**
|
|
1565
|
+
Whether to display the legend. By default it shows when it has more than
|
|
1566
|
+
one entry and each entry stands for a single group, or when entries are
|
|
1567
|
+
colored by a category that isn't a `groupBy` level. It hides when the
|
|
1568
|
+
chart's own labels already name every entry (see `labelPosition`), or
|
|
1569
|
+
when every Circle, Rect, and Bar of a Plot shows its whole label as its
|
|
1570
|
+
legend entry would, and stays while a series is hidden or soloed.
|
|
1571
|
+
`false` hides it, `true` always shows it, and a `(config, data) =>
|
|
1572
|
+
boolean` function decides.
|
|
1075
1573
|
*/
|
|
1076
1574
|
legend?: boolean | ((config: D3plusConfig, arr: DataPoint[]) => boolean);
|
|
1077
1575
|
/** Configuration object passed to the legend's config method. */
|
|
@@ -1087,11 +1585,21 @@ export interface D3plusConfig {
|
|
|
1087
1585
|
shapeConfig?: Record<string, string | number>;
|
|
1088
1586
|
};
|
|
1089
1587
|
/**
|
|
1090
|
-
Defines the click functionality of categorical legend squares. When set to false, clicking will hide that category and shift+clicking will solo that category. When set to true, clicking
|
|
1588
|
+
Defines the click functionality of categorical legend squares. When set to false, clicking will hide that category and shift+clicking will solo that category. When set to true, clicking will solo that category and shift+clicking will hide that category. The Back button undoes each click (see `legendHistory`).
|
|
1091
1589
|
*/
|
|
1092
1590
|
legendFilterInvert?: boolean | ((viz: VizBase) => boolean);
|
|
1093
1591
|
/**
|
|
1094
|
-
Whether
|
|
1592
|
+
Whether legend clicks go on the chart's Back history, so Back undoes
|
|
1593
|
+
them along with drill-downs, in order. Defaults to `true`; `false` leaves
|
|
1594
|
+
them off, so Back only steps out of drill-downs.
|
|
1595
|
+
*/
|
|
1596
|
+
legendHistory?: boolean;
|
|
1597
|
+
/**
|
|
1598
|
+
Whether the chart may draw a legend, size legend, or colorScale inside
|
|
1599
|
+
empty space around its marks (over a translucent box, see
|
|
1600
|
+
`legendInsetConfig`) instead of in a margin. Only a legend whose position
|
|
1601
|
+
is `"auto"` can move inside. Defaults to `true`; also accepts a function
|
|
1602
|
+
of the resolved config.
|
|
1095
1603
|
*/
|
|
1096
1604
|
legendInset?: boolean | ((config: D3plusConfig) => boolean);
|
|
1097
1605
|
/**
|
|
@@ -1118,12 +1626,15 @@ export interface D3plusConfig {
|
|
|
1118
1626
|
Defines which side of the visualization to anchor the legend. Expected values are `"auto"` (the default), `"top"`, `"bottom"`, `"left"`, `"right"`, and `false` to hide it. `"auto"` lets the chart choose: inside the chart when it fits there (see `legendInset`), otherwise the right side of charts more than 1.5 times as wide as they are tall and the bottom of all others. Any other side keeps the legend there.
|
|
1119
1627
|
*/
|
|
1120
1628
|
legendPosition?: false | PanelPosition | (() => false | PanelPosition);
|
|
1121
|
-
/**
|
|
1629
|
+
/**
|
|
1630
|
+
Comparator that orders the legend's entries. By default the legend reads in the order the chart draws: Treemap, Pack, Pie, Donut, Icicle, and Sunburst list their largest entries first; a stacked chart lists its series in stacking order, from the baseline outward (so the default `stackOrder`, `"descending"`, lists the largest first); Waffle and Waterfall follow their own order, and Network and ArcDiagram clusters come largest first; every other chart is alphabetical by label. A threshold group always comes last, whatever the sort.
|
|
1631
|
+
*/
|
|
1122
1632
|
legendSort?: (a: DataPoint, b: DataPoint) => number;
|
|
1123
1633
|
/** Configuration object for the legend tooltip. */
|
|
1124
1634
|
legendTooltip?: TooltipConfig;
|
|
1125
1635
|
/**
|
|
1126
|
-
Formats the Radar's level value labels
|
|
1636
|
+
Formats the Radar's level value labels and dot tooltip values, or the
|
|
1637
|
+
Hexbin's contour level labels and tooltips. Receives the value and
|
|
1127
1638
|
returns its label. Defaults to the abbreviated number format the axes
|
|
1128
1639
|
use (`1.5k`, `2M`, …).
|
|
1129
1640
|
*/
|
|
@@ -1161,15 +1672,115 @@ export interface D3plusConfig {
|
|
|
1161
1672
|
levels?: number | number[];
|
|
1162
1673
|
/** ParallelCoordinates: the lines' stroke opacity, or `"auto"` (default) to fade them as their number grows. */
|
|
1163
1674
|
lineOpacity?: number | "auto";
|
|
1164
|
-
/**
|
|
1165
|
-
|
|
1675
|
+
/**
|
|
1676
|
+
Labels each line with its series name: `true` or `"end"` past its right
|
|
1677
|
+
end, `"start"` past its left end, `"both"` at both ends, or `"along"`
|
|
1678
|
+
written along the line itself, following its curve. A function of each
|
|
1679
|
+
row picks per series (or `false`). End labels that would overlap are
|
|
1680
|
+
moved apart, and `lineLabelConfig` can add each end's value. When every
|
|
1681
|
+
line is named along it, the default legend hides. Defaults to `"along"`
|
|
1682
|
+
on LinePlot, no labels elsewhere.
|
|
1683
|
+
*/
|
|
1684
|
+
lineLabels?: LineLabelsSetting;
|
|
1685
|
+
/**
|
|
1686
|
+
Options for `lineLabels`. `value: true` adds the line's value at each
|
|
1687
|
+
labeled end after the series name (e.g. "Brazil 37%"), formatted as the
|
|
1688
|
+
y axis formats its ticks (its `tickFormat` when set). `valueFormat`
|
|
1689
|
+
formats it instead, as a function of the value, the row it belongs to,
|
|
1690
|
+
and the row's index. Defaults to `{value: false}`.
|
|
1691
|
+
*/
|
|
1692
|
+
lineLabelConfig?: LineLabelConfig;
|
|
1166
1693
|
/**
|
|
1167
1694
|
RadialBar's sweep, in degrees from `startAngle`. Defaults to 270 for
|
|
1168
1695
|
tracks and 360 for the circular bar chart.
|
|
1169
1696
|
*/
|
|
1170
1697
|
maxAngle?: number;
|
|
1698
|
+
/**
|
|
1699
|
+
Geomap: how far each link bows into an arc, as a share of the distance
|
|
1700
|
+
between its ends: `0` draws the plain great-circle path, and the default
|
|
1701
|
+
`0.2` bows it to the left of its direction (negative bows right), so
|
|
1702
|
+
links running both ways stay apart. Globes ignore it.
|
|
1703
|
+
*/
|
|
1704
|
+
linkCurve?: number;
|
|
1705
|
+
/**
|
|
1706
|
+
Network and Geomap: bundles links that run the same way into shared
|
|
1707
|
+
curves (force-directed edge bundling), so the main flows read through
|
|
1708
|
+
the clutter of a dense chart. A bundled Geomap link ignores
|
|
1709
|
+
`linkCurve`. Defaults to `false`.
|
|
1710
|
+
*/
|
|
1711
|
+
linkBundle?: boolean;
|
|
1712
|
+
/**
|
|
1713
|
+
Tunes `linkBundle`: `strength` (how closely links keep to their
|
|
1714
|
+
bundles, `0.85`), `cycles` (`6`), `iterations` (`50`),
|
|
1715
|
+
`compatibility` (how alike two links must be to bundle, `0.4`; lower
|
|
1716
|
+
bundles more), and `smoothing` (`true` draws smooth curves). Merged
|
|
1717
|
+
into the defaults.
|
|
1718
|
+
*/
|
|
1719
|
+
linkBundleConfig?: LinkBundleConfig;
|
|
1720
|
+
/**
|
|
1721
|
+
Network, Rings, and Geomap: the widest link, in pixels, when `linkSize`
|
|
1722
|
+
values differ. Network and Rings default to half the smallest node's
|
|
1723
|
+
radius (never thinner than `linkSizeMin`); Geomap defaults to `10`. A
|
|
1724
|
+
`linkSizeMin` wider than a set `linkSizeMax` is held to it.
|
|
1725
|
+
*/
|
|
1726
|
+
linkSizeMax?: number;
|
|
1727
|
+
/**
|
|
1728
|
+
Network, Rings, ArcDiagram, and Geomap: the thinnest link, in pixels,
|
|
1729
|
+
when `linkSize` values differ (default `1`).
|
|
1730
|
+
*/
|
|
1731
|
+
linkSizeMin?: number;
|
|
1732
|
+
/**
|
|
1733
|
+
Colors each link of a Network, Rings, Sankey, ArcDiagram, or Geomap (and
|
|
1734
|
+
its arrowheads): `"source"` or `"target"` takes that node's color, and a
|
|
1735
|
+
key or accessor reads a value from each link: a number is colored on the
|
|
1736
|
+
colorScale, and a string is a color or a palette category. `false` (the
|
|
1737
|
+
default) draws every link in the theme's link gray.
|
|
1738
|
+
*/
|
|
1739
|
+
linkColor?: false | "source" | "target" | string | ((d: DataPoint, i: number) => unknown);
|
|
1740
|
+
/**
|
|
1741
|
+
Text drawn at the middle of each link of a Network, Rings, Sankey,
|
|
1742
|
+
ArcDiagram, or Geomap: a key or accessor function (receiving the link, with
|
|
1743
|
+
`source` and `target` set to the data of its nodes, and its index in
|
|
1744
|
+
`links`). It sits halfway along a link's length, centered on
|
|
1745
|
+
a Sankey band, and at the top of an ArcDiagram arc, on a pad of the
|
|
1746
|
+
chart's background, and follows a curved link's curve (see
|
|
1747
|
+
`linkLabelConfig`). Numbers are abbreviated in the chart's locale.
|
|
1748
|
+
Labels that would cover a node or another label are hidden, the
|
|
1749
|
+
widest links' labels kept first. Defaults to none.
|
|
1750
|
+
*/
|
|
1751
|
+
linkLabel?: string | ((d: DataPoint, i: number) => unknown);
|
|
1752
|
+
/**
|
|
1753
|
+
Styles the link labels (see `linkLabel`): `rotate` (`"along"`, the
|
|
1754
|
+
default, runs text along its link, curves included; `"horizontal"`
|
|
1755
|
+
keeps it flat), `fontSize` (default `10`), `padding` (default `2`),
|
|
1756
|
+
`backgroundOpacity` of the pad behind the text (default `0.85`),
|
|
1757
|
+
`minRadius`, the tightest bend a label follows in ems (default `2`), and
|
|
1758
|
+
any other TextBox setting, such as `fontColor`.
|
|
1759
|
+
*/
|
|
1760
|
+
linkLabelConfig?: LinkLabelConfig;
|
|
1171
1761
|
/** Links this chart to every other chart with the same group name, so hovering, `active`, `highlight` (including search), and legend hide/solo clicks in one are mirrored in the rest, and a value gets the same categorical color in every chart. Rows match across charts by the value of `by` (a data key or accessor), which defaults to the chart's own id. A string is shorthand for `{group}`; set `hover`, `active`, `highlight`, `legend`, or `color` to `false` to stop sharing that behavior. */
|
|
1172
1762
|
link?: LinkOption;
|
|
1763
|
+
/**
|
|
1764
|
+
Network, Rings, ArcDiagram, and Geomap: each link's thickness, as a
|
|
1765
|
+
pixel number, or an accessor whose values are scaled (see
|
|
1766
|
+
`linkSizeScale`) between `linkSizeMin` and `linkSizeMax`. The accessor
|
|
1767
|
+
receives each link with `source` and `target` set to its nodes' data.
|
|
1768
|
+
*/
|
|
1769
|
+
linkSize?: number | ((d: DataPoint & {
|
|
1770
|
+
source: DataPoint;
|
|
1771
|
+
target: DataPoint;
|
|
1772
|
+
}, i: number) => number);
|
|
1773
|
+
/**
|
|
1774
|
+
Network, Rings, Sankey, Chord, ArcDiagram, and Geomap: transforms
|
|
1775
|
+
`links`
|
|
1776
|
+
before they are drawn. The function receives the loaded file (or the
|
|
1777
|
+
Array passed as `links`) and returns the links Array. It runs when the
|
|
1778
|
+
chart renders, whichever order `links` and `linksFormat` are set in,
|
|
1779
|
+
and setting it again re-runs it on the next render. Passing a formatter
|
|
1780
|
+
as the second argument of `links(url, format)` sets it, and setting
|
|
1781
|
+
`links` alone keeps it.
|
|
1782
|
+
*/
|
|
1783
|
+
linksFormat?: (data: DataPoint[]) => DataPoint[];
|
|
1173
1784
|
/**
|
|
1174
1785
|
Toggles the visibility of the status message that is displayed when loading AJAX requests and displaying errors.
|
|
1175
1786
|
*/
|
|
@@ -1184,6 +1795,12 @@ export interface D3plusConfig {
|
|
|
1184
1795
|
measureSize?: number;
|
|
1185
1796
|
/** Orders Violin and Ridgeline categories by median: `false` (default; data order), `"ascending"`, or `"descending"`. */
|
|
1186
1797
|
medianSort?: false | "ascending" | "descending";
|
|
1798
|
+
/**
|
|
1799
|
+
Gantt: accessor or data key for whether a task is a milestone, drawn as
|
|
1800
|
+
a diamond at its `end` (default `"milestone"`). Without one, a task that
|
|
1801
|
+
starts and ends at the same time is a milestone.
|
|
1802
|
+
*/
|
|
1803
|
+
milestone?: string | ((d: DataPoint, i: number) => unknown) | false;
|
|
1187
1804
|
/**
|
|
1188
1805
|
The color of the mask displayed underneath the status message when loading AJAX requests and displaying errors. Set to `false` to turn off the mask completely.
|
|
1189
1806
|
*/
|
|
@@ -1194,7 +1811,7 @@ export interface D3plusConfig {
|
|
|
1194
1811
|
messageStyle?: Record<string, unknown>;
|
|
1195
1812
|
/** Metric key for the visualization. */
|
|
1196
1813
|
metric?: string;
|
|
1197
|
-
/** Shows a small overview + draggable-viewport minimap
|
|
1814
|
+
/** Shows a small overview + draggable-viewport minimap in the chart's top-right corner (beneath the zoom controls, when they show) once the chart is zoomed in. On by default whenever `zoom` is enabled. */
|
|
1198
1815
|
minimap?: boolean;
|
|
1199
1816
|
/**
|
|
1200
1817
|
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.
|
|
@@ -1238,10 +1855,60 @@ export interface D3plusConfig {
|
|
|
1238
1855
|
Toggles the visibility of the status message that is displayed when no data is supplied to the visualization.
|
|
1239
1856
|
*/
|
|
1240
1857
|
noDataMessage?: boolean;
|
|
1858
|
+
/**
|
|
1859
|
+
The order of ArcDiagram's nodes along its line: `"data"` (the default,
|
|
1860
|
+
their order in `nodes`), `"label"` (alphabetical), `"group"` (by the
|
|
1861
|
+
top `groupBy` or `nodeGroupBy` level when there are several, else by
|
|
1862
|
+
the `color` value, then by label), `"degree"`
|
|
1863
|
+
(most connected first), or a comparator function receiving two node
|
|
1864
|
+
rows, as for `Array.prototype.sort`.
|
|
1865
|
+
*/
|
|
1866
|
+
nodeSort?: "data" | "label" | "group" | "degree" | ((a: DataPoint, b: DataPoint) => number);
|
|
1867
|
+
/**
|
|
1868
|
+
Network, Rings, Sankey, Chord, and ArcDiagram: transforms `nodes`
|
|
1869
|
+
before they are drawn. The function receives the loaded file (or the
|
|
1870
|
+
Array passed as `nodes`) and returns the nodes Array. It runs when the
|
|
1871
|
+
chart renders, whichever order `nodes` and `nodesFormat` are set in,
|
|
1872
|
+
and setting it again re-runs it on the next render. Passing a formatter
|
|
1873
|
+
as the second argument of `nodes(url, format)` sets it, and setting
|
|
1874
|
+
`nodes` alone keeps it.
|
|
1875
|
+
*/
|
|
1876
|
+
nodesFormat?: (data: DataPoint[]) => DataPoint[];
|
|
1877
|
+
/**
|
|
1878
|
+
Network, Rings, Sankey, ArcDiagram, and Geomap: how many links a node's tooltip
|
|
1879
|
+
lists below its number of connections, strongest first, each as the
|
|
1880
|
+
node at its other end ("→ Target" or "← Source") and its value. A
|
|
1881
|
+
number, or `false` to list none. Defaults to 3 when the links differ
|
|
1882
|
+
in value (`linkSize`, or Sankey's `value`), and none when they don't.
|
|
1883
|
+
*/
|
|
1884
|
+
nodeTooltipLinks?: number | false;
|
|
1885
|
+
/**
|
|
1886
|
+
Network, Rings, ArcDiagram, and Sankey: the network measures a node's
|
|
1887
|
+
tooltip lists. `true` (the default) lists them all, `false` none, or
|
|
1888
|
+
an Array picks some, in the order to list them: `"degree"` (its number
|
|
1889
|
+
of links, as "In-degree" and "Out-degree" when the chart draws arrows
|
|
1890
|
+
and in Sankey; it replaces the "Connections" count), `"betweenness"`
|
|
1891
|
+
(the share of shortest paths between other nodes that pass through
|
|
1892
|
+
it, 0 to 1), `"closeness"` (how near it is to the nodes it can reach,
|
|
1893
|
+
0 to 1), and `"cluster"` (the name of its cluster, when clusters color
|
|
1894
|
+
the chart). Betweenness and closeness are worked out while the browser
|
|
1895
|
+
is idle after the chart draws, and an open tooltip fills them in once
|
|
1896
|
+
they are ready.
|
|
1897
|
+
*/
|
|
1898
|
+
nodeTooltipStats?: boolean | ("degree" | "betweenness" | "closeness" | "cluster")[];
|
|
1899
|
+
/**
|
|
1900
|
+
Network, Rings, ArcDiagram, and Sankey: settings for the network
|
|
1901
|
+
measures in node tooltips. `weighted: true` counts a strong link (by
|
|
1902
|
+
`linkSize`, or Sankey's `value`) as a shorter step than a weak one for
|
|
1903
|
+
betweenness and closeness; by default every link is one step.
|
|
1904
|
+
*/
|
|
1905
|
+
nodeTooltipStatsConfig?: {
|
|
1906
|
+
weighted?: boolean;
|
|
1907
|
+
};
|
|
1241
1908
|
/**
|
|
1242
1909
|
Ocean color for geomaps (any CSS value including 'transparent'), or a
|
|
1243
|
-
`{light, dark}` pair chosen by the chart's
|
|
1244
|
-
default basemap's own water colors.
|
|
1910
|
+
`{light, dark}` pair chosen by the chart's `theme` (the page behind it
|
|
1911
|
+
in `"auto"` mode). Defaults to the default basemap's own water colors.
|
|
1245
1912
|
*/
|
|
1246
1913
|
ocean?: string | {
|
|
1247
1914
|
light: string;
|
|
@@ -1265,26 +1932,58 @@ export interface D3plusConfig {
|
|
|
1265
1932
|
*/
|
|
1266
1933
|
overlap?: number;
|
|
1267
1934
|
/**
|
|
1268
|
-
Room (px)
|
|
1269
|
-
`"auto"` (the default)
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
reserves exactly that much room and wraps labels to that width.
|
|
1935
|
+
Room (px) reserved around a Radar's web (or a polar chart's circle) for
|
|
1936
|
+
its labels. `"auto"` (the default) curves every label along the edge
|
|
1937
|
+
when they all fit (see `labelPosition`), else sizes the circle to the
|
|
1938
|
+
labels measured along their spokes, wrapping long ones onto two lines.
|
|
1939
|
+
A number reserves exactly that much room.
|
|
1274
1940
|
*/
|
|
1275
1941
|
outerPadding?: number | "auto";
|
|
1942
|
+
/** Priestley and Gantt: the space between neighboring bars, as a share of each row (d3's band `paddingInner`). */
|
|
1943
|
+
paddingInner?: number;
|
|
1944
|
+
/** Priestley and Gantt: the space before the first row and after the last, as a share of a row (d3's band `paddingOuter`). */
|
|
1945
|
+
paddingOuter?: number;
|
|
1276
1946
|
/** Pyramid: draws each value as a fraction of the frame's total, with the axis and tooltip reading percentages. */
|
|
1277
1947
|
percent?: boolean;
|
|
1278
1948
|
/** Calendar: what each block covers — `"year"` (the default; whole years, stacked) or `"month"` (whole months, as a grid of small calendars). */
|
|
1279
1949
|
period?: "year" | "month";
|
|
1280
1950
|
/** Coordinate accessor for point-based geomaps. */
|
|
1281
1951
|
point?: (d: DataPoint) => number[];
|
|
1952
|
+
/**
|
|
1953
|
+
Hexbin: the style of the observations `points` draws: `r`, the dot
|
|
1954
|
+
radius in pixels (default `1.5`); `fill` (defaults to the chart's text
|
|
1955
|
+
color); and `fillOpacity` (default `0.35`). Merged into the current
|
|
1956
|
+
config.
|
|
1957
|
+
*/
|
|
1958
|
+
pointConfig?: PointConfig;
|
|
1959
|
+
/**
|
|
1960
|
+
Fits and styles circle labels (see `labelPosition`): `fontMin` is the
|
|
1961
|
+
smallest font size a label may shrink to inside its circle before
|
|
1962
|
+
`"auto"` moves it beside the circle (default `10`, the size of the
|
|
1963
|
+
chart's smallest text, its total); `fontSize` is the size of a label
|
|
1964
|
+
beside its circle (default `11`); `padding` is the space between the
|
|
1965
|
+
circle's edge and that label (default `3`). The other TextBox keys
|
|
1966
|
+
(`fontColor`, `fontFamily`, `fontWeight`, `fontOpacity`, …) style the
|
|
1967
|
+
labels beside their circles, which default to the chart's text color.
|
|
1968
|
+
Merged into the current config.
|
|
1969
|
+
*/
|
|
1970
|
+
pointLabelConfig?: PointLabelConfig;
|
|
1971
|
+
/** Hexbin: draws the raw observations as small dots beneath the bins and contours. Defaults to `false`. */
|
|
1972
|
+
points?: boolean;
|
|
1282
1973
|
/** Point size accessor for geomaps. */
|
|
1283
1974
|
pointSize?: string | ((d: DataPoint) => number);
|
|
1284
1975
|
/** Minimum point size for geomaps. */
|
|
1285
1976
|
pointSizeMin?: number;
|
|
1286
1977
|
/** Maximum point size for geomaps. */
|
|
1287
1978
|
pointSizeMax?: number;
|
|
1979
|
+
/**
|
|
1980
|
+
Gantt: accessor or data key for each task's progress, a fraction from 0
|
|
1981
|
+
to 1 (`0.6`) or a percent string (`"60%"`); default `"progress"`. The
|
|
1982
|
+
done part of the bar fills in the task's color and the rest in a paler
|
|
1983
|
+
shade, and the tooltip lists it. A milestone below 100% draws pale and
|
|
1984
|
+
outlined. A key also averages grouped rows' progress.
|
|
1985
|
+
*/
|
|
1986
|
+
progress?: string | ((d: DataPoint, i: number) => unknown) | false;
|
|
1288
1987
|
/** Map projection name or function. */
|
|
1289
1988
|
projection?: string | ((x: number, y: number) => [number, number]);
|
|
1290
1989
|
/** Outer padding between the visualization edge and map shapes. */
|
|
@@ -1296,6 +1995,37 @@ export interface D3plusConfig {
|
|
|
1296
1995
|
wedge's area proportional to its value; `"linear"` its radius.
|
|
1297
1996
|
*/
|
|
1298
1997
|
radialScale?: "sqrt" | "linear";
|
|
1998
|
+
/**
|
|
1999
|
+
Whether the chart animates. `"auto"` (default) follows the viewer's OS
|
|
2000
|
+
setting, read from the `(prefers-reduced-motion: reduce)` media query at
|
|
2001
|
+
each draw (server-side rendering counts as not reduced). `true` always
|
|
2002
|
+
draws without motion: shapes, axes, legends, zooms, and fades jump
|
|
2003
|
+
straight to their final state. `false` always animates. `duration` keeps
|
|
2004
|
+
the value you set either way.
|
|
2005
|
+
*/
|
|
2006
|
+
reducedMotion?: "auto" | boolean;
|
|
2007
|
+
/**
|
|
2008
|
+
Plot: shaded spans between two values, such as a recession or a target
|
|
2009
|
+
range. Give each entry `x` (vertical) or `y` (horizontal) as
|
|
2010
|
+
`[start, end]` in data units, `x2`/`y2` for the secondary axes, or
|
|
2011
|
+
`ref: "plot"` for fractions of the plot. Optional: a `label` (top-left;
|
|
2012
|
+
`labelPosition: "end"` for top-right) with font keys and `maxWidth`,
|
|
2013
|
+
`fill`/`fillOpacity` (default the text color at `0.08`), `stroke`,
|
|
2014
|
+
`strokeWidth`, `strokeOpacity`, and `layer: "front"` to draw over the
|
|
2015
|
+
data. A band widens a continuous axis's domain to fit.
|
|
2016
|
+
*/
|
|
2017
|
+
referenceBands?: ReferenceBandConfig[];
|
|
2018
|
+
/**
|
|
2019
|
+
Plot: lines across the plot at one value, such as a target or a launch
|
|
2020
|
+
date. Give each entry `x` (vertical) or `y` (horizontal) in data units,
|
|
2021
|
+
`x2`/`y2` for the secondary axes, or `ref: "plot"` for a fraction of the
|
|
2022
|
+
plot. Optional: a `label` at the line's `"end"` or `"start"`
|
|
2023
|
+
(`labelPosition`) with font keys and `maxWidth`, `stroke`/`strokeOpacity`
|
|
2024
|
+
(default the text color at `0.6`), `strokeWidth` (`1`), `dash` (`true`
|
|
2025
|
+
or a dash pattern), and `layer: "front"` to draw over the data. A line
|
|
2026
|
+
widens a continuous axis's domain to fit.
|
|
2027
|
+
*/
|
|
2028
|
+
referenceLines?: ReferenceLineConfig[];
|
|
1299
2029
|
/** Row key for matrix-style layouts. */
|
|
1300
2030
|
row?: string;
|
|
1301
2031
|
/** Shows a top-left download button that saves the chart, as the reader sees it, as a PNG, SVG, or JPG file. On by default for every chart. */
|
|
@@ -1414,12 +2144,29 @@ export interface D3plusConfig {
|
|
|
1414
2144
|
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.
|
|
1415
2145
|
*/
|
|
1416
2146
|
sizeLegendPosition?: "right" | "bottom";
|
|
2147
|
+
/**
|
|
2148
|
+
Anchors a Plot's size scale at zero, so a mark's size is proportional to its value: with the default `sizeScale` of `"sqrt"`, each circle's area is (a value twice as large draws a circle with twice the area), and with `"linear"`, its radius. The largest value still draws at `sizeMax`, while `sizeMin` no longer sets the smallest mark's radius, so values near zero draw as small as they are. Off by default, except on BubbleChart. Ignored when any size is negative or `sizeScale` is `"log"`.
|
|
2149
|
+
*/
|
|
2150
|
+
sizeZero?: boolean;
|
|
2151
|
+
/**
|
|
2152
|
+
SlopeChart: colors each line by its direction between its first and
|
|
2153
|
+
last period. `true` draws rising lines green, falling lines red, and
|
|
2154
|
+
flat lines in the theme's muted text color, in shades that suit a light
|
|
2155
|
+
or dark theme; an object sets any of `up`, `down`, and `flat` itself.
|
|
2156
|
+
The legend and markers follow.
|
|
2157
|
+
*/
|
|
2158
|
+
slopeColor?: SlopeColorSetting;
|
|
1417
2159
|
/**
|
|
1418
2160
|
With two groupBy levels, Violin places violins by the first and sets
|
|
1419
2161
|
them side by side by the second. `split` draws a category holding
|
|
1420
2162
|
exactly two violins as the two halves of one shape instead.
|
|
1421
2163
|
*/
|
|
1422
2164
|
split?: boolean;
|
|
2165
|
+
/**
|
|
2166
|
+
Priestley and Gantt: accessor or data key for each row's start (default
|
|
2167
|
+
`"start"`). A key also aggregates grouped rows by their earliest start.
|
|
2168
|
+
*/
|
|
2169
|
+
start?: string | ((d: DataPoint, i: number) => unknown);
|
|
1423
2170
|
/** Funnel: the gap between consecutive stages, as a fraction (0–1) of each stage's slot. */
|
|
1424
2171
|
stagePadding?: number;
|
|
1425
2172
|
/** Whether to stack series. */
|
|
@@ -1437,7 +2184,8 @@ export interface D3plusConfig {
|
|
|
1437
2184
|
`"key"` / `"keyReverse"` alphabetically, `"none"` / `"data"` for input
|
|
1438
2185
|
order, or d3's `"insideOut"` / `"appearance"` / `"reverse"`), an Array of
|
|
1439
2186
|
series keys for an explicit order, a value accessor, or a `{value, order}`
|
|
1440
|
-
config to rank series by an aggregate of any data field.
|
|
2187
|
+
config to rank series by an aggregate of any data field. The default
|
|
2188
|
+
legend lists the series in this order, from the baseline outward.
|
|
1441
2189
|
*/
|
|
1442
2190
|
stackOrder?: string | string[] | {
|
|
1443
2191
|
value: string | ((d: DataPoint) => unknown);
|
|
@@ -1456,16 +2204,12 @@ export interface D3plusConfig {
|
|
|
1456
2204
|
/** Accessor function or string for the visualization's subtitle. */
|
|
1457
2205
|
subtitle?: string | ((data: DataPoint[]) => string);
|
|
1458
2206
|
/**
|
|
1459
|
-
Packs a Plot's circles into a beeswarm: each
|
|
1460
|
-
|
|
1461
|
-
overlap. `"x"` or `"y"` names the value axis; `true`
|
|
1462
|
-
values are numeric, else y; `false` draws a plain scatter.
|
|
1463
|
-
axis
|
|
1464
|
-
|
|
1465
|
-
Circles keep their ids, so switching a chart between `false` and `true`
|
|
1466
|
-
animates each circle between its scatter and swarm position. The default,
|
|
1467
|
-
`"auto"`, swarms only when every mark is a Circle and every row lacks a y
|
|
1468
|
-
(or x) value.
|
|
2207
|
+
Packs a Plot's circles into a beeswarm: each keeps its value along one
|
|
2208
|
+
axis and is placed beside its neighbors along the other, so none
|
|
2209
|
+
overlap. `"x"` or `"y"` names the value axis; `true` picks x when its
|
|
2210
|
+
values are numeric, else y; `false` draws a plain scatter. A category
|
|
2211
|
+
axis gets one swarm per category. The default, `"auto"`, swarms only
|
|
2212
|
+
when every mark is a Circle and rows lack the other axis's value.
|
|
1469
2213
|
*/
|
|
1470
2214
|
swarm?: boolean | "auto" | "x" | "y";
|
|
1471
2215
|
/**
|
|
@@ -1523,10 +2267,31 @@ export interface D3plusConfig {
|
|
|
1523
2267
|
tableViewSort?: boolean;
|
|
1524
2268
|
/** Funnel: narrows each stage toward the next stage's width, drawing a continuous funnel instead of flat bars. */
|
|
1525
2269
|
taper?: boolean;
|
|
2270
|
+
/** Gantt: styles the task label column: `fontColor` (the chart's text color by default), `fontFamily`, and `fontSize` (12). */
|
|
2271
|
+
taskLabelConfig?: {
|
|
2272
|
+
fontColor?: string;
|
|
2273
|
+
fontFamily?: string | string[];
|
|
2274
|
+
fontSize?: number;
|
|
2275
|
+
};
|
|
2276
|
+
/**
|
|
2277
|
+
Gantt: the order of the tasks: `"data"` (the default) keeps the data's
|
|
2278
|
+
order, `"start"` sorts by start, and a function compares two data rows.
|
|
2279
|
+
Groups follow their first task.
|
|
2280
|
+
*/
|
|
2281
|
+
taskSort?: "data" | "start" | ((a: DataPoint, b: DataPoint) => number);
|
|
1526
2282
|
/** Bullet: each row's target, drawn as a marker across the band: a data key, an accessor, a number shared by every row, or `false`. */
|
|
1527
2283
|
target?: string | number | ((d: DataPoint, i: number) => number) | false;
|
|
1528
2284
|
/** Bullet: the target marker's `size` (a fraction of the band's thickness), `stroke`, and `strokeWidth`, each a value or a `(d, i)` accessor. */
|
|
1529
2285
|
targetConfig?: Record<string, unknown>;
|
|
2286
|
+
/**
|
|
2287
|
+
The chart's colors. `"auto"` (the default) paints no background and
|
|
2288
|
+
follows the page, light or dark. `"light"` and `"dark"` paint the
|
|
2289
|
+
theme's background and take every chrome color from it. An object
|
|
2290
|
+
overrides tokens on top of its `base` preset, e.g.
|
|
2291
|
+
`{base: "dark", background: "#123", accent: "#ffd43b"}`. Colors set
|
|
2292
|
+
elsewhere in the config win over the theme.
|
|
2293
|
+
*/
|
|
2294
|
+
theme?: ThemeSetting;
|
|
1530
2295
|
/**
|
|
1531
2296
|
Threshold value for grouping small slices, as a share of the total
|
|
1532
2297
|
(`0.05` is 5%). On a stacked Plot (StackedArea, or an AreaPlot,
|
|
@@ -1543,7 +2308,8 @@ export interface D3plusConfig {
|
|
|
1543
2308
|
/**
|
|
1544
2309
|
URL template for XYZ map tiles, with `{z}`, `{x}`, `{y}` (and optional
|
|
1545
2310
|
`{s}` subdomain) placeholders — or a `{light, dark}` pair, chosen by the
|
|
1546
|
-
chart's
|
|
2311
|
+
chart's `theme` (the page behind it in `"auto"` mode). Defaults to
|
|
2312
|
+
Esri's Light Gray and Dark Gray Canvas.
|
|
1547
2313
|
*/
|
|
1548
2314
|
tileUrl?: string | {
|
|
1549
2315
|
light: string;
|
|
@@ -1553,7 +2319,15 @@ export interface D3plusConfig {
|
|
|
1553
2319
|
tiles?: boolean;
|
|
1554
2320
|
/** Time key for temporal data. */
|
|
1555
2321
|
time?: string;
|
|
1556
|
-
/**
|
|
2322
|
+
/**
|
|
2323
|
+
Predicate filtering which time slices are shown, or false to disable.
|
|
2324
|
+
With `time` set and no `timeFilter`, a chart starts on its latest
|
|
2325
|
+
period, or on `timelineDefault`/`timelineConfig.selection`; setting it
|
|
2326
|
+
starts the chart (and its timeline) on the periods it keeps. A
|
|
2327
|
+
viewer's pick on the timeline replaces it.
|
|
2328
|
+
@example
|
|
2329
|
+
{timeFilter: d => d.year === 2015}
|
|
2330
|
+
*/
|
|
1557
2331
|
timeFilter?: ((d: DataPoint, i: number) => boolean) | false;
|
|
1558
2332
|
/** Whether to show the timeline component. */
|
|
1559
2333
|
timeline?: boolean;
|
|
@@ -1571,8 +2345,28 @@ export interface D3plusConfig {
|
|
|
1571
2345
|
Tells the title whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the title appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
1572
2346
|
*/
|
|
1573
2347
|
titlePadding?: boolean | ((viz: VizBase) => boolean);
|
|
1574
|
-
/**
|
|
1575
|
-
|
|
2348
|
+
/**
|
|
2349
|
+
Gantt: draws a "today" line across the rows: `true` at the current
|
|
2350
|
+
time, or a date (or anything the axis parses) to mark that time. Off
|
|
2351
|
+
(`false`) by default; it only draws inside the time axis.
|
|
2352
|
+
*/
|
|
2353
|
+
today?: boolean | Date | string | number;
|
|
2354
|
+
/**
|
|
2355
|
+
Gantt: styles the "today" line like a `referenceLines` entry: `stroke`,
|
|
2356
|
+
`strokeWidth` (1.5), `strokeOpacity` (0.85), `dash`, and its `label`
|
|
2357
|
+
(the translated "Today"; `false` for none), with the label's font and
|
|
2358
|
+
`labelPosition`.
|
|
2359
|
+
*/
|
|
2360
|
+
todayConfig?: Omit<ReferenceLineConfig, "x" | "y" | "x2" | "y2" | "ref">;
|
|
2361
|
+
/**
|
|
2362
|
+
Whether to show tooltips, or a
|
|
2363
|
+
`(datum, index, {depth, maxDepth, legend})` accessor deciding per mark
|
|
2364
|
+
and legend entry. `depth` is the `groupBy` level (from 0) the hovered
|
|
2365
|
+
item stands for and `maxDepth` the deepest level, so
|
|
2366
|
+
`depth === maxDepth` keeps tooltips to the deepest level; `legend` is
|
|
2367
|
+
true for a legend entry. Defaults to `true`.
|
|
2368
|
+
*/
|
|
2369
|
+
tooltip?: boolean | ((d: DataPoint, i: number, levels: TooltipLevels) => boolean);
|
|
1576
2370
|
/** Configuration for the tooltip component. */
|
|
1577
2371
|
tooltipConfig?: TooltipConfig;
|
|
1578
2372
|
/**
|
|
@@ -1608,7 +2402,16 @@ export interface D3plusConfig {
|
|
|
1608
2402
|
trendLineConfig?: TrendLineConfig;
|
|
1609
2403
|
/** Path or object for the topojson data. */
|
|
1610
2404
|
topojson?: string | object;
|
|
1611
|
-
/**
|
|
2405
|
+
/**
|
|
2406
|
+
Geomap: transforms `topojson` before it is drawn. The function receives
|
|
2407
|
+
the loaded file (or the object passed as `topojson`) and returns the
|
|
2408
|
+
topojson to draw. It runs when the chart renders, whichever order
|
|
2409
|
+
`topojson` and `topojsonFormat` are set in, and setting it again re-runs
|
|
2410
|
+
it on the next render. Passing a formatter as the second argument of
|
|
2411
|
+
`topojson(url, format)` sets it, and setting `topojson` alone keeps it.
|
|
2412
|
+
*/
|
|
2413
|
+
topojsonFormat?: (data: Record<string, unknown>) => object;
|
|
2414
|
+
/** Geomap: the fill of shapes without data (or without a `colorScale` value). Defaults to the theme's `colorScale.missing` when it sets one, else a quiet gray that suits the basemap. */
|
|
1612
2415
|
topojsonFill?: CssColor;
|
|
1613
2416
|
/** Accessor function for topojson feature IDs. */
|
|
1614
2417
|
topojsonId?: (obj: Record<string, unknown>) => string;
|
|
@@ -1665,16 +2468,10 @@ export interface D3plusConfig {
|
|
|
1665
2468
|
*/
|
|
1666
2469
|
xBreak?: [number, number] | [number, number][];
|
|
1667
2470
|
/**
|
|
1668
|
-
The x domain
|
|
1669
|
-
|
|
1670
|
-
end
|
|
1671
|
-
|
|
1672
|
-
is "none"; time axes aren't rounded). With both ends set, neither is
|
|
1673
|
-
rounded. On a discrete axis it lists the categories to show, in
|
|
1674
|
-
order; data in other categories is not drawn. A full `xConfig`
|
|
1675
|
-
`domain` is the lower-level override: it wins over this, and is drawn
|
|
1676
|
-
exactly as given (rounded only by `xConfig`'s own `rounding`),
|
|
1677
|
-
without stretching to the chart's `baseline`.
|
|
2471
|
+
The x domain: `[min, max]` on a continuous axis, or the categories to
|
|
2472
|
+
show, in order, on a discrete one. Setting one end (`[min]` or
|
|
2473
|
+
`[undefined, max]`) pins only that end; the data fills the other. An
|
|
2474
|
+
`xConfig.domain` overrides this.
|
|
1678
2475
|
*/
|
|
1679
2476
|
xDomain?: (number | string | Date)[];
|
|
1680
2477
|
/** The x2 domain as an array. If either value is undefined, it is calculated from the data. */
|
|
@@ -1695,16 +2492,10 @@ export interface D3plusConfig {
|
|
|
1695
2492
|
*/
|
|
1696
2493
|
yBreak?: [number, number] | [number, number][];
|
|
1697
2494
|
/**
|
|
1698
|
-
The y domain
|
|
1699
|
-
|
|
1700
|
-
end
|
|
1701
|
-
|
|
1702
|
-
is "none"; time axes aren't rounded). With both ends set, neither is
|
|
1703
|
-
rounded. On a discrete axis it lists the categories to show, in
|
|
1704
|
-
order; data in other categories is not drawn. A full `yConfig`
|
|
1705
|
-
`domain` is the lower-level override: it wins over this, and is drawn
|
|
1706
|
-
exactly as given (rounded only by `yConfig`'s own `rounding`),
|
|
1707
|
-
without stretching to the chart's `baseline`.
|
|
2495
|
+
The y domain: `[min, max]` on a continuous axis, or the categories to
|
|
2496
|
+
show, in order, on a discrete one. Setting one end (`[min]` or
|
|
2497
|
+
`[undefined, max]`) pins only that end; the data fills the other. A
|
|
2498
|
+
`yConfig.domain` overrides this.
|
|
1708
2499
|
*/
|
|
1709
2500
|
yDomain?: (number | string | Date)[];
|
|
1710
2501
|
/** The y2 domain as an array. If either value is undefined, it is calculated from the data. */
|
|
@@ -1715,7 +2506,13 @@ export interface D3plusConfig {
|
|
|
1715
2506
|
y2Sort?: (a: DataPoint, b: DataPoint) => number;
|
|
1716
2507
|
/** Calendar: formats the year beside each year block — a d3-time-format specifier (default `"%Y"`), a function of the year's first day, or `false` for none. */
|
|
1717
2508
|
yearFormat?: string | ((date: Date) => string) | false;
|
|
1718
|
-
/**
|
|
2509
|
+
/**
|
|
2510
|
+
Enables pan and zoom: the mouse wheel or a pinch (see `zoomScroll`), a
|
|
2511
|
+
drag (see `zoomDrag`), a double-click (see `zoomDoubleClick`), the
|
|
2512
|
+
zoom-control buttons (see `zoomControls`), and the `zoomIn`, `zoomOut`,
|
|
2513
|
+
`zoomReset`, and `zoomBrush` methods. On by default for every chart;
|
|
2514
|
+
`false` turns all of them off.
|
|
2515
|
+
*/
|
|
1719
2516
|
zoom?: boolean;
|
|
1720
2517
|
/** The pixel stroke-width of the zoom brush area. */
|
|
1721
2518
|
zoomBrushHandleSize?: number;
|
|
@@ -1732,7 +2529,21 @@ export interface D3plusConfig {
|
|
|
1732
2529
|
*/
|
|
1733
2530
|
zoomControlClassName?: string;
|
|
1734
2531
|
/**
|
|
1735
|
-
|
|
2532
|
+
Whether the zoom-control buttons (zoom in, zoom out, reset, and brush)
|
|
2533
|
+
show in the chart's top-right corner. `false` hides them and gives the
|
|
2534
|
+
room they take back to the chart's title, legend, and other top
|
|
2535
|
+
content, while zooming stays on: the wheel, pinch, drag, and
|
|
2536
|
+
double-click gestures still work, and the chart's `zoomIn`, `zoomOut`,
|
|
2537
|
+
`zoomReset`, and `zoomBrush` methods let buttons of your own drive it.
|
|
2538
|
+
Defaults to `true`.
|
|
2539
|
+
*/
|
|
2540
|
+
zoomControls?: boolean;
|
|
2541
|
+
/**
|
|
2542
|
+
Overrides the zoom-control icons (`zoomIn`, `zoomOut`, `zoomReset`,
|
|
2543
|
+
`zoomBrush`). Each value is an HTML string, or a mount function
|
|
2544
|
+
`(el) => void | (() => void)` called with the button's 12×12px icon slot
|
|
2545
|
+
(for a React tree, an `<img>`, …); a returned cleanup runs when the
|
|
2546
|
+
buttons redraw.
|
|
1736
2547
|
*/
|
|
1737
2548
|
zoomControlIcons?: Partial<Record<"zoomIn" | "zoomOut" | "zoomReset" | "zoomBrush", string | ((el: HTMLElement) => void | (() => void))>>;
|
|
1738
2549
|
/**
|
|
@@ -1747,11 +2558,27 @@ export interface D3plusConfig {
|
|
|
1747
2558
|
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.
|
|
1748
2559
|
*/
|
|
1749
2560
|
zoomControlStyleHover?: Record<string, unknown> | false;
|
|
2561
|
+
/**
|
|
2562
|
+
What a double-click on the chart does: `"in"` (the default) doubles
|
|
2563
|
+
the zoom around the pointer (Shift + double-click halves it),
|
|
2564
|
+
`"reset"` returns to the chart's initial view, like the reset button,
|
|
2565
|
+
and `false` does nothing.
|
|
2566
|
+
*/
|
|
2567
|
+
zoomDoubleClick?: "in" | "reset" | false;
|
|
2568
|
+
/**
|
|
2569
|
+
What a mouse drag on the chart does. `"pan"` (the default) pans it
|
|
2570
|
+
(see `zoomPan`). `"brush"` draws a box and zooms into it on release,
|
|
2571
|
+
as the brush button does, without turning brush mode on: a click that
|
|
2572
|
+
doesn't drag still reaches the shape under it, and hovering still
|
|
2573
|
+
shows tooltips. Shift + drag pans in `"brush"` mode, and touch keeps
|
|
2574
|
+
panning and pinching as in `"pan"`.
|
|
2575
|
+
*/
|
|
2576
|
+
zoomDrag?: "pan" | "brush";
|
|
1750
2577
|
/** Multiplier applied to programmatic zoom steps. */
|
|
1751
2578
|
zoomFactor?: number;
|
|
1752
2579
|
/** Maximum zoom scale factor. Defaults to the scale at which the smallest shape fills the chart area. */
|
|
1753
2580
|
zoomMax?: number;
|
|
1754
|
-
/** A pixel value to be used to pad all sides of a zoomed area. */
|
|
2581
|
+
/** A pixel value to be used to pad all sides of a zoomed area. A Plot's brushed box fills its plot without it, so its axes show the brushed range. */
|
|
1755
2582
|
zoomPadding?: number;
|
|
1756
2583
|
/** Whether panning (drag) is enabled while zoomed. */
|
|
1757
2584
|
zoomPan?: boolean;
|