@d3plus/core 4.3.0 → 4.5.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 +1820 -714
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/internal.js +7 -1
- 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 +1 -2
- package/es/src/charts/BarChart/index.js.map +1 -1
- package/es/src/charts/BoxWhisker/index.js +1 -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 +168 -0
- package/es/src/charts/Chord/emit.js.map +1 -0
- package/es/src/charts/Chord/index.js +234 -0
- package/es/src/charts/Chord/index.js.map +1 -0
- 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 +69 -104
- package/es/src/charts/Geomap/index.js.map +1 -1
- 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/emit.js +58 -24
- package/es/src/charts/Network/emit.js.map +1 -1
- package/es/src/charts/Network/index.js +34 -54
- package/es/src/charts/Network/index.js.map +1 -1
- package/es/src/charts/Pack/emit.js +3 -0
- package/es/src/charts/Pack/emit.js.map +1 -1
- package/es/src/charts/Pack/index.js +1 -2
- package/es/src/charts/Pack/index.js.map +1 -1
- package/es/src/charts/Pie/emit.js +6 -2
- package/es/src/charts/Pie/emit.js.map +1 -1
- package/es/src/charts/Pie/index.js +1 -2
- package/es/src/charts/Pie/index.js.map +1 -1
- package/es/src/charts/Plot/index.js +26 -6
- package/es/src/charts/Plot/index.js.map +1 -1
- package/es/src/charts/Plot/pipeline.js +1 -2
- package/es/src/charts/Plot/pipeline.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/Priestley/emit.js +4 -0
- 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 +1 -2
- 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 +1 -2
- package/es/src/charts/RadialMatrix/index.js.map +1 -1
- package/es/src/charts/Rings/emit.js +74 -8
- package/es/src/charts/Rings/emit.js.map +1 -1
- package/es/src/charts/Rings/index.js +11 -3
- package/es/src/charts/Rings/index.js.map +1 -1
- 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 +1 -2
- package/es/src/charts/StackedArea/index.js.map +1 -1
- package/es/src/charts/Tree/emit.js +8 -2
- package/es/src/charts/Tree/emit.js.map +1 -1
- package/es/src/charts/Tree/index.js +1 -2
- package/es/src/charts/Tree/index.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/drawSteps/backControl.js +70 -0
- package/es/src/charts/drawSteps/backControl.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 +370 -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 +314 -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/features/attributionFeature.js +137 -0
- package/es/src/charts/features/attributionFeature.js.map +1 -0
- package/es/src/charts/features/axes.js +20 -8
- 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 +8 -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 +83 -110
- package/es/src/charts/features/features.js.map +1 -1
- package/es/src/charts/features/featuresLegend.js +45 -17
- package/es/src/charts/features/featuresLegend.js.map +1 -1
- package/es/src/charts/features/plotPaint.js +32 -7
- package/es/src/charts/features/plotPaint.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 +1 -0
- package/es/src/charts/index.js.map +1 -1
- package/es/src/charts/pipeline/runVizPipeline.js +33 -14
- package/es/src/charts/pipeline/runVizPipeline.js.map +1 -1
- package/es/src/charts/pipeline/vizDrawPure.js +32 -6
- package/es/src/charts/pipeline/vizDrawPure.js.map +1 -1
- package/es/src/charts/viz/Viz.js +39 -51
- package/es/src/charts/viz/Viz.js.map +1 -1
- package/es/src/charts/viz/VizBase.js +157 -4
- package/es/src/charts/viz/VizBase.js.map +1 -1
- package/es/src/charts/viz/VizBaseConfig.js +32 -2
- package/es/src/charts/viz/VizBaseConfig.js.map +1 -1
- package/es/src/charts/viz/vizDefaults.js +243 -50
- package/es/src/charts/viz/vizDefaults.js.map +1 -1
- package/es/src/charts/viz/vizTypes.js.map +1 -1
- package/es/src/components/Axis/Axis.js +10 -1
- 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/Legend/legendConfig.js +86 -20
- package/es/src/components/Legend/legendConfig.js.map +1 -1
- package/es/src/utils/D3plusConfig.js.map +1 -1
- package/package.json +11 -10
- package/types/index.d.ts +1 -1
- package/types/internal.d.ts +8 -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/basemapTheme.d.ts +35 -0
- package/types/src/charts/Plot/index.d.ts +12 -3
- package/types/src/charts/Plot/plotZoom.d.ts +65 -0
- package/types/src/charts/definition/ChartDefinition.d.ts +3 -1
- package/types/src/charts/drawSteps/backControl.d.ts +29 -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 +11 -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 +15 -2
- package/types/src/charts/features/zoomExtent.d.ts +25 -0
- package/types/src/charts/index.d.ts +1 -0
- package/types/src/charts/pipeline/runVizPipeline.d.ts +6 -3
- package/types/src/charts/viz/VizBase.d.ts +86 -4
- package/types/src/charts/viz/VizBaseConfig.d.ts +20 -2
- package/types/src/charts/viz/vizDefaults.d.ts +155 -0
- package/types/src/charts/viz/vizTypes.d.ts +57 -1
- package/types/src/components/Axis/Axis.d.ts +2 -0
- package/types/src/utils/D3plusConfig.d.ts +102 -8
- package/umd/d3plus-core.full.js +39613 -35374
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +5747 -4361
- package/umd/d3plus-core.js +13132 -9289
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +3658 -2302
|
@@ -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 if (viz._history.length) viz.config(viz._history.pop()).render();\n else viz.depth(viz._drawDepth - 1).filter(false).render();\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","_history","length","config","pop","render","depth","_drawDepth","filter","backControlsHtml","extraClass","label","translate","showsBackControl","_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,IAAIG,MAAM,CAACE,gBAAgB,EAAEP,yBAAyBG;AACnF;AAEA,wNAAwN,GACxN,OAAO,SAASK,gBAAgBN,GAAQ,EAAEO,GAAgB;IACxDX,mBAAmBW,KAAK;QAACC,MAAMT,wBAAwBC;IAAI,GAAG,OAAO;AACvE;AAEA,oEAAoE;AACpE,IAAMS,YAAY,AAAC,QAAkB,OAAXd,YAAW;AAErC,0GAA0G,GAC1G,SAASe,OAAOV,GAAQ;IACtB,IAAIA,IAAIW,QAAQ,CAACC,MAAM,EAAEZ,IAAIa,MAAM,CAACb,IAAIW,QAAQ,CAACG,GAAG,IAAIC,MAAM;SACzDf,IAAIgB,KAAK,CAAChB,IAAIiB,UAAU,GAAG,GAAGC,MAAM,CAAC,OAAOH,MAAM;AACzD;AAEA,oMAAoM,GACpM,OAAO,SAASI,iBAAiBnB,GAAQ;IACvC,IAAMoB,aAAapB,IAAIG,MAAM,CAACC,oBAAoB,GAAG,AAAC,IAAmC,OAAhCJ,IAAIG,MAAM,CAACC,oBAAoB,IAAK;IAC7F,IAAMiB,QAAQrB,IAAIG,MAAM,CAACmB,SAAS,CAAC;IACnC,OAAO,AAAC,4CAA0Db,OAAfW,YAAW,MAAgBC,OAAZZ,WAAkB,OAANY,OAAM;AACtF;AAEA,2LAA2L,GAC3L,SAASE,iBAAiBvB,GAAQ;IAChC,OAAOE,QAAQF,IAAIW,QAAQ,IAAIX,IAAIW,QAAQ,CAACC,MAAM,KAAK,CAACZ,IAAIwB,IAAI;AAClE;AAEA,OAAO,SAASC,iBAAiBzB,GAAQ;IACvC,IAAI,CAACuB,iBAAiBvB,MAAM,OAAO;IACnC,OAAO;QACL0B,KAAK;QACLC,MAAMR,iBAAiBnB;QACvB4B,gBAAgBC,KAAKC,SAAS,CAAC/B,wBAAwBC;QACvD+B,QAAQ;YACN,iBAAiB;gBAACC,OAAO,SAAPA;2BAAatB,OAAOV;;YAAI;QAC5C;QACAiC,UAAU,SAAVA,SAAWC;YACT,IAAM3B,MAAM2B,KAAKC,aAAa,CAAc;YAC5C,IAAI,CAAC5B,OAAOA,IAAI6B,OAAO,CAACC,SAAS,EAAE;YACnC9B,IAAI6B,OAAO,CAACC,SAAS,GAAG;YACxB/B,gBAAgBN,KAAKO;QACvB;IACF;AACF"}
|
|
@@ -0,0 +1,108 @@
|
|
|
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,CAAC;IACpD,OAAOP,SAAS,CAAC;AACnB;AAEA;;;;;;AAMA,GACA,OAAO,SAASS,mBACdC,GAAgB,EAChBC,MAAsE,EACtEC,OAAgB,EAChBC,QAAiB;IAEjB,IAAOC,OAAiCH,OAAjCG,uBAAiCH,OAA3BI,QAAAA,qCAAS,CAAC,oCAAiBJ,OAAdK,OAAAA,mCAAQ,CAAC;QAC9B,kCAAA,2BAAA;;QAAL,QAAK,YAAa,IAAIC,IAAI,AAAC,qBAAGC,OAAOC,IAAI,CAACL,cAAO,qBAAGI,OAAOC,IAAI,CAACJ,UAAS,qBAAGG,OAAOC,IAAI,CAACH,8BAAnF,SAAA,6BAAA,QAAA,yBAAA;YAAA,IAAMzB,MAAN;YACHmB,IAAIR,KAAK,CAACkB,cAAc,CAAC9B,MAAMC;;;QAD5B;QAAA;;;iBAAA,6BAAA;gBAAA;;;gBAAA;sBAAA;;;;IAEL,gBAAoB,QAAA;QAACuB;QAAMF,UAAUI,QAAQ,CAAC;QAAGH,WAAWE,SAAS,CAAC;KAAE,OAApD;YAATb,QAAS;QAClB,IAAK,IAAMX,QAAOW,MAAO;YACvB,IAAMmB,IAAInB,KAAK,CAACX,KAAI;YACpB,IAAI8B,MAAMC,aAAaD,MAAM,QAAQA,MAAM,OAAOvB,gBAAgBY,KAAKnB,MAAKgC,OAAOF;QACrF;;AACJ"}
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
9
|
+
function _iterable_to_array_limit(arr, i) {
|
|
10
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
11
|
+
if (_i == null) return;
|
|
12
|
+
var _arr = [];
|
|
13
|
+
var _n = true;
|
|
14
|
+
var _d = false;
|
|
15
|
+
var _s, _e;
|
|
16
|
+
try {
|
|
17
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
18
|
+
_arr.push(_s.value);
|
|
19
|
+
if (i && _arr.length === i) break;
|
|
20
|
+
}
|
|
21
|
+
} catch (err) {
|
|
22
|
+
_d = true;
|
|
23
|
+
_e = err;
|
|
24
|
+
} finally{
|
|
25
|
+
try {
|
|
26
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
27
|
+
} finally{
|
|
28
|
+
if (_d) throw _e;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return _arr;
|
|
32
|
+
}
|
|
33
|
+
function _non_iterable_rest() {
|
|
34
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
35
|
+
}
|
|
36
|
+
function _sliced_to_array(arr, i) {
|
|
37
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
38
|
+
}
|
|
39
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
40
|
+
if (!o) return;
|
|
41
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
42
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
43
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
44
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
45
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
46
|
+
}
|
|
47
|
+
import { zoomIdentity, zoomTransform } from "d3-zoom";
|
|
48
|
+
import { chartBounds } from "../features/chartGeometry.js";
|
|
49
|
+
import { zoomTo } from "./zoomControls.js";
|
|
50
|
+
import { MINIMAP_GAP, MINIMAP_RIGHT_INSET, formatZoomLabel, minimapHtml, minimapStyles, paintMinimapStyle } from "./minimapMarkup.js";
|
|
51
|
+
import { showsZoomControls, zoomControlsBox } from "./zoomControlsMarkup.js";
|
|
52
|
+
/**
|
|
53
|
+
The element d3-zoom's transform is read from — the same fallback
|
|
54
|
+
`zoomControls.ts` uses throughout (`_zoomEventTarget` on the Canvas
|
|
55
|
+
backend, `_container` otherwise).
|
|
56
|
+
@private
|
|
57
|
+
*/ function zoomTarget(viz) {
|
|
58
|
+
return viz._zoomEventTarget || viz._container;
|
|
59
|
+
}
|
|
60
|
+
/** The live d3-zoom transform — NOT `viz._zoomTransform`, which the Plot family clears to `undefined` for its own axis-rescale zoom (`zoomControls.ts`'s `zoomed()`). Reading it straight from d3-zoom works uniformly across every chart type. */ function liveTransform(viz) {
|
|
61
|
+
var _zoomTarget;
|
|
62
|
+
var node = (_zoomTarget = zoomTarget(viz)) === null || _zoomTarget === void 0 ? void 0 : _zoomTarget.node();
|
|
63
|
+
return node ? zoomTransform(node) : zoomIdentity;
|
|
64
|
+
}
|
|
65
|
+
/** A keyboard nudge step, in minimap pixels — Shift takes a bigger step. */ var KEY_STEP = 10;
|
|
66
|
+
var KEY_STEP_SHIFT = 40;
|
|
67
|
+
var ARROW_KEYS = {
|
|
68
|
+
ArrowLeft: [
|
|
69
|
+
-1,
|
|
70
|
+
0
|
|
71
|
+
],
|
|
72
|
+
ArrowRight: [
|
|
73
|
+
1,
|
|
74
|
+
0
|
|
75
|
+
],
|
|
76
|
+
ArrowUp: [
|
|
77
|
+
0,
|
|
78
|
+
-1
|
|
79
|
+
],
|
|
80
|
+
ArrowDown: [
|
|
81
|
+
0,
|
|
82
|
+
1
|
|
83
|
+
]
|
|
84
|
+
};
|
|
85
|
+
/** Re-centers the chart, at scale `k`, on a content-space point — the shared math behind click-to-jump and wheel-zoom. @private */ function centerOn(viz, px, py, k, duration) {
|
|
86
|
+
var _viz__zoomBehavior_translateExtent = _sliced_to_array(viz._zoomBehavior.translateExtent(), 2), _viz__zoomBehavior_translateExtent_ = _sliced_to_array(_viz__zoomBehavior_translateExtent[0], 2), ax0 = _viz__zoomBehavior_translateExtent_[0], ay0 = _viz__zoomBehavior_translateExtent_[1], _viz__zoomBehavior_translateExtent_1 = _sliced_to_array(_viz__zoomBehavior_translateExtent[1], 2), ax1 = _viz__zoomBehavior_translateExtent_1[0], ay1 = _viz__zoomBehavior_translateExtent_1[1];
|
|
87
|
+
zoomTo(viz, k, (ax0 + ax1) / 2 - px * k, (ay0 + ay1) / 2 - py * k, duration);
|
|
88
|
+
}
|
|
89
|
+
/** Maps a pointer position local to the minimap's outer box into content-space. @private */ function contentPointFromLocal(viz, mmW, mmH, localX, localY) {
|
|
90
|
+
var _viz__zoomBehavior_translateExtent = _sliced_to_array(viz._zoomBehavior.translateExtent(), 2), _viz__zoomBehavior_translateExtent_ = _sliced_to_array(_viz__zoomBehavior_translateExtent[0], 2), ax0 = _viz__zoomBehavior_translateExtent_[0], ay0 = _viz__zoomBehavior_translateExtent_[1], _viz__zoomBehavior_translateExtent_1 = _sliced_to_array(_viz__zoomBehavior_translateExtent[1], 2), ax1 = _viz__zoomBehavior_translateExtent_1[0], ay1 = _viz__zoomBehavior_translateExtent_1[1];
|
|
91
|
+
return [
|
|
92
|
+
ax0 + localX / mmW * (ax1 - ax0),
|
|
93
|
+
ay0 + localY / mmH * (ay1 - ay0)
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
Repaints the outer box, viewport box, and label from the LIVE zoom
|
|
98
|
+
transform. Called from `onUpdate` (every repaint) and directly from the
|
|
99
|
+
drag handlers (pointerdown/up need to flip the active style immediately,
|
|
100
|
+
before any transform change triggers a repaint of their own).
|
|
101
|
+
|
|
102
|
+
Each element's user-configurable style (`minimapStyle`/etc.) is painted
|
|
103
|
+
in its own call, BEFORE the internal, non-configurable geometry/
|
|
104
|
+
visibility styles this feature owns — so a user-supplied `opacity`,
|
|
105
|
+
`position`, or `left`/`top`/`width`/`height` can't accidentally break the
|
|
106
|
+
1x-hide gate or the live viewport-box positioning; the internal call
|
|
107
|
+
always wins for the handful of properties it manages, leaving every
|
|
108
|
+
other property (background, border, border-radius, …) up to the user.
|
|
109
|
+
@private
|
|
110
|
+
*/ function paint(viz, mmW, mmH, styles, state, viewportEl) {
|
|
111
|
+
var el = viewportEl.parentElement;
|
|
112
|
+
var labelEl = el === null || el === void 0 ? void 0 : el.querySelector(".d3plus-minimap-label");
|
|
113
|
+
if (!el || !labelEl) return;
|
|
114
|
+
var t = liveTransform(viz);
|
|
115
|
+
var zoomedIn = t.k > 1;
|
|
116
|
+
paintMinimapStyle(el, styles.outer);
|
|
117
|
+
// Faded (not `display:none`) so crossing the 1x threshold — via any of
|
|
118
|
+
// the minimap's own gestures, a zoom button, or the wheel — animates
|
|
119
|
+
// rather than popping. `pointer-events` still gates interaction while
|
|
120
|
+
// hidden. Tied to `viz.schema.duration` like the chart's other
|
|
121
|
+
// non-per-pixel transitions (button clicks, reset) — `0` (as every test
|
|
122
|
+
// in this suite sets) makes it an instant, assertion-friendly toggle.
|
|
123
|
+
paintMinimapStyle(el, {
|
|
124
|
+
position: "absolute",
|
|
125
|
+
"box-sizing": "border-box",
|
|
126
|
+
overflow: "hidden",
|
|
127
|
+
opacity: zoomedIn ? "1" : "0",
|
|
128
|
+
"pointer-events": zoomedIn ? "auto" : "none",
|
|
129
|
+
transition: "opacity ".concat(viz.schema.duration, "ms")
|
|
130
|
+
});
|
|
131
|
+
if (!zoomedIn) return;
|
|
132
|
+
var _viz__zoomBehavior_translateExtent = _sliced_to_array(viz._zoomBehavior.translateExtent(), 2), _viz__zoomBehavior_translateExtent_ = _sliced_to_array(_viz__zoomBehavior_translateExtent[0], 2), ax0 = _viz__zoomBehavior_translateExtent_[0], ay0 = _viz__zoomBehavior_translateExtent_[1], _viz__zoomBehavior_translateExtent_1 = _sliced_to_array(_viz__zoomBehavior_translateExtent[1], 2), ax1 = _viz__zoomBehavior_translateExtent_1[0], ay1 = _viz__zoomBehavior_translateExtent_1[1];
|
|
133
|
+
var areaW = ax1 - ax0, areaH = ay1 - ay0;
|
|
134
|
+
var frac = Math.min(1, 1 / t.k);
|
|
135
|
+
// Un-apply the current transform — the same algebra `zoomToBounds`
|
|
136
|
+
// uses to go from displayed bounds back to unzoomed surface space.
|
|
137
|
+
var contentX0 = (ax0 - t.x) / t.k, contentY0 = (ay0 - t.y) / t.k;
|
|
138
|
+
var fracX = Math.max(0, Math.min(1 - frac, areaW ? (contentX0 - ax0) / areaW : 0));
|
|
139
|
+
var fracY = Math.max(0, Math.min(1 - frac, areaH ? (contentY0 - ay0) / areaH : 0));
|
|
140
|
+
paintMinimapStyle(viewportEl, styles.viewport, state.dragging ? styles.viewportActive : {});
|
|
141
|
+
paintMinimapStyle(viewportEl, {
|
|
142
|
+
position: "absolute",
|
|
143
|
+
"box-sizing": "border-box",
|
|
144
|
+
"touch-action": "none",
|
|
145
|
+
left: "".concat(fracX * mmW, "px"),
|
|
146
|
+
top: "".concat(fracY * mmH, "px"),
|
|
147
|
+
width: "".concat(Math.max(1, frac * mmW), "px"),
|
|
148
|
+
height: "".concat(Math.max(1, frac * mmH), "px")
|
|
149
|
+
});
|
|
150
|
+
paintMinimapStyle(labelEl, styles.label);
|
|
151
|
+
paintMinimapStyle(labelEl, {
|
|
152
|
+
position: "absolute"
|
|
153
|
+
});
|
|
154
|
+
labelEl.textContent = formatZoomLabel(t.k);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
Drag-to-pan + keyboard-nudge events for the viewport box. Guards every
|
|
158
|
+
pointer event by `pointerId` against the one that started the drag, so a
|
|
159
|
+
second finger/pointer touching the box mid-drag (or a stray pointerup
|
|
160
|
+
for an unrelated pointer) can't hijack or prematurely end it.
|
|
161
|
+
@private
|
|
162
|
+
*/ function viewportEvents(viz, mmW, styles, state, paintFrom) {
|
|
163
|
+
var closestViewport = function closestViewport(e) {
|
|
164
|
+
var _e_target;
|
|
165
|
+
return (_e_target = e.target) === null || _e_target === void 0 ? void 0 : _e_target.closest(".d3plus-minimap-viewport");
|
|
166
|
+
};
|
|
167
|
+
var endDrag = function endDrag(e) {
|
|
168
|
+
if (e.pointerId !== state.dragPointerId) return;
|
|
169
|
+
state.dragging = false;
|
|
170
|
+
var el = closestViewport(e);
|
|
171
|
+
if (el) paintFrom(el);
|
|
172
|
+
};
|
|
173
|
+
return {
|
|
174
|
+
pointerdown: function pointerdown(e) {
|
|
175
|
+
var pe = e;
|
|
176
|
+
var el = closestViewport(e);
|
|
177
|
+
if (!el) return;
|
|
178
|
+
// Keeps pointermove/pointerup targeting this element even once the
|
|
179
|
+
// cursor leaves the small minimap during a fast drag. Not critical
|
|
180
|
+
// if it throws (an untrusted pointerId, an old browser) — a slower
|
|
181
|
+
// drag that stays over the element still works without it.
|
|
182
|
+
try {
|
|
183
|
+
el.setPointerCapture(pe.pointerId);
|
|
184
|
+
} catch (unused) {
|
|
185
|
+
/* not critical, see above */ }
|
|
186
|
+
state.dragging = true;
|
|
187
|
+
state.dragPointerId = pe.pointerId;
|
|
188
|
+
var t = liveTransform(viz);
|
|
189
|
+
state.dragStart = {
|
|
190
|
+
x: pe.clientX,
|
|
191
|
+
y: pe.clientY,
|
|
192
|
+
tx: t.x,
|
|
193
|
+
ty: t.y,
|
|
194
|
+
k: t.k
|
|
195
|
+
};
|
|
196
|
+
paintFrom(el);
|
|
197
|
+
e.preventDefault();
|
|
198
|
+
},
|
|
199
|
+
pointermove: function pointermove(e) {
|
|
200
|
+
var pe = e;
|
|
201
|
+
if (!state.dragging || pe.pointerId !== state.dragPointerId) return;
|
|
202
|
+
var _viz__zoomBehavior_translateExtent = _sliced_to_array(viz._zoomBehavior.translateExtent(), 2), _viz__zoomBehavior_translateExtent_ = _sliced_to_array(_viz__zoomBehavior_translateExtent[0], 1), ax0 = _viz__zoomBehavior_translateExtent_[0], _viz__zoomBehavior_translateExtent_1 = _sliced_to_array(_viz__zoomBehavior_translateExtent[1], 1), ax1 = _viz__zoomBehavior_translateExtent_1[0];
|
|
203
|
+
var scaleFactor = (ax1 - ax0) / mmW;
|
|
204
|
+
var dx = (pe.clientX - state.dragStart.x) * scaleFactor * state.dragStart.k;
|
|
205
|
+
var dy = (pe.clientY - state.dragStart.y) * scaleFactor * state.dragStart.k;
|
|
206
|
+
// duration 0 — 1:1 responsiveness, matching every other per-pixel
|
|
207
|
+
// pan/zoom tick (`zoomed()`'s own reasoning: a queued transition
|
|
208
|
+
// per pointermove would visibly lag).
|
|
209
|
+
zoomTo(viz, state.dragStart.k, state.dragStart.tx - dx, state.dragStart.ty - dy, 0);
|
|
210
|
+
},
|
|
211
|
+
pointerup: endDrag,
|
|
212
|
+
pointercancel: endDrag,
|
|
213
|
+
// Arrow keys nudge the pan (Shift for a bigger step) — the keyboard
|
|
214
|
+
// equivalent of dragging, for the `tabindex`-focusable viewport box
|
|
215
|
+
// `minimapHtml` marks up.
|
|
216
|
+
keydown: function keydown(e) {
|
|
217
|
+
var ke = e;
|
|
218
|
+
var dir = ARROW_KEYS[ke.key];
|
|
219
|
+
if (!dir) return;
|
|
220
|
+
ke.preventDefault();
|
|
221
|
+
var _viz__zoomBehavior_translateExtent = _sliced_to_array(viz._zoomBehavior.translateExtent(), 2), _viz__zoomBehavior_translateExtent_ = _sliced_to_array(_viz__zoomBehavior_translateExtent[0], 1), ax0 = _viz__zoomBehavior_translateExtent_[0], _viz__zoomBehavior_translateExtent_1 = _sliced_to_array(_viz__zoomBehavior_translateExtent[1], 1), ax1 = _viz__zoomBehavior_translateExtent_1[0];
|
|
222
|
+
var scaleFactor = (ax1 - ax0) / mmW;
|
|
223
|
+
var step = ke.shiftKey ? KEY_STEP_SHIFT : KEY_STEP;
|
|
224
|
+
var t = liveTransform(viz);
|
|
225
|
+
var dx = dir[0] * step * scaleFactor * t.k;
|
|
226
|
+
var dy = dir[1] * step * scaleFactor * t.k;
|
|
227
|
+
// A discrete step, not a per-pixel drag tick — animates like the
|
|
228
|
+
// zoom buttons' own clicks rather than jumping instantly.
|
|
229
|
+
zoomTo(viz, t.k, t.x - dx, t.y - dy, viz.schema.duration);
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
/** Click-to-jump / double-click-reset / Cmd+wheel-zoom events for the outer box. @private */ function outerEvents(viz, mmW, mmH) {
|
|
234
|
+
return {
|
|
235
|
+
// A click on the outer box (not the viewport box itself, which
|
|
236
|
+
// `viewportEvents`'s `pointerdown` already claims for dragging)
|
|
237
|
+
// re-centers the chart on the clicked point without changing scale —
|
|
238
|
+
// the "jump" complement to dragging the viewport box.
|
|
239
|
+
click: function click(e) {
|
|
240
|
+
var target = e.target;
|
|
241
|
+
if (target === null || target === void 0 ? void 0 : target.closest(".d3plus-minimap-viewport")) return;
|
|
242
|
+
var outerEl = target === null || target === void 0 ? void 0 : target.closest(".d3plus-minimap");
|
|
243
|
+
if (!outerEl) return;
|
|
244
|
+
var me = e;
|
|
245
|
+
var rect = outerEl.getBoundingClientRect();
|
|
246
|
+
var _contentPointFromLocal = _sliced_to_array(contentPointFromLocal(viz, mmW, mmH, me.clientX - rect.left, me.clientY - rect.top), 2), px = _contentPointFromLocal[0], py = _contentPointFromLocal[1];
|
|
247
|
+
centerOn(viz, px, py, liveTransform(viz).k, viz.schema.duration);
|
|
248
|
+
},
|
|
249
|
+
// Double-clicking anywhere on the minimap resets the chart, like the
|
|
250
|
+
// zoom-reset button.
|
|
251
|
+
dblclick: function dblclick(e) {
|
|
252
|
+
e.preventDefault();
|
|
253
|
+
zoomTo(viz, 1, 0, 0);
|
|
254
|
+
},
|
|
255
|
+
// Cmd/Ctrl + scroll zooms the whole chart, centered on the content
|
|
256
|
+
// point under the cursor's position within the minimap — mirrors
|
|
257
|
+
// the main chart's own modifier-gated wheel zoom (`zoomGestureFilter`)
|
|
258
|
+
// and `zoomToBounds`'s centering math.
|
|
259
|
+
wheel: function wheel(e) {
|
|
260
|
+
var _e_target;
|
|
261
|
+
var we = e;
|
|
262
|
+
if (!we.ctrlKey && !we.metaKey) return;
|
|
263
|
+
we.preventDefault();
|
|
264
|
+
var outerEl = (_e_target = e.target) === null || _e_target === void 0 ? void 0 : _e_target.closest(".d3plus-minimap");
|
|
265
|
+
if (!outerEl) return;
|
|
266
|
+
var rect = outerEl.getBoundingClientRect();
|
|
267
|
+
var _contentPointFromLocal = _sliced_to_array(contentPointFromLocal(viz, mmW, mmH, we.clientX - rect.left, we.clientY - rect.top), 2), px = _contentPointFromLocal[0], py = _contentPointFromLocal[1];
|
|
268
|
+
var factor = we.deltaY < 0 ? viz.schema.zoomFactor : 1 / viz.schema.zoomFactor;
|
|
269
|
+
centerOn(viz, px, py, liveTransform(viz).k * factor, 0);
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
Builds the minimap's `htmlOverlay` panel: a static skeleton (outer box +
|
|
275
|
+
draggable viewport box + zoom-level label) sized and positioned once per
|
|
276
|
+
full draw, whose `onUpdate` repaints the live geometry/label/visibility
|
|
277
|
+
on every repaint — including every pan/zoom/drag/wheel tick, none of
|
|
278
|
+
which re-run `layout()`. Mirrors `buildZoomControlPanel`'s shape.
|
|
279
|
+
@private
|
|
280
|
+
*/ function buildMinimapPanel(viz, mmW, mmH, controlsHeight) {
|
|
281
|
+
var styles = minimapStyles(viz);
|
|
282
|
+
var state = {
|
|
283
|
+
dragging: false,
|
|
284
|
+
dragPointerId: null,
|
|
285
|
+
dragStart: {
|
|
286
|
+
x: 0,
|
|
287
|
+
y: 0,
|
|
288
|
+
tx: 0,
|
|
289
|
+
ty: 0,
|
|
290
|
+
k: 1
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
var paintFrom = function paintFrom(viewportEl) {
|
|
294
|
+
return paint(viz, mmW, mmH, styles, state, viewportEl);
|
|
295
|
+
};
|
|
296
|
+
var extraClass = viz.schema.minimapClassName ? " ".concat(viz.schema.minimapClassName) : "";
|
|
297
|
+
return {
|
|
298
|
+
type: "htmlOverlay",
|
|
299
|
+
key: "viz-minimap",
|
|
300
|
+
x: viz.schema.width - MINIMAP_RIGHT_INSET - mmW,
|
|
301
|
+
y: controlsHeight + MINIMAP_GAP,
|
|
302
|
+
width: mmW,
|
|
303
|
+
height: mmH,
|
|
304
|
+
className: "d3plus-minimap".concat(extraClass),
|
|
305
|
+
html: minimapHtml(viz),
|
|
306
|
+
events: {
|
|
307
|
+
".d3plus-minimap-viewport": viewportEvents(viz, mmW, styles, state, paintFrom),
|
|
308
|
+
".d3plus-minimap": outerEvents(viz, mmW, mmH)
|
|
309
|
+
},
|
|
310
|
+
onUpdate: function onUpdate(host) {
|
|
311
|
+
var viewportEl = host.querySelector(".d3plus-minimap-viewport");
|
|
312
|
+
if (viewportEl) paintFrom(viewportEl);
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
@name minimapFeature
|
|
318
|
+
A small overview of the full scene, underneath the zoom-control panel,
|
|
319
|
+
with a draggable box showing the current viewport and a zoom-level
|
|
320
|
+
label — hidden at the chart's natural 1x view, shown once zoomed in.
|
|
321
|
+
|
|
322
|
+
Runs as a post-draw `FeatureModule` right after `zoomFeature` (needs its
|
|
323
|
+
`_zoomBehavior.translateExtent()`/`scaleExtent()` already configured for
|
|
324
|
+
this draw). Claims zero margin, like `zoomFeature` — it floats over the
|
|
325
|
+
existing chart area rather than pushing content around. The panel is
|
|
326
|
+
ALWAYS mounted whenever zoom + minimap are both enabled, regardless of
|
|
327
|
+
the current zoom level: the "hidden at 1x" gate lives inside the panel's
|
|
328
|
+
`onUpdate`, reading the LIVE transform on every repaint, so it hides/
|
|
329
|
+
shows correctly during any live pan/zoom gesture — not just on the next
|
|
330
|
+
full `.render()` (dragging the minimap itself, wheel-zooming, clicking a
|
|
331
|
+
zoom button, and brush-zooming all repaint outside the layout pipeline).
|
|
332
|
+
*/ export var minimapFeature = {
|
|
333
|
+
name: "minimap",
|
|
334
|
+
layout: function layout(param) {
|
|
335
|
+
var viz = param.viz;
|
|
336
|
+
if (!viz.schema.zoom || !viz.schema.minimap || !viz._container || !viz._zoomBehavior || !showsZoomControls(viz)) return {
|
|
337
|
+
panel: null,
|
|
338
|
+
margin: {}
|
|
339
|
+
};
|
|
340
|
+
var box = zoomControlsBox(viz);
|
|
341
|
+
if (!box) return {
|
|
342
|
+
panel: null,
|
|
343
|
+
margin: {}
|
|
344
|
+
};
|
|
345
|
+
// The same width/height `zoomFeature` sizes `translateExtent` from —
|
|
346
|
+
// `_zoomWidth`/`_zoomHeight` are an escape hatch no chart sets today,
|
|
347
|
+
// but if one ever does, the minimap's aspect ratio (and its viewport-box
|
|
348
|
+
// math, which reads `translateExtent` directly) must track it rather
|
|
349
|
+
// than `chartBounds` alone.
|
|
350
|
+
var bounds = chartBounds(viz);
|
|
351
|
+
var height = viz._zoomHeight || bounds.height, width = viz._zoomWidth || bounds.width;
|
|
352
|
+
if (!width || !height) return {
|
|
353
|
+
panel: null,
|
|
354
|
+
margin: {}
|
|
355
|
+
};
|
|
356
|
+
// `box.width` measures the WHOLE button panel, including its own
|
|
357
|
+
// `paddingRight` (`ZOOM_PANEL_STYLE`) — the same inset this panel adds
|
|
358
|
+
// again below to sit flush with the panel's right edge. Subtracting it
|
|
359
|
+
// once here keeps the minimap's visible width equal to the buttons'
|
|
360
|
+
// own footprint instead of double-counting that padding.
|
|
361
|
+
var mmW = box.width - MINIMAP_RIGHT_INSET;
|
|
362
|
+
var mmH = mmW * (height / width);
|
|
363
|
+
return {
|
|
364
|
+
panel: buildMinimapPanel(viz, mmW, mmH, box.height),
|
|
365
|
+
margin: {}
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
//# sourceMappingURL=minimap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/charts/drawSteps/minimap.ts"],"sourcesContent":["import {zoomIdentity, zoomTransform} from \"d3-zoom\";\nimport type {ZoomTransform} from \"d3-zoom\";\n\nimport {chartBounds} from \"../features/chartGeometry.js\";\nimport type {FeatureLayout, FeatureModule} from \"../features/features.js\";\nimport type Viz from \"../viz/Viz.js\";\nimport {zoomTo} from \"./zoomControls.js\";\nimport {\n MINIMAP_GAP,\n MINIMAP_RIGHT_INSET,\n formatZoomLabel,\n minimapHtml,\n minimapStyles,\n paintMinimapStyle,\n} from \"./minimapMarkup.js\";\nimport {showsZoomControls, zoomControlsBox} from \"./zoomControlsMarkup.js\";\n\ntype MinimapStyles = ReturnType<typeof minimapStyles>;\n\n/** Drag state shared between the viewport box's event handlers and `paint`. */\ninterface DragState {\n dragging: boolean;\n /** The pointer that started the current drag — a second finger/pointer is ignored until it ends. */\n dragPointerId: number | null;\n dragStart: {x: number; y: number; tx: number; ty: number; k: number};\n}\n\n/**\n The element d3-zoom's transform is read from — the same fallback\n `zoomControls.ts` uses throughout (`_zoomEventTarget` on the Canvas\n backend, `_container` otherwise).\n @private\n*/\nfunction zoomTarget(viz: Viz): Viz[\"_zoomEventTarget\"] {\n return viz._zoomEventTarget || viz._container;\n}\n\n/** The live d3-zoom transform — NOT `viz._zoomTransform`, which the Plot family clears to `undefined` for its own axis-rescale zoom (`zoomControls.ts`'s `zoomed()`). Reading it straight from d3-zoom works uniformly across every chart type. */\nfunction liveTransform(viz: Viz): ZoomTransform {\n const node = zoomTarget(viz)?.node();\n return node ? zoomTransform(node) : zoomIdentity;\n}\n\n/** A keyboard nudge step, in minimap pixels — Shift takes a bigger step. */\nconst KEY_STEP = 10;\nconst KEY_STEP_SHIFT = 40;\nconst ARROW_KEYS: Record<string, [number, number]> = {\n ArrowLeft: [-1, 0],\n ArrowRight: [1, 0],\n ArrowUp: [0, -1],\n ArrowDown: [0, 1],\n};\n\n/** Re-centers the chart, at scale `k`, on a content-space point — the shared math behind click-to-jump and wheel-zoom. @private */\nfunction centerOn(viz: Viz, px: number, py: number, k: number, duration: number): void {\n const [[ax0, ay0], [ax1, ay1]] = viz._zoomBehavior.translateExtent();\n zoomTo(viz, k, (ax0 + ax1) / 2 - px * k, (ay0 + ay1) / 2 - py * k, duration);\n}\n\n/** Maps a pointer position local to the minimap's outer box into content-space. @private */\nfunction contentPointFromLocal(viz: Viz, mmW: number, mmH: number, localX: number, localY: number): [number, number] {\n const [[ax0, ay0], [ax1, ay1]] = viz._zoomBehavior.translateExtent();\n return [ax0 + (localX / mmW) * (ax1 - ax0), ay0 + (localY / mmH) * (ay1 - ay0)];\n}\n\n/**\n Repaints the outer box, viewport box, and label from the LIVE zoom\n transform. Called from `onUpdate` (every repaint) and directly from the\n drag handlers (pointerdown/up need to flip the active style immediately,\n before any transform change triggers a repaint of their own).\n\n Each element's user-configurable style (`minimapStyle`/etc.) is painted\n in its own call, BEFORE the internal, non-configurable geometry/\n visibility styles this feature owns — so a user-supplied `opacity`,\n `position`, or `left`/`top`/`width`/`height` can't accidentally break the\n 1x-hide gate or the live viewport-box positioning; the internal call\n always wins for the handful of properties it manages, leaving every\n other property (background, border, border-radius, …) up to the user.\n @private\n*/\nfunction paint(viz: Viz, mmW: number, mmH: number, styles: MinimapStyles, state: DragState, viewportEl: HTMLElement): void {\n const el = viewportEl.parentElement;\n const labelEl = el?.querySelector<HTMLElement>(\".d3plus-minimap-label\");\n if (!el || !labelEl) return;\n\n const t = liveTransform(viz);\n const zoomedIn = t.k > 1;\n\n paintMinimapStyle(el, styles.outer);\n // Faded (not `display:none`) so crossing the 1x threshold — via any of\n // the minimap's own gestures, a zoom button, or the wheel — animates\n // rather than popping. `pointer-events` still gates interaction while\n // hidden. Tied to `viz.schema.duration` like the chart's other\n // non-per-pixel transitions (button clicks, reset) — `0` (as every test\n // in this suite sets) makes it an instant, assertion-friendly toggle.\n paintMinimapStyle(el, {\n position: \"absolute\",\n \"box-sizing\": \"border-box\",\n overflow: \"hidden\",\n opacity: zoomedIn ? \"1\" : \"0\",\n \"pointer-events\": zoomedIn ? \"auto\" : \"none\",\n transition: `opacity ${viz.schema.duration}ms`,\n });\n if (!zoomedIn) return;\n\n const [[ax0, ay0], [ax1, ay1]] = viz._zoomBehavior.translateExtent();\n const areaW = ax1 - ax0, areaH = ay1 - ay0;\n const frac = Math.min(1, 1 / t.k);\n // Un-apply the current transform — the same algebra `zoomToBounds`\n // uses to go from displayed bounds back to unzoomed surface space.\n const contentX0 = (ax0 - t.x) / t.k, contentY0 = (ay0 - t.y) / t.k;\n const fracX = Math.max(0, Math.min(1 - frac, areaW ? (contentX0 - ax0) / areaW : 0));\n const fracY = Math.max(0, Math.min(1 - frac, areaH ? (contentY0 - ay0) / areaH : 0));\n\n paintMinimapStyle(viewportEl, styles.viewport, state.dragging ? styles.viewportActive : {});\n paintMinimapStyle(viewportEl, {\n position: \"absolute\",\n \"box-sizing\": \"border-box\",\n \"touch-action\": \"none\",\n left: `${fracX * mmW}px`,\n top: `${fracY * mmH}px`,\n width: `${Math.max(1, frac * mmW)}px`,\n height: `${Math.max(1, frac * mmH)}px`,\n });\n\n paintMinimapStyle(labelEl, styles.label);\n paintMinimapStyle(labelEl, {position: \"absolute\"});\n labelEl.textContent = formatZoomLabel(t.k);\n}\n\n/**\n Drag-to-pan + keyboard-nudge events for the viewport box. Guards every\n pointer event by `pointerId` against the one that started the drag, so a\n second finger/pointer touching the box mid-drag (or a stray pointerup\n for an unrelated pointer) can't hijack or prematurely end it.\n @private\n*/\nfunction viewportEvents(\n viz: Viz,\n mmW: number,\n styles: MinimapStyles,\n state: DragState,\n paintFrom: (viewportEl: HTMLElement) => void,\n): Record<string, (e: Event) => void> {\n const closestViewport = (e: Event): HTMLElement | null =>\n (e.target as Element | null)?.closest(\".d3plus-minimap-viewport\") as HTMLElement | null;\n\n const endDrag = (e: Event): void => {\n if ((e as PointerEvent).pointerId !== state.dragPointerId) return;\n state.dragging = false;\n const el = closestViewport(e);\n if (el) paintFrom(el);\n };\n\n return {\n pointerdown: (e: Event) => {\n const pe = e as PointerEvent;\n const el = closestViewport(e);\n if (!el) return;\n // Keeps pointermove/pointerup targeting this element even once the\n // cursor leaves the small minimap during a fast drag. Not critical\n // if it throws (an untrusted pointerId, an old browser) — a slower\n // drag that stays over the element still works without it.\n try {\n el.setPointerCapture(pe.pointerId);\n } catch {\n /* not critical, see above */\n }\n state.dragging = true;\n state.dragPointerId = pe.pointerId;\n const t = liveTransform(viz);\n state.dragStart = {x: pe.clientX, y: pe.clientY, tx: t.x, ty: t.y, k: t.k};\n paintFrom(el);\n e.preventDefault();\n },\n pointermove: (e: Event) => {\n const pe = e as PointerEvent;\n if (!state.dragging || pe.pointerId !== state.dragPointerId) return;\n const [[ax0], [ax1]] = viz._zoomBehavior.translateExtent();\n const scaleFactor = (ax1 - ax0) / mmW;\n const dx = (pe.clientX - state.dragStart.x) * scaleFactor * state.dragStart.k;\n const dy = (pe.clientY - state.dragStart.y) * scaleFactor * state.dragStart.k;\n // duration 0 — 1:1 responsiveness, matching every other per-pixel\n // pan/zoom tick (`zoomed()`'s own reasoning: a queued transition\n // per pointermove would visibly lag).\n zoomTo(viz, state.dragStart.k, state.dragStart.tx - dx, state.dragStart.ty - dy, 0);\n },\n pointerup: endDrag,\n pointercancel: endDrag,\n // Arrow keys nudge the pan (Shift for a bigger step) — the keyboard\n // equivalent of dragging, for the `tabindex`-focusable viewport box\n // `minimapHtml` marks up.\n keydown: (e: Event) => {\n const ke = e as KeyboardEvent;\n const dir = ARROW_KEYS[ke.key];\n if (!dir) return;\n ke.preventDefault();\n const [[ax0], [ax1]] = viz._zoomBehavior.translateExtent();\n const scaleFactor = (ax1 - ax0) / mmW;\n const step = ke.shiftKey ? KEY_STEP_SHIFT : KEY_STEP;\n const t = liveTransform(viz);\n const dx = dir[0] * step * scaleFactor * t.k;\n const dy = dir[1] * step * scaleFactor * t.k;\n // A discrete step, not a per-pixel drag tick — animates like the\n // zoom buttons' own clicks rather than jumping instantly.\n zoomTo(viz, t.k, t.x - dx, t.y - dy, viz.schema.duration);\n },\n };\n}\n\n/** Click-to-jump / double-click-reset / Cmd+wheel-zoom events for the outer box. @private */\nfunction outerEvents(viz: Viz, mmW: number, mmH: number): Record<string, (e: Event) => void> {\n return {\n // A click on the outer box (not the viewport box itself, which\n // `viewportEvents`'s `pointerdown` already claims for dragging)\n // re-centers the chart on the clicked point without changing scale —\n // the \"jump\" complement to dragging the viewport box.\n click: (e: Event) => {\n const target = e.target as Element | null;\n if (target?.closest(\".d3plus-minimap-viewport\")) return;\n const outerEl = target?.closest(\".d3plus-minimap\") as HTMLElement | null;\n if (!outerEl) return;\n const me = e as MouseEvent;\n const rect = outerEl.getBoundingClientRect();\n const [px, py] = contentPointFromLocal(viz, mmW, mmH, me.clientX - rect.left, me.clientY - rect.top);\n centerOn(viz, px, py, liveTransform(viz).k, viz.schema.duration);\n },\n // Double-clicking anywhere on the minimap resets the chart, like the\n // zoom-reset button.\n dblclick: (e: Event) => {\n e.preventDefault();\n zoomTo(viz, 1, 0, 0);\n },\n // Cmd/Ctrl + scroll zooms the whole chart, centered on the content\n // point under the cursor's position within the minimap — mirrors\n // the main chart's own modifier-gated wheel zoom (`zoomGestureFilter`)\n // and `zoomToBounds`'s centering math.\n wheel: (e: Event) => {\n const we = e as WheelEvent;\n if (!we.ctrlKey && !we.metaKey) return;\n we.preventDefault();\n const outerEl = (e.target as Element | null)?.closest(\".d3plus-minimap\") as HTMLElement | null;\n if (!outerEl) return;\n const rect = outerEl.getBoundingClientRect();\n const [px, py] = contentPointFromLocal(viz, mmW, mmH, we.clientX - rect.left, we.clientY - rect.top);\n const factor = we.deltaY < 0 ? viz.schema.zoomFactor : 1 / viz.schema.zoomFactor;\n centerOn(viz, px, py, liveTransform(viz).k * factor, 0);\n },\n };\n}\n\n/**\n Builds the minimap's `htmlOverlay` panel: a static skeleton (outer box +\n draggable viewport box + zoom-level label) sized and positioned once per\n full draw, whose `onUpdate` repaints the live geometry/label/visibility\n on every repaint — including every pan/zoom/drag/wheel tick, none of\n which re-run `layout()`. Mirrors `buildZoomControlPanel`'s shape.\n @private\n*/\nfunction buildMinimapPanel(viz: Viz, mmW: number, mmH: number, controlsHeight: number): FeatureLayout[\"panel\"] {\n const styles = minimapStyles(viz);\n const state: DragState = {dragging: false, dragPointerId: null, dragStart: {x: 0, y: 0, tx: 0, ty: 0, k: 1}};\n const paintFrom = (viewportEl: HTMLElement): void => paint(viz, mmW, mmH, styles, state, viewportEl);\n const extraClass = viz.schema.minimapClassName ? ` ${viz.schema.minimapClassName}` : \"\";\n\n return {\n type: \"htmlOverlay\",\n key: \"viz-minimap\",\n x: viz.schema.width - MINIMAP_RIGHT_INSET - mmW,\n y: controlsHeight + MINIMAP_GAP,\n width: mmW,\n height: mmH,\n className: `d3plus-minimap${extraClass}`,\n html: minimapHtml(viz),\n events: {\n \".d3plus-minimap-viewport\": viewportEvents(viz, mmW, styles, state, paintFrom),\n \".d3plus-minimap\": outerEvents(viz, mmW, mmH),\n },\n onUpdate: (host: HTMLElement) => {\n const viewportEl = host.querySelector<HTMLElement>(\".d3plus-minimap-viewport\");\n if (viewportEl) paintFrom(viewportEl);\n },\n };\n}\n\n/**\n @name minimapFeature\n A small overview of the full scene, underneath the zoom-control panel,\n with a draggable box showing the current viewport and a zoom-level\n label — hidden at the chart's natural 1x view, shown once zoomed in.\n\n Runs as a post-draw `FeatureModule` right after `zoomFeature` (needs its\n `_zoomBehavior.translateExtent()`/`scaleExtent()` already configured for\n this draw). Claims zero margin, like `zoomFeature` — it floats over the\n existing chart area rather than pushing content around. The panel is\n ALWAYS mounted whenever zoom + minimap are both enabled, regardless of\n the current zoom level: the \"hidden at 1x\" gate lives inside the panel's\n `onUpdate`, reading the LIVE transform on every repaint, so it hides/\n shows correctly during any live pan/zoom gesture — not just on the next\n full `.render()` (dragging the minimap itself, wheel-zooming, clicking a\n zoom button, and brush-zooming all repaint outside the layout pipeline).\n*/\nexport const minimapFeature: FeatureModule = {\n name: \"minimap\",\n layout: ({viz}) => {\n if (!viz.schema.zoom || !viz.schema.minimap || !viz._container || !viz._zoomBehavior || !showsZoomControls(viz))\n return {panel: null, margin: {}};\n\n const box = zoomControlsBox(viz);\n if (!box) return {panel: null, margin: {}};\n\n // The same width/height `zoomFeature` sizes `translateExtent` from —\n // `_zoomWidth`/`_zoomHeight` are an escape hatch no chart sets today,\n // but if one ever does, the minimap's aspect ratio (and its viewport-box\n // math, which reads `translateExtent` directly) must track it rather\n // than `chartBounds` alone.\n const bounds = chartBounds(viz as never);\n const height = viz._zoomHeight || bounds.height, width = viz._zoomWidth || bounds.width;\n if (!width || !height) return {panel: null, margin: {}};\n\n // `box.width` measures the WHOLE button panel, including its own\n // `paddingRight` (`ZOOM_PANEL_STYLE`) — the same inset this panel adds\n // again below to sit flush with the panel's right edge. Subtracting it\n // once here keeps the minimap's visible width equal to the buttons'\n // own footprint instead of double-counting that padding.\n const mmW = box.width - MINIMAP_RIGHT_INSET;\n const mmH = mmW * (height / width);\n\n return {panel: buildMinimapPanel(viz, mmW, mmH, box.height), margin: {}};\n },\n};\n"],"names":["zoomIdentity","zoomTransform","chartBounds","zoomTo","MINIMAP_GAP","MINIMAP_RIGHT_INSET","formatZoomLabel","minimapHtml","minimapStyles","paintMinimapStyle","showsZoomControls","zoomControlsBox","zoomTarget","viz","_zoomEventTarget","_container","liveTransform","node","KEY_STEP","KEY_STEP_SHIFT","ARROW_KEYS","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","centerOn","px","py","k","duration","_zoomBehavior","translateExtent","ax0","ay0","ax1","ay1","contentPointFromLocal","mmW","mmH","localX","localY","paint","styles","state","viewportEl","el","parentElement","labelEl","querySelector","t","zoomedIn","outer","position","overflow","opacity","transition","schema","areaW","areaH","frac","Math","min","contentX0","x","contentY0","y","fracX","max","fracY","viewport","dragging","viewportActive","left","top","width","height","label","textContent","viewportEvents","paintFrom","closestViewport","e","target","closest","endDrag","pointerId","dragPointerId","pointerdown","pe","setPointerCapture","dragStart","clientX","clientY","tx","ty","preventDefault","pointermove","scaleFactor","dx","dy","pointerup","pointercancel","keydown","ke","dir","key","step","shiftKey","outerEvents","click","outerEl","me","rect","getBoundingClientRect","dblclick","wheel","we","ctrlKey","metaKey","factor","deltaY","zoomFactor","buildMinimapPanel","controlsHeight","extraClass","minimapClassName","type","className","html","events","onUpdate","host","minimapFeature","name","layout","zoom","minimap","panel","margin","box","bounds","_zoomHeight","_zoomWidth"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAQA,YAAY,EAAEC,aAAa,QAAO,UAAU;AAGpD,SAAQC,WAAW,QAAO,+BAA+B;AAGzD,SAAQC,MAAM,QAAO,oBAAoB;AACzC,SACEC,WAAW,EACXC,mBAAmB,EACnBC,eAAe,EACfC,WAAW,EACXC,aAAa,EACbC,iBAAiB,QACZ,qBAAqB;AAC5B,SAAQC,iBAAiB,EAA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