@d3plus/core 4.2.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.
Files changed (214) hide show
  1. package/README.md +2137 -953
  2. package/es/index.js +1 -1
  3. package/es/index.js.map +1 -1
  4. package/es/internal.js +7 -1
  5. package/es/internal.js.map +1 -1
  6. package/es/src/charts/AreaPlot/index.js +1 -2
  7. package/es/src/charts/AreaPlot/index.js.map +1 -1
  8. package/es/src/charts/BarChart/index.js +1 -2
  9. package/es/src/charts/BarChart/index.js.map +1 -1
  10. package/es/src/charts/BoxWhisker/index.js +1 -2
  11. package/es/src/charts/BoxWhisker/index.js.map +1 -1
  12. package/es/src/charts/BumpChart/index.js +1 -2
  13. package/es/src/charts/BumpChart/index.js.map +1 -1
  14. package/es/src/charts/Chord/applyLayout.js +205 -0
  15. package/es/src/charts/Chord/applyLayout.js.map +1 -0
  16. package/es/src/charts/Chord/emit.js +168 -0
  17. package/es/src/charts/Chord/emit.js.map +1 -0
  18. package/es/src/charts/Chord/index.js +234 -0
  19. package/es/src/charts/Chord/index.js.map +1 -0
  20. package/es/src/charts/Geomap/basemapTheme.js +78 -0
  21. package/es/src/charts/Geomap/basemapTheme.js.map +1 -0
  22. package/es/src/charts/Geomap/emit.js +58 -9
  23. package/es/src/charts/Geomap/emit.js.map +1 -1
  24. package/es/src/charts/Geomap/index.js +93 -99
  25. package/es/src/charts/Geomap/index.js.map +1 -1
  26. package/es/src/charts/LinePlot/index.js +1 -2
  27. package/es/src/charts/LinePlot/index.js.map +1 -1
  28. package/es/src/charts/Matrix/emit.js +6 -0
  29. package/es/src/charts/Matrix/emit.js.map +1 -1
  30. package/es/src/charts/Matrix/index.js +1 -2
  31. package/es/src/charts/Matrix/index.js.map +1 -1
  32. package/es/src/charts/Network/emit.js +58 -24
  33. package/es/src/charts/Network/emit.js.map +1 -1
  34. package/es/src/charts/Network/index.js +34 -54
  35. package/es/src/charts/Network/index.js.map +1 -1
  36. package/es/src/charts/Pack/emit.js +3 -0
  37. package/es/src/charts/Pack/emit.js.map +1 -1
  38. package/es/src/charts/Pack/index.js +1 -2
  39. package/es/src/charts/Pack/index.js.map +1 -1
  40. package/es/src/charts/Pie/emit.js +6 -2
  41. package/es/src/charts/Pie/emit.js.map +1 -1
  42. package/es/src/charts/Pie/index.js +1 -2
  43. package/es/src/charts/Pie/index.js.map +1 -1
  44. package/es/src/charts/Plot/index.js +99 -4
  45. package/es/src/charts/Plot/index.js.map +1 -1
  46. package/es/src/charts/Plot/pipeline.js +25 -5
  47. package/es/src/charts/Plot/pipeline.js.map +1 -1
  48. package/es/src/charts/Plot/plotZoom.js +278 -0
  49. package/es/src/charts/Plot/plotZoom.js.map +1 -0
  50. package/es/src/charts/Priestley/emit.js +4 -0
  51. package/es/src/charts/Priestley/emit.js.map +1 -1
  52. package/es/src/charts/Priestley/index.js +1 -2
  53. package/es/src/charts/Priestley/index.js.map +1 -1
  54. package/es/src/charts/Radar/emit.js +4 -1
  55. package/es/src/charts/Radar/emit.js.map +1 -1
  56. package/es/src/charts/Radar/index.js +1 -2
  57. package/es/src/charts/Radar/index.js.map +1 -1
  58. package/es/src/charts/RadialMatrix/emit.js +6 -0
  59. package/es/src/charts/RadialMatrix/emit.js.map +1 -1
  60. package/es/src/charts/RadialMatrix/index.js +1 -2
  61. package/es/src/charts/RadialMatrix/index.js.map +1 -1
  62. package/es/src/charts/Rings/emit.js +74 -8
  63. package/es/src/charts/Rings/emit.js.map +1 -1
  64. package/es/src/charts/Rings/index.js +11 -3
  65. package/es/src/charts/Rings/index.js.map +1 -1
  66. package/es/src/charts/Sankey/emit.js +55 -11
  67. package/es/src/charts/Sankey/emit.js.map +1 -1
  68. package/es/src/charts/Sankey/index.js +8 -2
  69. package/es/src/charts/Sankey/index.js.map +1 -1
  70. package/es/src/charts/StackedArea/index.js +1 -2
  71. package/es/src/charts/StackedArea/index.js.map +1 -1
  72. package/es/src/charts/Tree/emit.js +8 -2
  73. package/es/src/charts/Tree/emit.js.map +1 -1
  74. package/es/src/charts/Tree/index.js +1 -2
  75. package/es/src/charts/Tree/index.js.map +1 -1
  76. package/es/src/charts/Treemap/index.js +1 -2
  77. package/es/src/charts/Treemap/index.js.map +1 -1
  78. package/es/src/charts/definition/ChartDefinition.js.map +1 -1
  79. package/es/src/charts/drawSteps/backControl.js +70 -0
  80. package/es/src/charts/drawSteps/backControl.js.map +1 -0
  81. package/es/src/charts/drawSteps/controlButtonStyle.js +108 -0
  82. package/es/src/charts/drawSteps/controlButtonStyle.js.map +1 -0
  83. package/es/src/charts/drawSteps/minimap.js +370 -0
  84. package/es/src/charts/drawSteps/minimap.js.map +1 -0
  85. package/es/src/charts/drawSteps/minimapMarkup.js +147 -0
  86. package/es/src/charts/drawSteps/minimapMarkup.js.map +1 -0
  87. package/es/src/charts/drawSteps/searchControls.js +358 -0
  88. package/es/src/charts/drawSteps/searchControls.js.map +1 -0
  89. package/es/src/charts/drawSteps/searchControlsMarkup.js +430 -0
  90. package/es/src/charts/drawSteps/searchControlsMarkup.js.map +1 -0
  91. package/es/src/charts/drawSteps/tableView.js +173 -0
  92. package/es/src/charts/drawSteps/tableView.js.map +1 -0
  93. package/es/src/charts/drawSteps/tableViewControl.js +39 -0
  94. package/es/src/charts/drawSteps/tableViewControl.js.map +1 -0
  95. package/es/src/charts/drawSteps/tableViewMarkup.js +647 -0
  96. package/es/src/charts/drawSteps/tableViewMarkup.js.map +1 -0
  97. package/es/src/charts/drawSteps/topLeftControls.js +73 -0
  98. package/es/src/charts/drawSteps/topLeftControls.js.map +1 -0
  99. package/es/src/charts/drawSteps/topLeftControlsMarkup.js +227 -0
  100. package/es/src/charts/drawSteps/topLeftControlsMarkup.js.map +1 -0
  101. package/es/src/charts/drawSteps/zoomControls.js +314 -175
  102. package/es/src/charts/drawSteps/zoomControls.js.map +1 -1
  103. package/es/src/charts/drawSteps/zoomControlsMarkup.js +280 -0
  104. package/es/src/charts/drawSteps/zoomControlsMarkup.js.map +1 -0
  105. package/es/src/charts/features/attributionFeature.js +137 -0
  106. package/es/src/charts/features/attributionFeature.js.map +1 -0
  107. package/es/src/charts/features/axes.js +20 -8
  108. package/es/src/charts/features/axes.js.map +1 -1
  109. package/es/src/charts/features/chartGeometry.js +16 -2
  110. package/es/src/charts/features/chartGeometry.js.map +1 -1
  111. package/es/src/charts/features/edgeArrows.js +155 -0
  112. package/es/src/charts/features/edgeArrows.js.map +1 -0
  113. package/es/src/charts/features/emitHelpers.js +8 -0
  114. package/es/src/charts/features/emitHelpers.js.map +1 -1
  115. package/es/src/charts/features/ensureZoomDom.js +63 -12
  116. package/es/src/charts/features/ensureZoomDom.js.map +1 -1
  117. package/es/src/charts/features/features.js +83 -110
  118. package/es/src/charts/features/features.js.map +1 -1
  119. package/es/src/charts/features/featuresLegend.js +45 -17
  120. package/es/src/charts/features/featuresLegend.js.map +1 -1
  121. package/es/src/charts/features/plotPaint.js +32 -7
  122. package/es/src/charts/features/plotPaint.js.map +1 -1
  123. package/es/src/charts/features/shapeEmit.js +3 -1
  124. package/es/src/charts/features/shapeEmit.js.map +1 -1
  125. package/es/src/charts/features/zoomExtent.js +185 -0
  126. package/es/src/charts/features/zoomExtent.js.map +1 -0
  127. package/es/src/charts/helpers/tileAttributions.js +26 -0
  128. package/es/src/charts/helpers/tileAttributions.js.map +1 -1
  129. package/es/src/charts/index.js +1 -0
  130. package/es/src/charts/index.js.map +1 -1
  131. package/es/src/charts/pipeline/runVizPipeline.js +33 -14
  132. package/es/src/charts/pipeline/runVizPipeline.js.map +1 -1
  133. package/es/src/charts/pipeline/vizDrawPure.js +32 -6
  134. package/es/src/charts/pipeline/vizDrawPure.js.map +1 -1
  135. package/es/src/charts/viz/Viz.js +102 -61
  136. package/es/src/charts/viz/Viz.js.map +1 -1
  137. package/es/src/charts/viz/VizBase.js +157 -4
  138. package/es/src/charts/viz/VizBase.js.map +1 -1
  139. package/es/src/charts/viz/VizBaseConfig.js +32 -2
  140. package/es/src/charts/viz/VizBaseConfig.js.map +1 -1
  141. package/es/src/charts/viz/interactionOpacity.js +4 -1
  142. package/es/src/charts/viz/interactionOpacity.js.map +1 -1
  143. package/es/src/charts/viz/vizDefaults.js +247 -51
  144. package/es/src/charts/viz/vizDefaults.js.map +1 -1
  145. package/es/src/charts/viz/vizRender.js +7 -3
  146. package/es/src/charts/viz/vizRender.js.map +1 -1
  147. package/es/src/charts/viz/vizTypes.js.map +1 -1
  148. package/es/src/components/Axis/Axis.js +10 -1
  149. package/es/src/components/Axis/Axis.js.map +1 -1
  150. package/es/src/components/Axis/axisLayoutLabels.js +2 -1
  151. package/es/src/components/Axis/axisLayoutLabels.js.map +1 -1
  152. package/es/src/components/Axis/axisRender.js +5 -1
  153. package/es/src/components/Axis/axisRender.js.map +1 -1
  154. package/es/src/components/Legend/legendConfig.js +86 -20
  155. package/es/src/components/Legend/legendConfig.js.map +1 -1
  156. package/es/src/shapes/Shape.js +12 -10
  157. package/es/src/shapes/Shape.js.map +1 -1
  158. package/es/src/shapes/hitAreaNode.js +31 -5
  159. package/es/src/shapes/hitAreaNode.js.map +1 -1
  160. package/es/src/shapes/interactionPoints.js +30 -0
  161. package/es/src/shapes/interactionPoints.js.map +1 -0
  162. package/es/src/utils/D3plusConfig.js.map +1 -1
  163. package/package.json +11 -10
  164. package/types/index.d.ts +1 -1
  165. package/types/internal.d.ts +8 -1
  166. package/types/src/charts/Chord/applyLayout.d.ts +43 -0
  167. package/types/src/charts/Chord/emit.d.ts +10 -0
  168. package/types/src/charts/Chord/index.d.ts +19 -0
  169. package/types/src/charts/Geomap/basemapTheme.d.ts +35 -0
  170. package/types/src/charts/Plot/index.d.ts +32 -2
  171. package/types/src/charts/Plot/pipeline.d.ts +2 -1
  172. package/types/src/charts/Plot/plotZoom.d.ts +65 -0
  173. package/types/src/charts/definition/ChartDefinition.d.ts +3 -1
  174. package/types/src/charts/drawSteps/backControl.d.ts +29 -0
  175. package/types/src/charts/drawSteps/controlButtonStyle.d.ts +45 -0
  176. package/types/src/charts/drawSteps/minimap.d.ts +19 -0
  177. package/types/src/charts/drawSteps/minimapMarkup.d.ts +45 -0
  178. package/types/src/charts/drawSteps/searchControls.d.ts +3 -0
  179. package/types/src/charts/drawSteps/searchControlsMarkup.d.ts +111 -0
  180. package/types/src/charts/drawSteps/tableView.d.ts +23 -0
  181. package/types/src/charts/drawSteps/tableViewControl.d.ts +21 -0
  182. package/types/src/charts/drawSteps/tableViewMarkup.d.ts +119 -0
  183. package/types/src/charts/drawSteps/topLeftControls.d.ts +32 -0
  184. package/types/src/charts/drawSteps/topLeftControlsMarkup.d.ts +72 -0
  185. package/types/src/charts/drawSteps/zoomControls.d.ts +48 -8
  186. package/types/src/charts/drawSteps/zoomControlsMarkup.d.ts +138 -0
  187. package/types/src/charts/features/attributionFeature.d.ts +21 -0
  188. package/types/src/charts/features/axes.d.ts +1 -1
  189. package/types/src/charts/features/chartGeometry.d.ts +9 -3
  190. package/types/src/charts/features/edgeArrows.d.ts +92 -0
  191. package/types/src/charts/features/emitHelpers.d.ts +11 -0
  192. package/types/src/charts/features/ensureZoomDom.d.ts +6 -2
  193. package/types/src/charts/features/features.d.ts +32 -17
  194. package/types/src/charts/features/featuresLegend.d.ts +15 -0
  195. package/types/src/charts/features/plotPaint.d.ts +15 -2
  196. package/types/src/charts/features/zoomExtent.d.ts +25 -0
  197. package/types/src/charts/index.d.ts +1 -0
  198. package/types/src/charts/pipeline/runVizPipeline.d.ts +6 -3
  199. package/types/src/charts/viz/Viz.d.ts +31 -1
  200. package/types/src/charts/viz/VizBase.d.ts +86 -4
  201. package/types/src/charts/viz/VizBaseConfig.d.ts +20 -2
  202. package/types/src/charts/viz/vizDefaults.d.ts +155 -0
  203. package/types/src/charts/viz/vizTypes.d.ts +75 -1
  204. package/types/src/components/Axis/Axis.d.ts +2 -0
  205. package/types/src/shapes/Shape.d.ts +2 -2
  206. package/types/src/shapes/hitAreaNode.d.ts +5 -4
  207. package/types/src/shapes/interactionPoints.d.ts +15 -0
  208. package/types/src/utils/D3plusConfig.d.ts +102 -8
  209. package/umd/d3plus-core.full.js +39793 -34875
  210. package/umd/d3plus-core.full.js.map +1 -1
  211. package/umd/d3plus-core.full.min.js +5836 -4264
  212. package/umd/d3plus-core.js +13998 -9927
  213. package/umd/d3plus-core.js.map +1 -1
  214. package/umd/d3plus-core.min.js +3716 -2264
@@ -0,0 +1,111 @@
1
+ /**
2
+ Markup, styling, and event handlers for the search control (a toggle
3
+ button + an expanding text input) — the top-left counterpart to the
4
+ zoom-controls panel's buttons, contributed into the shared top-left
5
+ controls panel (`topLeftControls.ts`) alongside the back button. Kept as
6
+ its own module rather than folded into `zoomControlsMarkup.ts`/
7
+ `topLeftControlsMarkup.ts`: search is independent chrome a chart can mix
8
+ and match with zoom/back, so its styling knobs stay uncoupled from
9
+ theirs (matching the convention `zoomControlsMarkup.ts` itself notes for
10
+ why zoom and table-view don't share styling code).
11
+
12
+ @module
13
+ */
14
+ import type { DataPoint } from "@d3plus/data";
15
+ import type { SceneNode } from "@d3plus/render";
16
+ import type Viz from "../viz/Viz.js";
17
+ import { type StyleObject } from "./controlButtonStyle.js";
18
+ /** Search-open state is per-chart, read/written via `viz._searchOpen`. */
19
+ export declare function isSearchOpen(viz: Viz): boolean;
20
+ /** The resolved base / active / hover button styles for a chart — also the cheap, non-DOM basis for `searchContribution`'s `styleSignature` (see `Contribution.styleSignature`). */
21
+ export declare function searchButtonStyles(viz: Viz): {
22
+ base: StyleObject;
23
+ active: StyleObject;
24
+ hover: StyleObject;
25
+ };
26
+ /** Paints the search toggle button's inline style for its current state. Mirrors `paintZoomButton`. */
27
+ export declare function paintSearchButton(viz: Viz, btn: HTMLElement, hovered?: boolean): void;
28
+ /**
29
+ The input's inline style at rest (closed) vs. open — set directly by the
30
+ toggle click handler, never regenerated mid-typing. Open's right padding
31
+ reserves room for the clear button, which sits absolutely-positioned
32
+ INSIDE the input's own box (see `SEARCH_CLEAR_STYLE_SHOWN`) rather than
33
+ beside it, so typed text wraps short of it instead of running underneath.
34
+ */
35
+ export declare const SEARCH_INPUT_STYLE_CLOSED: Record<string, string>;
36
+ export declare const SEARCH_INPUT_STYLE_OPEN: Record<string, string>;
37
+ /**
38
+ The wrapper `.search-input-wrap` is the positioning context for both the
39
+ clear button (absolute, inside the input's own box) and the match-count
40
+ feedback (absolute, below it) — an `inline-block` with no explicit width
41
+ of its own, so it always shrink-wraps to the input's CURRENT width
42
+ (0 closed, 120px open) and the count box (`width: 100%`) automatically
43
+ matches it.
44
+ */
45
+ export declare const SEARCH_INPUT_WRAP_STYLE: Record<string, string>;
46
+ /** Applies the open/closed inline style directly to the input DOM node — no panel rebuild, so focus/cursor survive. */
47
+ export declare function applySearchInputOpenState(input: HTMLInputElement, open: boolean): void;
48
+ /** Shows/hides the clear button, directly on the DOM node — same no-rebuild pattern as the input's open state. */
49
+ export declare function applySearchClearVisible(btn: HTMLElement, visible: boolean): void;
50
+ /** Writes the match-count feedback's text/visibility directly onto the DOM node — visible whenever there's a term, regardless of whether it matched anything ("No Matches" is itself useful feedback). */
51
+ export declare function applySearchCount(viz: Viz, el: HTMLElement, hasTerm: boolean, index: number | undefined, total: number): void;
52
+ /**
53
+ The search control's markup: a toggle `<button>`, an `<input>`, a clear
54
+ (×) button, and a match-count span — all real elements so host-page
55
+ button/input styling applies through the cascade the same way zoom's
56
+ buttons do. Term/open state is baked in from `viz._searchTerm`/
57
+ `_searchOpen` so a full re-render (e.g. a resize or data change)
58
+ preserves whatever the user was doing — typing itself never regenerates
59
+ this markup (see `searchControls.ts`).
60
+
61
+ The count span is left EMPTY here on purpose — its text is written by
62
+ `searchContribution`'s `onUpdate` instead (see there), not baked into
63
+ this string. `onUpdate` runs on every draw regardless of whether this
64
+ html string changed, while the match count itself depends on the
65
+ CHART's data/scene, not on the search box's own state — baking its text
66
+ in here would make this contribution's own html change (and its DOM,
67
+ including the live `<input>`, get torn down and rebuilt) every time the
68
+ chart's data changes for a reason that has nothing to do with search,
69
+ e.g. drilling down while the box is open and focused.
70
+ */
71
+ export declare function searchControlsHtml(viz: Viz): string;
72
+ /**
73
+ Builds the predicate `.highlight()` drives from the current search term
74
+ — see `matchesSearchNeedle` for the match rule. Empty term restores
75
+ whatever `.highlight()` predicate (if any) was active before the search
76
+ box opened.
77
+ */
78
+ export declare function searchHighlightPredicate(viz: Viz, term: string): ((d: DataPoint, i: number) => boolean) | false;
79
+ /** One matching mark: its scene node (for `.key`/geometry), the unwrapped source row, and its index. */
80
+ export interface SearchMatch {
81
+ node: SceneNode;
82
+ row: DataPoint;
83
+ index: number;
84
+ }
85
+ /**
86
+ Every currently-rendered mark matching the given term, in scene order.
87
+ Walks `viz._chartScene` (the actual painted scene, post-layout) rather
88
+ than the raw data array, unwrapping each node's datum the same way
89
+ `applyInteractionOpacity` does, so a grouped/aggregated chart matches by
90
+ rendered mark, not by raw input row — and de-dupes by datum reference so
91
+ a mark's separate label node doesn't double-count it. An empty term
92
+ matches nothing (there's no "everything" state to jump through).
93
+ */
94
+ export declare function searchMatches(viz: Viz, term: string): SearchMatch[];
95
+ /**
96
+ Formats the match-count feedback as a readable, localized phrase:
97
+ "No Matches" with nothing found, "6 Matches"/"1 Match" once there's a
98
+ count but the user hasn't stepped to one yet (Enter/Shift+Enter), and
99
+ "Match 2/6" once they have — the translated noun for context, plus a
100
+ compact numeric position rather than a translated "of" connector, since
101
+ a fixed English word order ("Match 2 of 6") wouldn't read naturally in
102
+ every locale, while a number pair after a noun does. `index` is 0-based
103
+ (`viz._searchMatchIndex`); `total` is `searchMatches(...).length`. Text
104
+ and label are the same string — both visible and accessible.
105
+ */
106
+ export declare function formatMatchCount(viz: Viz, index: number | undefined, total: number): {
107
+ text: string;
108
+ label: string;
109
+ };
110
+ /** Whether a chart shows the search control. */
111
+ export declare function showsSearchControls(viz: Viz): boolean;
@@ -0,0 +1,23 @@
1
+ import type { FeatureModule } from "../features/features.js";
2
+ import type Viz from "../viz/Viz.js";
3
+ export declare function toggleTableView(viz: Viz): void;
4
+ export declare function changeTableViewPage(viz: Viz, dir: number): void;
5
+ /**
6
+ Clicking a column header: the same column toggles asc ↔ desc; a
7
+ different column starts at asc. Resets to page 0 — re-sorting while deep
8
+ in the pagination would otherwise strand the user on a page whose
9
+ contents just changed out from under them.
10
+ */
11
+ export declare function changeTableViewSort(viz: Viz, column: string): void;
12
+ /**
13
+ Clicking the raw/aggregate toggle (`dataSourceButtonHtml` — only
14
+ rendered when the two actually differ). Resets to page 0, same reasoning
15
+ as `changeTableViewSort`: the row count itself changes underneath
16
+ whatever page was showing. Sort state is left alone — raw and aggregate
17
+ can have different column sets (an aggregate merge may add a computed
18
+ field the raw rows don't have, e.g. Pie's "share"), and
19
+ `sortedTableViewRows` already no-ops a sort whose column isn't among the
20
+ new source's columns, so there's nothing to actively reconcile.
21
+ */
22
+ export declare function toggleTableViewDataSource(viz: Viz): void;
23
+ export declare const tableViewFeature: FeatureModule;
@@ -0,0 +1,21 @@
1
+ /**
2
+ The table-view toggle's contribution to the shared top-left controls
3
+ panel (`topLeftControls.ts`) — the button that switches the chart to a
4
+ static, scrollable data table (`tableView.ts` owns the actual overlay).
5
+
6
+ Unlike `backContribution` (only shows with drill-down history), this one
7
+ contributes as long as `tableView` is enabled — REGARDLESS of whether
8
+ table view is currently active. While active, `tableView.ts`'s
9
+ chart-sized overlay panel paints on top of the entire chart (including
10
+ this shared panel), so this button becomes invisible and unreachable by
11
+ real pointer hit-testing; the overlay embeds its own copy of the same
12
+ button (see `tableViewOverlayHtml`) for the user to actually click to
13
+ switch back. Keeping this contribution constant means toggling table
14
+ view never has to touch the shared panel's composition — only the
15
+ separate overlay panel appears/disappears.
16
+
17
+ @module
18
+ */
19
+ import type Viz from "../viz/Viz.js";
20
+ import type { Contribution } from "./topLeftControlsMarkup.js";
21
+ export declare function tableViewContribution(viz: Viz): Contribution | null;
@@ -0,0 +1,119 @@
1
+ /**
2
+ Markup, styling, and state helpers for the table-view toggle button + the
3
+ data-table overlay it swaps in (sorting, CSV export, pagination).
4
+
5
+ The button's html (`tableViewButtonHtml`) is consumed two ways: as
6
+ `tableViewContribution`'s piece of the shared top-left controls panel
7
+ (`tableViewControl.ts`) while the chart is showing, and embedded at the
8
+ top of the full-chart data-table overlay (`tableView.ts`) while table
9
+ view is active — so a click there can toggle back. Kept as its own
10
+ module (rather than folded into `zoomControlsMarkup.ts`) because the two
11
+ features are independent chrome a chart can mix and match; sharing
12
+ styling *knobs* (config keys, defaults) between them would couple them
13
+ for no benefit. The button-painting *mechanism* is genuinely
14
+ feature-agnostic, though — `paintControlButton`/`resolveControlStyle`
15
+ come from the shared `controlButtonStyle.ts` (also used by zoom/back/
16
+ search), the same way `zoomControlsInset` and `topLeftControlsInset`
17
+ share the box-measuring pattern without sharing what they measure.
18
+ `overlayHost` is reused from `zoomControlsMarkup.ts`.
19
+
20
+ @module
21
+ */
22
+ import type { DataPoint } from "@d3plus/data";
23
+ import type Viz from "../viz/Viz.js";
24
+ /** Table-view mode is per-chart state, read/written via `viz._tableView`. */
25
+ export declare function isTableView(viz: Viz): boolean;
26
+ export declare function setTableView(viz: Viz, value: boolean): void;
27
+ /** The current page (0-indexed) of the paginated data table. */
28
+ export declare function getTableViewPage(viz: Viz): number;
29
+ export declare function setTableViewPage(viz: Viz, value: number): void;
30
+ export type SortDirection = "asc" | "desc";
31
+ export interface TableViewSort {
32
+ column: string;
33
+ direction: SortDirection;
34
+ }
35
+ /** The data table's current sort column + direction, if any (`viz._tableViewSort`). */
36
+ export declare function getTableViewSort(viz: Viz): TableViewSort | undefined;
37
+ export declare function setTableViewSort(viz: Viz, value: TableViewSort | undefined): void;
38
+ export type TableViewDataSource = "raw" | "aggregate";
39
+ /** Which dataset the table currently shows: `viz._data` (raw) or `viz._filteredData` (aggregate, the default — matches the chart's own on-screen behavior). */
40
+ export declare function getTableViewDataSource(viz: Viz): TableViewDataSource;
41
+ export declare function setTableViewDataSource(viz: Viz, value: TableViewDataSource): void;
42
+ /** Paints the table-view button's inline style for its current state (base/hover/active) — see `paintControlButton`. */
43
+ export declare function paintTableViewButton(viz: Viz, btn: HTMLElement, hovered?: boolean): void;
44
+ /** The cheap, non-DOM signature capturing the button's resolved style — see `Contribution.styleSignature`. */
45
+ export declare function tableViewButtonStyleSignature(viz: Viz): string;
46
+ /** The toggle button's markup — a real `<button>` so host-page button styling applies once `tableViewControlClassName` disables the inline defaults. */
47
+ export declare function tableViewButtonHtml(viz: Viz): string;
48
+ /**
49
+ The chart's current data-table rows and their columns (the union of
50
+ every row's own keys — see `allColumns`), sorted per
51
+ `viz._tableViewSort` when set. Shared by the on-screen table (which
52
+ further paginates this) and CSV export (which exports it in full,
53
+ unpaginated) — both automatically follow whichever data source
54
+ `dataSourceButtonHtml`'s toggle currently selects.
55
+
56
+ Source: `viz._filteredData` (aggregate — what's actually charted) by
57
+ default, or `viz._data` (raw, untouched input) once the toggle picks
58
+ "raw" — guarded by `hasDistinctRawData` so a stale `_tableViewDataSource`
59
+ from a previous, genuinely-different dataset can't silently switch a
60
+ chart whose raw/aggregate happen to now coincide.
61
+
62
+ Absent an explicit column sort, the AGGREGATE source is further
63
+ reordered (`defaultRowOrder`) to match the chart's original `.data()`
64
+ insertion order — raw is already in that order by definition, so it's
65
+ skipped there.
66
+ */
67
+ export declare function sortedTableViewRows(viz: Viz): {
68
+ rows: DataPoint[];
69
+ columns: string[];
70
+ };
71
+ /** One page of rows, clamped/derived from `tableViewPageSize` + the current `_tableViewPage`. Clamps and writes back the page so it can't drift out of range as data/sort changes. Exported so `setupTableViewVirtualization` can re-derive the identical slice `tableViewOverlayHtml` built. */
72
+ export declare function paginate(viz: Viz, rows: DataPoint[]): {
73
+ slice: DataPoint[];
74
+ page: number;
75
+ totalPages: number;
76
+ start: number;
77
+ end: number;
78
+ total: number;
79
+ };
80
+ /** Whether a chart shows the table-view toggle button. */
81
+ export declare function showsTableView(viz: Viz): boolean;
82
+ /**
83
+ The full data-table overlay's markup: a toolbar (the toggle button, —
84
+ unless disabled — a "download CSV" button, and — only when raw and
85
+ aggregate data actually differ — the raw/aggregate source toggle), a
86
+ scrollable table with a sticky, click-to-sort header, and — when the
87
+ data doesn't fit on one page — Prev/Next pagination. Columns come from
88
+ the union of every row's own keys; every value is escaped, since it's
89
+ caller-supplied data landing in `innerHTML`.
90
+ */
91
+ export declare function tableViewOverlayHtml(viz: Viz): string;
92
+ /** Builds the CSV and triggers a browser download of the chart's full (sorted, unpaginated) data-table rows. */
93
+ export declare function downloadTableViewCsv(viz: Viz): void;
94
+ /**
95
+ Paints every `.table-view-control` button's inline style (base/active,
96
+ plus hover — which can't be delegated like click, since mouseenter/
97
+ mouseleave don't bubble) once per button DOM node, guarded by
98
+ `data-table-view-bound` the same way `buildZoomControlPanel`'s
99
+ `onUpdate` guards its four buttons. Shared by `tableViewContribution`
100
+ (the shared top-left panel's lone toggle button) and `tableView.ts`'s
101
+ full overlay (whose toolbar has both the toggle and the download button).
102
+ */
103
+ export declare function bindTableViewButton(host: HTMLElement, viz: Viz): void;
104
+ /** Wires both the toolbar buttons and (when applicable) row virtualization for the full data-table overlay. */
105
+ export declare function bindTableViewOverlay(host: HTMLElement, viz: Viz): void;
106
+ /**
107
+ Reflects the current active state onto the shared top-left panel's
108
+ toggle button DOM directly — mirrors `syncBrushButton`. Needed because
109
+ toggling table view deliberately does NOT rebuild the shared panel (see
110
+ `refreshTableViewOverlay` in `tableView.ts`: `tableViewContribution`'s
111
+ html bakes in `isTableView(viz)` at the time THAT panel was last built,
112
+ which only happens on a full `_preDraw`/`_draw` pass). Without this, the
113
+ shared panel's copy of the button can go visibly stale: activate table
114
+ view, let any unrelated full re-render happen while still active (a
115
+ resize, a `.data()` call), then deactivate via the overlay's OWN
116
+ embedded copy of the button — the shared one, now uncovered again,
117
+ would otherwise still read "active" until the next full re-render.
118
+ */
119
+ export declare function syncSharedTableViewButton(viz: Viz): void;
@@ -0,0 +1,32 @@
1
+ /**
2
+ @name topLeftControlsFeature
3
+ Shared top-left corner control panel — mirrors the top-right
4
+ zoom-controls panel's "N buttons, one flex-row `htmlOverlay` panel"
5
+ composition (`zoomControls.ts`/`zoomControlsMarkup.ts`), except fed by
6
+ independent contributor functions (`backContribution`,
7
+ `tableViewContribution`, `searchContribution`) rather than one feature's
8
+ own fixed button set. A downstream branch adding a new top-left control
9
+ appends its own contributor function to `TOP_LEFT_CONTRIBUTORS` — a
10
+ one-line diff, not a dynamic registry.
11
+
12
+ Runs as a post-draw `FeatureModule` (see `runVizPipeline`), the same
13
+ slot as `zoomFeature`/`attributionFeature`: it claims zero margin and
14
+ floats over whatever the chart already rendered. Content that needs to
15
+ avoid it (title/subtitle/total/legend) insets around the whole panel via
16
+ `topLeftControlsInset` (`topLeftControlsMarkup.ts`), the same way they
17
+ already inset around the zoom panel via `zoomControlsInset`.
18
+
19
+ @module
20
+ */
21
+ import type { FeatureModule } from "../features/features.js";
22
+ import type Viz from "../viz/Viz.js";
23
+ import { type Contribution } from "./topLeftControlsMarkup.js";
24
+ export type { Contribution };
25
+ /**
26
+ Ordered list of contributors to the shared top-left panel. Order is
27
+ visual order (left to right).
28
+ */
29
+ export declare const TOP_LEFT_CONTRIBUTORS: Array<(viz: Viz) => Contribution | null>;
30
+ /** The current, non-null contributions for a chart — computed once per layout/measurement. */
31
+ export declare function getTopLeftContributions(viz: Viz): Contribution[];
32
+ export declare const topLeftControlsFeature: FeatureModule;
@@ -0,0 +1,72 @@
1
+ /**
2
+ Markup, styling, and measurement for the shared top-left controls panel —
3
+ the top-left mirror of `zoomControlsMarkup.ts`'s top-right zoom-control
4
+ panel. Kept separate from `topLeftControls.ts` (which owns the
5
+ `FeatureModule` + the contributor list) so this module has no dependency
6
+ on `../features/features.js` — `textBlockLayout`/`featuresLegend.ts`
7
+ import only from here, the same way they already import
8
+ `zoomControlsBox`/`zoomControlsInset` from `zoomControlsMarkup.ts` rather
9
+ than from `zoomControls.ts`.
10
+
11
+ @module
12
+ */
13
+ import type { SceneNode } from "@d3plus/render";
14
+ import type Viz from "../viz/Viz.js";
15
+ /**
16
+ One control's contribution to the shared panel: its markup, its
17
+ delegated event handlers (keyed by its own CSS selector, so independent
18
+ contributors never collide), and an optional `onUpdate` for listeners
19
+ that can't be delegated (mirrors `HtmlOverlayNode`'s own shape — see
20
+ `zoomControls.ts`'s `buildZoomControlPanel` for the pattern this panel
21
+ generalizes from one feature's four buttons to N independent features).
22
+ */
23
+ export interface Contribution {
24
+ key: string;
25
+ html: string;
26
+ /**
27
+ A cheap, non-DOM string capturing anything besides `html` that can
28
+ change this contribution's rendered size — its resolved button style
29
+ object, typically (`JSON.stringify(...)`, mirroring how
30
+ `zoomControlsBox` folds its own resolved style into its signature).
31
+ Without this, a style-only change (e.g. `.searchControlStyle({width:
32
+ '60px'})`) wouldn't invalidate the measurement cache below, since the
33
+ *markup* (`html`) wouldn't have changed. Optional: a contribution
34
+ whose rendered size never varies with config can omit it.
35
+ */
36
+ styleSignature?: string;
37
+ events?: Record<string, Partial<Record<string, (e: Event) => void>>>;
38
+ onUpdate?: (host: HTMLElement) => void;
39
+ }
40
+ /**
41
+ Builds the shared panel as a GROUP of independent `htmlOverlay` nodes,
42
+ one per contribution, rather than one node holding every contribution's
43
+ markup concatenated together. `@d3plus/render`'s overlay diff replaces
44
+ an `htmlOverlay` node's ENTIRE `innerHTML` whenever its `html` string
45
+ changes — with one shared node, back appearing (its own html changing)
46
+ would rewrite the whole panel's DOM, destroying and recreating search's
47
+ `<input>` along with it and silently dropping its focus/cursor position
48
+ mid-type. Separate nodes mean each contribution's DOM subtree is only
49
+ ever touched by ITS OWN html changing.
50
+ */
51
+ export declare function buildTopLeftPanel(viz: Viz, contributions: Contribution[]): SceneNode | null;
52
+ /**
53
+ The shared top-left panel's rendered size (padding included) as it will
54
+ render in the chart's page, so top-positioned content can leave room for
55
+ it — the same measure-a-hidden-probe technique `zoomControlsBox` uses,
56
+ generalized to whichever mix of controls (back / table-view / search)
57
+ is currently contributing, and to each contribution's OWN resolved
58
+ button styling (not just its markup). Returns null when nothing is
59
+ contributing.
60
+ */
61
+ export declare function topLeftControlsBox(viz: Viz, contributions: Contribution[]): {
62
+ width: number;
63
+ height: number;
64
+ } | null;
65
+ /**
66
+ How far content starting `top` px down the chart, whose left edge sits
67
+ `left` px in from the chart's left edge, must pull in its left edge to
68
+ clear the top-left controls panel. Zero when nothing is showing there or
69
+ content starts below the panel's height. Mirrors `zoomControlsInset`,
70
+ measuring/insetting from the left instead of the right.
71
+ */
72
+ export declare function topLeftControlsInset(viz: Viz, top: number, left: number, contributions: Contribution[]): number;
@@ -1,4 +1,6 @@
1
+ import type { ZoomTransform } from "d3-zoom";
1
2
  import type { FeatureModule } from "../features/features.js";
3
+ import type Viz from "../viz/Viz.js";
2
4
  /**
3
5
  @name zoomFeature
4
6
  Sets up zoom + brush event behaviors and the zoom-control buttons.
@@ -15,13 +17,51 @@ import type { FeatureModule } from "../features/features.js";
15
17
  the SVG element directly via `viz._container.call(zoomBehavior)`.
16
18
  2. Returns the four control buttons (in/out/reset/brush) as an
17
19
  `htmlOverlay` scene-node panel; `runVizPipeline` appends it to
18
- `viz._featurePanels`. `onMount` is
19
- the scene's interactive-HTML escape hook: it wires the click/hover
20
- handlers + applies the user's zoomControl style configs. `onMount`
21
- fires ONCE per host element (after innerHTML is written, so the
22
- `.zoom-in` / `.zoom-out` querySelectors below resolve), not per
23
- draw — the html string is constant, so listeners attached here
24
- survive every subsequent draw (renderers only rewrite innerHTML
25
- when it differs from the current value).
20
+ `viz._featurePanels`. `onUpdate` is the scene's interactive-HTML
21
+ escape hook: it wires the hover handlers + applies the user's
22
+ zoomControl style configs, once per button DOM node (guarded by a
23
+ `data-zoom-bound` marker). Click handling instead rides the
24
+ declarative `events` map, which the renderer delegates from the
25
+ host element, so it survives DOM churn with no extra bookkeeping.
26
+ `onUpdate` (rather than `onMount`) matters because the html string
27
+ below isn't a fixed constant — it bakes in `zoomControlClassName`,
28
+ the active locale's translated `aria-label`s, and the current brush
29
+ state, so a `.locale(...)` or `.zoomControlClassName(...)` call
30
+ replaces the button nodes on the next draw. Renderers only rewrite
31
+ `innerHTML` when the string actually differs from the last-written
32
+ value, so the common case (nothing changed) is a cheap no-op.
26
33
  */
27
34
  export declare const zoomFeature: FeatureModule;
35
+ /**
36
+ Canvas backend: once the scene is painted (so the <canvas> exists), bind
37
+ d3-zoom to it. The compute <svg> overlaying the canvas is transparent to
38
+ pointer events there, so the canvas is the sole interaction surface —
39
+ CanvasRenderer's pick drives tooltips and d3-zoom drives pan/zoom on the
40
+ same element. Called after every canvas paint; a no-op once bound.
41
+ */
42
+ export declare function bindCanvasZoom(viz: Viz): void;
43
+ /**
44
+ Routes pointer events between the chart surface and the zoom brush.
45
+ While brush mode is on, the outer <svg> goes transparent to pointer
46
+ events and only the brush group opts back in, so a drag anywhere over the
47
+ chart (shapes included) reaches the brush rather than a shape. On the
48
+ Canvas backend the compute <svg> stays transparent otherwise, so the
49
+ <canvas> beneath is the interaction surface.
50
+ */
51
+ export declare function applyZoomPointerEvents(viz: Viz): void;
52
+ /**
53
+ The current zoom transform re-expressed for content inside `_container`,
54
+ which sits at the chart's margin offset rather than at the surface origin
55
+ the zoom behavior measures from (Geomap's imperative tile layer).
56
+ */
57
+ export declare function tileZoomTransform(viz: Viz): ZoomTransform;
58
+ /**
59
+ Applies a programmatic zoom: clamps the scale to `scaleExtent` and the
60
+ translate to `translateExtent` (the constraint d3-zoom enforces for
61
+ pointer gestures), records it as the bound element's zoom state so the
62
+ next wheel/drag continues from here, and paints it.
63
+
64
+ Exported so `minimap.ts`'s drag-to-pan and Cmd/Ctrl+scroll-to-zoom can
65
+ reuse the same scale/translate clamping instead of reimplementing it.
66
+ */
67
+ export declare function zoomTo(viz: Viz, scale: number, x: number, y: number, duration?: number): void;
@@ -0,0 +1,138 @@
1
+ /**
2
+ Markup, styling, and measurement for the zoom-control button panel —
3
+ shared by the zoom feature (which renders and wires the panel) and the
4
+ top-positioned layout features (title, subtitle, total, legend), which
5
+ measure the panel so their content can leave room for it.
6
+
7
+ @module
8
+ */
9
+ import type Viz from "../viz/Viz.js";
10
+ import { kebab } from "./controlButtonStyle.js";
11
+ export { kebab };
12
+ /**
13
+ Brush mode is per-chart, not global: it lives on `viz._brushing` and is
14
+ read/written via these helpers.
15
+ */
16
+ export declare function isBrushing(viz: Viz): boolean;
17
+ export declare function setBrushing(viz: Viz, value: boolean): void;
18
+ /** Paints a zoom-control button's inline style for its current state (base/hover/active) — see `paintControlButton`. */
19
+ export declare function paintZoomButton(viz: Viz, btn: HTMLElement, hovered?: boolean): void;
20
+ /**
21
+ Shared attributes for the four icon `<svg>`s below: one `viewBox`, one
22
+ `stroke-width`, `currentColor` for the stroke (so the icon still follows
23
+ `color` from `zoomControlStyle`/a host page's CSS, same as the glyph
24
+ characters this replaced). Sizing and `vertical-align: middle` live in
25
+ the `style` attribute rather than as `width`/`height` SVG attributes —
26
+ plenty of CSS resets (Bulma's base stylesheet, for one) include a plain
27
+ `svg { width: auto; height: auto }` rule, and *any* CSS declaration beats
28
+ a presentation attribute. An SVG with only a `viewBox` and no definite
29
+ CSS size can collapse to 0×0 inside a flex layout, which is exactly what
30
+ happened here — an inline `style` has enough specificity that no host
31
+ page's element-selector reset can strip it back out. `vertical-align:
32
+ middle` matters because an inline `svg` defaults to `vertical-align:
33
+ baseline` like text, which sits it a couple pixels off-center inside a
34
+ host page's own button styling (Bootstrap/Tailwind/Bulma center *text*
35
+ via their own line-height/padding, not a replaced element's baseline).
36
+ `zoomControlClassName` intentionally drops our own `align-items`/
37
+ `justify-content` centering so it doesn't fight a framework's layout —
38
+ `vertical-align: middle` is what keeps the icon itself centered
39
+ regardless of whose CSS is doing the centering. `flex-shrink: 0` guards
40
+ against a different failure mode: if a host framework's own button
41
+ (Bulma's `.button`, for one) is itself `display: flex` with padding wide
42
+ enough to leave less than 12px of content room, the icon — a flex item
43
+ of that button — would otherwise shrink to fit, quietly distorting it
44
+ into a non-square sliver instead of keeping its aspect ratio.
45
+
46
+ Text-glyph icons (`+`, `−`, a Unicode home/square symbol, …) come from
47
+ different font fallback chains, and browsers apply synthetic bold to
48
+ each inconsistently — no single font reliably bolds all of them to the
49
+ same visual stroke thickness across OSes. Vector paths sidestep that
50
+ entirely: every icon renders at the exact same stroke weight regardless
51
+ of the visitor's font/OS/browser (and all four share the same 4–20
52
+ bounding box within the 24x24 viewBox, so they also match in apparent
53
+ size) — this is how icon sets like Feather/Lucide/Material Symbols do it.
54
+ */
55
+ export declare const ICON_ATTRS = "viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"width:12px;height:12px;vertical-align:middle;flex-shrink:0\"";
56
+ /**
57
+ A custom zoom-control icon: either raw markup (a string — inserted as the
58
+ button's content in place of the built-in `<svg>`, no wrapper) or a mount
59
+ function, the escape hatch for a live component (a React/Vue/Svelte tree,
60
+ a canvas sprite, anything imperative). The function receives the actual
61
+ `<span>` reserved for the icon — sized to match the built-ins, 12x12px —
62
+ once per fresh button element (see `mountCustomIcons` below), and may
63
+ return a cleanup function, called right before that element is discarded
64
+ (the panel's html regenerates wholesale on a brush toggle, a `.locale(...)`
65
+ change, or a `zoomControlClassName` change — see `zoomControlsHtml`'s own
66
+ doc — so a mounted icon is torn down and remounted on those, not just once
67
+ per chart). Omit the return value for icons with nothing to clean up.
68
+
69
+ @example
70
+ // Raw markup — a single emoji.
71
+ viz.zoomControlIcons({zoomIn: "➕"})
72
+
73
+ // A React tree, mounted imperatively into the reserved slot.
74
+ viz.zoomControlIcons({
75
+ zoomIn: el => {
76
+ const root = createRoot(el);
77
+ root.render(<PlusIcon />);
78
+ return () => root.unmount();
79
+ },
80
+ })
81
+ */
82
+ export type ZoomControlIconRenderer = (el: HTMLElement) => void | (() => void);
83
+ export type ZoomControlIconValue = string | ZoomControlIconRenderer;
84
+ export type ZoomControlIconKey = "zoomIn" | "zoomOut" | "zoomReset" | "zoomBrush";
85
+ export type ZoomControlIcons = Partial<Record<ZoomControlIconKey, ZoomControlIconValue>>;
86
+ /**
87
+ The panel's own layout: a right-aligned flex row. Spacing lives here, not
88
+ on the buttons — per-button `margin` doesn't collapse between flex
89
+ siblings, so two adjacent 4px margins would add up to an 8px gap. A
90
+ container `gap` gives exactly one 4px gap between each pair, and
91
+ `padding` (with `box-sizing: border-box`) one 4px inset from the chart's
92
+ top/right edge. This isn't part of the auto-disable `zoomControlClassName`
93
+ triggers, so a host page never has to re-add its own spacing utility.
94
+ */
95
+ export declare const ZOOM_PANEL_STYLE: Record<string, string>;
96
+ /**
97
+ The four buttons' markup. Real <button>s (not <div>s) so a host page's own
98
+ button styling (Tailwind, Bootstrap, a design system's global `button`
99
+ reset) applies through the cascade once a `zoomControlClassName`
100
+ auto-disables the inline defaults. `zoomControlClassName` layers a
101
+ consumer's own class onto each button without losing the fixed classes
102
+ event delegation depends on. The brush toggle carries `aria-pressed` (and
103
+ the `.active` class frameworks like Bootstrap style) while brush mode is on.
104
+ */
105
+ export declare function zoomControlsHtml(viz: Viz): string;
106
+ /**
107
+ Mounts each configured custom icon function into its button's reserved
108
+ slot — called once per fresh button element (from the same `onUpdate`
109
+ guard in `zoomControls.ts` that binds hover/style exactly once), so a
110
+ remount only happens when the whole panel's html actually regenerates
111
+ (see `ZoomControlIconRenderer`'s doc for when that is). Runs any PREVIOUS
112
+ mount's cleanup for that icon key first — the prior button element (if
113
+ any) is about to be discarded regardless of whether its content was
114
+ custom-mounted, so this is the one place that teardown can happen.
115
+ */
116
+ export declare function mountCustomIcons(viz: Viz, btn: HTMLElement): void;
117
+ /** The HTML element a chart's overlays (the zoom controls) mount in. */
118
+ export declare function overlayHost(viz: Viz): HTMLElement | null;
119
+ /**
120
+ Reflects the brush mode onto the brush toggle button (its `.active`
121
+ class, `aria-pressed`, and active style) when the mode changes without
122
+ a click on the button itself — e.g. leaving brush mode after a selection.
123
+ */
124
+ export declare function syncBrushButton(viz: Viz): void;
125
+ /** Whether a chart shows the zoom-control panel. */
126
+ export declare function showsZoomControls(viz: Viz): boolean;
127
+ /**
128
+ The zoom-control panel's size (padding included) as it will render in the
129
+ chart's page, so top-positioned content can leave room for it. Measured
130
+ by mounting a hidden copy beside the chart — the buttons' size depends on
131
+ the host page's CSS (a `zoomControlClassName`, a global `button` reset) —
132
+ and cached until the markup or styling changes. Returns null when the
133
+ chart shows no controls.
134
+ */
135
+ export declare function zoomControlsBox(viz: Viz): {
136
+ width: number;
137
+ height: number;
138
+ } | null;
@@ -0,0 +1,21 @@
1
+ /**
2
+ The tile/data credit, an HTML overlay in the chart area's bottom-right
3
+ corner. It sits outside the SVG plane, so rather than encode it into the
4
+ scene graph this feature creates it imperatively from inside `layout()`
5
+ (funneled through `runLayout` like the other features); it claims zero
6
+ margin and emits no panel.
7
+
8
+ A credit that would take up more than half the chart's width collapses to
9
+ an ⓘ badge that expands on hover, focus, or click — the compact
10
+ attribution modern web maps use — so a long required credit (Esri's
11
+ basemap credit, for one) doesn't lay a banner across a small map.
12
+
13
+ The badge is an inline SVG by default; `attributionIcon` overrides it with
14
+ raw HTML or a mount function (a live component escape hatch — see its doc
15
+ and `zoomControlsMarkup.ts`'s matching `zoomControlIcons`, which this
16
+ mirrors).
17
+
18
+ @module
19
+ */
20
+ import type { FeatureModule } from "./features.js";
21
+ export declare const attributionFeature: FeatureModule;
@@ -130,5 +130,5 @@ export declare function measureAxes(viz: Viz, inputs: AxisMeasureInputs, measure
130
130
  bumps the line labels, and queues axis scenes for the emit phase.
131
131
  Returns everything `plotEmit` needs to consume.
132
132
  */
133
- export declare function renderAxes(viz: Viz, pCtx: PlotPaintContext): PlotMeasureResult;
133
+ export declare function renderAxes(viz: Viz, pCtx: PlotPaintContext, frozen?: PlotMeasureResult): PlotMeasureResult;
134
134
  export {};
@@ -16,7 +16,7 @@
16
16
 
17
17
  @module
18
18
  */
19
- import type { Transform } from "@d3plus/render";
19
+ import type { ClipShape, Transform } from "@d3plus/render";
20
20
  import type { VizInstance as Viz } from "../viz/vizTypes.js";
21
21
  /**
22
22
  Margin-adjusted chart-area dimensions. Replaces the pattern:
@@ -48,11 +48,17 @@ export declare function marginOriginTransform(viz: Viz): Transform;
48
48
  y: this._margin.top + height / 2,
49
49
  };
50
50
 
51
- Used by Pie, Donut, RadialMatrix, Radar — every chart whose data
52
- lays out around a center point (polar / circular geometry).
51
+ Used by Pie, Donut, RadialMatrix, Radar, Chord — every chart whose
52
+ data lays out around a center point (polar / circular geometry).
53
53
 
54
54
  Width and height are the margin-adjusted chart-area dimensions —
55
55
  callers usually have them on hand from `chartBounds(viz)` or from
56
56
  fields a stage stashed (e.g. `_pieWidth` / `_radialMatrixWidth`).
57
57
  */
58
58
  export declare function centerChartTransform(viz: Viz, width: number, height: number): Transform;
59
+ /**
60
+ The chart area (the svg minus its margins) as a scene-space rect clip —
61
+ where zoomable content is clipped so pan/zoom can't spill it over the
62
+ legend, title, or timeline.
63
+ */
64
+ export declare function chartAreaRect(viz: Viz): ClipShape;