@d3plus/core 4.7.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -26117
- package/es/index.js +1 -3
- package/es/internal.js +148 -7
- package/es/src/charts/AreaPlot/index.js +7 -10
- package/es/src/charts/BarChart/index.js +50 -17
- package/es/src/charts/Beeswarm/index.js +39 -0
- package/es/src/charts/BoxWhisker/index.js +6 -16
- package/es/src/charts/Bullet/applyLayout.js +157 -0
- package/es/src/charts/Bullet/bulletGeometry.js +215 -0
- package/es/src/charts/Bullet/bulletLayout.js +111 -0
- package/es/src/charts/Bullet/bulletStyle.js +44 -0
- package/es/src/charts/Bullet/emit.js +258 -0
- package/es/src/charts/Bullet/index.js +268 -0
- package/es/src/charts/BumpChart/index.js +21 -49
- package/es/src/charts/Calendar/applyLayout.js +120 -0
- package/es/src/charts/Calendar/calendarDates.js +151 -0
- package/es/src/charts/Calendar/calendarFormat.js +40 -0
- package/es/src/charts/Calendar/calendarGrid.js +138 -0
- package/es/src/charts/Calendar/calendarInset.js +22 -0
- package/es/src/charts/Calendar/calendarLayout.js +242 -0
- package/es/src/charts/Calendar/emit.js +179 -0
- package/es/src/charts/Calendar/index.js +206 -0
- package/es/src/charts/Candlestick/aggregate.js +154 -0
- package/es/src/charts/Candlestick/buffer.js +83 -0
- package/es/src/charts/Candlestick/emit.js +198 -0
- package/es/src/charts/Candlestick/index.js +257 -0
- package/es/src/charts/Candlestick/ohlc.js +114 -0
- package/es/src/charts/Candlestick/periods.js +191 -0
- package/es/src/charts/Candlestick/tooltip.js +116 -0
- package/es/src/charts/Candlestick/volume.js +278 -0
- package/es/src/charts/Chord/applyLayout.js +75 -111
- package/es/src/charts/Chord/emit.js +82 -173
- package/es/src/charts/Chord/index.js +92 -106
- package/es/src/charts/Donut/index.js +6 -12
- package/es/src/charts/Dumbbell/emit.js +106 -0
- package/es/src/charts/Dumbbell/gapSort.js +79 -0
- package/es/src/charts/Dumbbell/index.js +84 -0
- package/es/src/charts/FanChart/index.js +28 -0
- package/es/src/charts/Funnel/applyLayout.js +103 -0
- package/es/src/charts/Funnel/emit.js +99 -0
- package/es/src/charts/Funnel/funnelFacet.js +53 -0
- package/es/src/charts/Funnel/funnelGeometry.js +171 -0
- package/es/src/charts/Funnel/funnelLabels.js +118 -0
- package/es/src/charts/Funnel/index.js +180 -0
- package/es/src/charts/Funnel/labelNodes.js +202 -0
- package/es/src/charts/Gauge/applyLayout.js +70 -0
- package/es/src/charts/Gauge/dialLayout.js +106 -0
- package/es/src/charts/Gauge/emit.js +214 -0
- package/es/src/charts/Gauge/emitDial.js +167 -0
- package/es/src/charts/Gauge/gaugeGeometry.js +157 -0
- package/es/src/charts/Gauge/index.js +148 -0
- package/es/src/charts/Geomap/applyLayout.js +42 -73
- package/es/src/charts/Geomap/basemapTheme.js +16 -31
- package/es/src/charts/Geomap/emit.js +94 -162
- package/es/src/charts/Geomap/index.js +186 -193
- package/es/src/charts/Geomap/projections.js +37 -0
- package/es/src/charts/Histogram/binData.js +60 -209
- package/es/src/charts/Histogram/index.js +104 -137
- package/es/src/charts/Icicle/applyLayout.js +124 -0
- package/es/src/charts/Icicle/emit.js +162 -0
- package/es/src/charts/Icicle/enterStagger.js +55 -0
- package/es/src/charts/Icicle/geometry.js +101 -0
- package/es/src/charts/Icicle/index.js +130 -0
- package/es/src/charts/Icicle/interaction.js +20 -0
- package/es/src/charts/Icicle/labelFit.js +55 -0
- package/es/src/charts/Icicle/layout.js +20 -0
- package/es/src/charts/LinePlot/index.js +1 -9
- package/es/src/charts/Lollipop/emit.js +85 -0
- package/es/src/charts/Lollipop/index.js +97 -0
- package/es/src/charts/Lollipop/stemLayout.js +97 -0
- package/es/src/charts/Marimekko/axis.js +46 -0
- package/es/src/charts/Marimekko/index.js +77 -0
- package/es/src/charts/Matrix/applyLayout.js +22 -27
- package/es/src/charts/Matrix/emit.js +33 -34
- package/es/src/charts/Matrix/index.js +56 -80
- package/es/src/charts/Network/applyLayout.js +95 -172
- package/es/src/charts/Network/emit.js +132 -266
- package/es/src/charts/Network/index.js +148 -132
- package/es/src/charts/Pack/applyLayout.js +12 -17
- package/es/src/charts/Pack/emit.js +44 -106
- package/es/src/charts/Pack/index.js +63 -107
- package/es/src/charts/Pack/recursionCircles.js +2 -5
- package/es/src/charts/ParallelCoordinates/applyLayout.js +99 -0
- package/es/src/charts/ParallelCoordinates/axes.js +213 -0
- package/es/src/charts/ParallelCoordinates/brushDom.js +187 -0
- package/es/src/charts/ParallelCoordinates/brushFilter.js +79 -0
- package/es/src/charts/ParallelCoordinates/dimensions.js +102 -0
- package/es/src/charts/ParallelCoordinates/emit.js +72 -0
- package/es/src/charts/ParallelCoordinates/format.js +23 -0
- package/es/src/charts/ParallelCoordinates/index.js +190 -0
- package/es/src/charts/ParallelCoordinates/lineStates.js +62 -0
- package/es/src/charts/ParallelCoordinates/paths.js +31 -0
- package/es/src/charts/ParallelCoordinates/titles.js +56 -0
- package/es/src/charts/Pie/applyLayout.js +20 -28
- package/es/src/charts/Pie/emit.js +109 -219
- package/es/src/charts/Pie/index.js +49 -78
- package/es/src/charts/Plot/axisInk.js +31 -0
- package/es/src/charts/Plot/barConfidence.js +273 -0
- package/es/src/charts/Plot/barWidth.js +255 -0
- package/es/src/charts/Plot/baselineBreak.js +139 -0
- package/es/src/charts/Plot/baselineDomain.js +120 -0
- package/es/src/charts/Plot/columnHighlight.js +39 -0
- package/es/src/charts/Plot/confidenceBands.js +143 -0
- package/es/src/charts/Plot/confidenceConfig.js +50 -0
- package/es/src/charts/Plot/confidenceTooltip.js +102 -0
- package/es/src/charts/Plot/curveLength.js +97 -0
- package/es/src/charts/Plot/discreteDomain.js +19 -0
- package/es/src/charts/Plot/discreteSpan.js +6 -24
- package/es/src/charts/Plot/domainClip.js +190 -0
- package/es/src/charts/Plot/draw.js +164 -295
- package/es/src/charts/Plot/facetScales.js +27 -0
- package/es/src/charts/Plot/fillBetween.js +233 -0
- package/es/src/charts/Plot/forecast.js +211 -0
- package/es/src/charts/Plot/forecastScene.js +316 -0
- package/es/src/charts/Plot/index.js +355 -930
- package/es/src/charts/Plot/insetRegion.js +5 -10
- package/es/src/charts/Plot/labelPlacement.js +12 -14
- package/es/src/charts/Plot/lineBands.js +48 -0
- package/es/src/charts/Plot/lineCurve.js +25 -0
- package/es/src/charts/Plot/openDomainEnds.js +92 -0
- package/es/src/charts/Plot/pipeline.js +143 -480
- package/es/src/charts/Plot/pipelineAxisLayout.js +132 -0
- package/es/src/charts/Plot/pipelineDomains.js +121 -239
- package/es/src/charts/Plot/pipelineLineLabels.js +81 -147
- package/es/src/charts/Plot/pipelineScales.js +177 -0
- package/es/src/charts/Plot/plotBreaks.js +223 -0
- package/es/src/charts/Plot/plotFacet.js +172 -0
- package/es/src/charts/Plot/plotInit.js +252 -0
- package/es/src/charts/Plot/plotZoom.js +105 -206
- package/es/src/charts/Plot/shapeDefaults.js +66 -81
- package/es/src/charts/Plot/sharedHover.js +185 -308
- package/es/src/charts/Plot/sharedHoverScene.js +115 -157
- package/es/src/charts/Plot/sharedTooltip.js +96 -104
- package/es/src/charts/Plot/stackEnter.js +87 -0
- package/es/src/charts/Plot/stackHelpers.js +36 -69
- package/es/src/charts/Plot/stackShareLabels.js +34 -88
- package/es/src/charts/Plot/stackShareTooltip.js +10 -15
- package/es/src/charts/Plot/swarm.js +96 -0
- package/es/src/charts/Plot/swarmLayout.js +102 -0
- package/es/src/charts/Plot/trendLines.js +105 -321
- package/es/src/charts/Plot/trendProjection.js +27 -69
- package/es/src/charts/Plot/trendScene.js +27 -171
- package/es/src/charts/Plot/trendTooltip.js +50 -132
- package/es/src/charts/PolarArea/applyLayout.js +26 -0
- package/es/src/charts/PolarArea/emit.js +12 -0
- package/es/src/charts/PolarArea/index.js +183 -0
- package/es/src/charts/Priestley/applyLayout.js +33 -53
- package/es/src/charts/Priestley/emit.js +50 -111
- package/es/src/charts/Priestley/index.js +35 -35
- package/es/src/charts/Pyramid/gutter.js +208 -0
- package/es/src/charts/Pyramid/index.js +373 -0
- package/es/src/charts/Pyramid/pyramidData.js +65 -0
- package/es/src/charts/Pyramid/scene.js +224 -0
- package/es/src/charts/Pyramid/stackOrder.js +39 -0
- package/es/src/charts/Radar/applyLayout.js +52 -291
- package/es/src/charts/Radar/axisDecorations.js +200 -0
- package/es/src/charts/Radar/axisLabels.js +109 -0
- package/es/src/charts/Radar/emit.js +23 -19
- package/es/src/charts/Radar/index.js +64 -45
- package/es/src/charts/Radar/levels.js +136 -0
- package/es/src/charts/Radar/rings.js +72 -0
- package/es/src/charts/RadialBar/applyLayout.js +47 -0
- package/es/src/charts/RadialBar/emit.js +38 -0
- package/es/src/charts/RadialBar/index.js +221 -0
- package/es/src/charts/RadialBar/trackLayout.js +330 -0
- package/es/src/charts/RadialBar/tracks.js +53 -0
- package/es/src/charts/RadialMatrix/applyLayout.js +42 -80
- package/es/src/charts/RadialMatrix/emit.js +23 -23
- package/es/src/charts/RadialMatrix/index.js +65 -67
- package/es/src/charts/Ridgeline/emit.js +75 -0
- package/es/src/charts/Ridgeline/index.js +55 -0
- package/es/src/charts/Rings/applyLayout.js +124 -266
- package/es/src/charts/Rings/emit.js +127 -236
- package/es/src/charts/Rings/index.js +118 -98
- package/es/src/charts/Rings/ringsGraph.js +88 -0
- package/es/src/charts/Rings/ringsSizing.js +41 -89
- package/es/src/charts/Sankey/applyLayout.js +32 -60
- package/es/src/charts/Sankey/emit.js +94 -150
- package/es/src/charts/Sankey/index.js +130 -104
- package/es/src/charts/Sankey/sankeyLayout.js +283 -0
- package/es/src/charts/StackedArea/index.js +3 -10
- package/es/src/charts/Sunburst/applyLayout.js +116 -0
- package/es/src/charts/Sunburst/emit.js +181 -0
- package/es/src/charts/Sunburst/geometry.js +98 -0
- package/es/src/charts/Sunburst/index.js +168 -0
- package/es/src/charts/Sunburst/interaction.js +23 -0
- package/es/src/charts/Sunburst/labelFit.js +159 -0
- package/es/src/charts/Sunburst/partition.js +32 -0
- package/es/src/charts/Tree/applyLayout.js +78 -130
- package/es/src/charts/Tree/emit.js +76 -184
- package/es/src/charts/Tree/index.js +26 -37
- package/es/src/charts/Treemap/applyLayout.js +34 -57
- package/es/src/charts/Treemap/emit.js +57 -136
- package/es/src/charts/Treemap/index.js +57 -95
- package/es/src/charts/Treemap/thresholdFunction.js +14 -75
- package/es/src/charts/Violin/emit.js +80 -0
- package/es/src/charts/Violin/index.js +88 -0
- package/es/src/charts/Violin/inner.js +196 -0
- package/es/src/charts/Violin/violinLayout.js +80 -0
- package/es/src/charts/Waffle/applyLayout.js +90 -0
- package/es/src/charts/Waffle/emit.js +89 -0
- package/es/src/charts/Waffle/index.js +170 -0
- package/es/src/charts/Waffle/tooltip.js +37 -0
- package/es/src/charts/Waffle/waffleLayout.js +104 -0
- package/es/src/charts/Waterfall/buffer.js +65 -0
- package/es/src/charts/Waterfall/connectors.js +103 -0
- package/es/src/charts/Waterfall/index.js +211 -0
- package/es/src/charts/Waterfall/labels.js +82 -0
- package/es/src/charts/Waterfall/state.js +147 -0
- package/es/src/charts/Waterfall/steps.js +138 -0
- package/es/src/charts/definition/ChartDefinition.js +2 -4
- package/es/src/charts/definition/applyDefinition.js +4 -88
- package/es/src/charts/definition/makeChart.js +35 -141
- package/es/src/charts/drawSteps/backControl.js +15 -14
- package/es/src/charts/drawSteps/bottomRightControls.js +39 -115
- package/es/src/charts/drawSteps/bottomRightControlsMarkup.js +60 -174
- package/es/src/charts/drawSteps/controlButtonStyle.js +39 -63
- package/es/src/charts/drawSteps/minimap.js +82 -139
- package/es/src/charts/drawSteps/minimapMarkup.js +13 -93
- package/es/src/charts/drawSteps/searchControls.js +48 -105
- package/es/src/charts/drawSteps/searchControlsMarkup.js +62 -176
- package/es/src/charts/drawSteps/tableView.js +23 -40
- package/es/src/charts/drawSteps/tableViewControl.js +2 -8
- package/es/src/charts/drawSteps/tableViewMarkup.js +152 -233
- package/es/src/charts/drawSteps/topLeftControls.js +8 -28
- package/es/src/charts/drawSteps/topLeftControlsMarkup.js +49 -119
- package/es/src/charts/drawSteps/zoomControls.js +72 -145
- package/es/src/charts/drawSteps/zoomControlsMarkup.js +59 -124
- package/es/src/charts/drawSteps/zoomGesture.js +17 -0
- package/es/src/charts/drawSteps/zoomShown.js +40 -0
- package/es/src/charts/events/click.legend.js +12 -23
- package/es/src/charts/events/click.shape.js +6 -11
- package/es/src/charts/events/mouseenter.js +14 -24
- package/es/src/charts/events/mouseleave.js +29 -14
- package/es/src/charts/events/mousemove.legend.js +20 -30
- package/es/src/charts/events/mousemove.shape.js +12 -21
- package/es/src/charts/events/touchstart.body.js +0 -2
- package/es/src/charts/facet/drawFacets.js +332 -0
- package/es/src/charts/facet/facetConfig.js +72 -0
- package/es/src/charts/facet/facetData.js +97 -0
- package/es/src/charts/facet/facetGrid.js +107 -0
- package/es/src/charts/facet/facetGutter.js +131 -0
- package/es/src/charts/facet/facetPanel.js +56 -0
- package/es/src/charts/facet/facetScene.js +111 -0
- package/es/src/charts/features/attributionFeature.js +38 -38
- package/es/src/charts/features/axes.js +105 -304
- package/es/src/charts/features/axesFinal.js +134 -0
- package/es/src/charts/features/axesMeasure.js +138 -0
- package/es/src/charts/features/backgroundImageEmit.js +61 -0
- package/es/src/charts/features/chartGeometry.js +3 -5
- package/es/src/charts/features/colorScaleBucket.js +17 -21
- package/es/src/charts/features/edgeArrows.js +36 -70
- package/es/src/charts/features/emitHelpers.js +42 -137
- package/es/src/charts/features/ensureZoomDom.js +27 -40
- package/es/src/charts/features/features.js +216 -256
- package/es/src/charts/features/featuresColorScale.js +40 -39
- package/es/src/charts/features/featuresLegend.js +152 -188
- package/es/src/charts/features/frozenAxis.js +14 -0
- package/es/src/charts/features/insetState.js +25 -90
- package/es/src/charts/features/legendCategory.js +61 -0
- package/es/src/charts/features/legendLabel.js +5 -9
- package/es/src/charts/features/lineLabels.js +20 -87
- package/es/src/charts/features/plotAnnotations.js +105 -0
- package/es/src/charts/features/plotEndLabels.js +209 -0
- package/es/src/charts/features/plotPaint.js +192 -404
- package/es/src/charts/features/sceneBounds.js +57 -164
- package/es/src/charts/features/shapeEmit.js +183 -184
- package/es/src/charts/features/shareKey.js +32 -0
- package/es/src/charts/features/sharedFields.js +38 -0
- package/es/src/charts/features/tooltipSwatch.js +99 -42
- package/es/src/charts/features/xAxisConfig.js +19 -0
- package/es/src/charts/features/zoomExtent.js +23 -108
- package/es/src/charts/helpers/densityChart.js +267 -0
- package/es/src/charts/helpers/densityData.js +116 -0
- package/es/src/charts/helpers/densityEnter.js +64 -0
- package/es/src/charts/helpers/matrixData.js +11 -82
- package/es/src/charts/helpers/tileAttributions.js +1 -3
- package/es/src/charts/helpers/valueTitle.js +29 -0
- package/es/src/charts/index.js +20 -2
- package/es/src/charts/partition/chartFields.js +43 -0
- package/es/src/charts/partition/hierarchy.js +174 -0
- package/es/src/charts/partition/interaction.js +158 -0
- package/es/src/charts/partition/labelWords.js +95 -0
- package/es/src/charts/partition/shade.js +56 -0
- package/es/src/charts/partition/zoom.js +80 -0
- package/es/src/charts/pipeline/drillMorph.js +16 -37
- package/es/src/charts/pipeline/insetPlacement.js +95 -188
- package/es/src/charts/pipeline/preDrawData.js +74 -0
- package/es/src/charts/pipeline/resolveSpec.js +1 -3
- package/es/src/charts/pipeline/runChartDraw.js +14 -69
- package/es/src/charts/pipeline/runVizPipeline.js +13 -35
- package/es/src/charts/pipeline/stages.js +24 -61
- package/es/src/charts/pipeline/vizDraw.js +165 -30
- package/es/src/charts/pipeline/vizPreDraw.js +145 -106
- package/es/src/charts/plotBuffers/Bar.js +7 -108
- package/es/src/charts/plotBuffers/Box.js +6 -102
- package/es/src/charts/plotBuffers/Circle.js +11 -14
- package/es/src/charts/plotBuffers/Line.js +7 -13
- package/es/src/charts/plotBuffers/Rect.js +11 -15
- package/es/src/charts/plotBuffers/defaultBuffers.js +12 -0
- package/es/src/charts/plotBuffers/discreteBuffer.js +5 -9
- package/es/src/charts/plotBuffers/numericBuffer.js +24 -33
- package/es/src/charts/plotBuffers/rectLikeBuffer.js +39 -0
- package/es/src/charts/polar/chrome.js +170 -0
- package/es/src/charts/polar/config.js +82 -0
- package/es/src/charts/polar/geometry.js +92 -0
- package/es/src/charts/polar/labels.js +124 -0
- package/es/src/charts/polar/polarFacet.js +43 -0
- package/es/src/charts/polar/wedgeLayout.js +140 -0
- package/es/src/charts/viz/Viz.js +503 -991
- package/es/src/charts/viz/VizBase.js +260 -613
- package/es/src/charts/viz/backgroundInk.js +17 -0
- package/es/src/charts/viz/interactionOpacity.js +92 -135
- package/es/src/charts/viz/labelDefaults.js +61 -0
- package/es/src/charts/viz/linkGroup.js +63 -237
- package/es/src/charts/viz/ordinalColor.js +12 -44
- package/es/src/charts/viz/reserveContainerSize.js +49 -0
- package/es/src/charts/viz/resetChromeBoxes.js +41 -0
- package/es/src/charts/viz/sceneRows.js +7 -9
- package/es/src/charts/viz/shapeClassTargets.js +33 -0
- package/es/src/charts/viz/shapeHover.js +9 -0
- package/es/src/charts/viz/simpleHover.js +14 -0
- package/es/src/charts/viz/trailCatchup.js +28 -87
- package/es/src/charts/viz/vizDefaults.js +113 -385
- package/es/src/charts/viz/vizFields.js +197 -0
- package/es/src/charts/viz/vizRender.js +84 -78
- package/es/src/charts/viz/vizTypes.js +1 -3
- package/es/src/charts/viz/vizVisibility.js +32 -51
- package/es/src/components/Axis/Axis.js +304 -469
- package/es/src/components/Axis/AxisBottom.js +9 -74
- package/es/src/components/Axis/AxisLeft.js +9 -74
- package/es/src/components/Axis/AxisRight.js +9 -74
- package/es/src/components/Axis/AxisTop.js +9 -74
- package/es/src/components/Axis/axisBreak.js +243 -0
- package/es/src/components/Axis/axisDefaults.js +65 -0
- package/es/src/components/Axis/axisEndLabels.js +60 -0
- package/es/src/components/Axis/axisLabelThinning.js +123 -0
- package/es/src/components/Axis/axisLayout.js +211 -160
- package/es/src/components/Axis/axisLayoutLabels.js +187 -108
- package/es/src/components/Axis/axisLayoutScale.js +130 -247
- package/es/src/components/Axis/axisRender.js +82 -411
- package/es/src/components/Axis/axisRounding.js +68 -0
- package/es/src/components/Axis/axisScene.js +184 -0
- package/es/src/components/Axis/brokenScale.js +183 -0
- package/es/src/components/Axis/gridStroke.js +10 -0
- package/es/src/components/Axis/timeValues.js +155 -0
- package/es/src/components/Axis/yearValues.js +32 -0
- package/es/src/components/ColorScale/ColorScale.js +187 -345
- package/es/src/components/ColorScale/colorScaleRender.js +72 -108
- package/es/src/components/ColorScale/colorScaleScale.js +101 -164
- package/es/src/components/Legend/Legend.js +164 -352
- package/es/src/components/Legend/legendConfig.js +43 -55
- package/es/src/components/Legend/legendRender.js +61 -109
- package/es/src/components/Message.js +50 -98
- package/es/src/components/SizeLegend/SizeLegend.js +188 -330
- package/es/src/components/SizeLegend/sizeLegendLayout.js +65 -161
- package/es/src/components/TextBox.js +156 -615
- package/es/src/components/Timeline/Timeline.js +345 -554
- package/es/src/components/Timeline/timelineConfig.js +23 -56
- package/es/src/components/Timeline/timelineRender.js +58 -112
- package/es/src/components/Tooltip.js +128 -607
- package/es/src/components/index.js +0 -2
- package/es/src/components/textBoxLayout.js +230 -0
- package/es/src/components/tooltipDom.js +218 -0
- package/es/src/fluent.js +177 -203
- package/es/src/shapes/Area.js +128 -329
- package/es/src/shapes/Bar.js +92 -245
- package/es/src/shapes/Box.js +231 -405
- package/es/src/shapes/Circle.js +46 -199
- package/es/src/shapes/Image.js +98 -210
- package/es/src/shapes/Line.js +73 -251
- package/es/src/shapes/Path.js +34 -149
- package/es/src/shapes/Rect.js +57 -210
- package/es/src/shapes/Shape.js +328 -655
- package/es/src/shapes/Whisker.js +166 -371
- package/es/src/shapes/buildLabelData.js +31 -80
- package/es/src/shapes/emitLabels.js +17 -49
- package/es/src/shapes/hitAreaNode.js +8 -10
- package/es/src/shapes/index.js +0 -2
- package/es/src/shapes/interactionPoints.js +5 -7
- package/es/src/shapes/sceneSort.js +61 -161
- package/es/src/shapes/shapeConfig.js +0 -2
- package/es/src/shapes/shapeOwners.js +37 -0
- package/es/src/shapes/shapeStandalone.js +71 -0
- package/es/src/shapes/textureKey.js +11 -61
- package/es/src/shapes/uniqueIds.js +19 -0
- package/es/src/shapes/validateShapeConfig.js +23 -119
- package/es/src/utils/AccessorFn.js +0 -2
- package/es/src/utils/BaseClass.js +114 -262
- package/es/src/utils/D3Scale.js +0 -2
- package/es/src/utils/D3plusConfig.js +0 -2
- package/es/src/utils/RESET.js +1 -3
- package/es/src/utils/accessor.js +2 -8
- package/es/src/utils/configDefault.js +1 -3
- package/es/src/utils/configPrep.js +15 -35
- package/es/src/utils/configWarnings.js +11 -13
- package/es/src/utils/constant.js +0 -2
- package/es/src/utils/getProp.js +0 -2
- package/es/src/utils/index.js +0 -2
- package/es/src/utils/paintComponentScene.js +12 -23
- package/es/src/utils/wholeWords.js +44 -0
- package/package.json +16 -25
- package/types/index.d.ts +12 -4
- package/types/internal.d.ts +210 -12
- package/types/src/charts/AreaPlot/index.d.ts +2 -1
- package/types/src/charts/BarChart/index.d.ts +4 -2
- package/types/src/charts/Beeswarm/index.d.ts +15 -0
- package/types/src/charts/Bullet/applyLayout.d.ts +65 -0
- package/types/src/charts/Bullet/bulletGeometry.d.ts +91 -0
- package/types/src/charts/Bullet/bulletLayout.d.ts +54 -0
- package/types/src/charts/Bullet/bulletStyle.d.ts +33 -0
- package/types/src/charts/Bullet/emit.d.ts +25 -0
- package/types/src/charts/Bullet/index.d.ts +40 -0
- package/types/src/charts/Calendar/applyLayout.d.ts +37 -0
- package/types/src/charts/Calendar/calendarDates.d.ts +68 -0
- package/types/src/charts/Calendar/calendarFormat.d.ts +24 -0
- package/types/src/charts/Calendar/calendarGrid.d.ts +84 -0
- package/types/src/charts/Calendar/calendarInset.d.ts +13 -0
- package/types/src/charts/Calendar/calendarLayout.d.ts +84 -0
- package/types/src/charts/Calendar/emit.d.ts +31 -0
- package/types/src/charts/Calendar/index.d.ts +26 -0
- package/types/src/charts/Candlestick/aggregate.d.ts +91 -0
- package/types/src/charts/Candlestick/buffer.d.ts +37 -0
- package/types/src/charts/Candlestick/emit.d.ts +54 -0
- package/types/src/charts/Candlestick/index.d.ts +16 -0
- package/types/src/charts/Candlestick/ohlc.d.ts +94 -0
- package/types/src/charts/Candlestick/periods.d.ts +84 -0
- package/types/src/charts/Candlestick/tooltip.d.ts +50 -0
- package/types/src/charts/Candlestick/volume.d.ts +129 -0
- package/types/src/charts/Chord/emit.d.ts +2 -2
- package/types/src/charts/Dumbbell/emit.d.ts +34 -0
- package/types/src/charts/Dumbbell/gapSort.d.ts +47 -0
- package/types/src/charts/Dumbbell/index.d.ts +21 -0
- package/types/src/charts/FanChart/index.d.ts +17 -0
- package/types/src/charts/Funnel/applyLayout.d.ts +89 -0
- package/types/src/charts/Funnel/emit.d.ts +29 -0
- package/types/src/charts/Funnel/funnelFacet.d.ts +33 -0
- package/types/src/charts/Funnel/funnelGeometry.d.ts +78 -0
- package/types/src/charts/Funnel/funnelLabels.d.ts +101 -0
- package/types/src/charts/Funnel/index.d.ts +30 -0
- package/types/src/charts/Funnel/labelNodes.d.ts +57 -0
- package/types/src/charts/Gauge/applyLayout.d.ts +41 -0
- package/types/src/charts/Gauge/dialLayout.d.ts +78 -0
- package/types/src/charts/Gauge/emit.d.ts +22 -0
- package/types/src/charts/Gauge/emitDial.d.ts +41 -0
- package/types/src/charts/Gauge/gaugeGeometry.d.ts +89 -0
- package/types/src/charts/Gauge/index.d.ts +21 -0
- package/types/src/charts/Geomap/projections.d.ts +8 -0
- package/types/src/charts/Histogram/binData.d.ts +9 -1
- package/types/src/charts/Icicle/applyLayout.d.ts +54 -0
- package/types/src/charts/Icicle/emit.d.ts +20 -0
- package/types/src/charts/Icicle/enterStagger.d.ts +30 -0
- package/types/src/charts/Icicle/geometry.d.ts +72 -0
- package/types/src/charts/Icicle/index.d.ts +25 -0
- package/types/src/charts/Icicle/interaction.d.ts +16 -0
- package/types/src/charts/Icicle/labelFit.d.ts +37 -0
- package/types/src/charts/Icicle/layout.d.ts +21 -0
- package/types/src/charts/Lollipop/emit.d.ts +19 -0
- package/types/src/charts/Lollipop/index.d.ts +17 -0
- package/types/src/charts/Lollipop/stemLayout.d.ts +82 -0
- package/types/src/charts/Marimekko/axis.d.ts +27 -0
- package/types/src/charts/Marimekko/index.d.ts +19 -0
- package/types/src/charts/ParallelCoordinates/applyLayout.d.ts +27 -0
- package/types/src/charts/ParallelCoordinates/axes.d.ts +40 -0
- package/types/src/charts/ParallelCoordinates/brushDom.d.ts +47 -0
- package/types/src/charts/ParallelCoordinates/brushFilter.d.ts +39 -0
- package/types/src/charts/ParallelCoordinates/dimensions.d.ts +63 -0
- package/types/src/charts/ParallelCoordinates/emit.d.ts +27 -0
- package/types/src/charts/ParallelCoordinates/format.d.ts +13 -0
- package/types/src/charts/ParallelCoordinates/index.d.ts +27 -0
- package/types/src/charts/ParallelCoordinates/lineStates.d.ts +21 -0
- package/types/src/charts/ParallelCoordinates/paths.d.ts +27 -0
- package/types/src/charts/ParallelCoordinates/titles.d.ts +21 -0
- package/types/src/charts/Plot/axisInk.d.ts +8 -0
- package/types/src/charts/Plot/barConfidence.d.ts +120 -0
- package/types/src/charts/Plot/barWidth.d.ts +119 -0
- package/types/src/charts/Plot/baselineBreak.d.ts +52 -0
- package/types/src/charts/Plot/baselineDomain.d.ts +67 -0
- package/types/src/charts/Plot/columnHighlight.d.ts +23 -0
- package/types/src/charts/Plot/confidenceBands.d.ts +72 -0
- package/types/src/charts/Plot/confidenceConfig.d.ts +16 -0
- package/types/src/charts/Plot/confidenceTooltip.d.ts +70 -0
- package/types/src/charts/Plot/curveLength.d.ts +27 -0
- package/types/src/charts/Plot/discreteDomain.d.ts +14 -0
- package/types/src/charts/Plot/domainClip.d.ts +21 -0
- package/types/src/charts/Plot/facetScales.d.ts +27 -0
- package/types/src/charts/Plot/fillBetween.d.ts +69 -0
- package/types/src/charts/Plot/forecast.d.ts +102 -0
- package/types/src/charts/Plot/forecastScene.d.ts +88 -0
- package/types/src/charts/Plot/index.d.ts +24 -5
- package/types/src/charts/Plot/lineBands.d.ts +7 -0
- package/types/src/charts/Plot/lineCurve.d.ts +15 -0
- package/types/src/charts/Plot/openDomainEnds.d.ts +25 -0
- package/types/src/charts/Plot/pipeline.d.ts +5 -30
- package/types/src/charts/Plot/pipelineAxisLayout.d.ts +2 -0
- package/types/src/charts/Plot/pipelineScales.d.ts +20 -0
- package/types/src/charts/Plot/plotBreaks.d.ts +61 -0
- package/types/src/charts/Plot/plotFacet.d.ts +36 -0
- package/types/src/charts/Plot/plotInit.d.ts +44 -0
- package/types/src/charts/Plot/plotZoom.d.ts +14 -8
- package/types/src/charts/Plot/sharedHover.d.ts +5 -0
- package/types/src/charts/Plot/sharedHoverScene.d.ts +3 -6
- package/types/src/charts/Plot/sharedTooltip.d.ts +13 -8
- package/types/src/charts/Plot/stackEnter.d.ts +42 -0
- package/types/src/charts/Plot/swarm.d.ts +66 -0
- package/types/src/charts/Plot/swarmLayout.d.ts +59 -0
- package/types/src/charts/PolarArea/applyLayout.d.ts +17 -0
- package/types/src/charts/PolarArea/emit.d.ts +3 -0
- package/types/src/charts/PolarArea/index.d.ts +19 -0
- package/types/src/charts/Pyramid/gutter.d.ts +76 -0
- package/types/src/charts/Pyramid/index.d.ts +19 -0
- package/types/src/charts/Pyramid/pyramidData.d.ts +48 -0
- package/types/src/charts/Pyramid/scene.d.ts +106 -0
- package/types/src/charts/Pyramid/stackOrder.d.ts +9 -0
- package/types/src/charts/Radar/applyLayout.d.ts +7 -5
- package/types/src/charts/Radar/axisDecorations.d.ts +67 -0
- package/types/src/charts/Radar/axisLabels.d.ts +79 -0
- package/types/src/charts/Radar/emit.d.ts +2 -2
- package/types/src/charts/Radar/index.d.ts +5 -1
- package/types/src/charts/Radar/levels.d.ts +68 -0
- package/types/src/charts/Radar/rings.d.ts +30 -0
- package/types/src/charts/RadialBar/applyLayout.d.ts +19 -0
- package/types/src/charts/RadialBar/emit.d.ts +6 -0
- package/types/src/charts/RadialBar/index.d.ts +21 -0
- package/types/src/charts/RadialBar/trackLayout.d.ts +46 -0
- package/types/src/charts/RadialBar/tracks.d.ts +32 -0
- package/types/src/charts/Ridgeline/emit.d.ts +11 -0
- package/types/src/charts/Ridgeline/index.d.ts +16 -0
- package/types/src/charts/Rings/index.d.ts +2 -0
- package/types/src/charts/Rings/ringsGraph.d.ts +72 -0
- package/types/src/charts/Sankey/applyLayout.d.ts +1 -1
- package/types/src/charts/Sankey/sankeyLayout.d.ts +57 -0
- package/types/src/charts/StackedArea/index.d.ts +2 -1
- package/types/src/charts/Sunburst/applyLayout.d.ts +67 -0
- package/types/src/charts/Sunburst/emit.d.ts +29 -0
- package/types/src/charts/Sunburst/geometry.d.ts +65 -0
- package/types/src/charts/Sunburst/index.d.ts +21 -0
- package/types/src/charts/Sunburst/interaction.d.ts +20 -0
- package/types/src/charts/Sunburst/labelFit.d.ts +73 -0
- package/types/src/charts/Sunburst/partition.d.ts +34 -0
- package/types/src/charts/Violin/emit.d.ts +4 -0
- package/types/src/charts/Violin/index.d.ts +16 -0
- package/types/src/charts/Violin/inner.d.ts +31 -0
- package/types/src/charts/Violin/violinLayout.d.ts +64 -0
- package/types/src/charts/Waffle/applyLayout.d.ts +36 -0
- package/types/src/charts/Waffle/emit.d.ts +29 -0
- package/types/src/charts/Waffle/index.d.ts +21 -0
- package/types/src/charts/Waffle/tooltip.d.ts +20 -0
- package/types/src/charts/Waffle/waffleLayout.d.ts +81 -0
- package/types/src/charts/Waterfall/buffer.d.ts +31 -0
- package/types/src/charts/Waterfall/connectors.d.ts +40 -0
- package/types/src/charts/Waterfall/index.d.ts +24 -0
- package/types/src/charts/Waterfall/labels.d.ts +59 -0
- package/types/src/charts/Waterfall/state.d.ts +62 -0
- package/types/src/charts/Waterfall/steps.d.ts +84 -0
- package/types/src/charts/definition/ChartDefinition.d.ts +28 -7
- package/types/src/charts/definition/makeChart.d.ts +3 -1
- package/types/src/charts/drawSteps/bottomRightControls.d.ts +19 -0
- package/types/src/charts/drawSteps/bottomRightControlsMarkup.d.ts +1 -1
- package/types/src/charts/drawSteps/controlButtonStyle.d.ts +21 -0
- package/types/src/charts/drawSteps/searchControlsMarkup.d.ts +2 -6
- package/types/src/charts/drawSteps/topLeftControlsMarkup.d.ts +10 -2
- package/types/src/charts/drawSteps/zoomControlsMarkup.d.ts +9 -0
- package/types/src/charts/drawSteps/zoomGesture.d.ts +17 -0
- package/types/src/charts/drawSteps/zoomShown.d.ts +32 -0
- package/types/src/charts/facet/drawFacets.d.ts +52 -0
- package/types/src/charts/facet/facetConfig.d.ts +178 -0
- package/types/src/charts/facet/facetData.d.ts +47 -0
- package/types/src/charts/facet/facetGrid.d.ts +62 -0
- package/types/src/charts/facet/facetGutter.d.ts +68 -0
- package/types/src/charts/facet/facetPanel.d.ts +24 -0
- package/types/src/charts/facet/facetScene.d.ts +39 -0
- package/types/src/charts/features/axes.d.ts +4 -89
- package/types/src/charts/features/axesFinal.d.ts +66 -0
- package/types/src/charts/features/axesMeasure.d.ts +88 -0
- package/types/src/charts/features/backgroundImageEmit.d.ts +32 -0
- package/types/src/charts/features/features.d.ts +40 -12
- package/types/src/charts/features/featuresLegend.d.ts +10 -2
- package/types/src/charts/features/frozenAxis.d.ts +8 -0
- package/types/src/charts/features/insetState.d.ts +3 -4
- package/types/src/charts/features/legendCategory.d.ts +36 -0
- package/types/src/charts/features/legendLabel.d.ts +3 -6
- package/types/src/charts/features/plotAnnotations.d.ts +38 -0
- package/types/src/charts/features/plotEndLabels.d.ts +108 -0
- package/types/src/charts/features/plotPaint.d.ts +10 -25
- package/types/src/charts/features/sceneBounds.d.ts +8 -2
- package/types/src/charts/features/shapeEmit.d.ts +14 -1
- package/types/src/charts/features/shareKey.d.ts +24 -0
- package/types/src/charts/features/sharedFields.d.ts +22 -0
- package/types/src/charts/features/tooltipSwatch.d.ts +36 -4
- package/types/src/charts/features/xAxisConfig.d.ts +6 -0
- package/types/src/charts/helpers/densityChart.d.ts +62 -0
- package/types/src/charts/helpers/densityData.d.ts +88 -0
- package/types/src/charts/helpers/densityEnter.d.ts +23 -0
- package/types/src/charts/helpers/valueTitle.d.ts +23 -0
- package/types/src/charts/index.d.ts +20 -0
- package/types/src/charts/partition/chartFields.d.ts +29 -0
- package/types/src/charts/partition/hierarchy.d.ts +109 -0
- package/types/src/charts/partition/interaction.d.ts +57 -0
- package/types/src/charts/partition/labelWords.d.ts +50 -0
- package/types/src/charts/partition/shade.d.ts +61 -0
- package/types/src/charts/partition/zoom.d.ts +51 -0
- package/types/src/charts/pipeline/preDrawData.d.ts +34 -0
- package/types/src/charts/pipeline/stages.d.ts +11 -3
- package/types/src/charts/pipeline/vizDraw.d.ts +25 -20
- package/types/src/charts/pipeline/vizPreDraw.d.ts +23 -17
- package/types/src/charts/plotBuffers/Bar.d.ts +9 -12
- package/types/src/charts/plotBuffers/Box.d.ts +8 -11
- package/types/src/charts/plotBuffers/defaultBuffers.d.ts +25 -0
- package/types/src/charts/plotBuffers/numericBuffer.d.ts +1 -1
- package/types/src/charts/plotBuffers/rectLikeBuffer.d.ts +25 -0
- package/types/src/charts/polar/chrome.d.ts +62 -0
- package/types/src/charts/polar/config.d.ts +21 -0
- package/types/src/charts/polar/geometry.d.ts +68 -0
- package/types/src/charts/polar/labels.d.ts +87 -0
- package/types/src/charts/polar/polarFacet.d.ts +33 -0
- package/types/src/charts/polar/wedgeLayout.d.ts +81 -0
- package/types/src/charts/viz/Viz.d.ts +24 -24
- package/types/src/charts/viz/VizBase.d.ts +59 -204
- package/types/src/charts/viz/backgroundInk.d.ts +15 -0
- package/types/src/charts/viz/labelDefaults.d.ts +11 -0
- package/types/src/charts/viz/reserveContainerSize.d.ts +15 -0
- package/types/src/charts/viz/resetChromeBoxes.d.ts +4 -0
- package/types/src/charts/viz/shapeClassTargets.d.ts +25 -0
- package/types/src/charts/viz/shapeHover.d.ts +10 -0
- package/types/src/charts/viz/simpleHover.d.ts +9 -0
- package/types/src/charts/viz/vizDefaults.d.ts +10 -0
- package/types/src/charts/viz/vizFields.d.ts +199 -0
- package/types/src/charts/viz/vizTypes.d.ts +107 -39
- package/types/src/components/Axis/Axis.d.ts +59 -4
- package/types/src/components/Axis/axisBreak.d.ts +86 -0
- package/types/src/components/Axis/axisDefaults.d.ts +11 -0
- package/types/src/components/Axis/axisEndLabels.d.ts +37 -0
- package/types/src/components/Axis/axisLabelThinning.d.ts +48 -0
- package/types/src/components/Axis/axisLayout.d.ts +10 -0
- package/types/src/components/Axis/axisLayoutLabels.d.ts +30 -0
- package/types/src/components/Axis/axisLayoutScale.d.ts +13 -2
- package/types/src/components/Axis/axisRender.d.ts +1 -30
- package/types/src/components/Axis/axisRounding.d.ts +14 -0
- package/types/src/components/Axis/axisScene.d.ts +33 -0
- package/types/src/components/Axis/brokenScale.d.ts +66 -0
- package/types/src/components/Axis/gridStroke.d.ts +8 -0
- package/types/src/components/Axis/timeValues.d.ts +63 -0
- package/types/src/components/Axis/yearValues.d.ts +21 -0
- package/types/src/components/TextBox.d.ts +1 -36
- package/types/src/components/textBoxLayout.d.ts +45 -0
- package/types/src/components/tooltipDom.d.ts +30 -0
- package/types/src/fluent.d.ts +103 -34
- package/types/src/shapes/Box.d.ts +12 -1
- package/types/src/shapes/Shape.d.ts +2 -3
- package/types/src/shapes/Whisker.d.ts +4 -1
- package/types/src/shapes/emitLabels.d.ts +15 -0
- package/types/src/shapes/shapeConfig.d.ts +35 -5
- package/types/src/shapes/shapeOwners.d.ts +10 -0
- package/types/src/shapes/shapeStandalone.d.ts +7 -0
- package/types/src/shapes/uniqueIds.d.ts +6 -0
- package/types/src/shapes/validateShapeConfig.d.ts +20 -3
- package/types/src/utils/BaseClass.d.ts +6 -0
- package/types/src/utils/D3Scale.d.ts +3 -0
- package/types/src/utils/D3plusConfig.d.ts +940 -99
- package/types/src/utils/configPrep.d.ts +3 -2
- package/types/src/utils/configWarnings.d.ts +5 -0
- package/types/src/utils/index.d.ts +1 -1
- package/types/src/utils/wholeWords.d.ts +28 -0
- package/umd/d3plus-core.full.js +74785 -75059
- package/umd/d3plus-core.full.min.js +2 -10702
- package/umd/d3plus-core.js +44707 -23629
- package/umd/d3plus-core.min.js +2 -6671
- package/es/index.js.map +0 -1
- package/es/internal.js.map +0 -1
- package/es/src/charts/AreaPlot/index.js.map +0 -1
- package/es/src/charts/BarChart/index.js.map +0 -1
- package/es/src/charts/BoxWhisker/index.js.map +0 -1
- package/es/src/charts/BumpChart/index.js.map +0 -1
- package/es/src/charts/Chord/applyLayout.js.map +0 -1
- package/es/src/charts/Chord/emit.js.map +0 -1
- package/es/src/charts/Chord/index.js.map +0 -1
- package/es/src/charts/Donut/index.js.map +0 -1
- package/es/src/charts/Geomap/applyLayout.js.map +0 -1
- package/es/src/charts/Geomap/basemapTheme.js.map +0 -1
- package/es/src/charts/Geomap/emit.js.map +0 -1
- package/es/src/charts/Geomap/index.js.map +0 -1
- package/es/src/charts/Histogram/binData.js.map +0 -1
- package/es/src/charts/Histogram/index.js.map +0 -1
- package/es/src/charts/LinePlot/index.js.map +0 -1
- package/es/src/charts/Matrix/applyLayout.js.map +0 -1
- package/es/src/charts/Matrix/emit.js.map +0 -1
- package/es/src/charts/Matrix/index.js.map +0 -1
- package/es/src/charts/Network/applyLayout.js.map +0 -1
- package/es/src/charts/Network/emit.js.map +0 -1
- package/es/src/charts/Network/index.js.map +0 -1
- package/es/src/charts/Pack/applyLayout.js.map +0 -1
- package/es/src/charts/Pack/emit.js.map +0 -1
- package/es/src/charts/Pack/index.js.map +0 -1
- package/es/src/charts/Pack/recursionCircles.js.map +0 -1
- package/es/src/charts/Pie/applyLayout.js.map +0 -1
- package/es/src/charts/Pie/emit.js.map +0 -1
- package/es/src/charts/Pie/index.js.map +0 -1
- package/es/src/charts/Plot/discreteSpan.js.map +0 -1
- package/es/src/charts/Plot/draw.js.map +0 -1
- package/es/src/charts/Plot/index.js.map +0 -1
- package/es/src/charts/Plot/insetRegion.js.map +0 -1
- package/es/src/charts/Plot/labelPlacement.js.map +0 -1
- package/es/src/charts/Plot/pipeline.js.map +0 -1
- package/es/src/charts/Plot/pipelineDomains.js.map +0 -1
- package/es/src/charts/Plot/pipelineLineLabels.js.map +0 -1
- package/es/src/charts/Plot/plotZoom.js.map +0 -1
- package/es/src/charts/Plot/shapeDefaults.js.map +0 -1
- package/es/src/charts/Plot/sharedHover.js.map +0 -1
- package/es/src/charts/Plot/sharedHoverScene.js.map +0 -1
- package/es/src/charts/Plot/sharedTooltip.js.map +0 -1
- package/es/src/charts/Plot/stackHelpers.js.map +0 -1
- package/es/src/charts/Plot/stackShareLabels.js.map +0 -1
- package/es/src/charts/Plot/stackShareTooltip.js.map +0 -1
- package/es/src/charts/Plot/trendLines.js.map +0 -1
- package/es/src/charts/Plot/trendProjection.js.map +0 -1
- package/es/src/charts/Plot/trendScene.js.map +0 -1
- package/es/src/charts/Plot/trendTooltip.js.map +0 -1
- package/es/src/charts/Priestley/applyLayout.js.map +0 -1
- package/es/src/charts/Priestley/emit.js.map +0 -1
- package/es/src/charts/Priestley/index.js.map +0 -1
- package/es/src/charts/Radar/applyLayout.js.map +0 -1
- package/es/src/charts/Radar/emit.js.map +0 -1
- package/es/src/charts/Radar/index.js.map +0 -1
- package/es/src/charts/RadialMatrix/applyLayout.js.map +0 -1
- package/es/src/charts/RadialMatrix/emit.js.map +0 -1
- package/es/src/charts/RadialMatrix/index.js.map +0 -1
- package/es/src/charts/Rings/applyLayout.js.map +0 -1
- package/es/src/charts/Rings/emit.js.map +0 -1
- package/es/src/charts/Rings/index.js.map +0 -1
- package/es/src/charts/Rings/ringsSizing.js.map +0 -1
- package/es/src/charts/Sankey/applyLayout.js.map +0 -1
- package/es/src/charts/Sankey/emit.js.map +0 -1
- package/es/src/charts/Sankey/index.js.map +0 -1
- package/es/src/charts/StackedArea/index.js.map +0 -1
- package/es/src/charts/Tree/applyLayout.js.map +0 -1
- package/es/src/charts/Tree/emit.js.map +0 -1
- package/es/src/charts/Tree/index.js.map +0 -1
- package/es/src/charts/Treemap/applyLayout.js.map +0 -1
- package/es/src/charts/Treemap/emit.js.map +0 -1
- package/es/src/charts/Treemap/index.js.map +0 -1
- package/es/src/charts/Treemap/thresholdFunction.js.map +0 -1
- package/es/src/charts/definition/ChartDefinition.js.map +0 -1
- package/es/src/charts/definition/applyDefinition.js.map +0 -1
- package/es/src/charts/definition/makeChart.js.map +0 -1
- package/es/src/charts/drawSteps/backControl.js.map +0 -1
- package/es/src/charts/drawSteps/bottomRightControls.js.map +0 -1
- package/es/src/charts/drawSteps/bottomRightControlsMarkup.js.map +0 -1
- package/es/src/charts/drawSteps/controlButtonStyle.js.map +0 -1
- package/es/src/charts/drawSteps/minimap.js.map +0 -1
- package/es/src/charts/drawSteps/minimapMarkup.js.map +0 -1
- package/es/src/charts/drawSteps/searchControls.js.map +0 -1
- package/es/src/charts/drawSteps/searchControlsMarkup.js.map +0 -1
- package/es/src/charts/drawSteps/tableView.js.map +0 -1
- package/es/src/charts/drawSteps/tableViewControl.js.map +0 -1
- package/es/src/charts/drawSteps/tableViewMarkup.js.map +0 -1
- package/es/src/charts/drawSteps/topLeftControls.js.map +0 -1
- package/es/src/charts/drawSteps/topLeftControlsMarkup.js.map +0 -1
- package/es/src/charts/drawSteps/zoomControls.js.map +0 -1
- package/es/src/charts/drawSteps/zoomControlsMarkup.js.map +0 -1
- package/es/src/charts/events/click.legend.js.map +0 -1
- package/es/src/charts/events/click.shape.js.map +0 -1
- package/es/src/charts/events/mouseenter.js.map +0 -1
- package/es/src/charts/events/mouseleave.js.map +0 -1
- package/es/src/charts/events/mousemove.legend.js.map +0 -1
- package/es/src/charts/events/mousemove.shape.js.map +0 -1
- package/es/src/charts/events/touchstart.body.js.map +0 -1
- package/es/src/charts/features/attributionFeature.js.map +0 -1
- package/es/src/charts/features/axes.js.map +0 -1
- package/es/src/charts/features/chartGeometry.js.map +0 -1
- package/es/src/charts/features/colorScaleBucket.js.map +0 -1
- package/es/src/charts/features/edgeArrows.js.map +0 -1
- package/es/src/charts/features/emitHelpers.js.map +0 -1
- package/es/src/charts/features/ensureZoomDom.js.map +0 -1
- package/es/src/charts/features/features.js.map +0 -1
- package/es/src/charts/features/featuresColorScale.js.map +0 -1
- package/es/src/charts/features/featuresLegend.js.map +0 -1
- package/es/src/charts/features/insetState.js.map +0 -1
- package/es/src/charts/features/legendLabel.js.map +0 -1
- package/es/src/charts/features/lineLabels.js.map +0 -1
- package/es/src/charts/features/plotPaint.js.map +0 -1
- package/es/src/charts/features/sceneBounds.js.map +0 -1
- package/es/src/charts/features/shapeEmit.js.map +0 -1
- package/es/src/charts/features/tooltipSwatch.js.map +0 -1
- package/es/src/charts/features/zoomExtent.js.map +0 -1
- package/es/src/charts/helpers/matrixData.js.map +0 -1
- package/es/src/charts/helpers/tileAttributions.js.map +0 -1
- package/es/src/charts/index.js.map +0 -1
- package/es/src/charts/pipeline/drillMorph.js.map +0 -1
- package/es/src/charts/pipeline/insetPlacement.js.map +0 -1
- package/es/src/charts/pipeline/resolveSpec.js.map +0 -1
- package/es/src/charts/pipeline/runChartDraw.js.map +0 -1
- package/es/src/charts/pipeline/runVizPipeline.js.map +0 -1
- package/es/src/charts/pipeline/stages.js.map +0 -1
- package/es/src/charts/pipeline/vizContext.js +0 -29
- package/es/src/charts/pipeline/vizContext.js.map +0 -1
- package/es/src/charts/pipeline/vizDraw.js.map +0 -1
- package/es/src/charts/pipeline/vizDrawPure.js +0 -220
- package/es/src/charts/pipeline/vizDrawPure.js.map +0 -1
- package/es/src/charts/pipeline/vizPreDraw.js.map +0 -1
- package/es/src/charts/pipeline/vizPreDrawPure.js +0 -279
- package/es/src/charts/pipeline/vizPreDrawPure.js.map +0 -1
- package/es/src/charts/plotBuffers/Bar.js.map +0 -1
- package/es/src/charts/plotBuffers/Box.js.map +0 -1
- package/es/src/charts/plotBuffers/Circle.js.map +0 -1
- package/es/src/charts/plotBuffers/Line.js.map +0 -1
- package/es/src/charts/plotBuffers/Rect.js.map +0 -1
- package/es/src/charts/plotBuffers/discreteBuffer.js.map +0 -1
- package/es/src/charts/plotBuffers/numericBuffer.js.map +0 -1
- package/es/src/charts/viz/Viz.js.map +0 -1
- package/es/src/charts/viz/VizBase.js.map +0 -1
- package/es/src/charts/viz/VizBaseConfig.js +0 -538
- package/es/src/charts/viz/VizBaseConfig.js.map +0 -1
- package/es/src/charts/viz/interactionOpacity.js.map +0 -1
- package/es/src/charts/viz/linkGroup.js.map +0 -1
- package/es/src/charts/viz/ordinalColor.js.map +0 -1
- package/es/src/charts/viz/sceneRows.js.map +0 -1
- package/es/src/charts/viz/trailCatchup.js.map +0 -1
- package/es/src/charts/viz/vizDefaults.js.map +0 -1
- package/es/src/charts/viz/vizRender.js.map +0 -1
- package/es/src/charts/viz/vizTypes.js.map +0 -1
- package/es/src/charts/viz/vizVisibility.js.map +0 -1
- package/es/src/components/Axis/Axis.js.map +0 -1
- package/es/src/components/Axis/AxisBottom.js.map +0 -1
- package/es/src/components/Axis/AxisLeft.js.map +0 -1
- package/es/src/components/Axis/AxisRight.js.map +0 -1
- package/es/src/components/Axis/AxisTop.js.map +0 -1
- package/es/src/components/Axis/axisLayout.js.map +0 -1
- package/es/src/components/Axis/axisLayoutLabels.js.map +0 -1
- package/es/src/components/Axis/axisLayoutScale.js.map +0 -1
- package/es/src/components/Axis/axisRender.js.map +0 -1
- package/es/src/components/ColorScale/ColorScale.js.map +0 -1
- package/es/src/components/ColorScale/colorScaleRender.js.map +0 -1
- package/es/src/components/ColorScale/colorScaleScale.js.map +0 -1
- package/es/src/components/Legend/Legend.js.map +0 -1
- package/es/src/components/Legend/legendConfig.js.map +0 -1
- package/es/src/components/Legend/legendRender.js.map +0 -1
- package/es/src/components/Message.js.map +0 -1
- package/es/src/components/SizeLegend/SizeLegend.js.map +0 -1
- package/es/src/components/SizeLegend/sizeLegendLayout.js.map +0 -1
- package/es/src/components/TextBox.js.map +0 -1
- package/es/src/components/Timeline/Timeline.js.map +0 -1
- package/es/src/components/Timeline/timelineConfig.js.map +0 -1
- package/es/src/components/Timeline/timelineRender.js.map +0 -1
- package/es/src/components/Tooltip.js.map +0 -1
- package/es/src/components/index.js.map +0 -1
- package/es/src/fluent.js.map +0 -1
- package/es/src/shapes/Area.js.map +0 -1
- package/es/src/shapes/Bar.js.map +0 -1
- package/es/src/shapes/Box.js.map +0 -1
- package/es/src/shapes/Circle.js.map +0 -1
- package/es/src/shapes/Image.js.map +0 -1
- package/es/src/shapes/Line.js.map +0 -1
- package/es/src/shapes/Path.js.map +0 -1
- package/es/src/shapes/Rect.js.map +0 -1
- package/es/src/shapes/Shape.js.map +0 -1
- package/es/src/shapes/Whisker.js.map +0 -1
- package/es/src/shapes/buildLabelData.js.map +0 -1
- package/es/src/shapes/emitLabels.js.map +0 -1
- package/es/src/shapes/hitAreaNode.js.map +0 -1
- package/es/src/shapes/index.js.map +0 -1
- package/es/src/shapes/interactionPoints.js.map +0 -1
- package/es/src/shapes/sceneSort.js.map +0 -1
- package/es/src/shapes/shapeConfig.js.map +0 -1
- package/es/src/shapes/textureKey.js.map +0 -1
- package/es/src/shapes/validateShapeConfig.js.map +0 -1
- package/es/src/utils/AccessorFn.js.map +0 -1
- package/es/src/utils/BaseClass.js.map +0 -1
- package/es/src/utils/D3Scale.js.map +0 -1
- package/es/src/utils/D3plusConfig.js.map +0 -1
- package/es/src/utils/RESET.js.map +0 -1
- package/es/src/utils/accessor.js.map +0 -1
- package/es/src/utils/configDefault.js.map +0 -1
- package/es/src/utils/configPrep.js.map +0 -1
- package/es/src/utils/configWarnings.js.map +0 -1
- package/es/src/utils/constant.js.map +0 -1
- package/es/src/utils/getProp.js.map +0 -1
- package/es/src/utils/index.js.map +0 -1
- package/es/src/utils/paintComponentScene.js.map +0 -1
- package/es/umd-entry.js +0 -16
- package/es/umd-entry.js.map +0 -1
- package/types/src/charts/AreaPlot.d.ts +0 -16
- package/types/src/charts/BarChart.d.ts +0 -16
- package/types/src/charts/BoxWhisker.d.ts +0 -11
- package/types/src/charts/BumpChart.d.ts +0 -36
- package/types/src/charts/ChartDefinition.d.ts +0 -75
- package/types/src/charts/Donut.d.ts +0 -11
- package/types/src/charts/Geomap.d.ts +0 -126
- package/types/src/charts/LinePlot.d.ts +0 -15
- package/types/src/charts/Matrix.d.ts +0 -48
- package/types/src/charts/Network.d.ts +0 -54
- package/types/src/charts/Pack.d.ts +0 -34
- package/types/src/charts/Pie.d.ts +0 -17
- package/types/src/charts/Plot.d.ts +0 -150
- package/types/src/charts/Priestley.d.ts +0 -37
- package/types/src/charts/Radar.d.ts +0 -38
- package/types/src/charts/RadialMatrix.d.ts +0 -63
- package/types/src/charts/Rings.d.ts +0 -61
- package/types/src/charts/Sankey.d.ts +0 -77
- package/types/src/charts/StackedArea.d.ts +0 -14
- package/types/src/charts/Tree.d.ts +0 -17
- package/types/src/charts/Treemap.d.ts +0 -42
- package/types/src/charts/Viz.d.ts +0 -90
- package/types/src/charts/VizBase.d.ts +0 -158
- package/types/src/charts/VizBaseConfig.d.ts +0 -148
- package/types/src/charts/applyDefinition.d.ts +0 -13
- package/types/src/charts/axes.d.ts +0 -134
- package/types/src/charts/chartGeometry.d.ts +0 -58
- package/types/src/charts/drawSteps/drawAttribution.d.ts +0 -7
- package/types/src/charts/drawSteps/drawBack.d.ts +0 -6
- package/types/src/charts/drawSteps/drawColorScale.d.ts +0 -6
- package/types/src/charts/drawSteps/drawLegend.d.ts +0 -12
- package/types/src/charts/drawSteps/drawSubtitle.d.ts +0 -7
- package/types/src/charts/drawSteps/drawTimeline.d.ts +0 -7
- package/types/src/charts/drawSteps/drawTitle.d.ts +0 -7
- package/types/src/charts/drawSteps/drawTotal.d.ts +0 -7
- package/types/src/charts/emitHelpers.d.ts +0 -122
- package/types/src/charts/ensureZoomDom.d.ts +0 -39
- package/types/src/charts/factories.d.ts +0 -73
- package/types/src/charts/features/colorScaleBucketShare.d.ts +0 -16
- package/types/src/charts/features.d.ts +0 -152
- package/types/src/charts/featuresLegend.d.ts +0 -12
- package/types/src/charts/legendLabel.d.ts +0 -11
- package/types/src/charts/lineLabels.d.ts +0 -40
- package/types/src/charts/makeChart.d.ts +0 -22
- package/types/src/charts/pipeline/vizContext.d.ts +0 -45
- package/types/src/charts/pipeline/vizDrawPure.d.ts +0 -46
- package/types/src/charts/pipeline/vizPreDrawPure.d.ts +0 -68
- package/types/src/charts/plotPaint.d.ts +0 -233
- package/types/src/charts/resolveSpec.d.ts +0 -50
- package/types/src/charts/runChartDraw.d.ts +0 -38
- package/types/src/charts/runVizPipeline.d.ts +0 -31
- package/types/src/charts/shapeEmit.d.ts +0 -61
- package/types/src/charts/stages.d.ts +0 -117
- package/types/src/charts/viz/VizBaseConfig.d.ts +0 -175
- package/types/src/charts/vizContext.d.ts +0 -46
- package/types/src/charts/vizDefaults.d.ts +0 -8
- package/types/src/charts/vizDraw.d.ts +0 -25
- package/types/src/charts/vizDrawPure.d.ts +0 -17
- package/types/src/charts/vizPreDraw.d.ts +0 -22
- package/types/src/charts/vizPreDrawPure.d.ts +0 -40
- package/types/src/charts/vizRender.d.ts +0 -8
- package/types/src/charts/vizTypes.d.ts +0 -202
- package/types/src/components/Axis.d.ts +0 -183
- package/types/src/components/AxisBottom.d.ts +0 -11
- package/types/src/components/AxisLeft.d.ts +0 -11
- package/types/src/components/AxisRight.d.ts +0 -11
- package/types/src/components/AxisTop.d.ts +0 -11
- package/types/src/components/ColorScale.d.ts +0 -80
- package/types/src/components/Legend.d.ts +0 -93
- package/types/src/components/Timeline.d.ts +0 -83
- package/types/src/components/axisLayout.d.ts +0 -27
- package/types/src/components/axisLayoutLabels.d.ts +0 -42
- package/types/src/components/axisLayoutScale.d.ts +0 -12
- package/types/src/components/axisRender.d.ts +0 -65
- package/types/src/components/colorScaleRender.d.ts +0 -15
- package/types/src/components/colorScaleScale.d.ts +0 -19
- package/types/src/components/legendConfig.d.ts +0 -7
- package/types/src/components/legendRender.d.ts +0 -16
- package/types/src/components/timelineConfig.d.ts +0 -6
- package/types/src/components/timelineRender.d.ts +0 -14
- package/umd/d3plus-core.full.js.map +0 -1
- package/umd/d3plus-core.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shapes/shapeConfig.ts"],"sourcesContent":["/**\n Per-shape config types.\n\n Every `Shape` subclass exposes a `.config(c)` method that accepts a\n plain object whose keys match the class's accessor methods. The\n interfaces below enumerate those keys + their types so users (and\n chart-internal code) get autocomplete + compile-time validation\n instead of `Record<string, unknown>` everywhere.\n\n Pattern:\n - `BaseShapeConfig` holds the ~40 keys every shape inherits from\n `Shape` (fill, stroke, opacity, hover, label, etc.).\n - Each shape adds its own keys via interface extension\n (RectConfig adds width/height; CircleConfig adds r; etc.).\n - The discriminated union `AnyShapeConfig` is what callers\n composing a transient config object can use.\n\n These types are **declarative** — they don't change runtime behavior.\n Existing chart code that passes `Record<string, unknown>` still\n works (TypeScript allows a Record where a Partial<Interface> is\n expected if the keys overlap). The win is types AT THE BOUNDARY\n for new code and editor autocomplete on existing call sites.\n\n @module\n*/\n\nimport type {DataPoint} from \"@d3plus/data\";\n\nimport type {AccessorFn} from \"../utils/index.js\";\n\n/**\n A value that can either be a function (called per-datum) or a literal\n that wraps as `constant(_)`. Mirrors the runtime \"const\" coerce.\n*/\nexport type ConstOrAccessor<T = unknown> = T | AccessorFn;\n\n/**\n A value that can be a function, a string key (wrapped in `accessor`),\n or a literal (wrapped in `constant`). Mirrors the \"accessor\" coerce.\n*/\nexport type StringOrAccessor<T = unknown> = T | string | AccessorFn;\n\n/**\n Common props inherited from `Shape` — every shape subclass accepts\n these via `.config(...)` regardless of geometry.\n*/\nexport interface BaseShapeConfig {\n /** Data array driving the shape. */\n data?: DataPoint[];\n\n /** Predicate or null marking which data points are currently active. */\n active?: ((d: DataPoint, i: number) => boolean) | null;\n /** Opacity applied to non-active data points (default ~0.25). */\n activeOpacity?: number;\n /** Style overrides for active data points. */\n activeStyle?: Record<string, unknown>;\n\n /** ARIA label per datum (accessibility). */\n ariaLabel?: ConstOrAccessor<string>;\n /** Optional background image per datum (url or accessor returning a url). */\n backgroundImage?: ConstOrAccessor<string>;\n /**\n How a `backgroundImage` fits its shape: `\"cover\"` (default) fills the\n shape's bounding box, cropping the overflow and clipping to the outline;\n `\"contain\"` fits the whole image, centered and fully visible, inside the\n shape's largest inscribed rectangle.\n */\n backgroundImageFit?: ConstOrAccessor<\"cover\" | \"contain\">;\n\n /** Discrete-axis key (\"x\" | \"y\") for charts that flip layout per axis. */\n discrete?: \"x\" | \"y\";\n /** Animation duration in ms. */\n duration?: number;\n\n /** Fill color or accessor returning one. */\n fill?: ConstOrAccessor<string>;\n /** Fill opacity (0..1). */\n fillOpacity?: ConstOrAccessor<number>;\n\n /** Predicate or null marking which data points are currently hovered. */\n hover?: ((d: DataPoint, i: number) => boolean) | null;\n /** Opacity applied to non-hovered data points. */\n hoverOpacity?: number;\n /** Style overrides for hovered data points. */\n hoverStyle?: Record<string, unknown>;\n\n /** Hit-area shape: function returning bounds or static bounds. */\n hitArea?:\n | ((d: DataPoint, i: number, aes: unknown) => Record<string, unknown>)\n | Record<string, unknown>;\n\n /** Unique-id accessor per datum (used for keyed enter/update/exit). */\n id?: AccessorFn;\n /** Label text(s) per datum. False/undefined skips. */\n label?: ConstOrAccessor<string | string[] | false>;\n /** Label-bounds accessor (where to mount the label). */\n labelBounds?:\n | ((d: DataPoint, i: number, aes: unknown) => Record<string, unknown> | Record<string, unknown>[])\n | Record<string, unknown>;\n /** Label TextBox config (font, padding, etc.). */\n labelConfig?: Record<string, unknown>;\n\n /** Overall opacity (0..1). */\n opacity?: ConstOrAccessor<number>;\n /** SVG `pointer-events` attribute per datum. */\n pointerEvents?: ConstOrAccessor<string>;\n /** ARIA role per datum (accessibility). */\n role?: ConstOrAccessor<string>;\n\n /** Rotation in degrees per datum. */\n rotate?: ConstOrAccessor<number>;\n /** SVG `rx` (rect rounded-corner x) — applies to Rect/Bar. */\n rx?: ConstOrAccessor<number>;\n /** SVG `ry` (rect rounded-corner y) — applies to Rect/Bar. */\n ry?: ConstOrAccessor<number>;\n /** Scale factor (1 = identity). */\n scale?: ConstOrAccessor<number>;\n\n /** \"full\" runs the DOM enter/update/exit; \"compute\" skips DOM. */\n renderMode?: \"full\" | \"compute\";\n /** Where to mount the shape's DOM (CSS selector, element, or null). */\n select?: string | HTMLElement | SVGElement | null;\n\n /** SVG `shape-rendering` attribute per datum. */\n shapeRendering?: ConstOrAccessor<string>;\n\n /** d3-style sort comparator. */\n sort?: ((a: DataPoint, b: DataPoint) => number) | null;\n\n /** Stroke color. */\n stroke?: ConstOrAccessor<string>;\n /** SVG `stroke-dasharray`. */\n strokeDasharray?: ConstOrAccessor<string>;\n /** SVG `stroke-linecap`. */\n strokeLinecap?: ConstOrAccessor<string>;\n /** SVG `stroke-opacity`. */\n strokeOpacity?: ConstOrAccessor<number>;\n /** Stroke width in pixels. */\n strokeWidth?: ConstOrAccessor<number>;\n\n /** SVG `text-anchor` for labels. */\n textAnchor?: ConstOrAccessor<string>;\n /** Texture (per textures.js) — name string or full config. */\n texture?: ConstOrAccessor<string | Record<string, unknown>>;\n /** Default texture config merged into the per-datum texture. */\n textureDefault?: Record<string, unknown>;\n\n /** SVG `vector-effect` (e.g. \"non-scaling-stroke\"). */\n vectorEffect?: ConstOrAccessor<string>;\n /** Label vertical-align (\"top\"/\"middle\"/\"bottom\"). */\n verticalAlign?: ConstOrAccessor<string>;\n\n /** X position. */\n x?: ConstOrAccessor<number>;\n /** Y position. */\n y?: ConstOrAccessor<number>;\n\n /** Event handlers (Object.<event, handler>). */\n on?: Record<string, (...args: unknown[]) => unknown>;\n\n [key: string]: unknown;\n}\n\n/** Rect-specific config (width + height on top of base). */\nexport interface RectConfig extends BaseShapeConfig {\n width?: ConstOrAccessor<number>;\n height?: ConstOrAccessor<number>;\n /** Sweep a tapering motion trail behind the rect as it moves between frames. */\n trail?: boolean;\n /** Steps of trail history to keep (number), or `true` for a long fading tail. */\n trailPersist?: number | boolean;\n}\n\n/** Circle-specific config (radius). */\nexport interface CircleConfig extends BaseShapeConfig {\n r?: ConstOrAccessor<number>;\n /** Sweep a tapering motion trail behind the point as it moves between frames. */\n trail?: boolean;\n /** Steps of trail history to keep (number), or `true` for a long fading tail. */\n trailPersist?: number | boolean;\n}\n\n/** Line-specific config (curve + defined). */\nexport interface LineConfig extends BaseShapeConfig {\n curve?: ConstOrAccessor<string>;\n defined?: AccessorFn;\n}\n\n/** Area-specific config (curve, defined, dual-edge x/y). */\nexport interface AreaConfig extends BaseShapeConfig {\n curve?: ConstOrAccessor<string>;\n /** Determines whether a data point is defined (a gap in the area when false). */\n defined?: (d: DataPoint) => boolean;\n x0?: ConstOrAccessor<number>;\n x1?: ConstOrAccessor<number> | null;\n y0?: ConstOrAccessor<number>;\n y1?: ConstOrAccessor<number> | null;\n}\n\n/** Path-specific config (raw SVG path d string or generator). */\nexport interface PathConfig extends BaseShapeConfig {\n d?: ConstOrAccessor<string>;\n}\n\n/** Bar-specific config (Rect + start/end coords). */\nexport interface BarConfig extends RectConfig {\n x0?: ConstOrAccessor<number>;\n x1?: ConstOrAccessor<number> | null;\n y0?: ConstOrAccessor<number>;\n y1?: ConstOrAccessor<number> | null;\n}\n\n/** Image-specific config (url + dimensions). */\nexport interface ImageConfig {\n data?: DataPoint[];\n duration?: number;\n height?: ConstOrAccessor<number>;\n id?: AccessorFn;\n opacity?: ConstOrAccessor<number>;\n pointerEvents?: ConstOrAccessor<string>;\n select?: string | HTMLElement | SVGElement | null;\n /** URL accessor returning the image src. */\n url?: AccessorFn;\n width?: ConstOrAccessor<number>;\n x?: ConstOrAccessor<number>;\n y?: ConstOrAccessor<number>;\n}\n\n/** Box-specific config (whisker + median + outliers; subset of Shape). */\nexport interface BoxConfig {\n data?: DataPoint[];\n medianConfig?: Record<string, unknown>;\n /** Orientation: \"vertical\" or \"horizontal\". */\n orient?: ConstOrAccessor<string>;\n /** Outlier accessor (per-datum predicate). */\n outlier?: ConstOrAccessor<string>;\n outlierConfig?: Record<string, unknown>;\n rectConfig?: Record<string, unknown>;\n rectWidth?: ConstOrAccessor<number>;\n select?: string | HTMLElement | SVGElement | null;\n whiskerConfig?: Record<string, unknown>;\n /** Whisker mode: single mode string/number or [low, high] pair. */\n whiskerMode?: (string | number)[] | string | number;\n x?: ConstOrAccessor<number>;\n y?: ConstOrAccessor<number>;\n\n [key: string]: unknown;\n}\n\n/** Whisker-specific config. */\nexport interface WhiskerConfig {\n data?: DataPoint[];\n /** End-cap shape name (e.g. \"Rect\"). */\n endpoint?: ConstOrAccessor<string>;\n endpointConfig?: Record<string, unknown>;\n /** Whisker length in pixels. */\n length?: ConstOrAccessor<number>;\n lineConfig?: Record<string, unknown>;\n orient?: ConstOrAccessor<string>;\n select?: string | HTMLElement | SVGElement | null;\n x?: ConstOrAccessor<number>;\n y?: ConstOrAccessor<number>;\n\n [key: string]: unknown;\n}\n\n/**\n Union of every shape config — useful for code that composes\n transient configs at runtime without knowing the shape ahead of\n time (Plot's `shapeConfig`, axis decorators, etc.).\n*/\nexport type AnyShapeConfig =\n | BaseShapeConfig\n | RectConfig\n | CircleConfig\n | LineConfig\n | AreaConfig\n | PathConfig\n | BarConfig\n | ImageConfig\n | BoxConfig\n | WhiskerConfig;\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,GAkPA;;;;AAIA,GACA,WAUkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shapes/textureKey.ts"],"sourcesContent":["import {assign, isObject} from \"@d3plus/dom\";\n\n/** textures.js path-based texture names, drawn by its `paths()` generator. */\nconst pathNames = [\n \"squares\",\n \"nylon\",\n \"waves\",\n \"woven\",\n \"crosses\",\n \"caps\",\n \"hexagons\",\n];\n\n/** Color-valued texture keys; a d3-color object is reduced to its CSS string. */\nconst colorKeys = [\"background\", \"fill\", \"stroke\"];\n\n/**\n Builds the JSON key of a textures.js config for one datum, or `false` when\n the datum has no texture or no fill (`\"none\"`, e.g. a line or link). The key is what a `pattern:<key>` scene fill\n carries for the renderer backends to materialize. `fill` and `stroke` are\n the shape's resolved fill and stroke for the datum, used as the texture's\n default background and line colors.\n @private\n*/\nexport function textureKey(\n textureVal: unknown,\n fill: () => unknown,\n stroke: () => unknown,\n textureDefault: Record<string, unknown> = {},\n): string | false {\n if (!textureVal) return false;\n const background = fill();\n if (background === \"none\") return false;\n const texture: Record<string, unknown> = isObject(textureVal)\n ? {...(textureVal as Record<string, unknown>)}\n : {texture: textureVal};\n if (!texture.background) texture.background = background;\n if (!texture.stroke && !textureDefault.stroke) texture.stroke = stroke();\n if (\n pathNames.includes(texture.texture as string) ||\n typeof texture.texture === \"function\"\n ) {\n texture.d = texture.texture;\n texture.texture = \"paths\";\n } else if (texture.texture === \"grid\") {\n if (!texture.orientation && !textureDefault.orientation)\n texture.orientation = [\"vertical\", \"horizontal\"];\n texture.texture = \"lines\";\n }\n if (!texture.fill && texture.texture !== \"paths\")\n texture.fill = texture.stroke;\n for (const key of colorKeys) {\n const v = texture[key];\n if (v && typeof v === \"object\") texture[key] = String(v);\n }\n const retObj = assign({}, textureDefault, texture);\n if (typeof retObj.d === \"function\") {\n retObj.d = retObj.d(retObj.size || 20);\n }\n return JSON.stringify(retObj);\n}\n"],"names":["assign","isObject","pathNames","colorKeys","textureKey","textureVal","fill","stroke","textureDefault","background","texture","includes","d","orientation","key","v","String","retObj","size","JSON","stringify"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAQA,MAAM,EAAEC,QAAQ,QAAO,cAAc;AAE7C,4EAA4E,GAC5E,IAAMC,YAAY;IAChB;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,+EAA+E,GAC/E,IAAMC,YAAY;IAAC;IAAc;IAAQ;CAAS;AAElD;;;;;;;AAOA,GACA,OAAO,SAASC,WACdC,UAAmB,EACnBC,IAAmB,EACnBC,MAAqB;QACrBC,iBAAAA,iEAA0C,CAAC;IAE3C,IAAI,CAACH,YAAY,OAAO;IACxB,IAAMI,aAAaH;IACnB,IAAIG,eAAe,QAAQ,OAAO;IAClC,IAAMC,UAAmCT,SAASI,cAC9C,mBAAKA,cACL;QAACK,SAASL;IAAU;IACxB,IAAI,CAACK,QAAQD,UAAU,EAAEC,QAAQD,UAAU,GAAGA;IAC9C,IAAI,CAACC,QAAQH,MAAM,IAAI,CAACC,eAAeD,MAAM,EAAEG,QAAQH,MAAM,GAAGA;IAChE,IACEL,UAAUS,QAAQ,CAACD,QAAQA,OAAO,KAClC,OAAOA,QAAQA,OAAO,KAAK,YAC3B;QACAA,QAAQE,CAAC,GAAGF,QAAQA,OAAO;QAC3BA,QAAQA,OAAO,GAAG;IACpB,OAAO,IAAIA,QAAQA,OAAO,KAAK,QAAQ;QACrC,IAAI,CAACA,QAAQG,WAAW,IAAI,CAACL,eAAeK,WAAW,EACrDH,QAAQG,WAAW,GAAG;YAAC;YAAY;SAAa;QAClDH,QAAQA,OAAO,GAAG;IACpB;IACA,IAAI,CAACA,QAAQJ,IAAI,IAAII,QAAQA,OAAO,KAAK,SACvCA,QAAQJ,IAAI,GAAGI,QAAQH,MAAM;QAC1B,kCAAA,2BAAA;;QAAL,QAAK,YAAaJ,8BAAb,SAAA,6BAAA,QAAA,yBAAA,iCAAwB;YAAxB,IAAMW,MAAN;YACH,IAAMC,IAAIL,OAAO,CAACI,IAAI;YACtB,IAAIC,KAAK,CAAA,OAAOA,kCAAP,SAAOA,EAAAA,MAAM,UAAUL,OAAO,CAACI,IAAI,GAAGE,OAAOD;QACxD;;QAHK;QAAA;;;iBAAA,6BAAA;gBAAA;;;gBAAA;sBAAA;;;;IAIL,IAAME,SAASjB,OAAO,CAAC,GAAGQ,gBAAgBE;IAC1C,IAAI,OAAOO,OAAOL,CAAC,KAAK,YAAY;QAClCK,OAAOL,CAAC,GAAGK,OAAOL,CAAC,CAACK,OAAOC,IAAI,IAAI;IACrC;IACA,OAAOC,KAAKC,SAAS,CAACH;AACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shapes/validateShapeConfig.ts"],"sourcesContent":["import {isObject} from \"@d3plus/dom\";\nimport {warnUnknownConfig} from \"../utils/configWarnings.js\";\nimport * as shapes from \"./index.js\";\n\nconst shapeClasses = shapes as unknown as Record<string, new () => object>;\n\n// One instance per shape class, created on first use: fluent accessors are\n// installed onto the prototype by the constructor, so `key in instance`\n// matches exactly what `BaseClass.config()` accepts.\nlet instances: Record<string, object> | undefined;\nfunction shapeInstances(): Record<string, object> {\n if (!instances) {\n instances = {};\n for (const [name, Cls] of Object.entries(shapeClasses)) instances[name] = new Cls();\n }\n return instances;\n}\n\n/**\n Warns about `shapeConfig` keys that no shape supports. A top-level key is\n valid if any shape class has it (the config is shared by every shape type);\n a key nested under a shape name (like `{Rect: {…}}`) must exist on that\n shape.\n @param owner The class name of the chart receiving the config.\n @param config The user-supplied `shapeConfig` object.\n @private\n*/\nexport default function validateShapeConfig(owner: string, config: Record<string, unknown>): void {\n const label = `${owner}.shapeConfig()`;\n const all = shapeInstances();\n for (const key of Object.keys(config)) {\n const nested = all[key];\n if (nested && isObject(config[key])) {\n for (const k of Object.keys(config[key] as object)) {\n if (!(k in nested)) warnUnknownConfig(label, `${key}.${k}`);\n }\n }\n else if (!Object.values(all).some(shape => key in shape)) {\n warnUnknownConfig(label, key);\n }\n }\n}\n"],"names":["isObject","warnUnknownConfig","shapes","shapeClasses","instances","shapeInstances","Object","entries","name","Cls","validateShapeConfig","owner","config","label","all","key","nested","keys","k","values","some","shape"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAQA,QAAQ,QAAO,cAAc;AACrC,SAAQC,iBAAiB,QAAO,6BAA6B;AAC7D,YAAYC,YAAY,aAAa;AAErC,IAAMC,eAAeD;AAErB,2EAA2E;AAC3E,wEAAwE;AACxE,qDAAqD;AACrD,IAAIE;AACJ,SAASC;IACP,IAAI,CAACD,WAAW;QACdA,YAAY,CAAC;YACR,kCAAA,2BAAA;;YAAL,QAAK,YAAqBE,OAAOC,OAAO,CAACJ,kCAApC,SAAA,6BAAA,QAAA,yBAAA;gBAAA,mCAAA,iBAAOK,uBAAMC;gBAAsCL,SAAS,CAACI,KAAK,GAAG,IAAIC;;;YAAzE;YAAA;;;qBAAA,6BAAA;oBAAA;;;oBAAA;0BAAA;;;;IACP;IACA,OAAOL;AACT;AAEA;;;;;;;;AAQA,GACA,eAAe,SAASM,oBAAoBC,KAAa,EAAEC,MAA+B;IACxF,IAAMC,QAAQ,AAAC,GAAQ,OAANF,OAAM;IACvB,IAAMG,MAAMT;QACP,kCAAA,2BAAA;;;YAAA,IAAMU,MAAN;YACH,IAAMC,SAASF,GAAG,CAACC,IAAI;YACvB,IAAIC,UAAUhB,SAASY,MAAM,CAACG,IAAI,GAAG;oBAC9B,kCAAA,2BAAA;;oBAAL,QAAK,YAAWT,OAAOW,IAAI,CAACL,MAAM,CAACG,IAAI,sBAAlC,UAAA,6BAAA,SAAA,yBAAA,iCAA+C;wBAA/C,IAAMG,IAAN;wBACH,IAAI,CAAEA,CAAAA,KAAKF,MAAK,GAAIf,kBAAkBY,OAAO,AAAC,GAASK,OAAPH,KAAI,KAAK,OAAFG;oBACzD;;oBAFK;oBAAA;;;6BAAA,6BAAA;4BAAA;;;4BAAA;kCAAA;;;;YAGP,OACK,IAAI,CAACZ,OAAOa,MAAM,CAACL,KAAKM,IAAI,CAACC,SAAAA;uBAASN,OAAOM;gBAAQ;gBACxDpB,kBAAkBY,OAAOE;YAC3B;QACF;QAVA,QAAK,YAAaT,OAAOW,IAAI,CAACL,4BAAzB,SAAA,6BAAA,QAAA,yBAAA;;QAAA;QAAA;;;iBAAA,6BAAA;gBAAA;;;gBAAA;sBAAA;;;;AAWP"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/AccessorFn.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\n\n/**\n @type AccessorFn\n A function that accesses a property from a DataPoint.\n*/\nexport type AccessorFn = (\n d: DataPoint,\n i?: number,\n) => DataPoint[keyof DataPoint];\n"],"names":[],"mappings":"AAEA;;;AAGA,GACA,WAGgC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/BaseClass.ts"],"sourcesContent":["import {colorDefaults, type ColorDefaults} from \"@d3plus/color\";\nimport {assign, isObject} from \"@d3plus/dom\";\nimport {scaleOrdinal} from \"d3-scale\";\nimport {\n findLocale,\n translateLocale as dictionaries,\n type TranslationStrings,\n} from \"@d3plus/locales\";\n\nimport type {ColorDefaultsConfig, D3plusConfig} from \"./D3plusConfig.js\";\nimport RESET from \"./RESET.js\";\nimport {isSharedConfig, warnUnknownConfig} from \"./configWarnings.js\";\n\n/**\n Recursive function that resets nested Object configs.\n\n @private\n*/\nfunction nestedReset(\n obj: Record<string, unknown>,\n defaults: Record<string, unknown> | undefined,\n): void {\n if (isObject(obj)) {\n for (const nestedKey in obj) {\n if (\n {}.hasOwnProperty.call(obj, nestedKey) &&\n !nestedKey.startsWith(\"_\")\n ) {\n const defaultValue =\n defaults && isObject(defaults) ? defaults[nestedKey] : undefined;\n if (obj[nestedKey] === RESET) {\n if (defaultValue) obj[nestedKey] = defaultValue;\n else delete obj[nestedKey];\n } else if (isObject(obj[nestedKey])) {\n nestedReset(\n obj[nestedKey] as Record<string, unknown>,\n defaultValue as Record<string, unknown> | undefined,\n );\n }\n }\n }\n }\n}\n\n/**\n finds all prototype methods of a class and it's parent classes\n @param obj\n @private\n*/\nfunction getAllMethods(obj: object): string[] {\n let props: string[] = [];\n do {\n props = props.concat(Object.getOwnPropertyNames(obj));\n obj = Object.getPrototypeOf(obj);\n } while (obj && obj !== Object.prototype);\n return props.filter(\n e =>\n e.indexOf(\"_\") !== 0 &&\n // Side-effect/lifecycle methods excluded from config reflection: invoking\n // them as no-arg getters would run real work. `measure` runs the full\n // axis-layout pass; `destroy` tears down the scene renderer (which defeats\n // keyed reconcile and forces a full remount on the next draw).\n ![\"config\", \"constructor\", \"destroy\", \"measure\", \"parent\", \"render\", \"renderMode\", \"renderScene\", \"toScene\"].includes(e),\n );\n}\n\n/**\n Merges color overrides into an instance and every BaseClass it owns (own\n properties and `ctx` entries), so a Viz's legend, tooltip, axes, and\n shapes pick them up too.\n @private\n*/\nfunction cascadeColorDefaults(\n obj: BaseClass,\n overrides: Partial<ColorDefaults>,\n seen: WeakSet<BaseClass>,\n): void {\n if (seen.has(obj)) return;\n seen.add(obj);\n obj.schema.colorDefaults = {...obj.schema.colorDefaults, ...overrides};\n for (const child of [...Object.values(obj), ...Object.values(obj.ctx)]) {\n if (child instanceof BaseClass) cascadeColorDefaults(child, overrides, seen);\n }\n}\n\n/**\n Provides shared configuration, event handling, and locale management inherited by all d3plus classes.\n*/\nexport default class BaseClass {\n /**\n Post-coercion fluent storage (`.sum(...)`, `.x(...)`, …). `any` is\n deliberate and load-bearing: `installFluent` coerces accessor/const\n fields into functions, so call sites invoke `schema.fill(d, i)` and\n index `schema.groupBy[i]`. It is NOT `D3plusConfig` (that describes\n the pre-coercion user input). Typing it as a coerced `ResolvedSchema`\n interface is the only way to drop the `any`; until then it stays.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n schema: Record<string, any>;\n /** Chart-internal scratch (d3 layout instances, computed derived state). */\n ctx: Record<string, unknown>;\n\n _uuid: string;\n _configDefault?: D3plusConfig;\n\n /**\n Invoked when creating a new class instance, and sets any default parameters.\n @private\n*/\n constructor() {\n this.schema = {};\n this.ctx = {};\n this.schema.colorDefaults = {...colorDefaults};\n this.schema.locale = \"en-US\";\n this.schema.on = {};\n this.schema.parent = {};\n this.schema.translate = (\n d: string,\n locale: string = this.schema.locale,\n ): string => {\n const dictionary: TranslationStrings | undefined = dictionaries[locale];\n const key = d as keyof TranslationStrings;\n return dictionary && dictionary[key] ? dictionary[key] : d;\n };\n this._uuid = crypto.randomUUID();\n }\n\n /**\n Methods that correspond to the key/value pairs and returns this class.\n*/\n config(): D3plusConfig;\n config(_: D3plusConfig): this;\n config(_?: D3plusConfig): D3plusConfig | this {\n if (!this._configDefault) {\n const config: D3plusConfig = {};\n getAllMethods(Object.getPrototypeOf(this)).forEach(k => {\n const v = (this as unknown as Record<string, () => unknown>)[k]();\n if (v !== this) config[k] = isObject(v) ? assign({}, v as Record<string, unknown>) : v;\n });\n this._configDefault = config;\n }\n\n if (arguments.length) {\n for (const k in _) {\n if ({}.hasOwnProperty.call(_, k)) {\n if (k in this) {\n const v = _![k];\n if (v === RESET) {\n if (k === \"on\")\n this.schema.on = this._configDefault![k];\n else\n (this as unknown as Record<string, (v: unknown) => unknown>)[k](\n this._configDefault![k],\n );\n } else {\n nestedReset(\n v as Record<string, unknown>,\n this._configDefault![k] as Record<string, unknown>,\n );\n (this as unknown as Record<string, (v: unknown) => unknown>)[k](\n v,\n );\n }\n } else if (!isSharedConfig(_)) {\n warnUnknownConfig(`${this.constructor.name}.config()`, k);\n }\n }\n }\n return this;\n } else {\n const config: D3plusConfig = {};\n getAllMethods(Object.getPrototypeOf(this)).forEach(k => {\n config[k] = (this as unknown as Record<string, () => unknown>)[k]();\n });\n return config;\n }\n }\n\n /**\n The locale used for all text and number formatting. Supports the locales defined in [d3plus-format](https://github.com/d3plus/d3plus-format/blob/master/src/locale.js). The locale can be a complex Object, a locale code (like \"en-US\"), or a 2-digit language code (like \"en\"). If a 2-digit code is provided, the \"findLocale\" function is used to identify the most approximate locale.\n\n@example\n {\n separator: \"\",\n suffixes: [\"y\", \"z\", \"a\", \"f\", \"p\", \"n\", \"\\u00b5\", \"m\", \"\", \"k\", \"M\", \"B\", \"t\", \"q\", \"Q\", \"Z\", \"Y\"],\n grouping: [3],\n delimiters: {\n thousands: \",\",\n decimal: \".\"\n },\n currency: [\"$\", \"\"]\n }\n*/\n locale(): string;\n locale(_: string | object): this;\n locale(_?: string | object): string | this {\n return arguments.length\n ? ((this.schema.locale = findLocale(_ as string)), this)\n : this.schema.locale;\n }\n\n /**\n Overrides the default colors used when assigning fills from data and choosing legible text colors: `dark` and `light` (the text colors picked for contrast against a background), `missing` (null/undefined values), `on`/`off` (`true`/`false` values), `sequential` (the anchor hue for magnitude ramps), and `scale` (the categorical palette, given as a d3 ordinal scale or an array of colors). Keys are merged into the current defaults, and a Viz passes its overrides down to the shapes and components it draws.\n\n@example\nnew Treemap()\n .colorDefaults({\n dark: \"#222\",\n light: \"#fff\",\n scale: [\"#1b9e77\", \"#d95f02\", \"#7570b3\"]\n })\n*/\n colorDefaults(): ColorDefaults;\n colorDefaults(_: ColorDefaultsConfig): this;\n colorDefaults(_?: ColorDefaultsConfig): ColorDefaults | this {\n if (!arguments.length) return this.schema.colorDefaults;\n const {scale, ...rest} = _ ?? {};\n const next: Partial<ColorDefaults> = {...rest};\n if (Array.isArray(scale)) next.scale = scaleOrdinal<string>().range(scale);\n else if (scale) next.scale = scale;\n cascadeColorDefaults(this, next, new WeakSet());\n return this;\n }\n\n /**\n Event listener for the specified event *typenames*. Mirrors the core [d3-selection](https://github.com/d3/d3-selection#selection_on) behavior.\n\n@example <caption>By default, listeners apply globally to all objects, however, passing a namespace with the class name gives control over specific elements:</caption>\nnew Plot\n .on(\"click.Shape\", function(d) {\n console.log(\"data for shape clicked:\", d);\n })\n .on(\"click.Legend\", function(d) {\n console.log(\"data for legend clicked:\", d);\n })\n*/\n on(): Record<string, (...args: unknown[]) => unknown>;\n on(_: string): ((...args: unknown[]) => unknown) | undefined;\n on(_: string, f: (...args: unknown[]) => unknown): this;\n on(_: Record<string, (...args: unknown[]) => unknown>): this;\n on(\n _?: string | Record<string, (...args: unknown[]) => unknown>,\n f?: (...args: unknown[]) => unknown,\n ):\n | Record<string, (...args: unknown[]) => unknown>\n | ((...args: unknown[]) => unknown)\n | undefined\n | this {\n return arguments.length === 2\n ? ((this.schema.on[_ as string] = f!), this)\n : arguments.length\n ? typeof _ === \"string\"\n ? this.schema.on[_]\n : ((this.schema.on = Object.assign({}, this.schema.on, _)), this)\n : this.schema.on;\n }\n\n /**\n Parent config used by the wrapper.\n*/\n parent(): unknown;\n parent(_: unknown): this;\n parent(_?: unknown): unknown {\n return arguments.length\n ? ((this.schema.parent = _!), this)\n : this.schema.parent;\n }\n\n /**\n Defines how informational text strings should be displayed. By default, this function will try to find the string in question (which is the first argument provided to this function) inside of an internally managed translation Object. If you'd like to override to use custom text, simply pass this method your own custom formatting function.\n\n@example <caption>For example, if we wanted to only change the string \"Back\" and allow all other string to return in English:</caption>\n.translate(function(d) {\n return d === \"Back\" ? \"Get outta here\" : d;\n})\n*/\n translate(): (d: string, locale?: string) => string;\n translate(_: (d: string, locale?: string) => string): this;\n translate(\n _?: (d: string, locale?: string) => string,\n ): ((d: string, locale?: string) => string) | this {\n return arguments.length\n ? ((this.schema.translate = _!), this)\n : this.schema.translate;\n }\n\n /**\n Configuration object with key/value pairs applied as method calls on each shape.\n*/\n shapeConfig(): D3plusConfig;\n shapeConfig(_: D3plusConfig): this;\n shapeConfig(_?: D3plusConfig): D3plusConfig | this {\n return arguments.length\n ? ((this.schema.shapeConfig = assign(\n this.schema.shapeConfig ?? {},\n _!,\n ) as D3plusConfig),\n this)\n : (this.schema.shapeConfig as D3plusConfig);\n }\n}\n"],"names":["colorDefaults","assign","isObject","scaleOrdinal","findLocale","translateLocale","dictionaries","RESET","isSharedConfig","warnUnknownConfig","nestedReset","obj","defaults","nestedKey","hasOwnProperty","call","startsWith","defaultValue","undefined","getAllMethods","props","concat","Object","getOwnPropertyNames","getPrototypeOf","prototype","filter","e","indexOf","includes","cascadeColorDefaults","overrides","seen","has","add","schema","values","ctx","child","BaseClass","_uuid","_configDefault","locale","on","parent","translate","d","dictionary","key","crypto","randomUUID","config","_","forEach","k","v","arguments","length","name","scale","rest","next","Array","isArray","range","WeakSet","f","shapeConfig"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/D3Scale.ts"],"sourcesContent":["/**\n Structural type for the d3 scales d3plus builds dynamically via\n `scales[name]()`. A single field (`Axis._d3Scale`, `ColorScale._colorScale`,\n a plot buffer scale) can hold a linear / log / time / band / point /\n ordinal / threshold scale, whose concrete generic signatures are mutually\n incompatible (`domain()` takes `number[]` vs `string[]` vs `Date[]`). This\n captures the shared call surface instead, with scale-specific methods marked\n optional — guard (`if (scale.ticks)`) before calling them.\n\n `Out` is the scale's output: pixel positions (`number`) for axes and plot\n buffers, color strings for color scales.\n\n @module\n*/\nexport interface D3Scale<Out = number> {\n /** Maps a domain value to its output (pixel position or color). */\n (value: number | string | Date): Out;\n /** Current domain. */\n domain(): unknown[];\n /** Sets the domain. */\n domain(domain: Iterable<number | string | Date>): D3Scale<Out>;\n /** Current range. */\n range(): Out[];\n /** Sets the range. */\n range(range: Iterable<Out>): D3Scale<Out>;\n /** Returns an independent copy of the scale. */\n copy(): D3Scale<Out>;\n\n /** Continuous scales only: representative tick values. */\n ticks?(count?: number): number[];\n /** Continuous scales only: inverts an output value back to the domain. */\n invert?(value: number): number;\n /** Continuous scales only: get/set output clamping. */\n clamp?(): boolean;\n clamp?(clamp: boolean): D3Scale<Out>;\n\n /** Band / point scales only: width of one band. */\n bandwidth?(): number;\n /** Band / point scales only: distance between band starts. */\n step?(): number;\n /** Band / point scales only: get/set padding. */\n padding?(): number;\n padding?(padding: number): D3Scale<Out>;\n /** Band scales only: get/set inner padding. */\n paddingInner?(): number;\n paddingInner?(padding: number): D3Scale<Out>;\n /** Band scales only: get/set outer padding. */\n paddingOuter?(): number;\n paddingOuter?(padding: number): D3Scale<Out>;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;AAaA,GACA,WAmCC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/D3plusConfig.ts"],"sourcesContent":["import type {ColorDefaults} from \"@d3plus/color\";\nimport type {DataPoint} from \"@d3plus/data\";\n\nimport type VizBase from \"../charts/viz/VizBase.js\";\nimport type {LinkOption} from \"../charts/viz/linkGroup.js\";\nimport type {AccessorFn} from \"./AccessorFn.js\";\nimport type {\n SizeLegendLineConfig,\n SizeLegendShapeConfig,\n SizeLegendTextConfig,\n} from \"../components/SizeLegend/SizeLegend.js\";\nimport type {SizeLegendScale, SizeLegendSize} from \"../components/SizeLegend/sizeLegendLayout.js\";\n\ntype Position = \"top\" | \"right\" | \"bottom\" | \"left\";\n\ntype DataPointAccessor<T> = string | ((d: DataPoint) => T);\n\n/** A config value that is either a constant or a `(datum, index)` accessor. */\ntype Accessor<T> = T | ((d: DataPoint, i?: number) => T);\n\ntype AxisScale =\n | \"auto\"\n | \"band\"\n | \"diverging\"\n | \"divergingLog\"\n | \"divergingPow\"\n | \"divergingSqrt\"\n | \"divergingSymlog\"\n | \"identity\"\n | \"implicit\"\n | \"jenks\"\n | \"linear\"\n | \"log\"\n | \"ordinal\"\n | \"point\"\n | \"pow\"\n | \"quantile\"\n | \"quantize\"\n | \"radial\"\n | \"sequential\"\n | \"sequentialLog\"\n | \"sequentialPow\"\n | \"sequentialQuantile\"\n | \"sequentialSqrt\"\n | \"sequentialSymlog\"\n | \"sqrt\"\n | \"symlog\"\n | \"threshold\"\n | \"time\"\n | \"utc\";\n\nexport interface AxisConfig {\n barConfig?: Record<string, string | number>;\n /** Grid values of the axis. */\n grid?: unknown[];\n gridConfig?: Record<string, string | number>;\n /** Grid size of the axis. */\n gridSize?: number;\n label?: string;\n /** Visible tick labels of the axis. */\n labels?: unknown[];\n labelOffset?: false | number;\n /**\n Exact size of the space that contains the axis tick labels and title.\n Labels that need more room overflow outward instead of moving the axis\n line; zooming pins a rescaled axis this way so it doesn't shift.\n */\n fixedSize?: number;\n /** Maximum size allowed for the space that contains the axis tick labels and title. */\n maxSize?: number;\n /** Minimum size alloted for the space that contains the axis tick labels and title. */\n minSize?: number;\n /**\n Scale range (in pixels) of the axis. The given array must have 2 values,\n but one may be `undefined` to allow the default behavior for that value.\n */\n range?: (number | undefined)[];\n /** Scale of the axis. */\n scale?: AxisScale;\n /** Tick formatter. */\n tickFormat?: (d: number | string) => string | number;\n /** Tick values of the axis. */\n ticks?: unknown[];\n /**\n Whether the domain's min and max are always shown as ticks, even when\n they aren't among the scale's own \"nice\" tick values (the nearest nice\n tick is dropped when it would crowd them). Defaults to `true`; zooming\n turns it off so a rescaled axis shows only nice values.\n */\n domainTicks?: boolean;\n tickSize?: number;\n /**\n Defines a custom locale object to be used in time scales. Must include\n `dateTime`, `date`, `time`, `periods`, `days`, `shortDays`, `months`, and\n `shortMonths` (see\n [d3-time-format](https://github.com/d3/d3-time-format/blob/master/README.md#timeFormatLocale)).\n */\n timeLocale?: Record<string, unknown>;\n /** Title of the axis. */\n title?: string;\n}\n\nexport interface TooltipConfig {\n /** The inner HTML content of the arrow element, empty by default. */\n arrow?: ((d: DataPoint) => string) | string;\n /** The background color accessor for each tooltip. */\n background?: ((d: DataPoint) => string) | string;\n /** The border accessor for each tooltip. */\n border?: ((d: DataPoint) => string) | string;\n /** The border-radius accessor for each tooltip. */\n borderRadius?: ((d: DataPoint) => string) | string;\n /** The footer content accessor for each tooltip. */\n footer?: ((d: DataPoint) => string) | string;\n /** The max-width accessor for each tooltip. */\n maxWidth?: ((d: DataPoint) => string | number) | string | number;\n /** The min-width accessor for each tooltip. */\n minWidth?: ((d: DataPoint) => string | number) | string | number;\n /** The pixel offset between the tooltip and its anchor point. */\n offset?: ((d: DataPoint) => number) | number;\n /** The inner padding of each tooltip. */\n padding?: ((d: DataPoint) => string | number) | string | number;\n title?: ((d: DataPoint) => string) | string;\n body?: ((d: DataPoint) => string) | string;\n thead?:\n | ((d: DataPoint) => [string, string][])\n | Array<\n Array<\n | ((d: DataPoint, i?: number, x?: {share: number}) => string)\n | string\n >\n >;\n tbody?:\n | ((d: DataPoint) => [string, string][])\n | Array<\n Array<\n | ((d: DataPoint, i?: number, x?: {share: number}) => string)\n | string\n >\n >;\n}\n\nexport interface TextBoxConfig {\n /** The text content for each box. */\n text?: Accessor<string>;\n /** The font color as an accessor function or static string. Inferred from the DOM selection by default. */\n fontColor?: Accessor<string>;\n /** The font size in pixels. Inferred from the DOM selection by default. */\n fontSize?: Accessor<number>;\n /**\n The font-family to use: a font name, a comma-separated list of fallbacks,\n an array of fallbacks, or an accessor returning a string or array. The\n first available font on the client is used.\n */\n fontFamily?: Accessor<string | string[]>;\n /** The font weight. Inferred from the DOM selection by default. */\n fontWeight?: Accessor<string | number>;\n /** The minimum font size in pixels, used when dynamically resizing fonts. */\n fontMin?: number;\n /** The maximum font size in pixels, used when dynamically resizing fonts. */\n fontMax?: number;\n /** Toggles font resizing — a static boolean, or an accessor returning a boolean. */\n fontResize?: Accessor<boolean>;\n /** The font opacity as an accessor function or static number between 0 and 1. */\n fontOpacity?: Accessor<number>;\n /** The font stroke color for the rendered text. */\n fontStroke?: Accessor<string>;\n /** The font stroke width for the rendered text. */\n fontStrokeWidth?: Accessor<number>;\n /** The line height, which is 1.2 times the font size by default. */\n lineHeight?: Accessor<number>;\n /** Restricts the maximum number of lines to wrap onto; null (unlimited) by default. */\n maxLines?: Accessor<number | null>;\n /** Whether text is allowed to overflow its bounding box. */\n overflow?: Accessor<boolean>;\n /**\n Handles truncated lines, returning the new line value. Passed the line's\n text and number; by default appends an ellipsis to every line except a\n first word that cannot fit (which returns \"\").\n */\n ellipsis?: (text: string, line: number) => string;\n /** The padding as a CSS shorthand string or number. Defaults to 0. */\n padding?: Accessor<string | number>;\n /** The anchor point around which to rotate the text box. */\n rotateAnchor?: Accessor<[number, number]>;\n /** The word split function: given a string, returns it split into an array of words. */\n split?: (text: string) => string[];\n /** The width for each text box. */\n width?: Accessor<number>;\n /** The height for each text box. */\n height?: Accessor<number>;\n /** The x position (left edge) for each text box. */\n x?: Accessor<number>;\n /** The y position (top edge) for each text box. */\n y?: Accessor<number>;\n}\n\nexport interface TimelineConfig {\n /** Brush event filter. */\n brushFilter?: () => boolean;\n /**\n The minimum number of ticks that can be highlighted when using \"ticks\"\n `buttonBehavior`. Helpful for x/y plots where selecting fewer than 2 time\n periods is undesirable.\n */\n brushMin?: number;\n /** Toggles the horizontal alignment of the button timeline. */\n buttonAlign?: \"start\" | \"middle\" | \"end\";\n /** Toggles the style of the timeline. */\n buttonBehavior?: \"auto\" | \"buttons\" | \"ticks\";\n /** Button height. */\n buttonHeight?: number;\n /** Button padding. */\n buttonPadding?: number;\n /** Handle style. */\n handleConfig?: Record<string, unknown>;\n /** Handle size. */\n handleSize?: number;\n /**\n Determines the visibility of the play button to the left of the timeline,\n which cycles through the available periods at a rate set by `playButtonInterval`.\n */\n playButton?: boolean;\n /**\n The interval, in milliseconds, between periods when cycling via the play\n button. Used only when the chart's `duration` is 0 (no transition);\n otherwise playback steps once per `duration` so each step animates in full.\n */\n playButtonInterval?: number;\n /** The current selection. Defaults to the most recent period in the timeline. */\n selection?: (Date | number)[] | Date | number | false;\n /** Toggles the snapping value. */\n snapping?: boolean;\n}\n\nexport interface LegendConfig {\n /** The active method for all shapes. */\n active?: ((d: DataPoint, i?: number) => boolean) | false;\n /** The hover method for all shapes. */\n hover?: ((d: DataPoint, i?: number) => boolean) | false;\n /** The shape type used for each legend entry. */\n shape?: Accessor<string>;\n}\n\nexport interface SizeLegendConfig {\n /**\n The values to draw circles for: an array of values, how many to pick\n from the size domain (default 3: its min, max, and a round middle), or\n a function receiving the `[min, max]` domain and returning values.\n */\n values?: number[] | number | ((domain: [number, number]) => number[]);\n /** Formats each value's label. Defaults to the locale's abbreviated number format. */\n tickFormat?: (value: number) => string;\n /** Title above the circles. Defaults to the `size` key when `size` is set to a string. */\n title?: string;\n /** Circle paint: `fill`, `fillOpacity`, `stroke`, `strokeWidth`, `strokeOpacity`. */\n shapeConfig?: SizeLegendShapeConfig;\n /** Leader-line paint: `stroke`, `strokeWidth`, `strokeOpacity`, `strokeDasharray`. */\n lineConfig?: SizeLegendLineConfig;\n /** Value-label font: `fontColor`, `fontFamily`, `fontSize`. */\n labelConfig?: SizeLegendTextConfig;\n /** Title font: `fontColor`, `fontFamily`, `fontSize`, `fontWeight`. */\n titleConfig?: SizeLegendTextConfig;\n padding?: number;\n /** Length of the leader lines past the largest circle, in pixels. */\n lineLength?: number;\n /** Gap between each leader line and its label, in pixels. */\n labelPadding?: number;\n}\n\nexport interface TrendLineConfig {\n /** `\"series\"` (default) fits one line per series, colored to match it; `\"all\"` fits one line to every point. Stacked charts always fit the stack totals. */\n group?: \"series\" | \"all\";\n /** The polynomial degree when `trendLine` is `\"polynomial\"`. Defaults to 2. */\n order?: number;\n /** Draws a confidence band around a linear fit. Defaults to `false`. */\n confidence?: boolean;\n /** The confidence band's level, between 0 and 1. Defaults to 0.95. */\n confidenceLevel?: number;\n /** Area shape config for the confidence band. Its fill defaults to the line color. */\n confidenceConfig?: Record<string, unknown>;\n /**\n Extends each trend line past the end of its data: a number of steps (at the data's own spacing — the median gap between values, or the calendar interval of dates), or `{to}` an end value to step up to (a number, or on a time axis a Date or a parseable date such as a year). Widens the axis to fit. Ignored on a category axis. Defaults to `0` (off).\n */\n projection?: number | {to: number | string | Date};\n /** Line shape config for the projected stretch, merged over the line's own styles. Defaults to `{strokeDasharray: \"2 4\"}`. */\n projectionConfig?: Record<string, unknown>;\n /** Shows the fitted equation, R², and observations when hovering a line. Defaults to `true`. */\n tooltip?: boolean;\n /** Line color. Defaults to the series color (dark gray when `group` is `\"all\"`). */\n stroke?: string;\n /** Line width in pixels. Defaults to 2. */\n strokeWidth?: number;\n /** Line dash pattern. Defaults to `\"6 4\"`. */\n strokeDasharray?: string;\n /** Other Line shape config. */\n [key: string]: unknown;\n}\n\nexport interface ColorScaleConfig {\n /** The scale's colors: one color, expanded into a light→dark ramp, or an array of colors to step through. */\n color?: string | string[];\n /**\n For a linear scale, the `[min, max]` values used by the color scale; values\n outside this range map to the nearest color.\n */\n domain?: number[];\n /**\n Formats the label for each bucket in a bucket-type scale (\"jenks\",\n \"quantile\", …). Passed the bucket's start value, its index, the full\n bucket array, and every data value used to build the buckets.\n */\n bucketFormat?: (\n start: number,\n i: number,\n buckets: number[],\n values: number[],\n ) => string;\n /** Given a bucket's minimum and maximum values, returns the full label. */\n bucketJoiner?: (min: string, max: string) => string;\n}\n\n/** `colorDefaults` input: any subset of the color defaults, with `scale` also accepting an array of colors. */\nexport type ColorDefaultsConfig = Partial<Omit<ColorDefaults, \"scale\">> & {\n scale?: ColorDefaults[\"scale\"] | string[];\n};\n\nexport interface D3plusConfig {\n /** Data array or URL string to load data from. */\n data?: DataPoint[] | string;\n /** Locale code used for text and number formatting. */\n locale?: string;\n\n /** The active callback function for highlighting shapes. */\n active?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Custom aggregation functions keyed by data property. */\n aggs?: {[k: string]: (d: DataPoint[]) => unknown};\n /** Hides the SVG from assistive technology when true (`aria-hidden`). */\n ariaHidden?: boolean;\n /**\n Text (rendered as HTML — any valid HTML string works, including anchor\n links) shown in the chart's bottom-right corner, most often a map tile\n credit. `false` (the default) shows nothing. A credit wider than half\n the chart area collapses to a small \"ⓘ\" badge that expands on hover,\n focus, or click.\n */\n attribution?: string | boolean;\n /**\n Overrides the \"ⓘ\" badge a long attribution collapses to, which\n otherwise renders as an inline SVG. A string is used as the badge's\n raw HTML content; a mount function, `(el: HTMLElement) => void | (() =>\n void)`, is called once with the badge's reserved element so a live\n component (a React tree via `createRoot(el).render(...)`, or anything\n else imperative) can be mounted into it — return a cleanup function if\n there's teardown to do.\n */\n attributionIcon?: string | ((el: HTMLElement) => void | (() => void));\n /** CSS key/value pairs used to style the attribution text. */\n attributionStyle?: Record<string, unknown>;\n /** Additional CSS class name(s) applied to the back button, alongside the fixed `back-control` class. */\n backControlClassName?: string;\n /** Padding between bars in pixels. */\n barPadding?: number;\n /** The baseline for the x/y plot. */\n baseline?: number;\n /** Whether to cache the processed data between renders. */\n cache?: boolean;\n /** Overrides for the default colors used for data fills and legible text (see `colorDefaults` in @d3plus/color). */\n colorDefaults?: ColorDefaultsConfig;\n /** Treat a discrete color field as ordered: color it with a single-hue light→dark ramp instead of nominal categorical hues. */\n colorOrdinal?: boolean;\n /** Color scale key or custom color function. */\n colorScale?: string | ((d: number) => string);\n /** Configuration for the color scale component. */\n colorScaleConfig?: {\n axisConfig?: AxisConfig;\n centered?: boolean;\n colors?: string[];\n colorMin?: string;\n colorMid?: string;\n colorMax?: string;\n scale?: AxisScale;\n };\n /** Whether the color scale uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n colorScalePadding?: boolean | ((viz: VizBase) => boolean);\n /** Position of the color scale, `false` to hide it, or an accessor returning either. */\n colorScalePosition?: false | Position | (() => false | Position);\n /** Column key for matrix-style layouts. */\n column?: string;\n /**\n The confidence interval as `[lower, upper]` bounds — each given as an\n accessor function or a static data key (e.g. `[\"lci\", \"hci\"]`), or `false`\n to disable.\n */\n confidence?:\n | [\n string | ((d: DataPoint, i: number) => number),\n string | ((d: DataPoint, i: number) => number),\n ]\n | false;\n /**\n Paint for the shared tooltip's crosshair guide line (`stroke`,\n `strokeWidth`, `strokeDasharray`, `strokeOpacity`, …).\n */\n crosshairConfig?: Record<string, unknown>;\n /** Maximum number of data points to render before downsampling. */\n dataCutoff?: number;\n /** Active depth level for nested groupings. */\n depth?: number;\n /** Sets orientation of main category axis. */\n discrete?: \"x\" | \"y\";\n /** Default duration of transitions, in milliseconds. */\n duration?: number;\n /** Predicate filtering which data points are included, or false to disable. */\n filter?: ((d: DataPoint, i: number) => boolean) | false;\n /** Allows removing specific geographies from topojson file to improve zoom. */\n fitFilter?:\n | number\n | string\n | ((d: Record<string, unknown>) => boolean);\n /** Grouping key(s) or accessor function(s). */\n groupBy?:\n | string\n | string[]\n | ((d: DataPoint) => string | number)\n | ((d: DataPoint) => string | number)[];\n /** Padding between groups of bars in pixels. */\n groupPadding?: number;\n /** Overall height of the visualization in pixels. */\n height?: number;\n /** Color for legend shapes whose grouping is hidden (via legend click), or a `(datum, index)` accessor. */\n hiddenColor?: string | ((d: DataPoint, i: number) => string);\n /** Opacity for legend labels whose grouping is hidden (via legend click), or a `(datum, index)` accessor. */\n hiddenOpacity?: number | ((d: DataPoint, i: number) => number);\n /** The hover callback function for highlighting shapes on mouseover. */\n hover?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Persistently emphasizes matching marks (keep color) and grays the rest. */\n highlight?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Label accessor for shapes. */\n label?: string | string[] | false | AccessorFn;\n /**\n Controls legend visibility. Pass `false` to hide it, `true` to always\n show it, or a `(config, data) => boolean` accessor to decide dynamically\n — the chart defaults use an accessor to auto-hide the legend when it\n would be redundant.\n */\n legend?: boolean | ((config: D3plusConfig, arr: DataPoint[]) => boolean);\n /** Configuration for the legend component. */\n legendConfig?: {\n label?: DataPointAccessor<string>;\n /**\n Each item's swatch: `\"Rect\"` (a square), `\"Circle\"` (a dot), or `\"Line\"`\n (a dot with a short stroke through it). Defaults to the shape of the\n series it stands for: a dot for Circles, the line glyph for Lines, and\n a square for everything else.\n */\n shape?: \"Rect\" | \"Circle\" | \"Line\" | DataPointAccessor<string>;\n shapeConfig?: Record<string, string | number>;\n };\n /** Inverts legend click behavior (click hides / shift-click solos, or the reverse), or an accessor receiving the viz. */\n legendFilterInvert?: boolean | ((viz: VizBase) => boolean);\n /**\n Whether one legend may be drawn inside the empty space around the chart's\n marks instead of in a margin (size legend first, then legend, then\n colorScale), or an accessor receiving the resolved config. Defaults to `true`.\n */\n legendInset?: boolean | ((config: D3plusConfig) => boolean);\n /** Style of the semi-transparent box behind a legend drawn inside the chart. */\n legendInsetConfig?: {\n /** Box fill; defaults to the chart's background color. */\n fill?: string;\n fillOpacity?: number;\n stroke?: string;\n strokeWidth?: number;\n /** Corner radius. */\n rx?: number;\n /** Space between the box's edge and the legend inside it. */\n margin?: number;\n /** Space kept between the box and the chart's marks and edges. */\n padding?: number;\n };\n /** Whether the legend uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n legendPadding?: boolean | ((viz: VizBase) => boolean);\n /** Position of the legend, or an accessor returning it. */\n legendPosition?: Position | (() => Position);\n /** Custom sort comparator for legend items. */\n legendSort?: (a: DataPoint, b: DataPoint) => number;\n /** Tooltip configuration for legend items. */\n legendTooltip?: TooltipConfig;\n /** Whether to show labels on line charts. */\n lineLabels?: boolean;\n /** 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. */\n link?: LinkOption;\n /** Whether to show the loading message. */\n loadingMessage?: boolean;\n /** Custom HTML content for the loading indicator, or a function receiving the viz instance. */\n loadingHTML?: string | ((viz: VizBase) => string);\n /** Metric key for the visualization. */\n metric?: string;\n /** Shows a small overview + draggable-viewport minimap underneath the zoom controls once the chart is zoomed in. On by default whenever `zoom` is enabled. */\n minimap?: boolean;\n /** Additional CSS class name(s) applied to the minimap, alongside its fixed `d3plus-minimap`/etc. classes. */\n minimapClassName?: string;\n /** Custom HTML content shown when no data is supplied, or a function receiving the viz instance. */\n noDataHTML?: string | ((viz: VizBase) => string);\n /**\n Ocean color for geomaps (any CSS value including 'transparent'), or a\n `{light, dark}` pair chosen by the chart's backdrop. Defaults to the\n default basemap's own water colors.\n */\n ocean?: string | {light: string; dark: string};\n /** Event listeners keyed by event name. */\n on?: Record<string, (event: Event) => void>;\n /** Coordinate accessor for point-based geomaps. */\n point?: (d: DataPoint) => number[];\n /** Point size accessor for geomaps. */\n pointSize?: string | ((d: DataPoint) => number);\n /** Minimum point size for geomaps. */\n pointSizeMin?: number;\n /** Maximum point size for geomaps. */\n pointSizeMax?: number;\n /** Map projection name or function. */\n projection?: string | ((x: number, y: number) => [number, number]);\n /** Outer padding between the visualization edge and map shapes. */\n projectionPadding?: number | string;\n /** Rotation offset for the map projection center. */\n projectionRotate?: [number, number];\n /** Row key for matrix-style layouts. */\n row?: string;\n /** Scrollable container selector for tooltip positioning. */\n scrollContainer?: string | Window;\n /** Shows a top-left search button that expands into an input; typing highlights shapes whose label matches. On by default for every chart. */\n search?: boolean;\n /** Resolves the string the search box matches its typed term against, for a given datum. Defaults to the mark's resolved on-screen label. */\n searchAccessor?: (d: DataPoint, i: number) => string;\n /** Additional CSS class name(s) applied to the search toggle button and input, alongside the fixed `search-control` classes. */\n searchControlClassName?: string;\n /** Configuration for shape rendering. */\n shapeConfig?: {\n duration?: number;\n [key: string]: unknown;\n };\n /**\n A [sort comparator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\n that receives each shape class (e.g. \"Circle\", \"Line\") as its arguments.\n Shapes are drawn in groups by type, so this defines the layering order for\n all shapes of a given type.\n */\n shapeSort?: (a: string, b: string) => number;\n /** Size accessor key. */\n size?: string;\n /**\n Controls size-legend visibility — the nested-circle key drawn in the\n bottom-right corner of charts that size their marks. Shown by default\n whenever marks are sized by more than one value, unless it would take\n up more than a third of the chart's width or height; pass `true` to\n always show it, `false` to hide it, or a `(config, scale, size) =>\n boolean` accessor.\n */\n sizeLegend?:\n | boolean\n | ((config: D3plusConfig, scale: SizeLegendScale, size: SizeLegendSize) => boolean);\n /** Configuration for the size-legend component. */\n sizeLegendConfig?: SizeLegendConfig;\n /**\n Which margin the size legend claims in the bottom-right corner:\n `\"right\"` (default) keeps the chart's full height, `\"bottom\"` its full\n width.\n */\n sizeLegendPosition?: \"right\" | \"bottom\";\n /** Whether to stack series. */\n stacked?: boolean;\n /**\n Vertical offset applied to stacked series. One of `\"diverging\"`\n (default — positive and negative values split around zero), `\"none\"`,\n `\"expand\"` (normalize each stack to 100%), `\"silhouette\"` (streamgraph),\n or `\"wiggle\"` (minimize slope changes); or a custom offset function.\n */\n stackOffset?: string | ((series: number[][][], order: number[]) => void);\n /**\n Order of stacked series, from the bottom of the stack upward. Accepts a\n named order (`\"descending\"` [default] / `\"ascending\"` by summed value,\n `\"key\"` / `\"keyReverse\"` alphabetically, `\"none\"` / `\"data\"` for input\n order, or d3's `\"insideOut\"` / `\"appearance\"` / `\"reverse\"`), an Array of\n series keys for an explicit order, a value accessor, or a `{value, order}`\n config to rank series by an aggregate of any data field.\n */\n stackOrder?:\n | string\n | string[]\n | {value: string | ((d: DataPoint) => unknown); order?: \"ascending\" | \"descending\"}\n | ((d: DataPoint) => unknown);\n /** Subtitle text, or an accessor returning it. */\n subtitle?: string | ((data: DataPoint[]) => string);\n /** Whether the subtitle uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n subtitlePadding?: boolean | ((viz: VizBase) => boolean);\n /** Value accessor for treemaps and aggregation. */\n sum?: DataPointAccessor<number>;\n /** Accessible description applied to the root SVG (`<desc>`). */\n svgDesc?: string;\n /** Accessible title applied to the root SVG (`<title>`). */\n svgTitle?: string;\n /** Enables the top-left table-view toggle button, which swaps the chart for a static, scrollable `<table>` of its data. On by default for every chart. */\n tableView?: boolean;\n /** Additional CSS class name(s) applied to the `<table>` element rendered while in table view, alongside the fixed `d3plus-table-view-table` class. */\n tableViewClassName?: string;\n /** Additional CSS class name(s) applied to the table-view toggle button, alongside the fixed `table-view-control`/`table-view-toggle` classes. */\n tableViewControlClassName?: string;\n /** CSS key/value pairs styling the table-view toggle button. `false` removes all default styling. */\n tableViewControlStyle?: Record<string, unknown> | false;\n /** CSS key/value pairs styling the table-view toggle button while active (showing the data table). `false` removes all default styling. */\n tableViewControlStyleActive?: Record<string, unknown> | false;\n /** CSS key/value pairs styling the table-view toggle button on hover. `false` removes all default styling. */\n tableViewControlStyleHover?: Record<string, unknown> | false;\n /** Whether the data table shows a \"download CSV\" button, exporting its full (sorted, unpaginated) rows. On by default. */\n tableViewDownload?: boolean;\n /** Rows per page while in table view. `false` (or any non-positive number) disables pagination and shows every row on one page. */\n tableViewPageSize?: number | false;\n /** Whether the data table's column headers are clickable to sort (toggling asc/desc). On by default. */\n tableViewSort?: boolean;\n /** Threshold value for grouping small slices. */\n threshold?: number;\n /** Label for the threshold group, or a `(datum, index)` accessor. */\n thresholdName?: string | ((d: DataPoint, i: number) => string);\n /**\n URL template for XYZ map tiles, with `{z}`, `{x}`, `{y}` (and optional\n `{s}` subdomain) placeholders — or a `{light, dark}` pair, chosen by the\n chart's backdrop. Defaults to Esri's Light Gray and Dark Gray Canvas.\n */\n tileUrl?: string | {light: string; dark: string};\n /** Whether to show map tiles. */\n tiles?: boolean;\n /** Time key for temporal data. */\n time?: string;\n /** Predicate filtering which time slices are shown, or false to disable. */\n timeFilter?: ((d: DataPoint, i: number) => boolean) | false;\n /** Whether to show the timeline component. */\n timeline?: boolean;\n /** Whether the timeline uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n timelinePadding?: boolean | ((viz: VizBase) => boolean);\n /** Chart title or title accessor function. */\n title?: string | ((data: DataPoint[]) => string);\n /** CSS style configuration for the title. */\n titleConfig?: Record<string, string | number>;\n /** Whether the title uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n titlePadding?: boolean | ((viz: VizBase) => boolean);\n /** Whether to show tooltips, or a `(datum, index)` accessor deciding per mark. */\n tooltip?: boolean | ((d: DataPoint, i: number) => boolean);\n /** Configuration for the tooltip component. */\n tooltipConfig?: TooltipConfig;\n /**\n Whether hovering a Plot's plot area shows one tooltip listing every\n series' value at the nearest discrete-axis position, with a crosshair\n through it. Applies when a discrete axis is set and at least two series\n share that position.\n */\n tooltipShared?: boolean;\n /**\n Draws an automatic trend line fit to the plotted data: `true` (or\n `\"linear\"`) for a least-squares line, or `\"exponential\"`,\n `\"logarithmic\"`, `\"power\"`, or `\"polynomial\"`. `false` removes it.\n */\n trendLine?: boolean | \"linear\" | \"exponential\" | \"logarithmic\" | \"power\" | \"polynomial\";\n /**\n Options for the trend lines: `group` (`\"series\"` or `\"all\"`), the\n polynomial `order`, a `confidence` band with `confidenceLevel` and\n `confidenceConfig`, a `projection` into the future with\n `projectionConfig`, `tooltip`, and Line styles (`stroke`,\n `strokeWidth`, `strokeDasharray`, …).\n */\n trendLineConfig?: TrendLineConfig;\n /** Path or object for the topojson data. */\n topojson?: string | object;\n /** CSS color to fill the map shapes. */\n topojsonFill?: string;\n /** Accessor function for topojson feature IDs. */\n topojsonId?: (obj: Record<string, unknown>) => string;\n /** Whether the total uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n totalPadding?: boolean | ((viz: VizBase) => boolean);\n /** Value accessor for the visualization. */\n value?: DataPointAccessor<number>;\n /** Overall width of the visualization in pixels. */\n width?: number;\n /** Key, index, or accessor function for x-axis values. */\n x?: string | number | ((d: DataPoint, i: number) => unknown);\n /** Configuration for the x-axis. */\n xConfig?: AxisConfig;\n /** The x domain as an array. If either value is undefined, it is calculated from the data. */\n xDomain?: (number | Date)[];\n /** The x2 domain as an array. If either value is undefined, it is calculated from the data. */\n x2Domain?: (number | Date)[];\n /** Custom sort function for x-axis values. */\n xSort?: (a: DataPoint, b: DataPoint) => number;\n /** Defines a custom sorting comparator function for discrete x2 axes. */\n x2Sort?: (a: DataPoint, b: DataPoint) => number;\n /** Key, index, or accessor function for y-axis values. */\n y?: string | number | ((d: DataPoint, i: number) => unknown);\n /** Configuration for the y-axis. */\n yConfig?: AxisConfig;\n /** The y domain as an array. If either value is undefined, it is calculated from the data. */\n yDomain?: (number | Date)[];\n /** The y2 domain as an array. If either value is undefined, it is calculated from the data. */\n y2Domain?: (number | Date)[];\n /** Custom sort function for y-axis values. */\n ySort?: (a: DataPoint, b: DataPoint) => number;\n /** Defines a custom sorting comparator function for discrete y2 axes. */\n y2Sort?: (a: DataPoint, b: DataPoint) => number;\n /** Enables pan/zoom with zoom-control buttons. On by default for every chart. */\n zoom?: boolean;\n /** Additional CSS class name(s) applied to each zoom control button, alongside the fixed `zoom-control`/`zoom-in`/etc. classes. */\n zoomControlClassName?: string;\n /**\n Overrides one or more of the four built-in zoom-control icons (`zoomIn`,\n `zoomOut`, `zoomReset`, `zoomBrush`), which otherwise render as inline\n SVGs. Each value is either raw HTML — used as that button's content — or\n a mount function, `(el: HTMLElement) => void | (() => void)`, called\n once with the button's reserved icon slot so a live component (a React\n tree via `createRoot(el).render(...)`, or anything else imperative) can\n be mounted into it — return a cleanup function if there's teardown to do.\n */\n zoomControlIcons?: Partial<\n Record<\n \"zoomIn\" | \"zoomOut\" | \"zoomReset\" | \"zoomBrush\",\n string | ((el: HTMLElement) => void | (() => void))\n >\n >;\n /** Multiplier applied to programmatic zoom steps. */\n zoomFactor?: number;\n /** Maximum zoom scale factor. Defaults to the scale at which the smallest shape fills the chart area. */\n zoomMax?: number;\n /** Whether panning (drag) is enabled while zoomed. */\n zoomPan?: boolean;\n /**\n Whether the mouse wheel (and one-finger touch) zooms. `\"modifier\"` (the\n default) leaves page scrolling alone: only\n Ctrl/⌘ + wheel or a trackpad/two-finger pinch zooms, and one finger pans\n only once zoomed in. `true` zooms on any wheel; `false` never does.\n */\n zoomScroll?: boolean | \"modifier\";\n\n /** Allows additional custom properties. */\n [key: string]: unknown;\n}\n"],"names":[],"mappings":"AAsUA,WA+ZC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/RESET.ts"],"sourcesContent":["/** String constant used to reset an individual config property. */\nconst RESET: string = \"D3PLUS-COMMON-RESET\";\nexport default RESET;\n"],"names":["RESET"],"mappings":"AAAA,iEAAiE,GACjE,IAAMA,QAAgB;AACtB,eAAeA,MAAM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/accessor.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\n\n/**\n Wraps an object key in a simple accessor function.\n @param key The key to be returned from each Object passed to the function.\n @param def A default value to be returned if the key is not present.\n @example <caption>this</caption>\naccessor(\"id\");\n @example <caption>returns this</caption>\nfunction(d) {\n return d[\"id\"];\n}\n*/\nexport default function accessor(\n key: string,\n def?: DataPoint[keyof DataPoint],\n): (d: DataPoint) => DataPoint[keyof DataPoint] {\n if (def === undefined) return (d: DataPoint) => d[key];\n return (d: DataPoint) => (d[key] === undefined ? def : d[key]);\n}\n"],"names":["accessor","key","def","undefined","d"],"mappings":"AAEA;;;;;;;;;;AAUA,GACA,eAAe,SAASA,SACtBC,GAAW,EACXC,GAAgC;IAEhC,IAAIA,QAAQC,WAAW,OAAO,SAACC;eAAiBA,CAAC,CAACH,IAAI;;IACtD,OAAO,SAACG;eAAkBA,CAAC,CAACH,IAAI,KAAKE,YAAYD,MAAME,CAAC,CAACH,IAAI;;AAC/D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/configDefault.ts"],"sourcesContent":["const defaults = new WeakSet<object>();\n\n/**\n Marks a config function seeded by the library itself, so code that layers\n config can tell it apart from one the user set.\n @private\n*/\nexport function markDefault<T extends object>(value: T): T {\n defaults.add(value);\n return value;\n}\n\n/**\n Whether a config value is one registered with `markDefault`.\n @private\n*/\nexport function isDefault(value: unknown): boolean {\n return typeof value === \"function\" && defaults.has(value);\n}\n"],"names":["defaults","WeakSet","markDefault","value","add","isDefault","has"],"mappings":"AAAA,IAAMA,WAAW,IAAIC;AAErB;;;;AAIA,GACA,OAAO,SAASC,YAA8BC,KAAQ;IACpDH,SAASI,GAAG,CAACD;IACb,OAAOA;AACT;AAEA;;;AAGA,GACA,OAAO,SAASE,UAAUF,KAAc;IACtC,OAAO,OAAOA,UAAU,cAAcH,SAASM,GAAG,CAACH;AACrD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/configPrep.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\nimport { D3plusConfig } from \"./D3plusConfig.js\";\nimport {markSharedConfig} from \"./configWarnings.js\";\n\ninterface D3PlusWrapped {\n __d3plus__?: boolean;\n __d3plusParent__?: D3PlusWrapped;\n data?: DataPoint;\n feature?: DataPoint;\n i?: number;\n [key: string]: unknown;\n}\n\ntype DataAccessor = (\n d: DataPoint,\n i: number,\n s?: D3PlusWrapped,\n e?: Event,\n) => DataPoint[keyof DataPoint];\ntype ConfigValue =\n | DataAccessor\n | string\n | number\n | boolean\n | ConfigObject\n | ConfigValue[];\ninterface ConfigObject extends D3plusConfig {\n [key: string]: unknown;\n}\n\nexport interface VizContext {\n schema: {\n shapeConfig: ConfigObject;\n duration?: number;\n on?: Record<string, DataAccessor>;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\n/**\n Preps a config object for d3plus data, and optionally bubbles up a specific nested type. When using this function, you must bind a d3plus class' `this` context.\n @param config The configuration object to parse.\n @param type The event classifier to user for \"on\" events. For example, the default event type of \"shape\" will apply all events in the \"on\" config object with that key, like \"click.shape\" and \"mouseleave.shape\", in addition to any gloval events like \"click\" and \"mouseleave\".\n @param nest An optional nested key to bubble up to the parent config level.\n*/\nexport default function configPrep(\n this: VizContext,\n config: ConfigObject = this.schema.shapeConfig,\n type: string = \"shape\",\n nest: string | false = false,\n): ConfigObject {\n const newConfig: ConfigObject = {\n duration: this.schema.duration,\n on: {},\n };\n\n const wrapFunction =\n (func: DataAccessor) =>\n (\n d: DataPoint | D3PlusWrapped,\n i: number,\n s?: D3PlusWrapped,\n e?: Event,\n ): DataPoint[keyof DataPoint] => {\n if (!func) return func as unknown as DataPoint[keyof DataPoint];\n let parent: D3PlusWrapped | undefined;\n while ((d as D3PlusWrapped).__d3plus__) {\n if (parent) (d as D3PlusWrapped).__d3plusParent__ = parent;\n parent = d as D3PlusWrapped;\n i = (d as D3PlusWrapped).i!;\n d = ((d as D3PlusWrapped).data || (d as D3PlusWrapped).feature)!;\n }\n return func.bind(this)(d as DataPoint, i, s || parent, e);\n };\n\n const parseEvents = (\n newObj: ConfigObject,\n on: Record<string, DataAccessor>,\n ): void => {\n for (const event in on) {\n if (\n ({}.hasOwnProperty.call(on, event) && !event.includes(\".\")) ||\n event.includes(`.${type}`)\n ) {\n (newObj.on as unknown as Record<string, DataAccessor>)[event] = wrapFunction(on[event]);\n }\n }\n };\n\n const arrayEval = (arr: ConfigValue[]): ConfigValue[] =>\n arr.map((d: ConfigValue) => {\n if (d instanceof Array) return arrayEval(d);\n else if (typeof d === \"object\")\n return keyEval({} as ConfigObject, d as ConfigObject);\n else if (typeof d === \"function\") return wrapFunction(d as DataAccessor);\n else return d;\n });\n\n const keyEval = (newObj: ConfigObject, obj: ConfigObject): ConfigObject => {\n for (const key in obj) {\n if ({}.hasOwnProperty.call(obj, key)) {\n if (key === \"on\")\n parseEvents(newObj, obj[key] as unknown as Record<string, DataAccessor>);\n else if (key === \"sort\")\n // `sort` is a two-argument layering comparator, not a per-datum\n // accessor — pass it through untouched so `wrapFunction` doesn't\n // rewrite it into a single-datum call (which would feed the index\n // as its second argument).\n newObj[key] = obj[key];\n else if (typeof obj[key] === \"function\") {\n newObj[key] = wrapFunction(obj[key] as DataAccessor);\n } else if (obj[key] instanceof Array) {\n newObj[key] = arrayEval(obj[key] as ConfigValue[]);\n } else if (typeof obj[key] === \"object\") {\n if (!newObj[key]) newObj[key] = {} as ConfigObject;\n (newObj[key] as ConfigObject).on = {};\n keyEval(newObj[key] as ConfigObject, obj[key] as ConfigObject);\n } else newObj[key] = obj[key];\n }\n }\n\n return newObj;\n };\n\n keyEval(newConfig, config);\n if (this.schema.on) parseEvents(newConfig, this.schema.on as unknown as Record<string, DataAccessor>);\n if (nest && config[nest]) {\n keyEval(newConfig, config[nest] as ConfigObject);\n if ((config[nest] as ConfigObject).on)\n parseEvents(newConfig, (config[nest] as ConfigObject).on as unknown as Record<string, DataAccessor>);\n }\n\n return markSharedConfig(newConfig);\n}\n"],"names":["markSharedConfig","configPrep","config","schema","shapeConfig","type","nest","newConfig","duration","on","wrapFunction","func","d","i","s","e","parent","__d3plus__","__d3plusParent__","data","feature","bind","parseEvents","newObj","event","hasOwnProperty","call","includes","arrayEval","arr","map","Array","keyEval","obj","key"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/configWarnings.ts"],"sourcesContent":["const shared = new WeakSet<object>();\nconst warned = new Set<string>();\nlet enabled = true;\n\n/**\n Toggles the console warnings d3plus logs when a class receives a config\n property it does not support (like a misspelled key passed to `.config()`\n or `shapeConfig`). Warnings are on by default and the setting applies to\n every chart on the page. With no argument, returns the current setting.\n\n@example\nimport {configWarnings} from \"@d3plus/core\";\nconfigWarnings(false);\n*/\nexport function configWarnings(): boolean;\nexport function configWarnings(_: boolean): void;\nexport function configWarnings(_?: boolean): boolean | void {\n if (!arguments.length) return enabled;\n enabled = !!_;\n}\n\n/**\n Marks a config object as shared across several classes, so keys meant for\n other targets (like a `shapeConfig` carrying both `r` and `width`) are\n applied where supported without `BaseClass.config()` warning about the rest.\n @private\n*/\nexport function markSharedConfig<T extends object>(config: T): T {\n shared.add(config);\n return config;\n}\n\n/** @private */\nexport function isSharedConfig(config: unknown): boolean {\n return typeof config === \"object\" && config !== null && shared.has(config);\n}\n\n/**\n Warns that `owner` was given a config key it does not support. Each message\n is logged once, so re-renders (and framework wrappers re-applying the same\n config) don't flood the console.\n @private\n*/\nexport function warnUnknownConfig(owner: string, key: string): void {\n if (!enabled) return;\n const message = `${owner} received unknown property \"${key}\".`;\n if (warned.has(message)) return;\n warned.add(message);\n console.warn(message);\n}\n"],"names":["shared","WeakSet","warned","Set","enabled","configWarnings","_","arguments","length","markSharedConfig","config","add","isSharedConfig","has","warnUnknownConfig","owner","key","message","console","warn"],"mappings":";;;;AAAA,IAAMA,SAAS,IAAIC;AACnB,IAAMC,SAAS,IAAIC;AACnB,IAAIC,UAAU;AAcd,OAAO,SAASC,eAAeC,CAAW;IACxC,IAAI,CAACC,UAAUC,MAAM,EAAE,OAAOJ;IAC9BA,UAAU,CAAC,CAACE;AACd;AAEA;;;;;AAKA,GACA,OAAO,SAASG,iBAAmCC,MAAS;IAC1DV,OAAOW,GAAG,CAACD;IACX,OAAOA;AACT;AAEA,aAAa,GACb,OAAO,SAASE,eAAeF,MAAe;IAC5C,OAAO,CAAA,OAAOA,uCAAP,SAAOA,OAAK,MAAM,YAAYA,WAAW,QAAQV,OAAOa,GAAG,CAACH;AACrE;AAEA;;;;;AAKA,GACA,OAAO,SAASI,kBAAkBC,KAAa,EAAEC,GAAW;IAC1D,IAAI,CAACZ,SAAS;IACd,IAAMa,UAAU,AAAC,GAAsCD,OAApCD,OAAM,gCAAkC,OAAJC,KAAI;IAC3D,IAAId,OAAOW,GAAG,CAACI,UAAU;IACzBf,OAAOS,GAAG,CAACM;IACXC,QAAQC,IAAI,CAACF;AACf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/constant.ts"],"sourcesContent":["/**\n Wraps non-function variables in a simple return function.\n @param value The value to wrap in a return function.\n @example <caption>this</caption>\nconstant(42);\n @example <caption>returns this</caption>\nfunction() {\n return 42;\n}\n*/\nexport default function <T>(value: T): () => T {\n return function constant(): T {\n return value;\n };\n}\n"],"names":["value","constant"],"mappings":"AAAA;;;;;;;;;AASA,GACA,eAAe,SAAaA,KAAQ;IAClC,OAAO,SAASC;QACd,OAAOD;IACT;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/getProp.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\n\n/**\n @module getProp\n @param type\n @param d\n @param i\n @private\n*/\nexport default function getProp(\n this: {schema: Record<string, (d: DataPoint, i: number) => DataPoint[keyof DataPoint]>},\n type: string,\n d: DataPoint,\n i: number,\n): DataPoint[keyof DataPoint] {\n return d[type] || this.schema[type](d, i);\n}\n"],"names":["getProp","type","d","i","schema"],"mappings":"AAEA;;;;;;AAMA,GACA,eAAe,SAASA,QAEtBC,IAAY,EACZC,CAAY,EACZC,CAAS;IAET,OAAOD,CAAC,CAACD,KAAK,IAAI,IAAI,CAACG,MAAM,CAACH,KAAK,CAACC,GAAGC;AACzC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["export type {AccessorFn} from \"./AccessorFn.js\";\nexport {default as accessor} from \"./accessor.js\";\nexport {default as BaseClass} from \"./BaseClass.js\";\nexport type {\n D3plusConfig,\n AxisConfig,\n ColorDefaultsConfig,\n ColorScaleConfig,\n LegendConfig,\n SizeLegendConfig,\n TextBoxConfig,\n TimelineConfig,\n TooltipConfig,\n TrendLineConfig,\n} from \"./D3plusConfig.js\";\nexport type {D3Scale} from \"./D3Scale.js\";\nexport {default as configPrep} from \"./configPrep.js\";\nexport {configWarnings} from \"./configWarnings.js\";\nexport {default as constant} from \"./constant.js\";\nexport {default as getProp} from \"./getProp.js\";\nexport {paintComponentScene} from \"./paintComponentScene.js\";\nexport {default as RESET} from \"./RESET.js\";\n"],"names":["default","accessor","BaseClass","configPrep","configWarnings","constant","getProp","paintComponentScene","RESET"],"mappings":"AACA,SAAQA,WAAWC,QAAQ,QAAO,gBAAgB;AAClD,SAAQD,WAAWE,SAAS,QAAO,iBAAiB;AAcpD,SAAQF,WAAWG,UAAU,QAAO,kBAAkB;AACtD,SAAQC,cAAc,QAAO,sBAAsB;AACnD,SAAQJ,WAAWK,QAAQ,QAAO,gBAAgB;AAClD,SAAQL,WAAWM,OAAO,QAAO,eAAe;AAChD,SAAQC,mBAAmB,QAAO,2BAA2B;AAC7D,SAAQP,WAAWQ,KAAK,QAAO,aAAa"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/paintComponentScene.ts"],"sourcesContent":["/**\n Standalone scene paint for the BaseClass-derived components (Axis, Legend,\n ColorScale).\n\n When one of these components is composed inside a Viz it runs in\n `renderMode(\"compute\")` and the Viz reads its `toScene()` into the chart\n scene — nothing here is used. When it is rendered on its own (e.g. the\n `@d3plus/react` `<Axis>`/`<Legend>`/`<ColorScale>` wrappers, or a bare\n `new Axis().select(svg).render()`), `render()` only computes layout; no\n backend paints the resulting scene. This mounts an SvgRenderer into the\n component's `_select` and draws its scene, reusing the renderer instance\n across re-renders.\n*/\n\nimport {SvgRenderer} from \"@d3plus/render\";\nimport type {GroupNode, Scene} from \"@d3plus/render\";\n\ninterface SceneComponent {\n _select?: {node: () => import(\"d3-selection\").BaseType | null};\n _sceneRenderer?: SvgRenderer;\n schema: {width?: number; height?: number};\n toScene: () => GroupNode;\n}\n\nexport function paintComponentScene(instance: SceneComponent): void {\n const sel = instance._select;\n const node =\n sel && typeof sel.node === \"function\" ? sel.node() : null;\n if (!(node instanceof Element)) return;\n const container: Element = node;\n\n const width = instance.schema.width ?? 400;\n const height = instance.schema.height ?? 200;\n\n if (!instance._sceneRenderer) {\n instance._sceneRenderer = new SvgRenderer();\n instance._sceneRenderer.mount({container, width, height});\n } else {\n instance._sceneRenderer.resize(width, height);\n }\n\n // Wrap the component's group in a synthetic root so the renderer reconciles\n // it as a child (preserving the group's own key/transform); `drawScene`\n // only iterates `scene.root.children`.\n const scene: Scene = {\n root: {type: \"group\", key: \"root\", children: [instance.toScene()]},\n width,\n height,\n };\n instance._sceneRenderer.drawScene(scene, {duration: 0});\n}\n"],"names":["SvgRenderer","paintComponentScene","instance","sel","_select","node","Element","container","width","schema","height","_sceneRenderer","mount","resize","scene","root","type","key","children","toScene","drawScene","duration"],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;AAYA,GAEA,SAAQA,WAAW,QAAO,iBAAiB;AAU3C,OAAO,SAASC,oBAAoBC,QAAwB;QAO5CA,wBACCA;IAPf,IAAMC,MAAMD,SAASE,OAAO;IAC5B,IAAMC,OACJF,OAAO,OAAOA,IAAIE,IAAI,KAAK,aAAaF,IAAIE,IAAI,KAAK;IACvD,IAAI,CAAEA,AAAI,YAAJA,MAAgBC,UAAU;IAChC,IAAMC,YAAqBF;IAE3B,IAAMG,SAAQN,yBAAAA,SAASO,MAAM,CAACD,KAAK,cAArBN,oCAAAA,yBAAyB;IACvC,IAAMQ,UAASR,0BAAAA,SAASO,MAAM,CAACC,MAAM,cAAtBR,qCAAAA,0BAA0B;IAEzC,IAAI,CAACA,SAASS,cAAc,EAAE;QAC5BT,SAASS,cAAc,GAAG,IAAIX;QAC9BE,SAASS,cAAc,CAACC,KAAK,CAAC;YAACL,WAAAA;YAAWC,OAAAA;YAAOE,QAAAA;QAAM;IACzD,OAAO;QACLR,SAASS,cAAc,CAACE,MAAM,CAACL,OAAOE;IACxC;IAEA,4EAA4E;IAC5E,wEAAwE;IACxE,uCAAuC;IACvC,IAAMI,QAAe;QACnBC,MAAM;YAACC,MAAM;YAASC,KAAK;YAAQC,UAAU;gBAAChB,SAASiB,OAAO;aAAG;QAAA;QACjEX,OAAAA;QACAE,QAAAA;IACF;IACAR,SAASS,cAAc,CAACS,SAAS,CAACN,OAAO;QAACO,UAAU;IAAC;AACvD"}
|
package/es/umd-entry.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
UMD/CDN bundle entry — superset of the ESM entry.
|
|
3
|
-
|
|
4
|
-
The typed ESM API is intentionally curated: `@d3plus/core` exposes the
|
|
5
|
-
stable public surface (`./index.ts`) and the v4 pipeline lives behind the
|
|
6
|
-
opt-in `@d3plus/core/internal` subpath (`./internal.ts`). The standalone
|
|
7
|
-
UMD global (`window.d3plus`) has no `.d.ts` and is a convenience build, so
|
|
8
|
-
it carries both — advanced/browser consumers and the in-browser parity
|
|
9
|
-
tests can reach the pipeline through the same global.
|
|
10
|
-
|
|
11
|
-
This file is the rollup input for the UMD build only; it is not part of
|
|
12
|
-
the package's `exports` map.
|
|
13
|
-
*/ export * from "./index.js";
|
|
14
|
-
export * from "./internal.js";
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=umd-entry.js.map
|
package/es/umd-entry.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../umd-entry.ts"],"sourcesContent":["/**\n UMD/CDN bundle entry — superset of the ESM entry.\n\n The typed ESM API is intentionally curated: `@d3plus/core` exposes the\n stable public surface (`./index.ts`) and the v4 pipeline lives behind the\n opt-in `@d3plus/core/internal` subpath (`./internal.ts`). The standalone\n UMD global (`window.d3plus`) has no `.d.ts` and is a convenience build, so\n it carries both — advanced/browser consumers and the in-browser parity\n tests can reach the pipeline through the same global.\n\n This file is the rollup input for the UMD build only; it is not part of\n the package's `exports` map.\n*/\nexport * from \"./index.js\";\nexport * from \"./internal.js\";\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;AAYA,GACA,cAAc,aAAa;AAC3B,cAAc,gBAAgB"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { default as Plot } from "./Plot.js";
|
|
2
|
-
/**
|
|
3
|
-
Creates an area plot based on an array of data.
|
|
4
|
-
@example <caption>the equivalent of calling:</caption>
|
|
5
|
-
new d3plus.Plot()
|
|
6
|
-
.baseline(0)
|
|
7
|
-
.discrete("x")
|
|
8
|
-
.shape("Area")
|
|
9
|
-
*/
|
|
10
|
-
export default class AreaPlot extends Plot {
|
|
11
|
-
/**
|
|
12
|
-
Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
|
|
13
|
-
@private
|
|
14
|
-
*/
|
|
15
|
-
constructor();
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { default as Plot } from "./Plot.js";
|
|
2
|
-
/**
|
|
3
|
-
Creates a bar chart based on an array of data.
|
|
4
|
-
@example <caption>the equivalent of calling:</caption>
|
|
5
|
-
new d3plus.Plot()
|
|
6
|
-
.baseline(0)
|
|
7
|
-
.discrete("x")
|
|
8
|
-
.shape("Bar")
|
|
9
|
-
*/
|
|
10
|
-
export default class BarChart extends Plot {
|
|
11
|
-
/**
|
|
12
|
-
Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
|
|
13
|
-
@private
|
|
14
|
-
*/
|
|
15
|
-
constructor();
|
|
16
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { default as Plot } from "./Plot.js";
|
|
2
|
-
/**
|
|
3
|
-
Creates a simple box and whisker based on an array of data.
|
|
4
|
-
*/
|
|
5
|
-
export default class BoxWhisker extends Plot {
|
|
6
|
-
/**
|
|
7
|
-
Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
|
|
8
|
-
@private
|
|
9
|
-
*/
|
|
10
|
-
constructor();
|
|
11
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { default as Plot } from "./Plot.js";
|
|
2
|
-
/**
|
|
3
|
-
Creates a bump chart based on an array of data.
|
|
4
|
-
@example <caption>the equivalent of calling:</caption>
|
|
5
|
-
new d3plus.Plot()
|
|
6
|
-
.discrete("x")
|
|
7
|
-
.shape("Line")
|
|
8
|
-
.y2(d => this._y(d))
|
|
9
|
-
.yConfig({
|
|
10
|
-
tickFormat: val => {
|
|
11
|
-
const data = this._formattedData;
|
|
12
|
-
const xDomain = this._xDomain;
|
|
13
|
-
const startData = data.filter(d => d.x === xDomain[0]);
|
|
14
|
-
const d = startData.find(d => d.y === val);
|
|
15
|
-
return this._drawLabel(d, d.i);
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
.y2Config({
|
|
19
|
-
tickFormat: val => {
|
|
20
|
-
const data = this._formattedData;
|
|
21
|
-
const xDomain = this._xDomain;
|
|
22
|
-
const endData = data.filter(d => d.x === xDomain[xDomain.length - 1]);
|
|
23
|
-
const d = endData.find(d => d.y === val);
|
|
24
|
-
return this._drawLabel(d, d.i);
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
.ySort((a, b) => b.y - a.y)
|
|
28
|
-
.y2Sort((a, b) => b.y - a.y)
|
|
29
|
-
*/
|
|
30
|
-
export default class BumpChart extends Plot {
|
|
31
|
-
/**
|
|
32
|
-
Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
|
|
33
|
-
@private
|
|
34
|
-
*/
|
|
35
|
-
constructor();
|
|
36
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
`ChartDefinition` — charts as *values*, not classes.
|
|
3
|
-
|
|
4
|
-
A chart in v4 is the def value `{name, fields?, ctx?, features, stages,
|
|
5
|
-
layoutStage?, emit, chartTransform?, setup?, thresholdFunction?}`. Each
|
|
6
|
-
chart's def lives next to its applyLayout + emit in `./<ChartName>/`;
|
|
7
|
-
`makeChart(def, Base?)` produces the chart class from the def.
|
|
8
|
-
*/
|
|
9
|
-
import type { SceneNode } from "@d3plus/render";
|
|
10
|
-
import type { FeatureModule } from "./features.js";
|
|
11
|
-
import type { TransformStage, VizContext } from "./stages.js";
|
|
12
|
-
import type { VizInstance } from "./vizTypes.js";
|
|
13
|
-
interface ChartDefinitionBase {
|
|
14
|
-
/** Stable name for tagging and class generation. */
|
|
15
|
-
name: string;
|
|
16
|
-
/** Chart-internal scratch seeded onto `viz.ctx.<key>` at construction. */
|
|
17
|
-
ctx?: Record<string, unknown>;
|
|
18
|
-
/**
|
|
19
|
-
Scalar defaults seeded onto `viz._<key>` at construction. Defs that
|
|
20
|
-
need instance slots keep them here; user-facing values otherwise go
|
|
21
|
-
in `fields[].default` and chart-internal scratch in `ctx`.
|
|
22
|
-
*/
|
|
23
|
-
defaults?: Record<string, unknown>;
|
|
24
|
-
/** Fluent accessor declarations; `makeChart` installs each as `viz.<key>()`. */
|
|
25
|
-
fields?: import("../fluent.js").ConfigField[];
|
|
26
|
-
/** Chart-level features composed in; order is layout order. */
|
|
27
|
-
features: FeatureModule[];
|
|
28
|
-
/**
|
|
29
|
-
Chart-specific layout stage run in `_draw` after the shared chart-shell
|
|
30
|
-
prep (`vizPreDrawPure`). If absent, `makeChart` doesn't invoke
|
|
31
|
-
`runChartDraw` — the chart relies on its parent's `_draw` only.
|
|
32
|
-
*/
|
|
33
|
-
layoutStage?: TransformStage;
|
|
34
|
-
/** Optional pure threshold algorithm (replaces `Viz._thresholdFunction`). */
|
|
35
|
-
thresholdFunction?: (viz: VizInstance, data: unknown[]) => unknown[];
|
|
36
|
-
/**
|
|
37
|
-
Optional chart-specific `_chartTransform` builder. Receives the viz
|
|
38
|
-
after the layout stage runs; returns the transform applied to the
|
|
39
|
-
chart scene. Default: margin-origin translation.
|
|
40
|
-
*/
|
|
41
|
-
chartTransform?: (viz: VizInstance) => import("@d3plus/render").Transform | undefined;
|
|
42
|
-
/**
|
|
43
|
-
Imperative per-instance setup hook — runs once after `applyDefinition`
|
|
44
|
-
seeds the chart. Use for event handler overrides and shadowed methods
|
|
45
|
-
that don't fit the declarative `fields`/`ctx` surface.
|
|
46
|
-
*/
|
|
47
|
-
setup?: (viz: VizInstance) => void;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
A data-driven chart's emit: a pure function from a chart context (with
|
|
51
|
-
optional laid-out `shapeData`) to the scene nodes for one frame.
|
|
52
|
-
*/
|
|
53
|
-
export type ChartEmit = (ctx: VizContext & {
|
|
54
|
-
shapeData?: any[];
|
|
55
|
-
}) => SceneNode[];
|
|
56
|
-
/** Data-driven chart: `emit(ctx)` produces the scene nodes. */
|
|
57
|
-
export interface DataDrivenChartDefinition extends ChartDefinitionBase {
|
|
58
|
-
paintDriven?: false;
|
|
59
|
-
emit: ChartEmit;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
Paint-driven chart: `Plot._paint` populates `viz._chartScene` by calling
|
|
63
|
-
`plotPaint`, which builds the scene from the paint context assembled in
|
|
64
|
-
`drawPlot`. There is no `emit` step — `runChartDraw` refuses to drive
|
|
65
|
-
paint-driven defs (see runChartDraw.ts), so the scene is produced entirely
|
|
66
|
-
inside the Plot draw flow.
|
|
67
|
-
*/
|
|
68
|
-
export interface PaintDrivenChartDefinition extends ChartDefinitionBase {
|
|
69
|
-
paintDriven: true;
|
|
70
|
-
}
|
|
71
|
-
/** Discriminated union; use `isPaintDriven` to narrow. */
|
|
72
|
-
export type ChartDefinition = DataDrivenChartDefinition | PaintDrivenChartDefinition;
|
|
73
|
-
/** Type guard for the paint-driven variant. */
|
|
74
|
-
export declare function isPaintDriven(def: ChartDefinition): def is PaintDrivenChartDefinition;
|
|
75
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { default as Pie } from "./Pie.js";
|
|
2
|
-
/**
|
|
3
|
-
Extends the Pie visualization to create a donut chart.
|
|
4
|
-
*/
|
|
5
|
-
export default class Donut extends Pie {
|
|
6
|
-
/**
|
|
7
|
-
Invoked when creating a new class instance, and sets any default parameters.
|
|
8
|
-
@private
|
|
9
|
-
*/
|
|
10
|
-
constructor();
|
|
11
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { zoomTransform } from "d3-zoom";
|
|
2
|
-
import type { DataPoint } from "@d3plus/data";
|
|
3
|
-
import Viz from "./Viz.js";
|
|
4
|
-
/**
|
|
5
|
-
Creates a geographical map with zooming, panning, image tiles, and the ability to layer choropleth paths and coordinate points. See [this example](https://d3plus.org/examples/d3plus-geomap/getting-started/) for help getting started.
|
|
6
|
-
*/
|
|
7
|
-
export default class Geomap extends Viz {
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
/**
|
|
10
|
-
Invoked when creating a new class instance, and sets any default parameters.
|
|
11
|
-
@private
|
|
12
|
-
*/
|
|
13
|
-
constructor();
|
|
14
|
-
/**
|
|
15
|
-
Renders map tiles based on the current zoom level.
|
|
16
|
-
@private
|
|
17
|
-
*/
|
|
18
|
-
_renderTiles(transform?: ReturnType<typeof zoomTransform>, duration?: number): void;
|
|
19
|
-
/**
|
|
20
|
-
Extends the draw behavior of the abstract Viz class.
|
|
21
|
-
|
|
22
|
-
DOM mount (svg container, ocean rect, tileGroup, zoomGroup) + zoom
|
|
23
|
-
behavior extent stay here — they're lifecycle, not layout. The actual
|
|
24
|
-
projection / fit-extent / per-feature path + point computation runs as
|
|
25
|
-
`applyGeomapLayout` on `geomapDef.stages` and writes `_geomapCtx`
|
|
26
|
-
back onto the viz, which `geomapDef.emit` consumes.
|
|
27
|
-
@private
|
|
28
|
-
*/
|
|
29
|
-
_draw(callback?: () => void): this;
|
|
30
|
-
/**
|
|
31
|
-
Topojson files sometimes include small geographies that negatively impact how the library determines the default zoom level (for example, a small island or territory far off the coast that is barely visible to the eye). The fitFilter method can be used to remove specific geographies from the logic used to determine the zooming.
|
|
32
|
-
|
|
33
|
-
The *value* passed can be a single id to remove, an array of ids, or a filter function. Take a look at the [Choropleth Example](http://d3plus.org/examples/d3plus-geomap/getting-started/) to see it in action.
|
|
34
|
-
*/
|
|
35
|
-
fitFilter(_?: string | string[] | ((d: Record<string, unknown>) => boolean)): this | ((d: Record<string, unknown>) => boolean);
|
|
36
|
-
/**
|
|
37
|
-
If the topojson being used to determine the zoom fit (either the main [topojson](#Geomap.topojson) object or the [fitObject](#Geomap.fitObject)) contains multiple geographical sets (for example, a file containing state and county boundaries), use this method to indentify which set to use for the zoom fit.
|
|
38
|
-
|
|
39
|
-
If not specified, the first key in the *Array* returned from using `Object.keys` on the topojson will be used.
|
|
40
|
-
*/
|
|
41
|
-
fitKey(_?: string): this | string;
|
|
42
|
-
/**
|
|
43
|
-
The topojson to be used for the initial projection [fit extent](https://github.com/d3/d3-geo#projection_fitExtent). The value passed should either be a valid Topojson *Object* or a *String* representing a filepath or URL to be loaded.
|
|
44
|
-
|
|
45
|
-
Additionally, a custom formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function needs to return the final Topojson *Object*.
|
|
46
|
-
@param _ `undefined`
|
|
47
|
-
@param f Topojson data or a URL to load.
|
|
48
|
-
*/
|
|
49
|
-
fitObject(_?: Record<string, unknown> | string, f?: (data: unknown) => Record<string, unknown>): this | Record<string, unknown>;
|
|
50
|
-
/**
|
|
51
|
-
The color visible behind any shapes drawn on the map projection. By default, a color value matching the color used in the map tiles is used to help mask the loading time needed to render the tiles. Any value CSS color value may be used, including hexidecimal, rgb, rgba, and color strings like `"blue"` and `"transparent"`.
|
|
52
|
-
@param _ "#d4dadc"]
|
|
53
|
-
*/
|
|
54
|
-
ocean(_?: string): this | string;
|
|
55
|
-
/**
|
|
56
|
-
The accessor to be used when detecting coordinate points in the objects passed to the [data](https://d3plus.org/docs/#Viz.data) method. Values are expected to be in the format `[longitude, latitude]`, which is in-line with d3's expected coordinate mapping.
|
|
57
|
-
*/
|
|
58
|
-
point(_?: ((d: DataPoint, i: number) => number[]) | number[]): this | ((d: DataPoint, i: number) => number[]);
|
|
59
|
-
/**
|
|
60
|
-
The accessor or static value to be used for sizing coordinate points.
|
|
61
|
-
*/
|
|
62
|
-
pointSize(_?: number | ((d: DataPoint, i: number) => number)): this | number | ((d: DataPoint, i: number) => number);
|
|
63
|
-
/**
|
|
64
|
-
The maximum pixel radius used in the scale for sizing coordinate points.
|
|
65
|
-
@param _ 10]
|
|
66
|
-
*/
|
|
67
|
-
pointSizeMax(_?: number): this | number;
|
|
68
|
-
/**
|
|
69
|
-
The minimum pixel radius used in the scale for sizing coordinate points.
|
|
70
|
-
@param _ 5]
|
|
71
|
-
*/
|
|
72
|
-
pointSizeMin(_?: number): this | number;
|
|
73
|
-
/**
|
|
74
|
-
The map projection used when displaying topojson and coordinate points. All projections from [d3-geo](https://github.com/d3/d3-geo#projections), [d3-geo-projection](https://github.com/d3/d3-geo-projection#api-reference), and [d3-composite-projections](http://geoexamples.com/d3-composite-projections/) are accepted, either as the string name (ie. "geoMercator") or the generator function itself. Map tiles are only usable when the projection is set to Mercator (the default).
|
|
75
|
-
@param _ "geoMercator"
|
|
76
|
-
*/
|
|
77
|
-
projection(_?: string | ((...args: unknown[]) => unknown)): this | ((...args: unknown[]) => unknown);
|
|
78
|
-
/**
|
|
79
|
-
The outer padding between the edge of the visualization and the shapes drawn. The value passed can be either a single number to be used on all sides, or a CSS string pattern (ie. `"20px 0 10px"`).
|
|
80
|
-
@param _ 20]
|
|
81
|
-
*/
|
|
82
|
-
projectionPadding(_?: number | string): this | Record<string, number>;
|
|
83
|
-
/**
|
|
84
|
-
An array that corresponds to the value passed to the projection's [rotate](https://github.com/d3/d3-geo#projection_rotate) function. Use this method to shift the centerpoint of a map.
|
|
85
|
-
@param _ [0, 0]]
|
|
86
|
-
*/
|
|
87
|
-
projectionRotate(_?: number[]): this | number[];
|
|
88
|
-
/**
|
|
89
|
-
Toggles the visibility of the map tiles.
|
|
90
|
-
@param _ true]
|
|
91
|
-
*/
|
|
92
|
-
tiles(_?: boolean): this | boolean;
|
|
93
|
-
/**
|
|
94
|
-
By default, d3plus uses the `light_all` style provided by [CARTO](https://carto.com/location-data-services/basemaps/) for it's map tiles. The [tileUrl](https://d3plus.org/docs/#Geomap.tileUrl) method changes the base URL used for fetching the tiles, as long as the string passed contains `{x}`, `{y}`, and `{z}` variables enclosed in curly brackets for the zoom logic to load the correct tiles.
|
|
95
|
-
@param _ "https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"]
|
|
96
|
-
*/
|
|
97
|
-
tileUrl(_?: string): this | string;
|
|
98
|
-
/**
|
|
99
|
-
The topojson to be used for drawing geographical paths. The value passed should either be a valid Topojson *Object* or a *String* representing a filepath or URL to be loaded.
|
|
100
|
-
|
|
101
|
-
Additionally, a custom formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final Topojson *Obejct*.
|
|
102
|
-
@param _ []
|
|
103
|
-
@param f Topojson data or a URL to load.
|
|
104
|
-
*/
|
|
105
|
-
topojson(_?: Record<string, unknown> | string, f?: (data: unknown) => Record<string, unknown>): this | Record<string, unknown>;
|
|
106
|
-
/**
|
|
107
|
-
The function is used to set default color of the map.
|
|
108
|
-
@param _ string
|
|
109
|
-
*/
|
|
110
|
-
topojsonFill(_?: string | ((d: DataPoint, i: number) => string)): this | string | ((d: DataPoint, i: number) => string);
|
|
111
|
-
/**
|
|
112
|
-
If the [topojson](#Geomap.topojson) being used contains boundaries that should not be shown, this method can be used to filter them out of the final output. The *value* passed can be a single id to remove, an array of ids, or a filter function.
|
|
113
|
-
*/
|
|
114
|
-
topojsonFilter(_?: string | string[] | ((d: Record<string, unknown>) => boolean)): this | ((d: Record<string, unknown>) => boolean);
|
|
115
|
-
/**
|
|
116
|
-
If the [topojson](#Geomap.topojson) contains multiple geographical sets (for example, a file containing state and county boundaries), use this method to indentify which set to use.
|
|
117
|
-
|
|
118
|
-
If not specified, the first key in the *Array* returned from using `Object.keys` on the topojson will be used.
|
|
119
|
-
*/
|
|
120
|
-
topojsonKey(_?: string): this | string;
|
|
121
|
-
/**
|
|
122
|
-
The accessor used to map each topojson geometry to it's corresponding [data](https://d3plus.org/docs/#Viz.data) point.
|
|
123
|
-
@param _ "id"
|
|
124
|
-
*/
|
|
125
|
-
topojsonId(_?: string | ((d: Record<string, unknown>) => string)): this | ((d: Record<string, unknown>) => string);
|
|
126
|
-
}
|