@d3plus/core 4.11.0 → 4.12.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 (287) hide show
  1. package/es/internal.js +15 -5
  2. package/es/src/charts/Alluvial/emit.js +2 -2
  3. package/es/src/charts/Alluvial/index.js +7 -1
  4. package/es/src/charts/Alluvial/titles.js +24 -4
  5. package/es/src/charts/ArcDiagram/emit.js +27 -13
  6. package/es/src/charts/ArcDiagram/events.js +6 -2
  7. package/es/src/charts/ArcDiagram/index.js +2 -0
  8. package/es/src/charts/BarChart/index.js +3 -10
  9. package/es/src/charts/Calendar/index.js +2 -0
  10. package/es/src/charts/Candlestick/index.js +4 -10
  11. package/es/src/charts/Gantt/applyLayout.js +2 -4
  12. package/es/src/charts/Geomap/flowEmit.js +11 -6
  13. package/es/src/charts/Hexbin/index.js +2 -0
  14. package/es/src/charts/Icicle/index.js +3 -1
  15. package/es/src/charts/Matrix/applyLayout.js +20 -9
  16. package/es/src/charts/Matrix/index.js +19 -1
  17. package/es/src/charts/Network/applyLayout.js +36 -5
  18. package/es/src/charts/Network/bundle.js +5 -4
  19. package/es/src/charts/Network/emit.js +39 -40
  20. package/es/src/charts/Network/graph.js +34 -5
  21. package/es/src/charts/Network/graphFluent.js +5 -3
  22. package/es/src/charts/Network/index.js +6 -1
  23. package/es/src/charts/Pack/applyLayout.js +16 -5
  24. package/es/src/charts/Pack/emit.js +15 -8
  25. package/es/src/charts/Pack/groupRows.js +61 -0
  26. package/es/src/charts/Pack/index.js +3 -0
  27. package/es/src/charts/Pack/neutralPaint.js +20 -0
  28. package/es/src/charts/Pack/nodeNames.js +35 -0
  29. package/es/src/charts/ParallelCoordinates/axes.js +22 -22
  30. package/es/src/charts/ParallelCoordinates/chrome.js +18 -0
  31. package/es/src/charts/ParallelCoordinates/index.js +3 -1
  32. package/es/src/charts/ParallelCoordinates/titles.js +17 -9
  33. package/es/src/charts/Pie/emit.js +9 -1
  34. package/es/src/charts/Pie/index.js +10 -0
  35. package/es/src/charts/Plot/areaEnter.js +68 -0
  36. package/es/src/charts/Plot/draw.js +26 -12
  37. package/es/src/charts/Plot/index.js +4 -10
  38. package/es/src/charts/Plot/lineMarkerKeys.js +19 -0
  39. package/es/src/charts/Plot/plotInit.js +6 -0
  40. package/es/src/charts/Plot/shapeLabelLegend.js +67 -0
  41. package/es/src/charts/Plot/sharedHover.js +2 -1
  42. package/es/src/charts/Plot/sharedTooltip.js +13 -3
  43. package/es/src/charts/PolarArea/index.js +2 -1
  44. package/es/src/charts/Priestley/applyLayout.js +11 -7
  45. package/es/src/charts/Priestley/index.js +0 -2
  46. package/es/src/charts/Priestley/timeAxis.js +11 -8
  47. package/es/src/charts/Pyramid/gutter.js +52 -16
  48. package/es/src/charts/Pyramid/index.js +55 -7
  49. package/es/src/charts/Pyramid/scene.js +4 -4
  50. package/es/src/charts/Radar/applyLayout.js +31 -33
  51. package/es/src/charts/Radar/axisDecorations.js +29 -17
  52. package/es/src/charts/Radar/curvedLabels.js +43 -2
  53. package/es/src/charts/Radar/emit.js +30 -15
  54. package/es/src/charts/Radar/index.js +41 -2
  55. package/es/src/charts/Radar/points.js +85 -0
  56. package/es/src/charts/RadialBar/emit.js +6 -1
  57. package/es/src/charts/RadialBar/index.js +10 -0
  58. package/es/src/charts/RadialMatrix/applyLayout.js +115 -31
  59. package/es/src/charts/RadialMatrix/index.js +15 -2
  60. package/es/src/charts/Rings/applyLayout.js +11 -150
  61. package/es/src/charts/Rings/emit.js +80 -40
  62. package/es/src/charts/Rings/index.js +27 -4
  63. package/es/src/charts/Rings/ringsCurves.js +156 -0
  64. package/es/src/charts/Rings/ringsParallel.js +20 -3
  65. package/es/src/charts/Rings/ringsPlacement.js +152 -0
  66. package/es/src/charts/Rings/ringsSizing.js +61 -38
  67. package/es/src/charts/Sankey/applyLayout.js +18 -4
  68. package/es/src/charts/Sankey/index.js +7 -1
  69. package/es/src/charts/Sunburst/emit.js +9 -1
  70. package/es/src/charts/Sunburst/index.js +13 -1
  71. package/es/src/charts/Tree/applyLayout.js +44 -14
  72. package/es/src/charts/Tree/emit.js +5 -5
  73. package/es/src/charts/Tree/index.js +10 -12
  74. package/es/src/charts/Tree/keys.js +33 -0
  75. package/es/src/charts/Tree/nodeLabel.js +15 -0
  76. package/es/src/charts/Treemap/emitGroupHeaders.js +3 -5
  77. package/es/src/charts/definition/makeChart.js +6 -2
  78. package/es/src/charts/drawSteps/minimap.js +4 -20
  79. package/es/src/charts/drawSteps/zoomActions.js +36 -0
  80. package/es/src/charts/drawSteps/zoomControls.js +31 -18
  81. package/es/src/charts/drawSteps/zoomControlsMarkup.js +23 -4
  82. package/es/src/charts/drawSteps/zoomDrag.js +188 -0
  83. package/es/src/charts/drawSteps/zoomFit.js +69 -0
  84. package/es/src/charts/events/click.legend.js +4 -2
  85. package/es/src/charts/events/click.shape.js +5 -3
  86. package/es/src/charts/events/mouseenter.js +6 -16
  87. package/es/src/charts/events/mouseleave.js +9 -2
  88. package/es/src/charts/events/mousemove.legend.js +28 -32
  89. package/es/src/charts/events/mousemove.shape.js +44 -44
  90. package/es/src/charts/features/axes.js +15 -4
  91. package/es/src/charts/features/axesFinal.js +7 -2
  92. package/es/src/charts/features/axesMeasure.js +26 -8
  93. package/es/src/charts/features/axisTooltip.js +138 -0
  94. package/es/src/charts/features/centerLabel.js +177 -0
  95. package/es/src/charts/features/colorScaleBivariate.js +83 -0
  96. package/es/src/charts/features/colorScaleBucket.js +18 -0
  97. package/es/src/charts/features/colorScaleHover.js +30 -5
  98. package/es/src/charts/features/colorScaleLimit.js +73 -0
  99. package/es/src/charts/features/colorScaleTooltip.js +77 -0
  100. package/es/src/charts/features/colorScaleTop.js +61 -0
  101. package/es/src/charts/features/curvedArrows.js +33 -0
  102. package/es/src/charts/features/depthKey.js +26 -0
  103. package/es/src/charts/features/edgeArrows.js +61 -2
  104. package/es/src/charts/features/featuresColorScale.js +57 -16
  105. package/es/src/charts/features/hoverTicks.js +41 -0
  106. package/es/src/charts/features/idleQueue.js +72 -0
  107. package/es/src/charts/features/linkInteraction.js +59 -7
  108. package/es/src/charts/features/networkMeasures.js +241 -0
  109. package/es/src/charts/features/nodeStats.js +309 -0
  110. package/es/src/charts/features/plotEndLabels.js +28 -7
  111. package/es/src/charts/features/plotPaint.js +9 -2
  112. package/es/src/charts/features/shapeEmit.js +7 -1
  113. package/es/src/charts/features/textHalo.js +3 -2
  114. package/es/src/charts/partition/chartFields.js +12 -3
  115. package/es/src/charts/partition/interaction.js +10 -5
  116. package/es/src/charts/pipeline/insetPlacement.js +8 -3
  117. package/es/src/charts/polar/chrome.js +81 -9
  118. package/es/src/charts/polar/config.js +4 -0
  119. package/es/src/charts/polar/wedgeLayout.js +2 -1
  120. package/es/src/charts/viz/Viz.js +24 -15
  121. package/es/src/charts/viz/VizBase.js +39 -4
  122. package/es/src/charts/viz/backgroundInk.js +10 -0
  123. package/es/src/charts/viz/emphasis.js +14 -0
  124. package/es/src/charts/viz/fillStroke.js +10 -0
  125. package/es/src/charts/viz/interactionOpacity.js +115 -32
  126. package/es/src/charts/viz/reportDrawError.js +15 -0
  127. package/es/src/charts/viz/setCursor.js +29 -0
  128. package/es/src/charts/viz/tooltipEnabled.js +38 -0
  129. package/es/src/charts/viz/userClick.js +34 -0
  130. package/es/src/charts/viz/vizDataPolling.js +0 -1
  131. package/es/src/charts/viz/vizDefaults.js +13 -34
  132. package/es/src/charts/viz/vizFields.js +6 -1
  133. package/es/src/charts/viz/vizRender.js +35 -5
  134. package/es/src/charts/viz/vizVisibility.js +12 -2
  135. package/es/src/components/Axis/Axis.js +29 -2
  136. package/es/src/components/Axis/axisBreak.js +29 -7
  137. package/es/src/components/Axis/axisDefaults.js +11 -0
  138. package/es/src/components/Axis/axisLabelKinds.js +36 -0
  139. package/es/src/components/Axis/axisLabelLineHeight.js +19 -0
  140. package/es/src/components/Axis/axisLabelRoom.js +37 -0
  141. package/es/src/components/Axis/axisLabelSize.js +171 -0
  142. package/es/src/components/Axis/axisLabelThinning.js +98 -4
  143. package/es/src/components/Axis/axisLayout.js +71 -46
  144. package/es/src/components/Axis/axisLayoutLabels.js +82 -140
  145. package/es/src/components/Axis/axisLayoutScale.js +9 -10
  146. package/es/src/components/Axis/axisLimit.js +27 -0
  147. package/es/src/components/Axis/axisMaxSize.js +39 -0
  148. package/es/src/components/Axis/axisRender.js +20 -8
  149. package/es/src/components/Axis/axisRounding.js +16 -1
  150. package/es/src/components/Axis/axisScene.js +11 -2
  151. package/es/src/components/Axis/axisTitle.js +53 -0
  152. package/es/src/components/Axis/axisTooltipTargets.js +128 -0
  153. package/es/src/components/ColorScale/ColorScale.js +62 -18
  154. package/es/src/components/ColorScale/bivariateRender.js +353 -0
  155. package/es/src/components/ColorScale/bivariateScale.js +150 -0
  156. package/es/src/components/ColorScale/colorScaleRender.js +32 -2
  157. package/es/src/components/ColorScale/colorScaleSwatchTooltips.js +77 -0
  158. package/es/src/components/Legend/Legend.js +10 -2
  159. package/es/src/components/Legend/legendCut.js +108 -0
  160. package/es/src/components/Legend/legendRender.js +38 -13
  161. package/es/src/components/TextBox.js +5 -2
  162. package/es/src/components/Timeline/timelineRender.js +2 -1
  163. package/es/src/components/textBoxScene.js +3 -0
  164. package/es/src/components/textEllipsis.js +7 -0
  165. package/es/src/components/tooltipDom.js +8 -5
  166. package/es/src/fluent.js +48 -0
  167. package/es/src/utils/BaseClass.js +7 -2
  168. package/es/src/utils/configValue.js +9 -0
  169. package/package.json +10 -10
  170. package/types/index.d.ts +1 -1
  171. package/types/internal.d.ts +22 -5
  172. package/types/src/charts/Alluvial/titles.d.ts +16 -3
  173. package/types/src/charts/ArcDiagram/emit.d.ts +3 -2
  174. package/types/src/charts/ArcDiagram/events.d.ts +2 -1
  175. package/types/src/charts/Geomap/flowEmit.d.ts +3 -2
  176. package/types/src/charts/Matrix/applyLayout.d.ts +4 -2
  177. package/types/src/charts/Network/applyLayout.d.ts +11 -0
  178. package/types/src/charts/Network/bundle.d.ts +3 -1
  179. package/types/src/charts/Network/graph.d.ts +12 -4
  180. package/types/src/charts/Pack/applyLayout.d.ts +2 -0
  181. package/types/src/charts/Pack/groupRows.d.ts +46 -0
  182. package/types/src/charts/Pack/index.d.ts +3 -0
  183. package/types/src/charts/Pack/neutralPaint.d.ts +14 -0
  184. package/types/src/charts/Pack/nodeNames.d.ts +23 -0
  185. package/types/src/charts/ParallelCoordinates/chrome.d.ts +12 -0
  186. package/types/src/charts/ParallelCoordinates/index.d.ts +1 -0
  187. package/types/src/charts/ParallelCoordinates/titles.d.ts +7 -2
  188. package/types/src/charts/Plot/areaEnter.d.ts +34 -0
  189. package/types/src/charts/Plot/index.d.ts +4 -10
  190. package/types/src/charts/Plot/lineMarkerKeys.d.ts +11 -0
  191. package/types/src/charts/Plot/shapeLabelLegend.d.ts +19 -0
  192. package/types/src/charts/Plot/sharedTooltip.d.ts +7 -1
  193. package/types/src/charts/Priestley/timeAxis.d.ts +7 -4
  194. package/types/src/charts/Pyramid/gutter.d.ts +28 -6
  195. package/types/src/charts/Pyramid/scene.d.ts +1 -1
  196. package/types/src/charts/Radar/applyLayout.d.ts +2 -3
  197. package/types/src/charts/Radar/axisDecorations.d.ts +5 -2
  198. package/types/src/charts/Radar/curvedLabels.d.ts +35 -0
  199. package/types/src/charts/Radar/emit.d.ts +5 -2
  200. package/types/src/charts/Radar/index.d.ts +7 -2
  201. package/types/src/charts/Radar/points.d.ts +50 -0
  202. package/types/src/charts/RadialMatrix/applyLayout.d.ts +6 -4
  203. package/types/src/charts/Rings/emit.d.ts +24 -2
  204. package/types/src/charts/Rings/index.d.ts +4 -2
  205. package/types/src/charts/Rings/ringsCurves.d.ts +50 -0
  206. package/types/src/charts/Rings/ringsGraph.d.ts +29 -5
  207. package/types/src/charts/Rings/ringsParallel.d.ts +4 -2
  208. package/types/src/charts/Rings/ringsPlacement.d.ts +47 -0
  209. package/types/src/charts/Rings/ringsSizing.d.ts +36 -9
  210. package/types/src/charts/Tree/applyLayout.d.ts +20 -0
  211. package/types/src/charts/Tree/keys.d.ts +25 -0
  212. package/types/src/charts/Tree/nodeLabel.d.ts +11 -0
  213. package/types/src/charts/definition/ChartDefinition.d.ts +13 -0
  214. package/types/src/charts/definition/makeChart.d.ts +2 -2
  215. package/types/src/charts/drawSteps/zoomActions.d.ts +30 -0
  216. package/types/src/charts/drawSteps/zoomControls.d.ts +15 -0
  217. package/types/src/charts/drawSteps/zoomControlsMarkup.d.ts +16 -1
  218. package/types/src/charts/drawSteps/zoomDrag.d.ts +71 -0
  219. package/types/src/charts/drawSteps/zoomFit.d.ts +30 -0
  220. package/types/src/charts/features/axisTooltip.d.ts +49 -0
  221. package/types/src/charts/features/centerLabel.d.ts +75 -0
  222. package/types/src/charts/features/colorScaleBivariate.d.ts +50 -0
  223. package/types/src/charts/features/colorScaleBucket.d.ts +10 -0
  224. package/types/src/charts/features/colorScaleHover.d.ts +13 -3
  225. package/types/src/charts/features/colorScaleLimit.d.ts +60 -0
  226. package/types/src/charts/features/colorScaleTooltip.d.ts +43 -0
  227. package/types/src/charts/features/colorScaleTop.d.ts +30 -0
  228. package/types/src/charts/features/curvedArrows.d.ts +14 -0
  229. package/types/src/charts/features/depthKey.d.ts +19 -0
  230. package/types/src/charts/features/edgeArrows.d.ts +29 -2
  231. package/types/src/charts/features/hoverTicks.d.ts +30 -0
  232. package/types/src/charts/features/idleQueue.d.ts +46 -0
  233. package/types/src/charts/features/linkInteraction.d.ts +13 -4
  234. package/types/src/charts/features/networkMeasures.d.ts +53 -0
  235. package/types/src/charts/features/nodeStats.d.ts +93 -0
  236. package/types/src/charts/features/plotEndLabels.d.ts +14 -1
  237. package/types/src/charts/features/textHalo.d.ts +4 -3
  238. package/types/src/charts/partition/chartFields.d.ts +6 -1
  239. package/types/src/charts/pipeline/insetPlacement.d.ts +6 -0
  240. package/types/src/charts/polar/chrome.d.ts +19 -6
  241. package/types/src/charts/viz/Viz.d.ts +10 -3
  242. package/types/src/charts/viz/VizBase.d.ts +31 -2
  243. package/types/src/charts/viz/backgroundInk.d.ts +8 -0
  244. package/types/src/charts/viz/emphasis.d.ts +17 -0
  245. package/types/src/charts/viz/fillStroke.d.ts +7 -0
  246. package/types/src/charts/viz/reportDrawError.d.ts +12 -0
  247. package/types/src/charts/viz/setCursor.d.ts +26 -0
  248. package/types/src/charts/viz/tooltipEnabled.d.ts +31 -0
  249. package/types/src/charts/viz/userClick.d.ts +35 -0
  250. package/types/src/charts/viz/vizFields.d.ts +5 -0
  251. package/types/src/charts/viz/vizTypes.d.ts +16 -0
  252. package/types/src/charts/viz/vizVisibility.d.ts +7 -0
  253. package/types/src/components/Axis/Axis.d.ts +33 -3
  254. package/types/src/components/Axis/axisBreak.d.ts +19 -3
  255. package/types/src/components/Axis/axisDefaults.d.ts +12 -0
  256. package/types/src/components/Axis/axisLabelKinds.d.ts +22 -0
  257. package/types/src/components/Axis/axisLabelLineHeight.d.ts +27 -0
  258. package/types/src/components/Axis/axisLabelRoom.d.ts +17 -0
  259. package/types/src/components/Axis/axisLabelSize.d.ts +82 -0
  260. package/types/src/components/Axis/axisLabelThinning.d.ts +38 -2
  261. package/types/src/components/Axis/axisLayout.d.ts +9 -2
  262. package/types/src/components/Axis/axisLayoutLabels.d.ts +28 -33
  263. package/types/src/components/Axis/axisLayoutScale.d.ts +3 -1
  264. package/types/src/components/Axis/axisLimit.d.ts +18 -0
  265. package/types/src/components/Axis/axisMaxSize.d.ts +48 -0
  266. package/types/src/components/Axis/axisRounding.d.ts +8 -0
  267. package/types/src/components/Axis/axisTitle.d.ts +30 -0
  268. package/types/src/components/Axis/axisTooltipTargets.d.ts +82 -0
  269. package/types/src/components/ColorScale/ColorScale.d.ts +21 -11
  270. package/types/src/components/ColorScale/bivariateRender.d.ts +53 -0
  271. package/types/src/components/ColorScale/bivariateScale.d.ts +92 -0
  272. package/types/src/components/ColorScale/colorScaleSwatchTooltips.d.ts +48 -0
  273. package/types/src/components/Legend/Legend.d.ts +5 -0
  274. package/types/src/components/Legend/legendCut.d.ts +31 -0
  275. package/types/src/components/Legend/legendRender.d.ts +6 -1
  276. package/types/src/components/TextBox.d.ts +4 -0
  277. package/types/src/components/textEllipsis.d.ts +6 -0
  278. package/types/src/fluent.d.ts +18 -0
  279. package/types/src/shapes/emitLabels.d.ts +1 -1
  280. package/types/src/utils/D3plusConfig.d.ts +485 -609
  281. package/types/src/utils/configValue.d.ts +8 -0
  282. package/types/src/utils/index.d.ts +1 -1
  283. package/types/umd-entry.d.ts +4 -0
  284. package/umd/d3plus-core.full.js +22930 -17936
  285. package/umd/d3plus-core.full.min.js +2 -2
  286. package/umd/d3plus-core.js +21240 -16404
  287. package/umd/d3plus-core.min.js +2 -2
package/es/internal.js CHANGED
@@ -16,8 +16,8 @@ export { applyFunnelLayout } from "./src/charts/Funnel/applyLayout.js";
16
16
  export { applyGaugeLayout } from "./src/charts/Gauge/applyLayout.js";
17
17
  export { applyGeomapLayout } from "./src/charts/Geomap/applyLayout.js";
18
18
  export { applyMatrixLayout } from "./src/charts/Matrix/applyLayout.js";
19
- export { applyNetworkLayout } from "./src/charts/Network/applyLayout.js";
20
- export { graphLinkEnd, graphNodeId, resolveGraphLinks, resolveGraphNodes, zoomToNodeBounds } from "./src/charts/Network/graph.js";
19
+ export { applyNetworkLayout, placeLoneNodes } from "./src/charts/Network/applyLayout.js";
20
+ export { graphLinkEnd, graphNodeId, graphNodeRows, resolveGraphLinks, resolveGraphNodes, zoomToNodeBounds } from "./src/charts/Network/graph.js";
21
21
  export { installGraphFluent } from "./src/charts/Network/graphFluent.js";
22
22
  export { applyArcDiagramLayout, arcNodeGroup, arcRadiusScale, arcSizeLegendScale } from "./src/charts/ArcDiagram/applyLayout.js";
23
23
  export { arcApex, arcBox, arcEndTip, arcPathD, arcPoint, arcScale, arcSideOf, naturalCompare, nodeDegrees, slotPositions, sortArcNodes } from "./src/charts/ArcDiagram/arcGeometry.js";
@@ -26,6 +26,9 @@ export { arcDiagramEmit, arcLabelAnchor, arcLabelPath } from "./src/charts/ArcDi
26
26
  export { arcFocus, setupArcEvents } from "./src/charts/ArcDiagram/events.js";
27
27
  export { bindSvgBackgroundClick, clearLinkFocus, focusLink, installFocusBackgroundClick, linkEndsBox, linkFocusId } from "./src/charts/features/linkFocus.js";
28
28
  export { isLinkDatum, LINK_HIT_WIDTH, linkArrows, linkAriaLabel, linkCellText, linkEndLabel, linkHighlight, linkHitPath, linkMeta, linkNodeOf, linkTooltipConfig, linkTooltipRows, linkTooltipTitle, makeLinkDatum, nodeConnectionRows, nodeConnections, nodeHighlight, nodeTooltipLinkLimit, publishLinkGraph, rtlLocale, setLinkValue } from "./src/charts/features/linkInteraction.js";
29
+ export { measuresTask, networkMeasures } from "./src/charts/features/networkMeasures.js";
30
+ export { cancelIdleWork, IDLE_BUDGET, IdleQueue, idleQueue, requestIdle } from "./src/charts/features/idleQueue.js";
31
+ export { NODE_STATS, nodeStatRows, nodeStatsFields, nodeStatsGraph, nodeStatsInIdle, scheduleNodeStats, STAT_PENDING, nodeTooltipStatList } from "./src/charts/features/nodeStats.js";
29
32
  export { applyRingsLayout } from "./src/charts/Rings/applyLayout.js";
30
33
  export { applySankeyLayout } from "./src/charts/Sankey/applyLayout.js";
31
34
  export { applyPackLayout } from "./src/charts/Pack/applyLayout.js";
@@ -76,6 +79,8 @@ export { arrowheadPoints, clampBox, connectorEndpoints, offsetBox, placeCalloutB
76
79
  export { calloutNodes, calloutPicker, calloutRowNodes } from "./src/charts/features/calloutScene.js";
77
80
  export { expandReferenceBands, expandReferenceLines, REFERENCE_BAND, REFERENCE_LINE, referenceAxis, referenceBandLabelAt, referenceBandLabelSpots, referenceBandNodes, referenceBandRect, referenceLineLabelAt, referenceLineLabelSpots, referenceLineNodes, referenceLinePoints } from "./src/charts/features/referenceAnnotations.js";
78
81
  export { textHalo } from "./src/charts/features/textHalo.js";
82
+ export { bindAccessors, handleAxisTooltip, isAxisTooltipDatum, resolveAxisTooltip } from "./src/charts/features/axisTooltip.js";
83
+ export { axisTooltipTarget, inertAxis, labelCut, stampTickTooltips, stampTitleTooltip, tickRank } from "./src/components/Axis/axisTooltipTargets.js";
79
84
  export { clearGraphFocus, withinArea } from "./src/charts/features/ensureZoomDom.js";
80
85
  export { labelSpotBox, pickLabelSpot, placeReferenceLabels, registerLabelSpots, slideSteps } from "./src/charts/features/referenceLabelPlacement.js";
81
86
  export { openDomainEnds, referenceDomainValues, widenReferenceDomains, widenToValues } from "./src/charts/Plot/referenceDomains.js";
@@ -128,6 +133,7 @@ export { autoLineOpacity, axisPositions, detectDimensions, dimensionDomain, dime
128
133
  export { brushFromPixels, hasBrushes, isNumericRange, pixelsFromBrush, rowPasses, valuePasses } from "./src/charts/ParallelCoordinates/brushFilter.js";
129
134
  export { linePoints, parallelPath } from "./src/charts/ParallelCoordinates/paths.js";
130
135
  export { axisDomain, dimensionAxisConfig, dimensionTitleStyle, layoutAxes } from "./src/charts/ParallelCoordinates/axes.js";
136
+ export { chromeNode } from "./src/charts/ParallelCoordinates/chrome.js";
131
137
  export { brushTarget, parallelDimensionKeys, parallelOrient } from "./src/charts/ParallelCoordinates/applyLayout.js";
132
138
  export { clearStrip, stripLength, stripSelection, syncBrushDom } from "./src/charts/ParallelCoordinates/brushDom.js";
133
139
  export { lineAriaLabel, parallelEmit, resolveLineOpacity } from "./src/charts/ParallelCoordinates/emit.js";
@@ -141,7 +147,7 @@ export { alluvialEmit, formatAlluvialValue } from "./src/charts/Alluvial/emit.js
141
147
  export { alluvialHighlight, alluvialTooltipRows, alluvialTooltipTitle, installAlluvialHover } from "./src/charts/Alluvial/hover.js";
142
148
  export { alluvialColumns, alluvialRibbon, incomingBarycenters, layoutAlluvial, sortAlluvialColumns } from "./src/charts/Alluvial/layout.js";
143
149
  export { alluvialDimensions, alluvialGroupBy, alluvialMeta, setAlluvialMeta, sourceRows } from "./src/charts/Alluvial/meta.js";
144
- export { TITLE_GAP as ALLUVIAL_TITLE_GAP, alluvialTitleBoxes, alluvialTitleNodes, alluvialTitleStyle, sizeAlluvialTitles } from "./src/charts/Alluvial/titles.js";
150
+ export { TITLE_GAP as ALLUVIAL_TITLE_GAP, alluvialTitleBoxes, alluvialTitleNodes, alluvialTitleStyle, alluvialTitleTooltip, sizeAlluvialTitles } from "./src/charts/Alluvial/titles.js";
145
151
  export { candleChange, candleDirection, candlePath, candleWidth, finiteValue, ohlcBarPath, ohlcExtent, periodSpacing, pixelCenter, readOhlc } from "./src/charts/Candlestick/ohlc.js";
146
152
  export { aggregateFunctionFields, DEFAULT_AGGS, firstValue, keyedAccessor, lastValue, maxValue, minValue, ohlcAccessors, sumValue, syncDefaultAggs } from "./src/charts/Candlestick/aggregate.js";
147
153
  export { emitVolume, installVolumeStrip, stripSize, VOLUME_DEFAULTS, volumeAccessor, volumeScale, volumeStripRect } from "./src/charts/Candlestick/volume.js";
@@ -243,7 +249,7 @@ export { brokenTimeScale, isBrokenTimeScale } from "./src/components/Axis/broken
243
249
  export { gapIndex, hidesAllTime, isHiddenTime, isRangeBreakRule, normalizeRangeBreaks, offsetVisible, rangeBreakGaps, rangeBreakTest, rangeBreakTime, ruleMarker, visibleBetween } from "./src/components/Axis/rangeBreaks.js";
244
250
  export { applyAxisRangeBreaks, visibleTimeValues } from "./src/components/Axis/axisRangeBreaks.js";
245
251
  export { dropHiddenRows, plotRangeBreaks, plotTimeScale, rangeBreaksTimeAxis, timelineRangeBreaks } from "./src/charts/Plot/plotRangeBreaks.js";
246
- export { applyAxisBreaks, axisBarNodes, baselineBreakStyle, breakGap, breakStyle, breakStyleOf, breakTickValues, brokenBarScene, resolveBaselineBreak } from "./src/components/Axis/axisBreak.js";
252
+ export { applyAxisBreaks, axisBarNodes, baselineBreakStyle, breakGap, breakStyle, breakStyleOf, breakTickValues, brokenBarScene, fitBreakSpace, resolveBaselineBreak } from "./src/components/Axis/axisBreak.js";
247
253
  export { bandPolygon, breakLineNodes, breakLinePaint, maskBreaks, maskPath, unwrapBreakMasks } from "./src/charts/Plot/plotBreaks.js";
248
254
  export { baselineBreakAxisConfig, clampBarConfig, outsideBaselineBreak, plotAxisConfig, userDomainBreaksBaseline, valueAxis, valueAxisExtent } from "./src/charts/Plot/baselineBreak.js";
249
255
  export { baselineDomainAxis, configOpenDomain, hasFullConfigDomain, hasOpenUserEnd, hasUserDomain, isOneSided, openEndAxisConfig, plotAxisRounding, secondaryAxisRounding, userAxisDomain } from "./src/charts/Plot/baselineDomain.js";
@@ -280,6 +286,7 @@ export { chartName, createKeyboardNavHost, KEYBOARD_NAV_INSTRUCTIONS, plainText,
280
286
  export { hoverReach, isPointShape, nearestPick, pointMarkTargets, pointTarget, routePointerEvent } from "./src/charts/viz/nearestHover.js";
281
287
  export { nearestHoverSurface } from "./src/charts/viz/nearestHoverSurface.js";
282
288
  export { clientAnchor, pointTooltipAnchor, surfaceOrigin } from "./src/charts/viz/pointTooltipAnchor.js";
289
+ export { tooltipEnabled, tooltipLevels } from "./src/charts/viz/tooltipEnabled.js";
283
290
  export { pointVoronoi, polygonDistance } from "./src/charts/viz/pointVoronoi.js";
284
291
  export { boxCoverage, boxesOverlap, boxHitsCircle, placeCircleLabels, ringCentroid, sideBox, sideOrder } from "./src/charts/features/circleLabelPlacement.js";
285
292
  export { emitOutsideLabels, insideFontMin, labelFitsInside, labelPositionOf, layoutCircleLabels, measureLabel, outsideLabels, pointLabelSettings, sideAnchor } from "./src/charts/features/circleLabels.js";
@@ -359,7 +366,10 @@ export { uniqueLinkKeys } from "./src/charts/features/linkKeys.js";
359
366
  export { sankeyLinkIds } from "./src/charts/Sankey/emit.js";
360
367
  export { ringsLinkKeys } from "./src/charts/Rings/emit.js";
361
368
  export { bowedEdge, edgesBetween, fanParallelEdges, firstPerNeighbor, parallelOffsets, slideOnRim } from "./src/charts/Rings/ringsParallel.js";
362
- export { polylineArrowEdge } from "./src/charts/features/curvedArrows.js";
369
+ export { buildRingsEdges, claimRings, placeRings, ringWeights } from "./src/charts/Rings/ringsPlacement.js";
370
+ export { applyRingArc, arcCubics, curveRingsEdge, gapMiddle, ringArcRadius, ringArcCubics, ringRadius } from "./src/charts/Rings/ringsCurves.js";
371
+ export { ringNodeRadii, ringsGeometry, ringsHops, ringsNodeRadii } from "./src/charts/Rings/ringsSizing.js";
372
+ export { cubicsArrowEdge, cubicsPathD, polylineArrowEdge } from "./src/charts/features/curvedArrows.js";
363
373
  export { polylineReach } from "./src/charts/features/polyline.js";
364
374
  export { EDGE_BUNDLE_DEFAULTS, angleCompatibility, bundleEdges, compatibilityGraph, edgeBundleCache, edgeBundleKey, edgeBundleOptions, edgeCompatibility, maxLengthRatio, positionCompatibility, scaleCompatibility, subdividePolyline, visibilityCompatibility } from "./src/charts/features/edgeBundling.js";
365
375
  export { bsplinePolyline, simplifyPolyline, smoothBundle, straightenPolyline } from "./src/charts/features/edgeBundlingSmooth.js";
@@ -6,7 +6,7 @@ import { paintFromShapeConfig, resolveAccessor, shapeConfigFor } from "../featur
6
6
  import { sankeyLabels } from "../Sankey/labels.js";
7
7
  import { alluvialRibbon } from "./layout.js";
8
8
  import { alluvialMeta } from "./meta.js";
9
- import { alluvialTitleNodes } from "./titles.js";
9
+ import { alluvialTitleNodes, alluvialTitleTooltip } from "./titles.js";
10
10
  /** A value as the chart prints it. */ export function formatAlluvialValue(viz, value) {
11
11
  return formatAbbreviate(value, viz.schema.locale);
12
12
  }
@@ -68,6 +68,6 @@ export const alluvialEmit = ({ viz })=>{
68
68
  ...rectCfg,
69
69
  label: nodeLabel(rectCfg)
70
70
  }, c.width, c.height));
71
- out.push(...alluvialTitleNodes(c.titles, c.titleStyle, v.schema.locale));
71
+ out.push(...alluvialTitleNodes(c.titles, c.titleStyle, v.schema.locale, alluvialTitleTooltip(v)));
72
72
  return out;
73
73
  };
@@ -97,7 +97,13 @@ export const alluvialDef = {
97
97
  default: []
98
98
  },
99
99
  /**
100
- Styles the column titles above each column (any TextBox config).
100
+ Styles the column titles above each column (any TextBox config), and
101
+ takes a `titleTooltip`: the tooltip shown when a title is hovered,
102
+ as its text, a function that receives the title and returns it, or
103
+ a tooltip config (as `tooltipConfig`) whose accessors receive the
104
+ title. Unset (the default) or when the
105
+ function returns nothing, a title cut short with an ellipsis shows
106
+ its whole text; `false`, set or returned, shows no tooltip.
101
107
  @type {object}
102
108
  */ {
103
109
  key: "dimensionTitleConfig",
@@ -55,8 +55,14 @@ import { titleHeight, titleNodes } from "../ParallelCoordinates/titles.js";
55
55
  });
56
56
  return titles;
57
57
  }
58
- /** The column title style: `dimensionTitleConfig` over the chart's background ink. */ export function alluvialTitleStyle(viz, titles) {
59
- return {
58
+ /** The column titles' `titleTooltip`, from `dimensionTitleConfig`. */ export function alluvialTitleTooltip(viz) {
59
+ return viz.schema.dimensionTitleConfig?.titleTooltip;
60
+ }
61
+ /**
62
+ The column title style: `dimensionTitleConfig` over the chart's background
63
+ ink, without its `titleTooltip` (see `alluvialTitleTooltip`).
64
+ */ export function alluvialTitleStyle(viz, titles) {
65
+ const style = {
60
66
  fontColor: backgroundInk(viz),
61
67
  fontSize: 12,
62
68
  fontWeight: 600,
@@ -64,6 +70,8 @@ import { titleHeight, titleNodes } from "../ParallelCoordinates/titles.js";
64
70
  verticalAlign: "bottom",
65
71
  ...viz.schema.dimensionTitleConfig ?? {}
66
72
  };
73
+ delete style.titleTooltip;
74
+ return style;
67
75
  }
68
76
  /**
69
77
  Sizes the title boxes to the tallest wrapped title and returns that
@@ -73,8 +81,20 @@ import { titleHeight, titleNodes } from "../ParallelCoordinates/titles.js";
73
81
  for (const t of titles)t.height = height;
74
82
  return height;
75
83
  }
76
- /** The title text nodes: chrome, so no datum and no pointer events. */ export function alluvialTitleNodes(titles, style, locale) {
77
- return titleNodes(titles, style, locale).map((node)=>({
84
+ /**
85
+ The title text nodes, as chrome with no datum: a title takes the pointer
86
+ only when it has a tooltip to show, the option's or, drawn cut short, its
87
+ whole text.
88
+ @param titles The sized title boxes.
89
+ @param style The title style.
90
+ @param locale The chart's locale.
91
+ @param tooltip `dimensionTitleConfig`'s `titleTooltip`.
92
+ */ export function alluvialTitleNodes(titles, style, locale, tooltip) {
93
+ const tooltips = new Map(titles.map((t)=>[
94
+ t.key,
95
+ tooltip
96
+ ]));
97
+ return titleNodes(titles, style, locale, tooltips).map((node)=>({
78
98
  ...node,
79
99
  key: `alluvial-${String(node.key)}`
80
100
  }));
@@ -2,7 +2,7 @@
2
2
  `arcDiagramEmit` — ArcDiagram's scene: the arcs (longest first), a wider
3
3
  transparent hit path over each so thin arcs are easy to point at, their
4
4
  arrowheads, the nodes, and the node labels.
5
- */ import { edgeArrowTrims } from "../features/edgeArrows.js";
5
+ */ import { edgeArrowTrims, emphasizedArrowEdge, scaledArrowSize, scaledStrokeWidth } from "../features/edgeArrows.js";
6
6
  import { backgroundImageNode } from "../features/backgroundImageEmit.js";
7
7
  import { paintFromShapeConfig, shapeConfigFor } from "../features/emitHelpers.js";
8
8
  import { linkAriaLabel, linkHitPath } from "../features/linkInteraction.js";
@@ -49,19 +49,23 @@ import { selfLoopArrows, selfLoopD } from "../features/selfLoops.js";
49
49
  });
50
50
  }
51
51
  /** An arc's scene key. */ const arcLinkKey = (link)=>`arc-link-${link.source.id}-${link.target.id}-${link.index}`;
52
- /** Arrowheads at an arc's (or loop's) selected ends, each pointing along it into its node. */ function arcArrows(viz, link, stroke, key) {
52
+ /**
53
+ Arrowheads at an arc's (or loop's) selected ends, each pointing along it
54
+ into its node, sized for `scale` times its stroke (see
55
+ `emphasizedArrowEdge`).
56
+ */ function arcArrows(viz, link, stroke, key, scale = 1) {
53
57
  const datum = link.datum;
54
58
  if (link.loop) return selfLoopArrows({
55
59
  arrows: viz.schema.arrows,
56
- arrowSize: viz.schema.arrowSize,
57
- strokeWidth: link.size,
60
+ arrowSize: scaledArrowSize(viz.schema.arrowSize, scale),
61
+ strokeWidth: scaledStrokeWidth(link.size, scale),
58
62
  datum,
59
63
  i: link.index,
60
64
  keyPrefix: key,
61
65
  fill: stroke,
62
66
  loop: link.loop
63
67
  });
64
- const trims = arcTrims(viz, link);
68
+ const trims = arcTrims(viz, link, scale);
65
69
  if (!trims.ends.source && !trims.ends.target) return [];
66
70
  return chordArrowNodes({
67
71
  ends: arcArrowEdge(link.arc, trims, arcInsets(link)),
@@ -74,17 +78,18 @@ import { selfLoopArrows, selfLoopD } from "../features/selfLoops.js";
74
78
  /**
75
79
  An arc's (or loop's) visible stroke: along it up to each arrowhead's
76
80
  base, then along the head's axis to end inside it (see `arcArrowEdge`),
77
- whose tips sit a pixel out past the nodes.
78
- */ export function arcVisibleD(viz, link) {
79
- const trims = arcTrims(viz, link);
81
+ whose tips sit a pixel out past the nodes. `scale` widens the stroke
82
+ (see `emphasizedArrowEdge`).
83
+ */ export function arcVisibleD(viz, link, scale = 1) {
84
+ const trims = arcTrims(viz, link, scale);
80
85
  if (!trims.source && !trims.target) return link.d;
81
86
  if (link.loop) return selfLoopD(link.loop, trims);
82
87
  return arcArrowEdge(link.arc, trims, arcInsets(link)).d;
83
88
  }
84
- /** An arc's arrow ends, size, and stroke trims. */ const arcTrims = (viz, link)=>edgeArrowTrims({
89
+ /** An arc's arrow ends, size, and stroke trims, `scale` times as wide. */ const arcTrims = (viz, link, scale = 1)=>edgeArrowTrims({
85
90
  arrows: viz.schema.arrows,
86
- arrowSize: viz.schema.arrowSize,
87
- strokeWidth: link.size,
91
+ arrowSize: scaledArrowSize(viz.schema.arrowSize, scale),
92
+ strokeWidth: scaledStrokeWidth(link.size, scale),
88
93
  datum: link.datum,
89
94
  i: link.index
90
95
  });
@@ -105,10 +110,19 @@ import { selfLoopArrows, selfLoopD } from "../features/selfLoops.js";
105
110
  const stroke = linkColor(datum, link);
106
111
  if (stroke) paint.stroke = stroke;
107
112
  const key = arcLinkKey(link);
113
+ const fill = typeof paint.stroke === "string" ? paint.stroke : undefined;
114
+ const arrowKey = `arc-arrow-${link.source.id}-${link.target.id}-${link.index}`;
115
+ const edge = emphasizedArrowEdge((scale)=>({
116
+ d: arcVisibleD(viz, link, scale),
117
+ arrows: arcArrows(viz, link, fill, arrowKey, scale)
118
+ }));
108
119
  arcs.push({
109
120
  type: "path",
110
121
  key,
111
- d: arcVisibleD(viz, link),
122
+ d: edge.d,
123
+ ...edge.emphasis ? {
124
+ emphasis: edge.emphasis
125
+ } : {},
112
126
  datum,
113
127
  index: link.index,
114
128
  paint,
@@ -117,7 +131,7 @@ import { selfLoopArrows, selfLoopD } from "../features/selfLoops.js";
117
131
  }
118
132
  });
119
133
  hits.push(linkHitPath(key, link.d, datum, link.size));
120
- arrows.push(...arcArrows(viz, link, typeof paint.stroke === "string" ? paint.stroke : undefined, `arc-arrow-${link.source.id}-${link.target.id}-${link.index}`));
134
+ arrows.push(...edge.arrows);
121
135
  }
122
136
  return [
123
137
  ...arcs,
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  ArcDiagram's pointer handlers. Hovering a node highlights it, its
3
3
  neighbors, and the arcs between them; hovering an arc highlights it and
4
- its two ends. Clicking a node or arc focuses the same set and zooms to it
4
+ its two ends; hovering a legend item highlights its nodes and the arcs
5
+ between them. Clicking a node or arc focuses the same set and zooms to it
5
6
  (clicking it again, or the background, resets), and clicking a legend
6
7
  item focuses its nodes, as Network does.
7
- */ import { isLinkDatum, linkMeta } from "../features/linkInteraction.js";
8
+ */ import { isLinkDatum, legendHighlight, linkMeta } from "../features/linkInteraction.js";
8
9
  import { graphNodeId, zoomToNodeBounds } from "../Network/graph.js";
9
10
  import { arcBox } from "./arcGeometry.js";
10
11
  /**
@@ -83,6 +84,9 @@ import { arcBox } from "./arcGeometry.js";
83
84
  /** Installs ArcDiagram's hover, click, and legend-click handlers. */ export function setupArcEvents(viz) {
84
85
  const v = viz;
85
86
  viz.schema.on.mouseenter = ()=>undefined;
87
+ viz.schema.on["mouseenter.legend"] = (d, i)=>{
88
+ v.hover(legendHighlight(viz, d, i));
89
+ };
86
90
  viz.schema.on["mouseleave.shape"] = ()=>{
87
91
  v.hover(false);
88
92
  };
@@ -21,6 +21,7 @@ import { sceneInsetRegion } from "../pipeline/insetPlacement.js";
21
21
  import { isPointShape } from "../viz/nearestHover.js";
22
22
  import { effectiveDuration } from "../viz/reducedMotion.js";
23
23
  import { linkMeta, linkTooltipConfig } from "../features/linkInteraction.js";
24
+ import { nodeStatsFields } from "../features/nodeStats.js";
24
25
  import { isSelfLoopMark } from "../features/selfLoops.js";
25
26
  import { installGraphFluent } from "../Network/graphFluent.js";
26
27
  import { clusterFields, installClusters } from "../Network/clusters.js";
@@ -159,6 +160,7 @@ export const arcDiagramDef = {
159
160
  */ {
160
161
  key: "nodeTooltipLinks"
161
162
  },
163
+ ...nodeStatsFields(),
162
164
  /**
163
165
  The order of the nodes along the line: `"data"` (the default, their
164
166
  order in `nodes`), `"label"`, `"group"`, `"degree"` (most connected
@@ -32,16 +32,9 @@ export const barChartDef = {
32
32
  },
33
33
  /**
34
34
  With `barWidth`, adds each bar's share of the total width to its
35
- category's axis label: on a second line beneath the name along a
36
- horizontal axis, in parentheses after it along a vertical one. Along
37
- a horizontal axis, a name wraps to fit a narrow bar, widening into
38
- room its neighbors leave; a label that still can't fit is left out,
39
- and the labels rotate, showing the name alone, only when half or
40
- more can't fit. `"opposite"` puts the shares on the axis across the
41
- bars from the names instead: above them along a horizontal axis
42
- (`x2Config`), right of them along a vertical one (`y2Config`). In
43
- small multiples, each panel's shares are of that panel's own total
44
- width. Off (`false`) by default.
35
+ category's axis label ("Retail" over "50%"). `"opposite"` puts the
36
+ shares on the axis across from the names (`x2Config`/`y2Config`).
37
+ Off (`false`) by default.
45
38
  */ {
46
39
  key: "barWidthShare",
47
40
  default: false
@@ -43,6 +43,8 @@ export const calendarDef = {
43
43
  };
44
44
  }
45
45
  },
46
+ // Its tooltip has a "Value" row of its own.
47
+ colorScaleTooltip: false,
46
48
  ctx: {},
47
49
  fields: [
48
50
  /**
@@ -151,16 +151,10 @@ export const candlestickDef = {
151
151
  factory: ()=>defaultKeyedAccessor("close")
152
152
  },
153
153
  /**
154
- Accessor (or data key) for each period's traded volume. Off by
155
- default; when set, a strip under the candles draws one bar per
156
- candle, as tall as its volume on the strip's own axis (ticks
157
- abbreviated, e.g. "1.2M"), in its candle's up or down color, and the
158
- tooltip adds a Volume row. Bars are always filled, hollow candles
159
- included, and take `shapeConfig.texture` and
160
- `shapeConfig.backgroundImage` like filled candles; they hover with
161
- their candle. The price axis shrinks to make room, and the x axis
162
- sits under the strip. Merged rows add their volumes; an `aggs` entry
163
- overrides it as it does for `open`. Set `false` to turn it off.
154
+ Accessor (or data key) for each period's traded volume. When set, a
155
+ strip under the candles draws one bar per candle, as tall as its
156
+ volume, in its candle's up or down color (see `volumeConfig`), and
157
+ the tooltip adds a Volume row. Off (`false`) by default.
164
158
  */ {
165
159
  key: "volume",
166
160
  coerce: volumeAccessor
@@ -99,7 +99,8 @@ export const applyGanttLayout = ({ viz })=>{
99
99
  const block = Math.min(available, rows.length * MAX_ROW_STEP);
100
100
  const rowsTop = top ? size.height + size.padding : size.padding;
101
101
  // The axis box ends below the rows, so its grid spans them and a bottom
102
- // axis sits right under the last row.
102
+ // axis sits right under the last row. The pointer passes through it to
103
+ // the rows, all but its labels with a tooltip.
103
104
  const scale = renderTimeAxis(v, {
104
105
  ...frame,
105
106
  height: block + size.height + size.padding * 2,
@@ -108,9 +109,6 @@ export const applyGanttLayout = ({ viz })=>{
108
109
  y: 0
109
110
  },
110
111
  key: "gantt-axis"
111
- }, {
112
- interactive: false,
113
- interactionGroup: "axis"
114
112
  });
115
113
  const x = (t)=>column + scale(t);
116
114
  const bands = scaleBand().domain(rows.map((_, k)=>k)).paddingInner(Number(v.schema.paddingInner) || 0).paddingOuter(Number(v.schema.paddingOuter) || 0).range([
@@ -6,7 +6,7 @@
6
6
  top to hover.
7
7
  */ import { interpolateRgb } from "d3-interpolate";
8
8
  import { chordArrowNodes, polylineArrowEdge } from "../features/curvedArrows.js";
9
- import { edgeArrowTrims } from "../features/edgeArrows.js";
9
+ import { edgeArrowTrims, emphasizedArrowEdge, scaledArrowSize, scaledStrokeWidth } from "../features/edgeArrows.js";
10
10
  import { linkColorResolver } from "../features/linkColor.js";
11
11
  import { linkAriaLabel, linkHitPath } from "../features/linkInteraction.js";
12
12
  import { emitLinkLabels } from "../features/linkLabels.js";
@@ -36,12 +36,13 @@ import { pathRuns, polylineMidpoint } from "./flowGeometry.js";
36
36
  its base (`size` further back along the path) to its tip; the stroke
37
37
  follows the path to each base, then runs straight along that chord to
38
38
  end inside the head (see `polylineArrowEdge`). A head goes only on an
39
- end the projection draws.
40
- */ export function flowArrowEdge(viz, link, fill) {
39
+ end the projection draws. `scale` widens the stroke (see
40
+ `emphasizedArrowEdge`).
41
+ */ export function flowArrowEdge(viz, link, fill, scale = 1) {
41
42
  const trims = edgeArrowTrims({
42
43
  arrows: viz.schema.arrows,
43
- arrowSize: viz.schema.arrowSize,
44
- strokeWidth: link.size,
44
+ arrowSize: scaledArrowSize(viz.schema.arrowSize, scale),
45
+ strokeWidth: scaledStrokeWidth(link.size, scale),
45
46
  datum: link.datum,
46
47
  i: link.index
47
48
  });
@@ -95,13 +96,17 @@ import { pathRuns, polylineMidpoint } from "./flowGeometry.js";
95
96
  for (const link of order){
96
97
  const paint = flowLinkPaint(viz, link, color, gray);
97
98
  const key = flowLinkKey(link);
98
- const edge = flowArrowEdge(viz, link, typeof paint.stroke === "string" ? paint.stroke : undefined);
99
+ const fill = typeof paint.stroke === "string" ? paint.stroke : undefined;
100
+ const edge = emphasizedArrowEdge((scale)=>flowArrowEdge(viz, link, fill, scale));
99
101
  // A stroke ending inside its head ends square, so no cap pokes past it.
100
102
  if (edge.arrows.length) paint.strokeLinecap = "butt";
101
103
  paths.push({
102
104
  type: "path",
103
105
  key,
104
106
  d: edge.d,
107
+ ...edge.emphasis ? {
108
+ emphasis: edge.emphasis
109
+ } : {},
105
110
  datum: link.datum,
106
111
  index: link.index,
107
112
  paint,
@@ -70,6 +70,8 @@ export const hexbinDef = {
70
70
  return draw(callback);
71
71
  };
72
72
  },
73
+ // Its tooltip title reads each bin's measure, its colorScale value.
74
+ colorScaleTooltip: false,
73
75
  ctx: {},
74
76
  fields: [
75
77
  /**
@@ -15,7 +15,7 @@
15
15
  */ import accessor from "../../utils/accessor.js";
16
16
  import { makeChart } from "../definition/makeChart.js";
17
17
  import { rowLegend, shareRow } from "../features/sharedFields.js";
18
- import { partitionDefaultSort, partitionLegendSort, partitionSetup, partitionSortDecorate, partitionSumCoerce, partitionSumOnSet, partitionThreshold } from "../partition/chartFields.js";
18
+ import { partitionDefaultSort, partitionLegendSort, partitionSetup, partitionShapeDepth, partitionSortDecorate, partitionSumCoerce, partitionSumOnSet, partitionThreshold } from "../partition/chartFields.js";
19
19
  import { partitionShadeDefaults } from "../partition/shade.js";
20
20
  import { applyIcicleLayout } from "./applyLayout.js";
21
21
  import { icicleEmit } from "./emit.js";
@@ -28,6 +28,8 @@ export const icicleDef = {
28
28
  thresholdFunction: partitionThreshold,
29
29
  // Shading applies only while the default colors stay in place.
30
30
  setup: (viz)=>partitionSetup(viz, icicleInteraction),
31
+ // Each node reports its own `groupBy` level to the `tooltip` accessor.
32
+ shapeDepth: partitionShapeDepth(icicleInteraction),
31
33
  ctx: {},
32
34
  fields: [
33
35
  /**
@@ -2,9 +2,14 @@
2
2
  `applyMatrixLayout` — Matrix's chart-specific layout stage.
3
3
 
4
4
  Two-pass axis layout: measure-only pass for padding, then compute-mode
5
- render that absorbs row/column axis scenes into `_chartScene`. Stashes
6
- `columnScale`/`rowScale`/`cellWidth`/`cellHeight` on `viz.ctx`.
7
- */ import { chartBounds } from "../features/chartGeometry.js";
5
+ render that absorbs row/column axis scenes into `_chartScene` as chrome
6
+ (see `inertAxis`), their labels following the hover (see
7
+ `tagHoverTicks`). Stashes `columnScale`/`rowScale`/`cellWidth`/
8
+ `cellHeight` on `viz.ctx`.
9
+ */ import { inertAxis } from "../../components/Axis/axisTooltipTargets.js";
10
+ import { defaultMaxSize } from "../../components/Axis/axisMaxSize.js";
11
+ import { chartBounds } from "../features/chartGeometry.js";
12
+ import { tagHoverTicks } from "../features/hoverTicks.js";
8
13
  import matrixPrepData from "../helpers/matrixData.js";
9
14
  export const applyMatrixLayout = ({ viz })=>{
10
15
  const prep = matrixPrepData.bind(viz)(viz._filteredData);
@@ -27,7 +32,8 @@ export const applyMatrixLayout = ({ viz })=>{
27
32
  const columnAxis = viz.ctx.columnAxis;
28
33
  const rowConfig = viz.schema.rowConfig;
29
34
  const columnConfig = viz.schema.columnConfig;
30
- rowAxis.domain(rowValues).height(height - viz._padding.bottom - viz._padding.top).maxSize(width / 4).width(width).config(rowConfig).measure();
35
+ rowAxis.domain(rowValues).height(height - viz._padding.bottom - viz._padding.top).maxSize(width / 4).width(width).config(rowConfig);
36
+ defaultMaxSize(rowAxis, rowConfig).measure();
31
37
  const rowPadding = rowAxis.outerBounds().width;
32
38
  viz._padding.left += rowPadding;
33
39
  // `width` from chartBounds already excludes both margins, so the right edge
@@ -37,7 +43,8 @@ export const applyMatrixLayout = ({ viz })=>{
37
43
  columnAxis.domain(columnValues).range([
38
44
  viz._margin.left + viz._padding.left,
39
45
  viz._margin.left + width - viz._padding.right
40
- ]).height(height).maxSize(height / 4).width(width).labelRotation(columnRotation).config(columnConfig).measure();
46
+ ]).height(height).maxSize(height / 4).width(width).labelRotation(columnRotation).config(columnConfig);
47
+ defaultMaxSize(columnAxis, columnConfig).measure();
41
48
  const columnPadding = columnAxis.outerBounds().height;
42
49
  viz._padding.top += columnPadding;
43
50
  // Compute-mode render → absorb each axis scene.
@@ -47,7 +54,7 @@ export const applyMatrixLayout = ({ viz })=>{
47
54
  ]).render();
48
55
  const rowScene = rowAxis.toScene();
49
56
  if (rowScene) {
50
- (viz._chartScene ||= []).push({
57
+ const group = {
51
58
  type: "group",
52
59
  key: "matrix-row-axis",
53
60
  transform: {
@@ -55,7 +62,9 @@ export const applyMatrixLayout = ({ viz })=>{
55
62
  y: 0
56
63
  },
57
64
  children: rowScene.children ?? []
58
- });
65
+ };
66
+ tagHoverTicks(group, "row");
67
+ (viz._chartScene ||= []).push(inertAxis(group));
59
68
  }
60
69
  columnAxis.renderMode("compute").select(undefined).range([
61
70
  viz._margin.left + viz._padding.left + rowAxis.padding(),
@@ -63,7 +72,7 @@ export const applyMatrixLayout = ({ viz })=>{
63
72
  ]).maxSize(columnPadding).render();
64
73
  const colScene = columnAxis.toScene();
65
74
  if (colScene) {
66
- (viz._chartScene ||= []).push({
75
+ const group = {
67
76
  type: "group",
68
77
  key: "matrix-column-axis",
69
78
  transform: {
@@ -71,7 +80,9 @@ export const applyMatrixLayout = ({ viz })=>{
71
80
  y: 0
72
81
  },
73
82
  children: colScene.children ?? []
74
- });
83
+ };
84
+ tagHoverTicks(group, "column");
85
+ (viz._chartScene ||= []).push(inertAxis(group));
75
86
  }
76
87
  const rowScale = rowAxis._getPosition.bind(rowAxis);
77
88
  const columnScale = columnAxis._getPosition.bind(columnAxis);
@@ -45,7 +45,25 @@ export const matrixDef = {
45
45
  const column = getProp.bind(viz)("column", d, i);
46
46
  // Without a colorScale every cell has a value to highlight.
47
47
  const colorScale = viz.schema.colorScale;
48
- viz.hover((h, ii)=>(getProp.bind(viz)("row", h, ii) === row || getProp.bind(viz)("column", h, ii) === column) && (typeof colorScale !== "function" || typeof colorScale(h, ii) === "number"));
48
+ const hasValue = (h, ii)=>{
49
+ if (typeof colorScale !== "function") return true;
50
+ const value = colorScale(h, ii);
51
+ // A bivariate colorScale reads a pair of values.
52
+ return typeof value === "number" || Array.isArray(value);
53
+ };
54
+ const hover = (h, ii)=>(getProp.bind(viz)("row", h, ii) === row || getProp.bind(viz)("column", h, ii) === column) && hasValue(h, ii);
55
+ // The crosshair lights the whole row and column; only the hovered
56
+ // cell's row and column labels stay bright.
57
+ viz._hoverFocus = {
58
+ hover,
59
+ rows: [
60
+ {
61
+ row,
62
+ column
63
+ }
64
+ ]
65
+ };
66
+ viz.hover(hover);
49
67
  };
50
68
  },
51
69
  // Small-multiple panels as close to square as the grid allows.
@@ -64,12 +64,37 @@ const buildNetworkLinks = resolveGraphLinks;
64
64
  n.fy = p[1];
65
65
  });
66
66
  }
67
+ /**
68
+ Places `lone` (nodes no link pulls on) in rows under `placed`, as far
69
+ apart as the placed nodes typically sit from their nearest neighbor,
70
+ the rows centered beneath them. Without placed nodes the rows form a
71
+ square-ish grid.
72
+ */ export function placeLoneNodes(placed, lone) {
73
+ if (!lone.length) return;
74
+ // The median distance from each placed node to its nearest neighbor.
75
+ const nearest = placed.map((n)=>Math.min(...placed.filter((m)=>m !== n).map((m)=>Math.hypot(m.fx - n.fx, m.fy - n.fy)))).filter((d)=>d > 0 && Number.isFinite(d)).sort((a, b)=>a - b);
76
+ const step = nearest.length ? nearest[Math.floor(nearest.length / 2)] : 1;
77
+ const xs = placed.map((n)=>n.fx);
78
+ const ys = placed.map((n)=>n.fy);
79
+ const left = xs.length ? Math.min(...xs) : 0;
80
+ const right = xs.length ? Math.max(...xs) : 0;
81
+ const bottom = ys.length ? Math.max(...ys) : -step;
82
+ const columns = Math.max(Math.ceil(Math.sqrt(lone.length)), Math.floor((right - left) / step) + 1);
83
+ const center = (left + right) / 2;
84
+ lone.forEach((n, i)=>{
85
+ const row = Math.floor(i / columns);
86
+ const inRow = Math.min(columns, lone.length - row * columns);
87
+ n.fx = center + (i % columns - (inRow - 1) / 2) * step;
88
+ n.fy = bottom + (row + 1) * step;
89
+ });
90
+ }
67
91
  /**
68
92
  Gives every node an `fx`/`fy`: its own x/y, or — when any node lacks
69
- them — a force-simulated position. The simulation depends only on the
70
- node ids and links, so its result is cached on `v.ctx` and reused by the
71
- size legend's pre-layout estimate and the layout that follows it. Links
72
- from a node to itself don't take part.
93
+ them — a force-simulated position. Nodes no link pulls on sit out the
94
+ simulation, in rows under the rest (see `placeLoneNodes`). The layout
95
+ depends only on the node ids and links, so its result is cached on
96
+ `v.ctx` and reused by the size legend's pre-layout estimate and the
97
+ layout that follows it. Links from a node to itself don't take part.
73
98
  */ function positionNetworkNodes(v, nodes, links) {
74
99
  if (!nodes.some((n)=>n.fx === undefined || n.fy === undefined)) return;
75
100
  // Only links between two resolved, distinct nodes pull on the layout.
@@ -83,7 +108,13 @@ const buildNetworkLinks = resolveGraphLinks;
83
108
  });
84
109
  return;
85
110
  }
86
- runForceLayout(nodes, pulling);
111
+ const linked = new Set(pulling.flatMap((l)=>[
112
+ l.source,
113
+ l.target
114
+ ]));
115
+ const placed = nodes.filter((n)=>linked.has(n));
116
+ if (placed.length) runForceLayout(placed, pulling);
117
+ placeLoneNodes(placed, nodes.filter((n)=>!linked.has(n)));
87
118
  v.ctx.networkForceCache = {
88
119
  key,
89
120
  positions: nodes.map((n)=>[
@@ -41,10 +41,10 @@ import { isSelfLoop } from "../features/selfLoops.js";
41
41
  ].reverse(), rTarget + 1)
42
42
  };
43
43
  }
44
- /** A bundled link's arrowhead ends, size, and stroke trims. */ function bundledTrims(viz, datum, i, strokeWidth) {
44
+ /** A bundled link's arrowhead ends, size, and stroke trims. */ function bundledTrims(viz, datum, i, strokeWidth, arrowSize) {
45
45
  return edgeArrowTrims({
46
46
  arrows: viz.schema.arrows,
47
- arrowSize: viz.schema.arrowSize,
47
+ arrowSize,
48
48
  strokeWidth: typeof strokeWidth === "number" ? strokeWidth : undefined,
49
49
  datum,
50
50
  i
@@ -53,9 +53,10 @@ import { isSelfLoop } from "../features/selfLoops.js";
53
53
  /**
54
54
  A bundled link's visible stroke and arrowheads: the stroke follows the
55
55
  path and ends inside each head, and each head's tip sits a pixel off its
56
- node, aimed along the path (see `polylineArrowEdge`).
56
+ node, aimed along the path (see `polylineArrowEdge`). `arrowSize`
57
+ defaults to the chart's.
57
58
  */ export function bundledLinkEdge(viz, link, opts) {
58
- const trims = bundledTrims(viz, opts.datum, opts.i, opts.strokeWidth);
59
+ const trims = bundledTrims(viz, opts.datum, opts.i, opts.strokeWidth, "arrowSize" in opts ? opts.arrowSize : viz.schema.arrowSize);
59
60
  const tipBack = bundledTipBack(link.points, link.source?.r ?? 0, link.target?.r ?? 0);
60
61
  const { d, source, target } = polylineArrowEdge(link.points, trims, tipBack);
61
62
  return {