@heartlandone/vega 2.75.1 → 2.77.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 (861) hide show
  1. package/dist/cjs/{app-globals-35614ce8.js → app-globals-04e7024b.js} +28 -32
  2. package/dist/cjs/aria-attributes-value-mapper-f58c73f8.js +136 -0
  3. package/dist/cjs/breakpoints-751d433a.js +56 -0
  4. package/dist/cjs/{child-nodes-event-prevent-slimmer-aca87dac.js → child-nodes-event-prevent-slimmer-cc6d2919.js} +2 -2
  5. package/dist/cjs/{child-nodes-notify-observer-slimmer-257fedb3.js → child-nodes-notify-observer-slimmer-ed39283b.js} +1 -1
  6. package/dist/cjs/{code-block-c1d2e6a8.js → code-block-f1480ec3.js} +17 -17
  7. package/dist/cjs/{component-global-style-slimmer-adfa2e59.js → component-global-style-slimmer-93c5fb50.js} +2 -1
  8. package/dist/cjs/{component-usage-runtime-metrics-d10ace87.js → component-usage-runtime-metrics-4572c5b7.js} +1 -1
  9. package/dist/cjs/{component-value-history-controller-slimmer.abstract-787c67dc.js → component-value-history-controller-slimmer.abstract-a9264cc8.js} +5 -5
  10. package/dist/cjs/{create-public-api-runtime-metrics-slimmer-e2e274e1.js → create-public-api-runtime-metrics-slimmer-9cb09fb2.js} +3 -41
  11. package/dist/cjs/{dark-mode-style-controller-c21172aa.js → dark-mode-style-controller-3a04af3d.js} +292 -1254
  12. package/dist/cjs/{date-required-rule-30ee62d0.js → date-required-rule-912469e0.js} +1 -1
  13. package/dist/cjs/{design-token-bb39e07e.js → design-token-c49717c8.js} +2 -2
  14. package/dist/cjs/dom-node-subject-observer-factory-c62823de.js +141 -0
  15. package/dist/cjs/{dto-renderer-manager-03e1a038.js → dto-renderer-manager-809c947b.js} +33 -33
  16. package/dist/cjs/{element-appender-slimmer-daa8b9f5.js → element-appender-slimmer-38583ca9.js} +349 -166
  17. package/dist/cjs/{event-emit-slimmer-2dacabbd.js → event-emit-slimmer-062cdcb8.js} +2 -2
  18. package/dist/cjs/{feature-flag-controller-ce2162c8.js → feature-flag-controller-9129ef52.js} +7 -1
  19. package/dist/cjs/{form-field-controller-slimmer-aef2fb1e.js → form-field-controller-slimmer-102f37c7.js} +13 -14
  20. package/dist/cjs/{internal-icon-manager-32f9ed63.js → icon-manager-c12c6ea9.js} +1 -52
  21. package/dist/cjs/{image-annotation-action-3fa501b7.js → image-annotation-action-8d9fa20c.js} +10 -9
  22. package/dist/cjs/index-592b4052.js +220 -0
  23. package/dist/cjs/{index-4d7bce1a.js → index-f054eb5d.js} +15 -3
  24. package/dist/cjs/index.cjs.js +68 -65
  25. package/dist/cjs/{inject-keyboard-manager-d21b4387.js → inject-keyboard-manager-0f5bd568.js} +1 -1
  26. package/dist/cjs/internal-icon-manager-c989189a.js +55 -0
  27. package/dist/cjs/{translation-5f9f9c0c.js → internal-translation-controller-053eb0f1.js} +0 -93
  28. package/dist/cjs/{internal-vega-event-manager-6befeb34.js → internal-vega-event-manager-f7ecf3d4.js} +81 -81
  29. package/dist/cjs/internal-vega-z-index-manager-f03ddb37.js +180 -0
  30. package/dist/cjs/{keyboard-manager-3dea6b28.js → keyboard-manager-055e9f67.js} +2 -2
  31. package/dist/cjs/{keyboard-manager-slimmer-0d45f944.js → keyboard-manager-slimmer-0cc0c1c7.js} +1 -1
  32. package/dist/cjs/legend-input-processor-1e53e5bc.js +2126 -0
  33. package/dist/cjs/loader.cjs.js +26 -23
  34. package/dist/cjs/misc-3d30df91.js +41 -0
  35. package/dist/cjs/{month-view-generator-49cc5fc2.js → month-view-generator-6a6dd527.js} +1 -1
  36. package/dist/cjs/{page-resize-observer-slimmer-11937d6f.js → page-resize-observer-slimmer-7f065ee1.js} +2 -54
  37. package/dist/cjs/{public-rules-dc2a8d62.js → public-rules-922849f3.js} +12 -13
  38. package/dist/cjs/{range-79b668e7.js → range-8aa49b08.js} +2 -2
  39. package/dist/cjs/{responsive-format-facade-d5dba942.js → responsive-format-facade-acc39a40.js} +13 -22
  40. package/dist/cjs/{rich-text-editor-required-rule-ba312af9.js → rich-text-editor-required-rule-22225840.js} +1 -1
  41. package/dist/cjs/{string-format-strategy.abstract-63514c60.js → string-format-strategy.abstract-f2575647.js} +1 -1
  42. package/dist/cjs/{string-input-formatter-slimmer-f3e0bbc7.js → string-input-formatter-slimmer-0a334fc6.js} +5 -5
  43. package/dist/cjs/{string-mask-strategy-d23ac21a.js → string-mask-strategy-dda58395.js} +2 -2
  44. package/dist/cjs/{style-formatter-49693da7.js → style-formatter-028af284.js} +2 -2
  45. package/dist/cjs/{sub-state-notify-slimmer-468e19aa.js → sub-state-notify-slimmer-58121111.js} +1 -1
  46. package/dist/cjs/{sub-state-observer-slimmer-5d0b8ac3.js → sub-state-observer-slimmer-1dfbc4c3.js} +2 -2
  47. package/dist/cjs/{time-required-rule-c96ecdc9.js → time-required-rule-d6fa7aa8.js} +1 -1
  48. package/dist/cjs/{function-extension-cfbbc57e.js → token-extension-ffcaeae0.js} +621 -486
  49. package/dist/cjs/{translation-slimmer-f0ebe710.js → translation-slimmer-4533bd67.js} +4 -4
  50. package/dist/cjs/{type-guard-a0f026d8.js → type-guard-407ba0b8.js} +3 -3
  51. package/dist/cjs/{ui-9e181079.js → ui-234ea151.js} +12 -0
  52. package/dist/cjs/{valid-credit-card-number-rule-c854bed9.js → valid-credit-card-number-rule-41a8b51b.js} +1 -1
  53. package/dist/cjs/vega-accordion.cjs.entry.js +23 -32
  54. package/dist/cjs/vega-app-footer.cjs.entry.js +3 -3
  55. package/dist/cjs/vega-app-header-button.cjs.entry.js +47 -38
  56. package/dist/cjs/vega-backdrop.cjs.entry.js +2 -2
  57. package/dist/cjs/vega-banner.cjs.entry.js +15 -13
  58. package/dist/cjs/vega-bar-chart.cjs.entry.js +3 -3
  59. package/dist/cjs/vega-box.cjs.entry.js +18 -33
  60. package/dist/cjs/vega-brand-logo.cjs.entry.js +7 -5
  61. package/dist/cjs/vega-breadcrumb.cjs.entry.js +14 -13
  62. package/dist/cjs/vega-button-circle.cjs.entry.js +37 -32
  63. package/dist/cjs/vega-button-group_2.cjs.entry.js +15 -15
  64. package/dist/cjs/vega-button-link.cjs.entry.js +15 -14
  65. package/dist/cjs/vega-button.cjs.entry.js +21 -30
  66. package/dist/cjs/vega-calendar_4.cjs.entry.js +48 -45
  67. package/dist/cjs/vega-card.cjs.entry.js +9 -28
  68. package/dist/cjs/vega-carousel.cjs.entry.js +15 -26
  69. package/dist/cjs/vega-checkbox_2.cjs.entry.js +22 -20
  70. package/dist/cjs/vega-chip.cjs.entry.js +22 -33
  71. package/dist/cjs/vega-code-block.cjs.entry.js +658 -2709
  72. package/dist/cjs/vega-color-picker.cjs.entry.js +15 -12
  73. package/dist/cjs/vega-combo-box.cjs.entry.js +29 -28
  74. package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
  75. package/dist/cjs/vega-date-picker_2.cjs.entry.js +78 -59
  76. package/dist/cjs/vega-dialog-controller-03ef4d9a.js +84 -0
  77. package/dist/cjs/vega-dialog_2.cjs.entry.js +37 -44
  78. package/dist/cjs/vega-divider.cjs.entry.js +12 -30
  79. package/dist/cjs/vega-dropdown_5.cjs.entry.js +49 -55
  80. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  81. package/dist/cjs/{dom-node-subject-observer-factory-b5e71bf6.js → vega-event-id-ee01d8dd.js} +0 -139
  82. package/dist/cjs/vega-field-error.cjs.entry.js +1 -1
  83. package/dist/cjs/vega-field-label.cjs.entry.js +9 -8
  84. package/dist/cjs/vega-file-uploader.cjs.entry.js +28 -23
  85. package/dist/cjs/vega-flag-icon.cjs.entry.js +13 -27
  86. package/dist/cjs/vega-flex.cjs.entry.js +11 -28
  87. package/dist/cjs/vega-font.cjs.entry.js +12 -29
  88. package/dist/cjs/vega-form.cjs.entry.js +24 -22
  89. package/dist/cjs/vega-grid.cjs.entry.js +9 -28
  90. package/dist/cjs/vega-hint.cjs.entry.js +1 -1
  91. package/dist/cjs/vega-icon.cjs.entry.js +18 -31
  92. package/dist/cjs/vega-image-uploader.cjs.entry.js +34 -37
  93. package/dist/cjs/vega-input-credit-card.cjs.entry.js +31 -27
  94. package/dist/cjs/vega-input-numeric.cjs.entry.js +24 -22
  95. package/dist/cjs/vega-input-passcode.cjs.entry.js +26 -24
  96. package/dist/cjs/vega-input-phone-number.cjs.entry.js +4764 -5600
  97. package/dist/cjs/vega-input-range.cjs.entry.js +22 -20
  98. package/dist/cjs/vega-input-select.cjs.entry.js +41 -46
  99. package/dist/cjs/vega-input.cjs.entry.js +43 -31
  100. package/dist/cjs/vega-item-toggle.cjs.entry.js +8 -7
  101. package/dist/cjs/vega-left-nav_5.cjs.entry.js +38 -40
  102. package/dist/cjs/vega-line-chart.cjs.entry.js +326 -24
  103. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +16 -32
  104. package/dist/cjs/vega-page-notification_2.cjs.entry.js +5 -4
  105. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +12 -12
  106. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +9 -10
  107. package/dist/cjs/vega-pagination.cjs.entry.js +28 -38
  108. package/dist/cjs/vega-pie-chart.cjs.entry.js +6 -89
  109. package/dist/cjs/vega-popover_2.cjs.entry.js +21 -31
  110. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +66 -39
  111. package/dist/cjs/vega-radio_2.cjs.entry.js +25 -23
  112. package/dist/cjs/vega-rich-text-content.cjs.entry.js +36 -20
  113. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +58 -55
  114. package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
  115. package/dist/cjs/vega-segment-control.cjs.entry.js +10 -8
  116. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +25 -32
  117. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +22 -20
  118. package/dist/cjs/vega-sidenav_3.cjs.entry.js +34 -40
  119. package/dist/cjs/vega-signature-capture.cjs.entry.js +27 -31
  120. package/dist/cjs/vega-skeleton.cjs.entry.js +1 -1
  121. package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
  122. package/dist/cjs/vega-stepper.cjs.entry.js +23 -21
  123. package/dist/cjs/vega-tab-group_2.cjs.entry.js +15 -14
  124. package/dist/cjs/vega-table_11.cjs.entry.js +67 -68
  125. package/dist/cjs/vega-text.cjs.entry.js +4 -3
  126. package/dist/cjs/vega-textarea.cjs.entry.js +22 -20
  127. package/dist/cjs/vega-time-picker_2.cjs.entry.js +35 -41
  128. package/dist/cjs/vega-toggle-switch.cjs.entry.js +15 -12
  129. package/dist/cjs/vega-tooltip_2.cjs.entry.js +17 -28
  130. package/dist/cjs/vega.cjs.js +26 -23
  131. package/dist/cjs/{index-95fca64f.js → wait-for-component-did-render-70a01bf9.js} +1 -12
  132. package/dist/cjs/y-axis-input-processor-54a26515.js +832 -0
  133. package/dist/collection/components/vega-accordion/slimmers/vega-accordion-renderer.js +1 -1
  134. package/dist/collection/components/vega-accordion/vega-accordion.css +5 -0
  135. package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +17 -2
  136. package/dist/collection/components/vega-box/slimmers/controllers/vega-box-responsive-style-controller.js +2 -1
  137. package/dist/collection/components/vega-box/slimmers/controllers/vega-box-state-styles-controller.js +2 -1
  138. package/dist/collection/components/vega-button/vega-button.js +2 -1
  139. package/dist/collection/components/vega-button-circle/vega-button-circle.js +19 -4
  140. package/dist/collection/components/vega-button-link/vega-button-link.css +1 -1
  141. package/dist/collection/components/vega-button-link/vega-button-link.js +2 -1
  142. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/base-repeat-pattern.js +1 -1
  143. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-daily-repeat-pattern.js +1 -1
  144. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-monthly-repeat-pattern.js +1 -1
  145. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-weekly-repeat-pattern.js +1 -1
  146. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-yearly-repeat-pattern.js +1 -1
  147. package/dist/collection/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.js +5 -14
  148. package/dist/collection/components/vega-combo-box/slimmers/renderers/vega-combo-box-dropdown-renderer.js +2 -2
  149. package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-open-state-controller.js +1 -1
  150. package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +1 -1
  151. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +16 -2
  152. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.css +184 -207
  153. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +32 -0
  154. package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-search-controller.js +2 -2
  155. package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.js +2 -2
  156. package/dist/collection/components/vega-dropdown/vega-dropdown-group/slimmers/renderers/vega-dropdown-group-renderer.js +3 -3
  157. package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +6 -4
  158. package/dist/collection/components/vega-icon/vega-icon.js +2 -1
  159. package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-container-renderer.js +10 -2
  160. package/dist/collection/components/vega-input-phone-number/slimmers/controllers/country-select-controller.js +1 -1
  161. package/dist/collection/components/vega-input-phone-number/slimmers/controllers/vega-input-phone-number-value-controller.js +1 -1
  162. package/dist/collection/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.js +2 -2
  163. package/dist/collection/components/vega-input-phone-number/slimmers/renderers/phone-number-input-renderer.js +1 -1
  164. package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +4 -4
  165. package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +2 -2
  166. package/dist/collection/components/vega-pagination/vega-pagination.js +1 -1
  167. package/dist/collection/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.js +30 -6
  168. package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.js +1 -1
  169. package/dist/collection/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.js +8 -1
  170. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.js +27 -0
  171. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.css +12 -0
  172. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +8 -3
  173. package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +15 -0
  174. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +1 -1
  175. package/dist/collection/components/vega-rich-text-editor/extensions/base-extension-renderer.js +11 -0
  176. package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +15 -1
  177. package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +2 -0
  178. package/dist/collection/components/vega-rich-text-editor/extensions/functions/function-extension.js +0 -11
  179. package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.js +23 -23
  180. package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-extension.js +0 -10
  181. package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.js +7 -17
  182. package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +12 -16
  183. package/dist/collection/components/vega-rich-text-editor/helpers/extension-context-manager.js +31 -0
  184. package/dist/collection/components/vega-rich-text-editor/helpers/extension-context-manager.test.js +19 -0
  185. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +1 -1
  186. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +1 -1
  187. package/dist/collection/components/vega-rich-text-editor/test/extensions/extension-test-utils.js +41 -0
  188. package/dist/collection/components/vega-signature-capture/slimmers/written-mode/controllers/written-mode-svg-controller.js +2 -1
  189. package/dist/collection/components/vega-table/interface.js +3 -0
  190. package/dist/collection/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.js +1 -1
  191. package/dist/collection/global/scripts/before-vega-load.js +4 -3
  192. package/dist/collection/helpers/calendar/calendar-date.js +1 -1
  193. package/dist/collection/helpers/calendar/calendar-event.js +1 -1
  194. package/dist/collection/helpers/calendar/calendar-time.js +1 -1
  195. package/dist/collection/helpers/chart/input-processors/format-time-positions-input-processor.js +2 -2
  196. package/dist/collection/helpers/chart/input-processors/pie-chart-arc-path-input-processor.js +1 -1
  197. package/dist/collection/helpers/chart/input-processors/x-axis-input-processor.js +5 -3
  198. package/dist/collection/helpers/chart/input-processors/x-axis-label-formatter-input-processor.js +2 -1
  199. package/dist/collection/helpers/chart/input-processors/y-axis-input-processor.js +7 -5
  200. package/dist/collection/helpers/chart/interacting-entry-generator/arc-path-hover-generator.js +1 -1
  201. package/dist/collection/helpers/chart/interacting-entry-generator/pie-legend-hover-generator.js +1 -1
  202. package/dist/collection/helpers/chart/renderers/canvas-renderer.js +1 -1
  203. package/dist/collection/helpers/chart/renderers/svg-renderer.js +1 -1
  204. package/dist/collection/helpers/chart/test/drawers/arc-path-drawer.test.js +1 -1
  205. package/dist/collection/helpers/chart/test/input-processors/format-time-positions-input-processor.test.js +1 -1
  206. package/dist/collection/helpers/chart/test/input-processors/sort-positions-input-processor.test.js +1 -1
  207. package/dist/collection/helpers/chart/test/input-processors/x-axis-input-processor.test.js +39 -0
  208. package/dist/collection/helpers/chart/test/input-processors/x-axis-label-formatter-input-processor.test.js +61 -14
  209. package/dist/collection/helpers/chart/test/input-processors/y-axis-input-processor.coverage.test.js +39 -0
  210. package/dist/collection/helpers/chart/test/input-processors/y-axis-input-processor.test.js +14 -0
  211. package/dist/collection/helpers/chart/test/renderers/svg-renderer.test.js +1 -1
  212. package/dist/collection/helpers/code-format/test/code-formatter.test.js +1 -1
  213. package/dist/collection/helpers/common/index.js +2 -37
  214. package/dist/collection/helpers/common/test/wait-for-component-did-render.test.js +67 -0
  215. package/dist/collection/helpers/common/test/wait-for-vega-handler.test.js +2 -2
  216. package/dist/collection/helpers/common/wait-for-component-did-render.js +27 -0
  217. package/dist/collection/helpers/common/wait-for-vega-handler.js +12 -1
  218. package/dist/collection/helpers/feature-control/feature-flags-map.js +6 -0
  219. package/dist/collection/helpers/formatter/responsive-map-formatter/responsive-border-radius-style-formatter.js +1 -1
  220. package/dist/collection/helpers/public-api.js +0 -2
  221. package/dist/collection/helpers/slimmers/component-global-style-slimmer.js +2 -1
  222. package/dist/collection/helpers/slimmers/field-error-ui-controller-slimmer.js +3 -4
  223. package/dist/collection/helpers/slimmers/form-field-message-translator.js +1 -1
  224. package/dist/collection/helpers/slimmers/global/vega-translate-observer-slimmer.js +1 -1
  225. package/dist/collection/helpers/slimmers/global/vega-watch-method-cancel-slimmer.js +1 -1
  226. package/dist/collection/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.js +132 -0
  227. package/dist/collection/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.js +196 -0
  228. package/dist/collection/helpers/slimmers/position-calculation/base-position-calculation-strategy.js +162 -151
  229. package/dist/collection/helpers/slimmers/position-calculation/position-calculation-controller.js +9 -0
  230. package/dist/collection/helpers/slimmers/position-calculation/screen-position-calculation-strategy.js +112 -1
  231. package/dist/collection/helpers/slimmers/position-calculation/screen-scroll-position-update.js +53 -0
  232. package/dist/collection/helpers/slimmers/position-calculation/test/screen-position-calculation-strategy.test.js +103 -6
  233. package/dist/collection/helpers/slimmers/string-input-formatter-slimmer.js +1 -1
  234. package/dist/collection/helpers/slimmers/translation/translation-slimmer.js +1 -1
  235. package/dist/collection/helpers/theme/controllers/brand-style-controller.js +3 -1
  236. package/dist/collection/helpers/theme/controllers/color-schema-overriding-controller.js +8 -6
  237. package/dist/collection/helpers/theme/controllers/dark-mode-style-controller.js +3 -1
  238. package/dist/collection/helpers/theme/internal-theme-manager.js +2 -1
  239. package/dist/collection/helpers/theme/tests/theme-manager-controller.test.js +1 -2
  240. package/dist/collection/helpers/ui/element-appender.js +4 -5
  241. package/dist/collection/helpers/ui/test/element-appender.test.js +66 -17
  242. package/dist/collection/helpers/validator/rules/valid-phone-number-rule.js +1 -1
  243. package/dist/collection/helpers/validator/test/rules/valid-phone-number-rule.test.js +10 -0
  244. package/dist/collection/index.js +2 -0
  245. package/dist/collection/polyfill/d3/d3-array-polyfill.js +89 -0
  246. package/dist/collection/polyfill/d3/d3-axis-polyfill.js +195 -0
  247. package/dist/collection/polyfill/d3/d3-scale-polyfill.js +582 -0
  248. package/dist/collection/polyfill/d3/d3-selection-polyfill.js +274 -0
  249. package/dist/collection/polyfill/d3/d3-shape-polyfill.js +252 -0
  250. package/dist/collection/polyfill/d3/d3-time-format-polyfill.js +207 -0
  251. package/dist/collection/polyfill/d3/d3-time-polyfill.js +99 -0
  252. package/dist/collection/polyfill/d3/index.js +31 -0
  253. package/dist/collection/polyfill/d3/test/d3-array-polyfill.test.js +72 -0
  254. package/dist/collection/polyfill/d3/test/d3-axis-polyfill.test.js +171 -0
  255. package/dist/collection/polyfill/d3/test/d3-integration.test.js +137 -0
  256. package/dist/collection/polyfill/d3/test/d3-scale-polyfill.test.js +382 -0
  257. package/dist/collection/polyfill/d3/test/d3-selection-polyfill.test.js +239 -0
  258. package/dist/collection/polyfill/d3/test/d3-shape-polyfill.test.js +225 -0
  259. package/dist/collection/polyfill/d3/test/d3-time-format-polyfill.test.js +162 -0
  260. package/dist/collection/polyfill/d3/test/d3-time-polyfill.test.js +76 -0
  261. package/dist/collection/polyfill/d3/test/index.test.js +78 -0
  262. package/dist/collection/polyfill/libphonenumber/as-you-type.js +405 -0
  263. package/dist/collection/polyfill/libphonenumber/format-helpers.js +186 -0
  264. package/dist/collection/polyfill/libphonenumber/index.js +22 -0
  265. package/dist/collection/polyfill/libphonenumber/metadata.js +150 -0
  266. package/dist/collection/polyfill/libphonenumber/metadata.json.js +3900 -0
  267. package/dist/collection/polyfill/libphonenumber/parse-phone-number.js +127 -0
  268. package/dist/collection/polyfill/libphonenumber/phone-number.js +38 -0
  269. package/dist/collection/polyfill/libphonenumber/test/as-you-type.test.js +309 -0
  270. package/dist/collection/polyfill/libphonenumber/test/format-helpers.test.js +192 -0
  271. package/dist/collection/polyfill/libphonenumber/test/index.test.js +16 -0
  272. package/dist/collection/polyfill/libphonenumber/test/metadata.test.js +196 -0
  273. package/dist/collection/polyfill/libphonenumber/test/parse-phone-number.test.js +218 -0
  274. package/dist/collection/polyfill/libphonenumber/test/phone-number.test.js +56 -0
  275. package/dist/collection/polyfill/libphonenumber/types.js +23 -0
  276. package/dist/collection/polyfill/prism/index.js +2 -0
  277. package/dist/collection/polyfill/prism/languages/css.js +86 -0
  278. package/dist/collection/polyfill/prism/languages/javascript.js +96 -0
  279. package/dist/collection/polyfill/prism/languages/jsx.js +46 -0
  280. package/dist/collection/polyfill/prism/languages/language-registry.js +41 -0
  281. package/dist/collection/polyfill/prism/languages/markup.js +71 -0
  282. package/dist/collection/polyfill/prism/languages/tsx.js +10 -0
  283. package/dist/collection/polyfill/prism/languages/typescript.js +64 -0
  284. package/dist/collection/polyfill/prism/test/css.test.js +61 -0
  285. package/dist/collection/polyfill/prism/test/javascript.test.js +113 -0
  286. package/dist/collection/polyfill/prism/test/jsx.test.js +48 -0
  287. package/dist/collection/polyfill/prism/test/language-registry.test.js +77 -0
  288. package/dist/collection/polyfill/prism/test/markup.test.js +57 -0
  289. package/dist/collection/polyfill/prism/test/test-utils.js +22 -0
  290. package/dist/collection/polyfill/prism/test/tokenizer.test.js +180 -0
  291. package/dist/collection/polyfill/prism/test/tsx.test.js +87 -0
  292. package/dist/collection/polyfill/prism/test/typescript.test.js +86 -0
  293. package/dist/collection/polyfill/prism/tokenizer.js +242 -0
  294. package/dist/collection/polyfill/tinycolor/tinycolor-polyfill.js +320 -0
  295. package/dist/collection/polyfill/tinycolor/tinycolor-polyfill.test.js +361 -0
  296. package/dist/collection/types/ui.type.js +12 -0
  297. package/dist/collection/utils/e2e-utils.js +10 -3
  298. package/dist/collection/utils/sanitize/constants/tag-sets.js +5 -0
  299. package/dist/collection/utils/sanitize/core/html-sanitizer.js +39 -0
  300. package/dist/collection/utils/sanitize/core/sanitize-strategy.js +62 -0
  301. package/dist/collection/utils/sanitize/core/types.js +4 -0
  302. package/dist/collection/utils/sanitize/index.js +12 -0
  303. package/dist/collection/utils/sanitize/strategies/empty-sanitize-strategy.js +17 -0
  304. package/dist/collection/utils/sanitize/strategies/index.js +3 -0
  305. package/dist/collection/utils/sanitize/strategies/label-sanitize-strategy.js +13 -0
  306. package/dist/collection/utils/sanitize/strategies/style-sanitize-strategy.js +50 -0
  307. package/dist/collection/utils/sanitize/test/empty-strategy.test.js +12 -0
  308. package/dist/collection/utils/sanitize/test/html-sanitizer.test.js +57 -0
  309. package/dist/collection/utils/sanitize/test/label-strategy.test.js +56 -0
  310. package/dist/collection/utils/sanitize/test/sanitize-strategy.test.js +85 -0
  311. package/dist/collection/utils/sanitize/test/sanitize.test.js +22 -0
  312. package/dist/collection/utils/sanitize/test/serialize-fragment.test.js +25 -0
  313. package/dist/collection/utils/sanitize/test/style-strategy.test.js +45 -0
  314. package/dist/collection/utils/sanitize/utils/serialize-fragment.js +17 -0
  315. package/dist/esm/{app-globals-2ac60ff5.js → app-globals-32055795.js} +12 -16
  316. package/dist/esm/aria-attributes-value-mapper-d4fef46a.js +134 -0
  317. package/dist/esm/breakpoints-56e5407b.js +53 -0
  318. package/dist/esm/{child-nodes-event-prevent-slimmer-e662bee2.js → child-nodes-event-prevent-slimmer-331312b8.js} +2 -2
  319. package/dist/esm/{child-nodes-notify-observer-slimmer-b676cd2b.js → child-nodes-notify-observer-slimmer-541dd6a4.js} +1 -1
  320. package/dist/esm/{code-block-8ee34ab6.js → code-block-b6247a45.js} +7 -7
  321. package/dist/esm/{component-global-style-slimmer-08046b38.js → component-global-style-slimmer-ac703085.js} +2 -1
  322. package/dist/esm/{component-usage-runtime-metrics-a84cc93e.js → component-usage-runtime-metrics-46020a03.js} +1 -1
  323. package/dist/esm/{component-value-history-controller-slimmer.abstract-a61bf821.js → component-value-history-controller-slimmer.abstract-2bb8533d.js} +6 -6
  324. package/dist/esm/{create-public-api-runtime-metrics-slimmer-bedf3a1e.js → create-public-api-runtime-metrics-slimmer-aaadaa08.js} +3 -38
  325. package/dist/esm/{dark-mode-style-controller-de88a117.js → dark-mode-style-controller-82e5c1c6.js} +292 -1254
  326. package/dist/esm/{date-required-rule-47ecc28f.js → date-required-rule-e771e7d9.js} +1 -1
  327. package/dist/esm/{design-token-007efbaa.js → design-token-5bc034e1.js} +2 -2
  328. package/dist/esm/dom-node-subject-observer-factory-82f346e3.js +138 -0
  329. package/dist/esm/{dto-renderer-manager-ee1a5864.js → dto-renderer-manager-6fd22ab7.js} +7 -7
  330. package/dist/esm/{element-appender-slimmer-35e26b5a.js → element-appender-slimmer-9ea377d0.js} +348 -165
  331. package/dist/esm/{event-emit-slimmer-09827cec.js → event-emit-slimmer-ffaecb9a.js} +2 -2
  332. package/dist/esm/{feature-flag-controller-51659753.js → feature-flag-controller-30f7b625.js} +7 -1
  333. package/dist/esm/{form-field-controller-slimmer-5d9dc384.js → form-field-controller-slimmer-5817d14d.js} +10 -11
  334. package/dist/esm/{internal-icon-manager-f0486245.js → icon-manager-539d7cf7.js} +2 -52
  335. package/dist/esm/{image-annotation-action-285d432e.js → image-annotation-action-6701b4c9.js} +6 -5
  336. package/dist/esm/index-3b327f29.js +215 -0
  337. package/dist/esm/{index-e9da316f.js → index-bfc6dfa2.js} +13 -1
  338. package/dist/esm/index.js +32 -29
  339. package/dist/esm/{inject-keyboard-manager-83d76ff5.js → inject-keyboard-manager-78730062.js} +1 -1
  340. package/dist/esm/internal-icon-manager-bd80b3bb.js +53 -0
  341. package/dist/esm/{translation-96e5debd.js → internal-translation-controller-911515f9.js} +1 -93
  342. package/dist/esm/{internal-vega-event-manager-efb6786e.js → internal-vega-event-manager-32a3d848.js} +1 -1
  343. package/dist/esm/internal-vega-z-index-manager-7d2b54c3.js +178 -0
  344. package/dist/esm/{keyboard-manager-c92808d8.js → keyboard-manager-38934f94.js} +2 -2
  345. package/dist/esm/{keyboard-manager-slimmer-79c78ce8.js → keyboard-manager-slimmer-9984d922.js} +1 -1
  346. package/dist/esm/legend-input-processor-122008c5.js +2116 -0
  347. package/dist/esm/loader.js +27 -24
  348. package/dist/esm/misc-9fdbcfbb.js +37 -0
  349. package/dist/esm/{month-view-generator-16192182.js → month-view-generator-eaf9029c.js} +1 -1
  350. package/dist/esm/{page-resize-observer-slimmer-8744cb44.js → page-resize-observer-slimmer-d6af0d86.js} +2 -52
  351. package/dist/esm/{public-rules-724873f5.js → public-rules-25cc3a39.js} +13 -14
  352. package/dist/esm/{range-5257c062.js → range-663f44dc.js} +2 -2
  353. package/dist/esm/{responsive-format-facade-28ee2dbd.js → responsive-format-facade-aa705823.js} +3 -12
  354. package/dist/esm/{rich-text-editor-required-rule-873e2e67.js → rich-text-editor-required-rule-a238b862.js} +1 -1
  355. package/dist/esm/{string-format-strategy.abstract-fc60db79.js → string-format-strategy.abstract-713fba36.js} +1 -1
  356. package/dist/esm/{string-input-formatter-slimmer-ee32b1fd.js → string-input-formatter-slimmer-5b413ff9.js} +4 -4
  357. package/dist/esm/{string-mask-strategy-0b0accaa.js → string-mask-strategy-6beaf664.js} +2 -2
  358. package/dist/esm/{style-formatter-314b37f3.js → style-formatter-28138f5c.js} +2 -2
  359. package/dist/esm/{sub-state-notify-slimmer-4453047a.js → sub-state-notify-slimmer-5133f1a8.js} +2 -2
  360. package/dist/esm/{sub-state-observer-slimmer-202ec7dc.js → sub-state-observer-slimmer-478c9f41.js} +3 -3
  361. package/dist/esm/{time-required-rule-5fa43804.js → time-required-rule-e4138a76.js} +1 -1
  362. package/dist/esm/{function-extension-e8c0e43e.js → token-extension-73e4460a.js} +609 -476
  363. package/dist/esm/{translation-slimmer-c936cb1b.js → translation-slimmer-2394b173.js} +1 -1
  364. package/dist/esm/{type-guard-c65a227d.js → type-guard-f50e34d6.js} +1 -1
  365. package/dist/esm/{ui-bb99c0c2.js → ui-ee31416b.js} +12 -0
  366. package/dist/esm/{valid-credit-card-number-rule-666c415d.js → valid-credit-card-number-rule-22ce81db.js} +1 -1
  367. package/dist/esm/vega-accordion.entry.js +21 -30
  368. package/dist/esm/vega-app-footer.entry.js +3 -3
  369. package/dist/esm/vega-app-header-button.entry.js +38 -29
  370. package/dist/esm/vega-backdrop.entry.js +2 -2
  371. package/dist/esm/vega-banner.entry.js +12 -10
  372. package/dist/esm/vega-bar-chart.entry.js +3 -3
  373. package/dist/esm/vega-box.entry.js +14 -29
  374. package/dist/esm/vega-brand-logo.entry.js +7 -5
  375. package/dist/esm/vega-breadcrumb.entry.js +11 -10
  376. package/dist/esm/vega-button-circle.entry.js +36 -31
  377. package/dist/esm/vega-button-group_2.entry.js +12 -12
  378. package/dist/esm/vega-button-link.entry.js +13 -12
  379. package/dist/esm/vega-button.entry.js +19 -28
  380. package/dist/esm/vega-calendar_4.entry.js +23 -20
  381. package/dist/esm/vega-card.entry.js +9 -28
  382. package/dist/esm/vega-carousel.entry.js +14 -25
  383. package/dist/esm/vega-checkbox_2.entry.js +19 -17
  384. package/dist/esm/vega-chip.entry.js +18 -29
  385. package/dist/esm/vega-code-block.entry.js +653 -2704
  386. package/dist/esm/vega-color-picker.entry.js +15 -12
  387. package/dist/esm/vega-combo-box.entry.js +22 -21
  388. package/dist/esm/vega-counter-badge.entry.js +1 -1
  389. package/dist/esm/vega-date-picker_2.entry.js +59 -40
  390. package/dist/esm/vega-dialog-controller-bbb2fc52.js +82 -0
  391. package/dist/esm/vega-dialog_2.entry.js +23 -30
  392. package/dist/esm/vega-divider.entry.js +11 -29
  393. package/dist/esm/vega-dropdown_5.entry.js +39 -45
  394. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  395. package/dist/esm/vega-event-id-38aa77a0.js +113 -0
  396. package/dist/esm/vega-field-error.entry.js +1 -1
  397. package/dist/esm/vega-field-label.entry.js +7 -6
  398. package/dist/esm/vega-file-uploader.entry.js +19 -14
  399. package/dist/esm/vega-flag-icon.entry.js +12 -26
  400. package/dist/esm/vega-flex.entry.js +11 -28
  401. package/dist/esm/vega-font.entry.js +11 -28
  402. package/dist/esm/vega-form.entry.js +20 -18
  403. package/dist/esm/vega-grid.entry.js +9 -28
  404. package/dist/esm/vega-hint.entry.js +1 -1
  405. package/dist/esm/vega-icon.entry.js +15 -28
  406. package/dist/esm/vega-image-uploader.entry.js +28 -31
  407. package/dist/esm/vega-input-credit-card.entry.js +25 -21
  408. package/dist/esm/vega-input-numeric.entry.js +21 -19
  409. package/dist/esm/vega-input-passcode.entry.js +20 -18
  410. package/dist/esm/vega-input-phone-number.entry.js +4760 -5596
  411. package/dist/esm/vega-input-range.entry.js +19 -17
  412. package/dist/esm/vega-input-select.entry.js +27 -32
  413. package/dist/esm/vega-input.entry.js +33 -21
  414. package/dist/esm/{vega-internal-event-id-4a06d705.js → vega-internal-event-id-799d012e.js} +1 -1
  415. package/dist/esm/vega-item-toggle.entry.js +6 -5
  416. package/dist/esm/vega-left-nav_5.entry.js +29 -31
  417. package/dist/esm/vega-line-chart.entry.js +312 -10
  418. package/dist/esm/vega-loader-wrapper_2.entry.js +13 -29
  419. package/dist/esm/vega-page-notification_2.entry.js +4 -3
  420. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +9 -9
  421. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +7 -8
  422. package/dist/esm/vega-pagination.entry.js +20 -30
  423. package/dist/esm/vega-pie-chart.entry.js +6 -89
  424. package/dist/esm/vega-popover_2.entry.js +20 -30
  425. package/dist/esm/vega-progress-tracker_2.entry.js +64 -37
  426. package/dist/esm/vega-radio_2.entry.js +21 -19
  427. package/dist/esm/vega-rich-text-content.entry.js +32 -16
  428. package/dist/esm/vega-rich-text-editor_4.entry.js +33 -30
  429. package/dist/esm/vega-section-title.entry.js +1 -1
  430. package/dist/esm/vega-segment-control.entry.js +9 -7
  431. package/dist/esm/vega-selection-chip_2.entry.js +22 -29
  432. package/dist/esm/vega-selection-tile_2.entry.js +19 -17
  433. package/dist/esm/vega-sidenav_3.entry.js +24 -30
  434. package/dist/esm/vega-signature-capture.entry.js +24 -28
  435. package/dist/esm/vega-skeleton.entry.js +1 -1
  436. package/dist/esm/vega-slot-container.entry.js +1 -1
  437. package/dist/esm/vega-stepper.entry.js +18 -16
  438. package/dist/esm/vega-tab-group_2.entry.js +11 -10
  439. package/dist/esm/vega-table_11.entry.js +28 -29
  440. package/dist/esm/vega-text.entry.js +4 -3
  441. package/dist/esm/vega-textarea.entry.js +18 -16
  442. package/dist/esm/vega-time-picker_2.entry.js +26 -32
  443. package/dist/esm/vega-toggle-switch.entry.js +15 -12
  444. package/dist/esm/vega-tooltip_2.entry.js +18 -29
  445. package/dist/esm/vega.js +27 -24
  446. package/dist/esm/{index-51a7da7f.js → wait-for-component-did-render-b08ef07b.js} +3 -13
  447. package/dist/esm/y-axis-input-processor-c7e05353.js +826 -0
  448. package/dist/sri/vega-sri-manifest.json +425 -409
  449. package/dist/types/components/vega-app-footer/types.d.ts +18 -0
  450. package/dist/types/components/vega-app-header-button/types.d.ts +31 -0
  451. package/dist/types/components/vega-app-header-button/vega-app-header-button.d.ts +2 -0
  452. package/dist/types/components/vega-banner/types.d.ts +9 -0
  453. package/dist/types/components/vega-box/interface.d.ts +46 -0
  454. package/dist/types/components/vega-breadcrumb/types.d.ts +28 -0
  455. package/dist/types/components/vega-button/types.d.ts +12 -0
  456. package/dist/types/components/vega-button-circle/types.d.ts +9 -0
  457. package/dist/types/components/vega-button-circle/vega-button-circle.d.ts +2 -0
  458. package/dist/types/components/vega-button-group/types.d.ts +48 -0
  459. package/dist/types/components/vega-button-link/types.d.ts +3 -0
  460. package/dist/types/components/vega-calendar/types.d.ts +189 -0
  461. package/dist/types/components/vega-calendar/vega-calendar-event-preview/types.d.ts +6 -0
  462. package/dist/types/components/vega-chart/vega-bar-chart/types.d.ts +3 -0
  463. package/dist/types/components/vega-chip/types.d.ts +12 -0
  464. package/dist/types/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.d.ts +2 -10
  465. package/dist/types/components/vega-combo-box/types.d.ts +6 -0
  466. package/dist/types/components/vega-date-picker/types.d.ts +53 -0
  467. package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.d.ts +3 -0
  468. package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +9 -1
  469. package/dist/types/components/vega-dialog/types.d.ts +5 -0
  470. package/dist/types/components/vega-divider/interface.d.ts +18 -0
  471. package/dist/types/components/vega-dropdown/types.d.ts +30 -0
  472. package/dist/types/components/vega-dropdown/vega-dropdown-item/types.d.ts +9 -1
  473. package/dist/types/components/vega-field-error/types.d.ts +12 -0
  474. package/dist/types/components/vega-field-label/types.d.ts +16 -0
  475. package/dist/types/components/vega-file-uploader/types.d.ts +12 -0
  476. package/dist/types/components/vega-font/types.d.ts +3 -0
  477. package/dist/types/components/vega-form/types.d.ts +45 -0
  478. package/dist/types/components/vega-image-uploader/types.d.ts +33 -1
  479. package/dist/types/components/vega-input/types.d.ts +31 -0
  480. package/dist/types/components/vega-input-phone-number/types.d.ts +15 -0
  481. package/dist/types/components/vega-input-range/types.d.ts +9 -0
  482. package/dist/types/components/vega-input-select/types.d.ts +45 -0
  483. package/dist/types/components/vega-item-toggle/types.d.ts +21 -0
  484. package/dist/types/components/vega-loading-indicator/types.d.ts +3 -0
  485. package/dist/types/components/vega-modal/types.d.ts +9 -0
  486. package/dist/types/components/vega-nav/interface.d.ts +108 -0
  487. package/dist/types/components/vega-page-notification/types.d.ts +15 -0
  488. package/dist/types/components/vega-pagination/types.d.ts +11 -0
  489. package/dist/types/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.d.ts +16 -4
  490. package/dist/types/components/vega-progress-tracker/type.d.ts +8 -0
  491. package/dist/types/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.d.ts +6 -0
  492. package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +2 -2
  493. package/dist/types/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.d.ts +6 -0
  494. package/dist/types/components/vega-rich-text-editor/extensions/base-extension-renderer.d.ts +9 -1
  495. package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +9 -1
  496. package/dist/types/components/vega-rich-text-editor/extensions/functions/function-extension.d.ts +0 -7
  497. package/dist/types/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.d.ts +5 -10
  498. package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +1 -5
  499. package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.d.ts +3 -8
  500. package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.d.ts +5 -9
  501. package/dist/types/components/vega-rich-text-editor/helpers/extension-context-manager.d.ts +26 -0
  502. package/dist/types/components/vega-rich-text-editor/helpers/extension-context-manager.test.d.ts +1 -0
  503. package/dist/types/components/vega-rich-text-editor/interface.d.ts +477 -2
  504. package/dist/types/components/vega-rich-text-editor/test/extensions/extension-test-utils.d.ts +21 -0
  505. package/dist/types/components/vega-rich-text-editor/vega-rich-text-image-editor/types.d.ts +24 -0
  506. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/types.d.ts +24 -0
  507. package/dist/types/components/vega-segment-control/types.d.ts +18 -0
  508. package/dist/types/components/vega-selection-chip/interface.d.ts +12 -0
  509. package/dist/types/components/vega-selection-chip/vega-selection-chip-group/interface.d.ts +4 -0
  510. package/dist/types/components/vega-selection-tile/interface.d.ts +9 -0
  511. package/dist/types/components/vega-sidenav/types.d.ts +51 -0
  512. package/dist/types/components/vega-signature-capture/types.d.ts +29 -2
  513. package/dist/types/components/vega-skeleton/interface.d.ts +6 -0
  514. package/dist/types/components/vega-tab-group/types.d.ts +36 -0
  515. package/dist/types/components/vega-table/interface.d.ts +237 -20
  516. package/dist/types/components/vega-table/vega-table-expand-row/types.d.ts +6 -0
  517. package/dist/types/components/vega-table/vega-table-foot/types.d.ts +9 -0
  518. package/dist/types/components/vega-table/vega-table-foot-row/types.d.ts +9 -0
  519. package/dist/types/components/vega-table/vega-table-head/types.d.ts +9 -0
  520. package/dist/types/components/vega-table/vega-table-head-row/types.d.ts +12 -0
  521. package/dist/types/components/vega-table/vega-table-row/types.d.ts +18 -0
  522. package/dist/types/components/vega-text/types.d.ts +6 -0
  523. package/dist/types/components/vega-time-picker/types.d.ts +33 -0
  524. package/dist/types/components/vega-virtual-scroll/types.d.ts +30 -1
  525. package/dist/types/components.d.ts +24 -4
  526. package/dist/types/helpers/chart/test/input-processors/y-axis-input-processor.coverage.test.d.ts +1 -0
  527. package/dist/types/helpers/common/index.d.ts +2 -15
  528. package/dist/types/helpers/common/test/wait-for-component-did-render.test.d.ts +1 -0
  529. package/dist/types/helpers/common/wait-for-component-did-render.d.ts +8 -0
  530. package/dist/types/helpers/common/wait-for-vega-handler.d.ts +6 -15
  531. package/dist/types/helpers/feature-control/feature-flag.d.ts +2 -1
  532. package/dist/types/helpers/public-api.d.ts +0 -2
  533. package/dist/types/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.d.ts +44 -0
  534. package/dist/types/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.d.ts +1 -0
  535. package/dist/types/helpers/slimmers/position-calculation/base-position-calculation-strategy.d.ts +57 -48
  536. package/dist/types/helpers/slimmers/position-calculation/position-calculation-controller.d.ts +5 -0
  537. package/dist/types/helpers/slimmers/position-calculation/screen-position-calculation-strategy.d.ts +41 -1
  538. package/dist/types/helpers/slimmers/position-calculation/screen-scroll-position-update.d.ts +39 -0
  539. package/dist/types/helpers/ui/element-appender.d.ts +0 -1
  540. package/dist/types/index.d.ts +2 -0
  541. package/dist/types/polyfill/d3/d3-array-polyfill.d.ts +48 -0
  542. package/dist/types/polyfill/d3/d3-axis-polyfill.d.ts +53 -0
  543. package/dist/types/polyfill/d3/d3-scale-polyfill.d.ts +42 -0
  544. package/dist/types/polyfill/d3/d3-selection-polyfill.d.ts +173 -0
  545. package/dist/types/polyfill/d3/d3-shape-polyfill.d.ts +129 -0
  546. package/dist/types/polyfill/d3/d3-time-format-polyfill.d.ts +28 -0
  547. package/dist/types/polyfill/d3/d3-time-polyfill.d.ts +68 -0
  548. package/dist/types/polyfill/d3/index.d.ts +27 -0
  549. package/dist/types/polyfill/d3/test/d3-array-polyfill.test.d.ts +1 -0
  550. package/dist/types/polyfill/d3/test/d3-axis-polyfill.test.d.ts +1 -0
  551. package/dist/types/polyfill/d3/test/d3-integration.test.d.ts +1 -0
  552. package/dist/types/polyfill/d3/test/d3-scale-polyfill.test.d.ts +1 -0
  553. package/dist/types/polyfill/d3/test/d3-selection-polyfill.test.d.ts +1 -0
  554. package/dist/types/polyfill/d3/test/d3-shape-polyfill.test.d.ts +1 -0
  555. package/dist/types/polyfill/d3/test/d3-time-format-polyfill.test.d.ts +1 -0
  556. package/dist/types/polyfill/d3/test/d3-time-polyfill.test.d.ts +1 -0
  557. package/dist/types/polyfill/d3/test/index.test.d.ts +1 -0
  558. package/dist/types/polyfill/libphonenumber/as-you-type.d.ts +154 -0
  559. package/dist/types/polyfill/libphonenumber/format-helpers.d.ts +64 -0
  560. package/dist/types/polyfill/libphonenumber/index.d.ts +22 -0
  561. package/dist/types/polyfill/libphonenumber/metadata.d.ts +45 -0
  562. package/dist/types/polyfill/libphonenumber/metadata.json.d.ts +470 -0
  563. package/dist/types/polyfill/libphonenumber/parse-phone-number.d.ts +26 -0
  564. package/dist/types/polyfill/libphonenumber/phone-number.d.ts +24 -0
  565. package/dist/types/polyfill/libphonenumber/test/as-you-type.test.d.ts +1 -0
  566. package/dist/types/polyfill/libphonenumber/test/format-helpers.test.d.ts +1 -0
  567. package/dist/types/polyfill/libphonenumber/test/index.test.d.ts +1 -0
  568. package/dist/types/polyfill/libphonenumber/test/metadata.test.d.ts +1 -0
  569. package/dist/types/polyfill/libphonenumber/test/parse-phone-number.test.d.ts +1 -0
  570. package/dist/types/polyfill/libphonenumber/test/phone-number.test.d.ts +1 -0
  571. package/dist/types/polyfill/libphonenumber/types.d.ts +77 -0
  572. package/dist/types/polyfill/prism/index.d.ts +3 -0
  573. package/dist/types/polyfill/prism/languages/css.d.ts +6 -0
  574. package/dist/types/polyfill/prism/languages/javascript.d.ts +7 -0
  575. package/dist/types/polyfill/prism/languages/jsx.d.ts +7 -0
  576. package/dist/types/polyfill/prism/languages/language-registry.d.ts +8 -0
  577. package/dist/types/polyfill/prism/languages/markup.d.ts +6 -0
  578. package/dist/types/polyfill/prism/languages/tsx.d.ts +7 -0
  579. package/dist/types/polyfill/prism/languages/typescript.d.ts +2 -0
  580. package/dist/types/polyfill/prism/test/css.test.d.ts +1 -0
  581. package/dist/types/polyfill/prism/test/javascript.test.d.ts +1 -0
  582. package/dist/types/polyfill/prism/test/jsx.test.d.ts +1 -0
  583. package/dist/types/polyfill/prism/test/language-registry.test.d.ts +1 -0
  584. package/dist/types/polyfill/prism/test/markup.test.d.ts +1 -0
  585. package/dist/types/polyfill/prism/test/test-utils.d.ts +10 -0
  586. package/dist/types/polyfill/prism/test/tokenizer.test.d.ts +1 -0
  587. package/dist/types/polyfill/prism/test/tsx.test.d.ts +1 -0
  588. package/dist/types/polyfill/prism/test/typescript.test.d.ts +1 -0
  589. package/dist/types/polyfill/prism/tokenizer.d.ts +17 -0
  590. package/dist/types/polyfill/prism/types.d.ts +25 -0
  591. package/dist/types/polyfill/tinycolor/tinycolor-polyfill.d.ts +149 -0
  592. package/dist/types/polyfill/tinycolor/tinycolor-polyfill.test.d.ts +1 -0
  593. package/dist/types/types/components.type.d.ts +5 -1
  594. package/dist/types/types/design-token.type.d.ts +36 -0
  595. package/dist/types/types/flag.type.d.ts +257 -3
  596. package/dist/types/types/general.d.ts +12 -0
  597. package/dist/types/types/ui.type.d.ts +372 -0
  598. package/dist/types/types/vega-chart.d.ts +292 -14
  599. package/dist/types/utils/e2e-utils.d.ts +2 -0
  600. package/dist/types/utils/sanitize/constants/tag-sets.d.ts +6 -0
  601. package/dist/types/utils/sanitize/core/html-sanitizer.d.ts +22 -0
  602. package/dist/types/utils/sanitize/core/sanitize-strategy.d.ts +27 -0
  603. package/dist/types/utils/sanitize/core/types.d.ts +13 -0
  604. package/dist/types/utils/sanitize/index.d.ts +12 -0
  605. package/dist/types/utils/sanitize/strategies/empty-sanitize-strategy.d.ts +14 -0
  606. package/dist/types/utils/sanitize/strategies/index.d.ts +3 -0
  607. package/dist/types/utils/sanitize/strategies/label-sanitize-strategy.d.ts +10 -0
  608. package/dist/types/utils/sanitize/strategies/style-sanitize-strategy.d.ts +24 -0
  609. package/dist/types/utils/sanitize/test/empty-strategy.test.d.ts +1 -0
  610. package/dist/types/utils/sanitize/test/html-sanitizer.test.d.ts +1 -0
  611. package/dist/types/utils/sanitize/test/label-strategy.test.d.ts +1 -0
  612. package/dist/types/utils/sanitize/test/sanitize-strategy.test.d.ts +1 -0
  613. package/dist/types/utils/sanitize/test/sanitize.test.d.ts +1 -0
  614. package/dist/types/utils/sanitize/test/serialize-fragment.test.d.ts +1 -0
  615. package/dist/types/utils/sanitize/test/style-strategy.test.d.ts +1 -0
  616. package/dist/types/utils/sanitize/utils/serialize-fragment.d.ts +12 -0
  617. package/dist/vega/index.esm.js +1 -1
  618. package/dist/vega/p-0037068c.entry.js +1 -0
  619. package/dist/vega/p-010ff53d.entry.js +1 -0
  620. package/dist/vega/p-021d4ae4.js +1 -0
  621. package/dist/vega/{p-66fa700b.js → p-02c9796a.js} +1 -1
  622. package/dist/vega/p-03004a05.entry.js +1 -0
  623. package/dist/vega/p-0572c393.entry.js +1 -0
  624. package/dist/vega/p-0a3a285b.entry.js +1 -0
  625. package/dist/vega/{p-e5af5a4d.entry.js → p-0b4880bd.entry.js} +1 -1
  626. package/dist/vega/p-0d4cb1c7.entry.js +1 -0
  627. package/dist/vega/{p-920719ad.js → p-0e679d8c.js} +1 -1
  628. package/dist/vega/p-100b44c3.entry.js +1 -0
  629. package/dist/vega/p-168bb296.entry.js +1 -0
  630. package/dist/vega/{p-e77a83e4.js → p-18e8d9b7.js} +1 -1
  631. package/dist/vega/p-1a011d47.entry.js +1 -0
  632. package/dist/vega/p-1a3236e7.entry.js +1 -0
  633. package/dist/vega/{p-c9b6b5a9.js → p-1a51bf6f.js} +1 -1
  634. package/dist/vega/{p-ad2055f4.entry.js → p-1deedff2.entry.js} +1 -1
  635. package/dist/vega/p-1f3cd061.entry.js +1 -0
  636. package/dist/vega/p-1fa0c7da.entry.js +1 -0
  637. package/dist/vega/p-22056609.entry.js +1 -0
  638. package/dist/vega/p-242fbcad.entry.js +1 -0
  639. package/dist/vega/p-2a10e2e5.js +1 -0
  640. package/dist/vega/p-2b142818.entry.js +1 -0
  641. package/dist/vega/p-2bb5a232.js +1 -0
  642. package/dist/vega/{p-e9b86dac.entry.js → p-2c1a85dd.entry.js} +1 -1
  643. package/dist/vega/p-2d69632d.js +1 -0
  644. package/dist/vega/p-31ac7386.js +1 -0
  645. package/dist/vega/p-33f9ad94.entry.js +1 -0
  646. package/dist/vega/p-34bcf4ed.entry.js +1 -0
  647. package/dist/vega/{p-4897bedd.entry.js → p-358b4a06.entry.js} +1 -1
  648. package/dist/vega/p-36a09524.entry.js +1 -0
  649. package/dist/vega/p-3afc025e.entry.js +1 -0
  650. package/dist/vega/p-3c05abd9.entry.js +1 -0
  651. package/dist/vega/p-3ce2b05c.entry.js +1 -0
  652. package/dist/vega/{p-ea04a387.entry.js → p-3f3c771a.entry.js} +1 -1
  653. package/dist/vega/{p-1f83cebf.js → p-415ffa35.js} +1 -1
  654. package/dist/vega/p-43ff48c0.entry.js +1 -0
  655. package/dist/vega/{p-d849e0f5.js → p-4415ad28.js} +1 -1
  656. package/dist/vega/{p-0575d22e.js → p-464559e3.js} +1 -1
  657. package/dist/vega/p-4742feef.entry.js +1 -0
  658. package/dist/vega/p-49845a91.js +1 -0
  659. package/dist/vega/p-4aa52ed2.entry.js +1 -0
  660. package/dist/vega/p-4aa94940.entry.js +1 -0
  661. package/dist/vega/p-4bee4202.entry.js +1 -0
  662. package/dist/vega/{p-e16b3adf.js → p-4bffdb28.js} +1 -1
  663. package/dist/vega/{p-a2aeb646.js → p-4ea30592.js} +1 -1
  664. package/dist/vega/p-50d074ed.entry.js +1 -0
  665. package/dist/vega/{p-0b38a01f.entry.js → p-51fcb07f.entry.js} +1 -1
  666. package/dist/vega/p-5485c387.entry.js +1 -0
  667. package/dist/vega/p-560d2f48.entry.js +1 -0
  668. package/dist/vega/p-5833f33b.entry.js +1 -0
  669. package/dist/vega/p-592296d7.entry.js +1 -0
  670. package/dist/vega/p-593e0f80.js +1 -0
  671. package/dist/vega/p-5a25014f.js +1 -0
  672. package/dist/vega/p-5cfce62d.entry.js +1 -0
  673. package/dist/vega/p-5eb7f382.js +1 -0
  674. package/dist/vega/p-5f377954.js +1 -1
  675. package/dist/vega/p-60f77f5f.entry.js +1 -0
  676. package/dist/vega/p-641cdb5c.entry.js +1 -0
  677. package/dist/vega/p-67745549.entry.js +1 -0
  678. package/dist/vega/{p-75f981ce.js → p-6b6f0fb4.js} +1 -1
  679. package/dist/vega/p-6d219c44.entry.js +1 -0
  680. package/dist/vega/p-70df91fb.entry.js +1 -0
  681. package/dist/vega/p-7425cedc.entry.js +1 -0
  682. package/dist/vega/p-781fd6e0.js +1 -0
  683. package/dist/vega/{p-5b71c85e.js → p-7c39ce96.js} +1 -1
  684. package/dist/vega/p-7d7aaff9.entry.js +1 -0
  685. package/dist/vega/{p-4dd6554e.entry.js → p-7f46cc1e.entry.js} +1 -1
  686. package/dist/vega/{p-badad9ed.js → p-81b044b9.js} +1 -1
  687. package/dist/vega/p-857069a5.entry.js +1 -0
  688. package/dist/vega/p-8ac2d165.js +1 -0
  689. package/dist/vega/p-8b5d3a52.js +1 -0
  690. package/dist/vega/{p-fff13ed1.entry.js → p-8b891f36.entry.js} +1 -1
  691. package/dist/vega/p-8e34b266.js +1 -0
  692. package/dist/vega/{p-dd11f735.js → p-9339c6c4.js} +1 -1
  693. package/dist/vega/p-9441f2ba.entry.js +1 -0
  694. package/dist/vega/p-95528b47.js +1 -0
  695. package/dist/vega/p-9fb877c1.entry.js +1 -0
  696. package/dist/vega/{p-6f8be8ea.js → p-a0b66c25.js} +1 -1
  697. package/dist/vega/p-a46e977b.entry.js +1 -0
  698. package/dist/vega/{p-d0e31633.js → p-a786259a.js} +1 -1
  699. package/dist/vega/p-a8792e3d.js +1 -0
  700. package/dist/vega/{p-60851f9d.js → p-aa1174dc.js} +1 -1
  701. package/dist/vega/p-ab834f06.js +1 -0
  702. package/dist/vega/p-ac82b9f9.entry.js +1 -0
  703. package/dist/vega/p-b1773281.entry.js +1 -0
  704. package/dist/vega/p-b201f379.js +1 -0
  705. package/dist/vega/p-b54dc37c.entry.js +1 -0
  706. package/dist/vega/p-b597393b.entry.js +1 -0
  707. package/dist/vega/p-b5f18f4b.entry.js +1 -0
  708. package/dist/vega/p-b7f3221f.js +1 -0
  709. package/dist/vega/p-be1a210b.js +1 -0
  710. package/dist/vega/p-bf6fc19f.entry.js +1 -0
  711. package/dist/vega/{p-691ba1ae.js → p-bff57aa4.js} +1 -1
  712. package/dist/vega/p-c165232c.entry.js +1 -0
  713. package/dist/vega/p-c292ade4.entry.js +1 -0
  714. package/dist/vega/p-c2d2faa0.js +1 -0
  715. package/dist/vega/p-c3d2f316.js +1 -0
  716. package/dist/vega/{p-671afda4.entry.js → p-c72e08c6.entry.js} +1 -1
  717. package/dist/vega/p-c801c85d.js +1 -0
  718. package/dist/vega/p-c8feb644.entry.js +1 -0
  719. package/dist/vega/p-cc5eaa1b.js +1 -0
  720. package/dist/vega/p-cccd7648.entry.js +1 -0
  721. package/dist/vega/p-cfecc1cb.entry.js +1 -0
  722. package/dist/vega/p-d07f5d5a.entry.js +1 -0
  723. package/dist/vega/p-d1cfe972.entry.js +1 -0
  724. package/dist/vega/p-d2ee5711.entry.js +1 -0
  725. package/dist/vega/p-d64fab3d.js +1 -0
  726. package/dist/vega/p-d78f6ede.js +1 -0
  727. package/dist/vega/p-d8180e42.entry.js +1 -0
  728. package/dist/vega/p-daa60a59.entry.js +1 -0
  729. package/dist/vega/p-dad3ba5f.js +1 -0
  730. package/dist/vega/p-db5fa164.entry.js +1 -0
  731. package/dist/vega/p-de64f6e6.js +1 -0
  732. package/dist/vega/p-e1fbfd20.js +1 -0
  733. package/dist/vega/p-e4917e76.js +1 -0
  734. package/dist/vega/{p-521d1d07.js → p-e52890db.js} +1 -1
  735. package/dist/vega/{p-1298b126.js → p-e632475e.js} +1 -1
  736. package/dist/vega/p-e6adf829.js +1 -0
  737. package/dist/vega/p-e6cf2ace.entry.js +1 -0
  738. package/dist/vega/p-e7fbef97.js +1 -0
  739. package/dist/vega/{p-77edf50c.js → p-e827d56d.js} +1 -1
  740. package/dist/vega/p-e8775a56.entry.js +1 -0
  741. package/dist/vega/p-f0e828d8.js +1 -0
  742. package/dist/vega/p-f2b0b58a.js +1 -0
  743. package/dist/vega/p-f3e6483c.js +1 -0
  744. package/dist/vega/p-f428086c.entry.js +1 -0
  745. package/dist/vega/p-fc9ac6e9.entry.js +1 -0
  746. package/dist/vega/p-ffd48e37.entry.js +1 -0
  747. package/dist/vega/vega.esm.js +1 -1
  748. package/package.json +3 -9
  749. package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
  750. package/dist/cjs/language-extension-8c4a56ff.js +0 -210
  751. package/dist/cjs/legend-input-processor-27c65353.js +0 -4759
  752. package/dist/cjs/sanitize-fb222510.js +0 -131
  753. package/dist/cjs/wait-for-vega-handler-5469ff80.js +0 -63
  754. package/dist/cjs/y-axis-input-processor-9fbfd5e7.js +0 -2302
  755. package/dist/collection/utils/sanitize.js +0 -126
  756. package/dist/collection/utils/test/sanitize.test.js +0 -65
  757. package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
  758. package/dist/esm/dom-node-subject-observer-factory-064ee2b2.js +0 -250
  759. package/dist/esm/language-extension-29bf8acd.js +0 -207
  760. package/dist/esm/legend-input-processor-5ecae3a7.js +0 -4742
  761. package/dist/esm/sanitize-fd0cb40d.js +0 -129
  762. package/dist/esm/wait-for-vega-handler-c2c07ac3.js +0 -61
  763. package/dist/esm/y-axis-input-processor-bc54314a.js +0 -2290
  764. package/dist/types/utils/sanitize.d.ts +0 -71
  765. package/dist/vega/p-011b94b1.entry.js +0 -1
  766. package/dist/vega/p-012753b5.entry.js +0 -1
  767. package/dist/vega/p-024331ce.entry.js +0 -1
  768. package/dist/vega/p-08a90cc6.entry.js +0 -1
  769. package/dist/vega/p-0bb3be0b.entry.js +0 -1
  770. package/dist/vega/p-0ede1fea.entry.js +0 -1
  771. package/dist/vega/p-10ac8b57.js +0 -1
  772. package/dist/vega/p-112455b1.js +0 -1
  773. package/dist/vega/p-17c55205.entry.js +0 -1
  774. package/dist/vega/p-1e0d8228.entry.js +0 -1
  775. package/dist/vega/p-3353b3d7.js +0 -1
  776. package/dist/vega/p-365b1b35.entry.js +0 -1
  777. package/dist/vega/p-3ae9ee3d.entry.js +0 -1
  778. package/dist/vega/p-3af92370.entry.js +0 -1
  779. package/dist/vega/p-3bf66be2.js +0 -1
  780. package/dist/vega/p-3c5a28e4.entry.js +0 -1
  781. package/dist/vega/p-3e5f362f.js +0 -1
  782. package/dist/vega/p-430be941.js +0 -1
  783. package/dist/vega/p-43f585f7.entry.js +0 -1
  784. package/dist/vega/p-45296fd4.entry.js +0 -1
  785. package/dist/vega/p-46b077d9.js +0 -1
  786. package/dist/vega/p-476a173a.js +0 -1
  787. package/dist/vega/p-491618a6.entry.js +0 -1
  788. package/dist/vega/p-4a537391.entry.js +0 -1
  789. package/dist/vega/p-4aa893ef.entry.js +0 -1
  790. package/dist/vega/p-4c47e8bb.entry.js +0 -1
  791. package/dist/vega/p-4da75f2b.js +0 -1
  792. package/dist/vega/p-509eb52e.entry.js +0 -1
  793. package/dist/vega/p-5110ba73.entry.js +0 -1
  794. package/dist/vega/p-556f9a21.entry.js +0 -1
  795. package/dist/vega/p-55b54ba0.entry.js +0 -1
  796. package/dist/vega/p-5910be31.entry.js +0 -1
  797. package/dist/vega/p-5d676a94.js +0 -1
  798. package/dist/vega/p-5ea2e43c.entry.js +0 -1
  799. package/dist/vega/p-5efc6fe1.entry.js +0 -1
  800. package/dist/vega/p-64cd1931.entry.js +0 -1
  801. package/dist/vega/p-67fcf6f2.entry.js +0 -9
  802. package/dist/vega/p-68df4288.js +0 -1
  803. package/dist/vega/p-6a2205a1.entry.js +0 -1
  804. package/dist/vega/p-6a4277df.entry.js +0 -1
  805. package/dist/vega/p-6e136980.js +0 -1
  806. package/dist/vega/p-6fa8e231.entry.js +0 -1
  807. package/dist/vega/p-7045e84c.entry.js +0 -1
  808. package/dist/vega/p-7288f8c4.js +0 -1
  809. package/dist/vega/p-749f96a4.js +0 -1
  810. package/dist/vega/p-7aaece55.entry.js +0 -1
  811. package/dist/vega/p-7ec6a104.entry.js +0 -1
  812. package/dist/vega/p-81134e9e.entry.js +0 -1
  813. package/dist/vega/p-89d685a8.js +0 -1
  814. package/dist/vega/p-8c0eb12f.entry.js +0 -1
  815. package/dist/vega/p-8c9ea6f4.js +0 -1
  816. package/dist/vega/p-8d0ca805.js +0 -1
  817. package/dist/vega/p-8d701832.entry.js +0 -1
  818. package/dist/vega/p-8e42a14c.entry.js +0 -1
  819. package/dist/vega/p-8ed0faa2.entry.js +0 -1
  820. package/dist/vega/p-94394df7.entry.js +0 -1
  821. package/dist/vega/p-99aa554b.entry.js +0 -1
  822. package/dist/vega/p-9a2446f1.entry.js +0 -1
  823. package/dist/vega/p-9fd503e9.entry.js +0 -1
  824. package/dist/vega/p-a4670e23.js +0 -1
  825. package/dist/vega/p-a475d525.entry.js +0 -1
  826. package/dist/vega/p-a530797f.entry.js +0 -1
  827. package/dist/vega/p-a85ad369.entry.js +0 -1
  828. package/dist/vega/p-ac5e9955.entry.js +0 -1
  829. package/dist/vega/p-aedf7146.js +0 -1
  830. package/dist/vega/p-b1f869fb.js +0 -1
  831. package/dist/vega/p-b4ea3fad.js +0 -1
  832. package/dist/vega/p-bb4a558d.entry.js +0 -1
  833. package/dist/vega/p-bb8339ed.entry.js +0 -1
  834. package/dist/vega/p-be23bef2.js +0 -1
  835. package/dist/vega/p-be930e85.entry.js +0 -1
  836. package/dist/vega/p-bf2bd6d0.entry.js +0 -1
  837. package/dist/vega/p-c2488ed6.js +0 -1
  838. package/dist/vega/p-c379a5a5.entry.js +0 -1
  839. package/dist/vega/p-c616c592.js +0 -1
  840. package/dist/vega/p-ca3472c1.entry.js +0 -1
  841. package/dist/vega/p-cc43bffb.js +0 -1
  842. package/dist/vega/p-cf5b80f9.entry.js +0 -1
  843. package/dist/vega/p-db60a38e.entry.js +0 -1
  844. package/dist/vega/p-db8cdba6.js +0 -1
  845. package/dist/vega/p-e93545fd.js +0 -1
  846. package/dist/vega/p-e9c4fd24.entry.js +0 -1
  847. package/dist/vega/p-eb60cfe1.entry.js +0 -1
  848. package/dist/vega/p-ec192283.entry.js +0 -1
  849. package/dist/vega/p-ef9cbad1.js +0 -1
  850. package/dist/vega/p-f2a3a1ec.entry.js +0 -1
  851. package/dist/vega/p-f2cdd212.entry.js +0 -1
  852. package/dist/vega/p-f3c3ff26.entry.js +0 -1
  853. package/dist/vega/p-f4c05b4a.entry.js +0 -1
  854. package/dist/vega/p-f52a0155.entry.js +0 -1
  855. package/dist/vega/p-f69f84a7.js +0 -1
  856. package/dist/vega/p-f8641214.entry.js +0 -1
  857. package/dist/vega/p-f89443aa.entry.js +0 -1
  858. package/dist/vega/p-f8f7cf48.entry.js +0 -1
  859. package/dist/vega/p-fe12eff6.js +0 -1
  860. /package/dist/{types/utils/test/sanitize.test.d.ts → collection/polyfill/prism/types.js} +0 -0
  861. /package/dist/vega/{p-d9671d27.js → p-6c170474.js} +0 -0
@@ -0,0 +1,2116 @@
1
+ import { g as getLongestTextLengthFromArray } from './array-7888f339.js';
2
+ import { b as Typography } from './typography-396de03f.js';
3
+ import { a as parseNumberToPixelString, b as parsePixelStringToNumber } from './pixel-f32c07ce.js';
4
+
5
+ /** The GraphContextFactory class provides a method to create and return either a HTMLCanvasElement or SVGElement based on the specified mode and container element. */
6
+ class GraphContextFactory {
7
+ /**
8
+ * This function returns either a HTMLCanvasElement or an SVGElement based on the specified mode and container.
9
+ *
10
+ * @param {ChartGraphMode} mode - A string that specifies the mode of the chart graph. It can be either 'canvas' or 'svg'.
11
+ * @param {HTMLElement} container - HTMLElement - the HTML element that will contain the chart/graph.
12
+ * @returns {SVGElement | HTMLCanvasElement} either a HTMLCanvasElement or an SVGElement depending on the value of the `mode` parameter.
13
+ */
14
+ static get(mode, container) {
15
+ if (mode === 'canvas') {
16
+ const canvas = container.querySelector('canvas');
17
+ let context;
18
+ if (canvas) {
19
+ context = canvas;
20
+ }
21
+ else {
22
+ // eslint-disable-next-line no-restricted-globals
23
+ context = document.createElement('canvas');
24
+ context = container.appendChild(context);
25
+ }
26
+ return context;
27
+ }
28
+ else {
29
+ const svg = container.querySelector('svg');
30
+ let context;
31
+ if (svg) {
32
+ context = svg;
33
+ }
34
+ else {
35
+ // eslint-disable-next-line no-restricted-globals
36
+ context = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
37
+ context = container.appendChild(context);
38
+ }
39
+ return context;
40
+ }
41
+ }
42
+ }
43
+
44
+ /**
45
+ * defining an abstract class called `BaseRenderer` that takes a generic type `T` which
46
+ * can be either an `SVGElement` or a `HTMLCanvasElement`
47
+ */
48
+ class BaseRenderer {
49
+ /**
50
+ * This is a constructor function that takes a parameter of type T and sets it as a protected property called "context".
51
+ *
52
+ * @param {unknown} context - The "context" parameter is a protected property of a class constructor that is
53
+ * of type "T". It is used to store a reference to an object or data that is required by the class
54
+ * methods to perform their tasks
55
+ */
56
+ constructor(context) {
57
+ this.context = context;
58
+ }
59
+ }
60
+
61
+ /**
62
+ * D3 Selection Polyfill - A lightweight DOM selection and manipulation utility.
63
+ *
64
+ * This is a drop-in replacement for d3-selection, implementing only the methods
65
+ * used in the Vega chart rendering system.
66
+ *
67
+ * Supported methods: select, selectAll, append, attr, property, text, datum,
68
+ * call, node, nodes, each, remove, clone, transition, duration.
69
+ *
70
+ * @see VD-5022 - [Zero Dependencies] remove d3 dependency
71
+ */
72
+ /**
73
+ * A lightweight selection class mimicking d3-selection's chainable API.
74
+ * Wraps an array of DOM elements and provides attribute/property/child manipulation.
75
+ */
76
+ class D3SelectionPolyfill {
77
+ /**
78
+ * @param {Element[]} elements - Array of DOM elements to wrap.
79
+ * @param {*} [datum] - Optional bound datum for the selection.
80
+ */
81
+ constructor(elements, datum) {
82
+ this._groups = elements;
83
+ this._datum = datum;
84
+ }
85
+ /**
86
+ * Selects the first descendant element matching the selector.
87
+ *
88
+ * @template DescElement
89
+ * @template Datum
90
+ * @template GElement
91
+ * @param {string} selector - CSS selector string.
92
+ * @returns {D3SelectionPolyfill<DescElement, Datum, GElement, Datum>} A new selection wrapping the matched element.
93
+ */
94
+ select(selector) {
95
+ const el = this._groups[0];
96
+ if (!el) {
97
+ return new D3SelectionPolyfill([]);
98
+ }
99
+ const found = el.querySelector(selector);
100
+ return new D3SelectionPolyfill(found ? [found] : []);
101
+ }
102
+ /**
103
+ * Selects all descendant elements matching the selector.
104
+ *
105
+ * @template DescElement
106
+ * @template NewDatum
107
+ * @template GElement
108
+ * @template Datum
109
+ * @param {string} selector - CSS selector string.
110
+ * @returns {D3SelectionPolyfill<DescElement, NewDatum, GElement, Datum>} A new selection wrapping all matched elements.
111
+ */
112
+ selectAll(selector) {
113
+ const el = this._groups[0];
114
+ if (!el) {
115
+ return new D3SelectionPolyfill([]);
116
+ }
117
+ const found = Array.from(el.querySelectorAll(selector));
118
+ return new D3SelectionPolyfill(found);
119
+ }
120
+ /**
121
+ * Appends a new child element to each element in the selection.
122
+ * Accepts either a tag name string or a factory function that returns a DOM element.
123
+ *
124
+ * @template ChildElement
125
+ * @template Datum
126
+ * @template GElement
127
+ * @param {string | Function} tagOrFactory - Tag name (e.g. 'g', 'path') or a factory function.
128
+ * @returns {D3SelectionPolyfill<ChildElement, Datum, GElement, Datum>} A new selection wrapping the appended elements.
129
+ */
130
+ append(tagOrFactory) {
131
+ const results = [];
132
+ for (const parent of this._groups) {
133
+ let child;
134
+ if (typeof tagOrFactory === 'function') {
135
+ child = tagOrFactory();
136
+ }
137
+ else {
138
+ child = parent.ownerDocument.createElementNS('http://www.w3.org/2000/svg', tagOrFactory);
139
+ }
140
+ parent.appendChild(child);
141
+ results.push(child);
142
+ }
143
+ return new D3SelectionPolyfill(results, this._datum);
144
+ }
145
+ /**
146
+ * Sets or gets an attribute on each element.
147
+ * If value is a function, it is called with the bound datum.
148
+ *
149
+ * @param {...*} args - Attribute name, and optionally a value or function returning a value.
150
+ * @returns {any} This selection for chaining, or the attribute value if getting.
151
+ */
152
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
153
+ attr(...args) {
154
+ const name = args[0];
155
+ if (args.length === 1) {
156
+ const el = this._groups[0];
157
+ return el ? el.getAttribute(name) : null;
158
+ }
159
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
160
+ const value = args[1];
161
+ for (let i = 0; i < this._groups.length; i++) {
162
+ const el = this._groups[i];
163
+ const resolvedValue = typeof value === 'function' ? value.call(el, this._datum, i, this._groups) : value;
164
+ if (resolvedValue === null || resolvedValue === undefined) {
165
+ el.removeAttribute(name);
166
+ }
167
+ else {
168
+ el.setAttribute(name, String(resolvedValue));
169
+ }
170
+ }
171
+ return this;
172
+ }
173
+ /**
174
+ * Sets a JavaScript property on each element.
175
+ *
176
+ * @param {string} name - Property name.
177
+ * @param {unknown} value - Property value.
178
+ * @returns {this} This selection for chaining.
179
+ */
180
+ property(name, value) {
181
+ for (const el of this._groups) {
182
+ el[name] = value;
183
+ }
184
+ return this;
185
+ }
186
+ /**
187
+ * Sets the text content of each element.
188
+ *
189
+ * @param {string} value - Text content string.
190
+ * @returns {this} This selection for chaining.
191
+ */
192
+ text(value) {
193
+ for (const el of this._groups) {
194
+ el.textContent = value;
195
+ }
196
+ return this;
197
+ }
198
+ /**
199
+ * Binds a datum to the selection.
200
+ *
201
+ * @template NewDatum
202
+ * @template GElement
203
+ * @template PElement
204
+ * @template PDatum
205
+ * @param {*} data - The datum to bind.
206
+ * @returns {D3SelectionPolyfill<GElement, NewDatum, PElement, PDatum>} A new selection with the bound datum.
207
+ */
208
+ datum(data) {
209
+ return new D3SelectionPolyfill(this._groups, data);
210
+ }
211
+ /**
212
+ * Calls a function with this selection as argument. Used for grouping operations.
213
+ *
214
+ * @param {Function} fn - Function to call.
215
+ * @param {...*} args - Additional arguments.
216
+ * @returns {this} This selection for chaining.
217
+ */
218
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
219
+ call(fn, ...args) {
220
+ fn(this, ...args);
221
+ return this;
222
+ }
223
+ /**
224
+ * Returns the first DOM node in the selection, or null.
225
+ *
226
+ * @template GElement
227
+ * @returns {GElement | null} The first element or null.
228
+ */
229
+ node() {
230
+ return this._groups[0] || null;
231
+ }
232
+ /**
233
+ * Returns all DOM nodes in the selection as an array.
234
+ *
235
+ * @template GElement
236
+ * @returns {GElement[]} Array of elements.
237
+ */
238
+ nodes() {
239
+ return [...this._groups];
240
+ }
241
+ /**
242
+ * Iterates over each element, calling the provided function.
243
+ * The function is called with `this` set to the current DOM element.
244
+ *
245
+ * @param {Function} fn - Callback function.
246
+ * @returns {this} This selection for chaining.
247
+ */
248
+ each(fn) {
249
+ for (let i = 0; i < this._groups.length; i++) {
250
+ fn.call(this._groups[i], this._datum, i, this._groups);
251
+ }
252
+ return this;
253
+ }
254
+ /**
255
+ * Removes all elements in the selection from the DOM.
256
+ *
257
+ * @returns {this} This selection for chaining.
258
+ */
259
+ remove() {
260
+ var _a;
261
+ for (const el of this._groups) {
262
+ (_a = el.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(el);
263
+ }
264
+ return this;
265
+ }
266
+ /**
267
+ * Clones each element in the selection (shallow clone) and inserts after the original.
268
+ *
269
+ * @template GElement
270
+ * @template Datum
271
+ * @template PElement
272
+ * @template PDatum
273
+ * @returns {D3SelectionPolyfill<GElement, Datum, PElement, PDatum>} A new selection wrapping the cloned elements.
274
+ */
275
+ clone() {
276
+ var _a;
277
+ const clones = [];
278
+ for (const el of this._groups) {
279
+ const cloned = el.cloneNode(false);
280
+ (_a = el.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(cloned, el.nextSibling);
281
+ clones.push(cloned);
282
+ }
283
+ return new D3SelectionPolyfill(clones, this._datum);
284
+ }
285
+ /**
286
+ * Creates a transition-like object. This is a simplified polyfill that
287
+ * applies attribute changes immediately (no actual animation), which is
288
+ * sufficient for Vega's usage of hover path swapping.
289
+ *
290
+ * @param {*} [_name] - Transition name (ignored in polyfill).
291
+ * @returns {this} This selection for chaining (acts as a no-op).
292
+ */
293
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
294
+ transition(_name) {
295
+ return this;
296
+ }
297
+ /**
298
+ * Sets the transition duration. No-op in this polyfill since
299
+ * transitions are applied immediately.
300
+ *
301
+ * @param {number} _ms - Duration in milliseconds (ignored).
302
+ * @returns {this} This selection for chaining.
303
+ */
304
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
305
+ duration(_ms) {
306
+ return this;
307
+ }
308
+ }
309
+ /**
310
+ * Selects a DOM element by wrapping it in a D3SelectionPolyfill.
311
+ * Mimics d3.select().
312
+ *
313
+ * @template GElement
314
+ * @param {Element | EventTarget} element - A DOM element or EventTarget to wrap.
315
+ * @returns {D3SelectionPolyfill<GElement>} A new D3SelectionPolyfill wrapping the element.
316
+ */
317
+ function select(element) {
318
+ return new D3SelectionPolyfill([element]);
319
+ }
320
+ /**
321
+ * Creates a detached SVG element (e.g., 'svg:text', 'svg:circle', 'svg:path').
322
+ * Mimics d3.create().
323
+ *
324
+ * @template GElement
325
+ * @param {string} qualifiedName - A qualified name like 'svg:text' or 'svg:circle'.
326
+ * @returns {D3SelectionPolyfill<GElement>} A new D3SelectionPolyfill wrapping the created element.
327
+ */
328
+ function create(qualifiedName) {
329
+ const parts = qualifiedName.split(':');
330
+ const tagName = parts.length > 1 ? parts[1] : parts[0];
331
+ // eslint-disable-next-line no-restricted-globals
332
+ const el = document.createElementNS('http://www.w3.org/2000/svg', tagName);
333
+ return new D3SelectionPolyfill([el]);
334
+ }
335
+
336
+ /* eslint-disable jsdoc/require-param-type, jsdoc/require-returns-type, jsdoc/require-param, jsdoc/require-returns */
337
+ /**
338
+ * D3 Shape Polyfill - Lightweight SVG shape generators.
339
+ *
340
+ * This is a drop-in replacement for d3-shape, implementing only the methods
341
+ * used in the Vega chart rendering system: line, arc, and pie.
342
+ *
343
+ * @see VD-5022 - [Zero Dependencies] remove d3 dependency
344
+ */
345
+ /**
346
+ * A line generator that creates SVG path data strings from data arrays.
347
+ * Mimics d3.line() with .x() and .y() value extractors.
348
+ */
349
+ class LineGenerator {
350
+ constructor() {
351
+ /** Default x value extractor: reads `.x` property or first array index. */
352
+ this.xAccessor = (d) => { var _a; return (_a = d.x) !== null && _a !== void 0 ? _a : d[0]; };
353
+ /** Default y value extractor: reads `.y` property or second array index. */
354
+ this.yAccessor = (d) => { var _a; return (_a = d.y) !== null && _a !== void 0 ? _a : d[1]; };
355
+ }
356
+ /**
357
+ * Sets the x accessor function.
358
+ *
359
+ * @param accessor - Function that returns the x value for a datum.
360
+ * @returns This generator for chaining.
361
+ */
362
+ x(accessor) {
363
+ this.xAccessor = accessor;
364
+ return this;
365
+ }
366
+ /**
367
+ * Sets the y accessor function.
368
+ *
369
+ * @param accessor - Function that returns the y value for a datum.
370
+ * @returns This generator for chaining.
371
+ */
372
+ y(accessor) {
373
+ this.yAccessor = accessor;
374
+ return this;
375
+ }
376
+ /**
377
+ * Generates an SVG path data string for the given data.
378
+ * Called as a function (used by d3's attr('d', lineGenerator)).
379
+ *
380
+ * @param data - Array of data points.
381
+ * @returns SVG path data string (M...L...L...).
382
+ */
383
+ generate(data) {
384
+ if (!data || data.length === 0) {
385
+ return '';
386
+ }
387
+ const parts = [];
388
+ for (let i = 0; i < data.length; i++) {
389
+ const xVal = this.xAccessor(data[i], i);
390
+ const yVal = this.yAccessor(data[i], i);
391
+ parts.push(i === 0 ? `M${xVal},${yVal}` : `L${xVal},${yVal}`);
392
+ }
393
+ return parts.join('');
394
+ }
395
+ }
396
+ /**
397
+ * Creates a line generator. Mimics d3.line<T>().
398
+ * The returned object is also callable as a function for d3 compatibility.
399
+ *
400
+ * @returns A new LineGenerator with callable function interface.
401
+ */
402
+ function line() {
403
+ const generator = new LineGenerator();
404
+ /* eslint-disable jsdoc/require-jsdoc */
405
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
406
+ const fn = (data) => generator.generate(data);
407
+ fn.x = (accessor) => {
408
+ generator.x(accessor);
409
+ return fn;
410
+ };
411
+ fn.y = (accessor) => {
412
+ generator.y(accessor);
413
+ return fn;
414
+ };
415
+ fn.generate = (data) => generator.generate(data);
416
+ /* eslint-enable jsdoc/require-jsdoc */
417
+ return fn;
418
+ }
419
+ // ─── Arc Generator ──────────────────────────────────────────────────
420
+ /**
421
+ * An arc generator that creates SVG path data strings for arc/pie slices.
422
+ * Mimics d3.arc<T>() with .innerRadius() and .outerRadius() value setters.
423
+ */
424
+ class ArcGenerator {
425
+ constructor() {
426
+ /** Inner radius value for the arc. */
427
+ this.innerRadiusValue = 0;
428
+ /** Outer radius value for the arc. */
429
+ this.outerRadiusValue = 0;
430
+ }
431
+ /**
432
+ * Sets the inner radius for the arc.
433
+ *
434
+ * @param radius - Inner radius value.
435
+ * @returns This generator for chaining.
436
+ */
437
+ innerRadius(radius) {
438
+ this.innerRadiusValue = radius;
439
+ return this;
440
+ }
441
+ /**
442
+ * Sets the outer radius for the arc.
443
+ *
444
+ * @param radius - Outer radius value.
445
+ * @returns This generator for chaining.
446
+ */
447
+ outerRadius(radius) {
448
+ this.outerRadiusValue = radius;
449
+ return this;
450
+ }
451
+ /**
452
+ * Generates an SVG path data string for an arc datum.
453
+ * The datum must have startAngle and endAngle properties (in angle units).
454
+ *
455
+ * @param d - Arc datum with startAngle and endAngle.
456
+ * @returns SVG path data string for the arc.
457
+ */
458
+ generate(d) {
459
+ const datum = d;
460
+ const startAngle = datum.startAngle - Math.PI / 2;
461
+ const endAngle = datum.endAngle - Math.PI / 2;
462
+ const innerR = this.innerRadiusValue;
463
+ const outerR = this.outerRadiusValue;
464
+ const angleDiff = endAngle - startAngle;
465
+ const largeArcFlag = Math.abs(angleDiff) >= Math.PI ? 1 : 0;
466
+ // Outer arc endpoints
467
+ const outerStartX = outerR * Math.cos(startAngle);
468
+ const outerStartY = outerR * Math.sin(startAngle);
469
+ const outerEndX = outerR * Math.cos(endAngle);
470
+ const outerEndY = outerR * Math.sin(endAngle);
471
+ if (innerR > 0) {
472
+ // Donut arc: outer arc clockwise + inner arc counter-clockwise
473
+ const innerEndX = innerR * Math.cos(endAngle);
474
+ const innerEndY = innerR * Math.sin(endAngle);
475
+ const innerStartX = innerR * Math.cos(startAngle);
476
+ const innerStartY = innerR * Math.sin(startAngle);
477
+ return [
478
+ `M${outerStartX},${outerStartY}`,
479
+ `A${outerR},${outerR},0,${largeArcFlag},1,${outerEndX},${outerEndY}`,
480
+ `L${innerEndX},${innerEndY}`,
481
+ `A${innerR},${innerR},0,${largeArcFlag},0,${innerStartX},${innerStartY}`,
482
+ 'Z',
483
+ ].join('');
484
+ }
485
+ else {
486
+ // Pie arc: start at outer edge, arc, line to center, close
487
+ return [
488
+ `M${outerStartX},${outerStartY}`,
489
+ `A${outerR},${outerR},0,${largeArcFlag},1,${outerEndX},${outerEndY}`,
490
+ 'L0,0',
491
+ 'Z',
492
+ ].join('');
493
+ }
494
+ }
495
+ }
496
+ /**
497
+ * Creates an arc generator. Mimics d3.arc<T>().
498
+ * The returned object is also callable as a function for d3 compatibility.
499
+ *
500
+ * @returns A new ArcGenerator with callable function interface.
501
+ */
502
+ function arc() {
503
+ const generator = new ArcGenerator();
504
+ /* eslint-disable jsdoc/require-jsdoc */
505
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
506
+ const fn = (d) => generator.generate(d);
507
+ fn.innerRadius = (radius) => {
508
+ generator.innerRadius(radius);
509
+ return fn;
510
+ };
511
+ fn.outerRadius = (radius) => {
512
+ generator.outerRadius(radius);
513
+ return fn;
514
+ };
515
+ fn.generate = (d) => generator.generate(d);
516
+ /* eslint-enable jsdoc/require-jsdoc */
517
+ return fn;
518
+ }
519
+ /**
520
+ * A pie layout generator that computes start/end angles for data items.
521
+ * Mimics d3.pie<T>() with .value() setter.
522
+ */
523
+ class PieGenerator {
524
+ constructor() {
525
+ /** Default value extractor: reads `.value` property or falls back to 0. */
526
+ this.valueAccessor = (d) => { var _a; return (_a = d.value) !== null && _a !== void 0 ? _a : 0; };
527
+ }
528
+ /**
529
+ * Sets the value accessor function.
530
+ *
531
+ * @param accessor - Function that returns the numeric value for each datum.
532
+ * @returns This generator for chaining.
533
+ */
534
+ value(accessor) {
535
+ this.valueAccessor = accessor;
536
+ return this;
537
+ }
538
+ /**
539
+ * Computes pie arc data from the input data array.
540
+ *
541
+ * @param data - Array of data items.
542
+ * @returns Array of PieArcDatum with computed angles.
543
+ */
544
+ generate(data) {
545
+ const values = data.map((d) => this.valueAccessor(d));
546
+ const total = values.reduce((sum, v) => sum + v, 0);
547
+ const n = data.length;
548
+ // Sort indices by descending value (d3.pie default sort)
549
+ const indices = Array.from({ length: n }, (_, i) => i);
550
+ indices.sort((a, b) => values[b] - values[a]);
551
+ // Assign angles in sorted order, place arcs at original indices
552
+ const arcs = new Array(n);
553
+ let currentAngle = 0;
554
+ for (const index of indices) {
555
+ const angle = total > 0 ? (values[index] / total) * 2 * Math.PI : 0;
556
+ arcs[index] = {
557
+ data: data[index],
558
+ index: index,
559
+ value: values[index],
560
+ startAngle: currentAngle,
561
+ endAngle: currentAngle + angle,
562
+ padAngle: 0,
563
+ };
564
+ currentAngle += angle;
565
+ }
566
+ return arcs;
567
+ }
568
+ }
569
+ /**
570
+ * Creates a pie layout generator. Mimics d3.pie<T>().
571
+ * The returned object is also callable as a function for d3 compatibility.
572
+ *
573
+ * @returns A new PieGenerator with callable function interface.
574
+ */
575
+ function pie() {
576
+ const generator = new PieGenerator();
577
+ /* eslint-disable jsdoc/require-jsdoc */
578
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
579
+ const fn = (data) => generator.generate(data);
580
+ fn.value = (accessor) => {
581
+ generator.value(accessor);
582
+ return fn;
583
+ };
584
+ fn.generate = (data) => generator.generate(data);
585
+ /* eslint-enable jsdoc/require-jsdoc */
586
+ return fn;
587
+ }
588
+
589
+ /**
590
+ * D3 Axis Polyfill - Lightweight SVG axis generators.
591
+ *
592
+ * This is a drop-in replacement for d3-axis, implementing only the methods
593
+ * used in the Vega chart rendering system: axisBottom and axisLeft.
594
+ *
595
+ * @see VD-5022 - [Zero Dependencies] remove d3 dependency
596
+ */
597
+ /**
598
+ * Internal axis generator class.
599
+ */
600
+ class AxisGenerator {
601
+ /**
602
+ * @param {AxisScale} scale - The scale to use for the axis.
603
+ * @param {string} orientation - 'bottom' for x-axis, 'left' for y-axis.
604
+ */
605
+ constructor(scale, orientation) {
606
+ this._tickCount = 10;
607
+ this._tickFormatter = null;
608
+ this._scale = scale;
609
+ this._orientation = orientation;
610
+ }
611
+ /**
612
+ * Sets the number of ticks.
613
+ *
614
+ * @param {number} count - Desired number of ticks.
615
+ */
616
+ setTickCount(count) {
617
+ this._tickCount = count;
618
+ }
619
+ /**
620
+ * Sets a custom tick format function.
621
+ *
622
+ * @param {Function} formatter - Function to format tick labels.
623
+ */
624
+ setTickFormatter(formatter) {
625
+ this._tickFormatter = formatter;
626
+ }
627
+ /**
628
+ * Renders the axis into the given SVG <g> selection.
629
+ * Creates a domain path, tick lines, and tick text labels.
630
+ *
631
+ * @param {D3SelectionPolyfill} selection - A D3SelectionPolyfill wrapping an SVG <g> element.
632
+ */
633
+ render(selection) {
634
+ const g = selection.node();
635
+ if (!g)
636
+ return;
637
+ const doc = g.ownerDocument;
638
+ const tickValues = this.getTickValues();
639
+ const formatter = this.getFormatter();
640
+ const offset = 0.5;
641
+ // Compute band centering offset (d3's center() function)
642
+ const bandOffset = typeof this._scale.bandwidth === 'function'
643
+ ? Math.max(0, this._scale.bandwidth() - offset * 2) / 2
644
+ : 0;
645
+ const range = this._scale.range();
646
+ const range0 = +range[0] + offset;
647
+ const range1 = +range[range.length - 1] + offset;
648
+ // Create domain path (with outer tick marks, matching d3's tickSizeOuter = 6)
649
+ const domain = doc.createElementNS('http://www.w3.org/2000/svg', 'path');
650
+ domain.setAttribute('class', 'domain');
651
+ domain.setAttribute('stroke', 'currentColor');
652
+ if (this._orientation === 'bottom') {
653
+ domain.setAttribute('d', `M${range0},6V${offset}H${range1}V6`);
654
+ }
655
+ else {
656
+ domain.setAttribute('d', `M-6,${range0}H${offset}V${range1}H-6`);
657
+ }
658
+ g.appendChild(domain);
659
+ // Create ticks
660
+ for (const tickValue of tickValues) {
661
+ const position = this._scale(tickValue);
662
+ if (position === undefined)
663
+ continue;
664
+ const finalPosition = position + bandOffset + offset;
665
+ const tickG = doc.createElementNS('http://www.w3.org/2000/svg', 'g');
666
+ tickG.setAttribute('class', 'tick');
667
+ tickG.setAttribute('opacity', '1');
668
+ const tickLine = doc.createElementNS('http://www.w3.org/2000/svg', 'line');
669
+ tickLine.setAttribute('stroke', 'currentColor');
670
+ const tickText = doc.createElementNS('http://www.w3.org/2000/svg', 'text');
671
+ tickText.setAttribute('fill', 'currentColor');
672
+ tickText.textContent = formatter(tickValue);
673
+ // eslint-disable-next-line spellcheck/spell-checker
674
+ const verticalOffset = this._orientation === 'bottom' ? '0.71em' : '0.32em';
675
+ if (this._orientation === 'bottom') {
676
+ tickG.setAttribute('transform', `translate(${finalPosition},0)`);
677
+ tickLine.setAttribute('y2', '6');
678
+ tickText.setAttribute('y', '9');
679
+ // eslint-disable-next-line spellcheck/spell-checker
680
+ tickText.setAttribute('dy', verticalOffset);
681
+ }
682
+ else {
683
+ tickG.setAttribute('transform', `translate(0,${finalPosition})`);
684
+ tickLine.setAttribute('x2', '-6');
685
+ tickText.setAttribute('x', '-9');
686
+ // eslint-disable-next-line spellcheck/spell-checker
687
+ tickText.setAttribute('dy', verticalOffset);
688
+ }
689
+ tickG.appendChild(tickLine);
690
+ tickG.appendChild(tickText);
691
+ g.appendChild(tickG);
692
+ }
693
+ // Set axis group attributes (matching d3)
694
+ g.setAttribute('fill', 'none');
695
+ g.setAttribute('font-size', '10');
696
+ g.setAttribute('font-family', 'sans-serif');
697
+ g.setAttribute('text-anchor', this._orientation === 'bottom' ? 'middle' : 'end');
698
+ }
699
+ /**
700
+ * Gets tick values from the scale.
701
+ *
702
+ * @template Domain
703
+ * @returns {Domain[]} Array of tick domain values.
704
+ */
705
+ getTickValues() {
706
+ if (this._scale.ticks) {
707
+ return this._scale.ticks(this._tickCount);
708
+ }
709
+ if (this._scale.domain) {
710
+ return this._scale.domain();
711
+ }
712
+ return [];
713
+ }
714
+ /**
715
+ * Gets the tick formatter function.
716
+ *
717
+ * @template Domain
718
+ * @returns {(d: Domain) => string} A function that converts tick values to strings.
719
+ */
720
+ getFormatter() {
721
+ if (this._tickFormatter) {
722
+ return this._tickFormatter;
723
+ }
724
+ if (this._scale.tickFormat) {
725
+ return this._scale.tickFormat(this._tickCount);
726
+ }
727
+ return (d) => String(d);
728
+ }
729
+ }
730
+ /**
731
+ * Creates a bottom-oriented axis generator. Mimics d3.axisBottom().
732
+ *
733
+ * @template Domain
734
+ * @param {AxisScale} scale - The scale to use.
735
+ * @returns {Axis<Domain>} An Axis callable that renders into a <g> element.
736
+ */
737
+ function axisBottom(scale) {
738
+ const generator = new AxisGenerator(scale, 'bottom');
739
+ /* eslint-disable jsdoc/require-jsdoc */
740
+ const axisFn = Object.assign(
741
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
742
+ (selection) => {
743
+ generator.render(selection);
744
+ }, {
745
+ ticks: (count) => {
746
+ generator.setTickCount(count);
747
+ return axisFn;
748
+ },
749
+ tickFormat: (formatter) => {
750
+ generator.setTickFormatter(formatter);
751
+ return axisFn;
752
+ },
753
+ });
754
+ /* eslint-enable jsdoc/require-jsdoc */
755
+ return axisFn;
756
+ }
757
+ /**
758
+ * Creates a left-oriented axis generator. Mimics d3.axisLeft().
759
+ *
760
+ * @template Domain
761
+ * @param {AxisScale} scale - The scale to use.
762
+ * @returns {Axis<Domain>} An Axis callable that renders into a <g> element.
763
+ */
764
+ function axisLeft(scale) {
765
+ const generator = new AxisGenerator(scale, 'left');
766
+ /* eslint-disable jsdoc/require-jsdoc */
767
+ const axisFn = Object.assign(
768
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
769
+ (selection) => {
770
+ generator.render(selection);
771
+ }, {
772
+ ticks: (count) => {
773
+ generator.setTickCount(count);
774
+ return axisFn;
775
+ },
776
+ tickFormat: (formatter) => {
777
+ generator.setTickFormatter(formatter);
778
+ return axisFn;
779
+ },
780
+ });
781
+ /* eslint-enable jsdoc/require-jsdoc */
782
+ return axisFn;
783
+ }
784
+
785
+ /** This class is used to render charts using SVG elements. */
786
+ class SVGRenderer extends BaseRenderer {
787
+ /**
788
+ * The function sets the layout of a chart using D3 and SVG.
789
+ *
790
+ * @param {number} width - chart width
791
+ * @param {number} height - chart height
792
+ * @param {number} top - chart margin top
793
+ * @param {number} left - chart margin left
794
+ */
795
+ setLayout(width, height, top, left) {
796
+ select(this.context)
797
+ .attr('width', width)
798
+ .attr('height', height)
799
+ .attr('viewBox', [0, 0, width, height])
800
+ .property('style', 'display:block;max-width:100%;height:auto;')
801
+ .call((g) => {
802
+ g.append('g')
803
+ .attr('class', 'vega-chart-draw-g')
804
+ .attr('transform', `translate(${left},${top})`);
805
+ })
806
+ .call((g) => {
807
+ g.append('g')
808
+ .attr('class', 'vega-chart-legend-g')
809
+ .attr('transform', `translate(${left / 3},${top / 4})`);
810
+ });
811
+ }
812
+ /**
813
+ * This function draws a line on a chart using D3.js library.
814
+ *
815
+ * @param {ChartPosition} from - The starting position of the line to be drawn on the chart. It is an
816
+ * object with two properties: x and y, representing the x and y coordinates of the starting point respectively.
817
+ * @param {ChartPosition} to - The "to" parameter is a ChartPosition object that represents the ending
818
+ * point of the line to be drawn. It contains the x and y coordinates of the point on the chart where the line should end.
819
+ * @param {string} color - The color of the line
820
+ */
821
+ drawLine(from, to, color) {
822
+ select(this.context)
823
+ .select('.vega-chart-draw-g')
824
+ .append('line')
825
+ .attr('x1', from.x)
826
+ .attr('y1', from.y)
827
+ .attr('x2', to.x)
828
+ .attr('y2', to.y)
829
+ .attr('stroke', color);
830
+ }
831
+ /**
832
+ * This function draws an x-axis on a chart using D3 and a given scale and end point.
833
+ *
834
+ * @param {ChartExtend<unknown>} extend - which is an object that contains information about the chart's scale and end position on the y-axis. The `scale` property
835
+ * is a D3 scale object that maps data values to pixel positions on the x-axis
836
+ * @param {string} color - The stroke color of axis
837
+ * @param {string} textStyle - The text style of the axis
838
+ */
839
+ drawXAxis(extend, color, textStyle) {
840
+ const { scale, end, labelFormatter, direction, height } = extend;
841
+ let axis = axisBottom(scale);
842
+ if (labelFormatter) {
843
+ axis = axis.tickFormat(labelFormatter);
844
+ }
845
+ select(this.context)
846
+ .select('.vega-chart-draw-g')
847
+ .append('g')
848
+ .attr('class', 'vega-chart-x-axis')
849
+ .attr('transform', `translate(0, ${end.y})`)
850
+ .call(axis)
851
+ .call((g) => {
852
+ g.select('.domain').attr('stroke-width', 2).attr('stroke', color);
853
+ })
854
+ .call((g) => {
855
+ g.selectAll('line').attr('stroke', color);
856
+ g.selectAll('text').property('style', textStyle);
857
+ })
858
+ .call((g) => {
859
+ if (direction === 'horizontal') {
860
+ g.selectAll('line').clone().attr('y2', `${-height}`);
861
+ g.select('.domain').attr('stroke-width', 0);
862
+ }
863
+ });
864
+ }
865
+ /**
866
+ * This function draws the Y-axis of a chart using D3 and a given scale.
867
+ *
868
+ * @param {ChartExtend<unknown>} extend - It likely contains additional information or settings related to the chart being drawn, but without more context it's
869
+ * difficult to say exactly what it contains.
870
+ * @param {string} color - The stroke color of the axis
871
+ * @param {string} textStyle - The text style of the axis
872
+ */
873
+ drawYAxis(extend, color, textStyle) {
874
+ const { scale, labelFormatter, width, tickSize, direction } = extend;
875
+ let axis = axisLeft(scale).ticks(tickSize);
876
+ if (labelFormatter) {
877
+ axis = axis.tickFormat(labelFormatter);
878
+ }
879
+ select(this.context)
880
+ .select('.vega-chart-draw-g')
881
+ .append('g')
882
+ .attr('class', 'vega-chart-y-axis')
883
+ .call(axis)
884
+ .call((g) => {
885
+ g.select('.domain').attr('stroke-width', 0).attr('stroke', color);
886
+ })
887
+ .call((g) => {
888
+ g.selectAll('line').attr('stroke-width', 2).attr('stroke', color);
889
+ g.selectAll('text').property('style', textStyle);
890
+ })
891
+ .call((g) => {
892
+ if (direction !== 'horizontal') {
893
+ g.selectAll('line').clone().attr('x2', `${width}`);
894
+ }
895
+ else {
896
+ g.select('.domain').attr('stroke-width', 2).attr('stroke', color);
897
+ }
898
+ });
899
+ }
900
+ /**
901
+ * This function draws a circle with a given center, radius, and color using D3.js.
902
+ *
903
+ * @param {ChartPosition} center - ChartPosition, which is an object containing the x and y coordinates of the center of the circle.
904
+ * @param {number} radius - The radius parameter is a number that specifies the radius of the circle to be drawn.
905
+ * @param {string} fillColor - The color parameter is a string that represents the color of the circle to be drawn
906
+ * @param {number} strokeWidth - the border width
907
+ * @param {string} strokeColor - the border color
908
+ */
909
+ drawCircle(center, radius, fillColor, strokeWidth, strokeColor) {
910
+ select(this.context)
911
+ .select('.vega-chart-draw-g')
912
+ .append(() => this.getCircleNode(center, radius, fillColor, strokeWidth, strokeColor));
913
+ }
914
+ /**
915
+ * This function draws text on a chart at a specified position using D3.js.
916
+ *
917
+ * @param {ChartPosition} position - ChartPosition is an object that contains the x and y coordinates where the text will be positioned on the chart.
918
+ * @param {string} text - The text parameter is a string that represents the text that will be
919
+ * displayed on the chart. It is the content that will be added to the text element created by this function.
920
+ * @param {string} textStyle - The text style of the axis
921
+ * @param {TextAnchorType} textAnchor - text anchor
922
+ * @param {number} rotate - rotate of the text
923
+ */
924
+ drawText(position, text, textStyle, textAnchor, rotate) {
925
+ select(this.context)
926
+ .select('.vega-chart-draw-g')
927
+ .append(() => this.getTextNode(position, text, textStyle, textAnchor, rotate));
928
+ }
929
+ /**
930
+ * This function draws a legend item with a colored circle and text at a specified position on a chart.
931
+ *
932
+ * @param {ChartPosition} position - The position parameter is an object that contains the x and y
933
+ * coordinates where the legend should be placed on the chart.
934
+ * @param {string} text - The text to be displayed in the legend.
935
+ * @param {string} color - Background color token type, which is a type of color
936
+ * used in the chart's background.
937
+ * @param {string} textStyle - The text style of the axis
938
+ * @returns {SVGGElement} svg g element
939
+ */
940
+ drawLegend(position, text, color, textStyle) {
941
+ return select(this.context)
942
+ .select('.vega-chart-legend-g')
943
+ .append('g')
944
+ .attr('class', 'vega-chart-legend-item')
945
+ .attr('data-legend', text)
946
+ .attr('transform', `translate(${position.x},${position.y})`)
947
+ .call((g) => {
948
+ g.append(() => this.getCircleNode({
949
+ x: -4,
950
+ y: -4,
951
+ }, 4, color));
952
+ g.append(() => this.getTextNode({ x: 8, y: 0 }, text, textStyle));
953
+ })
954
+ .node();
955
+ }
956
+ /**
957
+ * This function draws a rectangle with a specified position, width, height, and optional color using D3.js.
958
+ *
959
+ * @param {ChartPosition} position - The position parameter is an object that contains the x and y coordinates of the top-left corner of the rectangle.
960
+ * @param {number} width - The width of the rectangle to be drawn.
961
+ * @param {number} height - The height parameter is a number that represents the height of the rectangle to be drawn.
962
+ * @param {string} [color] - The color parameter is an optional string that represents the color of the rectangle to be drawn. If it is not provided, the rectangle will have no fill color.
963
+ */
964
+ drawRect(position, width, height, color) {
965
+ select(this.context)
966
+ .select('.vega-chart-draw-g')
967
+ .append('rect')
968
+ .attr('fill', color)
969
+ .attr('x', position.x)
970
+ .attr('y', position.y)
971
+ .attr('width', width)
972
+ .attr('height', height);
973
+ }
974
+ /**
975
+ * This function draws a path on a chart using D3 and SVG based on the provided positions and color.
976
+ *
977
+ * @param {ChartPosition[]} positions - An array of ChartPosition objects that represent the
978
+ * coordinates of the points on the path to be drawn. Each ChartPosition object contains an x and y
979
+ * value that represent the position of the point on the chart.
980
+ * @param {string} color - line color
981
+ * represents a color value. It is likely used to specify the color of the path that will be drawn on the chart.
982
+ */
983
+ drawLinePath(positions, color) {
984
+ select(this.context)
985
+ .select('.vega-chart-draw-g')
986
+ .append('path')
987
+ .attr('class', 'vega-chart-line-path')
988
+ .datum(positions)
989
+ .attr('fill', 'none')
990
+ .attr('stroke', color)
991
+ .attr('stroke-width', 3)
992
+ .attr('stroke-linecap', 'round')
993
+ .attr('stroke-linejoin', 'round')
994
+ .attr('d', line()
995
+ .x((position) => position.x)
996
+ .y((position) => position.y));
997
+ }
998
+ /**
999
+ * This function draws an arc path using D3 library and applies color and radius based on input parameters.
1000
+ *
1001
+ * @param {ChartPosition} center - the arc center position
1002
+ * @param {ArcPathItem} record - an object containing data for the arc path to be drawn
1003
+ * @param {string} color - The color parameter
1004
+ * and is used to set the fill color of the arc path.
1005
+ * @param {number} outerRadius - The outer radius parameter is a number that determines the outer
1006
+ * radius of the arc path being drawn.
1007
+ * @param {number} innerRadius - The inner radius of the arc path, specified as a number.
1008
+ * @returns {SVGPathElement} svg arc path element.
1009
+ */
1010
+ drawArcPath(center, record, color, outerRadius, innerRadius) {
1011
+ return select(this.context)
1012
+ .select('.vega-chart-draw-g')
1013
+ .append('path')
1014
+ .datum(record)
1015
+ .attr('class', 'vega-chart-arc-path')
1016
+ .attr('data-name', (item) => item.data.name)
1017
+ .attr('transform', `translate(${center.x},${center.y})`)
1018
+ .attr('fill', color)
1019
+ .attr('stroke-width', 0)
1020
+ .attr('d', arc().innerRadius(innerRadius).outerRadius(outerRadius))
1021
+ .attr('data-d', arc()
1022
+ .innerRadius(innerRadius)
1023
+ .outerRadius(outerRadius + 10))
1024
+ .node();
1025
+ }
1026
+ /**
1027
+ * This function clears all elements within two specific classes in a D3 selection.
1028
+ */
1029
+ clear() {
1030
+ select(this.context).selectAll('.vega-chart-draw-g').remove();
1031
+ select(this.context).selectAll('.vega-chart-legend-g').remove();
1032
+ }
1033
+ /**
1034
+ * This TypeScript function creates and returns an SVG text element with the given position and text.
1035
+ *
1036
+ * @param {ChartPosition} position - The position parameter is an object that contains the x and y
1037
+ * coordinates where the text element will be placed on the SVG canvas.
1038
+ * @param {string} text - The text parameter is a string that represents the text content that will be
1039
+ * displayed in the SVGTextElement.
1040
+ * @param {string} textStyle - The text style of the axis
1041
+ * @param {TextAnchorType} textAnchor - text anchor
1042
+ * @param {number} rotate - rotate of the text
1043
+ * @returns {SVGTextElement} an SVGTextElement node.
1044
+ */
1045
+ getTextNode(position, text, textStyle, textAnchor = 'start', rotate = 0) {
1046
+ const TextSelectionType = create('svg:text')
1047
+ .property('style', textStyle)
1048
+ .attr('x', position.x)
1049
+ .attr('y', position.y)
1050
+ .attr('text-anchor', textAnchor)
1051
+ .attr('rotate', rotate)
1052
+ .text(text);
1053
+ return TextSelectionType.node();
1054
+ }
1055
+ /**
1056
+ * This TypeScript function creates an SVG circle element with a specified center, radius, and color.
1057
+ *
1058
+ * @param {ChartPosition} center - The center position of the circle on the chart, specified as an
1059
+ * object with `x` and `y` properties.
1060
+ * @param {number} radius - The radius parameter is a number that represents the radius of the circle
1061
+ * to be created.
1062
+ * @param {string} fillColor - The color parameter
1063
+ * and is used to determine the fill color of the circle. It is likely an enum or string type that maps
1064
+ * to a specific color value.
1065
+ * @param {number} strokeWidth - the border width
1066
+ * @param {string} strokeColor - the border color
1067
+ * @returns {SVGCircleElement} an SVG circle element.
1068
+ */
1069
+ getCircleNode(center, radius, fillColor, strokeWidth, strokeColor) {
1070
+ const circleSelection = create('svg:circle')
1071
+ .attr('r', radius)
1072
+ .attr('cx', center.x)
1073
+ .attr('cy', center.y)
1074
+ .attr('fill', fillColor)
1075
+ .attr('stroke-width', strokeWidth || 0)
1076
+ .attr('stroke', strokeColor);
1077
+ return circleSelection.node();
1078
+ }
1079
+ }
1080
+
1081
+ /**
1082
+ * The CanvasRenderer class is a TypeScript class that extends the BaseRenderer class and provides
1083
+ * methods for drawing various shapes and elements on a canvas.
1084
+ */
1085
+ class CanvasRenderer extends BaseRenderer {
1086
+ /**
1087
+ * The function sets the layout of a chart.
1088
+ *
1089
+ * @param {number} width - chart width
1090
+ * @param {number} height - chart height
1091
+ */
1092
+ setLayout(width, height) {
1093
+ this.context.width = width;
1094
+ this.context.height = height;
1095
+ this.context.style.display = 'block';
1096
+ this.initCanvasContext2d();
1097
+ }
1098
+ /**
1099
+ * The function `drawLine` takes two `ChartPosition` parameters and draws a line between them.
1100
+ *
1101
+ * @param {ChartPosition} from - The starting position of the line on the chart. It is of type ChartPosition.
1102
+ * @param {ChartPosition} to - The "to" parameter in the "drawLine" function is a ChartPosition object
1103
+ * that represents the end point of the line to be drawn. It contains information about the x and y
1104
+ * coordinates of the point on the chart where the line should end.
1105
+ */
1106
+ drawLine(from, to) {
1107
+ const context2d = this.getContext2d();
1108
+ context2d.beginPath();
1109
+ context2d.moveTo(from.x, from.y);
1110
+ context2d.lineTo(to.x, to.y);
1111
+ context2d.closePath();
1112
+ }
1113
+ /**
1114
+ * This function draws the X-axis on a chart and takes in a parameter of type ChartExtend.
1115
+ *
1116
+ * @param {ChartExtend<unknown>} extend - The parameter "extend" is of type "ChartExtend" which is a generic type that can
1117
+ * take any data type as an argument. It is likely used to extend or modify the properties of the chart's X-axis
1118
+ */
1119
+ drawXAxis(extend) {
1120
+ this.drawLine(extend.start, extend.end);
1121
+ }
1122
+ /**
1123
+ * This function draws the Y-axis on a chart.
1124
+ *
1125
+ * @param {ChartExtend<unknown>} extend - The parameter "extend" is of type ChartExtend, which is a generic type that
1126
+ * represents the range of values for a chart axis. It contains information such as the minimum and
1127
+ * maximum values for the axis
1128
+ */
1129
+ drawYAxis(extend) {
1130
+ this.drawLine(extend.start, extend.end);
1131
+ }
1132
+ /**
1133
+ * The function `drawCircle` takes in a center position, radius, and color and draws a circle.
1134
+ *
1135
+ * @param {ChartPosition} center - The center of the circle, represented by a ChartPosition object
1136
+ * that contains the x and y coordinates of the center point.
1137
+ * @param {number} radius - The _radius parameter is a number that represents the radius of the
1138
+ * circle to be drawn. The radius is the distance from the center of the circle to any point on its circumference.
1139
+ * @param {string} fillColor - The _color,
1140
+ * which is a type that represents a color value that can be used as a background color for a chart element
1141
+ * @param {number} strokeWidth - the border width
1142
+ * @param {string} strokeColor - the border color
1143
+ */
1144
+ drawCircle(center, radius, fillColor, strokeWidth, strokeColor) {
1145
+ const context2d = this.getContext2d();
1146
+ if (strokeWidth && strokeColor) {
1147
+ context2d.fillStyle = strokeColor;
1148
+ context2d.beginPath();
1149
+ context2d.arc(center.x, center.y, radius, 0, Math.PI * 2);
1150
+ context2d.fill();
1151
+ }
1152
+ context2d.fillStyle = fillColor;
1153
+ context2d.beginPath();
1154
+ context2d.arc(center.x, center.y, radius - (strokeWidth || 0), 0, Math.PI * 2);
1155
+ context2d.fill();
1156
+ }
1157
+ /**
1158
+ * The function draws a legend on a chart with a circle and text at a specified position and color.
1159
+ *
1160
+ * @param {ChartPosition} position - ChartPosition is a type that represents the position of an
1161
+ * element on a chart. It could be an object with properties like x and y coordinates or a string that
1162
+ * represents a predefined position.
1163
+ * @param {string} text - The text parameter is a string that represents the label or name of the
1164
+ * legend that will be displayed on the chart.
1165
+ * @param {string} color - color string
1166
+ * represents a color for the legend. It could be a string or a number that corresponds to a specific
1167
+ * color value.
1168
+ * @returns {HTMLCanvasElement} chart canvas element
1169
+ */
1170
+ drawLegend(position, text, color) {
1171
+ this.drawCircle(position, 4, color);
1172
+ this.drawText(position, text);
1173
+ return this.context;
1174
+ }
1175
+ /**
1176
+ * The function `drawText` takes a position and a string of text as parameters and does not return anything.
1177
+ *
1178
+ * @param {ChartPosition} position - ChartPosition is a data type that represents the position of the
1179
+ * text on a chart. It could be an object with properties such as x and y coordinates, or it could be
1180
+ * a string that represents a pre-defined position on the chart (e.g. "top-left", "bottom-right",
1181
+ * etc.).
1182
+ * @param {string} text - The text parameter is a string that represents the text that needs to be drawn on the chart.
1183
+ */
1184
+ drawText(position, text) {
1185
+ this.getContext2d().fillText(text, position.x, position.y);
1186
+ }
1187
+ /**
1188
+ * The function `drawRect` takes in a position, width, height, and optional color parameter to draw a rectangle.
1189
+ *
1190
+ * @param {ChartPosition} position - The position parameter is of type ChartPosition and represents
1191
+ * the position of the rectangle on the chart. It could be an object with x and y properties
1192
+ * representing the coordinates of the top-left corner of the rectangle.
1193
+ * @param {number} width - The width parameter is a number that represents the width of the rectangle
1194
+ * to be drawn. It determines how wide the rectangle will be on the chart.
1195
+ * @param {number} height - The `height` parameter in the `drawRect` function specifies the height of
1196
+ * the rectangle to be drawn. It is a required parameter and must be a number value.
1197
+ * @param {string} [color] - The color parameter is an optional parameter that
1198
+ * specifies the background color of the rectangle. It is of type string, which is
1199
+ * a custom type that represents a color token
1200
+ */
1201
+ drawRect(position, width, height, color) {
1202
+ const context2d = this.getContext2d();
1203
+ context2d.fillStyle = color;
1204
+ context2d.fillRect(position.x, position.y, width, height);
1205
+ }
1206
+ /**
1207
+ * The function `drawLinePath` takes in an array of `ChartPosition` objects and a `string` color and draws a path.
1208
+ *
1209
+ * @param {ChartPosition[]} positions - An array of ChartPosition objects that represent the
1210
+ * coordinates of points on a chart. Each ChartPosition object has an x and y property that represent
1211
+ * the horizontal and vertical position of the point on the chart.
1212
+ * @param {string} color - The `color` parameter is of type
1213
+ * `string` and represents the color of the path to be drawn. This parameter is
1214
+ * used to set the background color of the chart.
1215
+ */
1216
+ drawLinePath(positions, color) {
1217
+ const pathNode = create('svg:path')
1218
+ .datum(positions)
1219
+ .attr('d', line()
1220
+ .x((position) => position.x)
1221
+ .y((position) => position.y))
1222
+ .node();
1223
+ const path = new Path2D(pathNode.getAttribute('d'));
1224
+ const context2d = this.getContext2d();
1225
+ context2d.lineWidth = 3;
1226
+ context2d.strokeStyle = color;
1227
+ context2d.stroke(path);
1228
+ }
1229
+ /**
1230
+ * This function draws an arc path using D3 library and applies color and radius based on input parameters.
1231
+ *
1232
+ * @param {ChartPosition} center - arc center position
1233
+ * @param {ArcPathItem} record - an object containing data for the arc path to be drawn
1234
+ * @param {string} color - The color parameter
1235
+ * and is used to set the fill color of the arc path.
1236
+ * @param {number} outerRadius - The outer radius parameter is a number that determines the outer
1237
+ * radius of the arc path being drawn.
1238
+ * @param {number} innerRadius - The inner radius of the arc path, specified as a number.
1239
+ * @returns {HTMLCanvasElement} chart canvas element.
1240
+ */
1241
+ drawArcPath(center, record, color, outerRadius, innerRadius) {
1242
+ const context2d = this.getContext2d();
1243
+ context2d.beginPath();
1244
+ context2d.moveTo(center.x, center.y);
1245
+ context2d.arc(center.x, center.y, outerRadius, record.startAngle, record.endAngle);
1246
+ context2d.fillStyle = color;
1247
+ context2d.fill();
1248
+ if (innerRadius) {
1249
+ this.drawCircle(center, innerRadius, '#F0F3F7');
1250
+ }
1251
+ return this.context;
1252
+ }
1253
+ /**
1254
+ * The function "clear"
1255
+ */
1256
+ clear() {
1257
+ this.getContext2d().clearRect(0, 0, this.context.width, this.context.height);
1258
+ }
1259
+ /**
1260
+ * This function initializes a 2D canvas context.
1261
+ */
1262
+ initCanvasContext2d() {
1263
+ this.canvasContext2d = this.context.getContext('2d');
1264
+ }
1265
+ /**
1266
+ * This function returns the canvas 2D rendering context and initializes it if it doesn't exist.
1267
+ *
1268
+ * @returns {CanvasRenderingContext2D} The function `getContext2d()` returns the `CanvasRenderingContext2D` object.
1269
+ */
1270
+ getContext2d() {
1271
+ if (!this.canvasContext2d) {
1272
+ this.initCanvasContext2d();
1273
+ }
1274
+ return this.canvasContext2d;
1275
+ }
1276
+ }
1277
+
1278
+ /** The RendererFactory class provides a static method to create a renderer based on the type of context provided. */
1279
+ class RendererFactory {
1280
+ /**
1281
+ * This function returns a renderer based on the type of context provided (SVG or Canvas).
1282
+ *
1283
+ * @param {SVGElement | HTMLCanvasElement} context - The `context` parameter is either an
1284
+ * SVGElement or a HTMLCanvasElement. It is used to determine which renderer to instantiate and
1285
+ * return
1286
+ * @returns {BaseRenderer<SVGElement | HTMLCanvasElement> } based on the type of the `context` parameter. If
1287
+ * the `context` is an instance of `SVGElement`, an `SVGRenderer` object is returned
1288
+ */
1289
+ static get(context) {
1290
+ if (context instanceof SVGElement) {
1291
+ return new SVGRenderer(context);
1292
+ }
1293
+ else if (context instanceof HTMLCanvasElement) {
1294
+ return new CanvasRenderer(context);
1295
+ }
1296
+ else {
1297
+ throw new Error('Invalid context');
1298
+ }
1299
+ }
1300
+ }
1301
+
1302
+ const DEFAULT_LAYOUT = {
1303
+ width: undefined,
1304
+ height: undefined,
1305
+ margin: {
1306
+ top: 30,
1307
+ right: 30,
1308
+ bottom: 30,
1309
+ left: 30,
1310
+ },
1311
+ };
1312
+ const DEFAULT_MARGIN_TOP_WITH_LEGENDS = 60;
1313
+ const DEFAULT_MARGIN_LEFT_WITH_AXIS = 60;
1314
+ /** The ChartDimensionController class contains methods for setting and retrieving the width and height of a chart container element. */
1315
+ class ChartDimensionController {
1316
+ /**
1317
+ * This is a constructor function that takes an HTMLElement as a parameter and assigns it to a private property called "container".
1318
+ *
1319
+ * @param {HTMLElement} container - The "container" parameter is a reference to an HTML element that
1320
+ * will be used as a container for the component or module being constructed. This parameter is
1321
+ * typically passed in during the instantiation of the component or module and is used to specify
1322
+ * where the component or module should be rendered in the DOM.
1323
+ */
1324
+ constructor(container) {
1325
+ this.container = container;
1326
+ }
1327
+ /**
1328
+ * This function sets the width and height of a container element based on a given layout object. if the layout is null, then will not update,
1329
+ * prevent the original style is changed
1330
+ *
1331
+ * @param {ChartLayout} layout - ChartLayout object that contains the width and height values for the chart container.
1332
+ */
1333
+ setContainerWidthAndHeight(layout) {
1334
+ const { width, height } = layout;
1335
+ if (width !== undefined) {
1336
+ this.container.style.width = parseNumberToPixelString(width);
1337
+ }
1338
+ if (height !== undefined) {
1339
+ this.container.style.height = parseNumberToPixelString(height);
1340
+ }
1341
+ }
1342
+ /**
1343
+ * This function returns the client width of a container or parses the width from a layout object.
1344
+ *
1345
+ * @param {ChartLayout} layout - In this function, the layout parameter is used to determine the width of the chart container. If the container's
1346
+ * clientWidth property is not available,
1347
+ * @returns {number} returning a number. The number is either the client width of the container element or the parsed width value from the `ChartLayout` object.
1348
+ */
1349
+ getContainerClientWidth(layout) {
1350
+ return (this.container.clientWidth ||
1351
+ parsePixelStringToNumber((layout === null || layout === void 0 ? void 0 : layout.width) || this.container.style.width));
1352
+ }
1353
+ /**
1354
+ * This function returns the height of a container element in pixels, either by accessing its clientHeight property or by parsing a string value from the layout object.
1355
+ *
1356
+ * @param {ChartLayout} layout - the layout parameter is used to determine the height of the chart container if it is not already set.
1357
+ * @returns {number} The function `getContainerClientHeight` returns a number which represents the height of
1358
+ * the container client or the parsed height value from the `ChartLayout` object.
1359
+ */
1360
+ getContainerClientHeight(layout) {
1361
+ return (this.container.clientHeight ||
1362
+ parsePixelStringToNumber((layout === null || layout === void 0 ? void 0 : layout.height) || this.container.style.height));
1363
+ }
1364
+ /**
1365
+ * This function calculates the inner width of a chart container by subtracting the left and right margins from the client width.
1366
+ *
1367
+ * @param {ChartLayout} layout - ChartLayout object that contains information about the chart layout,
1368
+ * including the container width and margin.
1369
+ * @returns {number} the inner width of a container element, which is calculated by subtracting the left and
1370
+ * right margins from the client width of the container.
1371
+ */
1372
+ getContainerInnerWidth(layout) {
1373
+ const width = this.getContainerClientWidth(layout);
1374
+ const { left, right } = ((layout === null || layout === void 0 ? void 0 : layout.margin) || DEFAULT_LAYOUT.margin);
1375
+ return width ? width - right - left : 0;
1376
+ }
1377
+ /**
1378
+ * This function calculates the inner height of a chart container by subtracting the top and bottom margins from the client height.
1379
+ *
1380
+ * @param {ChartLayout} layout - The `layout` parameter is an object of type `ChartLayout` which
1381
+ * contains information about the layout of a chart, including its dimensions and margins.
1382
+ * @returns {number} the inner height of a container element, which is calculated by subtracting the top and
1383
+ * bottom margins from the client height of the container. The returned value is a number.
1384
+ */
1385
+ getContainerInnerHeight(layout) {
1386
+ const height = this.getContainerClientHeight(layout);
1387
+ const { top, bottom } = ((layout === null || layout === void 0 ? void 0 : layout.margin) || DEFAULT_LAYOUT.margin);
1388
+ return height ? height - top - bottom : 0;
1389
+ }
1390
+ /**
1391
+ * This function merges a given chart layout with default values and returns the updated layout.
1392
+ *
1393
+ * @param {string} chartName - A string representing the name of the chart.
1394
+ * @param {ChartLayout} layout - The `layout` parameter is an optional object that contains properties
1395
+ * for the width, height, and margin of a chart. If provided, it will be merged with the default
1396
+ * layout settings to create a new layout object. If not provided, the default layout settings will be
1397
+ * used.
1398
+ * @param {boolean} hasLegends - A boolean value indicating whether the chart has legends or not.
1399
+ * @returns {ChartLayout} a ChartLayout object.
1400
+ */
1401
+ mergeLayout(chartName, layout, hasLegends) {
1402
+ const defaultTop = hasLegends ? DEFAULT_MARGIN_TOP_WITH_LEGENDS : DEFAULT_LAYOUT.margin.top;
1403
+ const defaultLeft = chartName === 'VEGA-LINE-CHART' || chartName === 'VEGA-BAR-CHART'
1404
+ ? DEFAULT_MARGIN_LEFT_WITH_AXIS
1405
+ : DEFAULT_LAYOUT.margin.left;
1406
+ const newLayout = {
1407
+ width: layout && layout.width ? layout.width : DEFAULT_LAYOUT.width,
1408
+ height: layout && layout.height ? layout.height : DEFAULT_LAYOUT.height,
1409
+ margin: Object.assign({}, DEFAULT_LAYOUT.margin, { top: defaultTop, left: defaultLeft }, layout && layout.margin ? layout.margin : {}),
1410
+ };
1411
+ return newLayout;
1412
+ }
1413
+ }
1414
+
1415
+ /**
1416
+ * This is a TypeScript code that defines an abstract class `BaseInteractor` with a generic type `T` that extends either `SVGElement` or `HTMLCanvasElement`.
1417
+ */
1418
+ class BaseInteractor {
1419
+ /**
1420
+ * This is a constructor function that takes a parameter of type T and sets it as a protected property called "context".
1421
+ *
1422
+ * @param {SVGElement | HTMLCanvasElement} context - The "context" parameter is a protected property of a class constructor that is
1423
+ * of type "T". It is used to store a reference to an object or data that is required by the class
1424
+ * methods to perform their tasks. The "protected" keyword means that the property can only be
1425
+ * accessed within the class
1426
+ */
1427
+ constructor(context) {
1428
+ this.context = context;
1429
+ this.interactingEntryForEventRegistry = new Map();
1430
+ this.interactingEntryForDrawerRegistry = new WeakMap();
1431
+ }
1432
+ /**
1433
+ * This function registers an interacting entry with a drawer, draw piece, and event type in an interactor registry.
1434
+ *
1435
+ * @param {BaseDrawer<unknown>} drawer - The drawer parameter is an instance of a class that extends the BaseDrawer class,
1436
+ * which is used for drawing on a canvas or other graphical surface.
1437
+ * @param {DrawPiece} drawPiece - DrawPiece is a type that represents a specific piece that can be
1438
+ * drawn on a canvas or other graphical surface. It could include information such as the shape,
1439
+ * color, size, and position of the piece.
1440
+ * @param {InteractingEntry} interactingEntry - InteractingEntry is a data structure that represents
1441
+ * an interaction between a user and a graphical element on the screen. It contains information such
1442
+ * as the type of event that triggered the interaction (e.g. mouse click, touch)
1443
+ */
1444
+ register(drawer, drawPiece, interactingEntry) {
1445
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
1446
+ const eventType = interactingEntry.eventType;
1447
+ if (!this.interactingEntryForEventRegistry.get(eventType)) {
1448
+ this.interactingEntryForEventRegistry.set(eventType, []);
1449
+ }
1450
+ this.interactingEntryForEventRegistry.get(eventType).push(interactingEntry);
1451
+ if (!this.interactingEntryForDrawerRegistry.get(drawer)) {
1452
+ this.interactingEntryForDrawerRegistry.set(drawer, new WeakMap());
1453
+ }
1454
+ if (!this.interactingEntryForDrawerRegistry.get(drawer).get(drawPiece)) {
1455
+ this.interactingEntryForDrawerRegistry.get(drawer).set(drawPiece, []);
1456
+ }
1457
+ this.interactingEntryForDrawerRegistry.get(drawer).get(drawPiece).push(interactingEntry);
1458
+ /* eslint-enable @typescript-eslint/no-non-null-assertion */
1459
+ }
1460
+ /**
1461
+ * This function unregisters a drawer from the interactor registry.
1462
+ *
1463
+ * @param {BaseDrawer<unknown>} drawer - The parameter `drawer` is of type `BaseDrawer<unknown>`. It is an object that
1464
+ * represents a drawer and is used to unregister the drawer from the `interactorRegistry`. The
1465
+ * `interactorRegistry` is a `WeakMap` that stores a mapping between an `Interactor` and
1466
+ */
1467
+ unregisterByDrawer(drawer) {
1468
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
1469
+ const drawPiece = drawer.drawPiece;
1470
+ if (drawPiece &&
1471
+ this.interactingEntryForDrawerRegistry.has(drawer) &&
1472
+ this.interactingEntryForDrawerRegistry.get(drawer) &&
1473
+ this.interactingEntryForDrawerRegistry.get(drawer).has(drawPiece) &&
1474
+ this.interactingEntryForDrawerRegistry.get(drawer).get(drawPiece)) {
1475
+ this.interactingEntryForEventRegistry.forEach((value, key) => {
1476
+ this.interactingEntryForEventRegistry.set(key, value.filter((interactingEntry) => {
1477
+ return (this.interactingEntryForDrawerRegistry
1478
+ .get(drawer)
1479
+ .get(drawPiece)
1480
+ .indexOf(interactingEntry) < 0);
1481
+ }));
1482
+ });
1483
+ /* eslint-enable @typescript-eslint/no-non-null-assertion */
1484
+ }
1485
+ this.interactingEntryForDrawerRegistry.delete(drawer);
1486
+ }
1487
+ /**
1488
+ * This function handles mouse events for registered interactor and drawers.
1489
+ *
1490
+ * @param {EventType} eventType - The type of event being registered in the registry, such as "click" or "mousemove".
1491
+ * @param {MouseEvent} event - The `event` parameter is of type `MouseEvent`, which represents a
1492
+ * mouse-related event (such as a click, double-click, or mouse movement) that occurred on the web
1493
+ * page. It contains information about the event, such as the type of event, the target element that
1494
+ * triggered the event
1495
+ */
1496
+ callRegistry(eventType, event) {
1497
+ const interactingEntryArray = this.interactingEntryForEventRegistry.get(eventType);
1498
+ if (interactingEntryArray) {
1499
+ interactingEntryArray.forEach((interactingEntry) => {
1500
+ if (interactingEntry.shouldHandle(event)) {
1501
+ interactingEntry.handle(event);
1502
+ }
1503
+ });
1504
+ }
1505
+ }
1506
+ }
1507
+
1508
+ /**
1509
+ * The CanvasInteractor class extends the BaseInteractor class and provides empty methods for handling mouse move, click, and hover events on a HTML canvas element.
1510
+ */
1511
+ class CanvasInteractor extends BaseInteractor {
1512
+ }
1513
+
1514
+ /**
1515
+ * The SVGInteractor class extends the BaseInteractor class and provides methods for handling mouse events on SVG elements.
1516
+ */
1517
+ class SVGInteractor extends BaseInteractor {
1518
+ /**
1519
+ * This is a constructor function that adds event listeners for click and mouseover events to an SVG element.
1520
+ *
1521
+ * @param {SVGElement} context - The context parameter is an SVGElement, which is the element that the
1522
+ * constructor is being called on. It is used to add event listeners to the element for mouseover and
1523
+ * click events.
1524
+ */
1525
+ constructor(context) {
1526
+ super(context);
1527
+ this.addContextListener();
1528
+ }
1529
+ /**
1530
+ * This function adds event listeners for click and mouseover events to the context element and calls
1531
+ * a registry function with the corresponding event type and event object.
1532
+ */
1533
+ addContextListener() {
1534
+ this.context.addEventListener('click', (event) => {
1535
+ this.callRegistry('click', event);
1536
+ });
1537
+ this.context.addEventListener('mouseover', (event) => {
1538
+ this.callRegistry('mouseover', event);
1539
+ });
1540
+ }
1541
+ }
1542
+
1543
+ /** The InteractorFactory class provides a static method to create and return an appropriate interactor based on the type of context provided. */
1544
+ class InteractorFactory {
1545
+ /**
1546
+ * This function returns a BaseInteractor object based on the type of context passed in (SVGElement or HTMLCanvasElement).
1547
+ *
1548
+ * @param {SVGElement | HTMLCanvasElement} context - The `context` parameter is either an SVGElement
1549
+ * or an HTMLCanvasElement. It is used to determine which type of interactor to create and return. If
1550
+ * the context is an SVGElement, an instance of SVGInteractor is returned. If the context is an
1551
+ * HTMLCanvasElement, an instance of
1552
+ * @returns {BaseInteractor<SVGElement | HTMLCanvasElement>} A `BaseInteractor` object that is either an instance of `SVGInteractor` or
1553
+ * `CanvasInteractor`, depending on the type of the `context` parameter passed to the `get` method.
1554
+ */
1555
+ static get(context) {
1556
+ if (context instanceof SVGElement) {
1557
+ return new SVGInteractor(context);
1558
+ }
1559
+ else if (context instanceof HTMLCanvasElement) {
1560
+ return new CanvasInteractor(context);
1561
+ }
1562
+ else {
1563
+ throw new Error('Invalid context');
1564
+ }
1565
+ }
1566
+ }
1567
+
1568
+ /** This is a TypeScript class called `BaseChart` that serves as a base class for creating charts */
1569
+ class BaseChart {
1570
+ /**
1571
+ * This is a constructor function that initializes a chart with options and creates a chain of drawers for rendering.
1572
+ *
1573
+ * @param {ChartOptions<unknown>} options - generic type that represents the configuration options for the chart
1574
+ */
1575
+ constructor(options) {
1576
+ this.options = options;
1577
+ this.isLayoutSet = false;
1578
+ this.drawers = [];
1579
+ const context = GraphContextFactory.get(options.mode, options.container.shadowRoot ? options.container.shadowRoot : options.container);
1580
+ this.dimensionController = new ChartDimensionController(options.container);
1581
+ this.renderer = RendererFactory.get(context);
1582
+ this.interactor = InteractorFactory.get(context);
1583
+ this.initLayoutOptions(options);
1584
+ }
1585
+ /**
1586
+ * The function clears the renderer.
1587
+ */
1588
+ clear() {
1589
+ this.renderer.clear();
1590
+ }
1591
+ /**
1592
+ * This function updates the chart options, creates a new drawer chain, resets the layout, and renders the chart.
1593
+ *
1594
+ * @param {ChartOptions<unknown>} options - ChartOptions<T> is a generic type that represents the configuration options for a
1595
+ * chart. It can include properties such as the chart type, data, labels, colors, and other stylingoptions
1596
+ */
1597
+ updateOptions(options) {
1598
+ this.initLayoutOptions(options);
1599
+ this.isLayoutSet = false;
1600
+ this.render();
1601
+ }
1602
+ /**
1603
+ * re render the chart using existing options
1604
+ */
1605
+ reRender() {
1606
+ this.updateOptions(this.options);
1607
+ }
1608
+ /**
1609
+ * sets the layout if it hasn't been set yet, and executes all the drawers. unregister the interactor by drawer
1610
+ */
1611
+ render() {
1612
+ this.unregisterByDrawer();
1613
+ this.drawers = this.createDrawerChain(this.renderer, this.interactor);
1614
+ this.clear();
1615
+ if (!this.isLayoutSet) {
1616
+ this.setLayout();
1617
+ this.isLayoutSet = true;
1618
+ }
1619
+ this.drawers.forEach((drawer) => drawer.execute());
1620
+ }
1621
+ /**
1622
+ * sets the layout of a renderer using the options provided.
1623
+ */
1624
+ setLayout() {
1625
+ const layout = this.options.layout;
1626
+ const width = this.dimensionController.getContainerClientWidth(layout), height = this.dimensionController.getContainerClientHeight(layout), margin = (layout === null || layout === void 0 ? void 0 : layout.margin) || DEFAULT_LAYOUT.margin;
1627
+ this.renderer.setLayout(width, height, margin.top, margin.left);
1628
+ }
1629
+ /**
1630
+ * This function initializes layout options for a chart.
1631
+ *
1632
+ * @param {ChartOptions} options - ChartOptions<T> is a generic type that represents the configuration options for a
1633
+ * chart. It includes properties such as data, layout, and style.
1634
+ */
1635
+ initLayoutOptions(options) {
1636
+ const newLayout = this.dimensionController.mergeLayout(options.container.tagName, options.layout, options.legends && options.legends.length ? true : false);
1637
+ this.options = Object.assign(options, { layout: newLayout });
1638
+ this.dimensionController.setContainerWidthAndHeight(newLayout);
1639
+ this.options.container.style.display = 'block';
1640
+ }
1641
+ /**
1642
+ * This function un-registers drawers from the interactor.
1643
+ */
1644
+ unregisterByDrawer() {
1645
+ if (this.drawers) {
1646
+ this.drawers.forEach((drawer) => {
1647
+ this.interactor.unregisterByDrawer(drawer);
1648
+ });
1649
+ }
1650
+ }
1651
+ }
1652
+
1653
+ /* This file is generated by vega-design 2.0.77 */
1654
+ /* eslint-disable */
1655
+ /* tslint:disable */
1656
+ // prettier-ignore
1657
+ const BackgroundColorsMappingLight = {
1658
+ "bg-brand": "#33393D",
1659
+ "bg-page": "#F0F3F7",
1660
+ "bg-primary": "#FCFCFC",
1661
+ "bg-secondary": "#F5F7F7",
1662
+ "bg-tertiary": "#F0F3F7",
1663
+ "bg-quaternary": "#F1F8FB",
1664
+ "bg-inverted-primary": "#04041C",
1665
+ "bg-inverted-secondary": "#121227",
1666
+ "bg-inverted-tertiary": "#181830",
1667
+ "bg-inverted-quaternary": "#464765",
1668
+ "bg-action": "#1362E2",
1669
+ "bg-action-hover": "#0470EC",
1670
+ "bg-action-focus": "#1362E2",
1671
+ "bg-action-active": "#1D41C3",
1672
+ "bg-action-quaternary": "#DEE1E3",
1673
+ "bg-action-quaternary-hover": "#EFEFEF",
1674
+ "bg-action-quaternary-active": "#CDD1D3",
1675
+ "bg-action-secondary": "#FCFCFC",
1676
+ "bg-action-secondary-hover": "#0470EC",
1677
+ "bg-action-secondary-active": "#1D41C3",
1678
+ "bg-action-tertiary": "#000000",
1679
+ "bg-action-tertiary-hover": "#04041C",
1680
+ "bg-action-tertiary-active": "#04041C",
1681
+ "bg-app-header": "#F0F3F7",
1682
+ "bg-backdrop-modal": "#121227",
1683
+ "bg-backdrop-popover": "#203645",
1684
+ "bg-backdrop-sidebar": "#121227",
1685
+ "bg-chip": "#203645",
1686
+ "bg-chip-hover": "#203645",
1687
+ "bg-chip-active": "#203645",
1688
+ "bg-danger": "#BD2947",
1689
+ "bg-danger-hover": "#E94768",
1690
+ "bg-danger-focus": "#BD2947",
1691
+ "bg-danger-active": "#E63257",
1692
+ "bg-danger-tertiary": "#000000",
1693
+ "bg-danger-tertiary-hover": "#FF5772",
1694
+ "bg-danger-tertiary-active": "#BD2947",
1695
+ "bg-disabled": "#B0B4B5",
1696
+ "bg-divider": "#ABC6D8",
1697
+ "bg-divider-secondary": "#C7D9E5",
1698
+ "bg-keypad-btn-active": "#E5EFFF",
1699
+ "bg-loading-progress": "#99C0FF",
1700
+ "bg-loading-track": "#E5EFFF",
1701
+ "bg-segment-hover": "#CDD1D3",
1702
+ "bg-segment-control": "#596063",
1703
+ "bg-selected": "#0097FF",
1704
+ "bg-sidebar": "#121227",
1705
+ "bg-sidebar-icon": "#BCBAD5",
1706
+ "bg-sidebar-icon-hover": "#121227",
1707
+ "bg-sidebar-icon-selected": "#FCFCFC",
1708
+ "bg-sidebar-item-hover": "#FCFCFC",
1709
+ "bg-sidebar-item-selected": "#1362E2",
1710
+ "bg-site-footer": "#33393D",
1711
+ "bg-site-footer-action": "#ABC6D8",
1712
+ "bg-site-footer-action-hover": "#C7D9E5",
1713
+ "bg-site-footer-action-active": "#8FB3CB",
1714
+ "bg-site-footer-field": "#596063",
1715
+ "bg-slider-handle": "#FCFCFC",
1716
+ "bg-status-error": "#FF6E8B",
1717
+ "bg-status-info": "#CDD1D3",
1718
+ "bg-status-success": "#A0E9A7",
1719
+ "bg-status-warning": "#FFDC83",
1720
+ "bg-tab": "#F0F3F7",
1721
+ "bg-tab-hover": "#F5F7F7",
1722
+ "bg-tab-selected": "#203645",
1723
+ "bg-table-alt-row": "#F5F7F7",
1724
+ "bg-table-header": "#F0F3F7",
1725
+ "bg-table-row-hover": "#F1F8FB",
1726
+ "bg-table-row-selected-expanded": "#E5EFFF",
1727
+ "bg-table-selected-row": "#CCDFFF",
1728
+ "bg-textarea-count": "#04041C",
1729
+ "bg-tile": "#FCFCFC",
1730
+ "bg-tile-hover": "#F5F7F7",
1731
+ "bg-tile-selected": "#F2F7FF",
1732
+ "bg-tile-selected-hover": "#E5EFFF",
1733
+ "bg-toggle-switch": "#6B747D",
1734
+ "bg-toggle-switch-hover": "#6B747D",
1735
+ "bg-toggle-switch-selected-disabled": "#99C0FF",
1736
+ "bg-transparent": "#000000",
1737
+ "bg-accent1-primary": "#73E6DC",
1738
+ "bg-accent1-secondary": "#C1F4EF",
1739
+ "bg-accent1-tertiary": "#E0F9F7",
1740
+ "bg-accent2-primary": "#806BFF",
1741
+ "bg-accent2-secondary": "#C7BDFF",
1742
+ "bg-accent2-tertiary": "#E3DEFF",
1743
+ "bg-accent3-primary": "#FFDC83",
1744
+ "bg-accent3-secondary": "#FFEFC8",
1745
+ "bg-accent3-tertiary": "#FFF7E3",
1746
+ "bg-accent4-primary": "#FF9571",
1747
+ "bg-accent4-secondary": "#FFD0C0",
1748
+ "bg-accent4-tertiary": "#FFE7DF",
1749
+ "bg-accent5-primary": "#00BBFF",
1750
+ "bg-accent5-secondary": "#8EDFF9",
1751
+ "bg-accent5-tertiary": "#E3F7FD",
1752
+ "bg-accent6-primary": "#FF82C9",
1753
+ "bg-accent6-secondary": "#FFC7E7",
1754
+ "bg-accent6-tertiary": "#FFE3F3",
1755
+ "bg-accent7-primary": "#259F9F",
1756
+ "bg-accent7-secondary": "#9BD4D6",
1757
+ "bg-accent7-tertiary": "#D0EFEF",
1758
+ "bg-accent8-primary": "#563D82",
1759
+ "bg-accent8-secondary": "#C7A2CC",
1760
+ "bg-accent8-tertiary": "#E6D6EA",
1761
+ "bg-accent9-primary": "#FFBF3F",
1762
+ "bg-accent9-secondary": "#FED78E",
1763
+ "bg-accent9-tertiary": "#FBE2B9",
1764
+ "bg-accent10-primary": "#ED7A23",
1765
+ "bg-accent10-secondary": "#F19255",
1766
+ "bg-accent10-tertiary": "#F5BB94",
1767
+ "bg-date-picker-range": "#E5EFFF"
1768
+ };
1769
+
1770
+ const CHART_DEFAULT_COLORS = [
1771
+ 'bg-accent1-primary',
1772
+ 'bg-accent2-primary',
1773
+ 'bg-accent3-primary',
1774
+ 'bg-accent4-primary',
1775
+ 'bg-accent5-primary',
1776
+ 'bg-accent6-primary',
1777
+ 'bg-accent7-primary',
1778
+ 'bg-accent8-primary',
1779
+ 'bg-accent9-primary',
1780
+ 'bg-accent10-primary',
1781
+ ];
1782
+ const DEFAULT_FONT_FAMILY = 'font-family:"Inter", sans-serif;';
1783
+ const FONTSTYLEMAPPING = Object.keys(Typography).reduce((result, key) => {
1784
+ result[key] =
1785
+ DEFAULT_FONT_FAMILY +
1786
+ Typography[key].filter((str) => str.indexOf('@apply') < 0).join(';');
1787
+ return result;
1788
+ }, { 'v-text-secondary': `color:rgba(107, 116, 125, 1);` });
1789
+ /**
1790
+ * base drawer that provides a common structure for drawing charts using a renderer and options.
1791
+ */
1792
+ class BaseDrawer {
1793
+ /**
1794
+ * This is a constructor function that takes in a renderer and options for a chart drawer.
1795
+ *
1796
+ * @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
1797
+ * @param {BaseInteractor<SVGElement | HTMLCanvasElement>} interactor - `renderer` parameter is an instance of a `BaseInteractor` class
1798
+ * @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
1799
+ */
1800
+ constructor(renderer, interactor, options) {
1801
+ this.renderer = renderer;
1802
+ this.interactor = interactor;
1803
+ this.options = options;
1804
+ }
1805
+ /**
1806
+ * The function executes a draw method.
1807
+ */
1808
+ execute() {
1809
+ const drawPiece = this.draw();
1810
+ this.drawPiece = drawPiece;
1811
+ this.addInteractionSupport(drawPiece);
1812
+ }
1813
+ /**
1814
+ * returns a color token based on an index and an optional array of colors.
1815
+ *
1816
+ * @param {number} index - The index parameter is a number that represents the index of the color to be returned from the colors array.
1817
+ * @param {BackgroundColorsTokenType[]} [colors] - `colors` is an optional parameter of type `BackgroundColorsTokenType[]`
1818
+ * @returns {BackgroundColorsTokenType} color token
1819
+ */
1820
+ getColorByIndex(index, colors) {
1821
+ colors = colors && colors.length ? colors : CHART_DEFAULT_COLORS;
1822
+ index = index % colors.length;
1823
+ return colors[index];
1824
+ }
1825
+ /**
1826
+ * This function takes a token representing a background color and returns the corresponding color value from a predefined mapping.
1827
+ *
1828
+ * @param {BackgroundColorsTokenType} token - a string representing the token for a background color
1829
+ * @returns {string} The string value returned is the color code
1830
+ */
1831
+ getColorFromToken(token) {
1832
+ return BackgroundColorsMappingLight[token];
1833
+ }
1834
+ /**
1835
+ * The function takes a token as input and returns the corresponding CSS style text from a predefined mapping.
1836
+ *
1837
+ * @param {string} token - The `token` parameter is a string that represents a specific style mapping
1838
+ * in the `FONTSTYLEMAPPING` object. The function returns the CSS style text associated with the given `token`.
1839
+ * @returns {string} a string that represents the CSS style associated with the input token. If the input token
1840
+ * matches a key in the `FONTSTYLEMAPPING` object, the corresponding CSS style string is returned.
1841
+ */
1842
+ getStyleTextFromToken(token) {
1843
+ return token
1844
+ .split(' ')
1845
+ .map((item) => FONTSTYLEMAPPING[item])
1846
+ .join(';');
1847
+ }
1848
+ }
1849
+
1850
+ /** 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. */
1851
+ class InteractingEntryGenerator {
1852
+ /**
1853
+ * The function generates an InteractingEntry object based on the provided options.
1854
+ *
1855
+ * @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.
1856
+ * @returns {InteractingEntry} An object of type InteractingEntry is being returned.
1857
+ */
1858
+ generate(options) {
1859
+ return {
1860
+ eventType: this.eventType,
1861
+ shouldHandle: this.createShouldHandle(options),
1862
+ handle: this.createHandle(options),
1863
+ };
1864
+ }
1865
+ }
1866
+
1867
+ /** 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. */
1868
+ class PieLegendHoverGenerator extends InteractingEntryGenerator {
1869
+ constructor() {
1870
+ super(...arguments);
1871
+ this.eventType = 'mouseover';
1872
+ }
1873
+ /**
1874
+ * The function "createShouldHandle" returns a function that takes an event as a parameter and returns a boolean value.
1875
+ *
1876
+ * @returns {InteractingEntry['shouldHandle']} A function that takes an event as an argument and returns a boolean value.
1877
+ */
1878
+ createShouldHandle() {
1879
+ return this.shouldHandle;
1880
+ }
1881
+ /**
1882
+ * The function "createHandle" returns the handle property of an InteractingEntry object.
1883
+ *
1884
+ * @param {LegendInputType} options the legend render options
1885
+ * @returns {InteractingEntry['handle']} The `handle` property of the `InteractingEntry` object is being returned.
1886
+ */
1887
+ createHandle(options) {
1888
+ // eslint-disable-next-line jsdoc/require-jsdoc
1889
+ return (event) => {
1890
+ this.handle(event, options);
1891
+ };
1892
+ }
1893
+ /**
1894
+ * This function checks if a mouse event should be handled based on whether the target or its parent element has a specific class.
1895
+ *
1896
+ * @param {MouseEvent} event - MouseEvent is a type of event that is triggered by a mouse action, such
1897
+ * as clicking, hovering, or scrolling. It contains information about the event, such as the target
1898
+ * element and the position of the mouse.
1899
+ * @returns {boolean} A boolean value is being returned. The method `shouldHandle` checks if the target element
1900
+ * or its parent element has a class of `vega-chart-legend-item` and returns `true` if it does, and
1901
+ * `false` otherwise.
1902
+ */
1903
+ shouldHandle(event) {
1904
+ var _a;
1905
+ const target = event.target;
1906
+ const currentTarget = event.currentTarget;
1907
+ const container = currentTarget.parentElement && currentTarget.parentElement.nodeType !== 11
1908
+ ? currentTarget.parentElement
1909
+ : currentTarget.parentNode['host'];
1910
+ return (container.tagName === 'VEGA-PIE-CHART' &&
1911
+ (target.classList.contains('vega-chart-legend-item') ||
1912
+ !!((_a = target.parentElement) === null || _a === void 0 ? void 0 : _a.classList.contains('vega-chart-legend-item'))));
1913
+ }
1914
+ /**
1915
+ * The function handles a mouse event on a legend and triggers a mouseover event on the corresponding path element in a D3 chart.
1916
+ *
1917
+ * @param {MouseEvent} event - The event parameter is a MouseEvent, which represents a user action
1918
+ * (such as a click or hover) on a specific element in the DOM.
1919
+ * @param {LegendInputType} options - LegendInputType is a custom type that likely contains
1920
+ * information about the data being displayed in the chart, such as the names of the categories or
1921
+ * series being plotted. It may also include information about the chart's appearance or behavior,
1922
+ * such as the colors or labels used in the legend. Without more information about
1923
+ */
1924
+ handle(event, options) {
1925
+ var _a;
1926
+ const svgSelection = select(event.currentTarget);
1927
+ const target = event.target;
1928
+ const targetTextNode = target.tagName === 'text'
1929
+ ? target
1930
+ : target.tagName === 'circle'
1931
+ ? target.nextElementSibling
1932
+ : target.querySelector('text');
1933
+ const name = targetTextNode ? targetTextNode.textContent : '';
1934
+ const index = name ? options.data.indexOf(name) : 0;
1935
+ const paths = svgSelection
1936
+ .selectAll(`path.vega-chart-arc-path`)
1937
+ .nodes();
1938
+ (_a = paths[index]) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new MouseEvent('mouseover', { bubbles: true }));
1939
+ }
1940
+ }
1941
+
1942
+ /** The LegendDrawer class draws circles and text for each legend in a chart. */
1943
+ class LegendDrawer extends BaseDrawer {
1944
+ constructor() {
1945
+ super(...arguments);
1946
+ this.pieLegendHoverGenerator = new PieLegendHoverGenerator();
1947
+ }
1948
+ /**
1949
+ * This function adds interaction support to a chart by registering it with an interactor and providing a hover generator.
1950
+ *
1951
+ * @param {(SVGGElement | HTMLCanvasElement)[]} drawPiece - `drawPiece` is a parameter of type array
1952
+ * that contains either `SVGGElement` or `HTMLCanvasElement` elements. It is used as a callback
1953
+ * function to draw the legend items on the chart.
1954
+ */
1955
+ addInteractionSupport(drawPiece) {
1956
+ var _a;
1957
+ if ((_a = this.options.renderOptions.data) === null || _a === void 0 ? void 0 : _a.length) {
1958
+ this.interactor.register(this, drawPiece, this.pieLegendHoverGenerator.generate(this.options.renderOptions));
1959
+ }
1960
+ }
1961
+ /**
1962
+ * This function draws a legend on a chart using input options.
1963
+ *
1964
+ * @returns {(SVGGElement | HTMLCanvasElement)[] | undefined} draw piece
1965
+ */
1966
+ draw() {
1967
+ const { data = [], colors, position, width } = this.options.renderOptions;
1968
+ const options = this.getChartLegendOptions(data, colors, position);
1969
+ if (options) {
1970
+ const longestLegendLength = getLongestTextLengthFromArray(data);
1971
+ return options.legends.map((legend, index) => {
1972
+ const position = this.getLegendPosition(options.position, index, longestLegendLength, width);
1973
+ return this.renderer.drawLegend(position, legend.field, legend.color, this.getStyleTextFromToken('v-font-footnote2-short'));
1974
+ });
1975
+ }
1976
+ }
1977
+ /**
1978
+ * This function takes in an array of strings and an optional position parameter, and returns an object containing legend options for a chart.
1979
+ *
1980
+ * @param {string[]} data - an array of strings representing the legend labels
1981
+ * @param {BackgroundColorsTokenType[]} [colors] - bg color token array
1982
+ * @param {ChartPosition} [position] - The `position` parameter is an optional parameter of type
1983
+ * `ChartPosition` which specifies the x and y coordinates of the chart legend on the chart. If it is
1984
+ * not provided, the default position is `{x: 10, y: 0}`.
1985
+ * @returns {ChartLegendOptions | undefined} an object of type `ChartLegendOptions`.
1986
+ */
1987
+ getChartLegendOptions(data, colors, position) {
1988
+ if (data && data.length) {
1989
+ position = position ? Object.assign({ x: 10, y: 0 }, position) : { x: 10, y: 0 };
1990
+ const legendsMap = {
1991
+ position,
1992
+ legends: data.map((text, index) => {
1993
+ return {
1994
+ field: text,
1995
+ color: this.getColorFromToken(this.getColorByIndex(index, colors)),
1996
+ icon: '',
1997
+ };
1998
+ }),
1999
+ };
2000
+ return legendsMap;
2001
+ }
2002
+ }
2003
+ /**
2004
+ * This function calculates the position of a legend on a chart based on its index and the chart layout.
2005
+ *
2006
+ * @param {ChartPosition} position - The initial position of the legend on the chart, with x and y coordinates.
2007
+ * @param {number} index - The index parameter is a number that represents the index of the legend item in the array of legends. It is used to calculate the position of the legend item on the chart.
2008
+ * @param {number} longestTextLength - text length
2009
+ * @param {number} width - chart width
2010
+ * @returns {ChartPosition} an object of type `ChartPosition` with `x` and `y` properties.
2011
+ */
2012
+ getLegendPosition(position, index, longestTextLength, width) {
2013
+ const maxWidth = width;
2014
+ if (maxWidth) {
2015
+ const restWidth = maxWidth - position.x;
2016
+ const singleWidth = longestTextLength * 7 + 24;
2017
+ const singleHeight = 18;
2018
+ const column = Math.max(Number((restWidth / singleWidth).toFixed(0)), 1);
2019
+ const row = parseInt((index / column).toString());
2020
+ const x = position.x + singleWidth * (index % column);
2021
+ const y = position.y + row * singleHeight;
2022
+ return { x, y };
2023
+ }
2024
+ return { x: 0, y: 0 };
2025
+ }
2026
+ }
2027
+
2028
+ /** The LayoutInputProcessor class processes input chart options to calculate layout dimensions and margins. */
2029
+ class LayoutInputProcessor {
2030
+ /**
2031
+ * This function processes chart options and returns layout dimensions and margins.
2032
+ *
2033
+ * @param {ChartOptions<unknown>} input - A ChartOptions object containing the container and layout properties.
2034
+ * @returns {LayoutProcessResultType} An object with properties `width`, `height`, `innerWidth`, `innerHeight`, `top`, `right`,
2035
+ * `bottom`, and `left`.
2036
+ */
2037
+ process(input) {
2038
+ const { container, layout } = input;
2039
+ const { top, right, bottom, left } = ((layout === null || layout === void 0 ? void 0 : layout.margin) ||
2040
+ DEFAULT_LAYOUT.margin);
2041
+ const dimensionController = new ChartDimensionController(container);
2042
+ return {
2043
+ width: dimensionController.getContainerClientWidth(layout),
2044
+ height: dimensionController.getContainerClientHeight(layout),
2045
+ innerWidth: dimensionController.getContainerInnerWidth(layout),
2046
+ innerHeight: dimensionController.getContainerInnerHeight(layout),
2047
+ top,
2048
+ right,
2049
+ bottom,
2050
+ left,
2051
+ };
2052
+ }
2053
+ }
2054
+
2055
+ /** The `ProcessorChain` class takes an array of input processors, processes input through them, and returns the final output. */
2056
+ class ProcessorChain {
2057
+ /**
2058
+ * This is a constructor function that takes an array of input processors as a parameter.
2059
+ *
2060
+ * @param {InputProcessor<unknown, unknown, unknown>[]} processors - The `processors` parameter is a
2061
+ * private property of the class that is of type `InputProcessor` which is an interface that takes
2062
+ * three type parameters - `Input`, `Output`, and `Context`. It is an array of instances of classes
2063
+ * that implement the `InputProcessor` interface. These processors are
2064
+ */
2065
+ constructor(processors) {
2066
+ this.processors = processors;
2067
+ }
2068
+ /**
2069
+ * This function processes input through a series of processors and returns the final output.
2070
+ *
2071
+ * @typedef T generic type
2072
+ * @param {unknown} input - The input parameter is of type unknown, which means it can be any type of
2073
+ * value. It is the data that will be processed by the processors.
2074
+ * @returns {T} the output of the last processor in the `this.processors` array.
2075
+ */
2076
+ process(input) {
2077
+ let previousOutput;
2078
+ for (const processor of this.processors) {
2079
+ previousOutput = processor.process(input, previousOutput);
2080
+ }
2081
+ return previousOutput;
2082
+ }
2083
+ }
2084
+
2085
+ /** The `LegendInputProcessor` class processes chart options and previous layout results to generate a legend input object for a line chart. */
2086
+ class LegendInputProcessor {
2087
+ /**
2088
+ * This function takes in chart options and previous layout results, and returns a legend input object with data, colors, position, width, and height properties.
2089
+ *
2090
+ * @param {ChartOptions<LineChartDataType>} input - The input parameter is an object of type ChartOptions that contains the data and
2091
+ * configuration options for a line chart.
2092
+ * @param {LayoutProcessResultType} previousOutput - `previousOutput` is an optional parameter of
2093
+ * type `LayoutProcessResultType` that represents the output of the previous layout process. It is
2094
+ * used to retrieve the width and height of the chart, which are needed to properly position the
2095
+ * legend. If no previous output is provided, the width and height will
2096
+ * @returns {LegendInputType} an object of type `LegendInputType`. The object contains the following properties:
2097
+ * - `data`: an array of legend items
2098
+ * - `colors`: an array of colors used in the chart
2099
+ * - `position`: an object with `x` and `y` properties representing the position of the legend
2100
+ * - `width`: the width of the chart
2101
+ * - `height`: the
2102
+ */
2103
+ process(input, previousOutput) {
2104
+ const { colors, legends = [] } = input;
2105
+ const { width, height } = previousOutput;
2106
+ return {
2107
+ data: legends,
2108
+ colors,
2109
+ position: { x: 10, y: 10 },
2110
+ width,
2111
+ height,
2112
+ };
2113
+ }
2114
+ }
2115
+
2116
+ export { BaseDrawer as B, InteractingEntryGenerator as I, LayoutInputProcessor as L, ProcessorChain as P, BaseChart as a, LegendInputProcessor as b, LegendDrawer as c, pie as p, select as s };