@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,430 @@
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
+ */ function _array_like_to_array(arr, len) {
14
+ if (len == null || len > arr.length) len = arr.length;
15
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
16
+ return arr2;
17
+ }
18
+ function _array_with_holes(arr) {
19
+ if (Array.isArray(arr)) return arr;
20
+ }
21
+ function _define_property(obj, key, value) {
22
+ if (key in obj) {
23
+ Object.defineProperty(obj, key, {
24
+ value: value,
25
+ enumerable: true,
26
+ configurable: true,
27
+ writable: true
28
+ });
29
+ } else {
30
+ obj[key] = value;
31
+ }
32
+ return obj;
33
+ }
34
+ function _iterable_to_array_limit(arr, i) {
35
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
36
+ if (_i == null) return;
37
+ var _arr = [];
38
+ var _n = true;
39
+ var _d = false;
40
+ var _s, _e;
41
+ try {
42
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
43
+ _arr.push(_s.value);
44
+ if (i && _arr.length === i) break;
45
+ }
46
+ } catch (err) {
47
+ _d = true;
48
+ _e = err;
49
+ } finally{
50
+ try {
51
+ if (!_n && _i["return"] != null) _i["return"]();
52
+ } finally{
53
+ if (_d) throw _e;
54
+ }
55
+ }
56
+ return _arr;
57
+ }
58
+ function _non_iterable_rest() {
59
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
60
+ }
61
+ function _object_spread(target) {
62
+ for(var i = 1; i < arguments.length; i++){
63
+ var source = arguments[i] != null ? arguments[i] : {};
64
+ var ownKeys = Object.keys(source);
65
+ if (typeof Object.getOwnPropertySymbols === "function") {
66
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
67
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
68
+ }));
69
+ }
70
+ ownKeys.forEach(function(key) {
71
+ _define_property(target, key, source[key]);
72
+ });
73
+ }
74
+ return target;
75
+ }
76
+ function ownKeys(object, enumerableOnly) {
77
+ var keys = Object.keys(object);
78
+ if (Object.getOwnPropertySymbols) {
79
+ var symbols = Object.getOwnPropertySymbols(object);
80
+ if (enumerableOnly) {
81
+ symbols = symbols.filter(function(sym) {
82
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
83
+ });
84
+ }
85
+ keys.push.apply(keys, symbols);
86
+ }
87
+ return keys;
88
+ }
89
+ function _object_spread_props(target, source) {
90
+ source = source != null ? source : {};
91
+ if (Object.getOwnPropertyDescriptors) {
92
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
93
+ } else {
94
+ ownKeys(Object(source)).forEach(function(key) {
95
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
96
+ });
97
+ }
98
+ return target;
99
+ }
100
+ function _sliced_to_array(arr, i) {
101
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
102
+ }
103
+ function _unsupported_iterable_to_array(o, minLen) {
104
+ if (!o) return;
105
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
106
+ var n = Object.prototype.toString.call(o).slice(8, -1);
107
+ if (n === "Object" && o.constructor) n = o.constructor.name;
108
+ if (n === "Map" || n === "Set") return Array.from(n);
109
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
110
+ }
111
+ import { fontFamily, fontFamilyStringify } from "@d3plus/text";
112
+ import { ICON_ATTRS, kebab } from "./zoomControlsMarkup.js";
113
+ import { paintControlButton, resolveControlStyle } from "./controlButtonStyle.js";
114
+ import { searchControlStyleActiveDefault, searchControlStyleDefault, searchControlStyleHoverDefault } from "../viz/vizDefaults.js";
115
+ /** Search-open state is per-chart, read/written via `viz._searchOpen`. */ export function isSearchOpen(viz) {
116
+ return Boolean(viz._searchOpen);
117
+ }
118
+ /** The resolved base / active / hover button styles for a chart — also the cheap, non-DOM basis for `searchContribution`'s `styleSignature` (see `Contribution.styleSignature`). */ export function searchButtonStyles(viz) {
119
+ var className = Boolean(viz.schema.searchControlClassName);
120
+ return {
121
+ base: resolveControlStyle(viz.schema.searchControlStyle, searchControlStyleDefault, className),
122
+ active: resolveControlStyle(viz.schema.searchControlStyleActive, searchControlStyleActiveDefault, className),
123
+ hover: resolveControlStyle(viz.schema.searchControlStyleHover, searchControlStyleHoverDefault, className)
124
+ };
125
+ }
126
+ /** Paints the search toggle button's inline style for its current state. Mirrors `paintZoomButton`. */ export function paintSearchButton(viz, btn) {
127
+ var hovered = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
128
+ paintControlButton(btn, searchButtonStyles(viz), hovered, btn.classList.contains("active"));
129
+ }
130
+ // A magnifying glass: a circle + a short diagonal handle. Nudged 1 unit
131
+ // above the viewBox's true mathematical center (cy 10 → 9, the handle
132
+ // shifted to match) — the ring's hollow center reads as lighter than the
133
+ // handle's solid diagonal stroke, so a perfectly math-centered glass looks
134
+ // optically low next to a symmetric icon like the back arrow's, even
135
+ // though both render in pixel-identical boxes.
136
+ var SEARCH_ICON = "<svg ".concat(ICON_ATTRS, '><circle cx="10" cy="9" r="7"/><line x1="21" y1="20" x2="15" y2="14"/></svg>');
137
+ // An X: two crossed diagonals, for the clear button.
138
+ var CLEAR_ICON = "<svg ".concat(ICON_ATTRS, '><line x1="6" y1="6" x2="18" y2="18"/><line x1="18" y1="6" x2="6" y2="18"/></svg>');
139
+ /**
140
+ The input's inline style at rest (closed) vs. open — set directly by the
141
+ toggle click handler, never regenerated mid-typing. Open's right padding
142
+ reserves room for the clear button, which sits absolutely-positioned
143
+ INSIDE the input's own box (see `SEARCH_CLEAR_STYLE_SHOWN`) rather than
144
+ beside it, so typed text wraps short of it instead of running underneath.
145
+ */ export var SEARCH_INPUT_STYLE_CLOSED = {
146
+ width: "0",
147
+ padding: "0",
148
+ border: "none",
149
+ opacity: "0",
150
+ "pointer-events": "none"
151
+ };
152
+ export var SEARCH_INPUT_STYLE_OPEN = {
153
+ width: "120px",
154
+ padding: "0 22px 0 6px",
155
+ border: "1px solid #ccc",
156
+ "border-radius": "3px",
157
+ opacity: "1",
158
+ "pointer-events": "auto"
159
+ };
160
+ var SEARCH_INPUT_BASE_STYLE = {
161
+ height: "20px",
162
+ "box-sizing": "border-box",
163
+ // `inherit` picked up whatever font-size the host page's body/chart
164
+ // container happened to set — often much larger than this 20px-tall
165
+ // control was designed for. An explicit size matches the rest of the
166
+ // panel (back/zoom's own buttons) regardless of the host page's CSS.
167
+ font: "12px/1 ".concat(fontFamilyStringify(fontFamily)),
168
+ transition: "width 0.15s ease, opacity 0.15s ease"
169
+ };
170
+ /**
171
+ The wrapper `.search-input-wrap` is the positioning context for both the
172
+ clear button (absolute, inside the input's own box) and the match-count
173
+ feedback (absolute, below it) — an `inline-block` with no explicit width
174
+ of its own, so it always shrink-wraps to the input's CURRENT width
175
+ (0 closed, 120px open) and the count box (`width: 100%`) automatically
176
+ matches it.
177
+ */ export var SEARCH_INPUT_WRAP_STYLE = {
178
+ position: "relative",
179
+ display: "inline-block"
180
+ };
181
+ /**
182
+ The root wrapper tying the toggle button and `.search-input-wrap` span
183
+ together. Without it, the two sit as bare inline siblings and align by
184
+ CSS's default inline baseline rule — which, since a `<button>` and an
185
+ `<input>` differ in their UA-default box model (borders/padding under
186
+ `content-box` vs. this module's explicit `border-box` on the input),
187
+ doesn't actually land their content on the same visual center. `flex` +
188
+ `align-items: center` centers both on their shared cross-axis instead,
189
+ regardless of that box-model mismatch.
190
+ */ var SEARCH_ROOT_STYLE = {
191
+ display: "inline-flex",
192
+ "align-items": "center"
193
+ };
194
+ // The clear button and match-count feedback only ever show once there's a
195
+ // term — both are toggled by the same `hasTerm` condition, at generation
196
+ // time (`searchControlsHtml`) and imperatively while typing (`searchControls.ts`).
197
+ // The hidden state uses `visibility: hidden`, not `display: none`, for the
198
+ // clear button: it keeps its layout space reserved (matching the input's
199
+ // permanent right padding) even while empty. The count box doesn't need
200
+ // that — it's absolutely positioned below the input, so it never affects
201
+ // the panel's own width/height either way.
202
+ var SEARCH_CLEAR_STYLE_SHOWN = {
203
+ position: "absolute",
204
+ top: "50%",
205
+ right: "2px",
206
+ transform: "translateY(-50%)",
207
+ display: "inline-flex",
208
+ "align-items": "center",
209
+ "justify-content": "center",
210
+ visibility: "visible",
211
+ width: "16px",
212
+ height: "16px",
213
+ padding: "0",
214
+ border: "none",
215
+ background: "none",
216
+ cursor: "pointer"
217
+ };
218
+ var SEARCH_CLEAR_STYLE_HIDDEN = _object_spread_props(_object_spread({}, SEARCH_CLEAR_STYLE_SHOWN), {
219
+ visibility: "hidden",
220
+ cursor: "default"
221
+ });
222
+ /**
223
+ The match-count feedback sits directly below the input, at its same
224
+ width, styled like the attribution box (`vizDefaults.ts`'s
225
+ `attributionStyle` default) — a translucent white pill overlaying
226
+ whatever chart content is beneath it. `pointer-events: none` so it never
227
+ intercepts a click meant for the chart.
228
+ */ var SEARCH_COUNT_STYLE_SHOWN = {
229
+ position: "absolute",
230
+ top: "100%",
231
+ left: "0",
232
+ "margin-top": "4px",
233
+ width: "100%",
234
+ "box-sizing": "border-box",
235
+ display: "block",
236
+ visibility: "visible",
237
+ background: "rgba(255, 255, 255, 0.75)",
238
+ border: "1px solid rgba(0, 0, 0, 0.25)",
239
+ color: "rgba(0, 0, 0, 0.75)",
240
+ "font-size": "11px",
241
+ "text-align": "center",
242
+ padding: "2px 4px",
243
+ "white-space": "nowrap",
244
+ overflow: "hidden",
245
+ "text-overflow": "ellipsis",
246
+ "pointer-events": "none"
247
+ };
248
+ var SEARCH_COUNT_STYLE_HIDDEN = _object_spread_props(_object_spread({}, SEARCH_COUNT_STYLE_SHOWN), {
249
+ visibility: "hidden"
250
+ });
251
+ function styleAttr(style) {
252
+ return Object.entries(style).map(function(param) {
253
+ var _param = _sliced_to_array(param, 2), k = _param[0], v = _param[1];
254
+ return "".concat(kebab(k), ":").concat(v);
255
+ }).join(";");
256
+ }
257
+ /** Applies the open/closed inline style directly to the input DOM node — no panel rebuild, so focus/cursor survive. */ export function applySearchInputOpenState(input, open) {
258
+ var style = open ? SEARCH_INPUT_STYLE_OPEN : SEARCH_INPUT_STYLE_CLOSED;
259
+ for(var key in style)input.style.setProperty(kebab(key), style[key]);
260
+ }
261
+ /** Shows/hides the clear button, directly on the DOM node — same no-rebuild pattern as the input's open state. */ export function applySearchClearVisible(btn, visible) {
262
+ var style = visible ? SEARCH_CLEAR_STYLE_SHOWN : SEARCH_CLEAR_STYLE_HIDDEN;
263
+ for(var key in style)btn.style.setProperty(kebab(key), style[key]);
264
+ btn.tabIndex = visible ? 0 : -1;
265
+ }
266
+ /** 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). */ export function applySearchCount(viz, el, hasTerm, index, total) {
267
+ var style = hasTerm ? SEARCH_COUNT_STYLE_SHOWN : SEARCH_COUNT_STYLE_HIDDEN;
268
+ for(var key in style)el.style.setProperty(kebab(key), style[key]);
269
+ var _formatMatchCount = formatMatchCount(viz, index, total), text = _formatMatchCount.text, label = _formatMatchCount.label;
270
+ el.textContent = hasTerm ? text : "";
271
+ el.setAttribute("aria-label", label);
272
+ }
273
+ /** Escapes a value for safe interpolation into `innerHTML`. */ function escapeHtml(value) {
274
+ return String(value !== null && value !== void 0 ? value : "").replace(/[&<>"']/g, function(c) {
275
+ return ({
276
+ "&": "&amp;",
277
+ "<": "&lt;",
278
+ ">": "&gt;",
279
+ '"': "&quot;",
280
+ "'": "&#39;"
281
+ })[c];
282
+ });
283
+ }
284
+ /**
285
+ The search control's markup: a toggle `<button>`, an `<input>`, a clear
286
+ (×) button, and a match-count span — all real elements so host-page
287
+ button/input styling applies through the cascade the same way zoom's
288
+ buttons do. Term/open state is baked in from `viz._searchTerm`/
289
+ `_searchOpen` so a full re-render (e.g. a resize or data change)
290
+ preserves whatever the user was doing — typing itself never regenerates
291
+ this markup (see `searchControls.ts`).
292
+
293
+ The count span is left EMPTY here on purpose — its text is written by
294
+ `searchContribution`'s `onUpdate` instead (see there), not baked into
295
+ this string. `onUpdate` runs on every draw regardless of whether this
296
+ html string changed, while the match count itself depends on the
297
+ CHART's data/scene, not on the search box's own state — baking its text
298
+ in here would make this contribution's own html change (and its DOM,
299
+ including the live `<input>`, get torn down and rebuilt) every time the
300
+ chart's data changes for a reason that has nothing to do with search,
301
+ e.g. drilling down while the box is open and focused.
302
+ */ export function searchControlsHtml(viz) {
303
+ var extraClass = viz.schema.searchControlClassName ? " ".concat(viz.schema.searchControlClassName) : "";
304
+ var label = viz.schema.translate("Search");
305
+ var open = isSearchOpen(viz);
306
+ var term = viz._searchTerm || "";
307
+ var hasTerm = term.trim().length > 0;
308
+ var inputStyle = styleAttr(_object_spread({}, SEARCH_INPUT_BASE_STYLE, open ? SEARCH_INPUT_STYLE_OPEN : SEARCH_INPUT_STYLE_CLOSED));
309
+ var clearStyle = styleAttr(hasTerm ? SEARCH_CLEAR_STYLE_SHOWN : SEARCH_CLEAR_STYLE_HIDDEN);
310
+ var wrapStyle = styleAttr(SEARCH_INPUT_WRAP_STYLE);
311
+ var rootStyle = styleAttr(SEARCH_ROOT_STYLE);
312
+ return '<span class="search-root" style="'.concat(rootStyle, '">') + '<button type="button" class="search-control search-toggle'.concat(open ? " active" : "").concat(extraClass, '" aria-label="').concat(label, '" aria-pressed="').concat(open, '">').concat(SEARCH_ICON, "</button>") + '<span class="search-input-wrap" style="'.concat(wrapStyle, '">') + '<input type="text" class="search-control search-input" placeholder="'.concat(label, '" aria-label="').concat(label, '" value="').concat(escapeHtml(term), '" style="').concat(inputStyle, '"').concat(open ? "" : " tabindex=\"-1\"", "/>") + '<button type="button" class="search-control search-clear" aria-label="'.concat(viz.schema.translate("Clear"), '" style="').concat(clearStyle, '"').concat(hasTerm ? "" : " tabindex=\"-1\"", ">").concat(CLEAR_ICON, "</button>") + '<span class="search-count" aria-live="polite"></span>' + "</span>" + "</span>";
313
+ }
314
+ /**
315
+ Whether `d` (row at index `i`) matches the (already-lowercased,
316
+ already-trimmed) search `needle` — checked against
317
+ `viz.schema.searchAccessor`'s resolved string, OR any level of `d`'s
318
+ groupBy hierarchy (`viz._ids(d, i)`, one id string per groupBy field).
319
+
320
+ The hierarchy check is what makes a match reach across drawn depth: a
321
+ grouped chart's aggregate row (a Treemap's un-drilled parent cell, or a
322
+ legend entry) is built by merging every leaf row it summarizes
323
+ (`merge`/`objectMerge` in `@d3plus/data`), and a merged field that
324
+ varies across those leaves survives as an ARRAY of every value seen —
325
+ so an aggregate "Group 2" row's OWN `_ids()` output still contains
326
+ "Fig" (search "Fig", match "Group 2"'s cell/legend entry) even though
327
+ its rendered label is just "Group 2". The reverse direction needs no
328
+ special-casing: a LEAF row's `_ids()` includes its ancestor's own
329
+ (unmerged) id directly, so searching "Group 2" matches every one of its
330
+ leaves too. Non-hierarchical charts (a single-field `groupBy`) degrade
331
+ to exactly today's behavior — `_ids()` is a 1-element array equal to
332
+ the accessor's own value.
333
+
334
+ A custom `.searchAccessor()` isn't guaranteed to return a string for
335
+ every row shape this runs against (the legend's own merged-aggregate
336
+ rows differ in shape from a chart mark's row) — guard rather than let a
337
+ non-string (commonly `undefined`) throw on `.toLowerCase()`.
338
+ */ function matchesSearchNeedle(viz, d, i, needle) {
339
+ var value = viz.schema.searchAccessor(d, i);
340
+ if (typeof value === "string" && value.toLowerCase().includes(needle)) return true;
341
+ var ids = viz._ids(d, i);
342
+ return ids.some(function(id) {
343
+ return typeof id === "string" && id.toLowerCase().includes(needle);
344
+ });
345
+ }
346
+ /**
347
+ Builds the predicate `.highlight()` drives from the current search term
348
+ — see `matchesSearchNeedle` for the match rule. Empty term restores
349
+ whatever `.highlight()` predicate (if any) was active before the search
350
+ box opened.
351
+ */ export function searchHighlightPredicate(viz, term) {
352
+ var _viz__searchPrevHighlight;
353
+ var needle = term.trim().toLowerCase();
354
+ if (!needle) return (_viz__searchPrevHighlight = viz._searchPrevHighlight) !== null && _viz__searchPrevHighlight !== void 0 ? _viz__searchPrevHighlight : false;
355
+ return function(d, i) {
356
+ return matchesSearchNeedle(viz, d, i, needle);
357
+ };
358
+ }
359
+ /** Scene mark types a match is searched against — mirrors `interactionOpacity.ts`'s own `MARK_TYPES`. */ var MARK_TYPES = new Set([
360
+ "rect",
361
+ "circle",
362
+ "line",
363
+ "area",
364
+ "path"
365
+ ]);
366
+ /**
367
+ Every currently-rendered mark matching the given term, in scene order.
368
+ Walks `viz._chartScene` (the actual painted scene, post-layout) rather
369
+ than the raw data array, unwrapping each node's datum the same way
370
+ `applyInteractionOpacity` does, so a grouped/aggregated chart matches by
371
+ rendered mark, not by raw input row — and de-dupes by datum reference so
372
+ a mark's separate label node doesn't double-count it. An empty term
373
+ matches nothing (there's no "everything" state to jump through).
374
+ */ export function searchMatches(viz, term) {
375
+ var needle = term.trim().toLowerCase();
376
+ if (!needle) return [];
377
+ var nodes = viz._chartScene || [];
378
+ var seen = new Set();
379
+ var results = [];
380
+ var walk = function walk1(node) {
381
+ if (MARK_TYPES.has(node.type) && node.datum !== undefined) {
382
+ var raw = node.datum;
383
+ var row = raw && raw.data ? raw.data : raw;
384
+ if (row !== undefined && !seen.has(row)) {
385
+ seen.add(row);
386
+ // Mirrors applyInteractionOpacity's own fallback order exactly
387
+ // (interactionOpacity.ts) — node.index, then the row's own `.i`,
388
+ // then 0 — so the index a custom searchAccessor sees here always
389
+ // matches the index the highlight predicate was evaluated with,
390
+ // and Enter/Shift+Enter never jumps to a different mark than the
391
+ // one that's actually highlighted.
392
+ var i = typeof node.index === "number" ? node.index : typeof row.i === "number" ? row.i : 0;
393
+ if (matchesSearchNeedle(viz, row, i, needle)) results.push({
394
+ node: node,
395
+ row: row,
396
+ index: i
397
+ });
398
+ }
399
+ }
400
+ var kids = node.children;
401
+ if (kids) kids.forEach(walk);
402
+ };
403
+ nodes.forEach(walk);
404
+ return results;
405
+ }
406
+ /**
407
+ Formats the match-count feedback as a readable, localized phrase:
408
+ "No Matches" with nothing found, "6 Matches"/"1 Match" once there's a
409
+ count but the user hasn't stepped to one yet (Enter/Shift+Enter), and
410
+ "Match 2/6" once they have — the translated noun for context, plus a
411
+ compact numeric position rather than a translated "of" connector, since
412
+ a fixed English word order ("Match 2 of 6") wouldn't read naturally in
413
+ every locale, while a number pair after a noun does. `index` is 0-based
414
+ (`viz._searchMatchIndex`); `total` is `searchMatches(...).length`. Text
415
+ and label are the same string — both visible and accessible.
416
+ */ export function formatMatchCount(viz, index, total) {
417
+ var text;
418
+ if (total === 0) text = viz.schema.translate("No Matches");
419
+ else if (typeof index !== "number") text = "".concat(total, " ").concat(viz.schema.translate(total === 1 ? "Match" : "Matches"));
420
+ else text = "".concat(viz.schema.translate("Match"), " ").concat(index + 1, "/").concat(total);
421
+ return {
422
+ text: text,
423
+ label: text
424
+ };
425
+ }
426
+ /** Whether a chart shows the search control. */ export function showsSearchControls(viz) {
427
+ return Boolean(viz.schema.search) && !viz._ssr;
428
+ }
429
+
430
+ //# sourceMappingURL=searchControlsMarkup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/charts/drawSteps/searchControlsMarkup.ts"],"sourcesContent":["/**\n Markup, styling, and event handlers for the search control (a toggle\n button + an expanding text input) — the top-left counterpart to the\n zoom-controls panel's buttons, contributed into the shared top-left\n controls panel (`topLeftControls.ts`) alongside the back button. Kept as\n its own module rather than folded into `zoomControlsMarkup.ts`/\n `topLeftControlsMarkup.ts`: search is independent chrome a chart can mix\n and match with zoom/back, so its styling knobs stay uncoupled from\n theirs (matching the convention `zoomControlsMarkup.ts` itself notes for\n why zoom and table-view don't share styling code).\n\n @module\n*/\nimport type {DataPoint} from \"@d3plus/data\";\nimport type {SceneNode} from \"@d3plus/render\";\nimport {fontFamily, fontFamilyStringify} from \"@d3plus/text\";\n\nimport type Viz from \"../viz/Viz.js\";\nimport {ICON_ATTRS, kebab} from \"./zoomControlsMarkup.js\";\nimport {paintControlButton, resolveControlStyle, type StyleObject} from \"./controlButtonStyle.js\";\nimport {\n searchControlStyleActiveDefault,\n searchControlStyleDefault,\n searchControlStyleHoverDefault,\n} from \"../viz/vizDefaults.js\";\n\n/** Search-open state is per-chart, read/written via `viz._searchOpen`. */\nexport function isSearchOpen(viz: Viz): boolean {\n return Boolean(viz._searchOpen);\n}\n\n/** The resolved base / active / hover button styles for a chart — also the cheap, non-DOM basis for `searchContribution`'s `styleSignature` (see `Contribution.styleSignature`). */\nexport function searchButtonStyles(viz: Viz): {base: StyleObject; active: StyleObject; hover: StyleObject} {\n const className = Boolean(viz.schema.searchControlClassName);\n return {\n base: resolveControlStyle(viz.schema.searchControlStyle, searchControlStyleDefault, className),\n active: resolveControlStyle(viz.schema.searchControlStyleActive, searchControlStyleActiveDefault, className),\n hover: resolveControlStyle(viz.schema.searchControlStyleHover, searchControlStyleHoverDefault, className),\n };\n}\n\n/** Paints the search toggle button's inline style for its current state. Mirrors `paintZoomButton`. */\nexport function paintSearchButton(viz: Viz, btn: HTMLElement, hovered = false): void {\n paintControlButton(btn, searchButtonStyles(viz), hovered, btn.classList.contains(\"active\"));\n}\n\n// A magnifying glass: a circle + a short diagonal handle. Nudged 1 unit\n// above the viewBox's true mathematical center (cy 10 → 9, the handle\n// shifted to match) — the ring's hollow center reads as lighter than the\n// handle's solid diagonal stroke, so a perfectly math-centered glass looks\n// optically low next to a symmetric icon like the back arrow's, even\n// though both render in pixel-identical boxes.\nconst SEARCH_ICON = `<svg ${ICON_ATTRS}><circle cx=\"10\" cy=\"9\" r=\"7\"/><line x1=\"21\" y1=\"20\" x2=\"15\" y2=\"14\"/></svg>`;\n// An X: two crossed diagonals, for the clear button.\nconst CLEAR_ICON = `<svg ${ICON_ATTRS}><line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"/><line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"/></svg>`;\n\n/**\n The input's inline style at rest (closed) vs. open — set directly by the\n toggle click handler, never regenerated mid-typing. Open's right padding\n reserves room for the clear button, which sits absolutely-positioned\n INSIDE the input's own box (see `SEARCH_CLEAR_STYLE_SHOWN`) rather than\n beside it, so typed text wraps short of it instead of running underneath.\n*/\nexport const SEARCH_INPUT_STYLE_CLOSED: Record<string, string> = {\n width: \"0\",\n padding: \"0\",\n border: \"none\",\n opacity: \"0\",\n \"pointer-events\": \"none\",\n};\nexport const SEARCH_INPUT_STYLE_OPEN: Record<string, string> = {\n width: \"120px\",\n padding: \"0 22px 0 6px\",\n border: \"1px solid #ccc\",\n \"border-radius\": \"3px\",\n opacity: \"1\",\n \"pointer-events\": \"auto\",\n};\n\nconst SEARCH_INPUT_BASE_STYLE: Record<string, string> = {\n height: \"20px\",\n \"box-sizing\": \"border-box\",\n // `inherit` picked up whatever font-size the host page's body/chart\n // container happened to set — often much larger than this 20px-tall\n // control was designed for. An explicit size matches the rest of the\n // panel (back/zoom's own buttons) regardless of the host page's CSS.\n font: `12px/1 ${fontFamilyStringify(fontFamily)}`,\n transition: \"width 0.15s ease, opacity 0.15s ease\",\n};\n\n/**\n The wrapper `.search-input-wrap` is the positioning context for both the\n clear button (absolute, inside the input's own box) and the match-count\n feedback (absolute, below it) — an `inline-block` with no explicit width\n of its own, so it always shrink-wraps to the input's CURRENT width\n (0 closed, 120px open) and the count box (`width: 100%`) automatically\n matches it.\n*/\nexport const SEARCH_INPUT_WRAP_STYLE: Record<string, string> = {\n position: \"relative\",\n display: \"inline-block\",\n};\n\n/**\n The root wrapper tying the toggle button and `.search-input-wrap` span\n together. Without it, the two sit as bare inline siblings and align by\n CSS's default inline baseline rule — which, since a `<button>` and an\n `<input>` differ in their UA-default box model (borders/padding under\n `content-box` vs. this module's explicit `border-box` on the input),\n doesn't actually land their content on the same visual center. `flex` +\n `align-items: center` centers both on their shared cross-axis instead,\n regardless of that box-model mismatch.\n*/\nconst SEARCH_ROOT_STYLE: Record<string, string> = {\n display: \"inline-flex\",\n \"align-items\": \"center\",\n};\n\n// The clear button and match-count feedback only ever show once there's a\n// term — both are toggled by the same `hasTerm` condition, at generation\n// time (`searchControlsHtml`) and imperatively while typing (`searchControls.ts`).\n// The hidden state uses `visibility: hidden`, not `display: none`, for the\n// clear button: it keeps its layout space reserved (matching the input's\n// permanent right padding) even while empty. The count box doesn't need\n// that — it's absolutely positioned below the input, so it never affects\n// the panel's own width/height either way.\nconst SEARCH_CLEAR_STYLE_SHOWN: Record<string, string> = {\n position: \"absolute\",\n top: \"50%\",\n right: \"2px\",\n transform: \"translateY(-50%)\",\n display: \"inline-flex\",\n \"align-items\": \"center\",\n \"justify-content\": \"center\",\n visibility: \"visible\",\n width: \"16px\",\n height: \"16px\",\n padding: \"0\",\n border: \"none\",\n background: \"none\",\n cursor: \"pointer\",\n};\nconst SEARCH_CLEAR_STYLE_HIDDEN: Record<string, string> = {...SEARCH_CLEAR_STYLE_SHOWN, visibility: \"hidden\", cursor: \"default\"};\n\n/**\n The match-count feedback sits directly below the input, at its same\n width, styled like the attribution box (`vizDefaults.ts`'s\n `attributionStyle` default) — a translucent white pill overlaying\n whatever chart content is beneath it. `pointer-events: none` so it never\n intercepts a click meant for the chart.\n*/\nconst SEARCH_COUNT_STYLE_SHOWN: Record<string, string> = {\n position: \"absolute\",\n top: \"100%\",\n left: \"0\",\n \"margin-top\": \"4px\",\n width: \"100%\",\n \"box-sizing\": \"border-box\",\n display: \"block\",\n visibility: \"visible\",\n background: \"rgba(255, 255, 255, 0.75)\",\n border: \"1px solid rgba(0, 0, 0, 0.25)\",\n color: \"rgba(0, 0, 0, 0.75)\",\n \"font-size\": \"11px\",\n \"text-align\": \"center\",\n padding: \"2px 4px\",\n \"white-space\": \"nowrap\",\n overflow: \"hidden\",\n \"text-overflow\": \"ellipsis\",\n \"pointer-events\": \"none\",\n};\nconst SEARCH_COUNT_STYLE_HIDDEN: Record<string, string> = {...SEARCH_COUNT_STYLE_SHOWN, visibility: \"hidden\"};\n\nfunction styleAttr(style: Record<string, string>): string {\n return Object.entries(style)\n .map(([k, v]) => `${kebab(k)}:${v}`)\n .join(\";\");\n}\n\n/** Applies the open/closed inline style directly to the input DOM node — no panel rebuild, so focus/cursor survive. */\nexport function applySearchInputOpenState(input: HTMLInputElement, open: boolean): void {\n const style = open ? SEARCH_INPUT_STYLE_OPEN : SEARCH_INPUT_STYLE_CLOSED;\n for (const key in style) input.style.setProperty(kebab(key), style[key]);\n}\n\n/** Shows/hides the clear button, directly on the DOM node — same no-rebuild pattern as the input's open state. */\nexport function applySearchClearVisible(btn: HTMLElement, visible: boolean): void {\n const style = visible ? SEARCH_CLEAR_STYLE_SHOWN : SEARCH_CLEAR_STYLE_HIDDEN;\n for (const key in style) btn.style.setProperty(kebab(key), style[key]);\n btn.tabIndex = visible ? 0 : -1;\n}\n\n/** 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). */\nexport function applySearchCount(viz: Viz, el: HTMLElement, hasTerm: boolean, index: number | undefined, total: number): void {\n const style = hasTerm ? SEARCH_COUNT_STYLE_SHOWN : SEARCH_COUNT_STYLE_HIDDEN;\n for (const key in style) el.style.setProperty(kebab(key), style[key]);\n const {text, label} = formatMatchCount(viz, index, total);\n el.textContent = hasTerm ? text : \"\";\n el.setAttribute(\"aria-label\", label);\n}\n\n/** Escapes a value for safe interpolation into `innerHTML`. */\nfunction escapeHtml(value: unknown): string {\n return String(value ?? \"\").replace(/[&<>\"']/g, c => (\n {\"&\": \"&amp;\", \"<\": \"&lt;\", \">\": \"&gt;\", '\"': \"&quot;\", \"'\": \"&#39;\"}[c] as string\n ));\n}\n\n/**\n The search control's markup: a toggle `<button>`, an `<input>`, a clear\n (×) button, and a match-count span — all real elements so host-page\n button/input styling applies through the cascade the same way zoom's\n buttons do. Term/open state is baked in from `viz._searchTerm`/\n `_searchOpen` so a full re-render (e.g. a resize or data change)\n preserves whatever the user was doing — typing itself never regenerates\n this markup (see `searchControls.ts`).\n\n The count span is left EMPTY here on purpose — its text is written by\n `searchContribution`'s `onUpdate` instead (see there), not baked into\n this string. `onUpdate` runs on every draw regardless of whether this\n html string changed, while the match count itself depends on the\n CHART's data/scene, not on the search box's own state — baking its text\n in here would make this contribution's own html change (and its DOM,\n including the live `<input>`, get torn down and rebuilt) every time the\n chart's data changes for a reason that has nothing to do with search,\n e.g. drilling down while the box is open and focused.\n*/\nexport function searchControlsHtml(viz: Viz): string {\n const extraClass = viz.schema.searchControlClassName ? ` ${viz.schema.searchControlClassName}` : \"\";\n const label = viz.schema.translate(\"Search\");\n const open = isSearchOpen(viz);\n const term = viz._searchTerm || \"\";\n const hasTerm = term.trim().length > 0;\n const inputStyle = styleAttr({...SEARCH_INPUT_BASE_STYLE, ...(open ? SEARCH_INPUT_STYLE_OPEN : SEARCH_INPUT_STYLE_CLOSED)});\n const clearStyle = styleAttr(hasTerm ? SEARCH_CLEAR_STYLE_SHOWN : SEARCH_CLEAR_STYLE_HIDDEN);\n const wrapStyle = styleAttr(SEARCH_INPUT_WRAP_STYLE);\n const rootStyle = styleAttr(SEARCH_ROOT_STYLE);\n return (\n `<span class=\"search-root\" style=\"${rootStyle}\">` +\n `<button type=\"button\" class=\"search-control search-toggle${open ? \" active\" : \"\"}${extraClass}\" aria-label=\"${label}\" aria-pressed=\"${open}\">${SEARCH_ICON}</button>` +\n `<span class=\"search-input-wrap\" style=\"${wrapStyle}\">` +\n `<input type=\"text\" class=\"search-control search-input\" placeholder=\"${label}\" aria-label=\"${label}\" value=\"${escapeHtml(term)}\" style=\"${inputStyle}\"${open ? \"\" : \" tabindex=\\\"-1\\\"\"}/>` +\n `<button type=\"button\" class=\"search-control search-clear\" aria-label=\"${viz.schema.translate(\"Clear\")}\" style=\"${clearStyle}\"${hasTerm ? \"\" : \" tabindex=\\\"-1\\\"\"}>${CLEAR_ICON}</button>` +\n `<span class=\"search-count\" aria-live=\"polite\"></span>` +\n `</span>` +\n `</span>`\n );\n}\n\n/**\n Whether `d` (row at index `i`) matches the (already-lowercased,\n already-trimmed) search `needle` — checked against\n `viz.schema.searchAccessor`'s resolved string, OR any level of `d`'s\n groupBy hierarchy (`viz._ids(d, i)`, one id string per groupBy field).\n\n The hierarchy check is what makes a match reach across drawn depth: a\n grouped chart's aggregate row (a Treemap's un-drilled parent cell, or a\n legend entry) is built by merging every leaf row it summarizes\n (`merge`/`objectMerge` in `@d3plus/data`), and a merged field that\n varies across those leaves survives as an ARRAY of every value seen —\n so an aggregate \"Group 2\" row's OWN `_ids()` output still contains\n \"Fig\" (search \"Fig\", match \"Group 2\"'s cell/legend entry) even though\n its rendered label is just \"Group 2\". The reverse direction needs no\n special-casing: a LEAF row's `_ids()` includes its ancestor's own\n (unmerged) id directly, so searching \"Group 2\" matches every one of its\n leaves too. Non-hierarchical charts (a single-field `groupBy`) degrade\n to exactly today's behavior — `_ids()` is a 1-element array equal to\n the accessor's own value.\n\n A custom `.searchAccessor()` isn't guaranteed to return a string for\n every row shape this runs against (the legend's own merged-aggregate\n rows differ in shape from a chart mark's row) — guard rather than let a\n non-string (commonly `undefined`) throw on `.toLowerCase()`.\n*/\nfunction matchesSearchNeedle(viz: Viz, d: DataPoint, i: number, needle: string): boolean {\n const value = viz.schema.searchAccessor(d, i);\n if (typeof value === \"string\" && value.toLowerCase().includes(needle)) return true;\n const ids = viz._ids(d, i) as string[];\n return ids.some(id => typeof id === \"string\" && id.toLowerCase().includes(needle));\n}\n\n/**\n Builds the predicate `.highlight()` drives from the current search term\n — see `matchesSearchNeedle` for the match rule. Empty term restores\n whatever `.highlight()` predicate (if any) was active before the search\n box opened.\n*/\nexport function searchHighlightPredicate(\n viz: Viz,\n term: string,\n): ((d: DataPoint, i: number) => boolean) | false {\n const needle = term.trim().toLowerCase();\n if (!needle) return viz._searchPrevHighlight ?? false;\n return (d: DataPoint, i: number) => matchesSearchNeedle(viz, d, i, needle);\n}\n\n/** Scene mark types a match is searched against — mirrors `interactionOpacity.ts`'s own `MARK_TYPES`. */\nconst MARK_TYPES = new Set([\"rect\", \"circle\", \"line\", \"area\", \"path\"]);\n\n/** One matching mark: its scene node (for `.key`/geometry), the unwrapped source row, and its index. */\nexport interface SearchMatch {\n node: SceneNode;\n row: DataPoint;\n index: number;\n}\n\n/**\n Every currently-rendered mark matching the given term, in scene order.\n Walks `viz._chartScene` (the actual painted scene, post-layout) rather\n than the raw data array, unwrapping each node's datum the same way\n `applyInteractionOpacity` does, so a grouped/aggregated chart matches by\n rendered mark, not by raw input row — and de-dupes by datum reference so\n a mark's separate label node doesn't double-count it. An empty term\n matches nothing (there's no \"everything\" state to jump through).\n*/\nexport function searchMatches(viz: Viz, term: string): SearchMatch[] {\n const needle = term.trim().toLowerCase();\n if (!needle) return [];\n const nodes = viz._chartScene || [];\n const seen = new Set<unknown>();\n const results: SearchMatch[] = [];\n const walk = (node: SceneNode): void => {\n if (MARK_TYPES.has(node.type) && node.datum !== undefined) {\n const raw = node.datum as (DataPoint & {data?: DataPoint}) | undefined;\n const row = (raw && raw.data ? raw.data : raw) as DataPoint;\n if (row !== undefined && !seen.has(row)) {\n seen.add(row);\n // Mirrors applyInteractionOpacity's own fallback order exactly\n // (interactionOpacity.ts) — node.index, then the row's own `.i`,\n // then 0 — so the index a custom searchAccessor sees here always\n // matches the index the highlight predicate was evaluated with,\n // and Enter/Shift+Enter never jumps to a different mark than the\n // one that's actually highlighted.\n const i =\n typeof node.index === \"number\"\n ? node.index\n : typeof (row as {i?: number}).i === \"number\"\n ? (row as {i: number}).i\n : 0;\n if (matchesSearchNeedle(viz, row, i, needle)) results.push({node, row, index: i});\n }\n }\n const kids = (node as {children?: SceneNode[]}).children;\n if (kids) kids.forEach(walk);\n };\n nodes.forEach(walk);\n return results;\n}\n\n/**\n Formats the match-count feedback as a readable, localized phrase:\n \"No Matches\" with nothing found, \"6 Matches\"/\"1 Match\" once there's a\n count but the user hasn't stepped to one yet (Enter/Shift+Enter), and\n \"Match 2/6\" once they have — the translated noun for context, plus a\n compact numeric position rather than a translated \"of\" connector, since\n a fixed English word order (\"Match 2 of 6\") wouldn't read naturally in\n every locale, while a number pair after a noun does. `index` is 0-based\n (`viz._searchMatchIndex`); `total` is `searchMatches(...).length`. Text\n and label are the same string — both visible and accessible.\n*/\nexport function formatMatchCount(viz: Viz, index: number | undefined, total: number): {text: string; label: string} {\n let text: string;\n if (total === 0) text = viz.schema.translate(\"No Matches\");\n else if (typeof index !== \"number\") text = `${total} ${viz.schema.translate(total === 1 ? \"Match\" : \"Matches\")}`;\n else text = `${viz.schema.translate(\"Match\")} ${index + 1}/${total}`;\n return {text, label: text};\n}\n\n/** Whether a chart shows the search control. */\nexport function showsSearchControls(viz: Viz): boolean {\n return Boolean(viz.schema.search) && !viz._ssr;\n}\n"],"names":["fontFamily","fontFamilyStringify","ICON_ATTRS","kebab","paintControlButton","resolveControlStyle","searchControlStyleActiveDefault","searchControlStyleDefault","searchControlStyleHoverDefault","isSearchOpen","viz","Boolean","_searchOpen","searchButtonStyles","className","schema","searchControlClassName","base","searchControlStyle","active","searchControlStyleActive","hover","searchControlStyleHover","paintSearchButton","btn","hovered","classList","contains","SEARCH_ICON","CLEAR_ICON","SEARCH_INPUT_STYLE_CLOSED","width","padding","border","opacity","SEARCH_INPUT_STYLE_OPEN","SEARCH_INPUT_BASE_STYLE","height","font","transition","SEARCH_INPUT_WRAP_STYLE","position","display","SEARCH_ROOT_STYLE","SEARCH_CLEAR_STYLE_SHOWN","top","right","transform","visibility","background","cursor","SEARCH_CLEAR_STYLE_HIDDEN","SEARCH_COUNT_STYLE_SHOWN","left","color","overflow","SEARCH_COUNT_STYLE_HIDDEN","styleAttr","style","Object","entries","map","k","v","join","applySearchInputOpenState","input","open","key","setProperty","applySearchClearVisible","visible","tabIndex","applySearchCount","el","hasTerm","index","total","formatMatchCount","text","label","textContent","setAttribute","escapeHtml","value","String","replace","c","searchControlsHtml","extraClass","translate","term","_searchTerm","trim","length","inputStyle","clearStyle","wrapStyle","rootStyle","matchesSearchNeedle","d","i","needle","searchAccessor","toLowerCase","includes","ids","_ids","some","id","searchHighlightPredicate","_searchPrevHighlight","MARK_TYPES","Set","searchMatches","nodes","_chartScene","seen","results","walk","node","has","type","datum","undefined","raw","row","data","add","push","kids","children","forEach","showsSearchControls","search","_ssr"],"mappings":"AAAA;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,SAAQA,UAAU,EAAEC,mBAAmB,QAAO,eAAe;AAG7D,SAAQC,UAAU,EAAEC,KAAK,QAAO,0BAA0B;AAC1D,SAAQC,kBAAkB,EAAEC,mBAAmB,QAAyB,0BAA0B;AAClG,SACEC,+BAA+B,EAC/BC,yBAAyB,EACzBC,8BAA8B,QACzB,wBAAwB;AAE/B,wEAAwE,GACxE,OAAO,SAASC,aAAaC,GAAQ;IACnC,OAAOC,QAAQD,IAAIE,WAAW;AAChC;AAEA,kLAAkL,GAClL,OAAO,SAASC,mBAAmBH,GAAQ;IACzC,IAAMI,YAAYH,QAAQD,IAAIK,MAAM,CAACC,sBAAsB;IAC3D,OAAO;QACLC,MAAMZ,oBAAoBK,IAAIK,MAAM,CAACG,kBAAkB,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