@d3plus/core 4.3.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7406 -3676
- package/es/index.js +3 -3
- package/es/index.js.map +1 -1
- package/es/internal.js +13 -2
- package/es/internal.js.map +1 -1
- package/es/src/charts/AreaPlot/index.js +1 -2
- package/es/src/charts/AreaPlot/index.js.map +1 -1
- package/es/src/charts/BarChart/index.js +9 -3
- package/es/src/charts/BarChart/index.js.map +1 -1
- package/es/src/charts/BoxWhisker/index.js +6 -2
- package/es/src/charts/BoxWhisker/index.js.map +1 -1
- package/es/src/charts/BumpChart/index.js +1 -2
- package/es/src/charts/BumpChart/index.js.map +1 -1
- package/es/src/charts/Chord/applyLayout.js +205 -0
- package/es/src/charts/Chord/applyLayout.js.map +1 -0
- package/es/src/charts/Chord/emit.js +220 -0
- package/es/src/charts/Chord/emit.js.map +1 -0
- package/es/src/charts/Chord/index.js +249 -0
- package/es/src/charts/Chord/index.js.map +1 -0
- package/es/src/charts/Geomap/applyLayout.js +17 -10
- package/es/src/charts/Geomap/applyLayout.js.map +1 -1
- package/es/src/charts/Geomap/basemapTheme.js +78 -0
- package/es/src/charts/Geomap/basemapTheme.js.map +1 -0
- package/es/src/charts/Geomap/emit.js +18 -9
- package/es/src/charts/Geomap/emit.js.map +1 -1
- package/es/src/charts/Geomap/index.js +74 -105
- package/es/src/charts/Geomap/index.js.map +1 -1
- package/es/src/charts/Histogram/binData.js +225 -0
- package/es/src/charts/Histogram/binData.js.map +1 -0
- package/es/src/charts/Histogram/index.js +271 -0
- package/es/src/charts/Histogram/index.js.map +1 -0
- package/es/src/charts/LinePlot/index.js +1 -2
- package/es/src/charts/LinePlot/index.js.map +1 -1
- package/es/src/charts/Matrix/emit.js +6 -0
- package/es/src/charts/Matrix/emit.js.map +1 -1
- package/es/src/charts/Matrix/index.js +1 -2
- package/es/src/charts/Matrix/index.js.map +1 -1
- package/es/src/charts/Network/applyLayout.js +52 -4
- package/es/src/charts/Network/applyLayout.js.map +1 -1
- package/es/src/charts/Network/emit.js +61 -27
- package/es/src/charts/Network/emit.js.map +1 -1
- package/es/src/charts/Network/index.js +40 -55
- package/es/src/charts/Network/index.js.map +1 -1
- package/es/src/charts/Pack/emit.js +40 -2
- package/es/src/charts/Pack/emit.js.map +1 -1
- package/es/src/charts/Pack/index.js +14 -2
- package/es/src/charts/Pack/index.js.map +1 -1
- package/es/src/charts/Pie/applyLayout.js +20 -2
- package/es/src/charts/Pie/applyLayout.js.map +1 -1
- package/es/src/charts/Pie/emit.js +277 -32
- package/es/src/charts/Pie/emit.js.map +1 -1
- package/es/src/charts/Pie/index.js +47 -3
- package/es/src/charts/Pie/index.js.map +1 -1
- package/es/src/charts/Plot/discreteSpan.js +42 -0
- package/es/src/charts/Plot/discreteSpan.js.map +1 -0
- package/es/src/charts/Plot/draw.js +3 -1
- package/es/src/charts/Plot/draw.js.map +1 -1
- package/es/src/charts/Plot/index.js +152 -17
- package/es/src/charts/Plot/index.js.map +1 -1
- package/es/src/charts/Plot/pipeline.js +48 -22
- package/es/src/charts/Plot/pipeline.js.map +1 -1
- package/es/src/charts/Plot/pipelineDomains.js +84 -8
- package/es/src/charts/Plot/pipelineDomains.js.map +1 -1
- package/es/src/charts/Plot/plotZoom.js +278 -0
- package/es/src/charts/Plot/plotZoom.js.map +1 -0
- package/es/src/charts/Plot/shapeDefaults.js +3 -3
- package/es/src/charts/Plot/shapeDefaults.js.map +1 -1
- package/es/src/charts/Plot/sharedHover.js +431 -0
- package/es/src/charts/Plot/sharedHover.js.map +1 -0
- package/es/src/charts/Plot/sharedHoverScene.js +230 -0
- package/es/src/charts/Plot/sharedHoverScene.js.map +1 -0
- package/es/src/charts/Plot/sharedTooltip.js +163 -0
- package/es/src/charts/Plot/sharedTooltip.js.map +1 -0
- package/es/src/charts/Plot/stackShareLabels.js +137 -0
- package/es/src/charts/Plot/stackShareLabels.js.map +1 -0
- package/es/src/charts/Plot/stackShareTooltip.js +31 -0
- package/es/src/charts/Plot/stackShareTooltip.js.map +1 -0
- package/es/src/charts/Plot/trendLines.js +367 -0
- package/es/src/charts/Plot/trendLines.js.map +1 -0
- package/es/src/charts/Plot/trendScene.js +220 -0
- package/es/src/charts/Plot/trendScene.js.map +1 -0
- package/es/src/charts/Plot/trendTooltip.js +160 -0
- package/es/src/charts/Plot/trendTooltip.js.map +1 -0
- package/es/src/charts/Priestley/emit.js +36 -3
- package/es/src/charts/Priestley/emit.js.map +1 -1
- package/es/src/charts/Priestley/index.js +1 -2
- package/es/src/charts/Priestley/index.js.map +1 -1
- package/es/src/charts/Radar/emit.js +4 -1
- package/es/src/charts/Radar/emit.js.map +1 -1
- package/es/src/charts/Radar/index.js +16 -4
- package/es/src/charts/Radar/index.js.map +1 -1
- package/es/src/charts/RadialMatrix/emit.js +6 -0
- package/es/src/charts/RadialMatrix/emit.js.map +1 -1
- package/es/src/charts/RadialMatrix/index.js +18 -3
- package/es/src/charts/RadialMatrix/index.js.map +1 -1
- package/es/src/charts/Rings/applyLayout.js +72 -116
- package/es/src/charts/Rings/applyLayout.js.map +1 -1
- package/es/src/charts/Rings/emit.js +75 -10
- package/es/src/charts/Rings/emit.js.map +1 -1
- package/es/src/charts/Rings/index.js +24 -5
- package/es/src/charts/Rings/index.js.map +1 -1
- package/es/src/charts/Rings/ringsSizing.js +189 -0
- package/es/src/charts/Rings/ringsSizing.js.map +1 -0
- package/es/src/charts/Sankey/emit.js +55 -11
- package/es/src/charts/Sankey/emit.js.map +1 -1
- package/es/src/charts/Sankey/index.js +8 -2
- package/es/src/charts/Sankey/index.js.map +1 -1
- package/es/src/charts/StackedArea/index.js +9 -3
- package/es/src/charts/StackedArea/index.js.map +1 -1
- package/es/src/charts/Tree/emit.js +10 -4
- package/es/src/charts/Tree/emit.js.map +1 -1
- package/es/src/charts/Tree/index.js +6 -5
- package/es/src/charts/Tree/index.js.map +1 -1
- package/es/src/charts/Treemap/emit.js +56 -3
- package/es/src/charts/Treemap/emit.js.map +1 -1
- package/es/src/charts/Treemap/index.js +1 -2
- package/es/src/charts/Treemap/index.js.map +1 -1
- package/es/src/charts/definition/ChartDefinition.js.map +1 -1
- package/es/src/charts/definition/makeChart.js +8 -1
- package/es/src/charts/definition/makeChart.js.map +1 -1
- package/es/src/charts/drawSteps/backControl.js +85 -0
- package/es/src/charts/drawSteps/backControl.js.map +1 -0
- package/es/src/charts/drawSteps/bottomRightControls.js +193 -0
- package/es/src/charts/drawSteps/bottomRightControls.js.map +1 -0
- package/es/src/charts/drawSteps/bottomRightControlsMarkup.js +161 -0
- package/es/src/charts/drawSteps/bottomRightControlsMarkup.js.map +1 -0
- package/es/src/charts/drawSteps/controlButtonStyle.js +108 -0
- package/es/src/charts/drawSteps/controlButtonStyle.js.map +1 -0
- package/es/src/charts/drawSteps/minimap.js +395 -0
- package/es/src/charts/drawSteps/minimap.js.map +1 -0
- package/es/src/charts/drawSteps/minimapMarkup.js +147 -0
- package/es/src/charts/drawSteps/minimapMarkup.js.map +1 -0
- package/es/src/charts/drawSteps/searchControls.js +358 -0
- package/es/src/charts/drawSteps/searchControls.js.map +1 -0
- package/es/src/charts/drawSteps/searchControlsMarkup.js +430 -0
- package/es/src/charts/drawSteps/searchControlsMarkup.js.map +1 -0
- package/es/src/charts/drawSteps/tableView.js +173 -0
- package/es/src/charts/drawSteps/tableView.js.map +1 -0
- package/es/src/charts/drawSteps/tableViewControl.js +39 -0
- package/es/src/charts/drawSteps/tableViewControl.js.map +1 -0
- package/es/src/charts/drawSteps/tableViewMarkup.js +647 -0
- package/es/src/charts/drawSteps/tableViewMarkup.js.map +1 -0
- package/es/src/charts/drawSteps/topLeftControls.js +73 -0
- package/es/src/charts/drawSteps/topLeftControls.js.map +1 -0
- package/es/src/charts/drawSteps/topLeftControlsMarkup.js +227 -0
- package/es/src/charts/drawSteps/topLeftControlsMarkup.js.map +1 -0
- package/es/src/charts/drawSteps/zoomControls.js +317 -175
- package/es/src/charts/drawSteps/zoomControls.js.map +1 -1
- package/es/src/charts/drawSteps/zoomControlsMarkup.js +280 -0
- package/es/src/charts/drawSteps/zoomControlsMarkup.js.map +1 -0
- package/es/src/charts/events/click.shape.js +24 -1
- package/es/src/charts/events/click.shape.js.map +1 -1
- package/es/src/charts/events/mouseenter.js +3 -0
- package/es/src/charts/events/mouseenter.js.map +1 -1
- package/es/src/charts/events/mouseleave.js +3 -0
- package/es/src/charts/events/mouseleave.js.map +1 -1
- package/es/src/charts/events/mousemove.shape.js +2 -0
- package/es/src/charts/events/mousemove.shape.js.map +1 -1
- package/es/src/charts/features/attributionFeature.js +137 -0
- package/es/src/charts/features/attributionFeature.js.map +1 -0
- package/es/src/charts/features/axes.js +24 -9
- package/es/src/charts/features/axes.js.map +1 -1
- package/es/src/charts/features/chartGeometry.js +16 -2
- package/es/src/charts/features/chartGeometry.js.map +1 -1
- package/es/src/charts/features/edgeArrows.js +155 -0
- package/es/src/charts/features/edgeArrows.js.map +1 -0
- package/es/src/charts/features/emitHelpers.js +32 -0
- package/es/src/charts/features/emitHelpers.js.map +1 -1
- package/es/src/charts/features/ensureZoomDom.js +63 -12
- package/es/src/charts/features/ensureZoomDom.js.map +1 -1
- package/es/src/charts/features/features.js +89 -112
- package/es/src/charts/features/features.js.map +1 -1
- package/es/src/charts/features/featuresLegend.js +53 -17
- package/es/src/charts/features/featuresLegend.js.map +1 -1
- package/es/src/charts/features/plotPaint.js +81 -29
- package/es/src/charts/features/plotPaint.js.map +1 -1
- package/es/src/charts/features/shapeEmit.js +20 -2
- package/es/src/charts/features/shapeEmit.js.map +1 -1
- package/es/src/charts/features/zoomExtent.js +185 -0
- package/es/src/charts/features/zoomExtent.js.map +1 -0
- package/es/src/charts/helpers/tileAttributions.js +26 -0
- package/es/src/charts/helpers/tileAttributions.js.map +1 -1
- package/es/src/charts/index.js +2 -0
- package/es/src/charts/index.js.map +1 -1
- package/es/src/charts/pipeline/drillMorph.js +159 -0
- package/es/src/charts/pipeline/drillMorph.js.map +1 -0
- package/es/src/charts/pipeline/runChartDraw.js +35 -1
- package/es/src/charts/pipeline/runChartDraw.js.map +1 -1
- package/es/src/charts/pipeline/runVizPipeline.js +49 -15
- package/es/src/charts/pipeline/runVizPipeline.js.map +1 -1
- package/es/src/charts/pipeline/vizDrawPure.js +52 -6
- package/es/src/charts/pipeline/vizDrawPure.js.map +1 -1
- package/es/src/charts/viz/Viz.js +103 -59
- package/es/src/charts/viz/Viz.js.map +1 -1
- package/es/src/charts/viz/VizBase.js +186 -5
- package/es/src/charts/viz/VizBase.js.map +1 -1
- package/es/src/charts/viz/VizBaseConfig.js +41 -3
- package/es/src/charts/viz/VizBaseConfig.js.map +1 -1
- package/es/src/charts/viz/ordinalColor.js +2 -2
- package/es/src/charts/viz/ordinalColor.js.map +1 -1
- package/es/src/charts/viz/vizDefaults.js +270 -58
- package/es/src/charts/viz/vizDefaults.js.map +1 -1
- package/es/src/charts/viz/vizRender.js +54 -4
- package/es/src/charts/viz/vizRender.js.map +1 -1
- package/es/src/charts/viz/vizTypes.js.map +1 -1
- package/es/src/charts/viz/vizVisibility.js +145 -0
- package/es/src/charts/viz/vizVisibility.js.map +1 -0
- package/es/src/components/Axis/Axis.js +18 -9
- package/es/src/components/Axis/Axis.js.map +1 -1
- package/es/src/components/Axis/axisLayoutLabels.js +2 -1
- package/es/src/components/Axis/axisLayoutLabels.js.map +1 -1
- package/es/src/components/Axis/axisRender.js +5 -1
- package/es/src/components/Axis/axisRender.js.map +1 -1
- package/es/src/components/ColorScale/ColorScale.js +11 -11
- package/es/src/components/ColorScale/ColorScale.js.map +1 -1
- package/es/src/components/ColorScale/colorScaleScale.js +22 -10
- package/es/src/components/ColorScale/colorScaleScale.js.map +1 -1
- package/es/src/components/Legend/Legend.js +8 -5
- package/es/src/components/Legend/Legend.js.map +1 -1
- package/es/src/components/Legend/legendConfig.js +87 -21
- package/es/src/components/Legend/legendConfig.js.map +1 -1
- package/es/src/components/Legend/legendRender.js +29 -22
- package/es/src/components/Legend/legendRender.js.map +1 -1
- package/es/src/components/SizeLegend/SizeLegend.js +411 -0
- package/es/src/components/SizeLegend/SizeLegend.js.map +1 -0
- package/es/src/components/SizeLegend/sizeLegendLayout.js +285 -0
- package/es/src/components/SizeLegend/sizeLegendLayout.js.map +1 -0
- package/es/src/components/Timeline/timelineConfig.js +8 -4
- package/es/src/components/Timeline/timelineConfig.js.map +1 -1
- package/es/src/components/Timeline/timelineRender.js +1 -2
- package/es/src/components/Timeline/timelineRender.js.map +1 -1
- package/es/src/components/Tooltip.js +27 -7
- package/es/src/components/Tooltip.js.map +1 -1
- package/es/src/components/index.js +1 -0
- package/es/src/components/index.js.map +1 -1
- package/es/src/shapes/Box.js +4 -2
- package/es/src/shapes/Box.js.map +1 -1
- package/es/src/shapes/Shape.js +1 -1
- package/es/src/shapes/Shape.js.map +1 -1
- package/es/src/shapes/Whisker.js +3 -2
- package/es/src/shapes/Whisker.js.map +1 -1
- package/es/src/shapes/validateShapeConfig.js +141 -0
- package/es/src/shapes/validateShapeConfig.js.map +1 -0
- package/es/src/utils/BaseClass.js +134 -4
- package/es/src/utils/BaseClass.js.map +1 -1
- package/es/src/utils/D3plusConfig.js.map +1 -1
- package/es/src/utils/configDefault.js +17 -0
- package/es/src/utils/configDefault.js.map +1 -0
- package/es/src/utils/configPrep.js +2 -1
- package/es/src/utils/configPrep.js.map +1 -1
- package/es/src/utils/configWarnings.js +37 -0
- package/es/src/utils/configWarnings.js.map +1 -0
- package/es/src/utils/index.js +1 -0
- package/es/src/utils/index.js.map +1 -1
- package/package.json +13 -11
- package/types/index.d.ts +4 -4
- package/types/internal.d.ts +16 -2
- package/types/src/charts/BarChart/index.d.ts +2 -1
- package/types/src/charts/Chord/applyLayout.d.ts +43 -0
- package/types/src/charts/Chord/emit.d.ts +10 -0
- package/types/src/charts/Chord/index.d.ts +19 -0
- package/types/src/charts/Geomap/applyLayout.d.ts +9 -1
- package/types/src/charts/Geomap/basemapTheme.d.ts +35 -0
- package/types/src/charts/Histogram/binData.d.ts +37 -0
- package/types/src/charts/Histogram/index.d.ts +14 -0
- package/types/src/charts/Network/applyLayout.d.ts +8 -0
- package/types/src/charts/Plot/discreteSpan.d.ts +9 -0
- package/types/src/charts/Plot/index.d.ts +51 -3
- package/types/src/charts/Plot/pipeline.d.ts +14 -0
- package/types/src/charts/Plot/plotZoom.d.ts +65 -0
- package/types/src/charts/Plot/sharedHover.d.ts +79 -0
- package/types/src/charts/Plot/sharedHoverScene.d.ts +11 -0
- package/types/src/charts/Plot/sharedTooltip.d.ts +26 -0
- package/types/src/charts/Plot/stackShareLabels.d.ts +21 -0
- package/types/src/charts/Plot/stackShareTooltip.d.ts +9 -0
- package/types/src/charts/Plot/trendLines.d.ts +70 -0
- package/types/src/charts/Plot/trendScene.d.ts +18 -0
- package/types/src/charts/Plot/trendTooltip.d.ts +19 -0
- package/types/src/charts/Rings/applyLayout.d.ts +9 -0
- package/types/src/charts/Rings/ringsSizing.d.ts +49 -0
- package/types/src/charts/StackedArea/index.d.ts +2 -1
- package/types/src/charts/definition/ChartDefinition.d.ts +33 -1
- package/types/src/charts/definition/makeChart.d.ts +2 -1
- package/types/src/charts/drawSteps/backControl.d.ts +29 -0
- package/types/src/charts/drawSteps/bottomRightControls.d.ts +26 -0
- package/types/src/charts/drawSteps/bottomRightControlsMarkup.d.ts +108 -0
- package/types/src/charts/drawSteps/controlButtonStyle.d.ts +45 -0
- package/types/src/charts/drawSteps/minimap.d.ts +19 -0
- package/types/src/charts/drawSteps/minimapMarkup.d.ts +45 -0
- package/types/src/charts/drawSteps/searchControls.d.ts +3 -0
- package/types/src/charts/drawSteps/searchControlsMarkup.d.ts +111 -0
- package/types/src/charts/drawSteps/tableView.d.ts +23 -0
- package/types/src/charts/drawSteps/tableViewControl.d.ts +21 -0
- package/types/src/charts/drawSteps/tableViewMarkup.d.ts +119 -0
- package/types/src/charts/drawSteps/topLeftControls.d.ts +32 -0
- package/types/src/charts/drawSteps/topLeftControlsMarkup.d.ts +72 -0
- package/types/src/charts/drawSteps/zoomControls.d.ts +48 -8
- package/types/src/charts/drawSteps/zoomControlsMarkup.d.ts +138 -0
- package/types/src/charts/features/attributionFeature.d.ts +21 -0
- package/types/src/charts/features/axes.d.ts +1 -1
- package/types/src/charts/features/chartGeometry.d.ts +9 -3
- package/types/src/charts/features/edgeArrows.d.ts +92 -0
- package/types/src/charts/features/emitHelpers.d.ts +19 -0
- package/types/src/charts/features/ensureZoomDom.d.ts +6 -2
- package/types/src/charts/features/features.d.ts +32 -17
- package/types/src/charts/features/featuresLegend.d.ts +15 -0
- package/types/src/charts/features/plotPaint.d.ts +40 -2
- package/types/src/charts/features/zoomExtent.d.ts +25 -0
- package/types/src/charts/index.d.ts +2 -0
- package/types/src/charts/pipeline/drillMorph.d.ts +29 -0
- package/types/src/charts/pipeline/runVizPipeline.d.ts +14 -3
- package/types/src/charts/viz/Viz.d.ts +18 -1
- package/types/src/charts/viz/VizBase.d.ts +99 -4
- package/types/src/charts/viz/VizBaseConfig.d.ts +25 -3
- package/types/src/charts/viz/vizDefaults.d.ts +155 -0
- package/types/src/charts/viz/vizTypes.d.ts +204 -4
- package/types/src/charts/viz/vizVisibility.d.ts +34 -0
- package/types/src/components/Axis/Axis.d.ts +2 -0
- package/types/src/components/Legend/legendRender.d.ts +8 -2
- package/types/src/components/SizeLegend/SizeLegend.d.ts +107 -0
- package/types/src/components/SizeLegend/sizeLegendLayout.d.ts +101 -0
- package/types/src/components/Tooltip.d.ts +18 -3
- package/types/src/components/index.d.ts +1 -0
- package/types/src/shapes/validateShapeConfig.d.ts +10 -0
- package/types/src/utils/BaseClass.d.ts +15 -1
- package/types/src/utils/D3plusConfig.d.ts +200 -8
- package/types/src/utils/configDefault.d.ts +11 -0
- package/types/src/utils/configWarnings.d.ts +28 -0
- package/types/src/utils/index.d.ts +2 -1
- package/umd/d3plus-core.full.js +44507 -35766
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +7073 -4410
- package/umd/d3plus-core.js +16718 -9634
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +4615 -2322
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
*/ import { ICON_ATTRS } from "./zoomControlsMarkup.js";
|
|
23
|
+
import { paintControlButton, resolveControlStyle } from "./controlButtonStyle.js";
|
|
24
|
+
import { backControlStyleDefault } from "../viz/vizDefaults.js";
|
|
25
|
+
/** The resolved base button style — also used as the cheap, non-DOM basis for `backContribution`'s `styleSignature` (see `Contribution.styleSignature`). */ function resolvedBackButtonStyle(viz) {
|
|
26
|
+
var className = Boolean(viz.schema.backControlClassName);
|
|
27
|
+
return resolveControlStyle(viz.schema.backControlStyle, backControlStyleDefault, className);
|
|
28
|
+
}
|
|
29
|
+
/** 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. */ export function paintBackButton(viz, btn) {
|
|
30
|
+
paintControlButton(btn, {
|
|
31
|
+
base: resolvedBackButtonStyle(viz)
|
|
32
|
+
}, false, false);
|
|
33
|
+
}
|
|
34
|
+
// A left-pointing arrow: a horizontal shaft + an open chevron head.
|
|
35
|
+
var BACK_ICON = "<svg ".concat(ICON_ATTRS, '><line x1="19" y1="12" x2="5" y2="12"/><polyline points="12 19 5 12 12 5"/></svg>');
|
|
36
|
+
/** Pops the drill-down history (or steps up a level, when there's no history entry left) and re-renders. */ function goBack(viz) {
|
|
37
|
+
var entry = viz._history.pop();
|
|
38
|
+
if (entry) {
|
|
39
|
+
// Arms the reappearing parent's reunion lookup (resolveDrillMorph), so
|
|
40
|
+
// the vanishing children shrink into its rect instead of just fading —
|
|
41
|
+
// the mirror of clickShape's forward capture. `body` is the CURRENT
|
|
42
|
+
// (about-to-be-OLD) body rect, captured now because the exiting
|
|
43
|
+
// siblings' own geometry is frozen in THIS frame, not the new one
|
|
44
|
+
// .render() is about to produce.
|
|
45
|
+
if (entry.groupId !== undefined && entry.groupDepth !== undefined) viz._pendingExitReunion = {
|
|
46
|
+
groupId: entry.groupId,
|
|
47
|
+
groupDepth: entry.groupDepth,
|
|
48
|
+
body: viz._bodyRect
|
|
49
|
+
};
|
|
50
|
+
viz.config(entry).render();
|
|
51
|
+
} else {
|
|
52
|
+
viz.depth(viz._drawDepth - 1).filter(false).render();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** 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. */ export function backControlsHtml(viz) {
|
|
56
|
+
var extraClass = viz.schema.backControlClassName ? " ".concat(viz.schema.backControlClassName) : "";
|
|
57
|
+
var label = viz.schema.translate("Back");
|
|
58
|
+
return '<button type="button" class="back-control'.concat(extraClass, '">').concat(BACK_ICON).concat(label, "</button>");
|
|
59
|
+
}
|
|
60
|
+
/** Whether a chart shows the back button — history to pop, and not under SSR (mirrors `showsZoomControls`/`showsSearchControls`: a static export has no interaction to route a click to). */ function showsBackControl(viz) {
|
|
61
|
+
return Boolean(viz._history && viz._history.length) && !viz._ssr;
|
|
62
|
+
}
|
|
63
|
+
export function backContribution(viz) {
|
|
64
|
+
if (!showsBackControl(viz)) return null;
|
|
65
|
+
return {
|
|
66
|
+
key: "back",
|
|
67
|
+
html: backControlsHtml(viz),
|
|
68
|
+
styleSignature: JSON.stringify(resolvedBackButtonStyle(viz)),
|
|
69
|
+
events: {
|
|
70
|
+
".back-control": {
|
|
71
|
+
click: function click() {
|
|
72
|
+
return goBack(viz);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
onUpdate: function onUpdate(host) {
|
|
77
|
+
var btn = host.querySelector(".back-control");
|
|
78
|
+
if (!btn || btn.dataset.backBound) return;
|
|
79
|
+
btn.dataset.backBound = "1";
|
|
80
|
+
paintBackButton(viz, btn);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
//# sourceMappingURL=backControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/charts/drawSteps/backControl.ts"],"sourcesContent":["/**\n The \"← Back\" control's contribution to the shared top-left controls\n panel (`topLeftControls.ts`) — visible only when the chart has\n drill-down history to pop. Styled like the zoom/search controls: a real\n `<button>` at the same 20px height, an SVG arrow icon (not a text\n glyph), and no default background/border/color — a plain\n browser-appearance button that lets native/host-page button chrome\n show through, restylable via `.backControlStyle()`/\n `.backControlClassName()` the same way zoom/search are.\n\n Previously `backFeature` rendered \"← Back\" as an SVG text scene node in\n its own margin-claiming row, with its click routed through\n `Viz._routeSceneEvent`'s `interactionGroup === \"back\"` special case —\n the only way to attach a click handler to a plain scene text node. As a\n real button inside the shared `htmlOverlay` panel, its click instead\n rides the same declarative delegated-events map every other top-left/\n zoom control uses, and it claims no margin of its own — like zoom, it\n floats over whatever's there, and content that needs to avoid it insets\n around the whole panel via `topLeftControlsInset`.\n\n @module\n*/\nimport type Viz from \"../viz/Viz.js\";\nimport type {Contribution} from \"./topLeftControlsMarkup.js\";\nimport {ICON_ATTRS} from \"./zoomControlsMarkup.js\";\nimport {paintControlButton, resolveControlStyle} from \"./controlButtonStyle.js\";\nimport {backControlStyleDefault} from \"../viz/vizDefaults.js\";\n\n/** The resolved base button style — also used as the cheap, non-DOM basis for `backContribution`'s `styleSignature` (see `Contribution.styleSignature`). */\nfunction resolvedBackButtonStyle(viz: Viz) {\n const className = Boolean(viz.schema.backControlClassName);\n return resolveControlStyle(viz.schema.backControlStyle, backControlStyleDefault, className);\n}\n\n/** 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. */\nexport function paintBackButton(viz: Viz, btn: HTMLElement): void {\n paintControlButton(btn, {base: resolvedBackButtonStyle(viz)}, false, false);\n}\n\n// A left-pointing arrow: a horizontal shaft + an open chevron head.\nconst BACK_ICON = `<svg ${ICON_ATTRS}><line x1=\"19\" y1=\"12\" x2=\"5\" y2=\"12\"/><polyline points=\"12 19 5 12 12 5\"/></svg>`;\n\n/** Pops the drill-down history (or steps up a level, when there's no history entry left) and re-renders. */\nfunction goBack(viz: Viz): void {\n const entry = viz._history.pop();\n if (entry) {\n // Arms the reappearing parent's reunion lookup (resolveDrillMorph), so\n // the vanishing children shrink into its rect instead of just fading —\n // the mirror of clickShape's forward capture. `body` is the CURRENT\n // (about-to-be-OLD) body rect, captured now because the exiting\n // siblings' own geometry is frozen in THIS frame, not the new one\n // .render() is about to produce.\n if (entry.groupId !== undefined && entry.groupDepth !== undefined)\n viz._pendingExitReunion = {groupId: entry.groupId, groupDepth: entry.groupDepth, body: viz._bodyRect};\n viz.config(entry).render();\n } else {\n viz.depth(viz._drawDepth - 1).filter(false).render();\n }\n}\n\n/** 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. */\nexport function backControlsHtml(viz: Viz): string {\n const extraClass = viz.schema.backControlClassName ? ` ${viz.schema.backControlClassName}` : \"\";\n const label = viz.schema.translate(\"Back\");\n return `<button type=\"button\" class=\"back-control${extraClass}\">${BACK_ICON}${label}</button>`;\n}\n\n/** Whether a chart shows the back button — history to pop, and not under SSR (mirrors `showsZoomControls`/`showsSearchControls`: a static export has no interaction to route a click to). */\nfunction showsBackControl(viz: Viz): boolean {\n return Boolean(viz._history && viz._history.length) && !viz._ssr;\n}\n\nexport function backContribution(viz: Viz): Contribution | null {\n if (!showsBackControl(viz)) return null;\n return {\n key: \"back\",\n html: backControlsHtml(viz),\n styleSignature: JSON.stringify(resolvedBackButtonStyle(viz)),\n events: {\n \".back-control\": {click: () => goBack(viz)},\n },\n onUpdate: (host: HTMLElement) => {\n const btn = host.querySelector<HTMLElement>(\".back-control\");\n if (!btn || btn.dataset.backBound) return;\n btn.dataset.backBound = \"1\";\n paintBackButton(viz, btn);\n },\n };\n}\n"],"names":["ICON_ATTRS","paintControlButton","resolveControlStyle","backControlStyleDefault","resolvedBackButtonStyle","viz","className","Boolean","schema","backControlClassName","backControlStyle","paintBackButton","btn","base","BACK_ICON","goBack","entry","_history","pop","groupId","undefined","groupDepth","_pendingExitReunion","body","_bodyRect","config","render","depth","_drawDepth","filter","backControlsHtml","extraClass","label","translate","showsBackControl","length","_ssr","backContribution","key","html","styleSignature","JSON","stringify","events","click","onUpdate","host","querySelector","dataset","backBound"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;AAqBA,GAGA,SAAQA,UAAU,QAAO,0BAA0B;AACnD,SAAQC,kBAAkB,EAAEC,mBAAmB,QAAO,0BAA0B;AAChF,SAAQC,uBAAuB,QAAO,wBAAwB;AAE9D,0JAA0J,GAC1J,SAASC,wBAAwBC,GAAQ;IACvC,IAAMC,YAAYC,QAAQF,IAAIG,MAAM,CAACC,oBAAoB;IACzD,OAAOP,oBAAoBG,I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OAAO,SAASC,iBAAiBhC,GAAQ;IACvC,IAAI,CAAC6B,iBAAiB7B,MAAM,OAAO;IACnC,OAAO;QACLiC,KAAK;QACLC,MAAMT,iBAAiBzB;QACvBmC,gBAAgBC,KAAKC,SAAS,CAACtC,wBAAwBC;QACvDsC,QAAQ;YACN,iBAAiB;gBAACC,OAAO,SAAPA;2BAAa7B,OAAOV;;YAAI;QAC5C;QACAwC,UAAU,SAAVA,SAAWC;YACT,IAAMlC,MAAMkC,KAAKC,aAAa,CAAc;YAC5C,IAAI,CAACnC,OAAOA,IAAIoC,OAAO,CAACC,SAAS,EAAE;YACnCrC,IAAIoC,OAAO,CAACC,SAAS,GAAG;YACxBtC,gBAAgBN,KAAKO;QACvB;IACF;AACF"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
@name bottomRightControlsFeature
|
|
55
|
+
The bottom-right corner panel: chart chrome anchored in the corner below
|
|
56
|
+
the chart body, currently the size legend. Like the top-left panel it's
|
|
57
|
+
fed by independent contributor functions — a new corner item appends
|
|
58
|
+
its own to `BOTTOM_RIGHT_CONTRIBUTORS`.
|
|
59
|
+
|
|
60
|
+
Two steps, split around the chart's layout:
|
|
61
|
+
1. `reserveBottomRight` (called from `vizDrawPure`, before the legend
|
|
62
|
+
and colorScale lay out) measures every contribution from a
|
|
63
|
+
pre-layout estimate and stores the box on `viz._bottomRightBox`, so
|
|
64
|
+
bottom-band content insets around it and the chart body stays
|
|
65
|
+
clear of it.
|
|
66
|
+
2. `bottomRightControlsFeature` (post-draw, see `runVizPipeline`)
|
|
67
|
+
paints each contribution from its final, laid-out state into the
|
|
68
|
+
reserved box.
|
|
69
|
+
|
|
70
|
+
@module
|
|
71
|
+
*/ import { colorContrast } from "@d3plus/color";
|
|
72
|
+
import { backgroundColor } from "@d3plus/dom";
|
|
73
|
+
import { resolveSpec } from "../pipeline/resolveSpec.js";
|
|
74
|
+
import { zoomSizeLegendScale } from "../../components/SizeLegend/sizeLegendLayout.js";
|
|
75
|
+
import { buildBottomRightPanel, bottomRightControlsBox, measureBottomRight } from "./bottomRightControlsMarkup.js";
|
|
76
|
+
/** The text/stroke color that reads against the chart's background. */ function inkColor(viz) {
|
|
77
|
+
var node = viz._select && typeof viz._select.node === "function" ? viz._select.node() : null;
|
|
78
|
+
var bg = node ? backgroundColor(node) : "rgb(255, 255, 255)";
|
|
79
|
+
return colorContrast(bg, viz.schema.colorDefaults);
|
|
80
|
+
}
|
|
81
|
+
/** Configures the size legend for a scale and lays it out, returning its size. */ function layoutSizeLegend(viz, scale) {
|
|
82
|
+
var ink = inkColor(viz);
|
|
83
|
+
var legend = viz._sizeLegendClass;
|
|
84
|
+
legend.renderMode("compute").locale(viz.schema.locale).title(viz._sizeKey).labelConfig({
|
|
85
|
+
fontColor: ink,
|
|
86
|
+
fontFamily: viz.schema.fontFamily
|
|
87
|
+
}).titleConfig({
|
|
88
|
+
fontColor: ink,
|
|
89
|
+
fontFamily: viz.schema.fontFamily
|
|
90
|
+
}).lineConfig({
|
|
91
|
+
stroke: ink
|
|
92
|
+
}).shapeConfig({
|
|
93
|
+
fill: ink,
|
|
94
|
+
stroke: ink
|
|
95
|
+
}).config(viz.schema.sizeLegendConfig).scale(scale);
|
|
96
|
+
var _legend_layout = legend.layout(), width = _legend_layout.width, height = _legend_layout.height;
|
|
97
|
+
return {
|
|
98
|
+
width: width,
|
|
99
|
+
height: height
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
The size legend's contribution: sized from the chart's pre-layout scale
|
|
104
|
+
estimate, painted from the scale the chart's layout actually drew with.
|
|
105
|
+
*/ export function sizeLegendContribution(viz, available) {
|
|
106
|
+
if (!viz._sizeLegendClass || typeof viz._sizeLegendScale !== "function") return null;
|
|
107
|
+
var scale = viz._sizeLegendScale(available);
|
|
108
|
+
if (!scale) return null;
|
|
109
|
+
viz._sizeLegendClass._maxRadius = undefined;
|
|
110
|
+
var _layoutSizeLegend = layoutSizeLegend(viz, scale), width = _layoutSizeLegend.width, height = _layoutSizeLegend.height;
|
|
111
|
+
if (!width || !height) return null;
|
|
112
|
+
var size = {
|
|
113
|
+
width: width,
|
|
114
|
+
height: height,
|
|
115
|
+
availableWidth: available.width,
|
|
116
|
+
availableHeight: available.height
|
|
117
|
+
};
|
|
118
|
+
if (!viz.schema.sizeLegend.bind(viz)(resolveSpec(viz), scale, size)) return null;
|
|
119
|
+
return {
|
|
120
|
+
key: "sizeLegend",
|
|
121
|
+
width: width,
|
|
122
|
+
height: height,
|
|
123
|
+
paint: function paint(zoom) {
|
|
124
|
+
var final = viz._sizeLegendFinal;
|
|
125
|
+
if (!final) return null;
|
|
126
|
+
viz._sizeLegendClass._maxRadius = zoom === 1 ? undefined : final(final.domain()[1]);
|
|
127
|
+
var size = layoutSizeLegend(viz, zoomSizeLegendScale(final, zoom));
|
|
128
|
+
if (!size.width || !size.height) return null;
|
|
129
|
+
return _object_spread({
|
|
130
|
+
node: viz._sizeLegendClass.toScene()
|
|
131
|
+
}, size);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
Ordered contributors to the bottom-right panel, right to left.
|
|
137
|
+
*/ export var BOTTOM_RIGHT_CONTRIBUTORS = [
|
|
138
|
+
sizeLegendContribution
|
|
139
|
+
];
|
|
140
|
+
/**
|
|
141
|
+
Measures the panel for this draw and stores it on `viz._bottomRightBox`
|
|
142
|
+
(null when nothing contributes). `bottom` is how far above the chart's
|
|
143
|
+
bottom edge the panel sits (below it: the timeline); `available` is the
|
|
144
|
+
chart area left after the claims made so far. `sizeLegendPosition`
|
|
145
|
+
picks the margin it claims (see `BottomRightBox.side`).
|
|
146
|
+
*/ export function reserveBottomRight(viz, bottom, available) {
|
|
147
|
+
var items = [];
|
|
148
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
149
|
+
try {
|
|
150
|
+
for(var _iterator = BOTTOM_RIGHT_CONTRIBUTORS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
151
|
+
var fn = _step.value;
|
|
152
|
+
var c = fn(viz, available);
|
|
153
|
+
if (c) items.push(c);
|
|
154
|
+
}
|
|
155
|
+
} catch (err) {
|
|
156
|
+
_didIteratorError = true;
|
|
157
|
+
_iteratorError = err;
|
|
158
|
+
} finally{
|
|
159
|
+
try {
|
|
160
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
161
|
+
_iterator.return();
|
|
162
|
+
}
|
|
163
|
+
} finally{
|
|
164
|
+
if (_didIteratorError) {
|
|
165
|
+
throw _iteratorError;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
var side = viz.schema.sizeLegendPosition === "bottom" ? "bottom" : "right";
|
|
170
|
+
viz._bottomRightBox = items.length ? _object_spread_props(_object_spread({}, measureBottomRight(items)), {
|
|
171
|
+
bottom: bottom,
|
|
172
|
+
side: side,
|
|
173
|
+
items: items
|
|
174
|
+
}) : null;
|
|
175
|
+
}
|
|
176
|
+
export var bottomRightControlsFeature = {
|
|
177
|
+
name: "bottomRightControls",
|
|
178
|
+
configFields: [
|
|
179
|
+
"sizeLegend",
|
|
180
|
+
"sizeLegendConfig",
|
|
181
|
+
"sizeLegendPosition"
|
|
182
|
+
],
|
|
183
|
+
layout: function layout(param) {
|
|
184
|
+
var viz = param.viz;
|
|
185
|
+
var box = bottomRightControlsBox(viz);
|
|
186
|
+
return {
|
|
187
|
+
panel: box ? buildBottomRightPanel(viz, box) : null,
|
|
188
|
+
margin: {}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
//# sourceMappingURL=bottomRightControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/charts/drawSteps/bottomRightControls.ts"],"sourcesContent":["/**\n @name bottomRightControlsFeature\n The bottom-right corner panel: chart chrome anchored in the corner below\n the chart body, currently the size legend. Like the top-left panel it's\n fed by independent contributor functions — a new corner item appends\n its own to `BOTTOM_RIGHT_CONTRIBUTORS`.\n\n Two steps, split around the chart's layout:\n 1. `reserveBottomRight` (called from `vizDrawPure`, before the legend\n and colorScale lay out) measures every contribution from a\n pre-layout estimate and stores the box on `viz._bottomRightBox`, so\n bottom-band content insets around it and the chart body stays\n clear of it.\n 2. `bottomRightControlsFeature` (post-draw, see `runVizPipeline`)\n paints each contribution from its final, laid-out state into the\n reserved box.\n\n @module\n*/\nimport {colorContrast} from \"@d3plus/color\";\nimport {backgroundColor} from \"@d3plus/dom\";\n\nimport type {FeatureModule} from \"../features/features.js\";\nimport {resolveSpec} from \"../pipeline/resolveSpec.js\";\nimport type {VizInstance} from \"../viz/vizTypes.js\";\nimport {zoomSizeLegendScale} from \"../../components/SizeLegend/sizeLegendLayout.js\";\nimport type {SizeLegendScale} from \"../../components/SizeLegend/sizeLegendLayout.js\";\nimport {buildBottomRightPanel, bottomRightControlsBox, measureBottomRight} from \"./bottomRightControlsMarkup.js\";\nimport type {BottomRightContribution} from \"./bottomRightControlsMarkup.js\";\n\n/** The chart area a contribution may size itself against, before layout. */\nexport interface BottomRightAvailable {\n width: number;\n height: number;\n}\n\n/** The text/stroke color that reads against the chart's background. */\nfunction inkColor(viz: VizInstance): string {\n const node = viz._select && typeof viz._select.node === \"function\" ? viz._select.node() : null;\n const bg = node ? backgroundColor(node) : \"rgb(255, 255, 255)\";\n return colorContrast(bg, viz.schema.colorDefaults);\n}\n\n/** Configures the size legend for a scale and lays it out, returning its size. */\nfunction layoutSizeLegend(viz: VizInstance, scale: SizeLegendScale): {width: number; height: number} {\n const ink = inkColor(viz);\n const legend = viz._sizeLegendClass!;\n legend\n .renderMode(\"compute\")\n .locale(viz.schema.locale)\n .title(viz._sizeKey)\n .labelConfig({fontColor: ink, fontFamily: viz.schema.fontFamily})\n .titleConfig({fontColor: ink, fontFamily: viz.schema.fontFamily})\n .lineConfig({stroke: ink})\n .shapeConfig({fill: ink, stroke: ink})\n .config(viz.schema.sizeLegendConfig)\n .scale(scale);\n const {width, height} = legend.layout();\n return {width, height};\n}\n\n/**\n The size legend's contribution: sized from the chart's pre-layout scale\n estimate, painted from the scale the chart's layout actually drew with.\n*/\nexport function sizeLegendContribution(\n viz: VizInstance,\n available: BottomRightAvailable,\n): BottomRightContribution | null {\n if (!viz._sizeLegendClass || typeof viz._sizeLegendScale !== \"function\") return null;\n const scale = viz._sizeLegendScale(available);\n if (!scale) return null;\n viz._sizeLegendClass._maxRadius = undefined;\n const {width, height} = layoutSizeLegend(viz, scale);\n if (!width || !height) return null;\n const size = {width, height, availableWidth: available.width, availableHeight: available.height};\n if (!viz.schema.sizeLegend.bind(viz)(resolveSpec(viz), scale, size)) return null;\n return {\n key: \"sizeLegend\",\n width,\n height,\n paint: zoom => {\n const final = viz._sizeLegendFinal;\n if (!final) return null;\n viz._sizeLegendClass!._maxRadius = zoom === 1 ? undefined : final(final.domain()[1]);\n const size = layoutSizeLegend(viz, zoomSizeLegendScale(final, zoom));\n if (!size.width || !size.height) return null;\n return {node: viz._sizeLegendClass!.toScene(), ...size};\n },\n };\n}\n\n/**\n Ordered contributors to the bottom-right panel, right to left.\n*/\nexport const BOTTOM_RIGHT_CONTRIBUTORS: Array<\n (viz: VizInstance, available: BottomRightAvailable) => BottomRightContribution | null\n> = [sizeLegendContribution];\n\n/**\n Measures the panel for this draw and stores it on `viz._bottomRightBox`\n (null when nothing contributes). `bottom` is how far above the chart's\n bottom edge the panel sits (below it: the timeline); `available` is the\n chart area left after the claims made so far. `sizeLegendPosition`\n picks the margin it claims (see `BottomRightBox.side`).\n*/\nexport function reserveBottomRight(\n viz: VizInstance,\n bottom: number,\n available: BottomRightAvailable,\n): void {\n const items: BottomRightContribution[] = [];\n for (const fn of BOTTOM_RIGHT_CONTRIBUTORS) {\n const c = fn(viz, available);\n if (c) items.push(c);\n }\n const side = viz.schema.sizeLegendPosition === \"bottom\" ? \"bottom\" : \"right\";\n viz._bottomRightBox = items.length ? {...measureBottomRight(items), bottom, side, items} : null;\n}\n\nexport const bottomRightControlsFeature: FeatureModule = {\n name: \"bottomRightControls\",\n configFields: [\"sizeLegend\", \"sizeLegendConfig\", \"sizeLegendPosition\"],\n layout: ({viz}) => {\n const box = bottomRightControlsBox(viz);\n return {panel: box ? buildBottomRightPanel(viz, box) : null, margin: {}};\n },\n};\n"],"names":["colorContrast","backgroundColor","resolveSpec","zoomSizeLegendScale","buildBottomRightPanel","bottomRightControlsBox","measureBottomRight","inkColor","viz","node","_select","bg","schema","colorDefaults","layoutSizeLegend","scale","ink","legend","_sizeLegendClass","renderMode","locale","title","_sizeKey","labelConfig","fontColor","fontFamily","titleConfig","lineConfig","stroke","shapeConfig","fill","config","sizeLegendConfig","layout","width","height","sizeLegendContribution","available","_sizeLegendScale","_maxRadius","undefined","size","availableWidth","availableHeight","sizeLegend","bind","key","paint","zoom","final","_sizeLegendFinal","domain","toScene","BOTTOM_RIGHT_CONTRIBUTORS","reserveBottomRight","bottom","items","fn","c","push","side","sizeLegendPosition","_bottomRightBox","length","bottomRightControlsFeature","name","configFields","box","panel","margin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;AAkBA,GACA,SAAQA,aAAa,QAAO,gBAAgB;AAC5C,SAAQC,eAAe,QAAO,cAAc;AAG5C,SAAQC,WAAW,QAAO,6BAA6B;AAEvD,SAAQC,mBAAmB,QAAO,kDAAkD;AAEpF,SAAQC,qBAAqB,EAAEC,sBAAsB,EAAEC,kBAAkB,QAAO,iCAAiC;AASjH,qEAAqE,GACrE,SAASC,SAASC,GAAgB;IAChC,IAAMC,OAAOD,IAAIE,OAAO,IAAI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O,MAAM,GAAG,wCAAIzD,mBAAmBkD;QAAQD,QAAAA;QAAQK,MAAAA;QAAMJ,OAAAA;SAAS;AAC7F;AAEA,OAAO,IAAMQ,6BAA4C;IACvDC,MAAM;IACNC,cAAc;QAAC;QAAc;QAAoB;KAAqB;IACtEjC,QAAQ,SAARA;YAAUzB,YAAAA;QACR,IAAM2D,MAAM9D,uBAAuBG;QACnC,OAAO;YAAC4D,OAAOD,MAAM/D,sBAAsBI,KAAK2D,OAAO;YAAME,QAAQ,CAAC;QAAC;IACzE;AACF,EAAE"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Layout for the bottom-right corner panel — the bottom-corner counterpart
|
|
3
|
+
of the top-right zoom-control panel. Its items (the size legend, today)
|
|
4
|
+
are scene nodes rather than HTML, so the panel exports with the chart.
|
|
5
|
+
|
|
6
|
+
The panel is measured before the chart lays out (`reserveBottomRight`,
|
|
7
|
+
called from `vizDrawPure`), and the result is stored on
|
|
8
|
+
`viz._bottomRightBox` so content sharing the bottom band (a bottom
|
|
9
|
+
legend or colorScale) can inset around it via `bottomRightControlsInset`,
|
|
10
|
+
and content in the right column can stop short of it via
|
|
11
|
+
`bottomRightControlsDrop`. It paints after the chart lays out
|
|
12
|
+
(`bottomRightControlsFeature`), from each item's final state.
|
|
13
|
+
|
|
14
|
+
Kept separate from `bottomRightControls.ts` (the `FeatureModule` + the
|
|
15
|
+
contributor list) so the legend/colorScale features can import the inset
|
|
16
|
+
helpers without depending on the contributors.
|
|
17
|
+
|
|
18
|
+
@module
|
|
19
|
+
*/ function _array_like_to_array(arr, len) {
|
|
20
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
21
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
22
|
+
return arr2;
|
|
23
|
+
}
|
|
24
|
+
function _array_without_holes(arr) {
|
|
25
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
26
|
+
}
|
|
27
|
+
function _iterable_to_array(iter) {
|
|
28
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
29
|
+
}
|
|
30
|
+
function _non_iterable_spread() {
|
|
31
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
32
|
+
}
|
|
33
|
+
function _to_consumable_array(arr) {
|
|
34
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
35
|
+
}
|
|
36
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
37
|
+
if (!o) return;
|
|
38
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
39
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
40
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
41
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
42
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
43
|
+
}
|
|
44
|
+
/** Horizontal gap between items, and between the panel and content inset around it. */ export var BOTTOM_RIGHT_GAP = 6;
|
|
45
|
+
/** Lays contributions out in a row, right to left: the panel's total width and height. */ export function measureBottomRight(items) {
|
|
46
|
+
var _Math;
|
|
47
|
+
var width = items.reduce(function(w, item, i) {
|
|
48
|
+
return w + item.width + (i ? BOTTOM_RIGHT_GAP : 0);
|
|
49
|
+
}, 0);
|
|
50
|
+
var height = (_Math = Math).max.apply(_Math, [
|
|
51
|
+
0
|
|
52
|
+
].concat(_to_consumable_array(items.map(function(item) {
|
|
53
|
+
return item.height;
|
|
54
|
+
}))));
|
|
55
|
+
return {
|
|
56
|
+
width: width,
|
|
57
|
+
height: height
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** The panel reserved for this draw, or null when nothing is showing there. */ export function bottomRightControlsBox(viz) {
|
|
61
|
+
var box = viz._bottomRightBox;
|
|
62
|
+
return box && box.width && box.height ? box : null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
How far content in the bottom band must pull in its right edge to clear
|
|
66
|
+
the panel: content whose bottom edge sits `bottom` px above the chart's
|
|
67
|
+
bottom edge and whose right edge sits `right` px in from the chart's
|
|
68
|
+
right edge. Zero when nothing is showing or the content starts above the
|
|
69
|
+
panel.
|
|
70
|
+
*/ export function bottomRightControlsInset(viz, bottom, right) {
|
|
71
|
+
var box = bottomRightControlsBox(viz);
|
|
72
|
+
// A right-side panel already widened the right margin bottom content lays out against.
|
|
73
|
+
if (!box || box.side === "right" || bottom >= box.bottom + box.height) return 0;
|
|
74
|
+
var inset = box.width - right;
|
|
75
|
+
return inset > 0 ? inset + BOTTOM_RIGHT_GAP : 0;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
How much content in the right column, whose bottom edge sits `bottom` px
|
|
79
|
+
above the chart's bottom edge, must shorten to end above the panel. Zero
|
|
80
|
+
when nothing is showing.
|
|
81
|
+
*/ export function bottomRightControlsDrop(viz, bottom) {
|
|
82
|
+
var box = bottomRightControlsBox(viz);
|
|
83
|
+
if (!box) return 0;
|
|
84
|
+
return Math.max(0, box.bottom + box.height - bottom);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
How a legend or colorScale at `position` clears the panel: a bottom one
|
|
88
|
+
pulls its right edge in by `inset`, a left/right one shortens by `drop`.
|
|
89
|
+
`bottom`/`right` are its edges' distances from the chart's bottom/right.
|
|
90
|
+
*/ export function bottomRightClearance(viz, position, bottom, right) {
|
|
91
|
+
return {
|
|
92
|
+
inset: position === "bottom" ? bottomRightControlsInset(viz, bottom, right) : 0,
|
|
93
|
+
drop: position === "left" || position === "right" ? bottomRightControlsDrop(viz, bottom) : 0
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
How much taller the bottom margin must grow so the chart body, ending
|
|
98
|
+
`bottom` px above the chart's bottom edge, stays clear of a bottom-side
|
|
99
|
+
panel. Zero for a right-side panel.
|
|
100
|
+
*/ export function bottomRightControlsShortfall(viz, bottom) {
|
|
101
|
+
var box = bottomRightControlsBox(viz);
|
|
102
|
+
return box && box.side === "bottom" ? Math.max(0, box.bottom + box.height - bottom) : 0;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
How much wider the right margin must grow so the chart body, ending
|
|
106
|
+
`right` px in from the chart's right edge, stays clear of a right-side
|
|
107
|
+
panel. Zero for a bottom-side panel.
|
|
108
|
+
*/ export function bottomRightControlsRightShortfall(viz, right) {
|
|
109
|
+
var box = bottomRightControlsBox(viz);
|
|
110
|
+
return box && box.side === "right" ? Math.max(0, box.width + BOTTOM_RIGHT_GAP - right) : 0;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
The panel's scene: each item painted from its final state, bottom-right
|
|
114
|
+
aligned in the slot it reserved. Null when nothing paints.
|
|
115
|
+
*/ export function buildBottomRightPanel(viz, box) {
|
|
116
|
+
var _ref;
|
|
117
|
+
var _viz__zoomTransform;
|
|
118
|
+
var zoom = (_ref = (_viz__zoomTransform = viz._zoomTransform) === null || _viz__zoomTransform === void 0 ? void 0 : _viz__zoomTransform.scale) !== null && _ref !== void 0 ? _ref : 1;
|
|
119
|
+
var children = [];
|
|
120
|
+
var right = viz.schema.width;
|
|
121
|
+
var baseline = viz.schema.height - box.bottom;
|
|
122
|
+
box.items.forEach(function(item) {
|
|
123
|
+
var painted = item.paint(zoom);
|
|
124
|
+
if (painted) {
|
|
125
|
+
children.push({
|
|
126
|
+
type: "group",
|
|
127
|
+
key: item.key,
|
|
128
|
+
transform: {
|
|
129
|
+
x: right - painted.width,
|
|
130
|
+
y: baseline - painted.height
|
|
131
|
+
},
|
|
132
|
+
children: [
|
|
133
|
+
painted.node
|
|
134
|
+
]
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
right -= item.width + BOTTOM_RIGHT_GAP;
|
|
138
|
+
});
|
|
139
|
+
if (!children.length) return null;
|
|
140
|
+
return {
|
|
141
|
+
type: "group",
|
|
142
|
+
key: "viz-bottomRight",
|
|
143
|
+
children: children
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
Repaints the panel in place for the current zoom — called on every zoom
|
|
148
|
+
event, which repaints the scene without re-running the pipeline.
|
|
149
|
+
*/ export function refreshBottomRightPanel(viz) {
|
|
150
|
+
var box = bottomRightControlsBox(viz);
|
|
151
|
+
if (!box || !viz._featurePanels) return;
|
|
152
|
+
var panels = viz._featurePanels.filter(function(p) {
|
|
153
|
+
return p.key !== "viz-bottomRight";
|
|
154
|
+
});
|
|
155
|
+
var panel = buildBottomRightPanel(viz, box);
|
|
156
|
+
viz._featurePanels = panel ? _to_consumable_array(panels).concat([
|
|
157
|
+
panel
|
|
158
|
+
]) : panels;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
//# sourceMappingURL=bottomRightControlsMarkup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/charts/drawSteps/bottomRightControlsMarkup.ts"],"sourcesContent":["/**\n Layout for the bottom-right corner panel — the bottom-corner counterpart\n of the top-right zoom-control panel. Its items (the size legend, today)\n are scene nodes rather than HTML, so the panel exports with the chart.\n\n The panel is measured before the chart lays out (`reserveBottomRight`,\n called from `vizDrawPure`), and the result is stored on\n `viz._bottomRightBox` so content sharing the bottom band (a bottom\n legend or colorScale) can inset around it via `bottomRightControlsInset`,\n and content in the right column can stop short of it via\n `bottomRightControlsDrop`. It paints after the chart lays out\n (`bottomRightControlsFeature`), from each item's final state.\n\n Kept separate from `bottomRightControls.ts` (the `FeatureModule` + the\n contributor list) so the legend/colorScale features can import the inset\n helpers without depending on the contributors.\n\n @module\n*/\n\nimport type {SceneNode} from \"@d3plus/render\";\n\nimport type {VizInstance} from \"../viz/vizTypes.js\";\n\n/**\n One item's contribution to the bottom-right panel: its size as reserved\n before layout, and a `paint` that builds its scene after layout (its\n top-left at the origin) along with the size it actually drew at, which\n must not exceed the reservation. `zoom` is the scale the chart's picture\n is currently zoomed by (1 unzoomed; charts that zoom by rescaling axes,\n like Plot, always paint at 1).\n*/\nexport interface BottomRightContribution {\n key: string;\n width: number;\n height: number;\n paint: (zoom: number) => {node: SceneNode; width: number; height: number} | null;\n}\n\n/** The measured panel, as stored on `viz._bottomRightBox`. */\nexport interface BottomRightBox {\n width: number;\n height: number;\n /** Offset of the panel's bottom edge from the chart's bottom edge (the timeline sits below it). */\n bottom: number;\n /**\n The margin the panel claims: `\"right\"` widens the right margin so the\n chart body ends left of it (it shares the right column, below any\n right legend/colorScale); `\"bottom\"` deepens the bottom margin so the\n body ends above it (bottom legends/colorScales sit beside it).\n */\n side: \"right\" | \"bottom\";\n items: BottomRightContribution[];\n}\n\n/** Horizontal gap between items, and between the panel and content inset around it. */\nexport const BOTTOM_RIGHT_GAP = 6;\n\n/** Lays contributions out in a row, right to left: the panel's total width and height. */\nexport function measureBottomRight(items: BottomRightContribution[]): {width: number; height: number} {\n const width = items.reduce((w, item, i) => w + item.width + (i ? BOTTOM_RIGHT_GAP : 0), 0);\n const height = Math.max(0, ...items.map(item => item.height));\n return {width, height};\n}\n\n/** The panel reserved for this draw, or null when nothing is showing there. */\nexport function bottomRightControlsBox(viz: VizInstance): BottomRightBox | null {\n const box = viz._bottomRightBox;\n return box && box.width && box.height ? box : null;\n}\n\n/**\n How far content in the bottom band must pull in its right edge to clear\n the panel: content whose bottom edge sits `bottom` px above the chart's\n bottom edge and whose right edge sits `right` px in from the chart's\n right edge. Zero when nothing is showing or the content starts above the\n panel.\n*/\nexport function bottomRightControlsInset(viz: VizInstance, bottom: number, right: number): number {\n const box = bottomRightControlsBox(viz);\n // A right-side panel already widened the right margin bottom content lays out against.\n if (!box || box.side === \"right\" || bottom >= box.bottom + box.height) return 0;\n const inset = box.width - right;\n return inset > 0 ? inset + BOTTOM_RIGHT_GAP : 0;\n}\n\n/**\n How much content in the right column, whose bottom edge sits `bottom` px\n above the chart's bottom edge, must shorten to end above the panel. Zero\n when nothing is showing.\n*/\nexport function bottomRightControlsDrop(viz: VizInstance, bottom: number): number {\n const box = bottomRightControlsBox(viz);\n if (!box) return 0;\n return Math.max(0, box.bottom + box.height - bottom);\n}\n\n/**\n How a legend or colorScale at `position` clears the panel: a bottom one\n pulls its right edge in by `inset`, a left/right one shortens by `drop`.\n `bottom`/`right` are its edges' distances from the chart's bottom/right.\n*/\nexport function bottomRightClearance(\n viz: VizInstance,\n position: string | false,\n bottom: number,\n right: number,\n): {inset: number; drop: number} {\n return {\n inset: position === \"bottom\" ? bottomRightControlsInset(viz, bottom, right) : 0,\n drop: position === \"left\" || position === \"right\" ? bottomRightControlsDrop(viz, bottom) : 0,\n };\n}\n\n/**\n How much taller the bottom margin must grow so the chart body, ending\n `bottom` px above the chart's bottom edge, stays clear of a bottom-side\n panel. Zero for a right-side panel.\n*/\nexport function bottomRightControlsShortfall(viz: VizInstance, bottom: number): number {\n const box = bottomRightControlsBox(viz);\n return box && box.side === \"bottom\" ? Math.max(0, box.bottom + box.height - bottom) : 0;\n}\n\n/**\n How much wider the right margin must grow so the chart body, ending\n `right` px in from the chart's right edge, stays clear of a right-side\n panel. Zero for a bottom-side panel.\n*/\nexport function bottomRightControlsRightShortfall(viz: VizInstance, right: number): number {\n const box = bottomRightControlsBox(viz);\n return box && box.side === \"right\" ? Math.max(0, box.width + BOTTOM_RIGHT_GAP - right) : 0;\n}\n\n/**\n The panel's scene: each item painted from its final state, bottom-right\n aligned in the slot it reserved. Null when nothing paints.\n*/\nexport function buildBottomRightPanel(viz: VizInstance, box: BottomRightBox): SceneNode | null {\n const zoom = viz._zoomTransform?.scale ?? 1;\n const children: SceneNode[] = [];\n let right = viz.schema.width;\n const baseline = viz.schema.height - box.bottom;\n box.items.forEach(item => {\n const painted = item.paint(zoom);\n if (painted) {\n children.push({\n type: \"group\",\n key: item.key,\n transform: {x: right - painted.width, y: baseline - painted.height},\n children: [painted.node],\n });\n }\n right -= item.width + BOTTOM_RIGHT_GAP;\n });\n if (!children.length) return null;\n return {type: \"group\", key: \"viz-bottomRight\", children};\n}\n\n/**\n Repaints the panel in place for the current zoom — called on every zoom\n event, which repaints the scene without re-running the pipeline.\n*/\nexport function refreshBottomRightPanel(viz: VizInstance): void {\n const box = bottomRightControlsBox(viz);\n if (!box || !viz._featurePanels) return;\n const panels = viz._featurePanels.filter(p => p.key !== \"viz-bottomRight\");\n const panel = buildBottomRightPanel(viz, box);\n viz._featurePanels = panel ? [...panels, panel] : panels;\n}\n"],"names":["BOTTOM_RIGHT_GAP","measureBottomRight","items","Math","width","reduce","w","item","i","height","max","map","bottomRightControlsBox","viz","box","_bottomRightBox","bottomRightControlsInset","bottom","right","side","inset","bottomRightControlsDrop","bottomRightClearance","position","drop","bottomRightControlsShortfall","bottomRightControlsRightShortfall","buildBottomRightPanel","zoom","_zoomTransform","scale","children","schema","baseline","forEach","painted","paint","push","type","key","transform","x","y","node","length","refreshBottomRightPanel","_featurePanels","panels","filter","p","panel"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;AAkBA;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,qFAAqF,GACrF,OAAO,IAAMA,mBAAmB,EAAE;AAElC,wFAAwF,GACxF,OAAO,SAASC,mBAAmBC,KAAgC;QAElDC;IADf,IAAMC,QAAQF,MAAMG,MAAM,CAAC,SAACC,GAAGC,MAAMC;eAAMF,IAAIC,KAAKH,KAAK,GAAII,CAAAA,IAAIR,mBAAmB,CAAA;OAAI;IACxF,IAAMS,SAASN,CAAAA,QAAAA,MAAKO,GAAG,OAARP,OAAAA;QAAS;KAAqC,CAA9CA,OAAY,qBAAGD,MAAMS,GAAG,CAACJ,SAAAA;eAAQA,KAAKE,MAAM;;IAC3D,OAAO;QAACL,OAAAA;QAAOK,QAAAA;IAAM;AACvB;AAEA,6EAA6E,GAC7E,OAAO,SAASG,uBAAuBC,GAAgB;IACrD,IAAMC,MAAMD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
|
1
|
+
/**
|
|
2
|
+
Shared mechanics for a chart-chrome button's base/active/hover inline
|
|
3
|
+
styling — the resolve-and-paint algorithm zoom/search/back controls all
|
|
4
|
+
use identically. Each control still owns its OWN default style VALUES
|
|
5
|
+
and schema keys (`zoomControlStyle*` vs `searchControlStyle*` vs
|
|
6
|
+
`backControlStyle`) in its own module, so restyling one doesn't affect
|
|
7
|
+
another — only the mechanical part (which was three copy-pasted near-
|
|
8
|
+
duplicates) lives here.
|
|
9
|
+
|
|
10
|
+
@module
|
|
11
|
+
*/ function _array_like_to_array(arr, len) {
|
|
12
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
13
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
14
|
+
return arr2;
|
|
15
|
+
}
|
|
16
|
+
function _array_without_holes(arr) {
|
|
17
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
18
|
+
}
|
|
19
|
+
function _iterable_to_array(iter) {
|
|
20
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
21
|
+
}
|
|
22
|
+
function _non_iterable_spread() {
|
|
23
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
24
|
+
}
|
|
25
|
+
function _to_consumable_array(arr) {
|
|
26
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
27
|
+
}
|
|
28
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
29
|
+
if (!o) return;
|
|
30
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
31
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
32
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
33
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
34
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
35
|
+
}
|
|
36
|
+
/** `alignItems` / `align-items` → `align-items`, for `style.setProperty`. */ export var kebab = function kebab(key) {
|
|
37
|
+
return key.replace(/[A-Z]/g, function(c) {
|
|
38
|
+
return "-".concat(c.toLowerCase());
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
Fallbacks for CSS system colors a browser may not support yet: an
|
|
43
|
+
active-button default uses the OS accent color (Firefox, Safari), and
|
|
44
|
+
Chromium falls back to the text-selection highlight.
|
|
45
|
+
*/ export var SYSTEM_COLOR_FALLBACKS = {
|
|
46
|
+
AccentColor: "Highlight",
|
|
47
|
+
AccentColorText: "HighlightText"
|
|
48
|
+
};
|
|
49
|
+
/** Sets one style property, swapping an unsupported system color for its fallback. */ export function setControlStyle(el, key, value) {
|
|
50
|
+
var prop = kebab(key);
|
|
51
|
+
el.style.setProperty(prop, value);
|
|
52
|
+
var fallback = SYSTEM_COLOR_FALLBACKS[value];
|
|
53
|
+
if (fallback && !el.style.getPropertyValue(prop)) el.style.setProperty(prop, fallback);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
Resolves a `*ControlStyle`/`Active`/`Hover` value for painting. Setting
|
|
57
|
+
the matching `*ControlClassName` auto-disables whichever of the three is
|
|
58
|
+
still the untouched built-in default (identified by reference — the
|
|
59
|
+
caller's own default constant) so a host page's own button styling can
|
|
60
|
+
apply through the cascade without also requiring `.xControlStyle(false)`.
|
|
61
|
+
An explicit custom style object (a different reference) always wins,
|
|
62
|
+
className or not.
|
|
63
|
+
*/ export function resolveControlStyle(value, defaultValue, classNameSet) {
|
|
64
|
+
if (classNameSet && value === defaultValue) return {};
|
|
65
|
+
return value || {};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
Paints a control button's inline style for its current state: the base
|
|
69
|
+
style, then the hover style while hovered, then the active style while
|
|
70
|
+
its mode is on (so an active button reads as active even under the
|
|
71
|
+
cursor). Every property any of the three styles sets is cleared first,
|
|
72
|
+
so leaving a state fully undoes it.
|
|
73
|
+
*/ export function paintControlButton(btn, styles, hovered, isActive) {
|
|
74
|
+
var base = styles.base, _styles_active = styles.active, active = _styles_active === void 0 ? {} : _styles_active, _styles_hover = styles.hover, hover = _styles_hover === void 0 ? {} : _styles_hover;
|
|
75
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
76
|
+
try {
|
|
77
|
+
for(var _iterator = new Set(_to_consumable_array(Object.keys(base)).concat(_to_consumable_array(Object.keys(active)), _to_consumable_array(Object.keys(hover))))[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
78
|
+
var key = _step.value;
|
|
79
|
+
btn.style.removeProperty(kebab(key));
|
|
80
|
+
}
|
|
81
|
+
} catch (err) {
|
|
82
|
+
_didIteratorError = true;
|
|
83
|
+
_iteratorError = err;
|
|
84
|
+
} finally{
|
|
85
|
+
try {
|
|
86
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
87
|
+
_iterator.return();
|
|
88
|
+
}
|
|
89
|
+
} finally{
|
|
90
|
+
if (_didIteratorError) {
|
|
91
|
+
throw _iteratorError;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
for(var _i = 0, _iter = [
|
|
96
|
+
base,
|
|
97
|
+
hovered ? hover : {},
|
|
98
|
+
isActive ? active : {}
|
|
99
|
+
]; _i < _iter.length; _i++){
|
|
100
|
+
var style = _iter[_i];
|
|
101
|
+
for(var key1 in style){
|
|
102
|
+
var v = style[key1];
|
|
103
|
+
if (v !== undefined && v !== null && v !== false) setControlStyle(btn, key1, String(v));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=controlButtonStyle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/charts/drawSteps/controlButtonStyle.ts"],"sourcesContent":["/**\n Shared mechanics for a chart-chrome button's base/active/hover inline\n styling — the resolve-and-paint algorithm zoom/search/back controls all\n use identically. Each control still owns its OWN default style VALUES\n and schema keys (`zoomControlStyle*` vs `searchControlStyle*` vs\n `backControlStyle`) in its own module, so restyling one doesn't affect\n another — only the mechanical part (which was three copy-pasted near-\n duplicates) lives here.\n\n @module\n*/\n\nexport type StyleObject = Record<string, string | number | undefined | null | false>;\nexport type ControlStyleValue = StyleObject | false | null | undefined;\n\n/** `alignItems` / `align-items` → `align-items`, for `style.setProperty`. */\nexport const kebab = (key: string): string => key.replace(/[A-Z]/g, c => `-${c.toLowerCase()}`);\n\n/**\n Fallbacks for CSS system colors a browser may not support yet: an\n active-button default uses the OS accent color (Firefox, Safari), and\n Chromium falls back to the text-selection highlight.\n*/\nexport const SYSTEM_COLOR_FALLBACKS: Record<string, string> = {\n AccentColor: \"Highlight\",\n AccentColorText: \"HighlightText\",\n};\n\n/** Sets one style property, swapping an unsupported system color for its fallback. */\nexport function setControlStyle(el: HTMLElement, key: string, value: string): void {\n const prop = kebab(key);\n el.style.setProperty(prop, value);\n const fallback = SYSTEM_COLOR_FALLBACKS[value];\n if (fallback && !el.style.getPropertyValue(prop)) el.style.setProperty(prop, fallback);\n}\n\n/**\n Resolves a `*ControlStyle`/`Active`/`Hover` value for painting. Setting\n the matching `*ControlClassName` auto-disables whichever of the three is\n still the untouched built-in default (identified by reference — the\n caller's own default constant) so a host page's own button styling can\n apply through the cascade without also requiring `.xControlStyle(false)`.\n An explicit custom style object (a different reference) always wins,\n className or not.\n*/\nexport function resolveControlStyle(\n value: ControlStyleValue,\n defaultValue: ControlStyleValue,\n classNameSet: boolean,\n): StyleObject {\n if (classNameSet && value === defaultValue) return {};\n return value || {};\n}\n\n/**\n Paints a control button's inline style for its current state: the base\n style, then the hover style while hovered, then the active style while\n its mode is on (so an active button reads as active even under the\n cursor). Every property any of the three styles sets is cleared first,\n so leaving a state fully undoes it.\n*/\nexport function paintControlButton(\n btn: HTMLElement,\n styles: {base: StyleObject; active?: StyleObject; hover?: StyleObject},\n hovered: boolean,\n isActive: boolean,\n): void {\n const {base, active = {}, hover = {}} = styles;\n for (const key of new Set([...Object.keys(base), ...Object.keys(active), ...Object.keys(hover)]))\n btn.style.removeProperty(kebab(key));\n for (const style of [base, hovered ? hover : {}, isActive ? active : {}])\n for (const key in style) {\n const v = style[key];\n if (v !== undefined && v !== null && v !== false) setControlStyle(btn, key, String(v));\n }\n}\n"],"names":["kebab","key","replace","c","toLowerCase","SYSTEM_COLOR_FALLBACKS","AccentColor","AccentColorText","setControlStyle","el","value","prop","style","setProperty","fallback","getPropertyValue","resolveControlStyle","defaultValue","classNameSet","paintControlButton","btn","styles","hovered","isActive","base","active","hover","Set","Object","keys","removeProperty","v","undefined","String"],"mappings":"AAAA;;;;;;;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,2EAA2E,GAC3E,OAAO,IAAMA,QAAQ,eAACC;WAAwBA,IAAIC,OAAO,CAAC,UAAUC,SAAAA;eAAK,AAAC,IAAmB,OAAhBA,EAAEC,WAAW;;EAAM;AAEhG;;;;AAIA,GACA,OAAO,IAAMC,yBAAiD;IAC5DC,aAAa;IACbC,iBAAiB;AACnB,EAAE;AAEF,oFAAoF,GACpF,OAAO,SAASC,gBAAgBC,EAAe,EAAER,GAAW,EAAES,KAAa;IACzE,IAAMC,OAAOX,MAAMC;IACnBQ,GAAGG,KAAK,CAACC,WAAW,CAACF,MAAMD;IAC3B,IAAMI,WAAWT,sBAAsB,CAACK,MAAM;IAC9C,IAAII,YAAY,CAACL,GAAGG,KAAK,CAACG,gBAAgB,CAACJ,OAAOF,GAAGG,KAAK,CAACC,WAAW,CAACF,MAAMG;AAC/E;AAEA;;;;;;;;AAQA,GACA,OAAO,SAASE,oBACdN,KAAwB,EACxBO,YAA+B,EAC/BC,YAAqB;IAErB,IAAIA,gBAAgBR,UAAUO,cAAc,OAAO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