@d3plus/core 4.9.0 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.js +1 -1
- package/es/internal.js +170 -9
- package/es/src/charts/Alluvial/aggregate.js +145 -0
- package/es/src/charts/Alluvial/applyLayout.js +125 -0
- package/es/src/charts/Alluvial/dimensions.js +56 -0
- package/es/src/charts/Alluvial/emit.js +73 -0
- package/es/src/charts/Alluvial/hover.js +101 -0
- package/es/src/charts/Alluvial/index.js +170 -0
- package/es/src/charts/Alluvial/layout.js +137 -0
- package/es/src/charts/Alluvial/meta.js +57 -0
- package/es/src/charts/Alluvial/titles.js +81 -0
- package/es/src/charts/ArcDiagram/applyLayout.js +386 -0
- package/es/src/charts/ArcDiagram/arcGeometry.js +275 -0
- package/es/src/charts/ArcDiagram/arcLabels.js +171 -0
- package/es/src/charts/ArcDiagram/arcLoops.js +78 -0
- package/es/src/charts/ArcDiagram/emit.js +178 -0
- package/es/src/charts/ArcDiagram/events.js +144 -0
- package/es/src/charts/ArcDiagram/index.js +215 -0
- package/es/src/charts/BarChart/index.js +14 -2
- package/es/src/charts/BoxWhisker/index.js +95 -4
- package/es/src/charts/BoxWhisker/outliers.js +68 -0
- package/es/src/charts/BoxWhisker/summary.js +83 -0
- package/es/src/charts/BoxWhisker/tooltip.js +122 -0
- package/es/src/charts/BubbleChart/emit.js +31 -0
- package/es/src/charts/BubbleChart/index.js +54 -0
- package/es/src/charts/Bullet/index.js +2 -1
- package/es/src/charts/BumpChart/index.js +5 -0
- package/es/src/charts/Calendar/emit.js +1 -1
- package/es/src/charts/Calendar/index.js +5 -3
- package/es/src/charts/Candlestick/aggregate.js +11 -1
- package/es/src/charts/Candlestick/buffer.js +6 -4
- package/es/src/charts/Candlestick/index.js +7 -6
- package/es/src/charts/Chord/applyLayout.js +56 -69
- package/es/src/charts/Chord/emit.js +55 -24
- package/es/src/charts/Chord/index.js +17 -12
- package/es/src/charts/Chord/labels.js +105 -0
- package/es/src/charts/Donut/index.js +5 -11
- package/es/src/charts/Dumbbell/index.js +2 -4
- package/es/src/charts/Funnel/index.js +2 -1
- package/es/src/charts/Gantt/applyLayout.js +162 -0
- package/es/src/charts/Gantt/emit.js +142 -0
- package/es/src/charts/Gantt/ganttDecor.js +207 -0
- package/es/src/charts/Gantt/ganttGeometry.js +107 -0
- package/es/src/charts/Gantt/ganttLabels.js +85 -0
- package/es/src/charts/Gantt/ganttRows.js +111 -0
- package/es/src/charts/Gantt/ganttTooltip.js +136 -0
- package/es/src/charts/Gantt/index.js +219 -0
- package/es/src/charts/Gauge/index.js +2 -1
- package/es/src/charts/Geomap/applyLayout.js +90 -49
- package/es/src/charts/Geomap/basemapTheme.js +3 -48
- package/es/src/charts/Geomap/emit.js +19 -2
- package/es/src/charts/Geomap/flowEmit.js +132 -0
- package/es/src/charts/Geomap/flowEvents.js +86 -0
- package/es/src/charts/Geomap/flowFields.js +91 -0
- package/es/src/charts/Geomap/flowGeometry.js +225 -0
- package/es/src/charts/Geomap/flowLinks.js +239 -0
- package/es/src/charts/Geomap/geoCache.js +180 -0
- package/es/src/charts/Geomap/globeKeys.js +131 -0
- package/es/src/charts/Geomap/globeRotate.js +208 -0
- package/es/src/charts/Geomap/index.js +60 -19
- package/es/src/charts/Geomap/pointLabels.js +107 -0
- package/es/src/charts/Hexbin/binning.js +103 -0
- package/es/src/charts/Hexbin/buffer.js +33 -0
- package/es/src/charts/Hexbin/contourLabels.js +234 -0
- package/es/src/charts/Hexbin/contours.js +48 -0
- package/es/src/charts/Hexbin/emit.js +142 -0
- package/es/src/charts/Hexbin/index.js +204 -0
- package/es/src/charts/Hexbin/layers.js +212 -0
- package/es/src/charts/Hexbin/settings.js +86 -0
- package/es/src/charts/Hexbin/tooltip.js +77 -0
- package/es/src/charts/Histogram/binData.js +31 -4
- package/es/src/charts/Histogram/index.js +37 -16
- package/es/src/charts/Histogram/labels.js +18 -0
- package/es/src/charts/Icicle/index.js +3 -3
- package/es/src/charts/LinePlot/index.js +7 -0
- package/es/src/charts/Marimekko/index.js +7 -4
- package/es/src/charts/Matrix/index.js +3 -2
- package/es/src/charts/Network/applyLayout.js +138 -94
- package/es/src/charts/Network/bundle.js +81 -0
- package/es/src/charts/Network/clusterLabels.js +423 -0
- package/es/src/charts/Network/clusters.js +290 -0
- package/es/src/charts/Network/emit.js +253 -70
- package/es/src/charts/Network/graph.js +117 -0
- package/es/src/charts/Network/graphFluent.js +79 -0
- package/es/src/charts/Network/index.js +93 -108
- package/es/src/charts/Network/minNodeDistance.js +64 -0
- package/es/src/charts/Network/polygonRows.js +44 -0
- package/es/src/charts/Pack/index.js +7 -2
- package/es/src/charts/Pie/applyLayout.js +86 -27
- package/es/src/charts/Pie/arcFit.js +152 -0
- package/es/src/charts/Pie/curvedLabels.js +134 -0
- package/es/src/charts/Pie/emit.js +43 -96
- package/es/src/charts/Pie/index.js +66 -32
- package/es/src/charts/Pie/labelRoom.js +154 -0
- package/es/src/charts/Pie/outsideLabels.js +224 -0
- package/es/src/charts/Pie/outsideNodes.js +267 -0
- package/es/src/charts/Pie/pieLabels.js +137 -0
- package/es/src/charts/Pie/sectorBox.js +223 -0
- package/es/src/charts/Pie/straightLabels.js +96 -0
- package/es/src/charts/Pie/straightLayout.js +215 -0
- package/es/src/charts/Plot/alongLegend.js +76 -0
- package/es/src/charts/Plot/areaLabelsAlong.js +333 -0
- package/es/src/charts/Plot/axisHover.js +180 -0
- package/es/src/charts/Plot/axisHoverAnchors.js +174 -0
- package/es/src/charts/Plot/axisHoverScene.js +203 -0
- package/es/src/charts/Plot/axisValues.js +43 -0
- package/es/src/charts/Plot/barHitArea.js +81 -0
- package/es/src/charts/Plot/barLabelFit.js +123 -0
- package/es/src/charts/Plot/barWidth.js +61 -13
- package/es/src/charts/Plot/circleLabels.js +98 -0
- package/es/src/charts/Plot/confidenceConfig.js +2 -2
- package/es/src/charts/Plot/connectGaps.js +237 -0
- package/es/src/charts/Plot/connectGapsScene.js +188 -0
- package/es/src/charts/Plot/draw.js +14 -4
- package/es/src/charts/Plot/fillBetween.js +2 -1
- package/es/src/charts/Plot/forecastScene.js +3 -4
- package/es/src/charts/Plot/index.js +42 -15
- package/es/src/charts/Plot/labelPlacement.js +10 -2
- package/es/src/charts/Plot/lineLabelEmit.js +82 -0
- package/es/src/charts/Plot/lineLabelSides.js +51 -0
- package/es/src/charts/Plot/lineLabelSpread.js +65 -0
- package/es/src/charts/Plot/lineLabelsAlong.js +282 -0
- package/es/src/charts/Plot/openDomainEnds.js +2 -5
- package/es/src/charts/Plot/pipeline.js +71 -22
- package/es/src/charts/Plot/pipelineAxisLayout.js +42 -8
- package/es/src/charts/Plot/pipelineDomains.js +23 -6
- package/es/src/charts/Plot/pipelineLineLabels.js +145 -53
- package/es/src/charts/Plot/pipelineScales.js +40 -8
- package/es/src/charts/Plot/plotFacet.js +12 -1
- package/es/src/charts/Plot/plotInit.js +49 -5
- package/es/src/charts/Plot/plotRangeBreaks.js +85 -0
- package/es/src/charts/Plot/plotZoom.js +15 -6
- package/es/src/charts/Plot/referenceDomains.js +133 -0
- package/es/src/charts/Plot/shapeDefaults.js +14 -9
- package/es/src/charts/Plot/sharedHoverScene.js +50 -31
- package/es/src/charts/Plot/sharedTooltip.js +19 -7
- package/es/src/charts/Plot/stackHelpers.js +13 -1
- package/es/src/charts/Plot/stackLegendOrder.js +176 -0
- package/es/src/charts/Plot/stackShareTooltip.js +9 -4
- package/es/src/charts/Plot/stackThreshold.js +154 -0
- package/es/src/charts/Plot/trendLabels.js +183 -0
- package/es/src/charts/Plot/trendLines.js +1 -0
- package/es/src/charts/Plot/trendScene.js +6 -3
- package/es/src/charts/Plot/trendTooltip.js +5 -1
- package/es/src/charts/PolarArea/index.js +5 -4
- package/es/src/charts/Priestley/applyLayout.js +14 -20
- package/es/src/charts/Priestley/index.js +4 -34
- package/es/src/charts/Priestley/timeAxis.js +100 -0
- package/es/src/charts/Pyramid/index.js +4 -2
- package/es/src/charts/Radar/axisDecorations.js +49 -12
- package/es/src/charts/Radar/curvedLabels.js +187 -0
- package/es/src/charts/Radar/index.js +5 -5
- package/es/src/charts/RadialBar/curvedLabels.js +111 -0
- package/es/src/charts/RadialBar/emit.js +4 -1
- package/es/src/charts/RadialBar/index.js +18 -10
- package/es/src/charts/RadialBar/trackLayout.js +43 -13
- package/es/src/charts/RadialMatrix/index.js +6 -9
- package/es/src/charts/Rings/applyLayout.js +41 -24
- package/es/src/charts/Rings/emit.js +174 -58
- package/es/src/charts/Rings/index.js +65 -30
- package/es/src/charts/Rings/ringsGraph.js +28 -9
- package/es/src/charts/Rings/ringsLoops.js +73 -0
- package/es/src/charts/Rings/ringsParallel.js +166 -0
- package/es/src/charts/Sankey/applyLayout.js +116 -39
- package/es/src/charts/Sankey/circularLayout.js +208 -0
- package/es/src/charts/Sankey/circularLinks.js +301 -0
- package/es/src/charts/Sankey/emit.js +164 -94
- package/es/src/charts/Sankey/index.js +75 -77
- package/es/src/charts/Sankey/labels.js +80 -0
- package/es/src/charts/Sankey/ribbons.js +88 -0
- package/es/src/charts/Sankey/sankeyCycles.js +117 -0
- package/es/src/charts/Sankey/sankeyLayout.js +8 -3
- package/es/src/charts/Sankey/sankeyLinks.js +47 -0
- package/es/src/charts/Scatter/index.js +25 -0
- package/es/src/charts/SlopeChart/index.js +116 -0
- package/es/src/charts/SlopeChart/slope.js +95 -0
- package/es/src/charts/Streamgraph/index.js +51 -0
- package/es/src/charts/Sunburst/curvedLabels.js +74 -0
- package/es/src/charts/Sunburst/emit.js +74 -63
- package/es/src/charts/Sunburst/index.js +3 -3
- package/es/src/charts/Tree/index.js +2 -6
- package/es/src/charts/Treemap/applyLayout.js +14 -1
- package/es/src/charts/Treemap/emit.js +8 -2
- package/es/src/charts/Treemap/emitGroupHeaders.js +104 -0
- package/es/src/charts/Treemap/groupHeaders.js +95 -0
- package/es/src/charts/Treemap/index.js +17 -7
- package/es/src/charts/Treemap/thresholdFunction.js +11 -9
- package/es/src/charts/Violin/inner.js +3 -5
- package/es/src/charts/Waffle/index.js +4 -2
- package/es/src/charts/Waffle/tooltip.js +6 -2
- package/es/src/charts/Waterfall/index.js +4 -2
- package/es/src/charts/definition/makeChart.js +20 -5
- package/es/src/charts/drawSteps/backControl.js +17 -5
- package/es/src/charts/drawSteps/gestureHover.js +79 -0
- package/es/src/charts/drawSteps/minimap.js +6 -5
- package/es/src/charts/drawSteps/minimapMarkup.js +25 -9
- package/es/src/charts/drawSteps/saveChart.js +176 -0
- package/es/src/charts/drawSteps/saveControl.js +148 -0
- package/es/src/charts/drawSteps/saveControlMarkup.js +104 -0
- package/es/src/charts/drawSteps/searchControls.js +2 -1
- package/es/src/charts/drawSteps/searchControlsMarkup.js +11 -2
- package/es/src/charts/drawSteps/tableViewMarkup.js +18 -11
- package/es/src/charts/drawSteps/topLeftControls.js +3 -1
- package/es/src/charts/drawSteps/topLeftControlsMarkup.js +1 -1
- package/es/src/charts/drawSteps/zoomControls.js +21 -5
- package/es/src/charts/events/click.legend.js +7 -2
- package/es/src/charts/events/click.shape.js +38 -2
- package/es/src/charts/events/mouseenter.js +9 -0
- package/es/src/charts/events/mousemove.legend.js +3 -0
- package/es/src/charts/events/mousemove.shape.js +12 -4
- package/es/src/charts/facet/drawFacets.js +14 -5
- package/es/src/charts/facet/facetConfig.js +2 -2
- package/es/src/charts/facet/facetData.js +2 -2
- package/es/src/charts/features/annotationFrame.js +179 -0
- package/es/src/charts/features/annotationText.js +83 -0
- package/es/src/charts/features/annotationTypes.js +10 -0
- package/es/src/charts/features/attributionFeature.js +6 -11
- package/es/src/charts/features/axes.js +9 -7
- package/es/src/charts/features/axesFinal.js +26 -4
- package/es/src/charts/features/axesMeasure.js +61 -6
- package/es/src/charts/features/calloutLayout.js +121 -0
- package/es/src/charts/features/calloutScene.js +155 -0
- package/es/src/charts/features/chartGeometry.js +1 -1
- package/es/src/charts/features/circleLabelPlacement.js +297 -0
- package/es/src/charts/features/circleLabels.js +207 -0
- package/es/src/charts/features/colorScaleBucket.js +19 -1
- package/es/src/charts/features/colorScaleHover.js +70 -0
- package/es/src/charts/features/colorScaleValue.js +97 -0
- package/es/src/charts/features/curvedArrows.js +158 -0
- package/es/src/charts/features/edgeArrows.js +160 -4
- package/es/src/charts/features/edgeBundling.js +442 -0
- package/es/src/charts/features/edgeBundlingSmooth.js +117 -0
- package/es/src/charts/features/ensureZoomDom.js +32 -8
- package/es/src/charts/features/features.js +45 -15
- package/es/src/charts/features/featuresColorScale.js +62 -8
- package/es/src/charts/features/featuresLegend.js +21 -32
- package/es/src/charts/features/legendKeys.js +64 -0
- package/es/src/charts/features/lineLabels.js +55 -46
- package/es/src/charts/features/linkBundle.js +19 -0
- package/es/src/charts/features/linkColor.js +72 -0
- package/es/src/charts/features/linkFields.js +86 -0
- package/es/src/charts/features/linkFocus.js +118 -0
- package/es/src/charts/features/linkInteraction.js +312 -0
- package/es/src/charts/features/linkKeys.js +20 -0
- package/es/src/charts/features/linkLabelGeometry.js +209 -0
- package/es/src/charts/features/linkLabelPath.js +162 -0
- package/es/src/charts/features/linkLabels.js +340 -0
- package/es/src/charts/features/linkWidths.js +32 -0
- package/es/src/charts/features/pathLabelGeometry.js +232 -0
- package/es/src/charts/features/pathLabels.js +50 -0
- package/es/src/charts/features/plotAnnotations.js +68 -17
- package/es/src/charts/features/plotPaint.js +42 -15
- package/es/src/charts/features/polyline.js +129 -0
- package/es/src/charts/features/referenceAnnotations.js +403 -0
- package/es/src/charts/features/referenceLabelPlacement.js +106 -0
- package/es/src/charts/features/ringLabelNodes.js +93 -0
- package/es/src/charts/features/ringLabels.js +222 -0
- package/es/src/charts/features/sceneBounds.js +26 -6
- package/es/src/charts/features/selfLoops.js +306 -0
- package/es/src/charts/features/shapeEmit.js +67 -30
- package/es/src/charts/features/shareKey.js +15 -0
- package/es/src/charts/features/sharedFields.js +15 -2
- package/es/src/charts/features/textHalo.js +29 -0
- package/es/src/charts/features/thresholdMembers.js +71 -0
- package/es/src/charts/helpers/densityChart.js +3 -1
- package/es/src/charts/helpers/valueTitle.js +6 -3
- package/es/src/charts/index.js +8 -0
- package/es/src/charts/partition/chartFields.js +6 -5
- package/es/src/charts/partition/hierarchy.js +2 -0
- package/es/src/charts/partition/interaction.js +9 -5
- package/es/src/charts/partition/zoom.js +7 -6
- package/es/src/charts/pipeline/insetPlacement.js +14 -6
- package/es/src/charts/pipeline/preDrawData.js +77 -13
- package/es/src/charts/pipeline/runVizPipeline.js +5 -0
- package/es/src/charts/pipeline/vizDraw.js +40 -29
- package/es/src/charts/pipeline/vizPreDraw.js +29 -18
- package/es/src/charts/plotBuffers/discreteBuffer.js +7 -4
- package/es/src/charts/polar/config.js +2 -3
- package/es/src/charts/viz/Viz.js +82 -44
- package/es/src/charts/viz/VizBase.js +47 -19
- package/es/src/charts/viz/backgroundInk.js +13 -7
- package/es/src/charts/viz/dataPoller.js +52 -0
- package/es/src/charts/viz/focusRing.js +104 -0
- package/es/src/charts/viz/focusTargets.js +208 -0
- package/es/src/charts/viz/groupRow.js +35 -0
- package/es/src/charts/viz/history.js +74 -0
- package/es/src/charts/viz/interactionOpacity.js +19 -5
- package/es/src/charts/viz/keyboardNav.js +297 -0
- package/es/src/charts/viz/keyboardNavHost.js +95 -0
- package/es/src/charts/viz/loaderFormat.js +114 -0
- package/es/src/charts/viz/missingFields.js +123 -0
- package/es/src/charts/viz/mountTarget.js +9 -0
- package/es/src/charts/viz/nearestHover.js +183 -0
- package/es/src/charts/viz/nearestHoverSurface.js +92 -0
- package/es/src/charts/viz/ordinalColor.js +14 -12
- package/es/src/charts/viz/pageTheme.js +83 -0
- package/es/src/charts/viz/pointTooltipAnchor.js +59 -0
- package/es/src/charts/viz/pointVoronoi.js +124 -0
- package/es/src/charts/viz/reducedMotion.js +27 -0
- package/es/src/charts/viz/reportHandlerError.js +10 -0
- package/es/src/charts/viz/shapeClassTargets.js +18 -2
- package/es/src/charts/viz/simpleHover.js +2 -0
- package/es/src/charts/viz/vizClassName.js +31 -0
- package/es/src/charts/viz/vizDataPolling.js +172 -0
- package/es/src/charts/viz/vizDefaults.js +81 -23
- package/es/src/charts/viz/vizFields.js +53 -2
- package/es/src/charts/viz/vizRender.js +49 -28
- package/es/src/charts/viz/vizTheme.js +96 -0
- package/es/src/charts/viz/vizVisibility.js +14 -0
- package/es/src/components/Axis/Axis.js +34 -0
- package/es/src/components/Axis/AxisBottom.js +1 -0
- package/es/src/components/Axis/AxisLeft.js +1 -0
- package/es/src/components/Axis/AxisRight.js +1 -0
- package/es/src/components/Axis/AxisTop.js +1 -0
- package/es/src/components/Axis/axisBreak.js +4 -1
- package/es/src/components/Axis/axisDefaults.js +8 -10
- package/es/src/components/Axis/axisLabelAngle.js +175 -0
- package/es/src/components/Axis/axisLabelThinning.js +13 -4
- package/es/src/components/Axis/axisLayout.js +86 -19
- package/es/src/components/Axis/axisLayoutLabels.js +66 -13
- package/es/src/components/Axis/axisLayoutScale.js +10 -1
- package/es/src/components/Axis/axisRangeBreaks.js +77 -0
- package/es/src/components/Axis/axisRender.js +38 -9
- package/es/src/components/Axis/axisRounding.js +15 -4
- package/es/src/components/Axis/axisSlantWrap.js +39 -0
- package/es/src/components/Axis/brokenTimeScale.js +196 -0
- package/es/src/components/Axis/powTicks.js +73 -0
- package/es/src/components/Axis/rangeBreaks.js +201 -0
- package/es/src/components/Axis/timeValues.js +19 -4
- package/es/src/components/ColorScale/ColorScale.js +42 -36
- package/es/src/components/ColorScale/bucketBounds.js +64 -0
- package/es/src/components/ColorScale/colorScaleHoverMark.js +327 -0
- package/es/src/components/ColorScale/colorScaleRender.js +25 -1
- package/es/src/components/ColorScale/colorScaleScale.js +43 -24
- package/es/src/components/ColorScale/colorScaleType.js +26 -0
- package/es/src/components/Legend/Legend.js +3 -0
- package/es/src/components/Legend/legendConfig.js +2 -6
- package/es/src/components/SizeLegend/SizeLegend.js +1 -0
- package/es/src/components/TextBox.js +31 -65
- package/es/src/components/Timeline/Timeline.js +54 -54
- package/es/src/components/Timeline/brushSpan.js +78 -0
- package/es/src/components/Timeline/timelineConfig.js +27 -10
- package/es/src/components/Timeline/timelineMode.js +26 -0
- package/es/src/components/Timeline/timelineRender.js +51 -9
- package/es/src/components/Tooltip.js +28 -13
- package/es/src/components/fontStack.js +20 -0
- package/es/src/components/textBoxLayout.js +58 -21
- package/es/src/components/textBoxPath.js +73 -0
- package/es/src/components/textBoxScene.js +223 -0
- package/es/src/components/textBoxWords.js +70 -0
- package/es/src/shapes/Area.js +1 -0
- package/es/src/shapes/Bar.js +1 -0
- package/es/src/shapes/Box.js +67 -79
- package/es/src/shapes/Circle.js +1 -0
- package/es/src/shapes/Line.js +1 -0
- package/es/src/shapes/Path.js +1 -0
- package/es/src/shapes/Rect.js +1 -0
- package/es/src/shapes/Shape.js +1 -0
- package/es/src/shapes/Whisker.js +1 -0
- package/es/src/shapes/boxOutlierShape.js +19 -0
- package/es/src/shapes/boxStats.js +35 -0
- package/es/src/shapes/boxStyle.js +78 -0
- package/es/src/shapes/boxSummary.js +174 -0
- package/es/src/shapes/shapeStandalone.js +2 -0
- package/es/src/utils/BaseClass.js +44 -12
- package/es/src/utils/className.js +78 -0
- package/es/src/utils/configPrep.js +2 -1
- package/es/src/utils/configWarnings.js +25 -0
- package/es/src/utils/constant.js +13 -1
- package/es/src/utils/displayName.js +12 -0
- package/es/src/utils/fieldAccessor.js +31 -0
- package/es/src/utils/paintComponentScene.js +2 -0
- package/es/src/utils/theme.js +190 -0
- package/es/src/utils/themeInk.js +68 -0
- package/package.json +14 -10
- package/types/index.d.ts +8 -2
- package/types/internal.d.ts +253 -9
- package/types/src/charts/Alluvial/aggregate.d.ts +98 -0
- package/types/src/charts/Alluvial/applyLayout.d.ts +67 -0
- package/types/src/charts/Alluvial/dimensions.d.ts +40 -0
- package/types/src/charts/Alluvial/emit.d.ts +9 -0
- package/types/src/charts/Alluvial/hover.d.ts +31 -0
- package/types/src/charts/Alluvial/index.d.ts +27 -0
- package/types/src/charts/Alluvial/layout.d.ts +70 -0
- package/types/src/charts/Alluvial/meta.d.ts +54 -0
- package/types/src/charts/Alluvial/titles.d.ts +33 -0
- package/types/src/charts/ArcDiagram/applyLayout.d.ts +70 -0
- package/types/src/charts/ArcDiagram/arcGeometry.d.ts +150 -0
- package/types/src/charts/ArcDiagram/arcLabels.d.ts +89 -0
- package/types/src/charts/ArcDiagram/arcLoops.d.ts +48 -0
- package/types/src/charts/ArcDiagram/emit.d.ts +23 -0
- package/types/src/charts/ArcDiagram/events.d.ts +28 -0
- package/types/src/charts/ArcDiagram/index.d.ts +28 -0
- package/types/src/charts/BoxWhisker/index.d.ts +3 -1
- package/types/src/charts/BoxWhisker/outliers.d.ts +25 -0
- package/types/src/charts/BoxWhisker/summary.d.ts +39 -0
- package/types/src/charts/BoxWhisker/tooltip.d.ts +36 -0
- package/types/src/charts/BubbleChart/emit.d.ts +20 -0
- package/types/src/charts/BubbleChart/index.d.ts +16 -0
- package/types/src/charts/Candlestick/aggregate.d.ts +6 -0
- package/types/src/charts/Chord/applyLayout.d.ts +3 -0
- package/types/src/charts/Chord/labels.d.ts +66 -0
- package/types/src/charts/Donut/index.d.ts +2 -1
- package/types/src/charts/Gantt/applyLayout.d.ts +64 -0
- package/types/src/charts/Gantt/emit.d.ts +17 -0
- package/types/src/charts/Gantt/ganttDecor.d.ts +41 -0
- package/types/src/charts/Gantt/ganttGeometry.d.ts +57 -0
- package/types/src/charts/Gantt/ganttLabels.d.ts +41 -0
- package/types/src/charts/Gantt/ganttRows.d.ts +84 -0
- package/types/src/charts/Gantt/ganttTooltip.d.ts +57 -0
- package/types/src/charts/Gantt/index.d.ts +36 -0
- package/types/src/charts/Geomap/applyLayout.d.ts +8 -0
- package/types/src/charts/Geomap/basemapTheme.d.ts +2 -19
- package/types/src/charts/Geomap/emit.d.ts +2 -2
- package/types/src/charts/Geomap/flowEmit.d.ts +35 -0
- package/types/src/charts/Geomap/flowEvents.d.ts +20 -0
- package/types/src/charts/Geomap/flowFields.d.ts +7 -0
- package/types/src/charts/Geomap/flowGeometry.d.ts +91 -0
- package/types/src/charts/Geomap/flowLinks.d.ts +97 -0
- package/types/src/charts/Geomap/geoCache.d.ts +47 -0
- package/types/src/charts/Geomap/globeKeys.d.ts +41 -0
- package/types/src/charts/Geomap/globeRotate.d.ts +70 -0
- package/types/src/charts/Geomap/index.d.ts +3 -0
- package/types/src/charts/Geomap/pointLabels.d.ts +24 -0
- package/types/src/charts/Hexbin/binning.d.ts +64 -0
- package/types/src/charts/Hexbin/buffer.d.ts +18 -0
- package/types/src/charts/Hexbin/contourLabels.d.ts +95 -0
- package/types/src/charts/Hexbin/contours.d.ts +48 -0
- package/types/src/charts/Hexbin/emit.d.ts +23 -0
- package/types/src/charts/Hexbin/index.d.ts +25 -0
- package/types/src/charts/Hexbin/layers.d.ts +94 -0
- package/types/src/charts/Hexbin/settings.d.ts +122 -0
- package/types/src/charts/Hexbin/tooltip.d.ts +26 -0
- package/types/src/charts/Histogram/binData.d.ts +20 -1
- package/types/src/charts/Histogram/index.d.ts +3 -2
- package/types/src/charts/Histogram/labels.d.ts +7 -0
- package/types/src/charts/Marimekko/index.d.ts +2 -1
- package/types/src/charts/Network/bundle.d.ts +67 -0
- package/types/src/charts/Network/clusterLabels.d.ts +112 -0
- package/types/src/charts/Network/clusters.d.ts +115 -0
- package/types/src/charts/Network/graph.d.ts +65 -0
- package/types/src/charts/Network/graphFluent.d.ts +20 -0
- package/types/src/charts/Network/minNodeDistance.d.ts +18 -0
- package/types/src/charts/Network/polygonRows.d.ts +29 -0
- package/types/src/charts/Pie/applyLayout.d.ts +31 -3
- package/types/src/charts/Pie/arcFit.d.ts +63 -0
- package/types/src/charts/Pie/curvedLabels.d.ts +57 -0
- package/types/src/charts/Pie/labelRoom.d.ts +83 -0
- package/types/src/charts/Pie/outsideLabels.d.ts +119 -0
- package/types/src/charts/Pie/outsideNodes.d.ts +93 -0
- package/types/src/charts/Pie/pieLabels.d.ts +85 -0
- package/types/src/charts/Pie/sectorBox.d.ts +95 -0
- package/types/src/charts/Pie/straightLabels.d.ts +24 -0
- package/types/src/charts/Pie/straightLayout.d.ts +88 -0
- package/types/src/charts/Plot/alongLegend.d.ts +42 -0
- package/types/src/charts/Plot/areaLabelsAlong.d.ts +119 -0
- package/types/src/charts/Plot/axisHover.d.ts +68 -0
- package/types/src/charts/Plot/axisHoverAnchors.d.ts +88 -0
- package/types/src/charts/Plot/axisHoverScene.d.ts +88 -0
- package/types/src/charts/Plot/axisValues.d.ts +24 -0
- package/types/src/charts/Plot/barHitArea.d.ts +59 -0
- package/types/src/charts/Plot/barLabelFit.d.ts +81 -0
- package/types/src/charts/Plot/barWidth.d.ts +38 -4
- package/types/src/charts/Plot/circleLabels.d.ts +29 -0
- package/types/src/charts/Plot/connectGaps.d.ts +99 -0
- package/types/src/charts/Plot/connectGapsScene.d.ts +55 -0
- package/types/src/charts/Plot/forecastScene.d.ts +5 -0
- package/types/src/charts/Plot/index.d.ts +28 -8
- package/types/src/charts/Plot/labelPlacement.d.ts +5 -0
- package/types/src/charts/Plot/lineLabelEmit.d.ts +48 -0
- package/types/src/charts/Plot/lineLabelSides.d.ts +50 -0
- package/types/src/charts/Plot/lineLabelSpread.d.ts +15 -0
- package/types/src/charts/Plot/lineLabelsAlong.d.ts +116 -0
- package/types/src/charts/Plot/pipeline.d.ts +15 -1
- package/types/src/charts/Plot/pipelineLineLabels.d.ts +68 -0
- package/types/src/charts/Plot/plotFacet.d.ts +5 -0
- package/types/src/charts/Plot/plotInit.d.ts +23 -2
- package/types/src/charts/Plot/plotRangeBreaks.d.ts +35 -0
- package/types/src/charts/Plot/plotZoom.d.ts +2 -0
- package/types/src/charts/Plot/referenceDomains.d.ts +49 -0
- package/types/src/charts/Plot/sharedHoverScene.d.ts +3 -3
- package/types/src/charts/Plot/sharedTooltip.d.ts +11 -4
- package/types/src/charts/Plot/stackHelpers.d.ts +5 -0
- package/types/src/charts/Plot/stackLegendOrder.d.ts +83 -0
- package/types/src/charts/Plot/stackThreshold.d.ts +75 -0
- package/types/src/charts/Plot/trendLabels.d.ts +73 -0
- package/types/src/charts/Plot/trendTooltip.d.ts +6 -0
- package/types/src/charts/Priestley/timeAxis.d.ts +76 -0
- package/types/src/charts/Radar/axisDecorations.d.ts +7 -2
- package/types/src/charts/Radar/curvedLabels.d.ts +94 -0
- package/types/src/charts/RadialBar/curvedLabels.d.ts +31 -0
- package/types/src/charts/RadialBar/trackLayout.d.ts +34 -3
- package/types/src/charts/Rings/emit.d.ts +50 -0
- package/types/src/charts/Rings/ringsGraph.d.ts +10 -2
- package/types/src/charts/Rings/ringsLoops.d.ts +13 -0
- package/types/src/charts/Rings/ringsParallel.d.ts +43 -0
- package/types/src/charts/Sankey/circularLayout.d.ts +103 -0
- package/types/src/charts/Sankey/circularLinks.d.ts +178 -0
- package/types/src/charts/Sankey/emit.d.ts +58 -0
- package/types/src/charts/Sankey/labels.d.ts +19 -0
- package/types/src/charts/Sankey/ribbons.d.ts +36 -0
- package/types/src/charts/Sankey/sankeyCycles.d.ts +24 -0
- package/types/src/charts/Sankey/sankeyLayout.d.ts +6 -0
- package/types/src/charts/Sankey/sankeyLinks.d.ts +36 -0
- package/types/src/charts/Scatter/index.d.ts +15 -0
- package/types/src/charts/SlopeChart/index.d.ts +43 -0
- package/types/src/charts/SlopeChart/slope.d.ts +43 -0
- package/types/src/charts/Streamgraph/index.d.ts +28 -0
- package/types/src/charts/Sunburst/curvedLabels.d.ts +56 -0
- package/types/src/charts/Treemap/emit.d.ts +2 -1
- package/types/src/charts/Treemap/emitGroupHeaders.d.ts +16 -0
- package/types/src/charts/Treemap/groupHeaders.d.ts +91 -0
- package/types/src/charts/Treemap/index.d.ts +2 -0
- package/types/src/charts/Treemap/thresholdFunction.d.ts +5 -2
- package/types/src/charts/definition/ChartDefinition.d.ts +27 -2
- package/types/src/charts/definition/makeChart.d.ts +5 -3
- package/types/src/charts/drawSteps/backControl.d.ts +7 -22
- package/types/src/charts/drawSteps/gestureHover.d.ts +33 -0
- package/types/src/charts/drawSteps/minimapMarkup.d.ts +5 -4
- package/types/src/charts/drawSteps/saveChart.d.ts +47 -0
- package/types/src/charts/drawSteps/saveControl.d.ts +9 -0
- package/types/src/charts/drawSteps/saveControlMarkup.d.ts +44 -0
- package/types/src/charts/drawSteps/tableViewMarkup.d.ts +4 -1
- package/types/src/charts/drawSteps/topLeftControls.d.ts +1 -1
- package/types/src/charts/drawSteps/topLeftControlsMarkup.d.ts +1 -1
- package/types/src/charts/drawSteps/zoomGesture.d.ts +32 -0
- package/types/src/charts/events/click.legend.d.ts +2 -1
- package/types/src/charts/facet/facetConfig.d.ts +4 -2
- package/types/src/charts/facet/facetData.d.ts +1 -1
- package/types/src/charts/features/annotationFrame.d.ts +108 -0
- package/types/src/charts/features/annotationText.d.ts +57 -0
- package/types/src/charts/features/annotationTypes.d.ts +161 -0
- package/types/src/charts/features/axesMeasure.d.ts +13 -1
- package/types/src/charts/features/calloutLayout.d.ts +78 -0
- package/types/src/charts/features/calloutScene.d.ts +40 -0
- package/types/src/charts/features/chartGeometry.d.ts +1 -1
- package/types/src/charts/features/circleLabelPlacement.d.ts +97 -0
- package/types/src/charts/features/circleLabels.d.ts +130 -0
- package/types/src/charts/features/colorScaleBucket.d.ts +9 -0
- package/types/src/charts/features/colorScaleHover.d.ts +32 -0
- package/types/src/charts/features/colorScaleValue.d.ts +35 -0
- package/types/src/charts/features/curvedArrows.d.ts +105 -0
- package/types/src/charts/features/edgeArrows.d.ts +74 -2
- package/types/src/charts/features/edgeBundling.d.ts +86 -0
- package/types/src/charts/features/edgeBundlingSmooth.d.ts +29 -0
- package/types/src/charts/features/ensureZoomDom.d.ts +19 -1
- package/types/src/charts/features/features.d.ts +8 -0
- package/types/src/charts/features/featuresLegend.d.ts +4 -3
- package/types/src/charts/features/legendKeys.d.ts +34 -0
- package/types/src/charts/features/lineLabels.d.ts +15 -12
- package/types/src/charts/features/linkBundle.d.ts +16 -0
- package/types/src/charts/features/linkColor.d.ts +48 -0
- package/types/src/charts/features/linkFields.d.ts +16 -0
- package/types/src/charts/features/linkFocus.d.ts +51 -0
- package/types/src/charts/features/linkInteraction.d.ts +183 -0
- package/types/src/charts/features/linkKeys.d.ts +11 -0
- package/types/src/charts/features/linkLabelGeometry.d.ts +67 -0
- package/types/src/charts/features/linkLabelPath.d.ts +85 -0
- package/types/src/charts/features/linkLabels.d.ts +77 -0
- package/types/src/charts/features/linkWidths.d.ts +19 -0
- package/types/src/charts/features/pathLabelGeometry.d.ts +99 -0
- package/types/src/charts/features/pathLabels.d.ts +41 -0
- package/types/src/charts/features/plotAnnotations.d.ts +23 -8
- package/types/src/charts/features/plotPaint.d.ts +19 -0
- package/types/src/charts/features/polyline.d.ts +32 -0
- package/types/src/charts/features/referenceAnnotations.d.ts +130 -0
- package/types/src/charts/features/referenceLabelPlacement.d.ts +58 -0
- package/types/src/charts/features/ringLabelNodes.d.ts +63 -0
- package/types/src/charts/features/ringLabels.d.ts +164 -0
- package/types/src/charts/features/sceneBounds.d.ts +6 -0
- package/types/src/charts/features/selfLoops.d.ts +165 -0
- package/types/src/charts/features/shapeEmit.d.ts +5 -1
- package/types/src/charts/features/shareKey.d.ts +9 -0
- package/types/src/charts/features/sharedFields.d.ts +11 -2
- package/types/src/charts/features/textHalo.d.ts +14 -0
- package/types/src/charts/features/thresholdMembers.d.ts +38 -0
- package/types/src/charts/helpers/valueTitle.d.ts +4 -2
- package/types/src/charts/index.d.ts +8 -0
- package/types/src/charts/partition/interaction.d.ts +6 -3
- package/types/src/charts/partition/zoom.d.ts +4 -4
- package/types/src/charts/pipeline/preDrawData.d.ts +14 -1
- package/types/src/charts/pipeline/stages.d.ts +9 -0
- package/types/src/charts/pipeline/vizDraw.d.ts +8 -3
- package/types/src/charts/pipeline/vizPreDraw.d.ts +3 -2
- package/types/src/charts/plotBuffers/discreteBuffer.d.ts +0 -5
- package/types/src/charts/viz/Viz.d.ts +44 -6
- package/types/src/charts/viz/VizBase.d.ts +16 -7
- package/types/src/charts/viz/backgroundInk.d.ts +11 -4
- package/types/src/charts/viz/dataPoller.d.ts +28 -0
- package/types/src/charts/viz/focusRing.d.ts +25 -0
- package/types/src/charts/viz/focusTargets.d.ts +56 -0
- package/types/src/charts/viz/groupRow.d.ts +24 -0
- package/types/src/charts/viz/history.d.ts +35 -0
- package/types/src/charts/viz/interactionOpacity.d.ts +3 -1
- package/types/src/charts/viz/keyboardNav.d.ts +55 -0
- package/types/src/charts/viz/keyboardNavHost.d.ts +53 -0
- package/types/src/charts/viz/loaderFormat.d.ts +78 -0
- package/types/src/charts/viz/missingFields.d.ts +57 -0
- package/types/src/charts/viz/mountTarget.d.ts +7 -0
- package/types/src/charts/viz/nearestHover.d.ts +75 -0
- package/types/src/charts/viz/nearestHoverSurface.d.ts +21 -0
- package/types/src/charts/viz/ordinalColor.d.ts +10 -8
- package/types/src/charts/viz/pageTheme.d.ts +34 -0
- package/types/src/charts/viz/pointTooltipAnchor.d.ts +36 -0
- package/types/src/charts/viz/pointVoronoi.d.ts +65 -0
- package/types/src/charts/viz/reducedMotion.d.ts +25 -0
- package/types/src/charts/viz/reportHandlerError.d.ts +7 -0
- package/types/src/charts/viz/shapeClassTargets.d.ts +6 -0
- package/types/src/charts/viz/simpleHover.d.ts +2 -1
- package/types/src/charts/viz/vizClassName.d.ts +23 -0
- package/types/src/charts/viz/vizDataPolling.d.ts +48 -0
- package/types/src/charts/viz/vizDefaults.d.ts +49 -9
- package/types/src/charts/viz/vizFields.d.ts +47 -0
- package/types/src/charts/viz/vizRender.d.ts +2 -1
- package/types/src/charts/viz/vizTheme.d.ts +40 -0
- package/types/src/charts/viz/vizTypes.d.ts +117 -8
- package/types/src/charts/viz/vizVisibility.d.ts +6 -0
- package/types/src/components/Axis/Axis.d.ts +37 -8
- package/types/src/components/Axis/AxisBottom.d.ts +1 -0
- package/types/src/components/Axis/AxisLeft.d.ts +1 -0
- package/types/src/components/Axis/AxisRight.d.ts +1 -0
- package/types/src/components/Axis/AxisTop.d.ts +1 -0
- package/types/src/components/Axis/axisBreak.d.ts +2 -0
- package/types/src/components/Axis/axisLabelAngle.d.ts +110 -0
- package/types/src/components/Axis/axisLabelThinning.d.ts +3 -7
- package/types/src/components/Axis/axisLayout.d.ts +5 -0
- package/types/src/components/Axis/axisLayoutLabels.d.ts +13 -0
- package/types/src/components/Axis/axisRangeBreaks.d.ts +25 -0
- package/types/src/components/Axis/axisRounding.d.ts +6 -3
- package/types/src/components/Axis/axisSlantWrap.d.ts +22 -0
- package/types/src/components/Axis/brokenTimeScale.d.ts +51 -0
- package/types/src/components/Axis/powTicks.d.ts +29 -0
- package/types/src/components/Axis/rangeBreaks.d.ts +82 -0
- package/types/src/components/Axis/timeValues.d.ts +1 -1
- package/types/src/components/ColorScale/ColorScale.d.ts +14 -0
- package/types/src/components/ColorScale/bucketBounds.d.ts +28 -0
- package/types/src/components/ColorScale/colorScaleHoverMark.d.ts +86 -0
- package/types/src/components/ColorScale/colorScaleScale.d.ts +3 -0
- package/types/src/components/ColorScale/colorScaleType.d.ts +17 -0
- package/types/src/components/Legend/Legend.d.ts +1 -0
- package/types/src/components/SizeLegend/SizeLegend.d.ts +1 -0
- package/types/src/components/TextBox.d.ts +1 -0
- package/types/src/components/Timeline/Timeline.d.ts +1 -0
- package/types/src/components/Timeline/brushSpan.d.ts +41 -0
- package/types/src/components/Timeline/timelineConfig.d.ts +11 -0
- package/types/src/components/Timeline/timelineMode.d.ts +17 -0
- package/types/src/components/Timeline/timelineRender.d.ts +8 -0
- package/types/src/components/Tooltip.d.ts +12 -3
- package/types/src/components/fontStack.d.ts +10 -0
- package/types/src/components/textBoxLayout.d.ts +18 -9
- package/types/src/components/textBoxPath.d.ts +59 -0
- package/types/src/components/textBoxScene.d.ts +51 -0
- package/types/src/components/textBoxWords.d.ts +33 -0
- package/types/src/shapes/Area.d.ts +1 -0
- package/types/src/shapes/Bar.d.ts +1 -0
- package/types/src/shapes/Box.d.ts +2 -8
- package/types/src/shapes/Circle.d.ts +1 -0
- package/types/src/shapes/Line.d.ts +1 -0
- package/types/src/shapes/Path.d.ts +1 -0
- package/types/src/shapes/Rect.d.ts +1 -0
- package/types/src/shapes/Shape.d.ts +1 -0
- package/types/src/shapes/Whisker.d.ts +1 -0
- package/types/src/shapes/boxOutlierShape.d.ts +9 -0
- package/types/src/shapes/boxStats.d.ts +19 -0
- package/types/src/shapes/boxStyle.d.ts +25 -0
- package/types/src/shapes/boxSummary.d.ts +66 -0
- package/types/src/shapes/emitLabels.d.ts +1 -1
- package/types/src/shapes/shapeConfig.d.ts +42 -4
- package/types/src/utils/BaseClass.d.ts +32 -0
- package/types/src/utils/D3Scale.d.ts +3 -0
- package/types/src/utils/D3plusConfig.d.ts +1240 -33
- package/types/src/utils/className.d.ts +64 -0
- package/types/src/utils/configPrep.d.ts +2 -0
- package/types/src/utils/configWarnings.d.ts +21 -2
- package/types/src/utils/constant.d.ts +8 -0
- package/types/src/utils/displayName.d.ts +10 -0
- package/types/src/utils/fieldAccessor.d.ts +24 -0
- package/types/src/utils/index.d.ts +1 -1
- package/types/src/utils/paintComponentScene.d.ts +3 -1
- package/types/src/utils/theme.d.ts +170 -0
- package/types/src/utils/themeInk.d.ts +56 -0
- package/umd/d3plus-core.full.js +87388 -56271
- package/umd/d3plus-core.full.min.js +2 -2
- package/umd/d3plus-core.js +37988 -11768
- package/umd/d3plus-core.min.js +2 -2
- package/es/src/components/Axis/gridStroke.js +0 -10
- package/types/src/components/Axis/gridStroke.d.ts +0 -8
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Where each Sunburst arc's label goes (see `labelPosition`): a straight
|
|
3
|
+
box along the ring or along the radius (`sunburstLabelBox`), or a curve
|
|
4
|
+
along the arc itself (`ringLabelFit`), whichever shows the label larger.
|
|
5
|
+
A curve reads like the box along the ring but follows it, so it wins that
|
|
6
|
+
tie; the box along the radius suits the narrow arcs of the outer rings,
|
|
7
|
+
where a name runs out of arc long before it runs out of ring.
|
|
8
|
+
*/
|
|
9
|
+
import type { SceneNode } from "@d3plus/render";
|
|
10
|
+
import type { RingLabelFit } from "../features/ringLabels.js";
|
|
11
|
+
import type { LabelMetrics } from "../partition/labelWords.js";
|
|
12
|
+
import type { VizInstance } from "../viz/vizTypes.js";
|
|
13
|
+
import type { SunburstLabelBox } from "./labelFit.js";
|
|
14
|
+
import type { SunburstArc } from "./geometry.js";
|
|
15
|
+
import type { SunburstNode } from "./partition.js";
|
|
16
|
+
/** Every labeled arc's straight box or curve. */
|
|
17
|
+
export interface SunburstLabelPlacements {
|
|
18
|
+
boxes: Map<SunburstNode, SunburstLabelBox>;
|
|
19
|
+
curves: Map<SunburstNode, RingLabelFit>;
|
|
20
|
+
}
|
|
21
|
+
/** What placing the labels needs. */
|
|
22
|
+
export interface SunburstLabelInputs {
|
|
23
|
+
/** Each node's label text. */
|
|
24
|
+
labelOf: (node: SunburstNode) => string;
|
|
25
|
+
/** Each node's padded arc. */
|
|
26
|
+
arcOf: (node: SunburstNode) => SunburstArc & {
|
|
27
|
+
padAngle?: number;
|
|
28
|
+
};
|
|
29
|
+
fontMin: number;
|
|
30
|
+
fontMax: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
A label's one-line width at a font size, from its words measured at 1px.
|
|
34
|
+
@param metrics The label's words and space at a 1px font size.
|
|
35
|
+
*/
|
|
36
|
+
export declare function metricsWidth(metrics: LabelMetrics): (fontSize: number) => number;
|
|
37
|
+
/**
|
|
38
|
+
Places every node's label, measured in the label font: a straight box,
|
|
39
|
+
a curve along its arc, or nothing when neither fits.
|
|
40
|
+
@param viz The chart.
|
|
41
|
+
@param nodes The laid-out nodes.
|
|
42
|
+
@param labelConfig The Path labelConfig.
|
|
43
|
+
@param inputs Each node's text and arc, and the font range.
|
|
44
|
+
*/
|
|
45
|
+
export declare function sunburstLabelPlacements(viz: VizInstance, nodes: SunburstNode[], labelConfig: Record<string, unknown>, inputs: SunburstLabelInputs): SunburstLabelPlacements;
|
|
46
|
+
/**
|
|
47
|
+
The text nodes for the curved labels.
|
|
48
|
+
@param viz The chart.
|
|
49
|
+
@param curves Each curved node's fit.
|
|
50
|
+
@param labelConfig The Path labelConfig.
|
|
51
|
+
@param inputs Each node's text and text color.
|
|
52
|
+
*/
|
|
53
|
+
export declare function sunburstCurvedNodes(viz: VizInstance, curves: Map<SunburstNode, RingLabelFit>, labelConfig: Record<string, unknown>, inputs: {
|
|
54
|
+
labelOf: (node: SunburstNode) => string;
|
|
55
|
+
colorOf: (node: SunburstNode) => string;
|
|
56
|
+
}): SceneNode[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
`treemapEmit` — scene nodes for a laid-out Treemap: one rect per cell
|
|
3
|
-
plus the title + share-% text labels for each cell, both as flat data
|
|
3
|
+
plus the title + share-% text labels for each cell, both as flat data,
|
|
4
|
+
then the group header strips above them.
|
|
4
5
|
*/
|
|
5
6
|
import type { ChartEmit } from "../definition/ChartDefinition.js";
|
|
6
7
|
export declare const treemapEmit: ChartEmit;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Scene nodes for the Treemap's group headers: a strip rect per header and
|
|
3
|
+
its left-aligned, single-line name.
|
|
4
|
+
*/
|
|
5
|
+
import type { DataPoint } from "@d3plus/data";
|
|
6
|
+
import type { SceneNode } from "@d3plus/render";
|
|
7
|
+
import type { VizInstance } from "../viz/vizTypes.js";
|
|
8
|
+
import type { GroupLabelStyle, TreemapGroupHeader } from "./groupHeaders.js";
|
|
9
|
+
/**
|
|
10
|
+
A header strip's default fill: a darker shade of its group's color, or,
|
|
11
|
+
when a colorScale colors the tiles by value, a neutral tone between the
|
|
12
|
+
chart's background and its ink.
|
|
13
|
+
*/
|
|
14
|
+
export declare function defaultGroupFill(viz: VizInstance, row: DataPoint, i: number): string;
|
|
15
|
+
/** The strip rects and name labels for `headers`. */
|
|
16
|
+
export declare function groupHeaderNodes(viz: VizInstance, headers: TreemapGroupHeader[], style: GroupLabelStyle): SceneNode[];
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Treemap group headers: with a nested `groupBy`, each group above the drawn
|
|
3
|
+
tiles gets a strip across its top naming it, and its tiles sit below the
|
|
4
|
+
strip. Every level above the tiles gets its own strip, nested inside its
|
|
5
|
+
parent's. A group too small for a readable strip gets none, and its tiles
|
|
6
|
+
fill it.
|
|
7
|
+
|
|
8
|
+
The layout reserves a strip through d3-hierarchy's `paddingTop`, which
|
|
9
|
+
sees each group's box before its children are tiled into it.
|
|
10
|
+
*/
|
|
11
|
+
import type { HierarchyRectangularNode } from "d3-hierarchy";
|
|
12
|
+
import { merge } from "@d3plus/data";
|
|
13
|
+
import type { DataPoint } from "@d3plus/data";
|
|
14
|
+
import type { VizInstance } from "../viz/vizTypes.js";
|
|
15
|
+
type Accessor<T> = T | ((d: DataPoint, i: number) => T);
|
|
16
|
+
/** The resolved `groupLabelConfig` for one draw. */
|
|
17
|
+
export interface GroupLabelStyle {
|
|
18
|
+
fill?: Accessor<string>;
|
|
19
|
+
fontColor?: Accessor<string>;
|
|
20
|
+
label?: (d: DataPoint, i: number) => unknown;
|
|
21
|
+
fontFamily?: string | string[];
|
|
22
|
+
fontSize: number;
|
|
23
|
+
fontWeight: number | string;
|
|
24
|
+
padding: number;
|
|
25
|
+
}
|
|
26
|
+
/** `groupLabelConfig` defaults, under the user's config. */
|
|
27
|
+
export declare const groupLabelDefaults: {
|
|
28
|
+
fontSize: number;
|
|
29
|
+
fontWeight: number;
|
|
30
|
+
padding: number;
|
|
31
|
+
};
|
|
32
|
+
/** A laid-out group's header strip, stamped on its hierarchy node. */
|
|
33
|
+
export interface TreemapGroupHeader {
|
|
34
|
+
__d3plus__: true;
|
|
35
|
+
/** The group's rows merged into one, stamped with its `groupBy` level. */
|
|
36
|
+
data: DataPoint;
|
|
37
|
+
/** The group's `groupBy` level. */
|
|
38
|
+
depth: number;
|
|
39
|
+
/** Unique across the chart: the group's key at each level. */
|
|
40
|
+
id: string;
|
|
41
|
+
x0: number;
|
|
42
|
+
y0: number;
|
|
43
|
+
x1: number;
|
|
44
|
+
y1: number;
|
|
45
|
+
}
|
|
46
|
+
type GroupNode = HierarchyRectangularNode<unknown> & {
|
|
47
|
+
data: {
|
|
48
|
+
key?: unknown;
|
|
49
|
+
};
|
|
50
|
+
groupHeader?: TreemapGroupHeader;
|
|
51
|
+
};
|
|
52
|
+
/** The groups that reserved a strip, with each strip's height. */
|
|
53
|
+
export type GroupStrips = Map<GroupNode, number>;
|
|
54
|
+
/**
|
|
55
|
+
The chart's group-header style, or null when headers are off
|
|
56
|
+
(`groupLabels: false`).
|
|
57
|
+
*/
|
|
58
|
+
export declare function groupLabelStyle(viz: VizInstance): GroupLabelStyle | null;
|
|
59
|
+
/** A strip's height: one line of text plus its padding above and below. */
|
|
60
|
+
export declare function groupStripHeight(style: Pick<GroupLabelStyle, "fontSize" | "padding">): number;
|
|
61
|
+
/**
|
|
62
|
+
Whether a group `width` × `height` pixels gets a strip: it keeps at least
|
|
63
|
+
a strip's height for its tiles below the strip, and is wide enough for a
|
|
64
|
+
few characters of its name.
|
|
65
|
+
*/
|
|
66
|
+
export declare function groupStripFits(width: number, height: number, style: Pick<GroupLabelStyle, "fontSize" | "padding">): boolean;
|
|
67
|
+
/**
|
|
68
|
+
The treemap's `paddingTop`: a group above the drawn tiles (hierarchy depth
|
|
69
|
+
1 through `drawDepth`) that fits a strip reserves it, and is recorded in
|
|
70
|
+
`strips` with the strip's height; every other node keeps `padding`.
|
|
71
|
+
*/
|
|
72
|
+
export declare function groupPaddingTop(opts: {
|
|
73
|
+
drawDepth: number;
|
|
74
|
+
padding: number;
|
|
75
|
+
style: GroupLabelStyle | null;
|
|
76
|
+
}, strips: GroupStrips): (node: HierarchyRectangularNode<unknown>) => number;
|
|
77
|
+
/**
|
|
78
|
+
Stamps each group that reserved a strip with its header: the strip's box
|
|
79
|
+
(in the group's final, rounded position) and the group's merged row,
|
|
80
|
+
carrying its share of `total` and, when `label` gives one, its own label.
|
|
81
|
+
*/
|
|
82
|
+
export declare function attachGroupHeaders(strips: GroupStrips, opts: {
|
|
83
|
+
aggs: Parameters<typeof merge>[1];
|
|
84
|
+
label?: GroupLabelStyle["label"];
|
|
85
|
+
total: number;
|
|
86
|
+
}): void;
|
|
87
|
+
/** The headers above the laid-out tiles, shallowest level first. */
|
|
88
|
+
export declare function collectGroupHeaders(leaves: {
|
|
89
|
+
parent: object | null;
|
|
90
|
+
}[]): TreemapGroupHeader[];
|
|
91
|
+
export {};
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
- `applyLayout.ts` — chart-specific `TransformStage`.
|
|
6
6
|
- `emit.ts` — rect + label scene nodes from the laid-out data.
|
|
7
7
|
- `thresholdFunction.ts` — pure threshold-merge algorithm.
|
|
8
|
+
- `groupHeaders.ts` / `emitGroupHeaders.ts` — the header strip above
|
|
9
|
+
each group of a nested `groupBy`.
|
|
8
10
|
|
|
9
11
|
The default export is the chart class via `makeChart(def)`; the named
|
|
10
12
|
export is the def itself.
|
|
@@ -15,11 +15,14 @@ export interface ThresholdInputs {
|
|
|
15
15
|
threshold: (branchData: DataPoint[]) => number;
|
|
16
16
|
/** Per-datum value accessor compared against `threshold * totalSum`. */
|
|
17
17
|
thresholdKey: (d: DataPoint) => number;
|
|
18
|
+
/** Names each bucketed item in the bucket's member list (default: its id). */
|
|
19
|
+
label?: (d: DataPoint, i: number) => string;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
Walks `data` to `drawDepth` and merges entries whose `thresholdKey`
|
|
21
23
|
value falls below `threshold(branchData) * totalSum` into a single
|
|
22
|
-
aggregated row at that depth
|
|
23
|
-
|
|
24
|
+
aggregated row at that depth, listing them (largest first) under
|
|
25
|
+
`MEMBERS_KEY`. A lone entry under the threshold stays as itself: a
|
|
26
|
+
bucket needs two. Returns the kept set; original `data` is not mutated.
|
|
24
27
|
*/
|
|
25
28
|
export declare function thresholdFunction(data: DataPoint[], inputs: ThresholdInputs): DataPoint[];
|
|
@@ -53,6 +53,25 @@ interface ChartDefinitionBase {
|
|
|
53
53
|
chart has no room to offer.
|
|
54
54
|
*/
|
|
55
55
|
insetRegion?: (viz: VizInstance) => InsetRegion | null;
|
|
56
|
+
/**
|
|
57
|
+
Optional rows for the table view, in place of the chart's data: for a
|
|
58
|
+
chart whose marks come from more than its data (ArcDiagram's nodes and
|
|
59
|
+
links). Return null to show the data.
|
|
60
|
+
*/
|
|
61
|
+
tableData?: (viz: VizInstance) => DataPoint[] | null;
|
|
62
|
+
/**
|
|
63
|
+
Optional shape a colorScale row draws as, when it isn't the row's
|
|
64
|
+
`shape`: the `shapeConfig` key the colorScale's bucket swatches take
|
|
65
|
+
their stroke and opacity from (a Geomap row drawn as a topojson Path).
|
|
66
|
+
*/
|
|
67
|
+
colorScaleShape?: (viz: VizInstance, d: DataPoint, i: number) => string;
|
|
68
|
+
/**
|
|
69
|
+
Optional test for which painted scene nodes are point marks, the marks
|
|
70
|
+
nearest-point hover (`hoverDistance`) resolves the pointer to (see
|
|
71
|
+
`isPointShape`). Without one, the base chart's applies (none for a
|
|
72
|
+
data-driven chart; Circle and Rect shapes for the Plot family).
|
|
73
|
+
*/
|
|
74
|
+
pointMark?: (viz: VizInstance, node: SceneNode) => boolean;
|
|
56
75
|
/**
|
|
57
76
|
Optional small-multiples hooks (see `facet/facetConfig.ts`): the panel
|
|
58
77
|
aspect the chart reads best at, and for charts with scales, how panels
|
|
@@ -60,8 +79,14 @@ interface ChartDefinitionBase {
|
|
|
60
79
|
panel drawn the way the whole chart is.
|
|
61
80
|
*/
|
|
62
81
|
facet?: FacetHooks;
|
|
63
|
-
/**
|
|
64
|
-
|
|
82
|
+
/**
|
|
83
|
+
Optional pure threshold algorithm (replaces the base chart's
|
|
84
|
+
`_thresholdFunction`): returns the drawn rows `data` with small items
|
|
85
|
+
bucketed. `all` holds every row they were drawn from, legend-hidden
|
|
86
|
+
ones included. The legend's rows run through it too, so the legend
|
|
87
|
+
shows the bucket rather than the items it holds.
|
|
88
|
+
*/
|
|
89
|
+
thresholdFunction?: (viz: VizInstance, data: unknown[], all?: unknown[]) => unknown[];
|
|
65
90
|
/**
|
|
66
91
|
Optional chart-specific `_chartTransform` builder. Receives the viz
|
|
67
92
|
after the layout stage runs; returns the transform applied to the
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
The class is identical for every chart: its constructor runs
|
|
6
6
|
`applyDefinition(this, def)`, its `_draw` runs the shared Viz pipeline
|
|
7
7
|
then the chart's own layout stage via `runChartDraw`, and its
|
|
8
|
-
`_thresholdFunction` / `_sizeLegendScale` / `_insetRegion`
|
|
9
|
-
`
|
|
10
|
-
|
|
8
|
+
`_thresholdFunction` / `_thresholdLegend` / `_sizeLegendScale` / `_insetRegion` /
|
|
9
|
+
`_tableData` / `_colorScaleShape` / `_pointMark` delegate to `def.thresholdFunction` /
|
|
10
|
+
`def.sizeLegendScale` / `def.insetRegion` / `def.tableData` / `def.colorScaleShape` /
|
|
11
|
+
`def.pointMark` if
|
|
12
|
+
present (else to the base chart's), `_facetHooks` layers `def.facet` over the base chart's, and
|
|
11
13
|
`toScene` passes the base chart's scene through `def.decorateScene`.
|
|
12
14
|
|
|
13
15
|
A chart's `index.ts` becomes literally `export default makeChart(def)`.
|
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
The "← Back" control's contribution to the shared top-left controls
|
|
3
|
-
panel (`topLeftControls.ts`) — visible only when the chart has
|
|
4
|
-
drill-down history to pop. Styled like the zoom/search controls: a real
|
|
5
|
-
`<button>` at the same 20px height, an SVG arrow icon (not a text
|
|
6
|
-
glyph), and no default background/border/color — a plain
|
|
7
|
-
browser-appearance button that lets native/host-page button chrome
|
|
8
|
-
show through, restylable via `.backControlStyle()`/
|
|
9
|
-
`.backControlClassName()` the same way zoom/search are.
|
|
10
|
-
|
|
11
|
-
Previously `backFeature` rendered "← Back" as an SVG text scene node in
|
|
12
|
-
its own margin-claiming row, with its click routed through
|
|
13
|
-
`Viz._routeSceneEvent`'s `interactionGroup === "back"` special case —
|
|
14
|
-
the only way to attach a click handler to a plain scene text node. As a
|
|
15
|
-
real button inside the shared `htmlOverlay` panel, its click instead
|
|
16
|
-
rides the same declarative delegated-events map every other top-left/
|
|
17
|
-
zoom control uses, and it claims no margin of its own — like zoom, it
|
|
18
|
-
floats over whatever's there, and content that needs to avoid it insets
|
|
19
|
-
around the whole panel via `topLeftControlsInset`.
|
|
20
|
-
|
|
21
|
-
@module
|
|
22
|
-
*/
|
|
23
1
|
import type Viz from "../viz/Viz.js";
|
|
24
2
|
import type { Contribution } from "./topLeftControlsMarkup.js";
|
|
25
3
|
/** Paints the back button's inline style. There's no active/hover override — unlike zoom/search it's not a toggle, so it relies on the browser's native `:hover`, like their own hover default (`false`) already does. */
|
|
26
4
|
export declare function paintBackButton(viz: Viz, btn: HTMLElement): void;
|
|
5
|
+
/**
|
|
6
|
+
Pops the Back history and re-renders: a legend entry puts back the
|
|
7
|
+
legend's hide/solo state (mirrored to linked charts), a drill-down entry
|
|
8
|
+
the view (and any legend state the drill cleared) before it. With no
|
|
9
|
+
entry left, steps up a level.
|
|
10
|
+
*/
|
|
11
|
+
export declare function goBack(viz: Viz): void;
|
|
27
12
|
/** The back button's markup: a real `<button>` (icon + visible "Back" text), so host-page button styling applies through the cascade once `backControlClassName` auto-disables the inline default. */
|
|
28
13
|
export declare function backControlsHtml(viz: Viz): string;
|
|
29
14
|
export declare function backContribution(viz: Viz): Contribution | null;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Tooltips and hover during zoom gestures. Once a drag pans the chart (or
|
|
3
|
+
turns a Geomap globe), or a wheel or pinch zooms it, the marks move out
|
|
4
|
+
from under a pointer that d3-zoom keeps from reporting moves: the pointer
|
|
5
|
+
leaves whatever it was over, hiding its tooltip and hover, and pointer
|
|
6
|
+
events wait for the gesture to end. The next move after it hovers what is
|
|
7
|
+
under the pointer then. A press that lets go without moving changes
|
|
8
|
+
nothing, so a click behaves as without zoom.
|
|
9
|
+
|
|
10
|
+
@module
|
|
11
|
+
*/
|
|
12
|
+
import type { ZoomGestureEvent } from "./zoomGesture.js";
|
|
13
|
+
import type { VizInstance } from "../viz/vizTypes.js";
|
|
14
|
+
type Point = [number, number];
|
|
15
|
+
/** The client position of a mouse or wheel event, or of a touch event's first touch. */
|
|
16
|
+
export declare function clientPoint(event: Event | null | undefined): Point | null;
|
|
17
|
+
/**
|
|
18
|
+
Whether a zoom gesture's source event moves the chart: a wheel, a touch
|
|
19
|
+
move, or a mouse move away from where the press began. Programmatic zooms
|
|
20
|
+
(no source event) and the press itself don't.
|
|
21
|
+
@param press The press's client position, if the gesture began with one.
|
|
22
|
+
@param source The event behind a d3-zoom "zoom" event.
|
|
23
|
+
*/
|
|
24
|
+
export declare function gestureMoves(press: Point | null, source: Event | null | undefined): boolean;
|
|
25
|
+
/** Whether a zoom gesture is moving the chart, so pointer events wait. */
|
|
26
|
+
export declare function gestureHolds(viz: Pick<VizInstance, "_gestureHover">): boolean;
|
|
27
|
+
/** A zoom gesture begins (d3-zoom's "start"). */
|
|
28
|
+
export declare function gestureHoverStart(viz: VizInstance, event: ZoomGestureEvent): void;
|
|
29
|
+
/** A zoom gesture moves (d3-zoom's "zoom"): the first move leaves the hovered mark. */
|
|
30
|
+
export declare function gestureHoverMove(viz: VizInstance, event: ZoomGestureEvent): void;
|
|
31
|
+
/** A zoom gesture ends (d3-zoom's "end"). */
|
|
32
|
+
export declare function gestureHoverEnd(viz: VizInstance): void;
|
|
33
|
+
export {};
|
|
@@ -28,10 +28,11 @@ export declare function formatZoomLabel(k: number): string;
|
|
|
28
28
|
`minimap.ts`), the same reason `zoomControlsHtml` bakes in everything
|
|
29
29
|
that CAN change (locale, className) but nothing here changes per-tick.
|
|
30
30
|
The viewport box is `tabindex="0"` so it's keyboard-focusable — arrow
|
|
31
|
-
keys nudge the pan, matching what the `aria-label` describes.
|
|
32
|
-
`
|
|
33
|
-
`slider` is one-dimensional),
|
|
34
|
-
|
|
31
|
+
keys nudge the pan, matching what the `aria-label` describes. Its role
|
|
32
|
+
is `application`, like the chart's keyboard-nav host: a 2D pan target
|
|
33
|
+
has no widget role (a `slider` is one-dimensional), `aria-label` isn't
|
|
34
|
+
allowed on a div without a role, and `application` also has screen
|
|
35
|
+
readers pass the arrow keys through instead of reading the page.
|
|
35
36
|
|
|
36
37
|
`minimapClassName` (documented as applying to all three elements — the
|
|
37
38
|
outer box, viewport box, and label) is appended to the viewport/label
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { SaveFormat } from "../../utils/D3plusConfig.js";
|
|
2
|
+
import type Viz from "../viz/Viz.js";
|
|
3
|
+
/** Every format the download button can save, in its default menu order. */
|
|
4
|
+
export declare const SAVE_FORMATS: SaveFormat[];
|
|
5
|
+
/** The valid, de-duplicated formats in `value`, or every format when `value` isn't an array. */
|
|
6
|
+
export declare function saveFormats(value: unknown): SaveFormat[];
|
|
7
|
+
/**
|
|
8
|
+
A filename (without extension) from a title: markup and characters that
|
|
9
|
+
file systems reject are dropped, whitespace collapsed, and the result
|
|
10
|
+
capped at 100 characters. `"download"` when nothing is left.
|
|
11
|
+
*/
|
|
12
|
+
export declare function saveFilename(title: unknown): string;
|
|
13
|
+
export interface ResolvedSaveConfig {
|
|
14
|
+
filename: string;
|
|
15
|
+
formats: SaveFormat[];
|
|
16
|
+
background: string | false;
|
|
17
|
+
callback?: (error?: Error) => void;
|
|
18
|
+
renderOptions: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
/** `saveControlConfig` with its defaults applied. */
|
|
21
|
+
export declare function resolveSaveConfig(viz: Viz): ResolvedSaveConfig;
|
|
22
|
+
/** The chart's drawing surface: its `<canvas>` on the Canvas backend, else its `<svg>`. */
|
|
23
|
+
export declare function saveTarget(viz: Viz): HTMLElement | SVGElement | null;
|
|
24
|
+
/**
|
|
25
|
+
A detached copy of the chart's `<svg>` to save as a file, with a rect
|
|
26
|
+
filling `background` behind everything (none when `false`). The SVG
|
|
27
|
+
backend copies its live `<svg>`; the Canvas backend parses the scene
|
|
28
|
+
re-rendered as SVG markup.
|
|
29
|
+
*/
|
|
30
|
+
export declare function svgForSave(viz: Viz, background: string | false): SVGSVGElement | null;
|
|
31
|
+
/** The pixel density a PNG or JPG is drawn at: `pixelRatio`, else the screen's. */
|
|
32
|
+
export declare function savePixelRatio(renderOptions: Record<string, unknown>): number;
|
|
33
|
+
/**
|
|
34
|
+
Whether a canvas has fewer backing pixels per CSS pixel than
|
|
35
|
+
`pixelRatio`, so drawing an image from it would come out blurry.
|
|
36
|
+
*/
|
|
37
|
+
export declare function canvasTooCoarse(canvas: {
|
|
38
|
+
width: number;
|
|
39
|
+
getBoundingClientRect(): {
|
|
40
|
+
width: number;
|
|
41
|
+
};
|
|
42
|
+
}, pixelRatio: number): boolean;
|
|
43
|
+
/**
|
|
44
|
+
Saves the chart as a `format` file, named and styled by
|
|
45
|
+
`saveControlConfig`. Errors go to its `callback`, or to the console.
|
|
46
|
+
*/
|
|
47
|
+
export declare function saveChart(viz: Viz, format: SaveFormat): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type Viz from "../viz/Viz.js";
|
|
2
|
+
import type { Contribution } from "./topLeftControlsMarkup.js";
|
|
3
|
+
/** Whether the menu inside `root` is open. */
|
|
4
|
+
export declare function isSaveMenuOpen(root: HTMLElement): boolean;
|
|
5
|
+
/** Closes the menu inside `root`, returning focus to its button when `refocus`. */
|
|
6
|
+
export declare function closeSaveMenu(viz: Viz, root: HTMLElement, refocus?: boolean): void;
|
|
7
|
+
/** Opens the menu inside `root` and focuses its first (or last) item. */
|
|
8
|
+
export declare function openSaveMenu(viz: Viz, root: HTMLElement, focus?: "first" | "last"): void;
|
|
9
|
+
export declare function saveContribution(viz: Viz): Contribution | null;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Markup and styling for the download button (`saveControl.ts`): a toggle
|
|
3
|
+
button and the menu of file formats it opens.
|
|
4
|
+
|
|
5
|
+
The menu's open state lives only in the DOM (its `display` and the
|
|
6
|
+
button's `aria-expanded`), never in the generated html, so opening it
|
|
7
|
+
neither changes the panel's measured size nor makes the next repaint
|
|
8
|
+
rewrite the open menu.
|
|
9
|
+
|
|
10
|
+
@module
|
|
11
|
+
*/
|
|
12
|
+
import type { SaveFormat } from "../../utils/D3plusConfig.js";
|
|
13
|
+
import type Viz from "../viz/Viz.js";
|
|
14
|
+
import { type ControlButtonStyles, type StyleObject } from "./controlButtonStyle.js";
|
|
15
|
+
/** The English label of each format's menu item, translated through `translate`. */
|
|
16
|
+
export declare const SAVE_FORMAT_LABELS: Record<SaveFormat, string>;
|
|
17
|
+
/** Whether a chart shows the download button. */
|
|
18
|
+
export declare function showsSaveControl(viz: Viz): boolean;
|
|
19
|
+
/** The resolved base / active / hover styles of the download button. */
|
|
20
|
+
export declare function saveButtonStyles(viz: Viz): ControlButtonStyles;
|
|
21
|
+
/** Paints the download button's inline style for its state (base, hover, menu open). */
|
|
22
|
+
export declare function paintSaveButton(viz: Viz, btn: HTMLElement, hovered?: boolean): void;
|
|
23
|
+
/** The menu's fixed layout while closed; `SAVE_MENU_OPEN_STYLE` shows it. */
|
|
24
|
+
export declare const SAVE_MENU_STYLE: StyleObject;
|
|
25
|
+
export declare const SAVE_MENU_OPEN_STYLE: StyleObject;
|
|
26
|
+
/** The menu's and its items' resolved theme styles. */
|
|
27
|
+
export interface SaveMenuStyles {
|
|
28
|
+
menu: StyleObject;
|
|
29
|
+
item: StyleObject;
|
|
30
|
+
itemHover: StyleObject;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
Resolves `saveControlMenuStyle`, `saveControlMenuItemStyle`, and
|
|
34
|
+
`saveControlMenuItemStyleHover`, with `saveControlMenuClassName`
|
|
35
|
+
dropping whichever are still the defaults.
|
|
36
|
+
*/
|
|
37
|
+
export declare function saveMenuStyles(viz: Viz): SaveMenuStyles;
|
|
38
|
+
/** Paints a menu item's inline style, with the hover style while it has focus. */
|
|
39
|
+
export declare function paintSaveMenuItem(viz: Viz, item: HTMLElement, focused: boolean): void;
|
|
40
|
+
/**
|
|
41
|
+
The button's markup, plus its menu when more than one format is offered.
|
|
42
|
+
With one format, the button saves it directly and names it in its label.
|
|
43
|
+
*/
|
|
44
|
+
export declare function saveControlHtml(viz: Viz): string;
|
|
@@ -43,6 +43,7 @@ export declare function setTableViewDataSource(viz: Viz, value: TableViewDataSou
|
|
|
43
43
|
export declare function paintTableViewButton(viz: Viz, btn: HTMLElement, hovered?: boolean): void;
|
|
44
44
|
/** The cheap, non-DOM signature capturing the button's resolved style — see `Contribution.styleSignature`. */
|
|
45
45
|
export declare function tableViewButtonStyleSignature(viz: Viz): string;
|
|
46
|
+
export declare const DOWNLOAD_ICON = "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"width:12px;height:12px;vertical-align:middle;flex-shrink:0\"><path d=\"M12 3v12\"/><polyline points=\"7 11 12 16 17 11\"/><path d=\"M4 18v1a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-1\"/></svg>";
|
|
46
47
|
/** The toggle button's markup — a real `<button>` so host-page button styling applies once `tableViewControlClassName` disables the inline defaults. */
|
|
47
48
|
export declare function tableViewButtonHtml(viz: Viz): string;
|
|
48
49
|
/**
|
|
@@ -57,7 +58,9 @@ export declare function tableViewButtonHtml(viz: Viz): string;
|
|
|
57
58
|
default, or `viz._data` (raw, untouched input) once the toggle picks
|
|
58
59
|
"raw" — guarded by `hasDistinctRawData` so a stale `_tableViewDataSource`
|
|
59
60
|
from a previous, genuinely-different dataset can't silently switch a
|
|
60
|
-
chart whose raw/aggregate happen to now coincide.
|
|
61
|
+
chart whose raw/aggregate happen to now coincide. A chart that supplies
|
|
62
|
+
its own rows (`ChartDefinition.tableData`) shows those instead, in its
|
|
63
|
+
order, with no raw toggle.
|
|
61
64
|
|
|
62
65
|
Absent an explicit column sort, the AGGREGATE source is further
|
|
63
66
|
reordered (`defaultRowOrder`) to match the chart's original `.data()`
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
zoom-controls panel's "N buttons, one flex-row `htmlOverlay` panel"
|
|
5
5
|
composition (`zoomControls.ts`/`zoomControlsMarkup.ts`), except fed by
|
|
6
6
|
independent contributor functions (`backContribution`,
|
|
7
|
-
`tableViewContribution`, `searchContribution`) rather than one feature's
|
|
7
|
+
`tableViewContribution`, `saveContribution`, `searchContribution`) rather than one feature's
|
|
8
8
|
own fixed button set. A downstream branch adding a new top-left control
|
|
9
9
|
appends its own contributor function to `TOP_LEFT_CONTRIBUTORS` — a
|
|
10
10
|
one-line diff, not a dynamic registry.
|
|
@@ -53,7 +53,7 @@ export declare function buildTopLeftPanel(viz: Viz, contributions: Contribution[
|
|
|
53
53
|
The shared top-left panel's rendered size (padding included) as it will
|
|
54
54
|
render in the chart's page, so top-positioned content can leave room for
|
|
55
55
|
it — the same measure-a-hidden-probe technique `zoomControlsBox` uses,
|
|
56
|
-
generalized to whichever mix of controls (back / table-view / search)
|
|
56
|
+
generalized to whichever mix of controls (back / table-view / save / search)
|
|
57
57
|
is currently contributing, and to each contribution's OWN resolved
|
|
58
58
|
button styling (not just its markup). Returns null when nothing is
|
|
59
59
|
contributing.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
@module
|
|
5
5
|
*/
|
|
6
|
+
import type { ZoomTransform } from "d3-zoom";
|
|
6
7
|
/** The groups inside the zoom surface that hold a d3-brush: the timeline's and the zoom brush. */
|
|
7
8
|
export declare const BRUSH_GROUPS = "g.d3plus-viz-timeline, g.d3plus-zoom-brush";
|
|
8
9
|
/**
|
|
@@ -15,3 +16,34 @@ export declare const BRUSH_GROUPS = "g.d3plus-viz-timeline, g.d3plus-zoom-brush"
|
|
|
15
16
|
@param event The pointer event d3-zoom is filtering.
|
|
16
17
|
*/
|
|
17
18
|
export declare function startsOnBrush(event: Pick<Event, "target">): boolean;
|
|
19
|
+
/** A d3-zoom gesture event, as `ZoomGesture` reads it. */
|
|
20
|
+
export interface ZoomGestureEvent {
|
|
21
|
+
/** The zoom transform the event carries. */
|
|
22
|
+
transform: ZoomTransform;
|
|
23
|
+
/** The pointer or wheel event behind it, or null for a programmatic zoom. */
|
|
24
|
+
sourceEvent: Event | null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
A chart's own handling of the zoom behavior's gestures, consulted before
|
|
28
|
+
the zoom transform changes (Geomap turns a globe on a drag).
|
|
29
|
+
*/
|
|
30
|
+
export interface ZoomGesture {
|
|
31
|
+
/** A gesture begins. */
|
|
32
|
+
start(event: ZoomGestureEvent): void;
|
|
33
|
+
/** A gesture moves; true when the chart handled it, so the zoom transform is left alone. */
|
|
34
|
+
zoom(event: ZoomGestureEvent): boolean;
|
|
35
|
+
/** A gesture ends. */
|
|
36
|
+
end(event: ZoomGestureEvent): void;
|
|
37
|
+
/** The zoom controls' reset was pressed, just before the zoom resets. */
|
|
38
|
+
reset(): void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
The hover hold of a zoom gesture in progress (see `gestureHover.ts`):
|
|
42
|
+
where its press began, and whether it has moved the chart yet.
|
|
43
|
+
*/
|
|
44
|
+
export interface GestureHoverState {
|
|
45
|
+
/** The press's client position, or null for a gesture without one (a wheel). */
|
|
46
|
+
press: [number, number] | null;
|
|
47
|
+
/** Whether the gesture has moved the chart, holding off hover until it ends. */
|
|
48
|
+
moving: boolean;
|
|
49
|
+
}
|
|
@@ -2,7 +2,8 @@ import type { DataPoint } from "@d3plus/data";
|
|
|
2
2
|
import type Viz from "../viz/Viz.js";
|
|
3
3
|
/**
|
|
4
4
|
@module clickLegend
|
|
5
|
-
On click event for all legend shapes in a Viz.
|
|
5
|
+
On click event for all legend shapes in a Viz. A click that changes what
|
|
6
|
+
is hidden or solo'd goes on the chart's Back history (see `legendHistory`).
|
|
6
7
|
@private
|
|
7
8
|
*/
|
|
8
9
|
export default function (this: Viz, d: DataPoint, i: number, x: DataPoint, event: MouseEvent): void;
|
|
@@ -91,8 +91,8 @@ export interface FacetPanelContext {
|
|
|
91
91
|
default panel aspect.
|
|
92
92
|
*/
|
|
93
93
|
export interface FacetHooks {
|
|
94
|
-
/** The panel width/height ratio the chart reads best at, used to pick the grid shape. */
|
|
95
|
-
aspect?: number;
|
|
94
|
+
/** The panel width/height ratio the chart reads best at, used to pick the grid shape, or a function of the chart returning it. */
|
|
95
|
+
aspect?: number | ((viz: VizInstance) => number);
|
|
96
96
|
/** The chart's default for `FacetConfig.scales` (`"shared"` when unset). */
|
|
97
97
|
scales?: "shared" | "independent";
|
|
98
98
|
/** The chart's default for `FacetConfig.axes` (`"outer"` when unset), or a function of the chart returning it. */
|
|
@@ -106,6 +106,8 @@ export interface FacetHooks {
|
|
|
106
106
|
x?: boolean;
|
|
107
107
|
y?: boolean;
|
|
108
108
|
};
|
|
109
|
+
/** Runs before the chrome lays out, with each panel's rows (one array per panel), for chrome that reads what the panels draw (such as a stacked chart's legend order). */
|
|
110
|
+
chrome?: (viz: VizInstance, panels: DataPoint[][]) => void;
|
|
109
111
|
/** Computes the scales every panel shares from each panel's rows (one array per panel). Runs before any panel draws, when scales are shared. */
|
|
110
112
|
share?: (viz: VizInstance, panels: DataPoint[][]) => unknown;
|
|
111
113
|
/** Applies a panel's overrides before it draws; returns a function undoing them. */
|
|
@@ -37,7 +37,7 @@ export declare function facetGroups(viz: VizInstance, sort: FacetSort): FacetGro
|
|
|
37
37
|
/**
|
|
38
38
|
One panel's drawable rows: `rows` run through the same time filter,
|
|
39
39
|
rollup, legend hide/solo, and threshold the chart applies to its whole
|
|
40
|
-
dataset. `timeFilter` is computed once from the whole dataset, so every
|
|
40
|
+
dataset (a threshold that weighs rows weighs the whole chart's). `timeFilter` is computed once from the whole dataset, so every
|
|
41
41
|
panel shows the same period.
|
|
42
42
|
*/
|
|
43
43
|
export declare function facetFilteredData(viz: VizInstance, rows: DataPoint[], timeFilter: ReturnType<typeof computeTimeFilter>): DataPoint[];
|