@d3plus/core 4.12.0 → 4.13.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 +2 -2
- package/es/internal.js +155 -21
- package/es/src/charts/Alluvial/emit.js +3 -2
- package/es/src/charts/ArcDiagram/applyLayout.js +17 -10
- package/es/src/charts/ArcDiagram/arcGeometry.js +21 -8
- package/es/src/charts/ArcDiagram/arcLoops.js +5 -2
- package/es/src/charts/ArcDiagram/arcNodeBox.js +89 -0
- package/es/src/charts/ArcDiagram/emit.js +56 -27
- package/es/src/charts/ArcDiagram/events.js +10 -6
- package/es/src/charts/ArcDiagram/index.js +1 -1
- package/es/src/charts/BarChart/index.js +11 -0
- package/es/src/charts/BoxWhisker/extras.js +95 -0
- package/es/src/charts/BoxWhisker/index.js +77 -6
- package/es/src/charts/BoxWhisker/outliers.js +3 -2
- package/es/src/charts/BoxWhisker/summary.js +14 -3
- package/es/src/charts/BoxWhisker/tooltip.js +114 -29
- package/es/src/charts/BubbleChart/emit.js +9 -5
- package/es/src/charts/BubbleMatrix/colorDefaults.js +58 -0
- package/es/src/charts/BubbleMatrix/index.js +52 -0
- package/es/src/charts/Bullet/emit.js +3 -2
- package/es/src/charts/BumpChart/areaBump.js +175 -0
- package/es/src/charts/BumpChart/index.js +84 -18
- package/es/src/charts/Calendar/applyLayout.js +1 -1
- package/es/src/charts/Calendar/calendarDates.js +21 -7
- package/es/src/charts/Calendar/emit.js +3 -2
- package/es/src/charts/Calendar/index.js +14 -1
- package/es/src/charts/Candlestick/index.js +2 -1
- package/es/src/charts/Candlestick/periods.js +52 -29
- package/es/src/charts/Candlestick/tooltip.js +5 -7
- package/es/src/charts/Chord/emit.js +3 -2
- package/es/src/charts/ConnectedScatter/index.js +39 -0
- package/es/src/charts/CyclePlot/cycleFacet.js +162 -0
- package/es/src/charts/CyclePlot/cycleMeans.js +54 -0
- package/es/src/charts/CyclePlot/cyclePeriods.js +99 -0
- package/es/src/charts/CyclePlot/cycleTooltip.js +67 -0
- package/es/src/charts/CyclePlot/index.js +197 -0
- package/es/src/charts/DensityPlot/densityCurves.js +139 -0
- package/es/src/charts/DensityPlot/densityPoint.js +10 -0
- package/es/src/charts/DensityPlot/index.js +235 -0
- package/es/src/charts/DensityPlot/rug.js +144 -0
- package/es/src/charts/DotPlot/dotLayout.js +165 -0
- package/es/src/charts/DotPlot/facetSize.js +40 -0
- package/es/src/charts/DotPlot/index.js +173 -0
- package/es/src/charts/DotPlot/placements.js +121 -0
- package/es/src/charts/DotPlot/tooltip.js +68 -0
- package/es/src/charts/Dumbbell/arrowGrays.js +46 -0
- package/es/src/charts/Dumbbell/categoryChange.js +124 -0
- package/es/src/charts/Dumbbell/changeEmit.js +291 -0
- package/es/src/charts/Dumbbell/changes.js +87 -0
- package/es/src/charts/Dumbbell/connectors.js +46 -0
- package/es/src/charts/Dumbbell/emit.js +51 -50
- package/es/src/charts/Dumbbell/gapSort.js +2 -1
- package/es/src/charts/Dumbbell/index.js +121 -5
- package/es/src/charts/Funnel/emit.js +3 -2
- package/es/src/charts/Gantt/applyLayout.js +31 -9
- package/es/src/charts/Gantt/criticalPath.js +202 -0
- package/es/src/charts/Gantt/emit.js +49 -15
- package/es/src/charts/Gantt/ganttCalendar.js +54 -0
- package/es/src/charts/Gantt/ganttCritical.js +106 -0
- package/es/src/charts/Gantt/ganttDecor.js +183 -60
- package/es/src/charts/Gantt/ganttSlack.js +14 -0
- package/es/src/charts/Gantt/ganttTooltip.js +91 -36
- package/es/src/charts/Gantt/index.js +59 -10
- package/es/src/charts/Gauge/emit.js +3 -2
- package/es/src/charts/Geomap/applyLayout.js +177 -19
- package/es/src/charts/Geomap/cartogram.js +50 -0
- package/es/src/charts/Geomap/cartogramContiguous.js +196 -0
- package/es/src/charts/Geomap/cartogramFields.js +63 -0
- package/es/src/charts/Geomap/cartogramLabels.js +109 -0
- package/es/src/charts/Geomap/cartogramLayout.js +186 -0
- package/es/src/charts/Geomap/cartogramLegend.js +73 -0
- package/es/src/charts/Geomap/cartogramRelax.js +251 -0
- package/es/src/charts/Geomap/densityEmit.js +93 -0
- package/es/src/charts/Geomap/densityFields.js +69 -0
- package/es/src/charts/Geomap/densityLayout.js +90 -0
- package/es/src/charts/Geomap/densityTooltip.js +98 -0
- package/es/src/charts/Geomap/dotDensity.js +157 -0
- package/es/src/charts/Geomap/dotDensityLayout.js +116 -0
- package/es/src/charts/Geomap/dotRenderer.js +49 -0
- package/es/src/charts/Geomap/drillDown.js +216 -0
- package/es/src/charts/Geomap/drillEmit.js +64 -0
- package/es/src/charts/Geomap/drillEvents.js +108 -0
- package/es/src/charts/Geomap/emit.js +64 -42
- package/es/src/charts/Geomap/flowEmit.js +27 -11
- package/es/src/charts/Geomap/flowEvents.js +3 -1
- package/es/src/charts/Geomap/flowFields.js +2 -2
- package/es/src/charts/Geomap/flowLinks.js +18 -10
- package/es/src/charts/Geomap/geoHexbin.js +144 -0
- package/es/src/charts/Geomap/geoHexbinZoom.js +110 -0
- package/es/src/charts/Geomap/index.js +71 -116
- package/es/src/charts/Geomap/pointCluster.js +246 -0
- package/es/src/charts/Geomap/pointClusterEmit.js +385 -0
- package/es/src/charts/Geomap/pointClusterLayout.js +170 -0
- package/es/src/charts/Geomap/pointClusterLinks.js +95 -0
- package/es/src/charts/Geomap/pointClusterZoom.js +253 -0
- package/es/src/charts/Geomap/pointLabels.js +12 -4
- package/es/src/charts/Geomap/pointRows.js +25 -0
- package/es/src/charts/Geomap/tileGrid.js +468 -0
- package/es/src/charts/Geomap/tileState.js +41 -0
- package/es/src/charts/Geomap/topojsonFluent.js +96 -0
- package/es/src/charts/Geomap/topojsonLevels.js +16 -0
- package/es/src/charts/Hexbin/contourLabels.js +25 -17
- package/es/src/charts/Hexbin/index.js +2 -1
- package/es/src/charts/Histogram/binData.js +5 -1
- package/es/src/charts/Histogram/index.js +4 -26
- package/es/src/charts/HorizonChart/emit.js +147 -0
- package/es/src/charts/HorizonChart/horizonBands.js +117 -0
- package/es/src/charts/HorizonChart/horizonColors.js +30 -0
- package/es/src/charts/HorizonChart/hover.js +147 -0
- package/es/src/charts/HorizonChart/index.js +220 -0
- package/es/src/charts/HorizonChart/measure.js +91 -0
- package/es/src/charts/HorizonChart/rowFilter.js +250 -0
- package/es/src/charts/HorizonChart/state.js +64 -0
- package/es/src/charts/Icicle/emit.js +3 -2
- package/es/src/charts/KPI/applyLayout.js +119 -0
- package/es/src/charts/KPI/delta.js +74 -0
- package/es/src/charts/KPI/emit.js +303 -0
- package/es/src/charts/KPI/index.js +192 -0
- package/es/src/charts/KPI/series.js +67 -0
- package/es/src/charts/KPI/tileLayout.js +134 -0
- package/es/src/charts/Lollipop/emit.js +2 -1
- package/es/src/charts/Marimekko/index.js +2 -1
- package/es/src/charts/Matrix/applyLayout.js +10 -4
- package/es/src/charts/Matrix/bubbles.js +133 -0
- package/es/src/charts/Matrix/emit.js +68 -25
- package/es/src/charts/Matrix/index.js +45 -4
- package/es/src/charts/Network/applyLayout.js +173 -82
- package/es/src/charts/Network/bundle.js +26 -6
- package/es/src/charts/Network/circleLayout.js +281 -0
- package/es/src/charts/Network/containNodes.js +72 -0
- package/es/src/charts/Network/emit.js +78 -18
- package/es/src/charts/Network/forceLayout.js +111 -0
- package/es/src/charts/Network/graph.js +45 -6
- package/es/src/charts/Network/index.js +111 -2
- package/es/src/charts/Network/liveForce.js +312 -0
- package/es/src/charts/Network/livePositions.js +180 -0
- package/es/src/charts/Network/networkDrag.js +156 -0
- package/es/src/charts/Pack/emit.js +3 -2
- package/es/src/charts/Pack/index.js +0 -14
- package/es/src/charts/ParallelCoordinates/emit.js +3 -2
- package/es/src/charts/Pareto/color.js +46 -0
- package/es/src/charts/Pareto/hover.js +54 -0
- package/es/src/charts/Pareto/index.js +170 -0
- package/es/src/charts/Pareto/labels.js +91 -0
- package/es/src/charts/Pareto/order.js +61 -0
- package/es/src/charts/Pareto/paretoSteps.js +84 -0
- package/es/src/charts/Pareto/state.js +158 -0
- package/es/src/charts/Parliament/index.js +68 -0
- package/es/src/charts/Pie/emit.js +3 -2
- package/es/src/charts/Plot/areaEnter.js +5 -3
- package/es/src/charts/Plot/areaLabelsAlong.js +10 -2
- package/es/src/charts/Plot/aspectRatio.js +92 -0
- package/es/src/charts/Plot/axisHover.js +4 -2
- package/es/src/charts/Plot/axisHoverAnchors.js +2 -1
- package/es/src/charts/Plot/axisHoverScene.js +138 -5
- package/es/src/charts/Plot/barConfidence.js +7 -6
- package/es/src/charts/Plot/barHitArea.js +121 -7
- package/es/src/charts/Plot/barLabelConfidence.js +50 -0
- package/es/src/charts/Plot/barLabelFit.js +2 -1
- package/es/src/charts/Plot/barWidth.js +10 -5
- package/es/src/charts/Plot/baselineBreak.js +15 -6
- package/es/src/charts/Plot/baselineDomain.js +13 -4
- package/es/src/charts/Plot/circleLabels.js +26 -16
- package/es/src/charts/Plot/confidenceAxes.js +100 -0
- package/es/src/charts/Plot/confidenceConfig.js +7 -2
- package/es/src/charts/Plot/confidenceTooltip.js +47 -4
- package/es/src/charts/Plot/connectGapsScene.js +2 -1
- package/es/src/charts/Plot/discreteDomain.js +27 -5
- package/es/src/charts/Plot/discreteSpan.js +10 -1
- package/es/src/charts/Plot/domainClip.js +74 -44
- package/es/src/charts/Plot/downsample.js +26 -0
- package/es/src/charts/Plot/draw.js +15 -2
- package/es/src/charts/Plot/fillBetween.js +2 -1
- package/es/src/charts/Plot/forecast.js +8 -4
- package/es/src/charts/Plot/forecastScene.js +6 -5
- package/es/src/charts/Plot/index.js +49 -18
- package/es/src/charts/Plot/inferDiscrete.js +72 -0
- package/es/src/charts/Plot/jitter.js +50 -0
- package/es/src/charts/Plot/labelPlacement.js +4 -3
- package/es/src/charts/Plot/lineBands.js +6 -1
- package/es/src/charts/Plot/lineLabelEmit.js +4 -3
- package/es/src/charts/Plot/lineLabelSides.js +8 -0
- package/es/src/charts/Plot/lineLabelsAlong.js +45 -31
- package/es/src/charts/Plot/marginalHover.js +141 -0
- package/es/src/charts/Plot/marginalLayout.js +102 -0
- package/es/src/charts/Plot/marginalPaint.js +105 -0
- package/es/src/charts/Plot/marginalScene.js +272 -0
- package/es/src/charts/Plot/marginalSeries.js +73 -0
- package/es/src/charts/Plot/marginalStats.js +219 -0
- package/es/src/charts/Plot/openDomainEnds.js +60 -0
- package/es/src/charts/Plot/orderPath.js +137 -0
- package/es/src/charts/Plot/orderPathScene.js +253 -0
- package/es/src/charts/Plot/outlierDetect.js +179 -0
- package/es/src/charts/Plot/outlierLabels.js +327 -0
- package/es/src/charts/Plot/outlierLines.js +93 -0
- package/es/src/charts/Plot/outlierScene.js +308 -0
- package/es/src/charts/Plot/outlierTooltip.js +69 -0
- package/es/src/charts/Plot/periodLabels.js +27 -0
- package/es/src/charts/Plot/pipeline.js +62 -24
- package/es/src/charts/Plot/pipelineAxisLayout.js +9 -7
- package/es/src/charts/Plot/pipelineDomains.js +64 -27
- package/es/src/charts/Plot/pipelineScales.js +37 -28
- package/es/src/charts/Plot/plotBreaks.js +38 -18
- package/es/src/charts/Plot/plotFacet.js +3 -1
- package/es/src/charts/Plot/plotInit.js +59 -3
- package/es/src/charts/Plot/plotLevels.js +183 -0
- package/es/src/charts/Plot/plotRangeBreaks.js +46 -9
- package/es/src/charts/Plot/plotShapes.js +60 -0
- package/es/src/charts/Plot/pointConfidence.js +186 -0
- package/es/src/charts/Plot/pointKey.js +10 -0
- package/es/src/charts/Plot/referenceDomains.js +11 -6
- package/es/src/charts/Plot/shapeAccessors.js +52 -0
- package/es/src/charts/Plot/shapeDefaults.js +32 -17
- package/es/src/charts/Plot/sharedHover.js +40 -12
- package/es/src/charts/Plot/sharedHoverScene.js +49 -13
- package/es/src/charts/Plot/sharedTooltip.js +55 -22
- package/es/src/charts/Plot/stackEnter.js +7 -3
- package/es/src/charts/Plot/stackLegendOrder.js +5 -2
- package/es/src/charts/Plot/stackNeutral.js +154 -0
- package/es/src/charts/Plot/stackShareTooltip.js +2 -1
- package/es/src/charts/Plot/stackThreshold.js +2 -1
- package/es/src/charts/Plot/swarm.js +8 -5
- package/es/src/charts/Plot/timeNestKeys.js +37 -0
- package/es/src/charts/Plot/trendLabels.js +45 -18
- package/es/src/charts/Plot/trendLines.js +78 -34
- package/es/src/charts/Plot/trendMovingAverage.js +135 -0
- package/es/src/charts/Plot/trendProjection.js +18 -6
- package/es/src/charts/Plot/trendScene.js +4 -1
- package/es/src/charts/Plot/trendTooltip.js +75 -20
- package/es/src/charts/PolarArea/emit.js +3 -2
- package/es/src/charts/Priestley/applyLayout.js +9 -5
- package/es/src/charts/Priestley/emit.js +3 -2
- package/es/src/charts/Priestley/timeAxis.js +13 -5
- package/es/src/charts/Radar/emit.js +3 -2
- package/es/src/charts/RadialArea/index.js +51 -0
- package/es/src/charts/RadialBar/emit.js +3 -2
- package/es/src/charts/RadialLine/angles.js +117 -0
- package/es/src/charts/RadialLine/applyLayout.js +204 -0
- package/es/src/charts/RadialLine/emit.js +66 -0
- package/es/src/charts/RadialLine/index.js +228 -0
- package/es/src/charts/RadialLine/paths.js +55 -0
- package/es/src/charts/RadialLine/points.js +80 -0
- package/es/src/charts/RadialLine/series.js +84 -0
- package/es/src/charts/RadialLine/seriesLabelNodes.js +116 -0
- package/es/src/charts/RadialLine/seriesLabels.js +91 -0
- package/es/src/charts/RadialLine/spokes.js +32 -0
- package/es/src/charts/RadialMatrix/emit.js +3 -2
- package/es/src/charts/RadialTree/index.js +33 -0
- package/es/src/charts/Rings/applyLayout.js +22 -6
- package/es/src/charts/Rings/emit.js +43 -23
- package/es/src/charts/Rings/index.js +1 -1
- package/es/src/charts/Rings/ringsCurves.js +10 -8
- package/es/src/charts/Rings/ringsLoops.js +4 -2
- package/es/src/charts/Rings/ringsSizing.js +21 -13
- package/es/src/charts/Sankey/applyLayout.js +4 -0
- package/es/src/charts/Sankey/circularLayout.js +14 -6
- package/es/src/charts/Sankey/emit.js +3 -2
- package/es/src/charts/Sankey/index.js +43 -0
- package/es/src/charts/Sankey/sankeyDrag.js +225 -0
- package/es/src/charts/Sankey/sankeyLayout.js +12 -0
- package/es/src/charts/Scatter/index.js +3 -2
- package/es/src/charts/ScatterMatrix/binEmit.js +59 -0
- package/es/src/charts/ScatterMatrix/index.js +253 -0
- package/es/src/charts/ScatterMatrix/matrixData.js +161 -0
- package/es/src/charts/ScatterMatrix/matrixFacet.js +76 -0
- package/es/src/charts/ScatterMatrix/matrixHover.js +36 -0
- package/es/src/charts/ScatterMatrix/matrixTooltip.js +45 -0
- package/es/src/charts/StripPlot/index.js +53 -0
- package/es/src/charts/Sunburst/emit.js +3 -2
- package/es/src/charts/TileGridMap/index.js +29 -0
- package/es/src/charts/Tree/applyLayout.js +91 -18
- package/es/src/charts/Tree/emit.js +56 -3
- package/es/src/charts/Tree/index.js +24 -3
- package/es/src/charts/Tree/nodeHeight.js +58 -0
- package/es/src/charts/Tree/radialLabels.js +61 -0
- package/es/src/charts/Tree/radialLayout.js +210 -0
- package/es/src/charts/Treemap/emit.js +3 -2
- package/es/src/charts/Venn/applyLayout.js +176 -0
- package/es/src/charts/Venn/circles.js +192 -0
- package/es/src/charts/Venn/ellipseFrame.js +57 -0
- package/es/src/charts/Venn/emit.js +142 -0
- package/es/src/charts/Venn/index.js +178 -0
- package/es/src/charts/Venn/nelderMead.js +59 -0
- package/es/src/charts/Venn/tooltip.js +22 -0
- package/es/src/charts/Venn/vennData.js +99 -0
- package/es/src/charts/Venn/vennEllipses.js +291 -0
- package/es/src/charts/Venn/vennFit.js +169 -0
- package/es/src/charts/Venn/vennLayout.js +252 -0
- package/es/src/charts/Venn/vennRegions.js +133 -0
- package/es/src/charts/Violin/emit.js +2 -1
- package/es/src/charts/Violin/index.js +2 -1
- package/es/src/charts/Waffle/applyLayout.js +45 -22
- package/es/src/charts/Waffle/arcEmit.js +153 -0
- package/es/src/charts/Waffle/arcLayout.js +122 -0
- package/es/src/charts/Waffle/arcStage.js +79 -0
- package/es/src/charts/Waffle/emit.js +9 -4
- package/es/src/charts/Waffle/index.js +88 -4
- package/es/src/charts/Waffle/tooltip.js +7 -2
- package/es/src/charts/Waterfall/connectors.js +5 -3
- package/es/src/charts/Waterfall/state.js +2 -1
- package/es/src/charts/WordCloud/applyLayout.js +157 -0
- package/es/src/charts/WordCloud/cloudLayout.js +128 -0
- package/es/src/charts/WordCloud/emit.js +96 -0
- package/es/src/charts/WordCloud/fontScale.js +34 -0
- package/es/src/charts/WordCloud/glyphMask.js +298 -0
- package/es/src/charts/WordCloud/index.js +174 -0
- package/es/src/charts/WordCloud/occupancy.js +99 -0
- package/es/src/charts/WordCloud/rotation.js +44 -0
- package/es/src/charts/WordCloud/size.js +15 -0
- package/es/src/charts/WordCloud/spiral.js +72 -0
- package/es/src/charts/definition/applyDefinition.js +6 -1
- package/es/src/charts/definition/declaresField.js +14 -0
- package/es/src/charts/definition/makeChart.js +10 -2
- package/es/src/charts/drawSteps/bottomRightControls.js +1 -1
- package/es/src/charts/drawSteps/bottomRightControlsMarkup.js +1 -1
- package/es/src/charts/drawSteps/gestureHover.js +10 -6
- package/es/src/charts/drawSteps/leavesSurface.js +12 -0
- package/es/src/charts/drawSteps/minimap.js +1 -1
- package/es/src/charts/drawSteps/selectActions.js +105 -0
- package/es/src/charts/drawSteps/selectGesture.js +318 -0
- package/es/src/charts/drawSteps/selectRegion.js +222 -0
- package/es/src/charts/drawSteps/selectState.js +118 -0
- package/es/src/charts/drawSteps/topLeftControls.js +4 -1
- package/es/src/charts/drawSteps/zoomControls.js +59 -19
- package/es/src/charts/drawSteps/zoomControlsMarkup.js +212 -39
- package/es/src/charts/drawSteps/zoomControlsMenu.js +140 -0
- package/es/src/charts/drawSteps/zoomDrag.js +3 -1
- package/es/src/charts/events/mouseleave.js +6 -3
- package/es/src/charts/events/mousemove.legend.js +10 -5
- package/es/src/charts/events/mousemove.shape.js +15 -6
- package/es/src/charts/facet/drawFacets.js +61 -22
- package/es/src/charts/facet/facetConfig.js +3 -1
- package/es/src/charts/facet/facetData.js +10 -2
- package/es/src/charts/facet/facetGrid.js +5 -1
- package/es/src/charts/facet/facetGutter.js +36 -7
- package/es/src/charts/facet/facetLayout.js +136 -0
- package/es/src/charts/facet/facetLayouts.js +574 -0
- package/es/src/charts/facet/facetScene.js +10 -3
- package/es/src/charts/features/annotationFrame.js +8 -3
- package/es/src/charts/features/axes.js +4 -2
- package/es/src/charts/features/axesFinal.js +92 -8
- package/es/src/charts/features/axesMeasure.js +7 -4
- package/es/src/charts/features/bareRegion.js +24 -0
- package/es/src/charts/features/boxGrid.js +39 -0
- package/es/src/charts/features/centerLabel.js +36 -17
- package/es/src/charts/features/circleLabelPlacement.js +288 -83
- package/es/src/charts/features/circleLabels.js +66 -14
- package/es/src/charts/features/colorScaleHover.js +7 -2
- package/es/src/charts/features/colorScaleTooltip.js +6 -21
- package/es/src/charts/features/colorScaleTop.js +12 -2
- package/es/src/charts/features/colorScaleValue.js +10 -1
- package/es/src/charts/features/curvedArrows.js +46 -28
- package/es/src/charts/features/edgeArrows.js +48 -18
- package/es/src/charts/features/emitHelpers.js +7 -2
- package/es/src/charts/features/features.js +25 -5
- package/es/src/charts/features/featuresColorScale.js +7 -4
- package/es/src/charts/features/featuresLegend.js +20 -0
- package/es/src/charts/features/hoverTicks.js +12 -7
- package/es/src/charts/features/keyHold.js +115 -0
- package/es/src/charts/features/keyTooltip.js +91 -0
- package/es/src/charts/features/labelLayering.js +149 -0
- package/es/src/charts/features/labelSlots.js +112 -0
- package/es/src/charts/features/linkInteraction.js +4 -1
- package/es/src/charts/features/linkLabelPath.js +2 -39
- package/es/src/charts/features/nodeDrag.js +175 -0
- package/es/src/charts/features/nodeKeys.js +117 -0
- package/es/src/charts/features/nodeOutline.js +41 -0
- package/es/src/charts/features/pathLabelBends.js +191 -0
- package/es/src/charts/features/plotAnnotations.js +8 -5
- package/es/src/charts/features/plotPaint.js +45 -13
- package/es/src/charts/features/rectNodeSize.js +41 -0
- package/es/src/charts/features/ringLabels.js +3 -1
- package/es/src/charts/features/selfLoops.js +33 -23
- package/es/src/charts/features/shapeEmit.js +104 -32
- package/es/src/charts/features/sharedFields.js +10 -5
- package/es/src/charts/features/spokeLabels.js +178 -0
- package/es/src/charts/features/swatchPaint.js +68 -0
- package/es/src/charts/features/thresholdMembers.js +8 -12
- package/es/src/charts/features/tooltipRows.js +76 -0
- package/es/src/charts/features/tooltipSwatch.js +81 -24
- package/es/src/charts/features/xAxisConfig.js +2 -1
- package/es/src/charts/helpers/densityChart.js +2 -7
- package/es/src/charts/helpers/valueTitle.js +13 -1
- package/es/src/charts/index.js +17 -0
- package/es/src/charts/partition/interaction.js +2 -2
- package/es/src/charts/pipeline/insetPlacement.js +13 -6
- package/es/src/charts/pipeline/preDrawData.js +80 -11
- package/es/src/charts/pipeline/runVizPipeline.js +5 -0
- package/es/src/charts/pipeline/stages.js +3 -2
- package/es/src/charts/pipeline/vizPreDraw.js +4 -0
- package/es/src/charts/plotBuffers/Circle.js +3 -2
- package/es/src/charts/plotBuffers/Line.js +6 -5
- package/es/src/charts/plotBuffers/Rect.js +3 -2
- package/es/src/charts/plotBuffers/Tick.js +12 -0
- package/es/src/charts/plotBuffers/defaultBuffers.js +3 -1
- package/es/src/charts/plotBuffers/rectLikeBuffer.js +4 -3
- package/es/src/charts/viz/Viz.js +32 -18
- package/es/src/charts/viz/VizBase.js +39 -38
- package/es/src/charts/viz/appendRows.js +90 -0
- package/es/src/charts/viz/dataChanged.js +19 -0
- package/es/src/charts/viz/discrete.js +9 -0
- package/es/src/charts/viz/focusTargets.js +25 -5
- package/es/src/charts/viz/groupByLevels.js +48 -0
- package/es/src/charts/viz/groupRow.js +27 -0
- package/es/src/charts/viz/hoverBand.js +40 -0
- package/es/src/charts/viz/interactionOpacity.js +134 -29
- package/es/src/charts/viz/keyboardNav.js +39 -9
- package/es/src/charts/viz/liftRaised.js +84 -0
- package/es/src/charts/viz/nearestHover.js +9 -2
- package/es/src/charts/viz/setCursor.js +12 -0
- package/es/src/charts/viz/simpleHover.js +3 -4
- package/es/src/charts/viz/userClick.js +11 -0
- package/es/src/charts/viz/vizDefaults.js +10 -0
- package/es/src/charts/viz/vizFields.js +7 -0
- package/es/src/charts/viz/vizTypes.js +1 -1
- package/es/src/components/Axis/Axis.js +85 -12
- 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/axisDefaults.js +7 -0
- package/es/src/components/Axis/axisEndLabels.js +4 -1
- package/es/src/components/Axis/axisLabelSize.js +40 -16
- package/es/src/components/Axis/axisLabelThinning.js +69 -6
- package/es/src/components/Axis/axisLayout.js +5 -0
- package/es/src/components/Axis/axisLayoutLabels.js +11 -5
- package/es/src/components/Axis/axisLayoutScale.js +71 -25
- package/es/src/components/Axis/axisLevels.js +271 -0
- package/es/src/components/Axis/axisLimit.js +6 -0
- package/es/src/components/Axis/axisMinorTicks.js +280 -0
- package/es/src/components/Axis/axisPeriods.js +144 -0
- package/es/src/components/Axis/axisRangeBreaks.js +19 -10
- package/es/src/components/Axis/axisRender.js +71 -29
- package/es/src/components/Axis/axisRounding.js +24 -2
- package/es/src/components/Axis/axisScaleType.js +55 -0
- package/es/src/components/Axis/axisScene.js +90 -5
- package/es/src/components/Axis/axisTickLookups.js +30 -0
- package/es/src/components/Axis/axisTooltipTargets.js +23 -0
- package/es/src/components/Axis/labelSizeSession.js +23 -0
- package/es/src/components/Axis/rangeBreaks.js +10 -4
- package/es/src/components/Axis/timeValues.js +116 -19
- package/es/src/components/ColorScale/ColorScale.js +1 -0
- package/es/src/components/ColorScale/colorScaleScale.js +139 -41
- package/es/src/components/Legend/Legend.js +1 -0
- package/es/src/components/SizeLegend/SizeLegend.js +20 -1
- package/es/src/components/TextBox.js +1 -0
- package/es/src/components/Timeline/Timeline.js +11 -3
- package/es/src/components/Timeline/timelineRender.js +23 -13
- package/es/src/components/Tooltip.js +8 -1
- package/es/src/components/tooltipDom.js +73 -14
- package/es/src/fluent.js +77 -10
- package/es/src/shapes/Area.js +32 -1
- package/es/src/shapes/Bar.js +22 -1
- package/es/src/shapes/Box.js +72 -13
- package/es/src/shapes/Circle.js +1 -0
- package/es/src/shapes/Image.js +8 -1
- package/es/src/shapes/Line.js +45 -1
- package/es/src/shapes/Path.js +1 -0
- package/es/src/shapes/Rect.js +1 -0
- package/es/src/shapes/Shape.js +29 -8
- package/es/src/shapes/Tick.js +54 -0
- package/es/src/shapes/Whisker.js +1 -0
- package/es/src/shapes/boxExtraShapes.js +72 -0
- package/es/src/shapes/boxExtras.js +212 -0
- package/es/src/shapes/boxStyle.js +38 -5
- package/es/src/shapes/buildLabelData.js +2 -0
- package/es/src/shapes/downsample.js +150 -0
- package/es/src/shapes/hitAreaNode.js +6 -2
- package/es/src/shapes/index.js +1 -0
- package/es/src/shapes/pathSeries.js +51 -0
- package/es/src/utils/BaseClass.js +59 -57
- package/es/src/utils/jitter.js +33 -0
- package/es/src/utils/resetSetters.js +66 -0
- package/package.json +10 -10
- package/types/index.d.ts +5 -4
- package/types/internal.d.ts +253 -27
- package/types/src/charts/ArcDiagram/arcGeometry.d.ts +7 -3
- package/types/src/charts/ArcDiagram/arcLoops.d.ts +3 -1
- package/types/src/charts/ArcDiagram/arcNodeBox.d.ts +60 -0
- package/types/src/charts/ArcDiagram/emit.d.ts +5 -4
- package/types/src/charts/BoxWhisker/extras.d.ts +41 -0
- package/types/src/charts/BoxWhisker/summary.d.ts +1 -1
- package/types/src/charts/BoxWhisker/tooltip.d.ts +33 -4
- package/types/src/charts/BubbleChart/emit.d.ts +3 -3
- package/types/src/charts/BubbleMatrix/colorDefaults.d.ts +19 -0
- package/types/src/charts/BubbleMatrix/index.d.ts +18 -0
- package/types/src/charts/BumpChart/areaBump.d.ts +86 -0
- package/types/src/charts/BumpChart/index.d.ts +19 -1
- package/types/src/charts/Calendar/calendarDates.d.ts +8 -1
- package/types/src/charts/Candlestick/periods.d.ts +19 -8
- package/types/src/charts/ConnectedScatter/index.d.ts +17 -0
- package/types/src/charts/CyclePlot/cycleFacet.d.ts +61 -0
- package/types/src/charts/CyclePlot/cycleMeans.d.ts +32 -0
- package/types/src/charts/CyclePlot/cyclePeriods.d.ts +37 -0
- package/types/src/charts/CyclePlot/cycleTooltip.d.ts +47 -0
- package/types/src/charts/CyclePlot/index.d.ts +75 -0
- package/types/src/charts/DensityPlot/densityCurves.d.ts +84 -0
- package/types/src/charts/DensityPlot/densityPoint.d.ts +16 -0
- package/types/src/charts/DensityPlot/index.d.ts +33 -0
- package/types/src/charts/DensityPlot/rug.d.ts +57 -0
- package/types/src/charts/DotPlot/dotLayout.d.ts +95 -0
- package/types/src/charts/DotPlot/facetSize.d.ts +33 -0
- package/types/src/charts/DotPlot/index.d.ts +22 -0
- package/types/src/charts/DotPlot/placements.d.ts +28 -0
- package/types/src/charts/DotPlot/tooltip.d.ts +27 -0
- package/types/src/charts/Dumbbell/arrowGrays.d.ts +33 -0
- package/types/src/charts/Dumbbell/categoryChange.d.ts +66 -0
- package/types/src/charts/Dumbbell/changeEmit.d.ts +71 -0
- package/types/src/charts/Dumbbell/changes.d.ts +64 -0
- package/types/src/charts/Dumbbell/connectors.d.ts +43 -0
- package/types/src/charts/Dumbbell/emit.d.ts +17 -19
- package/types/src/charts/Dumbbell/index.d.ts +6 -2
- package/types/src/charts/Gantt/applyLayout.d.ts +14 -1
- package/types/src/charts/Gantt/criticalPath.d.ts +100 -0
- package/types/src/charts/Gantt/emit.d.ts +17 -1
- package/types/src/charts/Gantt/ganttCalendar.d.ts +37 -0
- package/types/src/charts/Gantt/ganttCritical.d.ts +53 -0
- package/types/src/charts/Gantt/ganttDecor.d.ts +32 -2
- package/types/src/charts/Gantt/ganttRows.d.ts +2 -0
- package/types/src/charts/Gantt/ganttSlack.d.ts +21 -0
- package/types/src/charts/Gantt/ganttTooltip.d.ts +35 -15
- package/types/src/charts/Gantt/index.d.ts +12 -6
- package/types/src/charts/Geomap/applyLayout.d.ts +19 -0
- package/types/src/charts/Geomap/cartogram.d.ts +58 -0
- package/types/src/charts/Geomap/cartogramContiguous.d.ts +59 -0
- package/types/src/charts/Geomap/cartogramFields.d.ts +16 -0
- package/types/src/charts/Geomap/cartogramLabels.d.ts +48 -0
- package/types/src/charts/Geomap/cartogramLayout.d.ts +71 -0
- package/types/src/charts/Geomap/cartogramLegend.d.ts +36 -0
- package/types/src/charts/Geomap/cartogramRelax.d.ts +29 -0
- package/types/src/charts/Geomap/densityEmit.d.ts +29 -0
- package/types/src/charts/Geomap/densityFields.d.ts +27 -0
- package/types/src/charts/Geomap/densityLayout.d.ts +49 -0
- package/types/src/charts/Geomap/densityTooltip.d.ts +48 -0
- package/types/src/charts/Geomap/dotDensity.d.ts +80 -0
- package/types/src/charts/Geomap/dotDensityLayout.d.ts +97 -0
- package/types/src/charts/Geomap/dotRenderer.d.ts +27 -0
- package/types/src/charts/Geomap/drillDown.d.ts +128 -0
- package/types/src/charts/Geomap/drillEmit.d.ts +37 -0
- package/types/src/charts/Geomap/drillEvents.d.ts +33 -0
- package/types/src/charts/Geomap/emit.d.ts +7 -0
- package/types/src/charts/Geomap/flowEmit.d.ts +5 -4
- package/types/src/charts/Geomap/flowLinks.d.ts +12 -1
- package/types/src/charts/Geomap/geoHexbin.d.ts +91 -0
- package/types/src/charts/Geomap/geoHexbinZoom.d.ts +76 -0
- package/types/src/charts/Geomap/index.d.ts +7 -0
- package/types/src/charts/Geomap/pointCluster.d.ts +108 -0
- package/types/src/charts/Geomap/pointClusterEmit.d.ts +106 -0
- package/types/src/charts/Geomap/pointClusterLayout.d.ts +123 -0
- package/types/src/charts/Geomap/pointClusterLinks.d.ts +21 -0
- package/types/src/charts/Geomap/pointClusterZoom.d.ts +89 -0
- package/types/src/charts/Geomap/pointLabels.d.ts +21 -3
- package/types/src/charts/Geomap/pointRows.d.ts +24 -0
- package/types/src/charts/Geomap/tileGrid.d.ts +98 -0
- package/types/src/charts/Geomap/tileState.d.ts +18 -0
- package/types/src/charts/Geomap/topojsonFluent.d.ts +9 -0
- package/types/src/charts/Geomap/topojsonLevels.d.ts +14 -0
- package/types/src/charts/Hexbin/contourLabels.d.ts +6 -5
- package/types/src/charts/Hexbin/settings.d.ts +7 -1
- package/types/src/charts/Histogram/binData.d.ts +6 -0
- package/types/src/charts/HorizonChart/emit.d.ts +20 -0
- package/types/src/charts/HorizonChart/horizonBands.d.ts +42 -0
- package/types/src/charts/HorizonChart/horizonColors.d.ts +25 -0
- package/types/src/charts/HorizonChart/hover.d.ts +52 -0
- package/types/src/charts/HorizonChart/index.d.ts +32 -0
- package/types/src/charts/HorizonChart/measure.d.ts +24 -0
- package/types/src/charts/HorizonChart/rowFilter.d.ts +88 -0
- package/types/src/charts/HorizonChart/state.d.ts +71 -0
- package/types/src/charts/KPI/applyLayout.d.ts +64 -0
- package/types/src/charts/KPI/delta.d.ts +62 -0
- package/types/src/charts/KPI/emit.d.ts +55 -0
- package/types/src/charts/KPI/index.d.ts +34 -0
- package/types/src/charts/KPI/series.d.ts +45 -0
- package/types/src/charts/KPI/tileLayout.d.ts +90 -0
- package/types/src/charts/Matrix/applyLayout.d.ts +2 -1
- package/types/src/charts/Matrix/bubbles.d.ts +87 -0
- package/types/src/charts/Matrix/emit.d.ts +3 -2
- package/types/src/charts/Matrix/index.d.ts +2 -1
- package/types/src/charts/Network/applyLayout.d.ts +24 -0
- package/types/src/charts/Network/bundle.d.ts +23 -16
- package/types/src/charts/Network/circleLayout.d.ts +149 -0
- package/types/src/charts/Network/containNodes.d.ts +35 -0
- package/types/src/charts/Network/emit.d.ts +20 -0
- package/types/src/charts/Network/forceLayout.d.ts +49 -0
- package/types/src/charts/Network/graph.d.ts +18 -2
- package/types/src/charts/Network/liveForce.d.ts +133 -0
- package/types/src/charts/Network/livePositions.d.ts +90 -0
- package/types/src/charts/Network/networkDrag.d.ts +55 -0
- package/types/src/charts/Pareto/color.d.ts +21 -0
- package/types/src/charts/Pareto/hover.d.ts +38 -0
- package/types/src/charts/Pareto/index.d.ts +22 -0
- package/types/src/charts/Pareto/labels.d.ts +40 -0
- package/types/src/charts/Pareto/order.d.ts +30 -0
- package/types/src/charts/Pareto/paretoSteps.d.ts +65 -0
- package/types/src/charts/Pareto/state.d.ts +93 -0
- package/types/src/charts/Parliament/index.d.ts +18 -0
- package/types/src/charts/Plot/areaLabelsAlong.d.ts +7 -0
- package/types/src/charts/Plot/aspectRatio.d.ts +68 -0
- package/types/src/charts/Plot/axisHover.d.ts +2 -0
- package/types/src/charts/Plot/axisHoverScene.d.ts +44 -1
- package/types/src/charts/Plot/barConfidence.d.ts +14 -1
- package/types/src/charts/Plot/barHitArea.d.ts +34 -7
- package/types/src/charts/Plot/barLabelConfidence.d.ts +25 -0
- package/types/src/charts/Plot/baselineBreak.d.ts +2 -1
- package/types/src/charts/Plot/baselineDomain.d.ts +5 -0
- package/types/src/charts/Plot/circleLabels.d.ts +8 -7
- package/types/src/charts/Plot/confidenceAxes.d.ts +63 -0
- package/types/src/charts/Plot/confidenceTooltip.d.ts +22 -0
- package/types/src/charts/Plot/discreteDomain.d.ts +13 -2
- package/types/src/charts/Plot/discreteSpan.d.ts +5 -0
- package/types/src/charts/Plot/domainClip.d.ts +15 -5
- package/types/src/charts/Plot/downsample.d.ts +16 -0
- package/types/src/charts/Plot/index.d.ts +17 -8
- package/types/src/charts/Plot/inferDiscrete.d.ts +31 -0
- package/types/src/charts/Plot/jitter.d.ts +45 -0
- package/types/src/charts/Plot/lineLabelSides.d.ts +19 -0
- package/types/src/charts/Plot/lineLabelsAlong.d.ts +19 -6
- package/types/src/charts/Plot/marginalHover.d.ts +26 -0
- package/types/src/charts/Plot/marginalLayout.d.ts +95 -0
- package/types/src/charts/Plot/marginalPaint.d.ts +54 -0
- package/types/src/charts/Plot/marginalScene.d.ts +67 -0
- package/types/src/charts/Plot/marginalSeries.d.ts +38 -0
- package/types/src/charts/Plot/marginalStats.d.ts +115 -0
- package/types/src/charts/Plot/openDomainEnds.d.ts +25 -0
- package/types/src/charts/Plot/orderPath.d.ts +100 -0
- package/types/src/charts/Plot/orderPathScene.d.ts +49 -0
- package/types/src/charts/Plot/outlierDetect.d.ts +87 -0
- package/types/src/charts/Plot/outlierLabels.d.ts +103 -0
- package/types/src/charts/Plot/outlierLines.d.ts +30 -0
- package/types/src/charts/Plot/outlierScene.d.ts +103 -0
- package/types/src/charts/Plot/outlierTooltip.d.ts +44 -0
- package/types/src/charts/Plot/periodLabels.d.ts +14 -0
- package/types/src/charts/Plot/pipeline.d.ts +2 -1
- package/types/src/charts/Plot/plotBreaks.d.ts +21 -6
- package/types/src/charts/Plot/plotInit.d.ts +7 -25
- package/types/src/charts/Plot/plotLevels.d.ts +120 -0
- package/types/src/charts/Plot/plotRangeBreaks.d.ts +28 -2
- package/types/src/charts/Plot/plotShapes.d.ts +42 -0
- package/types/src/charts/Plot/pointConfidence.d.ts +73 -0
- package/types/src/charts/Plot/pointKey.d.ts +9 -0
- package/types/src/charts/Plot/referenceDomains.d.ts +2 -1
- package/types/src/charts/Plot/shapeAccessors.d.ts +24 -0
- package/types/src/charts/Plot/sharedHover.d.ts +5 -0
- package/types/src/charts/Plot/sharedTooltip.d.ts +24 -6
- package/types/src/charts/Plot/stackEnter.d.ts +1 -1
- package/types/src/charts/Plot/stackLegendOrder.d.ts +4 -1
- package/types/src/charts/Plot/stackNeutral.d.ts +85 -0
- package/types/src/charts/Plot/swarm.d.ts +8 -4
- package/types/src/charts/Plot/timeNestKeys.d.ts +20 -0
- package/types/src/charts/Plot/trendLabels.d.ts +15 -6
- package/types/src/charts/Plot/trendLines.d.ts +40 -8
- package/types/src/charts/Plot/trendMovingAverage.d.ts +78 -0
- package/types/src/charts/Plot/trendProjection.d.ts +4 -2
- package/types/src/charts/Plot/trendTooltip.d.ts +24 -2
- package/types/src/charts/Priestley/timeAxis.d.ts +6 -3
- package/types/src/charts/RadialArea/index.d.ts +17 -0
- package/types/src/charts/RadialLine/angles.d.ts +67 -0
- package/types/src/charts/RadialLine/applyLayout.d.ts +70 -0
- package/types/src/charts/RadialLine/emit.d.ts +13 -0
- package/types/src/charts/RadialLine/index.d.ts +28 -0
- package/types/src/charts/RadialLine/paths.d.ts +37 -0
- package/types/src/charts/RadialLine/points.d.ts +43 -0
- package/types/src/charts/RadialLine/series.d.ts +63 -0
- package/types/src/charts/RadialLine/seriesLabelNodes.d.ts +26 -0
- package/types/src/charts/RadialLine/seriesLabels.d.ts +80 -0
- package/types/src/charts/RadialLine/spokes.d.ts +15 -0
- package/types/src/charts/RadialTree/index.d.ts +16 -0
- package/types/src/charts/Rings/emit.d.ts +6 -5
- package/types/src/charts/Rings/ringsCurves.d.ts +10 -14
- package/types/src/charts/Rings/ringsGraph.d.ts +3 -0
- package/types/src/charts/Rings/ringsSizing.d.ts +5 -2
- package/types/src/charts/Sankey/circularLayout.d.ts +3 -0
- package/types/src/charts/Sankey/sankeyDrag.d.ts +112 -0
- package/types/src/charts/Sankey/sankeyLayout.d.ts +8 -0
- package/types/src/charts/Scatter/index.d.ts +3 -2
- package/types/src/charts/ScatterMatrix/binEmit.d.ts +22 -0
- package/types/src/charts/ScatterMatrix/index.d.ts +80 -0
- package/types/src/charts/ScatterMatrix/matrixData.d.ts +93 -0
- package/types/src/charts/ScatterMatrix/matrixFacet.d.ts +32 -0
- package/types/src/charts/ScatterMatrix/matrixHover.d.ts +21 -0
- package/types/src/charts/ScatterMatrix/matrixTooltip.d.ts +32 -0
- package/types/src/charts/StripPlot/index.d.ts +16 -0
- package/types/src/charts/TileGridMap/index.d.ts +14 -0
- package/types/src/charts/Tree/index.d.ts +2 -2
- package/types/src/charts/Tree/nodeHeight.d.ts +41 -0
- package/types/src/charts/Tree/radialLabels.d.ts +24 -0
- package/types/src/charts/Tree/radialLayout.d.ts +129 -0
- package/types/src/charts/Venn/applyLayout.d.ts +91 -0
- package/types/src/charts/Venn/circles.d.ts +87 -0
- package/types/src/charts/Venn/ellipseFrame.d.ts +37 -0
- package/types/src/charts/Venn/emit.d.ts +36 -0
- package/types/src/charts/Venn/index.d.ts +30 -0
- package/types/src/charts/Venn/nelderMead.d.ts +28 -0
- package/types/src/charts/Venn/tooltip.d.ts +8 -0
- package/types/src/charts/Venn/vennData.d.ts +56 -0
- package/types/src/charts/Venn/vennEllipses.d.ts +93 -0
- package/types/src/charts/Venn/vennFit.d.ts +39 -0
- package/types/src/charts/Venn/vennLayout.d.ts +52 -0
- package/types/src/charts/Venn/vennRegions.d.ts +58 -0
- package/types/src/charts/Waffle/applyLayout.d.ts +4 -1
- package/types/src/charts/Waffle/arcEmit.d.ts +45 -0
- package/types/src/charts/Waffle/arcLayout.d.ts +82 -0
- package/types/src/charts/Waffle/arcStage.d.ts +60 -0
- package/types/src/charts/Waffle/emit.d.ts +2 -1
- package/types/src/charts/Waffle/index.d.ts +8 -2
- package/types/src/charts/Waffle/tooltip.d.ts +7 -2
- package/types/src/charts/Waterfall/connectors.d.ts +3 -2
- package/types/src/charts/WordCloud/applyLayout.d.ts +51 -0
- package/types/src/charts/WordCloud/cloudLayout.d.ts +95 -0
- package/types/src/charts/WordCloud/emit.d.ts +27 -0
- package/types/src/charts/WordCloud/fontScale.d.ts +20 -0
- package/types/src/charts/WordCloud/glyphMask.d.ts +95 -0
- package/types/src/charts/WordCloud/index.d.ts +31 -0
- package/types/src/charts/WordCloud/occupancy.d.ts +59 -0
- package/types/src/charts/WordCloud/rotation.d.ts +31 -0
- package/types/src/charts/WordCloud/size.d.ts +16 -0
- package/types/src/charts/WordCloud/spiral.d.ts +47 -0
- package/types/src/charts/definition/ChartDefinition.d.ts +13 -0
- package/types/src/charts/definition/declaresField.d.ts +9 -0
- package/types/src/charts/definition/makeChart.d.ts +2 -2
- package/types/src/charts/drawSteps/gestureHover.d.ts +2 -2
- package/types/src/charts/drawSteps/leavesSurface.d.ts +11 -0
- package/types/src/charts/drawSteps/selectActions.d.ts +58 -0
- package/types/src/charts/drawSteps/selectGesture.d.ts +60 -0
- package/types/src/charts/drawSteps/selectRegion.d.ts +86 -0
- package/types/src/charts/drawSteps/selectState.d.ts +51 -0
- package/types/src/charts/drawSteps/zoomControls.d.ts +17 -7
- package/types/src/charts/drawSteps/zoomControlsMarkup.d.ts +94 -21
- package/types/src/charts/drawSteps/zoomControlsMenu.d.ts +30 -0
- package/types/src/charts/drawSteps/zoomDrag.d.ts +2 -0
- package/types/src/charts/facet/drawFacets.d.ts +6 -3
- package/types/src/charts/facet/facetConfig.d.ts +35 -1
- package/types/src/charts/facet/facetData.d.ts +8 -2
- package/types/src/charts/facet/facetGrid.d.ts +12 -0
- package/types/src/charts/facet/facetGutter.d.ts +19 -5
- package/types/src/charts/facet/facetLayout.d.ts +79 -0
- package/types/src/charts/facet/facetLayouts.d.ts +21 -0
- package/types/src/charts/facet/facetScene.d.ts +4 -1
- package/types/src/charts/features/annotationFrame.d.ts +2 -0
- package/types/src/charts/features/axesFinal.d.ts +5 -2
- package/types/src/charts/features/bareRegion.d.ts +18 -0
- package/types/src/charts/features/boxGrid.d.ts +28 -0
- package/types/src/charts/features/centerLabel.d.ts +16 -2
- package/types/src/charts/features/circleLabelPlacement.d.ts +81 -11
- package/types/src/charts/features/circleLabels.d.ts +33 -3
- package/types/src/charts/features/colorScaleHover.d.ts +3 -2
- package/types/src/charts/features/colorScaleTooltip.d.ts +4 -9
- package/types/src/charts/features/colorScaleValue.d.ts +6 -0
- package/types/src/charts/features/curvedArrows.d.ts +28 -12
- package/types/src/charts/features/edgeArrows.d.ts +40 -30
- package/types/src/charts/features/emitHelpers.d.ts +6 -1
- package/types/src/charts/features/featuresColorScale.d.ts +6 -0
- package/types/src/charts/features/hoverTicks.d.ts +5 -2
- package/types/src/charts/features/keyHold.d.ts +41 -0
- package/types/src/charts/features/keyTooltip.d.ts +44 -0
- package/types/src/charts/features/labelLayering.d.ts +38 -0
- package/types/src/charts/features/labelSlots.d.ts +53 -0
- package/types/src/charts/features/linkLabelPath.d.ts +0 -7
- package/types/src/charts/features/nodeDrag.d.ts +51 -0
- package/types/src/charts/features/nodeKeys.d.ts +53 -0
- package/types/src/charts/features/nodeOutline.d.ts +34 -0
- package/types/src/charts/features/pathLabelBends.d.ts +78 -0
- package/types/src/charts/features/plotAnnotations.d.ts +2 -1
- package/types/src/charts/features/plotPaint.d.ts +5 -0
- package/types/src/charts/features/rectNodeSize.d.ts +42 -0
- package/types/src/charts/features/ringLabels.d.ts +3 -1
- package/types/src/charts/features/selfLoops.d.ts +10 -9
- package/types/src/charts/features/shapeEmit.d.ts +2 -0
- package/types/src/charts/features/sharedFields.d.ts +8 -4
- package/types/src/charts/features/spokeLabels.d.ts +123 -0
- package/types/src/charts/features/swatchPaint.d.ts +58 -0
- package/types/src/charts/features/thresholdMembers.d.ts +6 -6
- package/types/src/charts/features/tooltipRows.d.ts +50 -0
- package/types/src/charts/features/tooltipSwatch.d.ts +25 -11
- package/types/src/charts/helpers/valueTitle.d.ts +7 -0
- package/types/src/charts/index.d.ts +17 -0
- package/types/src/charts/pipeline/preDrawData.d.ts +26 -0
- package/types/src/charts/plotBuffers/Circle.d.ts +2 -1
- package/types/src/charts/plotBuffers/Rect.d.ts +2 -1
- package/types/src/charts/plotBuffers/Tick.d.ts +9 -0
- package/types/src/charts/plotBuffers/defaultBuffers.d.ts +2 -0
- package/types/src/charts/viz/VizBase.d.ts +32 -1
- package/types/src/charts/viz/appendRows.d.ts +49 -0
- package/types/src/charts/viz/dataChanged.d.ts +11 -0
- package/types/src/charts/viz/discrete.d.ts +19 -0
- package/types/src/charts/viz/focusTargets.d.ts +15 -1
- package/types/src/charts/viz/groupByLevels.d.ts +36 -0
- package/types/src/charts/viz/groupRow.d.ts +6 -0
- package/types/src/charts/viz/hoverBand.d.ts +28 -0
- package/types/src/charts/viz/interactionOpacity.d.ts +23 -2
- package/types/src/charts/viz/keyboardNav.d.ts +13 -0
- package/types/src/charts/viz/liftRaised.d.ts +23 -0
- package/types/src/charts/viz/setCursor.d.ts +12 -0
- package/types/src/charts/viz/simpleHover.d.ts +3 -3
- package/types/src/charts/viz/userClick.d.ts +8 -0
- package/types/src/charts/viz/vizFields.d.ts +7 -0
- package/types/src/charts/viz/vizTypes.d.ts +116 -2
- package/types/src/components/Axis/Axis.d.ts +35 -0
- package/types/src/components/Axis/axisDefaults.d.ts +2 -0
- package/types/src/components/Axis/axisLabelSize.d.ts +3 -3
- package/types/src/components/Axis/axisLabelThinning.d.ts +19 -1
- package/types/src/components/Axis/axisLayoutScale.d.ts +14 -2
- package/types/src/components/Axis/axisLevels.d.ts +137 -0
- package/types/src/components/Axis/axisMinorTicks.d.ts +83 -0
- package/types/src/components/Axis/axisPeriods.d.ts +45 -0
- package/types/src/components/Axis/axisRangeBreaks.d.ts +6 -2
- package/types/src/components/Axis/axisRounding.d.ts +15 -1
- package/types/src/components/Axis/axisScaleType.d.ts +32 -0
- package/types/src/components/Axis/axisScene.d.ts +15 -7
- package/types/src/components/Axis/axisTickLookups.d.ts +26 -0
- package/types/src/components/Axis/axisTooltipTargets.d.ts +16 -4
- package/types/src/components/Axis/labelSizeSession.d.ts +16 -0
- package/types/src/components/Axis/rangeBreaks.d.ts +6 -2
- package/types/src/components/Axis/timeValues.d.ts +48 -2
- package/types/src/components/ColorScale/colorScaleScale.d.ts +45 -0
- package/types/src/components/Tooltip.d.ts +11 -2
- package/types/src/components/tooltipDom.d.ts +24 -0
- package/types/src/fluent.d.ts +30 -1
- package/types/src/shapes/Bar.d.ts +7 -0
- package/types/src/shapes/Box.d.ts +15 -0
- package/types/src/shapes/Shape.d.ts +11 -0
- package/types/src/shapes/Tick.d.ts +20 -0
- package/types/src/shapes/boxExtraShapes.d.ts +40 -0
- package/types/src/shapes/boxExtras.d.ts +85 -0
- package/types/src/shapes/boxStyle.d.ts +25 -4
- package/types/src/shapes/downsample.d.ts +68 -0
- package/types/src/shapes/hitAreaNode.d.ts +2 -1
- package/types/src/shapes/index.d.ts +1 -0
- package/types/src/shapes/pathSeries.d.ts +35 -0
- package/types/src/shapes/shapeConfig.d.ts +70 -2
- package/types/src/utils/BaseClass.d.ts +18 -4
- package/types/src/utils/D3plusConfig.d.ts +991 -85
- package/types/src/utils/index.d.ts +1 -1
- package/types/src/utils/jitter.d.ts +23 -0
- package/types/src/utils/resetSetters.d.ts +23 -0
- package/umd/d3plus-core.full.js +98950 -68731
- package/umd/d3plus-core.full.min.js +2 -2
- package/umd/d3plus-core.js +77484 -48545
- package/umd/d3plus-core.min.js +2 -2
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
The scene nodes of a Geomap's `dotDensity` dots and `hexbin` bins.
|
|
3
|
+
|
|
4
|
+
@module
|
|
5
|
+
*/ import { color } from "d3-color";
|
|
6
|
+
import { formatAbbreviate } from "@d3plus/format";
|
|
7
|
+
import { paintFromShapeConfig, resolveAccessor, shapeConfigFor } from "../features/emitHelpers.js";
|
|
8
|
+
import { colorScaleColor } from "../features/colorScaleValue.js";
|
|
9
|
+
import { backgroundInk, chartBackground } from "../viz/backgroundInk.js";
|
|
10
|
+
import { dotsPathD } from "./dotDensity.js";
|
|
11
|
+
import { geoBinMeta, geoBinTitle } from "./geoHexbin.js";
|
|
12
|
+
/**
|
|
13
|
+
The color of a group of dots: `dotDensity.fill`, else, with categories,
|
|
14
|
+
the color the chart gives their row (as its legend shows), else the
|
|
15
|
+
first color of the chart's palette (see `singleDotFill`).
|
|
16
|
+
@param viz The Geomap.
|
|
17
|
+
@param layout The dots.
|
|
18
|
+
@param group The group.
|
|
19
|
+
*/ export function dotFill(viz, layout, group) {
|
|
20
|
+
const { fill } = layout.settings;
|
|
21
|
+
const own = resolveAccessor(fill, group.row, group.index);
|
|
22
|
+
if (typeof own === "string" && own) return own;
|
|
23
|
+
if (layout.categories) {
|
|
24
|
+
const paint = paintFromShapeConfig(shapeConfigFor(viz, "Circle"), group.row, group.index);
|
|
25
|
+
if (paint.fill) return paint.fill;
|
|
26
|
+
}
|
|
27
|
+
return singleDotFill(viz);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
The color of dots without categories: the first color of the chart's
|
|
31
|
+
palette, lightened over a dark basemap so the dots stand out from the
|
|
32
|
+
dark regions.
|
|
33
|
+
@param viz The Geomap.
|
|
34
|
+
*/ export function singleDotFill(viz) {
|
|
35
|
+
const palette = viz.schema.colorDefaults?.scale?.range?.();
|
|
36
|
+
const first = palette?.[0] ?? backgroundInk(viz);
|
|
37
|
+
if (!viz._basemapDark) return first;
|
|
38
|
+
const c = color(first);
|
|
39
|
+
return c ? c.brighter(DARK_LIFT).formatHex() : first;
|
|
40
|
+
}
|
|
41
|
+
/** How much `singleDotFill` lightens the palette color over a dark basemap. */ const DARK_LIFT = 0.8;
|
|
42
|
+
/** Each group's dots, as one path of circles. */ export function emitDots(viz, layout) {
|
|
43
|
+
if (!layout) return [];
|
|
44
|
+
const { r, fillOpacity } = layout.settings;
|
|
45
|
+
const t = (s)=>viz.schema.translate(s);
|
|
46
|
+
const out = [];
|
|
47
|
+
for (const group of layout.groups){
|
|
48
|
+
if (!group.points.length) continue;
|
|
49
|
+
const label = viz._drawLabel(group.row, group.index, 0);
|
|
50
|
+
out.push({
|
|
51
|
+
type: "path",
|
|
52
|
+
key: `geomap-dots-${group.key}`,
|
|
53
|
+
d: dotsPathD(group.points, r),
|
|
54
|
+
datum: group.row,
|
|
55
|
+
index: group.index,
|
|
56
|
+
paint: {
|
|
57
|
+
fill: dotFill(viz, layout, group),
|
|
58
|
+
fillOpacity,
|
|
59
|
+
stroke: "none",
|
|
60
|
+
strokeWidth: 0
|
|
61
|
+
},
|
|
62
|
+
aria: {
|
|
63
|
+
label: `${label}, ${formatAbbreviate(group.points.length, viz.schema.locale)} ${t("Dots").toLowerCase()}.`
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
/** The bins, each a hexagon filled by its measure on the colorScale. */ export function emitBins(viz, bins) {
|
|
70
|
+
if (!bins || !bins.length) return [];
|
|
71
|
+
const stroke = chartBackground(viz);
|
|
72
|
+
const out = [];
|
|
73
|
+
bins.forEach((row, index)=>{
|
|
74
|
+
const meta = geoBinMeta(row);
|
|
75
|
+
out.push({
|
|
76
|
+
type: "path",
|
|
77
|
+
key: `geomap-bin-${row.id}`,
|
|
78
|
+
d: meta.path,
|
|
79
|
+
datum: row,
|
|
80
|
+
index,
|
|
81
|
+
paint: {
|
|
82
|
+
fill: colorScaleColor(viz, meta.value),
|
|
83
|
+
stroke,
|
|
84
|
+
strokeWidth: 0.5,
|
|
85
|
+
vectorEffect: "non-scaling-stroke"
|
|
86
|
+
},
|
|
87
|
+
aria: {
|
|
88
|
+
label: `${geoBinTitle(viz, row)}.`
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
The config a Geomap's `dotDensity` and `hexbin` add, and how they reach
|
|
3
|
+
the colorScale and the legend.
|
|
4
|
+
|
|
5
|
+
@module
|
|
6
|
+
*/ import { dotDensitySettings } from "./dotDensityLayout.js";
|
|
7
|
+
import { geoBinValue, geoHexbinSettings } from "./geoHexbin.js";
|
|
8
|
+
import { geoHexbinColorRows, rebinOnZoom } from "./geoHexbinZoom.js";
|
|
9
|
+
import { dataRows } from "../features/featuresColorScale.js";
|
|
10
|
+
import { drillsOnMap } from "./drillDown.js";
|
|
11
|
+
/** Geomap's `dotDensity` and `hexbin` fields. */ export function densityFields() {
|
|
12
|
+
return [
|
|
13
|
+
/**
|
|
14
|
+
Draws one dot for every `per` units of each row's `value`, scattered
|
|
15
|
+
inside its region. Each region places its dots the same way on
|
|
16
|
+
every draw, so a resize or a new value never moves the dots
|
|
17
|
+
already there. With more than one `groupBy` level, the outer levels
|
|
18
|
+
split each region into categories, whose dots take their colors
|
|
19
|
+
(and show in the legend); with one, every dot takes the first color
|
|
20
|
+
of the chart's palette. Past 20,000 dots, a chart whose `renderer`
|
|
21
|
+
isn't set draws on Canvas. The region outlines stay drawn, and
|
|
22
|
+
hovering one shows its totals. `false` (the default) draws no dots.
|
|
23
|
+
@type {false | {value: string | function, per?: number, r?: number, fill?: string | function, fillOpacity?: number, max?: number}}
|
|
24
|
+
*/ {
|
|
25
|
+
key: "dotDensity",
|
|
26
|
+
default: false
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
Bins the coordinate points into hexagons on the map, each colored
|
|
30
|
+
on the colorScale by how many points it holds: `true`, or
|
|
31
|
+
`{radius, value, agg, label}` to set the hexagon radius in pixels
|
|
32
|
+
(`12` by default) and color each bin by the `"sum"` (default) or
|
|
33
|
+
`"mean"` of `value` over its points instead, named `label` in its
|
|
34
|
+
tooltip. Zooming bins the points again at the same pixel radius, so
|
|
35
|
+
finer detail appears. The points themselves aren't drawn. `false`
|
|
36
|
+
(the default) draws the points.
|
|
37
|
+
@type {boolean | {radius?: number, value?: string | function, agg?: "sum" | "mean", label?: string}}
|
|
38
|
+
*/ {
|
|
39
|
+
key: "hexbin",
|
|
40
|
+
default: false
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
Points the colorScale at the bins while `hexbin` is on (it reads each
|
|
46
|
+
bin's measure, from the bins in view), and re-bins them as the map
|
|
47
|
+
zooms. With a topojson for each level, it reads the rows of the level
|
|
48
|
+
drawn (every region of that level, through any drill). Runs before
|
|
49
|
+
each draw.
|
|
50
|
+
@param viz The Geomap.
|
|
51
|
+
*/ export function syncDensityColorScale(viz) {
|
|
52
|
+
const settings = geoHexbinSettings(viz);
|
|
53
|
+
viz._colorScaleAccessor = settings ? ()=>geoBinValue : undefined;
|
|
54
|
+
// Bins re-bin as the map zooms; the zoom still moves the map.
|
|
55
|
+
viz._zoomRescale = settings ? (zoom)=>rebinOnZoom(viz, zoom) : undefined;
|
|
56
|
+
viz._colorScaleRows = settings ? ()=>geoHexbinColorRows(viz, settings) : drillsOnMap(viz) ? ()=>dataRows(viz, viz._drawDepth) : undefined;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
Wraps the chart's legend so it hides while `hexbin` bins the points, or
|
|
60
|
+
while `dotDensity` draws every dot one color.
|
|
61
|
+
@param viz The Geomap.
|
|
62
|
+
*/ export function densityLegend(viz) {
|
|
63
|
+
const base = viz.schema.legend;
|
|
64
|
+
return (config, arr)=>{
|
|
65
|
+
if (geoHexbinSettings(viz)) return false;
|
|
66
|
+
if (dotDensitySettings(viz) && !(viz._drawDepth > 0)) return false;
|
|
67
|
+
return base.call(viz, config, arr);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Joins a Geomap's rows to its regions for `dotDensity`, and lays out its
|
|
3
|
+
dots and `hexbin` bins for a draw.
|
|
4
|
+
|
|
5
|
+
@module
|
|
6
|
+
*/ import { merge } from "@d3plus/data";
|
|
7
|
+
import { dotDensitySettings, geomapDotDensity } from "./dotDensityLayout.js";
|
|
8
|
+
import { noteDotRows } from "./densityTooltip.js";
|
|
9
|
+
import { syncDotRenderer } from "./dotRenderer.js";
|
|
10
|
+
import { geoBinColorRows, geoBinPoints, geoHexbinSettings } from "./geoHexbin.js";
|
|
11
|
+
import { geoBinsAt, geoBinsInView, geoZoom, refreshGeoColorScale } from "./geoHexbinZoom.js";
|
|
12
|
+
import { isPointRow } from "./pointRows.js";
|
|
13
|
+
/**
|
|
14
|
+
The rows matched to regions (those without a coordinate point), by
|
|
15
|
+
region id, and each region's datum: its one row, or with `dotDensity`
|
|
16
|
+
splitting regions into categories, its rows merged (so its tooltip
|
|
17
|
+
reads the region's totals).
|
|
18
|
+
@param viz The Geomap.
|
|
19
|
+
*/ export function geomapRegionRows(viz) {
|
|
20
|
+
const rows = new Map();
|
|
21
|
+
viz._filteredData.forEach((row, index)=>{
|
|
22
|
+
if (isPointRow(viz, row, index)) return;
|
|
23
|
+
const id = `${viz._id(row, index)}`;
|
|
24
|
+
const list = rows.get(id);
|
|
25
|
+
if (list) list.push({
|
|
26
|
+
row,
|
|
27
|
+
index
|
|
28
|
+
});
|
|
29
|
+
else rows.set(id, [
|
|
30
|
+
{
|
|
31
|
+
row,
|
|
32
|
+
index
|
|
33
|
+
}
|
|
34
|
+
]);
|
|
35
|
+
});
|
|
36
|
+
const merged = Boolean(dotDensitySettings(viz)) && viz._drawDepth > 0;
|
|
37
|
+
const data = {};
|
|
38
|
+
for (const [id, list] of rows)data[id] = merged && list.length > 1 ? merge(list.map((r)=>r.row), viz.schema.aggs) : list[list.length - 1].row;
|
|
39
|
+
return {
|
|
40
|
+
rows,
|
|
41
|
+
data
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
Lays out the dots inside the regions and bins the visible points, and
|
|
46
|
+
lays the colorScale out again over the bins (with small multiples,
|
|
47
|
+
every panel's bins, so all panels share one colorScale).
|
|
48
|
+
@param viz The Geomap.
|
|
49
|
+
@param input The regions, their rows and datums, each region's
|
|
50
|
+
projected path, and the coordinate points the projection draws.
|
|
51
|
+
*/ export function geomapDensity(viz, input) {
|
|
52
|
+
const dots = geomapDotDensity(viz, input.regions, input.rows, input.pathD);
|
|
53
|
+
// A chart switched to Canvas for its dots goes back without them.
|
|
54
|
+
if (!dots) syncDotRenderer(viz, 0);
|
|
55
|
+
if (dots) {
|
|
56
|
+
const regionDots = new Map();
|
|
57
|
+
const byRegion = new Map();
|
|
58
|
+
for (const g of dots.groups){
|
|
59
|
+
const list = byRegion.get(`${g.region}`);
|
|
60
|
+
if (list) list.push(g);
|
|
61
|
+
else byRegion.set(`${g.region}`, [
|
|
62
|
+
g
|
|
63
|
+
]);
|
|
64
|
+
}
|
|
65
|
+
for (const region of input.regions){
|
|
66
|
+
const groups = byRegion.get(`${region.id}`);
|
|
67
|
+
if (region.data && groups) regionDots.set(region.data, groups);
|
|
68
|
+
}
|
|
69
|
+
noteDotRows(viz, dots, regionDots);
|
|
70
|
+
}
|
|
71
|
+
const settings = geoHexbinSettings(viz);
|
|
72
|
+
if (!settings) return {
|
|
73
|
+
dots,
|
|
74
|
+
bins: null
|
|
75
|
+
};
|
|
76
|
+
// Bins keep their pixel radius at the chart's zoom.
|
|
77
|
+
const zoom = geoZoom(viz);
|
|
78
|
+
const points = geoBinPoints(viz, input.points, settings);
|
|
79
|
+
const bins = geoBinsAt(viz, points, settings, zoom.k);
|
|
80
|
+
refreshGeoColorScale(viz, viz._facetStep === "panel" ? geoBinColorRows(viz, settings) : geoBinsInView(viz, bins, zoom, settings.radius));
|
|
81
|
+
return {
|
|
82
|
+
dots,
|
|
83
|
+
bins,
|
|
84
|
+
binState: {
|
|
85
|
+
points,
|
|
86
|
+
k: zoom.k,
|
|
87
|
+
bins
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Geomap's tooltip for `dotDensity` and `hexbin`: a bin's measure, a
|
|
3
|
+
group of dots' value and dot count, and a region's totals under its
|
|
4
|
+
dots.
|
|
5
|
+
|
|
6
|
+
@module
|
|
7
|
+
*/ import { formatAbbreviate } from "@d3plus/format";
|
|
8
|
+
import { bareRegionName } from "../features/bareRegion.js";
|
|
9
|
+
import { linkTooltipConfig } from "../features/linkInteraction.js";
|
|
10
|
+
import { geoBinTitle, geoBinTooltipRows } from "./geoHexbin.js";
|
|
11
|
+
import { geoClusterTitle, geoClusterTooltipRows } from "./pointClusterLayout.js";
|
|
12
|
+
/** The dot groups each hovered row stands for, per chart, with their dots. */ const noted = new WeakMap();
|
|
13
|
+
/**
|
|
14
|
+
Notes the rows a tooltip reads dots for: each group's row, and each
|
|
15
|
+
region's datum with all of the region's groups. Small multiples note
|
|
16
|
+
every panel's.
|
|
17
|
+
@param viz The Geomap.
|
|
18
|
+
@param dots The dots.
|
|
19
|
+
@param regions Each region datum's groups.
|
|
20
|
+
*/ export function noteDotRows(viz, dots, regions) {
|
|
21
|
+
let rows = noted.get(viz);
|
|
22
|
+
if (!rows) noted.set(viz, rows = new WeakMap());
|
|
23
|
+
for (const g of dots.groups)rows.set(g.row, {
|
|
24
|
+
dots,
|
|
25
|
+
groups: [
|
|
26
|
+
g
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
for (const [datum, groups] of regions)rows.set(datum, {
|
|
30
|
+
dots,
|
|
31
|
+
groups
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const fmt = (viz, n)=>Number.isFinite(n) ? formatAbbreviate(n, viz.schema.locale) : "";
|
|
35
|
+
/**
|
|
36
|
+
The tooltip rows of some dot groups: each category's value (or the
|
|
37
|
+
value, without categories), then the dots drawn and what each stands
|
|
38
|
+
for.
|
|
39
|
+
@param viz The Geomap.
|
|
40
|
+
@param dots The dots.
|
|
41
|
+
@param groups The groups: one, for a hovered group, or a region's.
|
|
42
|
+
*/ export function dotTooltipRows(viz, dots, groups) {
|
|
43
|
+
const t = (s)=>viz.schema.translate(s);
|
|
44
|
+
const rows = [];
|
|
45
|
+
if (dots.categories) [
|
|
46
|
+
...groups
|
|
47
|
+
].sort((a, b)=>b.value - a.value).forEach((g)=>rows.push([
|
|
48
|
+
`${viz._drawLabel(g.row, g.index, 0)}`,
|
|
49
|
+
fmt(viz, g.value)
|
|
50
|
+
]));
|
|
51
|
+
else rows.push([
|
|
52
|
+
dots.settings.valueName ?? t("Value"),
|
|
53
|
+
fmt(viz, groups.reduce((sum, g)=>sum + g.value, 0))
|
|
54
|
+
]);
|
|
55
|
+
const count = groups.reduce((sum, g)=>sum + g.points.length, 0);
|
|
56
|
+
rows.push([
|
|
57
|
+
t("Dots"),
|
|
58
|
+
fmt(viz, count)
|
|
59
|
+
]);
|
|
60
|
+
rows.push([
|
|
61
|
+
t("Each dot"),
|
|
62
|
+
fmt(viz, dots.per)
|
|
63
|
+
]);
|
|
64
|
+
return rows;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
The tooltip rows Geomap adds for a hovered row: a bin's point count, a
|
|
68
|
+
group of dots' value and count, or the totals of the region they fill.
|
|
69
|
+
Empty for any other row.
|
|
70
|
+
@param viz The Geomap.
|
|
71
|
+
@param d The hovered row.
|
|
72
|
+
*/ export function densityTooltipRows(viz, d) {
|
|
73
|
+
const bin = geoBinTooltipRows(viz, d);
|
|
74
|
+
if (bin.length) return bin;
|
|
75
|
+
const hit = d && noted.get(viz)?.get(d);
|
|
76
|
+
return hit ? dotTooltipRows(viz, hit.dots, hit.groups) : [];
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
Geomap's default `tooltipConfig`: a cluster titled by its count and
|
|
80
|
+
listing its first points, a bin titled by its measure, a region with no
|
|
81
|
+
data row by its own name (see `bareRegionName`), dots and regions under
|
|
82
|
+
them listing their values and dots, and links and their ends as on the
|
|
83
|
+
other node-link charts (see `linkTooltipConfig`).
|
|
84
|
+
@param viz The Geomap.
|
|
85
|
+
*/ export function geomapTooltipConfig(viz) {
|
|
86
|
+
const links = linkTooltipConfig(viz);
|
|
87
|
+
return {
|
|
88
|
+
// A region with no data row reaches here as its bare feature, with the
|
|
89
|
+
// region wrapping it after.
|
|
90
|
+
title: (d, i, wrapper)=>geoClusterTitle(viz, d) ?? geoBinTitle(viz, d) ?? bareRegionName(wrapper) ?? links.title(d, i),
|
|
91
|
+
tbody: (d, i)=>{
|
|
92
|
+
const cluster = geoClusterTooltipRows(viz, d);
|
|
93
|
+
if (cluster.length) return cluster;
|
|
94
|
+
const rows = densityTooltipRows(viz, d);
|
|
95
|
+
return rows.length ? rows : links.tbody(d, i);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Dot-density helpers: how many dots each value draws, and where they
|
|
3
|
+
fall inside a region's projected shape, scattered by a random stream
|
|
4
|
+
seeded from the region, so the same region always places its dots the
|
|
5
|
+
same way.
|
|
6
|
+
|
|
7
|
+
@module
|
|
8
|
+
*/ /** A point in pixels. */ /**
|
|
9
|
+
A random number generator seeded by `key`: a 32-bit FNV-1a hash of its
|
|
10
|
+
characters feeding a mulberry32 stream. The same key always gives the
|
|
11
|
+
same sequence of numbers in [0, 1).
|
|
12
|
+
@param key The seed.
|
|
13
|
+
*/ export function seededRandom(key) {
|
|
14
|
+
let h = 0x811c9dc5;
|
|
15
|
+
for(let i = 0; i < key.length; i++){
|
|
16
|
+
h ^= key.charCodeAt(i);
|
|
17
|
+
h = Math.imul(h, 0x01000193);
|
|
18
|
+
}
|
|
19
|
+
let s = h >>> 0;
|
|
20
|
+
return ()=>{
|
|
21
|
+
s = s + 0x6d2b79f5 >>> 0;
|
|
22
|
+
let t = s;
|
|
23
|
+
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
24
|
+
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
|
25
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
Whether a point falls inside the shape the rings draw, by the even-odd
|
|
30
|
+
rule: inside an odd number of rings, so a hole cuts out of its polygon
|
|
31
|
+
and each part of a multipolygon counts.
|
|
32
|
+
@param x The point's x.
|
|
33
|
+
@param y The point's y.
|
|
34
|
+
@param rings The shape's rings.
|
|
35
|
+
*/ export function insideRings(x, y, rings) {
|
|
36
|
+
let inside = false;
|
|
37
|
+
for (const ring of rings){
|
|
38
|
+
const n = ring.length;
|
|
39
|
+
for(let i = 0, j = n - 1; i < n; j = i++){
|
|
40
|
+
const [xi, yi] = ring[i];
|
|
41
|
+
const [xj, yj] = ring[j];
|
|
42
|
+
if (yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi) inside = !inside;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return inside;
|
|
46
|
+
}
|
|
47
|
+
/** The box around every ring, `[x0, y0, x1, y1]`, or null without a point. */ export function ringsBounds(rings) {
|
|
48
|
+
let x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;
|
|
49
|
+
for (const ring of rings)for (const [x, y] of ring){
|
|
50
|
+
if (x < x0) x0 = x;
|
|
51
|
+
if (x > x1) x1 = x;
|
|
52
|
+
if (y < y0) y0 = y;
|
|
53
|
+
if (y > y1) y1 = y;
|
|
54
|
+
}
|
|
55
|
+
return x0 <= x1 && y0 <= y1 ? [
|
|
56
|
+
x0,
|
|
57
|
+
y0,
|
|
58
|
+
x1,
|
|
59
|
+
y1
|
|
60
|
+
] : null;
|
|
61
|
+
}
|
|
62
|
+
/** The candidates tried for each dot before a shape is taken as too thin to fill. */ const TRIES_PER_DOT = 200;
|
|
63
|
+
/**
|
|
64
|
+
A seeded stream of dots inside a shape: each candidate is drawn at the
|
|
65
|
+
same share of the way across the shape's box, so a shape that is only
|
|
66
|
+
moved or scaled (as a map resize does) keeps its dots in place, and
|
|
67
|
+
asking for more dots keeps the ones already placed. Candidates outside
|
|
68
|
+
the shape are thrown away.
|
|
69
|
+
*/ export class DotScatter {
|
|
70
|
+
rings;
|
|
71
|
+
points = [];
|
|
72
|
+
box;
|
|
73
|
+
random;
|
|
74
|
+
exhausted = false;
|
|
75
|
+
/**
|
|
76
|
+
@param rings The shape's rings, in pixels.
|
|
77
|
+
@param seed The key the shape's random stream is seeded with.
|
|
78
|
+
*/ constructor(rings, seed){
|
|
79
|
+
this.rings = rings;
|
|
80
|
+
this.box = ringsBounds(rings);
|
|
81
|
+
this.random = seededRandom(seed);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
The first `count` dots of the stream (fewer when the shape is too
|
|
85
|
+
thin to hold them).
|
|
86
|
+
@param count How many dots.
|
|
87
|
+
*/ take(count) {
|
|
88
|
+
const { box, points } = this;
|
|
89
|
+
if (box && !this.exhausted && points.length < count) {
|
|
90
|
+
const [x0, y0, x1, y1] = box;
|
|
91
|
+
let tries = (count - points.length) * TRIES_PER_DOT;
|
|
92
|
+
while(points.length < count && tries-- > 0){
|
|
93
|
+
const x = x0 + this.random() * (x1 - x0);
|
|
94
|
+
const y = y0 + this.random() * (y1 - y0);
|
|
95
|
+
if (insideRings(x, y, this.rings)) points.push([
|
|
96
|
+
x,
|
|
97
|
+
y
|
|
98
|
+
]);
|
|
99
|
+
}
|
|
100
|
+
if (points.length < count) this.exhausted = true;
|
|
101
|
+
}
|
|
102
|
+
return points.length > count ? points.slice(0, count) : points.slice();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
The smallest round number (1, 2, 2.5 or 5 times a power of ten) at
|
|
107
|
+
least `x`.
|
|
108
|
+
@param x A positive number.
|
|
109
|
+
*/ export function niceCeil(x) {
|
|
110
|
+
if (!(x > 0)) return 1;
|
|
111
|
+
const p = Math.pow(10, Math.floor(Math.log10(x)));
|
|
112
|
+
for (const m of [
|
|
113
|
+
1,
|
|
114
|
+
2,
|
|
115
|
+
2.5,
|
|
116
|
+
5,
|
|
117
|
+
10
|
|
118
|
+
])if (m * p >= x * (1 - 1e-12)) return m * p;
|
|
119
|
+
return 10 * p;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
How many dots each value draws at `per` units a dot (rounded to the
|
|
123
|
+
nearest dot), and the units each dot stands for once the total is held
|
|
124
|
+
to `max` dots: past it, `per` grows to the next round number (see
|
|
125
|
+
`niceCeil`) at which the dots fit.
|
|
126
|
+
@param values Each group's value (anything not a positive number draws none).
|
|
127
|
+
@param per The units each dot stands for.
|
|
128
|
+
@param max The most dots drawn in all.
|
|
129
|
+
*/ export function dotCounts(values, per, max) {
|
|
130
|
+
const positive = values.map((v)=>Number.isFinite(v) && v > 0 ? v : 0);
|
|
131
|
+
const limit = max > 0 ? Math.floor(max) : Infinity;
|
|
132
|
+
const count = (u)=>positive.map((v)=>Math.round(v / u));
|
|
133
|
+
const total = (c)=>c.reduce((a, b)=>a + b, 0);
|
|
134
|
+
let unit = per > 0 ? per : 1;
|
|
135
|
+
let counts = count(unit);
|
|
136
|
+
let sum = total(counts);
|
|
137
|
+
while(sum > limit){
|
|
138
|
+
unit = niceCeil(Math.max(unit * (sum / limit), unit * 1.000001));
|
|
139
|
+
counts = count(unit);
|
|
140
|
+
sum = total(counts);
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
counts,
|
|
144
|
+
per: unit
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
Dots as one path of `r`-pixel circles, each drawn as two arcs.
|
|
149
|
+
@param points The dots' centers.
|
|
150
|
+
@param r The radius.
|
|
151
|
+
*/ export function dotsPathD(points, r) {
|
|
152
|
+
const round = (n)=>Math.round(n * 100) / 100;
|
|
153
|
+
const rr = round(r);
|
|
154
|
+
let d = "";
|
|
155
|
+
for (const [x, y] of points)d += `M${round(x - r)},${round(y)}a${rr},${rr} 0 1,0 ${round(2 * r)},0a${rr},${rr} 0 1,0 ${round(-2 * r)},0`;
|
|
156
|
+
return d;
|
|
157
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Lays out a Geomap's `dotDensity`: one dot for every `per` units of each
|
|
3
|
+
row's value, scattered inside its region's projected shape. Each group
|
|
4
|
+
of dots (a region, or a category within one) draws from a random
|
|
5
|
+
stream seeded by its ids, so redraws and resizes keep every dot in
|
|
6
|
+
place.
|
|
7
|
+
|
|
8
|
+
@module
|
|
9
|
+
*/ import { pathRings } from "@d3plus/render";
|
|
10
|
+
import { fieldAccessor, fieldNameOf } from "../../utils/fieldAccessor.js";
|
|
11
|
+
import { regionsReshaped } from "./tileGrid.js";
|
|
12
|
+
import { DotScatter, dotCounts } from "./dotDensity.js";
|
|
13
|
+
import { syncDotRenderer } from "./dotRenderer.js";
|
|
14
|
+
/** `dotDensity`'s defaults. */ export const DOT_DEFAULTS = {
|
|
15
|
+
per: 1000,
|
|
16
|
+
r: 1.5,
|
|
17
|
+
fillOpacity: 0.8
|
|
18
|
+
};
|
|
19
|
+
/** The most dots drawn, unless `dotDensity.max` sets it: past it, `per` rises. */ export const DOT_MAX = 100000;
|
|
20
|
+
/**
|
|
21
|
+
`dotDensity`, resolved: null when it is off, has no `value`, or a
|
|
22
|
+
`cartogram` or `tileGrid` reshapes the regions.
|
|
23
|
+
*/ export function dotDensitySettings(viz) {
|
|
24
|
+
const option = viz.schema.dotDensity;
|
|
25
|
+
if (!option || typeof option !== "object" || regionsReshaped(viz)) return null;
|
|
26
|
+
const { value } = option;
|
|
27
|
+
const accessor = typeof value === "function" ? value : typeof value === "string" ? fieldAccessor(value) : undefined;
|
|
28
|
+
if (!accessor) return null;
|
|
29
|
+
const num = (v, fallback)=>typeof v === "number" && Number.isFinite(v) && v > 0 ? v : fallback;
|
|
30
|
+
return {
|
|
31
|
+
value: accessor,
|
|
32
|
+
valueName: typeof value === "string" ? value : fieldNameOf(accessor) ?? undefined,
|
|
33
|
+
per: num(option.per, DOT_DEFAULTS.per),
|
|
34
|
+
r: num(option.r, DOT_DEFAULTS.r),
|
|
35
|
+
fill: option.fill,
|
|
36
|
+
fillOpacity: typeof option.fillOpacity === "number" ? Math.min(1, Math.max(0, option.fillOpacity)) : DOT_DEFAULTS.fillOpacity,
|
|
37
|
+
max: num(option.max, DOT_MAX)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** Each viz's scatters, by group key, with the path they were placed in. */ const scatters = new WeakMap();
|
|
41
|
+
/** How many scatters a viz keeps per group drawn (one per small-multiples panel). */ const KEEP = 12;
|
|
42
|
+
/** The rings of each projected path, by its path data. */ function ringsOf(d, cache) {
|
|
43
|
+
let rings = cache.get(d);
|
|
44
|
+
if (!rings) cache.set(d, rings = pathRings(d) ?? []);
|
|
45
|
+
return rings;
|
|
46
|
+
}
|
|
47
|
+
/** The value a row's dots count, or 0 when it isn't a positive number. */ function rowValue(settings, d, i) {
|
|
48
|
+
const v = settings.value(d, i);
|
|
49
|
+
const n = v === null || v === undefined || v === "" ? NaN : Number(v);
|
|
50
|
+
return Number.isFinite(n) && n > 0 ? n : 0;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
The dots of every region with rows: each row's value over `per` (held
|
|
54
|
+
to `max` dots in all), scattered inside its region's projected shape.
|
|
55
|
+
Past the dots SVG draws quickly, a chart whose `renderer` was never set
|
|
56
|
+
switches to Canvas (see `syncDotRenderer`). Null when `dotDensity` is
|
|
57
|
+
off.
|
|
58
|
+
@param viz The Geomap.
|
|
59
|
+
@param regions The topojson regions.
|
|
60
|
+
@param rows Each region's rows (with their indices), by region id as a string.
|
|
61
|
+
@param pathD A region's projected path data.
|
|
62
|
+
*/ export function geomapDotDensity(viz, regions, rows, pathD) {
|
|
63
|
+
const settings = dotDensitySettings(viz);
|
|
64
|
+
if (!settings) return null;
|
|
65
|
+
const categories = (viz._drawDepth ?? 0) > 0;
|
|
66
|
+
const drawn = [];
|
|
67
|
+
const paths = [];
|
|
68
|
+
for (const region of regions){
|
|
69
|
+
const own = rows.get(`${region.id}`);
|
|
70
|
+
if (!own) continue;
|
|
71
|
+
const d = pathD(region);
|
|
72
|
+
for (const { row, index } of own){
|
|
73
|
+
const category = categories ? viz._ids(row, index).slice(0, viz._drawDepth).join("|") : "";
|
|
74
|
+
drawn.push({
|
|
75
|
+
key: `${region.id}|${category}`,
|
|
76
|
+
region: region.id,
|
|
77
|
+
row,
|
|
78
|
+
index,
|
|
79
|
+
value: rowValue(settings, row, index)
|
|
80
|
+
});
|
|
81
|
+
paths.push(d);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const { counts, per } = dotCounts(drawn.map((g)=>g.value), settings.per, settings.max);
|
|
85
|
+
syncDotRenderer(viz, counts.reduce((a, b)=>a + b, 0));
|
|
86
|
+
let kept = scatters.get(viz);
|
|
87
|
+
if (!kept) scatters.set(viz, kept = new Map());
|
|
88
|
+
const rings = new Map();
|
|
89
|
+
const live = new Set();
|
|
90
|
+
const groups = drawn.map((g, k)=>{
|
|
91
|
+
const d = paths[k];
|
|
92
|
+
live.add(g.key);
|
|
93
|
+
if (!d || !counts[k]) return {
|
|
94
|
+
...g,
|
|
95
|
+
points: []
|
|
96
|
+
};
|
|
97
|
+
let hit = kept.get(g.key);
|
|
98
|
+
if (!hit || hit.d !== d) kept.set(g.key, hit = {
|
|
99
|
+
d,
|
|
100
|
+
scatter: new DotScatter(ringsOf(d, rings), g.key)
|
|
101
|
+
});
|
|
102
|
+
return {
|
|
103
|
+
...g,
|
|
104
|
+
points: hit.scatter.take(counts[k])
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
// Small multiples keep every panel's scatters; a map whose regions have
|
|
108
|
+
// all changed starts over.
|
|
109
|
+
if (kept.size > KEEP * Math.max(1, live.size)) kept.clear();
|
|
110
|
+
return {
|
|
111
|
+
groups,
|
|
112
|
+
per,
|
|
113
|
+
categories,
|
|
114
|
+
settings
|
|
115
|
+
};
|
|
116
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
How a Geomap picks its renderer for `dotDensity`: past the dots SVG
|
|
3
|
+
draws quickly, a chart whose `renderer` was never set draws on Canvas,
|
|
4
|
+
and back on SVG once its dots fit again.
|
|
5
|
+
|
|
6
|
+
@module
|
|
7
|
+
*/ /** The most dots drawn on SVG before a chart switches itself to Canvas. */ export const DOT_SVG_MAX = 20000;
|
|
8
|
+
/** The charts whose `renderer` was set by the user. */ const chosen = new WeakSet();
|
|
9
|
+
/** The charts drawing on Canvas because of their dots. */ const switched = new WeakSet();
|
|
10
|
+
/** The charts that have logged their switch to Canvas. */ const noted = new WeakSet();
|
|
11
|
+
/**
|
|
12
|
+
Remembers when the chart's `renderer` is set, so the dots never
|
|
13
|
+
override a renderer the user chose.
|
|
14
|
+
@param viz The Geomap.
|
|
15
|
+
*/ export function trackRendererChoice(viz) {
|
|
16
|
+
const host = viz;
|
|
17
|
+
const base = host.renderer.bind(viz);
|
|
18
|
+
host.renderer = function(_) {
|
|
19
|
+
if (!arguments.length) return base();
|
|
20
|
+
chosen.add(viz);
|
|
21
|
+
switched.delete(viz);
|
|
22
|
+
return base(_);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/** Whether the chart's renderer was set by the user. */ export function rendererChosen(viz) {
|
|
26
|
+
return chosen.has(viz);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
Switches a chart whose `renderer` was never set to Canvas when it draws
|
|
30
|
+
more than `DOT_SVG_MAX` dots, logging it once, and back to SVG when it
|
|
31
|
+
draws fewer. A small-multiples panel only switches to Canvas, so one
|
|
32
|
+
panel with few dots doesn't undo another's switch.
|
|
33
|
+
@param viz The Geomap.
|
|
34
|
+
@param dots How many dots the draw places.
|
|
35
|
+
*/ export function syncDotRenderer(viz, dots) {
|
|
36
|
+
if (chosen.has(viz)) return;
|
|
37
|
+
if (dots > DOT_SVG_MAX) {
|
|
38
|
+
if (viz._renderer === "canvas") return;
|
|
39
|
+
viz._renderer = "canvas";
|
|
40
|
+
switched.add(viz);
|
|
41
|
+
if (!noted.has(viz)) {
|
|
42
|
+
noted.add(viz);
|
|
43
|
+
console.info(`d3plus: Geomap draws its ${dots} dots on Canvas, past the ${DOT_SVG_MAX} it draws on SVG. Set \`renderer\` to choose one.`);
|
|
44
|
+
}
|
|
45
|
+
} else if (switched.has(viz) && viz._facetStep !== "panel") {
|
|
46
|
+
viz._renderer = "svg";
|
|
47
|
+
switched.delete(viz);
|
|
48
|
+
}
|
|
49
|
+
}
|