@heartlandone/vega 1.35.1 → 1.36.1

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 (263) hide show
  1. package/dist/cjs/{app-globals-c8a5e8f9.js → app-globals-10b08b3a.js} +2 -2
  2. package/dist/cjs/{component-b15f9853.js → component-6111461d.js} +1 -1
  3. package/dist/cjs/{designToken-21d31650.js → designToken-0231398e.js} +2 -2
  4. package/dist/cjs/index.cjs.js +6 -6
  5. package/dist/cjs/{injectElementAppender-79e3cece.js → injectElementAppender-a90ff4ba.js} +4 -4
  6. package/dist/cjs/{injectFormFieldController-8fa3cee6.js → injectFormFieldController-be1c3d42.js} +3 -3
  7. package/dist/cjs/{injectKeyboardManager-3603cb45.js → injectKeyboardManager-e858f542.js} +1 -1
  8. package/dist/cjs/{legendInputProcessor-1472b831.js → legendInputProcessor-52b9a7cf.js} +313 -20
  9. package/dist/cjs/loader.cjs.js +6 -6
  10. package/dist/cjs/{log-2402f20e.js → log-0e500258.js} +5 -0
  11. package/dist/cjs/{observer-d6c59015.js → observer-b2f7a866.js} +1 -1
  12. package/dist/cjs/{responsiveFormatFacade-897d74ef.js → responsiveFormatFacade-1635c5dd.js} +1 -1
  13. package/dist/cjs/{themeManager-1d14fe0d.js → themeManager-27f2b6aa.js} +338 -170
  14. package/dist/cjs/{ui-e19fec2a.js → ui-7db8ff4a.js} +4 -10
  15. package/dist/cjs/vega-accordion.cjs.entry.js +343 -67
  16. package/dist/cjs/vega-app-footer.cjs.entry.js +2 -2
  17. package/dist/cjs/vega-app-header-button.cjs.entry.js +6 -6
  18. package/dist/cjs/vega-badge.cjs.entry.js +5 -5
  19. package/dist/cjs/vega-banner_37.cjs.entry.js +45 -18
  20. package/dist/cjs/vega-bar-chart.cjs.entry.js +20 -10
  21. package/dist/cjs/vega-box.cjs.entry.js +5 -5
  22. package/dist/cjs/vega-chip.cjs.entry.js +6 -6
  23. package/dist/cjs/vega-color-picker.cjs.entry.js +6 -6
  24. package/dist/cjs/vega-combo-box.cjs.entry.js +7 -7
  25. package/dist/cjs/vega-dialog.cjs.entry.js +2 -2
  26. package/dist/cjs/vega-header.cjs.entry.js +2 -2
  27. package/dist/cjs/vega-image-uploader.cjs.entry.js +6 -6
  28. package/dist/cjs/vega-input-credit-card.cjs.entry.js +6 -6
  29. package/dist/cjs/vega-item-toggle.cjs.entry.js +14 -5
  30. package/dist/cjs/vega-left-nav-group_3.cjs.entry.js +4 -4
  31. package/dist/cjs/vega-left-nav.cjs.entry.js +4 -4
  32. package/dist/cjs/vega-option.cjs.entry.js +2 -2
  33. package/dist/cjs/vega-page-notification.cjs.entry.js +3 -3
  34. package/dist/cjs/vega-pie-chart.cjs.entry.js +108 -27
  35. package/dist/cjs/vega-popover.cjs.entry.js +8 -8
  36. package/dist/cjs/vega-stepper.cjs.entry.js +6 -6
  37. package/dist/cjs/vega-textarea.cjs.entry.js +6 -6
  38. package/dist/cjs/vega.cjs.js +6 -6
  39. package/dist/cjs/{vueEventPatch-35786f19.js → vueEventPatch-fc311de9.js} +1 -1
  40. package/dist/cjs/{yAxisInputProcessor-93322b28.js → yAxisInputProcessor-2dad0e4b.js} +7 -1
  41. package/dist/cjs/{zIndexManager-e2852632.js → zIndexManager-d4174c1c.js} +1 -1
  42. package/dist/collection/collection-manifest.json +1 -1
  43. package/dist/collection/components/vega-accordion/slimmers/vega-accordion-expand-controller.js +61 -0
  44. package/dist/collection/components/vega-accordion/slimmers/vega-accordion-renderer.js +86 -0
  45. package/dist/collection/components/vega-accordion/vega-accordion.js +21 -77
  46. package/dist/collection/components/vega-image-uploader/vega-image-uploader.js +4 -2
  47. package/dist/collection/components/vega-item-toggle/vega-item-toggle.js +17 -4
  48. package/dist/collection/components/vega-radio/vega-radio.js +4 -1
  49. package/dist/collection/components/vega-tab-group/vega-tab-group.js +23 -0
  50. package/dist/collection/constants/tokens/overridableBorderTokens.js +74 -38
  51. package/dist/collection/constants/tokens/overridableColorTokens.js +248 -124
  52. package/dist/collection/constants/tokens/overridableRingTokens.js +14 -6
  53. package/dist/collection/helpers/chart/barChart.js +12 -6
  54. package/dist/collection/helpers/chart/baseChart.js +15 -2
  55. package/dist/collection/helpers/chart/controllers/chartDimensionController.js +6 -6
  56. package/dist/collection/helpers/chart/drawers/arcPathDrawer.js +21 -3
  57. package/dist/collection/helpers/chart/drawers/baseDrawer.js +6 -2
  58. package/dist/collection/helpers/chart/drawers/legendDrawer.js +23 -3
  59. package/dist/collection/helpers/chart/drawers/lineDrawer.js +3 -0
  60. package/dist/collection/helpers/chart/drawers/pathDrawer.js +3 -0
  61. package/dist/collection/helpers/chart/drawers/rectDrawer.js +6 -2
  62. package/dist/collection/helpers/chart/drawers/textDrawer.js +3 -0
  63. package/dist/collection/helpers/chart/drawers/xAxisDrawer.js +3 -0
  64. package/dist/collection/helpers/chart/drawers/yAxisDrawer.js +3 -0
  65. package/dist/collection/helpers/chart/inputProcessors/layoutInputProcessor.js +3 -2
  66. package/dist/collection/helpers/chart/inputProcessors/legendInputProcessor.js +1 -1
  67. package/dist/collection/helpers/chart/inputProcessors/pieChartTextInputProcessor.js +7 -17
  68. package/dist/collection/helpers/chart/interactingEntryGenerator/arcPathHoverGenerator.js +69 -0
  69. package/dist/collection/helpers/chart/interactingEntryGenerator/interactingEntryGenerator.js +16 -0
  70. package/dist/collection/helpers/chart/interactingEntryGenerator/pieLegendHoverGenerator.js +73 -0
  71. package/dist/collection/helpers/chart/interactors/baseInteractor.js +92 -0
  72. package/dist/collection/helpers/chart/interactors/canvasInteractor.js +6 -0
  73. package/dist/collection/helpers/chart/interactors/interactorFactory.js +26 -0
  74. package/dist/collection/helpers/chart/interactors/svgInteractor.js +29 -0
  75. package/dist/collection/helpers/chart/lineChart.js +6 -5
  76. package/dist/collection/helpers/chart/pieChart.js +7 -5
  77. package/dist/collection/helpers/chart/renderers/canvasRenderer.js +4 -0
  78. package/dist/collection/helpers/chart/renderers/svgRenderer.js +14 -4
  79. package/dist/collection/helpers/chart/test/drawers/arcPathDrawer.test.js +5 -2
  80. package/dist/collection/helpers/chart/test/drawers/legendDrawer.test.js +28 -4
  81. package/dist/collection/helpers/chart/test/drawers/lineDrawer.test.js +3 -1
  82. package/dist/collection/helpers/chart/test/drawers/pathDrawer.test.js +3 -1
  83. package/dist/collection/helpers/chart/test/drawers/rectDrawer.test.js +43 -1
  84. package/dist/collection/helpers/chart/test/drawers/textDrawer.test.js +3 -1
  85. package/dist/collection/helpers/chart/test/drawers/xAxisDrawer.test.js +3 -1
  86. package/dist/collection/helpers/chart/test/drawers/yAxisDrawer.test.js +3 -1
  87. package/dist/collection/helpers/chart/test/interactingEntryGenerator/arcPathHoverGenerator.test.js +11 -0
  88. package/dist/collection/helpers/chart/test/interactingEntryGenerator/pieLegendHoverGenerator.test.js +16 -0
  89. package/dist/collection/helpers/chart/test/interactors/interactorFactory.test.js +19 -0
  90. package/dist/collection/helpers/chart/test/interactors/svgInteractor.test.js +48 -0
  91. package/dist/collection/helpers/feature-control/featureFlagsMap.js +5 -0
  92. package/dist/collection/helpers/theme/tests/themeManagerController.test.js +21 -18
  93. package/dist/collection/slim-core/decorators/index.js +3 -0
  94. package/dist/collection/slim-core/decorators/injectVegaSlimmer.js +83 -0
  95. package/dist/collection/slim-core/decorators/mapToComponentField.js +69 -0
  96. package/dist/collection/slim-core/decorators/mapToComponentMethod.js +20 -0
  97. package/dist/collection/slim-core/decorators/tests/injectVegaSlimmer.test.js +51 -0
  98. package/dist/collection/slim-core/decorators/tests/mapToComponentField.test.js +157 -0
  99. package/dist/collection/slim-core/decorators/tests/mapToComponentMethod.test.js +65 -0
  100. package/dist/collection/slim-core/helpers/index.js +1 -0
  101. package/dist/collection/slim-core/helpers/vegaSlimmer.js +5 -0
  102. package/dist/collection/slim-core/index.js +2 -0
  103. package/dist/collection/utils/test/ui.test.js +13 -1
  104. package/dist/collection/utils/ui.js +3 -9
  105. package/dist/collection/{adapters → value-model-adapters}/angularNgModelAccessorAdapter.js +9 -5
  106. package/dist/collection/value-model-adapters/vueComponentVModelAdaptor.js +24 -0
  107. package/dist/esm/{app-globals-a15d35b8.js → app-globals-efa3f0ae.js} +2 -2
  108. package/dist/esm/{component-29a92832.js → component-75db1978.js} +1 -1
  109. package/dist/esm/{designToken-3bf3b1d6.js → designToken-d02da653.js} +2 -2
  110. package/dist/esm/index.js +6 -6
  111. package/dist/esm/{injectElementAppender-0de4f40a.js → injectElementAppender-3ed44f5d.js} +4 -4
  112. package/dist/esm/{injectFormFieldController-c0e1c16b.js → injectFormFieldController-497e0dbd.js} +3 -3
  113. package/dist/esm/{injectKeyboardManager-304dfad9.js → injectKeyboardManager-c4092ea9.js} +1 -1
  114. package/dist/esm/{legendInputProcessor-b4179fc8.js → legendInputProcessor-aea5690d.js} +312 -20
  115. package/dist/esm/loader.js +6 -6
  116. package/dist/esm/{log-20e1576f.js → log-8e753299.js} +5 -0
  117. package/dist/esm/{observer-8a6152cd.js → observer-bb866830.js} +1 -1
  118. package/dist/esm/{responsiveFormatFacade-26b73441.js → responsiveFormatFacade-7788442f.js} +1 -1
  119. package/dist/esm/{themeManager-039f6d6d.js → themeManager-f1144d55.js} +338 -170
  120. package/dist/esm/{ui-f450ca41.js → ui-bcbcd962.js} +4 -10
  121. package/dist/esm/vega-accordion.entry.js +344 -68
  122. package/dist/esm/vega-app-footer.entry.js +2 -2
  123. package/dist/esm/vega-app-header-button.entry.js +6 -6
  124. package/dist/esm/vega-badge.entry.js +5 -5
  125. package/dist/esm/vega-banner_37.entry.js +45 -18
  126. package/dist/esm/vega-bar-chart.entry.js +20 -10
  127. package/dist/esm/vega-box.entry.js +5 -5
  128. package/dist/esm/vega-chip.entry.js +6 -6
  129. package/dist/esm/vega-color-picker.entry.js +6 -6
  130. package/dist/esm/vega-combo-box.entry.js +7 -7
  131. package/dist/esm/vega-dialog.entry.js +2 -2
  132. package/dist/esm/vega-header.entry.js +2 -2
  133. package/dist/esm/vega-image-uploader.entry.js +6 -6
  134. package/dist/esm/vega-input-credit-card.entry.js +6 -6
  135. package/dist/esm/vega-item-toggle.entry.js +14 -5
  136. package/dist/esm/vega-left-nav-group_3.entry.js +4 -4
  137. package/dist/esm/vega-left-nav.entry.js +4 -4
  138. package/dist/esm/vega-option.entry.js +2 -2
  139. package/dist/esm/vega-page-notification.entry.js +3 -3
  140. package/dist/esm/vega-pie-chart.entry.js +108 -27
  141. package/dist/esm/vega-popover.entry.js +8 -8
  142. package/dist/esm/vega-stepper.entry.js +6 -6
  143. package/dist/esm/vega-textarea.entry.js +6 -6
  144. package/dist/esm/vega.js +6 -6
  145. package/dist/esm/{vueEventPatch-871f2112.js → vueEventPatch-a21203dd.js} +1 -1
  146. package/dist/esm/{yAxisInputProcessor-4ccf2e0f.js → yAxisInputProcessor-5a39409d.js} +7 -1
  147. package/dist/esm/{zIndexManager-d58c79ec.js → zIndexManager-908c4553.js} +1 -1
  148. package/dist/types/components/vega-accordion/slimmers/vega-accordion-expand-controller.d.ts +14 -0
  149. package/dist/types/components/vega-accordion/slimmers/vega-accordion-renderer.d.ts +19 -0
  150. package/dist/types/components/vega-accordion/vega-accordion.d.ts +4 -9
  151. package/dist/types/components/vega-image-uploader/types.d.ts +6 -0
  152. package/dist/types/components/vega-image-uploader/vega-image-uploader.d.ts +1 -5
  153. package/dist/types/components/vega-item-toggle/vega-item-toggle.d.ts +8 -1
  154. package/dist/types/components/vega-tab-group/vega-tab-group.d.ts +12 -0
  155. package/dist/types/components.d.ts +4 -3
  156. package/dist/types/helpers/chart/barChart.d.ts +3 -1
  157. package/dist/types/helpers/chart/baseChart.d.ts +9 -2
  158. package/dist/types/helpers/chart/controllers/chartDimensionController.d.ts +16 -6
  159. package/dist/types/helpers/chart/drawers/arcPathDrawer.d.ts +14 -2
  160. package/dist/types/helpers/chart/drawers/baseDrawer.d.ts +10 -3
  161. package/dist/types/helpers/chart/drawers/legendDrawer.d.ts +12 -1
  162. package/dist/types/helpers/chart/drawers/lineDrawer.d.ts +2 -0
  163. package/dist/types/helpers/chart/drawers/pathDrawer.d.ts +2 -0
  164. package/dist/types/helpers/chart/drawers/rectDrawer.d.ts +2 -0
  165. package/dist/types/helpers/chart/drawers/textDrawer.d.ts +2 -0
  166. package/dist/types/helpers/chart/drawers/xAxisDrawer.d.ts +2 -0
  167. package/dist/types/helpers/chart/drawers/yAxisDrawer.d.ts +2 -0
  168. package/dist/types/helpers/chart/graphContextFactory.d.ts +1 -1
  169. package/dist/types/helpers/chart/inputProcessors/formatTimePositionsInputProcessor.d.ts +1 -2
  170. package/dist/types/helpers/chart/inputProcessors/legendInputProcessor.d.ts +1 -2
  171. package/dist/types/helpers/chart/inputProcessors/linePathInputProcessor.d.ts +1 -2
  172. package/dist/types/helpers/chart/inputProcessors/sortPositionsInputProcessor.d.ts +1 -2
  173. package/dist/types/helpers/chart/inputProcessors/xAxisInputProcessor.d.ts +2 -3
  174. package/dist/types/helpers/chart/inputProcessors/yAxisInputProcessor.d.ts +2 -3
  175. package/dist/types/helpers/chart/interactingEntryGenerator/arcPathHoverGenerator.d.ts +38 -0
  176. package/dist/types/helpers/chart/interactingEntryGenerator/interactingEntryGenerator.d.ts +17 -0
  177. package/dist/types/helpers/chart/interactingEntryGenerator/pieLegendHoverGenerator.d.ts +42 -0
  178. package/dist/types/helpers/chart/interactors/baseInteractor.d.ts +54 -0
  179. package/dist/types/helpers/chart/interactors/canvasInteractor.d.ts +6 -0
  180. package/dist/types/helpers/chart/interactors/interactorFactory.d.ts +15 -0
  181. package/dist/types/helpers/chart/interactors/svgInteractor.d.ts +19 -0
  182. package/dist/types/helpers/chart/lineChart.d.ts +5 -5
  183. package/dist/types/helpers/chart/pieChart.d.ts +3 -1
  184. package/dist/types/helpers/chart/renderers/baseRenderer.d.ts +2 -2
  185. package/dist/types/helpers/chart/renderers/canvasRenderer.d.ts +4 -2
  186. package/dist/types/helpers/chart/renderers/svgRenderer.d.ts +4 -2
  187. package/dist/types/helpers/chart/test/interactingEntryGenerator/arcPathHoverGenerator.test.d.ts +1 -0
  188. package/dist/types/helpers/chart/test/interactingEntryGenerator/pieLegendHoverGenerator.test.d.ts +1 -0
  189. package/dist/types/helpers/chart/test/interactors/interactorFactory.test.d.ts +1 -0
  190. package/dist/types/helpers/chart/test/interactors/svgInteractor.test.d.ts +1 -0
  191. package/dist/types/helpers/feature-control/featureFlag.d.ts +2 -1
  192. package/dist/types/helpers/theme/theme.d.ts +3 -1
  193. package/dist/types/slim-core/decorators/index.d.ts +3 -0
  194. package/dist/types/slim-core/decorators/injectVegaSlimmer.d.ts +10 -0
  195. package/dist/types/slim-core/decorators/mapToComponentField.d.ts +16 -0
  196. package/dist/types/slim-core/decorators/mapToComponentMethod.d.ts +14 -0
  197. package/dist/types/slim-core/decorators/tests/injectVegaSlimmer.test.d.ts +1 -0
  198. package/dist/types/slim-core/decorators/tests/mapToComponentField.test.d.ts +1 -0
  199. package/dist/types/slim-core/decorators/tests/mapToComponentMethod.test.d.ts +1 -0
  200. package/dist/types/slim-core/helpers/index.d.ts +1 -0
  201. package/dist/types/slim-core/helpers/vegaSlimmer.d.ts +5 -0
  202. package/dist/types/slim-core/index.d.ts +2 -0
  203. package/dist/types/slim-core/types.d.ts +1 -0
  204. package/dist/types/types/general.d.ts +3 -1
  205. package/dist/types/types/publicApi.d.ts +2 -1
  206. package/dist/types/types/vegaChart.d.ts +22 -4
  207. package/dist/types/utils/ui.d.ts +3 -2
  208. package/dist/vega/index.esm.js +1 -1
  209. package/dist/vega/{p-d5f30079.js → p-0a3120cc.js} +1 -1
  210. package/dist/vega/{p-b19f5a42.js → p-0f795d6f.js} +1 -1
  211. package/dist/vega/{p-18303b35.entry.js → p-1eafa2d1.entry.js} +1 -1
  212. package/dist/vega/{p-2f7d0df1.entry.js → p-2303c27b.entry.js} +1 -1
  213. package/dist/vega/{p-ad1cc031.entry.js → p-277b69c8.entry.js} +1 -1
  214. package/dist/vega/{p-e4e3051e.js → p-2cd0480f.js} +1 -1
  215. package/dist/vega/p-343a84d4.entry.js +1 -0
  216. package/dist/vega/{p-07196814.entry.js → p-4c83d807.entry.js} +1 -1
  217. package/dist/vega/{p-e9f34e2f.entry.js → p-5876b3ac.entry.js} +1 -1
  218. package/dist/vega/{p-2d88a474.entry.js → p-5ba16da8.entry.js} +1 -1
  219. package/dist/vega/{p-52dee646.js → p-5c12d4a0.js} +1 -1
  220. package/dist/vega/{p-93559728.entry.js → p-6259ac7e.entry.js} +1 -1
  221. package/dist/vega/{p-92335dd1.js → p-62682c58.js} +1 -1
  222. package/dist/vega/{p-a27a16b2.entry.js → p-662ff70e.entry.js} +1 -1
  223. package/dist/vega/p-67c7f040.entry.js +1 -0
  224. package/dist/vega/{p-8af7b766.js → p-6f4a330e.js} +1 -1
  225. package/dist/vega/{p-516d0a12.entry.js → p-70d5cc29.entry.js} +1 -1
  226. package/dist/vega/{p-72cf2d61.entry.js → p-83265565.entry.js} +1 -1
  227. package/dist/vega/{p-bb9b010e.js → p-9819bbbe.js} +1 -1
  228. package/dist/vega/p-a981b648.js +1 -0
  229. package/dist/vega/{p-1622d0a2.entry.js → p-ab3c90d6.entry.js} +1 -1
  230. package/dist/vega/p-ac5abc6b.entry.js +1 -0
  231. package/dist/vega/{p-fbe584e2.entry.js → p-ad64e72a.entry.js} +2 -2
  232. package/dist/vega/p-b2639e28.entry.js +1 -0
  233. package/dist/vega/{p-20c445c4.entry.js → p-b6ea7e54.entry.js} +1 -1
  234. package/dist/vega/{p-8117435e.js → p-b71e2211.js} +1 -1
  235. package/dist/vega/{p-11cd4978.entry.js → p-b87b2fdd.entry.js} +1 -1
  236. package/dist/vega/p-b88f9206.entry.js +1 -0
  237. package/dist/vega/p-c543be28.entry.js +1 -0
  238. package/dist/vega/{p-0c0d0a4f.js → p-c8755706.js} +1 -1
  239. package/dist/vega/{p-0609b0ee.entry.js → p-d35598a9.entry.js} +1 -1
  240. package/dist/vega/{p-03534e40.js → p-d35f96a2.js} +1 -1
  241. package/dist/vega/p-d4e5f9ea.js +1 -0
  242. package/dist/vega/p-d7ce4a09.js +1 -0
  243. package/dist/vega/{p-5e60690c.js → p-d804c019.js} +1 -1
  244. package/dist/vega/{p-d0498951.entry.js → p-dbbf1c6c.entry.js} +1 -1
  245. package/dist/vega/{p-19e82db6.entry.js → p-e8fa28b1.entry.js} +1 -1
  246. package/dist/vega/{p-93f430ad.js → p-f74cac01.js} +1 -1
  247. package/dist/vega/vega.css +1 -1
  248. package/dist/vega/vega.esm.js +1 -1
  249. package/package.json +5 -4
  250. package/style/vega.css +1 -1
  251. package/style/vega_min.css +1 -1
  252. package/dist/collection/adapters/vueComponentVModelAdaptor.js +0 -10
  253. package/dist/vega/p-11076999.js +0 -1
  254. package/dist/vega/p-40099af3.js +0 -1
  255. package/dist/vega/p-401bbc3a.entry.js +0 -1
  256. package/dist/vega/p-4e25b9c1.entry.js +0 -1
  257. package/dist/vega/p-75291831.entry.js +0 -1
  258. package/dist/vega/p-7610dd64.entry.js +0 -1
  259. package/dist/vega/p-77cbbc55.js +0 -1
  260. package/dist/vega/p-7a0db509.entry.js +0 -1
  261. package/dist/vega/p-a516bf82.entry.js +0 -1
  262. /package/dist/types/{adapters → value-model-adapters}/angularNgModelAccessorAdapter.d.ts +0 -0
  263. /package/dist/types/{adapters → value-model-adapters}/vueComponentVModelAdaptor.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const log = require('./log-2402f20e.js');
4
- const themeManager = require('./themeManager-1d14fe0d.js');
3
+ const log = require('./log-0e500258.js');
4
+ const themeManager = require('./themeManager-27f2b6aa.js');
5
5
  const vegaDialogController = require('./vegaDialogController-7b71945a.js');
6
6
 
7
7
  /**
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const log = require('./log-2402f20e.js');
3
+ const log = require('./log-0e500258.js');
4
4
 
5
5
  const exemptionClasses = [
6
6
  'vega-flex-grow',
@@ -2,8 +2,8 @@
2
2
 
3
3
  const typeGuard = require('./typeGuard-bb401d05.js');
4
4
  const breakpoints = require('./breakpoints-23bb4f74.js');
5
- const log = require('./log-2402f20e.js');
6
- const responsiveFormatFacade = require('./responsiveFormatFacade-897d74ef.js');
5
+ const log = require('./log-0e500258.js');
6
+ const responsiveFormatFacade = require('./responsiveFormatFacade-1635c5dd.js');
7
7
 
8
8
  /**
9
9
  * It logs a warning message to the console.
@@ -3,22 +3,22 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const breakpoints = require('./breakpoints-2c150832.js');
6
- const log = require('./log-2402f20e.js');
7
- const designToken = require('./designToken-21d31650.js');
6
+ const log = require('./log-0e500258.js');
7
+ const designToken = require('./designToken-0231398e.js');
8
8
  const string = require('./string-21427167.js');
9
9
  const typeGuard = require('./typeGuard-bb401d05.js');
10
10
  const breakpoints$1 = require('./breakpoints-23bb4f74.js');
11
11
  const icons = require('./icons-44ed411d.js');
12
12
  const typography = require('./typography-9f9d8d04.js');
13
13
  const ui = require('./ui-bbf1eed1.js');
14
- const themeManager = require('./themeManager-1d14fe0d.js');
14
+ const themeManager = require('./themeManager-27f2b6aa.js');
15
15
  const vegaDialogController = require('./vegaDialogController-7b71945a.js');
16
- require('./responsiveFormatFacade-897d74ef.js');
16
+ require('./responsiveFormatFacade-1635c5dd.js');
17
17
  require('./number-7e7d9981.js');
18
18
  require('./misc-aa481a6d.js');
19
- require('./ui-e19fec2a.js');
19
+ require('./ui-7db8ff4a.js');
20
20
  require('./ui.type-655d8879.js');
21
- require('./zIndexManager-e2852632.js');
21
+ require('./zIndexManager-d4174c1c.js');
22
22
  require('./tinycolor-14174cd4.js');
23
23
 
24
24
  /* This file is generated by vega-design 2.0.71 */
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const log = require('./log-2402f20e.js');
3
+ const log = require('./log-0e500258.js');
4
4
  const ui = require('./ui-bbf1eed1.js');
5
5
  const typeGuard = require('./typeGuard-bb401d05.js');
6
- const responsiveFormatFacade = require('./responsiveFormatFacade-897d74ef.js');
7
- const ui$1 = require('./ui-e19fec2a.js');
8
- const zIndexManager = require('./zIndexManager-e2852632.js');
6
+ const responsiveFormatFacade = require('./responsiveFormatFacade-1635c5dd.js');
7
+ const ui$1 = require('./ui-7db8ff4a.js');
8
+ const zIndexManager = require('./zIndexManager-d4174c1c.js');
9
9
 
10
10
  /**
11
11
  * Get the position of the element in the container according to the target element and the placement
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const log = require('./log-2402f20e.js');
4
- const observer = require('./observer-d6c59015.js');
5
- const ui = require('./ui-e19fec2a.js');
3
+ const log = require('./log-0e500258.js');
4
+ const observer = require('./observer-b2f7a866.js');
5
+ const ui = require('./ui-7db8ff4a.js');
6
6
  const string = require('./string-21427167.js');
7
7
 
8
8
  /**
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const ui = require('./ui-e19fec2a.js');
3
+ const ui = require('./ui-7db8ff4a.js');
4
4
 
5
5
  /**
6
6
  * It listens to the keyup event on the window and calls the appropriate method on the registered elements
@@ -3549,9 +3549,10 @@ class SVGRenderer extends BaseRenderer {
3549
3549
  * @param {string} color - Background color token type, which is a type of color
3550
3550
  * used in the chart's background.
3551
3551
  * @param {string} textStyle - The text style of the axis
3552
+ * @returns {SVGGElement} svg g element
3552
3553
  */
3553
3554
  drawLegend(position, text, color, textStyle) {
3554
- d3Select(this.context)
3555
+ return d3Select(this.context)
3555
3556
  .select('.vega-chart-legend-g')
3556
3557
  .append('g')
3557
3558
  .attr('class', 'vega-chart-legend-item')
@@ -3563,7 +3564,8 @@ class SVGRenderer extends BaseRenderer {
3563
3564
  y: -4,
3564
3565
  }, 4, color));
3565
3566
  g.append(() => this.getTextNode({ x: 8, y: 0 }, text, textStyle));
3566
- });
3567
+ })
3568
+ .node();
3567
3569
  }
3568
3570
  /**
3569
3571
  * This function draws a rectangle with a specified position, width, height, and optional color using D3.js.
@@ -3596,6 +3598,7 @@ class SVGRenderer extends BaseRenderer {
3596
3598
  d3Select(this.context)
3597
3599
  .select('.vega-chart-draw-g')
3598
3600
  .append('path')
3601
+ .attr('class', 'vega-chart-line-path')
3599
3602
  .datum(positions)
3600
3603
  .attr('fill', 'none')
3601
3604
  .attr('stroke', color)
@@ -3616,16 +3619,23 @@ class SVGRenderer extends BaseRenderer {
3616
3619
  * @param {number} outerRadius - The outer radius parameter is a number that determines the outer
3617
3620
  * radius of the arc path being drawn.
3618
3621
  * @param {number} innerRadius - The inner radius of the arc path, specified as a number.
3622
+ * @returns {SVGPathElement} svg arc path element.
3619
3623
  */
3620
3624
  drawArcPath(center, record, color, outerRadius, innerRadius) {
3621
- d3Select(this.context)
3625
+ return d3Select(this.context)
3622
3626
  .select('.vega-chart-draw-g')
3623
3627
  .append('path')
3624
3628
  .datum(record)
3629
+ .attr('class', 'vega-chart-arc-path')
3630
+ .attr('data-name', (item) => item.data.name)
3625
3631
  .attr('transform', `translate(${center.x},${center.y})`)
3626
3632
  .attr('fill', color)
3627
3633
  .attr('stroke-width', 0)
3628
- .attr('d', d3Arc().innerRadius(innerRadius).outerRadius(outerRadius));
3634
+ .attr('d', d3Arc().innerRadius(innerRadius).outerRadius(outerRadius))
3635
+ .attr('data-d', d3Arc()
3636
+ .innerRadius(innerRadius)
3637
+ .outerRadius(outerRadius + 10))
3638
+ .node();
3629
3639
  }
3630
3640
  /**
3631
3641
  * This function clears all elements within two specific classes in a D3 selection.
@@ -3769,10 +3779,12 @@ class CanvasRenderer extends BaseRenderer {
3769
3779
  * @param {string} color - color string
3770
3780
  * represents a color for the legend. It could be a string or a number that corresponds to a specific
3771
3781
  * color value.
3782
+ * @returns {HTMLCanvasElement} chart canvas element
3772
3783
  */
3773
3784
  drawLegend(position, text, color) {
3774
3785
  this.drawCircle(position, 4, color);
3775
3786
  this.drawText(position, text);
3787
+ return this.context;
3776
3788
  }
3777
3789
  /**
3778
3790
  * The function `drawText` takes a position and a string of text as parameters and does not return anything.
@@ -3838,6 +3850,7 @@ class CanvasRenderer extends BaseRenderer {
3838
3850
  * @param {number} outerRadius - The outer radius parameter is a number that determines the outer
3839
3851
  * radius of the arc path being drawn.
3840
3852
  * @param {number} innerRadius - The inner radius of the arc path, specified as a number.
3853
+ * @returns {HTMLCanvasElement} chart canvas element.
3841
3854
  */
3842
3855
  drawArcPath(center, record, color, outerRadius, innerRadius) {
3843
3856
  const context2d = this.getContext2d();
@@ -3849,6 +3862,7 @@ class CanvasRenderer extends BaseRenderer {
3849
3862
  if (innerRadius) {
3850
3863
  this.drawCircle(center, innerRadius, '#F0F3F7');
3851
3864
  }
3865
+ return this.context;
3852
3866
  }
3853
3867
  /**
3854
3868
  * The function "clear"
@@ -3928,8 +3942,8 @@ function parseNumberToPixelString(input) {
3928
3942
  }
3929
3943
 
3930
3944
  const DEFAULT_LAYOUT = {
3931
- width: null,
3932
- height: null,
3945
+ width: undefined,
3946
+ height: undefined,
3933
3947
  margin: {
3934
3948
  top: 30,
3935
3949
  right: 30,
@@ -3960,10 +3974,10 @@ class ChartDimensionController {
3960
3974
  */
3961
3975
  setContainerWidthAndHeight(layout) {
3962
3976
  const { width, height } = layout;
3963
- if (width !== null) {
3977
+ if (width !== undefined) {
3964
3978
  this.container.style.width = parseNumberToPixelString(width);
3965
3979
  }
3966
- if (height !== null) {
3980
+ if (height !== undefined) {
3967
3981
  this.container.style.height = parseNumberToPixelString(height);
3968
3982
  }
3969
3983
  }
@@ -3999,7 +4013,7 @@ class ChartDimensionController {
3999
4013
  */
4000
4014
  getContainerInnerWidth(layout) {
4001
4015
  const width = this.getContainerClientWidth(layout);
4002
- const { left, right } = (layout === null || layout === void 0 ? void 0 : layout.margin) || DEFAULT_LAYOUT.margin;
4016
+ const { left, right } = ((layout === null || layout === void 0 ? void 0 : layout.margin) || DEFAULT_LAYOUT.margin);
4003
4017
  return width ? width - right - left : 0;
4004
4018
  }
4005
4019
  /**
@@ -4012,7 +4026,7 @@ class ChartDimensionController {
4012
4026
  */
4013
4027
  getContainerInnerHeight(layout) {
4014
4028
  const height = this.getContainerClientHeight(layout);
4015
- const { top, bottom } = (layout === null || layout === void 0 ? void 0 : layout.margin) || DEFAULT_LAYOUT.margin;
4029
+ const { top, bottom } = ((layout === null || layout === void 0 ? void 0 : layout.margin) || DEFAULT_LAYOUT.margin);
4016
4030
  return height ? height - top - bottom : 0;
4017
4031
  }
4018
4032
  /**
@@ -4040,6 +4054,159 @@ class ChartDimensionController {
4040
4054
  }
4041
4055
  }
4042
4056
 
4057
+ /**
4058
+ * This is a TypeScript code that defines an abstract class `BaseInteractor` with a generic type `T` that extends either `SVGElement` or `HTMLCanvasElement`.
4059
+ */
4060
+ class BaseInteractor {
4061
+ /**
4062
+ * This is a constructor function that takes a parameter of type T and sets it as a protected property called "context".
4063
+ *
4064
+ * @param {SVGElement | HTMLCanvasElement} context - The "context" parameter is a protected property of a class constructor that is
4065
+ * of type "T". It is used to store a reference to an object or data that is required by the class
4066
+ * methods to perform their tasks. The "protected" keyword means that the property can only be
4067
+ * accessed within the class
4068
+ */
4069
+ constructor(context) {
4070
+ this.context = context;
4071
+ this.interactingEntryForEventRegistry = new Map();
4072
+ this.interactingEntryForDrawerRegistry = new WeakMap();
4073
+ }
4074
+ /**
4075
+ * This function registers an interacting entry with a drawer, draw piece, and event type in an interactor registry.
4076
+ *
4077
+ * @param {BaseDrawer<unknown>} drawer - The drawer parameter is an instance of a class that extends the BaseDrawer class,
4078
+ * which is used for drawing on a canvas or other graphical surface.
4079
+ * @param {DrawPiece} drawPiece - DrawPiece is a type that represents a specific piece that can be
4080
+ * drawn on a canvas or other graphical surface. It could include information such as the shape,
4081
+ * color, size, and position of the piece.
4082
+ * @param {InteractingEntry} interactingEntry - InteractingEntry is a data structure that represents
4083
+ * an interaction between a user and a graphical element on the screen. It contains information such
4084
+ * as the type of event that triggered the interaction (e.g. mouse click, touch)
4085
+ */
4086
+ register(drawer, drawPiece, interactingEntry) {
4087
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
4088
+ const eventType = interactingEntry.eventType;
4089
+ if (!this.interactingEntryForEventRegistry.get(eventType)) {
4090
+ this.interactingEntryForEventRegistry.set(eventType, []);
4091
+ }
4092
+ this.interactingEntryForEventRegistry.get(eventType).push(interactingEntry);
4093
+ if (!this.interactingEntryForDrawerRegistry.get(drawer)) {
4094
+ this.interactingEntryForDrawerRegistry.set(drawer, new WeakMap());
4095
+ }
4096
+ if (!this.interactingEntryForDrawerRegistry.get(drawer).get(drawPiece)) {
4097
+ this.interactingEntryForDrawerRegistry.get(drawer).set(drawPiece, []);
4098
+ }
4099
+ this.interactingEntryForDrawerRegistry.get(drawer).get(drawPiece).push(interactingEntry);
4100
+ /* eslint-enable @typescript-eslint/no-non-null-assertion */
4101
+ }
4102
+ /**
4103
+ * This function unregisters a drawer from the interactor registry.
4104
+ *
4105
+ * @param {BaseDrawer<unknown>} drawer - The parameter `drawer` is of type `BaseDrawer<unknown>`. It is an object that
4106
+ * represents a drawer and is used to unregister the drawer from the `interactorRegistry`. The
4107
+ * `interactorRegistry` is a `WeakMap` that stores a mapping between an `Interactor` and
4108
+ */
4109
+ unregisterByDrawer(drawer) {
4110
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
4111
+ const drawPiece = drawer.drawPiece;
4112
+ if (drawPiece &&
4113
+ this.interactingEntryForDrawerRegistry.has(drawer) &&
4114
+ this.interactingEntryForDrawerRegistry.get(drawer) &&
4115
+ this.interactingEntryForDrawerRegistry.get(drawer).has(drawPiece) &&
4116
+ this.interactingEntryForDrawerRegistry.get(drawer).get(drawPiece)) {
4117
+ this.interactingEntryForEventRegistry.forEach((value, key) => {
4118
+ this.interactingEntryForEventRegistry.set(key, value.filter((interactingEntry) => {
4119
+ return (this.interactingEntryForDrawerRegistry
4120
+ .get(drawer)
4121
+ .get(drawPiece)
4122
+ .indexOf(interactingEntry) < 0);
4123
+ }));
4124
+ });
4125
+ /* eslint-enable @typescript-eslint/no-non-null-assertion */
4126
+ }
4127
+ this.interactingEntryForDrawerRegistry.delete(drawer);
4128
+ }
4129
+ /**
4130
+ * This function handles mouse events for registered interactor and drawers.
4131
+ *
4132
+ * @param {EventType} eventType - The type of event being registered in the registry, such as "click" or "mousemove".
4133
+ * @param {MouseEvent} event - The `event` parameter is of type `MouseEvent`, which represents a
4134
+ * mouse-related event (such as a click, double-click, or mouse movement) that occurred on the web
4135
+ * page. It contains information about the event, such as the type of event, the target element that
4136
+ * triggered the event
4137
+ */
4138
+ callRegistry(eventType, event) {
4139
+ const interactingEntryArray = this.interactingEntryForEventRegistry.get(eventType);
4140
+ if (interactingEntryArray) {
4141
+ interactingEntryArray.forEach((interactingEntry) => {
4142
+ if (interactingEntry.shouldHandle(event)) {
4143
+ interactingEntry.handle(event);
4144
+ }
4145
+ });
4146
+ }
4147
+ }
4148
+ }
4149
+
4150
+ /**
4151
+ * The CanvasInteractor class extends the BaseInteractor class and provides empty methods for handling mouse move, click, and hover events on a HTML canvas element.
4152
+ */
4153
+ class CanvasInteractor extends BaseInteractor {
4154
+ }
4155
+
4156
+ /**
4157
+ * The SVGInteractor class extends the BaseInteractor class and provides methods for handling mouse events on SVG elements.
4158
+ */
4159
+ class SVGInteractor extends BaseInteractor {
4160
+ /**
4161
+ * This is a constructor function that adds event listeners for click and mouseover events to an SVG element.
4162
+ *
4163
+ * @param {SVGElement} context - The context parameter is an SVGElement, which is the element that the
4164
+ * constructor is being called on. It is used to add event listeners to the element for mouseover and
4165
+ * click events.
4166
+ */
4167
+ constructor(context) {
4168
+ super(context);
4169
+ this.addContextListener();
4170
+ }
4171
+ /**
4172
+ * This function adds event listeners for click and mouseover events to the context element and calls
4173
+ * a registry function with the corresponding event type and event object.
4174
+ */
4175
+ addContextListener() {
4176
+ this.context.addEventListener('click', (event) => {
4177
+ this.callRegistry('click', event);
4178
+ });
4179
+ this.context.addEventListener('mouseover', (event) => {
4180
+ this.callRegistry('mouseover', event);
4181
+ });
4182
+ }
4183
+ }
4184
+
4185
+ /** The InteractorFactory class provides a static method to create and return an appropriate interactor based on the type of context provided. */
4186
+ class InteractorFactory {
4187
+ /**
4188
+ * This function returns a BaseInteractor object based on the type of context passed in (SVGElement or HTMLCanvasElement).
4189
+ *
4190
+ * @param {SVGElement | HTMLCanvasElement} context - The `context` parameter is either an SVGElement
4191
+ * or an HTMLCanvasElement. It is used to determine which type of interactor to create and return. If
4192
+ * the context is an SVGElement, an instance of SVGInteractor is returned. If the context is an
4193
+ * HTMLCanvasElement, an instance of
4194
+ * @returns {BaseInteractor<SVGElement | HTMLCanvasElement>} A `BaseInteractor` object that is either an instance of `SVGInteractor` or
4195
+ * `CanvasInteractor`, depending on the type of the `context` parameter passed to the `get` method.
4196
+ */
4197
+ static get(context) {
4198
+ if (context instanceof SVGElement) {
4199
+ return new SVGInteractor(context);
4200
+ }
4201
+ else if (context instanceof HTMLCanvasElement) {
4202
+ return new CanvasInteractor(context);
4203
+ }
4204
+ else {
4205
+ throw new Error('Invalid context');
4206
+ }
4207
+ }
4208
+ }
4209
+
4043
4210
  /** This is a TypeScript class called `BaseChart` that serves as a base class for creating charts */
4044
4211
  class BaseChart {
4045
4212
  /**
@@ -4054,6 +4221,7 @@ class BaseChart {
4054
4221
  const context = GraphContextFactory.get(options.mode, options.container);
4055
4222
  this.dimensionController = new ChartDimensionController(options.container);
4056
4223
  this.renderer = RendererFactory.get(context);
4224
+ this.interactor = InteractorFactory.get(context);
4057
4225
  this.initLayoutOptions(options);
4058
4226
  }
4059
4227
  /**
@@ -4080,10 +4248,11 @@ class BaseChart {
4080
4248
  this.updateOptions(this.options);
4081
4249
  }
4082
4250
  /**
4083
- * sets the layout if it hasn't been set yet, and executes all the drawers.
4251
+ * sets the layout if it hasn't been set yet, and executes all the drawers. unregister the interactor by drawer
4084
4252
  */
4085
4253
  render() {
4086
- this.drawers = this.createDrawerChain(this.renderer);
4254
+ this.unregisterByDrawer();
4255
+ this.drawers = this.createDrawerChain(this.renderer, this.interactor);
4087
4256
  this.clear();
4088
4257
  if (!this.isLayoutSet) {
4089
4258
  this.setLayout();
@@ -4110,6 +4279,16 @@ class BaseChart {
4110
4279
  this.options = Object.assign(options, { layout: newLayout });
4111
4280
  this.dimensionController.setContainerWidthAndHeight(newLayout);
4112
4281
  }
4282
+ /**
4283
+ * This function un-registers drawers from the interactor.
4284
+ */
4285
+ unregisterByDrawer() {
4286
+ if (this.drawers) {
4287
+ this.drawers.forEach((drawer) => {
4288
+ this.interactor.unregisterByDrawer(drawer);
4289
+ });
4290
+ }
4291
+ }
4113
4292
  }
4114
4293
 
4115
4294
  /* This file is generated by vega-design 2.0.71 */
@@ -4255,17 +4434,21 @@ class BaseDrawer {
4255
4434
  * This is a constructor function that takes in a renderer and options for a chart drawer.
4256
4435
  *
4257
4436
  * @param {BaseRenderer<SVGElement | HTMLCanvasElement>} renderer - `renderer` parameter is an instance of a `BaseRenderer` class that can render either SVG elements or a 2D canvas context
4437
+ * @param {BaseInteractor<SVGElement | HTMLCanvasElement>} interactor - `renderer` parameter is an instance of a `BaseInteractor` class
4258
4438
  * @param {ChartDrawerOptions<unknown>} options - where `T` is a generic type parameter. This parameter contains various options that can be used to customize the chart being drawn
4259
4439
  */
4260
- constructor(renderer, options) {
4440
+ constructor(renderer, interactor, options) {
4261
4441
  this.renderer = renderer;
4442
+ this.interactor = interactor;
4262
4443
  this.options = options;
4263
4444
  }
4264
4445
  /**
4265
4446
  * The function executes a draw method.
4266
4447
  */
4267
4448
  execute() {
4268
- this.draw();
4449
+ const drawPiece = this.draw();
4450
+ this.drawPiece = drawPiece;
4451
+ this.addInteractionSupport(drawPiece);
4269
4452
  }
4270
4453
  /**
4271
4454
  * returns a color token based on an index and an optional array of colors.
@@ -4304,19 +4487,127 @@ class BaseDrawer {
4304
4487
  }
4305
4488
  }
4306
4489
 
4490
+ /** The code is defining an abstract class called `InteractingEntryGenerator` with a generic type `T`. This class is responsible for generating an `InteractingEntry` object based on the provided options. */
4491
+ class InteractingEntryGenerator {
4492
+ /**
4493
+ * The function generates an InteractingEntry object based on the provided options.
4494
+ *
4495
+ * @param {unknown} options - The `options` parameter is a generic type `T` that represents the options or configuration for the `generate` function. It can be any type that you define when calling the `generate` function.
4496
+ * @returns {InteractingEntry} An object of type InteractingEntry is being returned.
4497
+ */
4498
+ generate(options) {
4499
+ return {
4500
+ eventType: this.eventType,
4501
+ shouldHandle: this.createShouldHandle(options),
4502
+ handle: this.createHandle(options),
4503
+ };
4504
+ }
4505
+ }
4506
+
4507
+ /** The PieLegendHoverGenerator class generates an InteractingEntry object that handles mouseover events on a legend of a D3 pie chart and triggers a mouseover event on the corresponding path element. */
4508
+ class PieLegendHoverGenerator extends InteractingEntryGenerator {
4509
+ constructor() {
4510
+ super(...arguments);
4511
+ this.eventType = 'mouseover';
4512
+ }
4513
+ /**
4514
+ * The function "createShouldHandle" returns a function that takes an event as a parameter and returns a boolean value.
4515
+ *
4516
+ * @returns {InteractingEntry['shouldHandle']} A function that takes an event as an argument and returns a boolean value.
4517
+ */
4518
+ createShouldHandle() {
4519
+ return this.shouldHandle;
4520
+ }
4521
+ /**
4522
+ * The function "createHandle" returns the handle property of an InteractingEntry object.
4523
+ *
4524
+ * @param {LegendInputType} options the legend render options
4525
+ * @returns {InteractingEntry['handle']} The `handle` property of the `InteractingEntry` object is being returned.
4526
+ */
4527
+ createHandle(options) {
4528
+ // eslint-disable-next-line jsdoc/require-jsdoc
4529
+ return (event) => {
4530
+ this.handle(event, options);
4531
+ };
4532
+ }
4533
+ /**
4534
+ * This function checks if a mouse event should be handled based on whether the target or its parent element has a specific class.
4535
+ *
4536
+ * @param {MouseEvent} event - MouseEvent is a type of event that is triggered by a mouse action, such
4537
+ * as clicking, hovering, or scrolling. It contains information about the event, such as the target
4538
+ * element and the position of the mouse.
4539
+ * @returns {boolean} A boolean value is being returned. The method `shouldHandle` checks if the target element
4540
+ * or its parent element has a class of `vega-chart-legend-item` and returns `true` if it does, and
4541
+ * `false` otherwise.
4542
+ */
4543
+ shouldHandle(event) {
4544
+ var _a;
4545
+ const target = event.target;
4546
+ const container = event.currentTarget.parentElement;
4547
+ return (container.tagName === 'VEGA-PIE-CHART' &&
4548
+ (target.classList.contains('vega-chart-legend-item') ||
4549
+ !!((_a = target.parentElement) === null || _a === void 0 ? void 0 : _a.classList.contains('vega-chart-legend-item'))));
4550
+ }
4551
+ /**
4552
+ * The function handles a mouse event on a legend and triggers a mouseover event on the corresponding path element in a D3 chart.
4553
+ *
4554
+ * @param {MouseEvent} event - The event parameter is a MouseEvent, which represents a user action
4555
+ * (such as a click or hover) on a specific element in the DOM.
4556
+ * @param {LegendInputType} options - LegendInputType is a custom type that likely contains
4557
+ * information about the data being displayed in the chart, such as the names of the categories or
4558
+ * series being plotted. It may also include information about the chart's appearance or behavior,
4559
+ * such as the colors or labels used in the legend. Without more information about
4560
+ */
4561
+ handle(event, options) {
4562
+ var _a;
4563
+ const svgSelection = d3Select(event.currentTarget);
4564
+ const target = event.target;
4565
+ const targetTextNode = target.tagName === 'text'
4566
+ ? target
4567
+ : target.tagName === 'circle'
4568
+ ? target.nextElementSibling
4569
+ : target.querySelector('text');
4570
+ const name = targetTextNode ? targetTextNode.textContent : '';
4571
+ const index = name ? options.data.indexOf(name) : 0;
4572
+ const paths = svgSelection
4573
+ .selectAll(`path.vega-chart-arc-path`)
4574
+ .nodes();
4575
+ (_a = paths[index]) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new MouseEvent('mouseover', { bubbles: true }));
4576
+ }
4577
+ }
4578
+
4307
4579
  /** The LegendDrawer class draws circles and text for each legend in a chart. */
4308
4580
  class LegendDrawer extends BaseDrawer {
4581
+ constructor() {
4582
+ super(...arguments);
4583
+ this.pieLegendHoverGenerator = new PieLegendHoverGenerator();
4584
+ }
4585
+ /**
4586
+ * This function adds interaction support to a chart by registering it with an interactor and providing a hover generator.
4587
+ *
4588
+ * @param {(SVGGElement | HTMLCanvasElement)[]} drawPiece - `drawPiece` is a parameter of type array
4589
+ * that contains either `SVGGElement` or `HTMLCanvasElement` elements. It is used as a callback
4590
+ * function to draw the legend items on the chart.
4591
+ */
4592
+ addInteractionSupport(drawPiece) {
4593
+ var _a;
4594
+ if ((_a = this.options.renderOptions.data) === null || _a === void 0 ? void 0 : _a.length) {
4595
+ this.interactor.register(this, drawPiece, this.pieLegendHoverGenerator.generate(this.options.renderOptions));
4596
+ }
4597
+ }
4309
4598
  /**
4310
4599
  * This function draws a legend on a chart using input options.
4600
+ *
4601
+ * @returns {(SVGGElement | HTMLCanvasElement)[]} draw piece
4311
4602
  */
4312
4603
  draw() {
4313
- const { data, colors, position, width } = this.options.renderOptions;
4604
+ const { data = [], colors, position, width } = this.options.renderOptions;
4314
4605
  const options = this.getChartLegendOptions(data, colors, position);
4315
4606
  if (options) {
4316
4607
  const longestLegendLength = array$2.getLongestTextLengthFromArray(data);
4317
- options.legends.forEach((legend, index) => {
4608
+ return options.legends.map((legend, index) => {
4318
4609
  const position = this.getLegendPosition(options.position, index, longestLegendLength, width);
4319
- this.renderer.drawLegend(position, legend.field, legend.color, this.getStyleTextFromToken('v-font-footnote2-short'));
4610
+ return this.renderer.drawLegend(position, legend.field, legend.color, this.getStyleTextFromToken('v-font-footnote2-short'));
4320
4611
  });
4321
4612
  }
4322
4613
  }
@@ -4382,7 +4673,8 @@ class LayoutInputProcessor {
4382
4673
  */
4383
4674
  process(input) {
4384
4675
  const { container, layout } = input;
4385
- const { top, right, bottom, left } = (layout === null || layout === void 0 ? void 0 : layout.margin) || DEFAULT_LAYOUT.margin;
4676
+ const { top, right, bottom, left } = ((layout === null || layout === void 0 ? void 0 : layout.margin) ||
4677
+ DEFAULT_LAYOUT.margin);
4386
4678
  const dimensionController = new ChartDimensionController(container);
4387
4679
  return {
4388
4680
  width: dimensionController.getContainerClientWidth(layout),
@@ -4445,7 +4737,7 @@ class LegendInputProcessor {
4445
4737
  * - `height`: the
4446
4738
  */
4447
4739
  process(input, previousOutput) {
4448
- const { colors, legends } = input;
4740
+ const { colors, legends = [] } = input;
4449
4741
  const { width, height } = previousOutput;
4450
4742
  return {
4451
4743
  data: legends,
@@ -4459,6 +4751,7 @@ class LegendInputProcessor {
4459
4751
 
4460
4752
  exports.BaseChart = BaseChart;
4461
4753
  exports.BaseDrawer = BaseDrawer;
4754
+ exports.InteractingEntryGenerator = InteractingEntryGenerator;
4462
4755
  exports.LayoutInputProcessor = LayoutInputProcessor;
4463
4756
  exports.LegendDrawer = LegendDrawer;
4464
4757
  exports.LegendInputProcessor = LegendInputProcessor;
@@ -4467,7 +4760,7 @@ exports.array = array;
4467
4760
  exports.color = color;
4468
4761
  exports.constant = constant$1;
4469
4762
  exports.constant$1 = constant;
4470
- exports.d3Arc = d3Arc;
4763
+ exports.d3Select = d3Select;
4471
4764
  exports.interpolateNumber = interpolateNumber;
4472
4765
  exports.interpolateRgb = interpolateRgb;
4473
4766
  exports.interpolateString = interpolateString;