@oliasoft-open-source/charts-library 5.9.0-beta-5 → 5.9.0-beta-7

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 (363) hide show
  1. package/dist/index.d.ts +973 -1
  2. package/dist/index.js +2561 -1077
  3. package/package.json +14 -27
  4. package/dist/assets/Color-6BZIO3FS-DdowJmIE.js +0 -1
  5. package/dist/assets/DocsRenderer-LL677BLK-Bh3SSh9b.js +0 -41
  6. package/dist/assets/WithTooltip-65CFNBJE-jPKxajlJ.js +0 -9
  7. package/dist/assets/bar-chart-const-BupPLp8f.js +0 -1
  8. package/dist/assets/bar-chart.stories-BflbVUPC.js +0 -138
  9. package/dist/assets/chunk-242VQQM5-By-lqKqL.js +0 -1
  10. package/dist/assets/chunk-CYSK6WYR-BpIZnq_i.js +0 -1
  11. package/dist/assets/chunk-YKABRMAI-DEtioWGg.js +0 -18
  12. package/dist/assets/components-CVnPnJrM.js +0 -92
  13. package/dist/assets/formatter-EIJCOSYU-CFg7KAGQ.js +0 -1
  14. package/dist/assets/get-custom-legend-plugin-example-Bo7hTtyz.js +0 -1
  15. package/dist/assets/get-draggableData-7QedQGoF.js +0 -2
  16. package/dist/assets/iframe-gWDSyY5r.js +0 -1228
  17. package/dist/assets/legend-RH4DOORv.js +0 -314
  18. package/dist/assets/legend-context-BhFJ15-e.js +0 -10
  19. package/dist/assets/line-chart-8HLWYRar.js +0 -1
  20. package/dist/assets/line-chart.stories-B8gghA-c.js +0 -1211
  21. package/dist/assets/line-chart.test-case.stories-D3lffJw3.js +0 -1749
  22. package/dist/assets/noto-sans-cyrillic-400-italic-CMQj_TQM.woff2 +0 -0
  23. package/dist/assets/noto-sans-cyrillic-400-italic-Dm4hr-Ag.woff +0 -0
  24. package/dist/assets/noto-sans-cyrillic-400-normal-BDYvNhAR.woff +0 -0
  25. package/dist/assets/noto-sans-cyrillic-400-normal-CHP_ranX.woff2 +0 -0
  26. package/dist/assets/noto-sans-cyrillic-700-italic-Cmu_Qrsl.woff +0 -0
  27. package/dist/assets/noto-sans-cyrillic-700-italic-D3UOC7d4.woff2 +0 -0
  28. package/dist/assets/noto-sans-cyrillic-700-normal-D8UNalU-.woff +0 -0
  29. package/dist/assets/noto-sans-cyrillic-700-normal-DYZmzPmX.woff2 +0 -0
  30. package/dist/assets/noto-sans-cyrillic-ext-400-italic-C9NI8UaU.woff2 +0 -0
  31. package/dist/assets/noto-sans-cyrillic-ext-400-italic-DqW_YkPk.woff +0 -0
  32. package/dist/assets/noto-sans-cyrillic-ext-400-normal-BjDhGU6t.woff2 +0 -0
  33. package/dist/assets/noto-sans-cyrillic-ext-400-normal-d9FrwbiD.woff +0 -0
  34. package/dist/assets/noto-sans-cyrillic-ext-700-italic-B0vIy3Bn.woff +0 -0
  35. package/dist/assets/noto-sans-cyrillic-ext-700-italic-MYAGlKQw.woff2 +0 -0
  36. package/dist/assets/noto-sans-cyrillic-ext-700-normal-D83T7awq.woff +0 -0
  37. package/dist/assets/noto-sans-cyrillic-ext-700-normal-OK-fZO_i.woff2 +0 -0
  38. package/dist/assets/noto-sans-devanagari-400-italic-BpEXw0fu.woff +0 -0
  39. package/dist/assets/noto-sans-devanagari-400-italic-aza5nvbj.woff2 +0 -0
  40. package/dist/assets/noto-sans-devanagari-400-normal-C3FccbrF.woff2 +0 -0
  41. package/dist/assets/noto-sans-devanagari-400-normal-g9fsM2jL.woff +0 -0
  42. package/dist/assets/noto-sans-devanagari-700-italic-B7b0Qocp.woff +0 -0
  43. package/dist/assets/noto-sans-devanagari-700-italic-DQbbFiZ1.woff2 +0 -0
  44. package/dist/assets/noto-sans-devanagari-700-normal-CT12sGlc.woff +0 -0
  45. package/dist/assets/noto-sans-devanagari-700-normal-DVs0dmkg.woff2 +0 -0
  46. package/dist/assets/noto-sans-greek-400-italic-Cw158ua2.woff2 +0 -0
  47. package/dist/assets/noto-sans-greek-400-italic-Ds3lC5jm.woff +0 -0
  48. package/dist/assets/noto-sans-greek-400-normal-Be2BcUUc.woff +0 -0
  49. package/dist/assets/noto-sans-greek-400-normal-DCESwnT1.woff2 +0 -0
  50. package/dist/assets/noto-sans-greek-700-italic-DiFf_pN5.woff +0 -0
  51. package/dist/assets/noto-sans-greek-700-italic-Wr-Zu-Te.woff2 +0 -0
  52. package/dist/assets/noto-sans-greek-700-normal-DDNJsN3F.woff +0 -0
  53. package/dist/assets/noto-sans-greek-700-normal-x3kNWF-0.woff2 +0 -0
  54. package/dist/assets/noto-sans-greek-ext-400-italic-D9i0Od8_.woff +0 -0
  55. package/dist/assets/noto-sans-greek-ext-400-italic-DlxXzGt2.woff2 +0 -0
  56. package/dist/assets/noto-sans-greek-ext-400-normal-L11LEhi4.woff +0 -0
  57. package/dist/assets/noto-sans-greek-ext-400-normal-i2oSBwXz.woff2 +0 -0
  58. package/dist/assets/noto-sans-greek-ext-700-italic-BWtLoNYq.woff2 +0 -0
  59. package/dist/assets/noto-sans-greek-ext-700-italic-D1odJgaI.woff +0 -0
  60. package/dist/assets/noto-sans-greek-ext-700-normal-BOmIwFkq.woff +0 -0
  61. package/dist/assets/noto-sans-greek-ext-700-normal-Dq1WA5-1.woff2 +0 -0
  62. package/dist/assets/noto-sans-latin-400-italic-4m5KtZ19.woff2 +0 -0
  63. package/dist/assets/noto-sans-latin-400-italic-D8X3Awh8.woff +0 -0
  64. package/dist/assets/noto-sans-latin-400-normal-BTkUljjl.woff2 +0 -0
  65. package/dist/assets/noto-sans-latin-400-normal-DPpKfCgK.woff +0 -0
  66. package/dist/assets/noto-sans-latin-700-italic-CSXnTKie.woff2 +0 -0
  67. package/dist/assets/noto-sans-latin-700-italic-Dye4NHQ1.woff +0 -0
  68. package/dist/assets/noto-sans-latin-700-normal-CrvTEWhy.woff2 +0 -0
  69. package/dist/assets/noto-sans-latin-700-normal-ZyrKABVF.woff +0 -0
  70. package/dist/assets/noto-sans-latin-ext-400-italic-BXXaecLH.woff2 +0 -0
  71. package/dist/assets/noto-sans-latin-ext-400-italic-C3uzHanu.woff +0 -0
  72. package/dist/assets/noto-sans-latin-ext-400-normal-CNh9dRW_.woff +0 -0
  73. package/dist/assets/noto-sans-latin-ext-400-normal-CVf-LbaS.woff2 +0 -0
  74. package/dist/assets/noto-sans-latin-ext-700-italic-ClDAM8zy.woff +0 -0
  75. package/dist/assets/noto-sans-latin-ext-700-italic-DvsrmUw0.woff2 +0 -0
  76. package/dist/assets/noto-sans-latin-ext-700-normal-BypTtJma.woff2 +0 -0
  77. package/dist/assets/noto-sans-latin-ext-700-normal-CgsG9aVh.woff +0 -0
  78. package/dist/assets/noto-sans-vietnamese-400-italic-Dotu2pZp.woff2 +0 -0
  79. package/dist/assets/noto-sans-vietnamese-400-italic-da8J1rYs.woff +0 -0
  80. package/dist/assets/noto-sans-vietnamese-400-normal-C3Al4sv4.woff +0 -0
  81. package/dist/assets/noto-sans-vietnamese-400-normal-D2wP-Vm-.woff2 +0 -0
  82. package/dist/assets/noto-sans-vietnamese-700-italic-CKIaFk_d.woff2 +0 -0
  83. package/dist/assets/noto-sans-vietnamese-700-italic-CfCpOr03.woff +0 -0
  84. package/dist/assets/noto-sans-vietnamese-700-normal-1GL2JyGE.woff +0 -0
  85. package/dist/assets/noto-sans-vietnamese-700-normal-DayJ0F-f.woff2 +0 -0
  86. package/dist/assets/pie-chart.stories-CQ6148pO.js +0 -45
  87. package/dist/assets/preload-helper-Bhb7V-Yo.js +0 -1
  88. package/dist/assets/react-18-DZdrvSyo.js +0 -1
  89. package/dist/assets/react-DrmbVkNb.js +0 -1
  90. package/dist/assets/react-dom-CUqZc1lH.js +0 -8
  91. package/dist/assets/scatter-chart.stories-BmCRLBrB.js +0 -41
  92. package/dist/assets/syntaxhighlighter-ED5Y7EFY-CirqknGz.js +0 -6
  93. package/dist/assets/theming-BqNSGASu.js +0 -39
  94. package/dist/bar-chart/bar-chart-const.d.ts +0 -2
  95. package/dist/bar-chart/bar-chart-default-props.d.ts +0 -2
  96. package/dist/bar-chart/bar-chart.d.ts +0 -3
  97. package/dist/bar-chart/bar-chart.interface.d.ts +0 -96
  98. package/dist/bar-chart/utils/get-bar-chart-data-labels.d.ts +0 -10
  99. package/dist/bar-chart/utils/get-bar-chart-scales.d.ts +0 -3
  100. package/dist/bar-chart/utils/get-bar-chart-tooltips.d.ts +0 -6
  101. package/dist/bar-chart/utils/use-bar-chart-config.d.ts +0 -13
  102. package/dist/bar-chart/utils/use-bar-chart-options.d.ts +0 -55
  103. package/dist/common/common.interface.d.ts +0 -227
  104. package/dist/common/controls-portal.d.ts +0 -7
  105. package/dist/common/enums.d.ts +0 -10
  106. package/dist/common/helpers/add-transparency/add-transparency.d.ts +0 -1
  107. package/dist/common/helpers/callout-helpers/callout-helpers.d.ts +0 -7
  108. package/dist/common/helpers/chart-border-plugin.d.ts +0 -16
  109. package/dist/common/helpers/chart-consts.d.ts +0 -39
  110. package/dist/common/helpers/chart-utils.d.ts +0 -86
  111. package/dist/common/helpers/container.d.ts +0 -18
  112. package/dist/common/helpers/custom-format-number.d.ts +0 -1
  113. package/dist/common/helpers/download-pgn.d.ts +0 -3
  114. package/dist/common/helpers/enums.d.ts +0 -81
  115. package/dist/common/helpers/get-chart-annotation.d.ts +0 -136
  116. package/dist/common/helpers/get-chart-from-ctx.d.ts +0 -1
  117. package/dist/common/helpers/get-custom-legend-plugin-example.d.ts +0 -8
  118. package/dist/common/helpers/get-draggableData.d.ts +0 -18
  119. package/dist/common/helpers/get-grouped-color-scheme/get-grouped-color-scheme.d.ts +0 -1
  120. package/dist/common/helpers/range/estimate-data-series-have-close-values.d.ts +0 -8
  121. package/dist/common/helpers/range/range.d.ts +0 -33
  122. package/dist/common/helpers/text.d.ts +0 -1
  123. package/dist/common/helpers/to-annotation.d.ts +0 -4
  124. package/dist/common/hooks/use-generated-labels.d.ts +0 -4
  125. package/dist/common/hooks/use-legend-state.d.ts +0 -28
  126. package/dist/common/hooks/use-legend.d.ts +0 -4
  127. package/dist/common/hooks/use-reset.d.ts +0 -3
  128. package/dist/common/hooks/use-update-annotations.d.ts +0 -4
  129. package/dist/common/legend-component/legend-dropzone.d.ts +0 -3
  130. package/dist/common/legend-component/legend-interface.d.ts +0 -48
  131. package/dist/common/legend-component/legend-item/LegendItemLine.d.ts +0 -5
  132. package/dist/common/legend-component/legend-item/legend-item.d.ts +0 -3
  133. package/dist/common/legend-component/legend-panel.d.ts +0 -3
  134. package/dist/common/legend-component/legend.d.ts +0 -3
  135. package/dist/common/legend-component/state/legend-action-types.d.ts +0 -3
  136. package/dist/common/legend-component/state/legend-context.d.ts +0 -14
  137. package/dist/common/legend-component/state/legend-state-reducer.d.ts +0 -30
  138. package/dist/common/legend-component/utils/create-style-object.d.ts +0 -27
  139. package/dist/common/legend-component/utils/get-generated-labels.d.ts +0 -2
  140. package/dist/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +0 -15
  141. package/dist/common/plugins/annotation-dragger-plugin/annotation-position-storage.d.ts +0 -7
  142. package/dist/common/plugins/annotation-dragger-plugin/enums.d.ts +0 -21
  143. package/dist/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +0 -6
  144. package/dist/common/plugins/annotation-dragger-plugin/helpers.d.ts +0 -53
  145. package/dist/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +0 -5
  146. package/dist/common/plugins/ellipsis-annotation-plugin/compute-ellipse-geometry.d.ts +0 -9
  147. package/dist/common/plugins/ellipsis-annotation-plugin/ellipsis-annotation-plugin.d.ts +0 -18
  148. package/dist/common/plugins/gradient-background-plugin/enums.d.ts +0 -10
  149. package/dist/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +0 -2
  150. package/dist/favicon-wrapper.svg +0 -46
  151. package/dist/favicon.svg +0 -1
  152. package/dist/iframe.html +0 -705
  153. package/dist/index.html +0 -144
  154. package/dist/index.json +0 -1
  155. package/dist/line-chart/constants/default-translations.d.ts +0 -25
  156. package/dist/line-chart/constants/line-chart-consts.d.ts +0 -13
  157. package/dist/line-chart/controls/axes-options/axes-options-interfaces.d.ts +0 -57
  158. package/dist/line-chart/controls/axes-options/axes-options.d.ts +0 -6
  159. package/dist/line-chart/controls/axes-options/axes-validation.d.ts +0 -8
  160. package/dist/line-chart/controls/controls-interfaces.d.ts +0 -20
  161. package/dist/line-chart/controls/controls.d.ts +0 -3
  162. package/dist/line-chart/controls/drag-options-interfaces.d.ts +0 -14
  163. package/dist/line-chart/controls/drag-options.d.ts +0 -23
  164. package/dist/line-chart/controls/line-options.d.ts +0 -19
  165. package/dist/line-chart/hooks/use-chart-functions.d.ts +0 -33
  166. package/dist/line-chart/hooks/use-chart-options.d.ts +0 -19
  167. package/dist/line-chart/hooks/use-chart-plugins.d.ts +0 -7
  168. package/dist/line-chart/hooks/use-chart-state.d.ts +0 -12
  169. package/dist/line-chart/hooks/use-toggle-handler.d.ts +0 -12
  170. package/dist/line-chart/initialize/config.d.ts +0 -12
  171. package/dist/line-chart/initialize/initialize-line-chart.d.ts +0 -12
  172. package/dist/line-chart/line-chart-get-default-props.d.ts +0 -2
  173. package/dist/line-chart/line-chart.d.ts +0 -3
  174. package/dist/line-chart/line-chart.interface.d.ts +0 -150
  175. package/dist/line-chart/plugins/callout-plugin/callout-plugin.d.ts +0 -11
  176. package/dist/line-chart/plugins/callout-plugin/helpers.d.ts +0 -37
  177. package/dist/line-chart/plugins/chart-area-text-plugin.d.ts +0 -17
  178. package/dist/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +0 -8
  179. package/dist/line-chart/plugins/plugin-constants.d.ts +0 -11
  180. package/dist/line-chart/plugins/plugins.interface.d.ts +0 -9
  181. package/dist/line-chart/plugins/vertical-markers-plugin/draw.d.ts +0 -24
  182. package/dist/line-chart/plugins/vertical-markers-plugin/types.d.ts +0 -42
  183. package/dist/line-chart/plugins/vertical-markers-plugin/utils.d.ts +0 -23
  184. package/dist/line-chart/plugins/vertical-markers-plugin/vertical-markers-plugin.d.ts +0 -54
  185. package/dist/line-chart/state/action-types.d.ts +0 -12
  186. package/dist/line-chart/state/helpers.d.ts +0 -13
  187. package/dist/line-chart/state/initial-state.d.ts +0 -11
  188. package/dist/line-chart/state/line-chart-reducer.d.ts +0 -2
  189. package/dist/line-chart/state/manage-state-in-local-storage.d.ts +0 -15
  190. package/dist/line-chart/state/state.interfaces.d.ts +0 -26
  191. package/dist/line-chart/utils/axis-formatting/axis-formatting.d.ts +0 -2
  192. package/dist/line-chart/utils/axis-scales/axis-scales.d.ts +0 -9
  193. package/dist/line-chart/utils/check-custom-option/check-custom-option.d.ts +0 -12
  194. package/dist/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +0 -20
  195. package/dist/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +0 -8
  196. package/dist/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +0 -11
  197. package/dist/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +0 -6
  198. package/dist/line-chart/utils/enums.d.ts +0 -4
  199. package/dist/line-chart/utils/generate-line-chart-datasets.d.ts +0 -8
  200. package/dist/line-chart/utils/get-annotations-data.d.ts +0 -1
  201. package/dist/line-chart/utils/get-axes-data-from-metasets.d.ts +0 -1
  202. package/dist/line-chart/utils/get-axes-ranges-from-chart.d.ts +0 -9
  203. package/dist/line-chart/utils/get-axis-range-by-type.d.ts +0 -10
  204. package/dist/line-chart/utils/get-generated-labels.d.ts +0 -2
  205. package/dist/line-chart/utils/get-line-chart-data-labels.d.ts +0 -16
  206. package/dist/line-chart/utils/get-line-chart-scales.d.ts +0 -4
  207. package/dist/line-chart/utils/get-line-chart-tooltips.d.ts +0 -30
  208. package/dist/line-chart/utils/line-chart-utils.d.ts +0 -24
  209. package/dist/line-chart/utils/translations/get-translations.d.ts +0 -8
  210. package/dist/nunito-sans-bold-italic.woff2 +0 -0
  211. package/dist/nunito-sans-bold.woff2 +0 -0
  212. package/dist/nunito-sans-italic.woff2 +0 -0
  213. package/dist/nunito-sans-regular.woff2 +0 -0
  214. package/dist/pie-chart/pie-chart-defalut-props.interface.d.ts +0 -50
  215. package/dist/pie-chart/pie-chart-get-default-props.d.ts +0 -3
  216. package/dist/pie-chart/pie-chart.d.ts +0 -3
  217. package/dist/pie-chart/pie-chart.interface.d.ts +0 -70
  218. package/dist/pie-chart/use-pie-chart-config.d.ts +0 -42
  219. package/dist/project.json +0 -1
  220. package/dist/sb-addons/docs-2/manager-bundle.js +0 -3
  221. package/dist/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -628
  222. package/dist/sb-addons/themes-1/manager-bundle.js +0 -3
  223. package/dist/sb-common-assets/favicon-wrapper.svg +0 -46
  224. package/dist/sb-common-assets/favicon.svg +0 -1
  225. package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  226. package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  227. package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  228. package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  229. package/dist/sb-manager/globals-runtime.js +0 -77947
  230. package/dist/sb-manager/globals.js +0 -24
  231. package/dist/sb-manager/manager-stores.js +0 -23
  232. package/dist/sb-manager/runtime.js +0 -20422
  233. package/dist/scatter-chart/hooks/use-scatter-chart-config.d.ts +0 -113
  234. package/dist/scatter-chart/scatter-chart-default-props.interface.d.ts +0 -71
  235. package/dist/scatter-chart/scatter-chart-get-default-props.d.ts +0 -3
  236. package/dist/scatter-chart/scatter-chart.d.ts +0 -3
  237. package/dist/scatter-chart/scatter-chart.interface.d.ts +0 -81
  238. package/dist/scatter-chart/utils/get-scales-config.d.ts +0 -49
  239. package/dist/scatter-chart/utils/get-tooltip-config.d.ts +0 -21
  240. package/dist/src/components/bar-chart/bar-chart-const.d.ts +0 -2
  241. package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +0 -2
  242. package/dist/src/components/bar-chart/bar-chart.d.ts +0 -3
  243. package/dist/src/components/bar-chart/bar-chart.interface.d.ts +0 -96
  244. package/dist/src/components/bar-chart/utils/get-bar-chart-data-labels.d.ts +0 -10
  245. package/dist/src/components/bar-chart/utils/get-bar-chart-scales.d.ts +0 -3
  246. package/dist/src/components/bar-chart/utils/get-bar-chart-tooltips.d.ts +0 -6
  247. package/dist/src/components/bar-chart/utils/use-bar-chart-config.d.ts +0 -13
  248. package/dist/src/components/bar-chart/utils/use-bar-chart-options.d.ts +0 -55
  249. package/dist/src/components/common/common.interface.d.ts +0 -227
  250. package/dist/src/components/common/controls-portal.d.ts +0 -7
  251. package/dist/src/components/common/enums.d.ts +0 -10
  252. package/dist/src/components/common/helpers/add-transparency/add-transparency.d.ts +0 -1
  253. package/dist/src/components/common/helpers/callout-helpers/callout-helpers.d.ts +0 -7
  254. package/dist/src/components/common/helpers/chart-border-plugin.d.ts +0 -16
  255. package/dist/src/components/common/helpers/chart-consts.d.ts +0 -39
  256. package/dist/src/components/common/helpers/chart-utils.d.ts +0 -86
  257. package/dist/src/components/common/helpers/container.d.ts +0 -18
  258. package/dist/src/components/common/helpers/custom-format-number.d.ts +0 -1
  259. package/dist/src/components/common/helpers/download-pgn.d.ts +0 -3
  260. package/dist/src/components/common/helpers/enums.d.ts +0 -81
  261. package/dist/src/components/common/helpers/get-chart-annotation.d.ts +0 -136
  262. package/dist/src/components/common/helpers/get-chart-from-ctx.d.ts +0 -1
  263. package/dist/src/components/common/helpers/get-custom-legend-plugin-example.d.ts +0 -8
  264. package/dist/src/components/common/helpers/get-draggableData.d.ts +0 -18
  265. package/dist/src/components/common/helpers/get-grouped-color-scheme/get-grouped-color-scheme.d.ts +0 -1
  266. package/dist/src/components/common/helpers/range/estimate-data-series-have-close-values.d.ts +0 -8
  267. package/dist/src/components/common/helpers/range/range.d.ts +0 -33
  268. package/dist/src/components/common/helpers/text.d.ts +0 -1
  269. package/dist/src/components/common/helpers/to-annotation.d.ts +0 -4
  270. package/dist/src/components/common/hooks/use-generated-labels.d.ts +0 -4
  271. package/dist/src/components/common/hooks/use-legend-state.d.ts +0 -28
  272. package/dist/src/components/common/hooks/use-legend.d.ts +0 -4
  273. package/dist/src/components/common/hooks/use-reset.d.ts +0 -3
  274. package/dist/src/components/common/hooks/use-update-annotations.d.ts +0 -4
  275. package/dist/src/components/common/legend-component/legend-dropzone.d.ts +0 -3
  276. package/dist/src/components/common/legend-component/legend-interface.d.ts +0 -48
  277. package/dist/src/components/common/legend-component/legend-item/LegendItemLine.d.ts +0 -5
  278. package/dist/src/components/common/legend-component/legend-item/legend-item.d.ts +0 -3
  279. package/dist/src/components/common/legend-component/legend-panel.d.ts +0 -3
  280. package/dist/src/components/common/legend-component/legend.d.ts +0 -3
  281. package/dist/src/components/common/legend-component/state/legend-action-types.d.ts +0 -3
  282. package/dist/src/components/common/legend-component/state/legend-context.d.ts +0 -14
  283. package/dist/src/components/common/legend-component/state/legend-state-reducer.d.ts +0 -30
  284. package/dist/src/components/common/legend-component/utils/create-style-object.d.ts +0 -27
  285. package/dist/src/components/common/legend-component/utils/get-generated-labels.d.ts +0 -2
  286. package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +0 -15
  287. package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-position-storage.d.ts +0 -7
  288. package/dist/src/components/common/plugins/annotation-dragger-plugin/enums.d.ts +0 -21
  289. package/dist/src/components/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +0 -6
  290. package/dist/src/components/common/plugins/annotation-dragger-plugin/helpers.d.ts +0 -53
  291. package/dist/src/components/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +0 -5
  292. package/dist/src/components/common/plugins/ellipsis-annotation-plugin/compute-ellipse-geometry.d.ts +0 -9
  293. package/dist/src/components/common/plugins/ellipsis-annotation-plugin/ellipsis-annotation-plugin.d.ts +0 -18
  294. package/dist/src/components/common/plugins/gradient-background-plugin/enums.d.ts +0 -10
  295. package/dist/src/components/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +0 -2
  296. package/dist/src/components/line-chart/constants/default-translations.d.ts +0 -25
  297. package/dist/src/components/line-chart/constants/line-chart-consts.d.ts +0 -13
  298. package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +0 -57
  299. package/dist/src/components/line-chart/controls/axes-options/axes-options.d.ts +0 -6
  300. package/dist/src/components/line-chart/controls/axes-options/axes-validation.d.ts +0 -8
  301. package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +0 -20
  302. package/dist/src/components/line-chart/controls/controls.d.ts +0 -3
  303. package/dist/src/components/line-chart/controls/drag-options-interfaces.d.ts +0 -14
  304. package/dist/src/components/line-chart/controls/drag-options.d.ts +0 -23
  305. package/dist/src/components/line-chart/controls/line-options.d.ts +0 -19
  306. package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +0 -33
  307. package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +0 -19
  308. package/dist/src/components/line-chart/hooks/use-chart-plugins.d.ts +0 -7
  309. package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +0 -12
  310. package/dist/src/components/line-chart/hooks/use-toggle-handler.d.ts +0 -12
  311. package/dist/src/components/line-chart/initialize/config.d.ts +0 -12
  312. package/dist/src/components/line-chart/initialize/initialize-line-chart.d.ts +0 -12
  313. package/dist/src/components/line-chart/line-chart-get-default-props.d.ts +0 -2
  314. package/dist/src/components/line-chart/line-chart.d.ts +0 -3
  315. package/dist/src/components/line-chart/line-chart.interface.d.ts +0 -150
  316. package/dist/src/components/line-chart/plugins/callout-plugin/callout-plugin.d.ts +0 -11
  317. package/dist/src/components/line-chart/plugins/callout-plugin/helpers.d.ts +0 -37
  318. package/dist/src/components/line-chart/plugins/chart-area-text-plugin.d.ts +0 -17
  319. package/dist/src/components/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +0 -8
  320. package/dist/src/components/line-chart/plugins/plugin-constants.d.ts +0 -11
  321. package/dist/src/components/line-chart/plugins/plugins.interface.d.ts +0 -9
  322. package/dist/src/components/line-chart/plugins/vertical-markers-plugin/draw.d.ts +0 -24
  323. package/dist/src/components/line-chart/plugins/vertical-markers-plugin/types.d.ts +0 -42
  324. package/dist/src/components/line-chart/plugins/vertical-markers-plugin/utils.d.ts +0 -23
  325. package/dist/src/components/line-chart/plugins/vertical-markers-plugin/vertical-markers-plugin.d.ts +0 -54
  326. package/dist/src/components/line-chart/state/action-types.d.ts +0 -12
  327. package/dist/src/components/line-chart/state/helpers.d.ts +0 -13
  328. package/dist/src/components/line-chart/state/initial-state.d.ts +0 -11
  329. package/dist/src/components/line-chart/state/line-chart-reducer.d.ts +0 -2
  330. package/dist/src/components/line-chart/state/manage-state-in-local-storage.d.ts +0 -15
  331. package/dist/src/components/line-chart/state/state.interfaces.d.ts +0 -26
  332. package/dist/src/components/line-chart/utils/axis-formatting/axis-formatting.d.ts +0 -2
  333. package/dist/src/components/line-chart/utils/axis-scales/axis-scales.d.ts +0 -9
  334. package/dist/src/components/line-chart/utils/check-custom-option/check-custom-option.d.ts +0 -12
  335. package/dist/src/components/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +0 -20
  336. package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +0 -8
  337. package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +0 -11
  338. package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +0 -6
  339. package/dist/src/components/line-chart/utils/enums.d.ts +0 -4
  340. package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +0 -8
  341. package/dist/src/components/line-chart/utils/get-annotations-data.d.ts +0 -1
  342. package/dist/src/components/line-chart/utils/get-axes-data-from-metasets.d.ts +0 -1
  343. package/dist/src/components/line-chart/utils/get-axes-ranges-from-chart.d.ts +0 -9
  344. package/dist/src/components/line-chart/utils/get-axis-range-by-type.d.ts +0 -10
  345. package/dist/src/components/line-chart/utils/get-generated-labels.d.ts +0 -2
  346. package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +0 -16
  347. package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +0 -4
  348. package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +0 -30
  349. package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +0 -24
  350. package/dist/src/components/line-chart/utils/translations/get-translations.d.ts +0 -8
  351. package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +0 -50
  352. package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +0 -3
  353. package/dist/src/components/pie-chart/pie-chart.d.ts +0 -3
  354. package/dist/src/components/pie-chart/pie-chart.interface.d.ts +0 -70
  355. package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +0 -42
  356. package/dist/src/components/scatter-chart/hooks/use-scatter-chart-config.d.ts +0 -113
  357. package/dist/src/components/scatter-chart/scatter-chart-default-props.interface.d.ts +0 -71
  358. package/dist/src/components/scatter-chart/scatter-chart-get-default-props.d.ts +0 -3
  359. package/dist/src/components/scatter-chart/scatter-chart.d.ts +0 -3
  360. package/dist/src/components/scatter-chart/scatter-chart.interface.d.ts +0 -81
  361. package/dist/src/components/scatter-chart/utils/get-scales-config.d.ts +0 -49
  362. package/dist/src/components/scatter-chart/utils/get-tooltip-config.d.ts +0 -21
  363. package/dist/vite-inject-mocker-entry.js +0 -8
@@ -1,1749 +0,0 @@
1
- import{a as e,j as t,t as n}from"./iframe-gWDSyY5r.js";import"./react-dom-CUqZc1lH.js";import{G as r}from"./legend-context-BhFJ15-e.js";import{O as i,W as a,k as o,x as s}from"./legend-RH4DOORv.js";import{t as c}from"./line-chart-8HLWYRar.js";import"./get-draggableData-7QedQGoF.js";var l=t(e(),1),u={controlsPortalId:`chartOne-plan-view-chart-controls`,data:{datasets:[{label:`CH-4ST`,lineTension:0,borderColor:`#a30125`,pointBackgroundColor:`#a30125`,pointRadius:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:2,fill:!1,data:[{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:.3927,label:[]},{x:0,y:2.4838,label:[]},{x:0,y:7.1727,label:[]},{x:0,y:14.4238,label:[]},{x:0,y:24.1818,label:[]},{x:0,y:36.3728,label:[]},{x:0,y:50.9039,label:[]},{x:0,y:67.6648,label:[]},{x:0,y:86.528,label:[]},{x:0,y:107.3503,label:[]},{x:0,y:129.9733,label:[]},{x:0,y:154.2251,label:[]},{x:0,y:179.9215,label:[]},{x:0,y:206.867,label:[]},{x:0,y:234.8569,label:[]},{x:0,y:263.6785,label:[]},{x:0,y:293.1127,label:[]},{x:0,y:322.9358,label:[]},{x:0,y:344.2833,label:[]},{x:0,y:352.9221,label:[]},{x:0,y:382.9221,label:[]},{x:0,y:412.9221,label:[]},{x:0,y:442.9221,label:[]},{x:0,y:472.9221,label:[]},{x:0,y:502.9221,label:[]},{x:0,y:532.9221,label:[]},{x:0,y:562.9221,label:[]},{x:0,y:592.9221,label:[]},{x:0,y:622.9221,label:[]},{x:0,y:644.2821,label:[]}]},{label:`CH-4`,lineTension:0,borderColor:`#0154a3`,pointBackgroundColor:`#0154a3`,pointRadius:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:2,fill:!1,data:[{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]}]}]},options:{direction:`vertical`,axes:{x:[{label:`E/W [m]`,position:`top`}],y:[{label:`N/S [m]`,position:`left`}]},additionalAxesOptions:{chartScaleType:`linear`},graph:{showDataLabels:!0,showMinorGridlines:!0,lineTension:0},chartStyling:{height:`100%`},annotations:{showAnnotations:!0,enableDragAnnotation:!0,annotationsData:[]}}},d=n(),f=[{label:`Dataset 1`,data:[{x:0,y:0},{x:5,y:25}]}],p={data:{datasets:f},options:{title:`Chart title`,chartStyling:{height:`100%`}}},m={title:`LineChart / Test Cases`,component:c,args:{chart:p}};const h=()=>(0,d.jsx)(c,{chart:{data:{datasets:[{label:`Duration %`,lineTension:`0`,pointHitRadius:10,borderColor:`#dc3912`,pointBackgroundColor:`#dc3912`,borderWidth:2,pointRadius:4,data:[{x:3,y:0},{x:3,y:100}],yAxisID:`y2`}]},options:{direction:`vertical`,axes:{x:[{label:`Duration (TempSim long) [d]`,position:`bottom`}],y:[{label:`Probability`},{label:`Percentage [%]`}]},annotations:{annotationsData:[{annotationAxis:`y2`,color:`darkgrey`,value:16},{displayDragCoordinates:!1,color:`#ff9900`,label:`P16`,dragAxis:`y`,enableDrag:!0,resizable:!1,type:`box`,xMax:3,xMin:3,yMax:17,yMin:15,yScaleID:`y2`},{annotationAxis:`y2`,color:`darkgrey`,value:66},{displayDragCoordinates:!1,color:`#109618`,label:`P66`,dragAxis:`y`,enableDrag:!0,resizable:!1,type:`box`,xMax:3,xMin:3,yMax:67,yMin:65,yScaleID:`y2`},{annotationAxis:`y2`,color:`darkgrey`,value:78},{displayDragCoordinates:!1,color:`#990099`,label:`P78`,dragAxis:`y`,enableDrag:!0,resizable:!1,type:`box`,xMax:3,xMin:3,yMax:79,yMin:77,yScaleID:`y2`},{annotationAxis:`y2`,color:`darkgrey`,value:90},{displayDragCoordinates:!1,color:`#0099c6`,label:`P90`,dragAxis:`y`,enableDrag:!0,resizable:!1,type:`box`,xMax:3,xMin:3,yMax:91,yMin:89,yScaleID:`y2`}],enableDragAnnotation:!0,showAnnotations:!0},additionalAxesOptions:{range:{x:{min:3}},chartScaleType:`linear`,reverse:!1},graph:{showMinorGridlines:!0},chartStyling:{height:`100%`},chartOptions:{showPoints:!1,enableDragAnnotation:!0}}}}),g=()=>(0,d.jsx)(c,{chart:u}),_=()=>{let[e,t]=(0,l.useState)(f),[n,i]=(0,l.useState)(0),[a,o]=(0,l.useState)(!1),[u,p]=(0,l.useState)(!0),[m,h]=(0,l.useState)(!1),[g,_]=(0,l.useState)(!0),[v,y]=(0,l.useState)(`linear`),[b,x]=(0,l.useState)(!1),S=(0,l.useMemo)(()=>({title:`Stress Tester`,axes:{x:[{label:`X Axis`}],y:[{label:`Y Axis`}]},chartOptions:{enableDragAnnotation:!0},annotations:{showAnnotations:!0,enableDragAnnotation:!0,annotationsData:[{enableDrag:!0,type:`box`,xMin:3.5,xMax:4,yMin:5,yMax:10,color:`rgba(255, 0, 0, 0.3)`,label:`DRAG ME!`},{type:`point`,enableDrag:!0,xValue:1,yValue:10,radius:2,color:`red`,label:`Draggable Point`,labelConfig:{font:`bold 8px ${r}`,color:`rgba(0,0,0,0.7)`}}]},chartStyling:{height:`100%`,squareAspectRatio:g},additionalAxesOptions:{chartScaleType:v},legend:{display:!1}}),[e,g,v]),C=(0,l.useMemo)(()=>({data:{datasets:e},options:S}),[e,S]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`,marginBottom:16},children:[(0,d.jsx)(s,{label:`Reset to Initial State`,colored:!0,onClick:()=>{t(f),i(e=>e+1),p(!0),x(!1)}}),(0,d.jsx)(s,{label:`Async Dataset + Unmount`,onClick:()=>{h(!0);let e=[];for(let n=0;n<50;n++)setTimeout(()=>{e.push({label:`DS ${n+1}`,data:[{x:n,y:Math.random()*100},{x:n+1,y:Math.random()*100}],borderColor:`hsl(${360/50*n}, 100%, 50%)`}),t([...e]),n===15&&(console.warn(`Forcing unmount mid-update`),p(!1)),n===25&&(console.warn(`Remounting chart`),p(!0),i(e=>e+1)),n===49&&(console.log(`Async injection complete`),h(!1))},n*40)},disabled:m}),(0,d.jsx)(s,{label:`Set Invalid Dataset`,onClick:()=>{t([{label:`Broken Dataset`,borderColor:`red`}])}}),(0,d.jsx)(s,{label:`Set Empty Dataset`,onClick:()=>{t([])}}),(0,d.jsx)(s,{label:`Mixed Data Formats`,onClick:()=>{t([{label:`X/Y Points`,data:[{x:0,y:0},{x:1,y:1}],borderColor:`green`},{label:`Y Only Array`,data:[2,4,6],borderColor:`blue`}])}}),(0,d.jsx)(s,{label:`Bad Axis Ref`,onClick:()=>{t([{label:`Bad Y Axis Ref`,yAxisID:`y-missing`,data:[{x:1,y:1},{x:2,y:2}],borderColor:`purple`}])}}),(0,d.jsx)(s,{label:`Toggle size`,onClick:()=>o(!a)}),(0,d.jsx)(s,{label:`Toggle Axis Type`,onClick:()=>{y(e=>e===`linear`?`logarithmic`:`linear`)}}),(0,d.jsx)(s,{label:`Toggle Aspect Ratio`,onClick:()=>{_(e=>!e)}}),(0,d.jsx)(s,{label:`Spam Re-renders`,onClick:()=>{let e=0,t=setInterval(()=>{i(e=>e+1),e++,e===100&&clearInterval(t)},30)}}),(0,d.jsx)(s,{label:u?`Unmount Chart`:`Remount Chart`,onClick:()=>p(e=>!e)}),(0,d.jsx)(s,{label:`Manual Re-render`,onClick:()=>i(e=>e+1)}),(0,d.jsx)(s,{label:`Empty Dataset`,onClick:()=>t([])}),(0,d.jsx)(s,{label:`Add 5k Points Slowly`,onClick:()=>{t([{label:`Big 5k Points`,data:Array.from({length:5e3},(e,t)=>({x:t,y:Math.sin(t/100)*100})),borderColor:`orange`}])}}),(0,d.jsx)(s,{label:`Dataset With Invalid Point`,onClick:()=>{t([{label:`Corrupt Point Dataset`,data:[{x:0,y:10},{x:1},{y:20},null,void 0,`bad-value`,{x:5,y:50}],borderColor:`red`}])}}),(0,d.jsx)(s,{label:`Malformed Dataset Combo`,onClick:()=>{t([{label:`Valid A`,data:[{x:0,y:1},{x:1,y:2}],borderColor:`blue`},{label:`Corrupt`,data:`not-an-array`,borderColor:`red`},{label:`Valid B`,data:[{x:0,y:3},{x:1,y:4}],borderColor:`green`}])}}),(0,d.jsx)(s,{label:`Cycle Big Load (Async)`,onClick:()=>{let e=[];for(let t=0;t<4;t++){let n=Array.from({length:3e3},(e,t)=>({x:t,y:Math.random()*100}));e.push({label:`Stream DS ${t+1}`,data:n,borderColor:`hsl(${t*90}, 100%, 50%)`})}let n=0,r=setInterval(()=>{t(e.slice(0,n+1)),n++,n===e.length&&clearInterval(r)},500)}}),(0,d.jsx)(s,{label:`Timed Unmount During Drag`,onClick:()=>{x(!0),p(!0),setTimeout(()=>{p(!1),x(!1)},5e3)},disabled:b})]}),b&&(0,d.jsx)(`span`,{style:{color:`crimson`,fontWeight:`bold`},children:`⏱ Unmounting in 5s – start dragging!`}),(0,d.jsx)(`div`,{style:{height:a?300:null,width:a?300:null,padding:`var(--padding)`,overflow:`auto`},children:u?(0,d.jsx)(c,{chart:C},n):(0,d.jsx)(`div`,{style:{padding:40,textAlign:`center`},children:`Chart unmounted`})})]})},v=()=>{let[e,t]=(0,l.useState)([{type:`point`,labelOffsetPx:50,xValue:2,yValue:100,radius:4,color:`rgba(128, 128, 128, 1)`,pointStyle:`triangle`,label:`annotation 1`,labelConfig:{position:`right`,color:`rgba(128, 128, 128, 1)`,callout:{enabled:!0}}}]),[n,r]=(0,l.useState)(`annotation 1`),i=[{label:`16/9-C-16`,lineTension:0,borderColor:`#e25112`,pointBackgroundColor:`#e25112`,pointHoverRadius:0,pointHitRadius:0,pointRadius:2,pointBorderWidth:2,borderWidth:2,fill:!1,data:[{y:0,x:0,label:[]},{y:30,x:0,label:[]},{y:60,x:0,label:[]},{y:90,x:0,label:[]},{y:120,x:0,label:[]},{y:150,x:0,label:[]},{y:180,x:0,label:[]},{y:210,x:0,label:[]},{y:240,x:0,label:[]},{y:270,x:0,label:[]},{y:300,x:0,label:[]},{y:330,x:0,label:[]},{y:360,x:0,label:[]},{y:390,x:0,label:[]},{y:400,x:0,label:[]},{y:419.9982,x:.1453,label:[]},{y:449.9718,x:.9078,label:[]},{y:479.8845,x:2.3231,label:[]},{y:509.6999,x:4.3892,label:[]},{y:539.3817,x:7.1038,label:[]},{y:568.8936,x:10.4635,label:[]},{y:569.3544,x:10.5213,label:[]},{y:598.3054,x:14.1545,label:[]},{y:627.7172,x:17.8456,label:[]},{y:657.1289,x:21.5367,label:[]},{y:686.5407,x:25.2278,label:[]},{y:715.9525,x:28.9188,label:[]},{y:745.3643,x:32.6099,label:[]},{y:804.1878,x:39.992,label:[]},{y:833.5996,x:43.6831,label:[]},{y:863.0113,x:47.3742,label:[]},{y:892.4231,x:51.0653,label:[]},{y:921.8349,x:54.7563,label:[]},{y:951.2467,x:58.4474,label:[]},{y:980.6584,x:62.1385,label:[]},{y:1010.0674,x:65.7954,label:[]},{y:1039.4763,x:69.4299,label:[]},{y:1068.8881,x:73.0986,label:[]},{y:1098.2999,x:76.7897,label:[]},{y:1127.7116,x:80.4807,label:[]},{y:1157.1234,x:84.1718,label:[]},{y:1186.5352,x:87.8629,label:[]},{y:1215.947,x:91.554,label:[]},{y:1245.3587,x:95.245,label:[]},{y:1274.7705,x:98.9361,label:[]},{y:1304.1823,x:102.6272,label:[]},{y:1333.5941,x:106.3183,label:[]},{y:1363.0058,x:110.0093,label:[]},{y:1392.4176,x:113.7004,label:[]},{y:1421.8294,x:117.3915,label:[]},{y:1451.2411,x:121.0825,label:[]},{y:1480.6529,x:124.7736,label:[]},{y:1510.0647,x:128.4647,label:[]},{y:1539.4765,x:132.1558,label:[]},{y:1568.8882,x:135.8468,label:[]},{y:1598.3,x:139.5379,label:[]},{y:1627.7118,x:143.229,label:[]},{y:1657.1236,x:146.9201,label:[]},{y:1686.5353,x:150.6111,label:[]},{y:1715.9471,x:154.3022,label:[]},{y:1745.3589,x:157.9933,label:[]},{y:1774.7706,x:161.6843,label:[]},{y:1804.1824,x:165.3754,label:[]},{y:1833.5942,x:169.0665,label:[]},{y:1863.006,x:172.7576,label:[]},{y:1892.4177,x:176.4486,label:[]},{y:1903.9079,x:177.8906,label:[]},{y:1921.8305,x:180.284,label:[]},{y:1951.2325,x:184.8347,label:[]},{y:1980.5894,x:190.1546,label:[]},{y:2009.8654,x:196.2372,label:[]},{y:2039.0247,x:203.0751,label:[]},{y:2068.0319,x:210.6599,label:[]},{y:2096.8516,x:218.9825,label:[]},{y:2125.4487,x:228.0327,label:[]},{y:2153.7883,x:237.7994,label:[]},{y:2181.836,x:248.2708,label:[]},{y:2209.5576,x:259.434,label:[]},{y:2236.9192,x:271.2756,label:[]},{y:2263.8876,x:283.781,label:[]},{y:2290.4299,x:296.935,label:[]},{y:2316.5138,x:310.7217,label:[]},{y:2342.1074,x:325.1241,label:[]},{y:2367.1796,x:340.1249,label:[]},{y:2391.6999,x:355.7056,label:[]},{y:2415.6384,x:371.8473,label:[]},{y:2438.9658,x:388.5303,label:[]},{y:2461.6539,x:405.7344,label:[]},{y:2483.6749,x:423.4384,label:[]},{y:2505.0021,x:441.621,label:[]},{y:2525.6093,x:460.2599,label:[]},{y:2545.4716,x:479.3325,label:[]},{y:2550.4401,x:484.2884,label:[]},{y:2564.5931,x:499.1889,label:[]},{y:2582.9606,x:520.6713,label:[]},{y:2600.4389,x:543.6622,label:[]},{y:2616.8951,x:567.9865,label:[]},{y:2632.2039,x:593.4591,label:[]},{y:2646.2488,x:619.8861,label:[]},{y:2657.1619,x:643.0591,label:[]},{y:2658.9386,x:647.0604,label:[]},{y:2671.1078,x:674.4667,label:[]},{y:2683.277,x:701.8731,label:[]},{y:2695.4463,x:729.2794,label:[]},{y:2707.6155,x:756.6858,label:[]},{y:2719.7847,x:784.0921,label:[]},{y:2731.954,x:811.4984,label:[]},{y:2744.1232,x:838.9048,label:[]},{y:2756.2924,x:866.3111,label:[]},{y:2768.4617,x:893.7174,label:[]},{y:2780.6309,x:921.1238,label:[]},{y:2792.8001,x:948.5301,label:[]},{y:2804.9693,x:975.9365,label:[]},{y:2817.1386,x:1003.3428,label:[]},{y:2829.3078,x:1030.7491,label:[]},{y:2841.477,x:1058.1555,label:[]},{y:2853.6463,x:1085.5618,label:[]},{y:2865.8155,x:1112.9682,label:[]},{y:2877.9847,x:1140.3745,label:[]},{y:2890.1539,x:1167.7808,label:[]},{y:2902.3232,x:1195.1872,label:[]},{y:2914.4924,x:1222.5935,label:[]},{y:2926.6616,x:1249.9999,label:[]},{y:2938.8309,x:1277.4062,label:[]},{y:2951.0001,x:1304.8125,label:[]},{y:2963.1693,x:1332.2189,label:[]},{y:2975.3386,x:1359.6252,label:[]},{y:2987.5078,x:1387.0316,label:[]},{y:2999.677,x:1414.4379,label:[]},{y:3011.8462,x:1441.8442,label:[]},{y:3024.0155,x:1469.2506,label:[]},{y:3036.1847,x:1496.6569,label:[]},{y:3048.3539,x:1524.0632,label:[]},{y:3060.5232,x:1551.4696,label:[]},{y:3072.6924,x:1578.8759,label:[]},{y:3084.8616,x:1606.2823,label:[]},{y:3097.0309,x:1633.6886,label:[]},{y:3109.2001,x:1661.0949,label:[]},{y:3133.5385,x:1715.9076,label:[]},{y:3145.7078,x:1743.314,label:[]},{y:3157.877,x:1770.7203,label:[]},{y:3170.0462,x:1798.1266,label:[]},{y:3182.1915,x:1825.5436,label:[]},{y:3206.4821,x:1880.3775,label:[]},{y:3218.6513,x:1907.7838,label:[]},{y:3242.9898,x:1962.5965,label:[]},{y:3303.8876,x:2098.6264,label:[]},{y:3316.0671,x:2125.8324,label:[]},{y:3328.2364,x:2153.2388,label:[]},{y:3340.4056,x:2180.6451,label:[]},{y:3352.5748,x:2208.0514,label:[]},{y:3364.744,x:2235.4578,label:[]},{y:3376.9133,x:2262.8641,label:[]},{y:3389.0825,x:2290.2705,label:[]},{y:3401.2517,x:2317.6768,label:[]},{y:3413.421,x:2345.0831,label:[]},{y:3425.5902,x:2372.4895,label:[]},{y:3437.7594,x:2399.8958,label:[]},{y:3449.9287,x:2427.3022,label:[]},{y:3462.0979,x:2454.7085,label:[]},{y:3472.1213,x:2477.2822,label:[]},{y:3474.2312,x:2482.1309,label:[]},{y:3484.8166,x:2510.1876,label:[]},{y:3493.0003,x:2539.0391,label:[]},{y:3498.72,x:2568.4657,label:[]},{y:3499.9842,x:2577.6599,label:[]},{y:3502.5335,x:2598.189,label:[]},{y:3506.2262,x:2627.9269,label:[]},{y:3509.919,x:2657.6648,label:[]},{y:3513.6118,x:2687.4026,label:[]},{y:3517.3045,x:2717.1405,label:[]},{y:3520.9973,x:2746.8784,label:[]},{y:3524.6901,x:2776.6163,label:[]},{y:3528.3828,x:2806.3542,label:[]},{y:3532.0756,x:2836.0921,label:[]},{y:3535.7684,x:2865.83,label:[]},{y:3539.4612,x:2895.5679,label:[]},{y:3543.1539,x:2925.3058,label:[]},{y:3546.8467,x:2955.0436,label:[]},{y:3550.5395,x:2984.7815,label:[]},{y:3554.2322,x:3014.5194,label:[]},{y:3557.925,x:3044.2573,label:[]},{y:3561.6178,x:3073.9952,label:[]},{y:3565.3105,x:3103.7331,label:[]},{y:3569.0033,x:3133.471,label:[]},{y:3572.6961,x:3163.2089,label:[]},{y:3576.3888,x:3192.9467,label:[]},{y:3580.0816,x:3222.6846,label:[]},{y:3583.7744,x:3252.4225,label:[]},{y:3587.4671,x:3282.1604,label:[]},{y:3591.1599,x:3311.8983,label:[]},{y:3594.8527,x:3341.6362,label:[]},{y:3598.5455,x:3371.3741,label:[]},{y:3599.9856,x:3382.9719,label:[]},{y:3602.2382,x:3401.112,label:[]},{y:3605.931,x:3430.8499,label:[]},{y:3609.6238,x:3460.5877,label:[]},{y:3613.3165,x:3490.3256,label:[]},{y:3617.0093,x:3520.0635,label:[]},{y:3620.7021,x:3549.8014,label:[]},{y:3624.3948,x:3579.5393,label:[]},{y:3628.0876,x:3609.2772,label:[]},{y:3631.7804,x:3639.0151,label:[]},{y:3635.4731,x:3668.753,label:[]},{y:3639.1659,x:3698.4909,label:[]},{y:3642.8587,x:3728.2287,label:[]},{y:3646.5514,x:3757.9666,label:[]},{y:3650.2442,x:3787.7045,label:[]},{y:3653.937,x:3817.4424,label:[]},{y:3657.6298,x:3847.1803,label:[]},{y:3661.3225,x:3876.9182,label:[]},{y:3665.0153,x:3906.6561,label:[]},{y:3668.7081,x:3936.394,label:[]},{y:3672.4008,x:3966.1318,label:[]},{y:3676.0936,x:3995.8697,label:[]},{y:3679.7864,x:4025.6076,label:[]},{y:3683.4791,x:4055.3455,label:[]},{y:3687.1719,x:4085.0834,label:[]},{y:3690.8647,x:4114.8213,label:[]},{y:3694.5574,x:4144.5592,label:[]},{y:3698.2502,x:4174.2971,label:[]},{y:3701.943,x:4204.035,label:[]},{y:3705.6357,x:4233.7728,label:[]},{y:3709.3285,x:4263.5107,label:[]},{y:3713.0213,x:4293.2486,label:[]},{y:3716.7141,x:4322.9865,label:[]},{y:3720.4068,x:4352.7244,label:[]},{y:3724.0996,x:4382.4623,label:[]},{y:3727.7924,x:4412.2002,label:[]},{y:3731.4851,x:4441.9381,label:[]},{y:3735.1779,x:4471.676,label:[]},{y:3738.8707,x:4501.4138,label:[]},{y:3742.5634,x:4531.1517,label:[]},{y:3746.2562,x:4560.8896,label:[]},{y:3749.949,x:4590.6275,label:[]},{y:3753.6417,x:4620.3654,label:[]},{y:3757.3345,x:4650.1033,label:[]},{y:3761.0273,x:4679.8412,label:[]},{y:3764.72,x:4709.5791,label:[]},{y:3768.4128,x:4739.3169,label:[]},{y:3772.1056,x:4769.0548,label:[]},{y:3775.7984,x:4798.7927,label:[]},{y:3779.4911,x:4828.5306,label:[]},{y:3783.1839,x:4858.2685,label:[]},{y:3786.8767,x:4888.0064,label:[]},{y:3790.5694,x:4917.7443,label:[]},{y:3794.2622,x:4947.4822,label:[]},{y:3797.955,x:4977.2201,label:[]},{y:3801.6477,x:5006.9579,label:[]},{y:3805.3405,x:5036.6958,label:[]},{y:3809.0333,x:5066.4337,label:[]},{y:3809.7189,x:5067.0389,label:[]},{y:3810.7189,x:5067.0389,label:[]}],wellOffset:[-3.4,.11]}];return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:16,alignItems:`center`},children:[(0,d.jsx)(`span`,{children:`Label for first annotation:`}),(0,d.jsx)(`input`,{value:n,onChange:e=>{let n=e.target.value;r(n),t(e=>e.map((e,t)=>t===0?{...e,label:n}:e))},style:{padding:4,minWidth:180}}),(0,d.jsx)(`button`,{type:`button`,onClick:()=>{t(e=>{let t=e.length,n=i[0].data,r={type:`point`,labelOffsetPx:50,xValue:n[t]?.x??n[n.length-1].x,yValue:100+t*10,radius:4,color:`rgba(128, 128, 128, 1)`,pointStyle:`triangle`,label:`annotation ${t+1}`,labelConfig:{position:`right`,color:`rgba(128, 128, 128, 1)`,callout:{enabled:!0}}};return[...e,r]})},children:`Add annotation`})]}),(0,d.jsx)(c,{chart:{...p,data:{datasets:i},options:{...p.options,legend:{display:!1},annotations:{showAnnotations:!0,enableDragAnnotation:!0,enableCalloutAnnotation:!0,annotationsData:e}}}})]})},y=()=>{let[e,t]=(0,l.useState)(!1),[n,r]=(0,l.useState)(!1),s=[{label:`Label 1`,depth:1e3},{label:`Label 2`,depth:1360},{label:`Label 3`,depth:1374},{label:`Label 4`,depth:3600},{label:`Label 5`,depth:4800},{label:`Label 6`,depth:5300},{label:`Label 7`,depth:5590},{label:`Label 8`,depth:5612},{label:`Label 9`,depth:5628}],u=[{label:`Label 1`,depth:1120},{label:`Label 2`,depth:1490},{label:`Label 3`,depth:1508},{label:`Label 4`,depth:3420},{label:`Label 5`,depth:4238},{label:`Label 6`,depth:5050},{label:`Label 7`,depth:5068},{label:`Label 8`,depth:5350},{label:`Label 9`,depth:5536}],f=(t,r)=>e?{position:t,xAdjust:r,yAdjust:0,color:`rgba(15, 15, 15, 1)`,callout:{enabled:!0,onlyWhenOverlapping:n}}:{position:t,xAdjust:r,yAdjust:0,color:`rgba(15, 15, 15, 1)`};return(0,d.jsxs)(o,{gap:!0,children:[(0,d.jsx)(i,{children:(0,d.jsx)(a,{label:`Use callout: ${e?`on`:`off`}`,checked:e,onChange:()=>t(e=>!e)})}),(0,d.jsx)(i,{children:(0,d.jsx)(a,{label:`Only when overlapping: ${n?`on`:`off`}`,checked:n,onChange:()=>r(e=>!e),disabled:!e})}),(0,d.jsx)(c,{chart:{data:{datasets:[{label:`Pore pressure`,data:[{x:6,y:1e3},{x:6.8,y:2e3},{x:7.3,y:3500},{x:7.7,y:4700},{x:8.2,y:5600}]}]},options:{title:`Playground: left/right box annotation series`,chartStyling:{height:560},legend:{display:!1},axes:{x:[{label:`Pressure Gradient [ppg]`}],y:[{label:`Depth TVD RKB [ft]`}]},additionalAxesOptions:{reverse:!0,range:{x:{min:.9,max:11},y:{min:900,max:6200}}},annotations:{showAnnotations:!0,enableCalloutAnnotation:e,annotationsData:[...s.map(({label:e,depth:t})=>({type:`box`,yMin:t-22,yMax:t+22,color:`rgba(35, 117, 255, 0.16)`,adjustScaleRange:!1,borderColor:`rgba(35, 117, 255, 0.55)`,borderWidth:1,label:`L: ${e}`,labelConfig:f(`top-left`,14)})),...u.map(({label:e,depth:t})=>({type:`box`,yMin:t-22,yMax:t+22,color:`rgba(255, 138, 0, 0.18)`,adjustScaleRange:!1,borderColor:`rgba(255, 138, 0, 0.55)`,borderWidth:1,label:`R: ${e}`,labelConfig:f(`top-right`,-14)}))]}}}})]})},b=()=>{let[e,t]=(0,l.useState)(!1),n=(0,l.useMemo)(()=>[{annotationAxis:`y`,label:`Annotation 1`,value:50},{annotationAxis:`x`,label:`Annotation 2`,value:10}],[]),r=(0,l.useMemo)(()=>({...p,options:{...p.options,title:`Repro: toggle controlAnnotation (with legend)`,legend:{display:!0},annotations:{controlAnnotation:e,showAnnotations:!0,annotationsData:n}}}),[e,n]);return(0,d.jsxs)(o,{gap:!0,children:[(0,d.jsx)(i,{children:(0,d.jsx)(a,{label:`controlAnnotation: ${e?`true`:`false`}`,value:e,onChange:()=>t(e=>!e)})}),(0,d.jsx)(c,{chart:r})]})};h.__docgenInfo={description:``,methods:[],displayName:`PartialRangeWithSimilarValues`},g.__docgenInfo={description:``,methods:[],displayName:`closeToValueInDifferentAxes`},_.__docgenInfo={description:``,methods:[],displayName:`StressTest`},v.__docgenInfo={description:``,methods:[],displayName:`DynamicCalloutAnnotations`},y.__docgenInfo={description:``,methods:[],displayName:`OverlappingBoxAnnotationLabels`},b.__docgenInfo={description:``,methods:[],displayName:`Test_ControlAnnotation_WithLegend`},h.parameters={...h.parameters,docs:{...h.parameters?.docs,source:{originalSource:`() => {
2
- return <LineChart chart={{
3
- data: {
4
- datasets: [{
5
- label: 'Duration %',
6
- lineTension: '0',
7
- pointHitRadius: 10,
8
- borderColor: '#dc3912',
9
- pointBackgroundColor: '#dc3912',
10
- borderWidth: 2,
11
- pointRadius: 4,
12
- data: [{
13
- x: 3,
14
- y: 0
15
- }, {
16
- x: 3,
17
- y: 100
18
- }],
19
- yAxisID: 'y2'
20
- }]
21
- },
22
- options: {
23
- direction: 'vertical',
24
- axes: {
25
- x: [{
26
- label: 'Duration (TempSim long) [d]',
27
- position: 'bottom'
28
- }],
29
- y: [{
30
- label: 'Probability'
31
- }, {
32
- label: 'Percentage [%]'
33
- }]
34
- },
35
- annotations: {
36
- annotationsData: [{
37
- annotationAxis: 'y2',
38
- color: 'darkgrey',
39
- value: 16
40
- }, {
41
- displayDragCoordinates: false,
42
- color: '#ff9900',
43
- label: 'P16',
44
- dragAxis: 'y',
45
- enableDrag: true,
46
- resizable: false,
47
- type: 'box',
48
- xMax: 3,
49
- xMin: 3,
50
- yMax: 17,
51
- yMin: 15,
52
- yScaleID: 'y2'
53
- }, {
54
- annotationAxis: 'y2',
55
- color: 'darkgrey',
56
- value: 66
57
- }, {
58
- displayDragCoordinates: false,
59
- color: '#109618',
60
- label: 'P66',
61
- dragAxis: 'y',
62
- enableDrag: true,
63
- resizable: false,
64
- type: 'box',
65
- xMax: 3,
66
- xMin: 3,
67
- yMax: 67,
68
- yMin: 65,
69
- yScaleID: 'y2'
70
- }, {
71
- annotationAxis: 'y2',
72
- color: 'darkgrey',
73
- value: 78
74
- }, {
75
- displayDragCoordinates: false,
76
- color: '#990099',
77
- label: 'P78',
78
- dragAxis: 'y',
79
- enableDrag: true,
80
- resizable: false,
81
- type: 'box',
82
- xMax: 3,
83
- xMin: 3,
84
- yMax: 79,
85
- yMin: 77,
86
- yScaleID: 'y2'
87
- }, {
88
- annotationAxis: 'y2',
89
- color: 'darkgrey',
90
- value: 90
91
- }, {
92
- displayDragCoordinates: false,
93
- color: '#0099c6',
94
- label: 'P90',
95
- dragAxis: 'y',
96
- enableDrag: true,
97
- resizable: false,
98
- type: 'box',
99
- xMax: 3,
100
- xMin: 3,
101
- yMax: 91,
102
- yMin: 89,
103
- yScaleID: 'y2'
104
- }],
105
- enableDragAnnotation: true,
106
- showAnnotations: true
107
- },
108
- additionalAxesOptions: {
109
- range: {
110
- x: {
111
- min: 3
112
- }
113
- },
114
- chartScaleType: 'linear',
115
- reverse: false
116
- },
117
- graph: {
118
- showMinorGridlines: true
119
- },
120
- chartStyling: {
121
- height: '100%'
122
- },
123
- chartOptions: {
124
- showPoints: false,
125
- enableDragAnnotation: true
126
- }
127
- }
128
- }} />;
129
- }`,...h.parameters?.docs?.source}}},g.parameters={...g.parameters,docs:{...g.parameters?.docs,source:{originalSource:`() => {
130
- return <LineChart chart={planView} />;
131
- }`,...g.parameters?.docs?.source}}},_.parameters={..._.parameters,docs:{..._.parameters?.docs,source:{originalSource:`() => {
132
- const [datasets, setDatasets] = useState(basicDS);
133
- const [chartKey, setChartKey] = useState(0);
134
- const [isSmall, setIsSmall] = useState(false);
135
- const [showChart, setShowChart] = useState(true);
136
- const [loading, setLoading] = useState(false);
137
- const [aspectRatio, setAspectRatio] = useState(true);
138
- const [xAxisType, setXAxisType] = useState('linear');
139
- const [timerRunning, setTimerRunning] = useState(false);
140
- const baseOptions = useMemo(() => ({
141
- title: 'Stress Tester',
142
- axes: {
143
- x: [{
144
- label: 'X Axis'
145
- }],
146
- y: [{
147
- label: 'Y Axis'
148
- }]
149
- },
150
- chartOptions: {
151
- enableDragAnnotation: true
152
- },
153
- annotations: {
154
- showAnnotations: true,
155
- enableDragAnnotation: true,
156
- annotationsData: [{
157
- enableDrag: true,
158
- type: 'box',
159
- xMin: 3.5,
160
- xMax: 4,
161
- yMin: 5,
162
- yMax: 10,
163
- color: 'rgba(255, 0, 0, 0.3)',
164
- label: 'DRAG ME!'
165
- }, {
166
- type: 'point',
167
- enableDrag: true,
168
- xValue: 1,
169
- yValue: 10,
170
- radius: DEFAULT_POINT_RADIUS,
171
- color: 'red',
172
- label: 'Draggable Point',
173
- labelConfig: {
174
- font: \`bold 8px \${DEFAULT_FONT_FAMILY}\`,
175
- color: 'rgba(0,0,0,0.7)'
176
- }
177
- }]
178
- },
179
- chartStyling: {
180
- height: '100%',
181
- squareAspectRatio: aspectRatio
182
- },
183
- additionalAxesOptions: {
184
- chartScaleType: xAxisType
185
- },
186
- legend: {
187
- display: false
188
- }
189
- }), [datasets, aspectRatio, xAxisType]);
190
- const chartConfig = useMemo(() => ({
191
- data: {
192
- datasets
193
- },
194
- options: baseOptions
195
- }), [datasets, baseOptions]);
196
- const startTimedUnmount = () => {
197
- setTimerRunning(true);
198
- setShowChart(true);
199
- setTimeout(() => {
200
- setShowChart(false);
201
- setTimerRunning(false);
202
- }, 5000);
203
- };
204
- const resetChart = () => {
205
- setDatasets(basicDS);
206
- setChartKey(k => k + 1);
207
- setShowChart(true);
208
- setTimerRunning(false);
209
- };
210
- const injectDatasetsAsync = () => {
211
- setLoading(true);
212
- const buffer = [];
213
- const total = 50;
214
- const delay = 40;
215
- for (let i = 0; i < total; i++) {
216
- setTimeout(() => {
217
- buffer.push({
218
- label: \`DS \${i + 1}\`,
219
- data: [{
220
- x: i,
221
- y: Math.random() * 100
222
- }, {
223
- x: i + 1,
224
- y: Math.random() * 100
225
- }],
226
- borderColor: \`hsl(\${i * (360 / total)}, 100%, 50%)\`
227
- });
228
- setDatasets([...buffer]);
229
- if (i === 15) {
230
- console.warn('Forcing unmount mid-update');
231
- setShowChart(false);
232
- }
233
- if (i === 25) {
234
- console.warn('Remounting chart');
235
- setShowChart(true);
236
- setChartKey(prev => prev + 1);
237
- }
238
- if (i === total - 1) {
239
- console.log('Async injection complete');
240
- setLoading(false);
241
- }
242
- }, i * delay);
243
- }
244
- };
245
- const setInvalidDataset = () => {
246
- setDatasets([{
247
- label: 'Broken Dataset',
248
- borderColor: 'red'
249
- }]);
250
- };
251
- const setEmptyDataset = () => {
252
- setDatasets([]);
253
- };
254
- const setMixedDataTypes = () => {
255
- setDatasets([{
256
- label: 'X/Y Points',
257
- data: [{
258
- x: 0,
259
- y: 0
260
- }, {
261
- x: 1,
262
- y: 1
263
- }],
264
- borderColor: 'green'
265
- }, {
266
- label: 'Y Only Array',
267
- data: [2, 4, 6],
268
- borderColor: 'blue'
269
- }]);
270
- };
271
- const setMissingAxisRef = () => {
272
- setDatasets([{
273
- label: 'Bad Y Axis Ref',
274
- yAxisID: 'y-missing',
275
- data: [{
276
- x: 1,
277
- y: 1
278
- }, {
279
- x: 2,
280
- y: 2
281
- }],
282
- borderColor: 'purple'
283
- }]);
284
- };
285
- const addBigDataset = () => {
286
- const data = Array.from({
287
- length: 5000
288
- }, (_, i) => ({
289
- x: i,
290
- y: Math.sin(i / 100) * 100
291
- }));
292
- setDatasets([{
293
- label: 'Big 5k Points',
294
- data,
295
- borderColor: 'orange'
296
- }]);
297
- };
298
- const addDatasetWithInvalidPoint = () => {
299
- setDatasets([{
300
- label: 'Corrupt Point Dataset',
301
- data: [{
302
- x: 0,
303
- y: 10
304
- }, {
305
- x: 1
306
- },
307
- // missing y
308
- {
309
- y: 20
310
- },
311
- // missing x
312
- null, undefined, 'bad-value', {
313
- x: 5,
314
- y: 50
315
- }],
316
- borderColor: 'red'
317
- }]);
318
- };
319
- const addMalformedDatasetCombo = () => {
320
- setDatasets([{
321
- label: 'Valid A',
322
- data: [{
323
- x: 0,
324
- y: 1
325
- }, {
326
- x: 1,
327
- y: 2
328
- }],
329
- borderColor: 'blue'
330
- }, {
331
- label: 'Corrupt',
332
- data: 'not-an-array',
333
- borderColor: 'red'
334
- }, {
335
- label: 'Valid B',
336
- data: [{
337
- x: 0,
338
- y: 3
339
- }, {
340
- x: 1,
341
- y: 4
342
- }],
343
- borderColor: 'green'
344
- }]);
345
- };
346
- const streamLargeData = () => {
347
- const allDS = [];
348
- for (let j = 0; j < 4; j++) {
349
- const data = Array.from({
350
- length: 3000
351
- }, (_, i) => ({
352
- x: i,
353
- y: Math.random() * 100
354
- }));
355
- allDS.push({
356
- label: \`Stream DS \${j + 1}\`,
357
- data,
358
- borderColor: \`hsl(\${j * 90}, 100%, 50%)\`
359
- });
360
- }
361
- let step = 0;
362
- const interval = setInterval(() => {
363
- setDatasets(allDS.slice(0, step + 1));
364
- step++;
365
- if (step === allDS.length) clearInterval(interval);
366
- }, 500);
367
- };
368
- const cycleXAxisType = () => {
369
- setXAxisType(prev => prev === 'linear' ? 'logarithmic' : 'linear');
370
- };
371
- const toggleAspectRatio = () => {
372
- setAspectRatio(prev => !prev);
373
- };
374
- const spamReRenders = () => {
375
- let count = 0;
376
- const interval = setInterval(() => {
377
- setChartKey(prev => prev + 1);
378
- count++;
379
- if (count === 100) clearInterval(interval);
380
- }, 30);
381
- };
382
- return <>
383
- <div style={{
384
- display: 'flex',
385
- gap: 8,
386
- flexWrap: 'wrap',
387
- marginBottom: 16
388
- }}>
389
- <Button label="Reset to Initial State" colored onClick={resetChart} />
390
- <Button label="Async Dataset + Unmount" onClick={injectDatasetsAsync} disabled={loading} />
391
- <Button label="Set Invalid Dataset" onClick={setInvalidDataset} />
392
- <Button label="Set Empty Dataset" onClick={setEmptyDataset} />
393
- <Button label="Mixed Data Formats" onClick={setMixedDataTypes} />
394
- <Button label="Bad Axis Ref" onClick={setMissingAxisRef} />
395
- <Button label="Toggle size" onClick={() => setIsSmall(!isSmall)} />
396
- <Button label="Toggle Axis Type" onClick={cycleXAxisType} />
397
- <Button label="Toggle Aspect Ratio" onClick={toggleAspectRatio} />
398
- <Button label="Spam Re-renders" onClick={spamReRenders} />
399
- <Button label={showChart ? 'Unmount Chart' : 'Remount Chart'} onClick={() => setShowChart(s => !s)} />
400
- <Button label="Manual Re-render" onClick={() => setChartKey(k => k + 1)} />
401
- <Button label="Empty Dataset" onClick={() => setDatasets([])} />
402
- <Button label="Add 5k Points Slowly" onClick={addBigDataset} />
403
- <Button label="Dataset With Invalid Point" onClick={addDatasetWithInvalidPoint} />
404
- <Button label="Malformed Dataset Combo" onClick={addMalformedDatasetCombo} />
405
- <Button label="Cycle Big Load (Async)" onClick={streamLargeData} />
406
- <Button label="Timed Unmount During Drag" onClick={startTimedUnmount} disabled={timerRunning} />
407
- </div>
408
-
409
- {timerRunning && <span style={{
410
- color: 'crimson',
411
- fontWeight: 'bold'
412
- }}>
413
- ⏱ Unmounting in 5s – start dragging!
414
- </span>}
415
-
416
- <div style={{
417
- height: isSmall ? 300 : null,
418
- width: isSmall ? 300 : null,
419
- padding: 'var(--padding)',
420
- overflow: 'auto'
421
- }}>
422
- {showChart ? <LineChart key={chartKey} chart={chartConfig} /> : <div style={{
423
- padding: 40,
424
- textAlign: 'center'
425
- }}>
426
- Chart unmounted
427
- </div>}
428
- </div>
429
- </>;
430
- }`,..._.parameters?.docs?.source}}},v.parameters={...v.parameters,docs:{...v.parameters?.docs,source:{originalSource:`() => {
431
- const [annotations, setAnnotations] = useState([{
432
- type: 'point',
433
- labelOffsetPx: 50,
434
- xValue: 2,
435
- yValue: 100,
436
- radius: 4,
437
- color: 'rgba(128, 128, 128, 1)',
438
- pointStyle: 'triangle',
439
- label: 'annotation 1',
440
- labelConfig: {
441
- position: 'right',
442
- color: 'rgba(128, 128, 128, 1)',
443
- callout: {
444
- enabled: true
445
- }
446
- }
447
- }]);
448
- const [labelInput, setLabelInput] = useState('annotation 1');
449
- const dataset1 = [{
450
- label: '16/9-C-16',
451
- lineTension: 0,
452
- borderColor: '#e25112',
453
- pointBackgroundColor: '#e25112',
454
- pointHoverRadius: 0,
455
- pointHitRadius: 0,
456
- pointRadius: 2,
457
- pointBorderWidth: 2,
458
- borderWidth: 2,
459
- fill: false,
460
- data: [{
461
- y: 0,
462
- x: 0,
463
- label: []
464
- }, {
465
- y: 30,
466
- x: 0,
467
- label: []
468
- }, {
469
- y: 60,
470
- x: 0,
471
- label: []
472
- }, {
473
- y: 90,
474
- x: 0,
475
- label: []
476
- }, {
477
- y: 120,
478
- x: 0,
479
- label: []
480
- }, {
481
- y: 150,
482
- x: 0,
483
- label: []
484
- }, {
485
- y: 180,
486
- x: 0,
487
- label: []
488
- }, {
489
- y: 210,
490
- x: 0,
491
- label: []
492
- }, {
493
- y: 240,
494
- x: 0,
495
- label: []
496
- }, {
497
- y: 270,
498
- x: 0,
499
- label: []
500
- }, {
501
- y: 300,
502
- x: 0,
503
- label: []
504
- }, {
505
- y: 330,
506
- x: 0,
507
- label: []
508
- }, {
509
- y: 360,
510
- x: 0,
511
- label: []
512
- }, {
513
- y: 390,
514
- x: 0,
515
- label: []
516
- }, {
517
- y: 400,
518
- x: 0,
519
- label: []
520
- }, {
521
- y: 419.9982,
522
- x: 0.1453,
523
- label: []
524
- }, {
525
- y: 449.9718,
526
- x: 0.9078,
527
- label: []
528
- }, {
529
- y: 479.8845,
530
- x: 2.3231,
531
- label: []
532
- }, {
533
- y: 509.6999,
534
- x: 4.3892,
535
- label: []
536
- }, {
537
- y: 539.3817,
538
- x: 7.1038,
539
- label: []
540
- }, {
541
- y: 568.8936,
542
- x: 10.4635,
543
- label: []
544
- }, {
545
- y: 569.3544,
546
- x: 10.5213,
547
- label: []
548
- }, {
549
- y: 598.3054,
550
- x: 14.1545,
551
- label: []
552
- }, {
553
- y: 627.7172,
554
- x: 17.8456,
555
- label: []
556
- }, {
557
- y: 657.1289,
558
- x: 21.5367,
559
- label: []
560
- }, {
561
- y: 686.5407,
562
- x: 25.2278,
563
- label: []
564
- }, {
565
- y: 715.9525,
566
- x: 28.9188,
567
- label: []
568
- }, {
569
- y: 745.3643,
570
- x: 32.6099,
571
- label: []
572
- }, {
573
- y: 804.1878,
574
- x: 39.992,
575
- label: []
576
- }, {
577
- y: 833.5996,
578
- x: 43.6831,
579
- label: []
580
- }, {
581
- y: 863.0113,
582
- x: 47.3742,
583
- label: []
584
- }, {
585
- y: 892.4231,
586
- x: 51.0653,
587
- label: []
588
- }, {
589
- y: 921.8349,
590
- x: 54.7563,
591
- label: []
592
- }, {
593
- y: 951.2467,
594
- x: 58.4474,
595
- label: []
596
- }, {
597
- y: 980.6584,
598
- x: 62.1385,
599
- label: []
600
- }, {
601
- y: 1010.0674,
602
- x: 65.7954,
603
- label: []
604
- }, {
605
- y: 1039.4763,
606
- x: 69.4299,
607
- label: []
608
- }, {
609
- y: 1068.8881,
610
- x: 73.0986,
611
- label: []
612
- }, {
613
- y: 1098.2999,
614
- x: 76.7897,
615
- label: []
616
- }, {
617
- y: 1127.7116,
618
- x: 80.4807,
619
- label: []
620
- }, {
621
- y: 1157.1234,
622
- x: 84.1718,
623
- label: []
624
- }, {
625
- y: 1186.5352,
626
- x: 87.8629,
627
- label: []
628
- }, {
629
- y: 1215.947,
630
- x: 91.554,
631
- label: []
632
- }, {
633
- y: 1245.3587,
634
- x: 95.245,
635
- label: []
636
- }, {
637
- y: 1274.7705,
638
- x: 98.9361,
639
- label: []
640
- }, {
641
- y: 1304.1823,
642
- x: 102.6272,
643
- label: []
644
- }, {
645
- y: 1333.5941,
646
- x: 106.3183,
647
- label: []
648
- }, {
649
- y: 1363.0058,
650
- x: 110.0093,
651
- label: []
652
- }, {
653
- y: 1392.4176,
654
- x: 113.7004,
655
- label: []
656
- }, {
657
- y: 1421.8294,
658
- x: 117.3915,
659
- label: []
660
- }, {
661
- y: 1451.2411,
662
- x: 121.0825,
663
- label: []
664
- }, {
665
- y: 1480.6529,
666
- x: 124.7736,
667
- label: []
668
- }, {
669
- y: 1510.0647,
670
- x: 128.4647,
671
- label: []
672
- }, {
673
- y: 1539.4765,
674
- x: 132.1558,
675
- label: []
676
- }, {
677
- y: 1568.8882,
678
- x: 135.8468,
679
- label: []
680
- }, {
681
- y: 1598.3,
682
- x: 139.5379,
683
- label: []
684
- }, {
685
- y: 1627.7118,
686
- x: 143.229,
687
- label: []
688
- }, {
689
- y: 1657.1236,
690
- x: 146.9201,
691
- label: []
692
- }, {
693
- y: 1686.5353,
694
- x: 150.6111,
695
- label: []
696
- }, {
697
- y: 1715.9471,
698
- x: 154.3022,
699
- label: []
700
- }, {
701
- y: 1745.3589,
702
- x: 157.9933,
703
- label: []
704
- }, {
705
- y: 1774.7706,
706
- x: 161.6843,
707
- label: []
708
- }, {
709
- y: 1804.1824,
710
- x: 165.3754,
711
- label: []
712
- }, {
713
- y: 1833.5942,
714
- x: 169.0665,
715
- label: []
716
- }, {
717
- y: 1863.006,
718
- x: 172.7576,
719
- label: []
720
- }, {
721
- y: 1892.4177,
722
- x: 176.4486,
723
- label: []
724
- }, {
725
- y: 1903.9079,
726
- x: 177.8906,
727
- label: []
728
- }, {
729
- y: 1921.8305,
730
- x: 180.284,
731
- label: []
732
- }, {
733
- y: 1951.2325,
734
- x: 184.8347,
735
- label: []
736
- }, {
737
- y: 1980.5894,
738
- x: 190.1546,
739
- label: []
740
- }, {
741
- y: 2009.8654,
742
- x: 196.2372,
743
- label: []
744
- }, {
745
- y: 2039.0247,
746
- x: 203.0751,
747
- label: []
748
- }, {
749
- y: 2068.0319,
750
- x: 210.6599,
751
- label: []
752
- }, {
753
- y: 2096.8516,
754
- x: 218.9825,
755
- label: []
756
- }, {
757
- y: 2125.4487,
758
- x: 228.0327,
759
- label: []
760
- }, {
761
- y: 2153.7883,
762
- x: 237.7994,
763
- label: []
764
- }, {
765
- y: 2181.836,
766
- x: 248.2708,
767
- label: []
768
- }, {
769
- y: 2209.5576,
770
- x: 259.434,
771
- label: []
772
- }, {
773
- y: 2236.9192,
774
- x: 271.2756,
775
- label: []
776
- }, {
777
- y: 2263.8876,
778
- x: 283.781,
779
- label: []
780
- }, {
781
- y: 2290.4299,
782
- x: 296.935,
783
- label: []
784
- }, {
785
- y: 2316.5138,
786
- x: 310.7217,
787
- label: []
788
- }, {
789
- y: 2342.1074,
790
- x: 325.1241,
791
- label: []
792
- }, {
793
- y: 2367.1796,
794
- x: 340.1249,
795
- label: []
796
- }, {
797
- y: 2391.6999,
798
- x: 355.7056,
799
- label: []
800
- }, {
801
- y: 2415.6384,
802
- x: 371.8473,
803
- label: []
804
- }, {
805
- y: 2438.9658,
806
- x: 388.5303,
807
- label: []
808
- }, {
809
- y: 2461.6539,
810
- x: 405.7344,
811
- label: []
812
- }, {
813
- y: 2483.6749,
814
- x: 423.4384,
815
- label: []
816
- }, {
817
- y: 2505.0021,
818
- x: 441.621,
819
- label: []
820
- }, {
821
- y: 2525.6093,
822
- x: 460.2599,
823
- label: []
824
- }, {
825
- y: 2545.4716,
826
- x: 479.3325,
827
- label: []
828
- }, {
829
- y: 2550.4401,
830
- x: 484.2884,
831
- label: []
832
- }, {
833
- y: 2564.5931,
834
- x: 499.1889,
835
- label: []
836
- }, {
837
- y: 2582.9606,
838
- x: 520.6713,
839
- label: []
840
- }, {
841
- y: 2600.4389,
842
- x: 543.6622,
843
- label: []
844
- }, {
845
- y: 2616.8951,
846
- x: 567.9865,
847
- label: []
848
- }, {
849
- y: 2632.2039,
850
- x: 593.4591,
851
- label: []
852
- }, {
853
- y: 2646.2488,
854
- x: 619.8861,
855
- label: []
856
- }, {
857
- y: 2657.1619,
858
- x: 643.0591,
859
- label: []
860
- }, {
861
- y: 2658.9386,
862
- x: 647.0604,
863
- label: []
864
- }, {
865
- y: 2671.1078,
866
- x: 674.4667,
867
- label: []
868
- }, {
869
- y: 2683.277,
870
- x: 701.8731,
871
- label: []
872
- }, {
873
- y: 2695.4463,
874
- x: 729.2794,
875
- label: []
876
- }, {
877
- y: 2707.6155,
878
- x: 756.6858,
879
- label: []
880
- }, {
881
- y: 2719.7847,
882
- x: 784.0921,
883
- label: []
884
- }, {
885
- y: 2731.954,
886
- x: 811.4984,
887
- label: []
888
- }, {
889
- y: 2744.1232,
890
- x: 838.9048,
891
- label: []
892
- }, {
893
- y: 2756.2924,
894
- x: 866.3111,
895
- label: []
896
- }, {
897
- y: 2768.4617,
898
- x: 893.7174,
899
- label: []
900
- }, {
901
- y: 2780.6309,
902
- x: 921.1238,
903
- label: []
904
- }, {
905
- y: 2792.8001,
906
- x: 948.5301,
907
- label: []
908
- }, {
909
- y: 2804.9693,
910
- x: 975.9365,
911
- label: []
912
- }, {
913
- y: 2817.1386,
914
- x: 1003.3428,
915
- label: []
916
- }, {
917
- y: 2829.3078,
918
- x: 1030.7491,
919
- label: []
920
- }, {
921
- y: 2841.477,
922
- x: 1058.1555,
923
- label: []
924
- }, {
925
- y: 2853.6463,
926
- x: 1085.5618,
927
- label: []
928
- }, {
929
- y: 2865.8155,
930
- x: 1112.9682,
931
- label: []
932
- }, {
933
- y: 2877.9847,
934
- x: 1140.3745,
935
- label: []
936
- }, {
937
- y: 2890.1539,
938
- x: 1167.7808,
939
- label: []
940
- }, {
941
- y: 2902.3232,
942
- x: 1195.1872,
943
- label: []
944
- }, {
945
- y: 2914.4924,
946
- x: 1222.5935,
947
- label: []
948
- }, {
949
- y: 2926.6616,
950
- x: 1249.9999,
951
- label: []
952
- }, {
953
- y: 2938.8309,
954
- x: 1277.4062,
955
- label: []
956
- }, {
957
- y: 2951.0001,
958
- x: 1304.8125,
959
- label: []
960
- }, {
961
- y: 2963.1693,
962
- x: 1332.2189,
963
- label: []
964
- }, {
965
- y: 2975.3386,
966
- x: 1359.6252,
967
- label: []
968
- }, {
969
- y: 2987.5078,
970
- x: 1387.0316,
971
- label: []
972
- }, {
973
- y: 2999.677,
974
- x: 1414.4379,
975
- label: []
976
- }, {
977
- y: 3011.8462,
978
- x: 1441.8442,
979
- label: []
980
- }, {
981
- y: 3024.0155,
982
- x: 1469.2506,
983
- label: []
984
- }, {
985
- y: 3036.1847,
986
- x: 1496.6569,
987
- label: []
988
- }, {
989
- y: 3048.3539,
990
- x: 1524.0632,
991
- label: []
992
- }, {
993
- y: 3060.5232,
994
- x: 1551.4696,
995
- label: []
996
- }, {
997
- y: 3072.6924,
998
- x: 1578.8759,
999
- label: []
1000
- }, {
1001
- y: 3084.8616,
1002
- x: 1606.2823,
1003
- label: []
1004
- }, {
1005
- y: 3097.0309,
1006
- x: 1633.6886,
1007
- label: []
1008
- }, {
1009
- y: 3109.2001,
1010
- x: 1661.0949,
1011
- label: []
1012
- }, {
1013
- y: 3133.5385,
1014
- x: 1715.9076,
1015
- label: []
1016
- }, {
1017
- y: 3145.7078,
1018
- x: 1743.314,
1019
- label: []
1020
- }, {
1021
- y: 3157.877,
1022
- x: 1770.7203,
1023
- label: []
1024
- }, {
1025
- y: 3170.0462,
1026
- x: 1798.1266,
1027
- label: []
1028
- }, {
1029
- y: 3182.1915,
1030
- x: 1825.5436,
1031
- label: []
1032
- }, {
1033
- y: 3206.4821,
1034
- x: 1880.3775,
1035
- label: []
1036
- }, {
1037
- y: 3218.6513,
1038
- x: 1907.7838,
1039
- label: []
1040
- }, {
1041
- y: 3242.9898,
1042
- x: 1962.5965,
1043
- label: []
1044
- }, {
1045
- y: 3303.8876,
1046
- x: 2098.6264,
1047
- label: []
1048
- }, {
1049
- y: 3316.0671,
1050
- x: 2125.8324,
1051
- label: []
1052
- }, {
1053
- y: 3328.2364,
1054
- x: 2153.2388,
1055
- label: []
1056
- }, {
1057
- y: 3340.4056,
1058
- x: 2180.6451,
1059
- label: []
1060
- }, {
1061
- y: 3352.5748,
1062
- x: 2208.0514,
1063
- label: []
1064
- }, {
1065
- y: 3364.744,
1066
- x: 2235.4578,
1067
- label: []
1068
- }, {
1069
- y: 3376.9133,
1070
- x: 2262.8641,
1071
- label: []
1072
- }, {
1073
- y: 3389.0825,
1074
- x: 2290.2705,
1075
- label: []
1076
- }, {
1077
- y: 3401.2517,
1078
- x: 2317.6768,
1079
- label: []
1080
- }, {
1081
- y: 3413.421,
1082
- x: 2345.0831,
1083
- label: []
1084
- }, {
1085
- y: 3425.5902,
1086
- x: 2372.4895,
1087
- label: []
1088
- }, {
1089
- y: 3437.7594,
1090
- x: 2399.8958,
1091
- label: []
1092
- }, {
1093
- y: 3449.9287,
1094
- x: 2427.3022,
1095
- label: []
1096
- }, {
1097
- y: 3462.0979,
1098
- x: 2454.7085,
1099
- label: []
1100
- }, {
1101
- y: 3472.1213,
1102
- x: 2477.2822,
1103
- label: []
1104
- }, {
1105
- y: 3474.2312,
1106
- x: 2482.1309,
1107
- label: []
1108
- }, {
1109
- y: 3484.8166,
1110
- x: 2510.1876,
1111
- label: []
1112
- }, {
1113
- y: 3493.0003,
1114
- x: 2539.0391,
1115
- label: []
1116
- }, {
1117
- y: 3498.72,
1118
- x: 2568.4657,
1119
- label: []
1120
- }, {
1121
- y: 3499.9842,
1122
- x: 2577.6599,
1123
- label: []
1124
- }, {
1125
- y: 3502.5335,
1126
- x: 2598.189,
1127
- label: []
1128
- }, {
1129
- y: 3506.2262,
1130
- x: 2627.9269,
1131
- label: []
1132
- }, {
1133
- y: 3509.919,
1134
- x: 2657.6648,
1135
- label: []
1136
- }, {
1137
- y: 3513.6118,
1138
- x: 2687.4026,
1139
- label: []
1140
- }, {
1141
- y: 3517.3045,
1142
- x: 2717.1405,
1143
- label: []
1144
- }, {
1145
- y: 3520.9973,
1146
- x: 2746.8784,
1147
- label: []
1148
- }, {
1149
- y: 3524.6901,
1150
- x: 2776.6163,
1151
- label: []
1152
- }, {
1153
- y: 3528.3828,
1154
- x: 2806.3542,
1155
- label: []
1156
- }, {
1157
- y: 3532.0756,
1158
- x: 2836.0921,
1159
- label: []
1160
- }, {
1161
- y: 3535.7684,
1162
- x: 2865.83,
1163
- label: []
1164
- }, {
1165
- y: 3539.4612,
1166
- x: 2895.5679,
1167
- label: []
1168
- }, {
1169
- y: 3543.1539,
1170
- x: 2925.3058,
1171
- label: []
1172
- }, {
1173
- y: 3546.8467,
1174
- x: 2955.0436,
1175
- label: []
1176
- }, {
1177
- y: 3550.5395,
1178
- x: 2984.7815,
1179
- label: []
1180
- }, {
1181
- y: 3554.2322,
1182
- x: 3014.5194,
1183
- label: []
1184
- }, {
1185
- y: 3557.925,
1186
- x: 3044.2573,
1187
- label: []
1188
- }, {
1189
- y: 3561.6178,
1190
- x: 3073.9952,
1191
- label: []
1192
- }, {
1193
- y: 3565.3105,
1194
- x: 3103.7331,
1195
- label: []
1196
- }, {
1197
- y: 3569.0033,
1198
- x: 3133.471,
1199
- label: []
1200
- }, {
1201
- y: 3572.6961,
1202
- x: 3163.2089,
1203
- label: []
1204
- }, {
1205
- y: 3576.3888,
1206
- x: 3192.9467,
1207
- label: []
1208
- }, {
1209
- y: 3580.0816,
1210
- x: 3222.6846,
1211
- label: []
1212
- }, {
1213
- y: 3583.7744,
1214
- x: 3252.4225,
1215
- label: []
1216
- }, {
1217
- y: 3587.4671,
1218
- x: 3282.1604,
1219
- label: []
1220
- }, {
1221
- y: 3591.1599,
1222
- x: 3311.8983,
1223
- label: []
1224
- }, {
1225
- y: 3594.8527,
1226
- x: 3341.6362,
1227
- label: []
1228
- }, {
1229
- y: 3598.5455,
1230
- x: 3371.3741,
1231
- label: []
1232
- }, {
1233
- y: 3599.9856,
1234
- x: 3382.9719,
1235
- label: []
1236
- }, {
1237
- y: 3602.2382,
1238
- x: 3401.112,
1239
- label: []
1240
- }, {
1241
- y: 3605.931,
1242
- x: 3430.8499,
1243
- label: []
1244
- }, {
1245
- y: 3609.6238,
1246
- x: 3460.5877,
1247
- label: []
1248
- }, {
1249
- y: 3613.3165,
1250
- x: 3490.3256,
1251
- label: []
1252
- }, {
1253
- y: 3617.0093,
1254
- x: 3520.0635,
1255
- label: []
1256
- }, {
1257
- y: 3620.7021,
1258
- x: 3549.8014,
1259
- label: []
1260
- }, {
1261
- y: 3624.3948,
1262
- x: 3579.5393,
1263
- label: []
1264
- }, {
1265
- y: 3628.0876,
1266
- x: 3609.2772,
1267
- label: []
1268
- }, {
1269
- y: 3631.7804,
1270
- x: 3639.0151,
1271
- label: []
1272
- }, {
1273
- y: 3635.4731,
1274
- x: 3668.753,
1275
- label: []
1276
- }, {
1277
- y: 3639.1659,
1278
- x: 3698.4909,
1279
- label: []
1280
- }, {
1281
- y: 3642.8587,
1282
- x: 3728.2287,
1283
- label: []
1284
- }, {
1285
- y: 3646.5514,
1286
- x: 3757.9666,
1287
- label: []
1288
- }, {
1289
- y: 3650.2442,
1290
- x: 3787.7045,
1291
- label: []
1292
- }, {
1293
- y: 3653.937,
1294
- x: 3817.4424,
1295
- label: []
1296
- }, {
1297
- y: 3657.6298,
1298
- x: 3847.1803,
1299
- label: []
1300
- }, {
1301
- y: 3661.3225,
1302
- x: 3876.9182,
1303
- label: []
1304
- }, {
1305
- y: 3665.0153,
1306
- x: 3906.6561,
1307
- label: []
1308
- }, {
1309
- y: 3668.7081,
1310
- x: 3936.394,
1311
- label: []
1312
- }, {
1313
- y: 3672.4008,
1314
- x: 3966.1318,
1315
- label: []
1316
- }, {
1317
- y: 3676.0936,
1318
- x: 3995.8697,
1319
- label: []
1320
- }, {
1321
- y: 3679.7864,
1322
- x: 4025.6076,
1323
- label: []
1324
- }, {
1325
- y: 3683.4791,
1326
- x: 4055.3455,
1327
- label: []
1328
- }, {
1329
- y: 3687.1719,
1330
- x: 4085.0834,
1331
- label: []
1332
- }, {
1333
- y: 3690.8647,
1334
- x: 4114.8213,
1335
- label: []
1336
- }, {
1337
- y: 3694.5574,
1338
- x: 4144.5592,
1339
- label: []
1340
- }, {
1341
- y: 3698.2502,
1342
- x: 4174.2971,
1343
- label: []
1344
- }, {
1345
- y: 3701.943,
1346
- x: 4204.035,
1347
- label: []
1348
- }, {
1349
- y: 3705.6357,
1350
- x: 4233.7728,
1351
- label: []
1352
- }, {
1353
- y: 3709.3285,
1354
- x: 4263.5107,
1355
- label: []
1356
- }, {
1357
- y: 3713.0213,
1358
- x: 4293.2486,
1359
- label: []
1360
- }, {
1361
- y: 3716.7141,
1362
- x: 4322.9865,
1363
- label: []
1364
- }, {
1365
- y: 3720.4068,
1366
- x: 4352.7244,
1367
- label: []
1368
- }, {
1369
- y: 3724.0996,
1370
- x: 4382.4623,
1371
- label: []
1372
- }, {
1373
- y: 3727.7924,
1374
- x: 4412.2002,
1375
- label: []
1376
- }, {
1377
- y: 3731.4851,
1378
- x: 4441.9381,
1379
- label: []
1380
- }, {
1381
- y: 3735.1779,
1382
- x: 4471.676,
1383
- label: []
1384
- }, {
1385
- y: 3738.8707,
1386
- x: 4501.4138,
1387
- label: []
1388
- }, {
1389
- y: 3742.5634,
1390
- x: 4531.1517,
1391
- label: []
1392
- }, {
1393
- y: 3746.2562,
1394
- x: 4560.8896,
1395
- label: []
1396
- }, {
1397
- y: 3749.949,
1398
- x: 4590.6275,
1399
- label: []
1400
- }, {
1401
- y: 3753.6417,
1402
- x: 4620.3654,
1403
- label: []
1404
- }, {
1405
- y: 3757.3345,
1406
- x: 4650.1033,
1407
- label: []
1408
- }, {
1409
- y: 3761.0273,
1410
- x: 4679.8412,
1411
- label: []
1412
- }, {
1413
- y: 3764.72,
1414
- x: 4709.5791,
1415
- label: []
1416
- }, {
1417
- y: 3768.4128,
1418
- x: 4739.3169,
1419
- label: []
1420
- }, {
1421
- y: 3772.1056,
1422
- x: 4769.0548,
1423
- label: []
1424
- }, {
1425
- y: 3775.7984,
1426
- x: 4798.7927,
1427
- label: []
1428
- }, {
1429
- y: 3779.4911,
1430
- x: 4828.5306,
1431
- label: []
1432
- }, {
1433
- y: 3783.1839,
1434
- x: 4858.2685,
1435
- label: []
1436
- }, {
1437
- y: 3786.8767,
1438
- x: 4888.0064,
1439
- label: []
1440
- }, {
1441
- y: 3790.5694,
1442
- x: 4917.7443,
1443
- label: []
1444
- }, {
1445
- y: 3794.2622,
1446
- x: 4947.4822,
1447
- label: []
1448
- }, {
1449
- y: 3797.955,
1450
- x: 4977.2201,
1451
- label: []
1452
- }, {
1453
- y: 3801.6477,
1454
- x: 5006.9579,
1455
- label: []
1456
- }, {
1457
- y: 3805.3405,
1458
- x: 5036.6958,
1459
- label: []
1460
- }, {
1461
- y: 3809.0333,
1462
- x: 5066.4337,
1463
- label: []
1464
- }, {
1465
- y: 3809.7189,
1466
- x: 5067.0389,
1467
- label: []
1468
- }, {
1469
- y: 3810.7189,
1470
- x: 5067.0389,
1471
- label: []
1472
- }],
1473
- wellOffset: [-3.4, 0.11]
1474
- }];
1475
- const handleLabelChange = event => {
1476
- const value = event.target.value;
1477
- setLabelInput(value);
1478
- setAnnotations(prev => prev.map((ann, index) => index === 0 ? {
1479
- ...ann,
1480
- label: value
1481
- } : ann));
1482
- };
1483
- const handleAddAnnotation = () => {
1484
- setAnnotations(prev => {
1485
- const nextIndex = prev.length;
1486
- const data = dataset1[0].data;
1487
- const baseX = data[nextIndex]?.x ?? data[data.length - 1].x;
1488
- const baseY = 100 + nextIndex * 10;
1489
- const newAnnotation = {
1490
- type: 'point',
1491
- labelOffsetPx: 50,
1492
- xValue: baseX,
1493
- yValue: baseY,
1494
- radius: 4,
1495
- color: 'rgba(128, 128, 128, 1)',
1496
- pointStyle: 'triangle',
1497
- label: \`annotation \${nextIndex + 1}\`,
1498
- labelConfig: {
1499
- position: 'right',
1500
- color: 'rgba(128, 128, 128, 1)',
1501
- callout: {
1502
- enabled: true
1503
- }
1504
- }
1505
- };
1506
- return [...prev, newAnnotation];
1507
- });
1508
- };
1509
- return <>
1510
- <div style={{
1511
- display: 'flex',
1512
- gap: 8,
1513
- marginBottom: 16,
1514
- alignItems: 'center'
1515
- }}>
1516
- <span>Label for first annotation:</span>
1517
- <input value={labelInput} onChange={handleLabelChange} style={{
1518
- padding: 4,
1519
- minWidth: 180
1520
- }} />
1521
- <button type="button" onClick={handleAddAnnotation}>
1522
- Add annotation
1523
- </button>
1524
- </div>
1525
-
1526
- <LineChart chart={{
1527
- ...basicChart,
1528
- data: {
1529
- datasets: dataset1
1530
- },
1531
- options: {
1532
- ...basicChart.options,
1533
- legend: {
1534
- display: false
1535
- },
1536
- annotations: {
1537
- showAnnotations: true,
1538
- enableDragAnnotation: true,
1539
- enableCalloutAnnotation: true,
1540
- annotationsData: annotations
1541
- }
1542
- }
1543
- }} />
1544
- </>;
1545
- }`,...v.parameters?.docs?.source}}},y.parameters={...y.parameters,docs:{...y.parameters?.docs,source:{originalSource:`() => {
1546
- const [useCallout, setUseCallout] = useState(false);
1547
- const [onlyWhenOverlapping, setOnlyWhenOverlapping] = useState(false);
1548
- const chartXMin = 0.9;
1549
- const chartXMax = 11;
1550
- const leftFormations = [{
1551
- label: 'Label 1',
1552
- depth: 1000
1553
- }, {
1554
- label: 'Label 2',
1555
- depth: 1360
1556
- }, {
1557
- label: 'Label 3',
1558
- depth: 1374
1559
- }, {
1560
- label: 'Label 4',
1561
- depth: 3600
1562
- }, {
1563
- label: 'Label 5',
1564
- depth: 4800
1565
- }, {
1566
- label: 'Label 6',
1567
- depth: 5300
1568
- }, {
1569
- label: 'Label 7',
1570
- depth: 5590
1571
- }, {
1572
- label: 'Label 8',
1573
- depth: 5612
1574
- }, {
1575
- label: 'Label 9',
1576
- depth: 5628
1577
- }];
1578
- const rightFormations = [{
1579
- label: 'Label 1',
1580
- depth: 1120
1581
- }, {
1582
- label: 'Label 2',
1583
- depth: 1490
1584
- }, {
1585
- label: 'Label 3',
1586
- depth: 1508
1587
- }, {
1588
- label: 'Label 4',
1589
- depth: 3420
1590
- }, {
1591
- label: 'Label 5',
1592
- depth: 4238
1593
- }, {
1594
- label: 'Label 6',
1595
- depth: 5050
1596
- }, {
1597
- label: 'Label 7',
1598
- depth: 5068
1599
- }, {
1600
- label: 'Label 8',
1601
- depth: 5350
1602
- }, {
1603
- label: 'Label 9',
1604
- depth: 5536
1605
- }];
1606
- const getLabelConfig = (position, xAdjust) => useCallout ? {
1607
- position,
1608
- xAdjust,
1609
- yAdjust: 0,
1610
- color: 'rgba(15, 15, 15, 1)',
1611
- callout: {
1612
- enabled: true,
1613
- onlyWhenOverlapping
1614
- }
1615
- } : {
1616
- position,
1617
- xAdjust,
1618
- yAdjust: 0,
1619
- color: 'rgba(15, 15, 15, 1)'
1620
- };
1621
- const baseDataset = {
1622
- label: 'Pore pressure',
1623
- data: [{
1624
- x: 6,
1625
- y: 1000
1626
- }, {
1627
- x: 6.8,
1628
- y: 2000
1629
- }, {
1630
- x: 7.3,
1631
- y: 3500
1632
- }, {
1633
- x: 7.7,
1634
- y: 4700
1635
- }, {
1636
- x: 8.2,
1637
- y: 5600
1638
- }]
1639
- };
1640
- return <Grid gap>
1641
- <FormRow>
1642
- <Toggle label={\`Use callout: \${useCallout ? 'on' : 'off'}\`} checked={useCallout} onChange={() => setUseCallout(v => !v)} />
1643
- </FormRow>
1644
-
1645
- <FormRow>
1646
- <Toggle label={\`Only when overlapping: \${onlyWhenOverlapping ? 'on' : 'off'}\`} checked={onlyWhenOverlapping} onChange={() => setOnlyWhenOverlapping(v => !v)} disabled={!useCallout} />
1647
- </FormRow>
1648
-
1649
- <LineChart chart={{
1650
- data: {
1651
- datasets: [baseDataset]
1652
- },
1653
- options: {
1654
- title: 'Playground: left/right box annotation series',
1655
- chartStyling: {
1656
- height: 560
1657
- },
1658
- legend: {
1659
- display: false
1660
- },
1661
- axes: {
1662
- x: [{
1663
- label: 'Pressure Gradient [ppg]'
1664
- }],
1665
- y: [{
1666
- label: 'Depth TVD RKB [ft]'
1667
- }]
1668
- },
1669
- additionalAxesOptions: {
1670
- reverse: true,
1671
- range: {
1672
- x: {
1673
- min: chartXMin,
1674
- max: chartXMax
1675
- },
1676
- y: {
1677
- min: 900,
1678
- max: 6200
1679
- }
1680
- }
1681
- },
1682
- annotations: {
1683
- showAnnotations: true,
1684
- enableCalloutAnnotation: useCallout,
1685
- annotationsData: [...leftFormations.map(({
1686
- label,
1687
- depth
1688
- }) => ({
1689
- type: 'box',
1690
- yMin: depth - 22,
1691
- yMax: depth + 22,
1692
- color: 'rgba(35, 117, 255, 0.16)',
1693
- adjustScaleRange: false,
1694
- borderColor: 'rgba(35, 117, 255, 0.55)',
1695
- borderWidth: 1,
1696
- label: \`L: \${label}\`,
1697
- labelConfig: getLabelConfig('top-left', 14)
1698
- })), ...rightFormations.map(({
1699
- label,
1700
- depth
1701
- }) => ({
1702
- type: 'box',
1703
- yMin: depth - 22,
1704
- yMax: depth + 22,
1705
- color: 'rgba(255, 138, 0, 0.18)',
1706
- adjustScaleRange: false,
1707
- borderColor: 'rgba(255, 138, 0, 0.55)',
1708
- borderWidth: 1,
1709
- label: \`R: \${label}\`,
1710
- labelConfig: getLabelConfig('top-right', -14)
1711
- }))]
1712
- }
1713
- }
1714
- }} />
1715
- </Grid>;
1716
- }`,...y.parameters?.docs?.source}}},b.parameters={...b.parameters,docs:{...b.parameters?.docs,source:{originalSource:`() => {
1717
- const [control, setControl] = useState(false);
1718
- const annotationsData = useMemo(() => [{
1719
- annotationAxis: 'y',
1720
- label: 'Annotation 1',
1721
- value: 50
1722
- }, {
1723
- annotationAxis: 'x',
1724
- label: 'Annotation 2',
1725
- value: 10
1726
- }], []);
1727
- const chart = useMemo(() => ({
1728
- ...basicChart,
1729
- options: {
1730
- ...basicChart.options,
1731
- title: 'Repro: toggle controlAnnotation (with legend)',
1732
- legend: {
1733
- display: true
1734
- },
1735
- annotations: {
1736
- controlAnnotation: control,
1737
- showAnnotations: true,
1738
- annotationsData
1739
- }
1740
- }
1741
- }), [control, annotationsData]);
1742
- return <Grid gap>
1743
- <FormRow>
1744
- <Toggle label={\`controlAnnotation: \${control ? 'true' : 'false'}\`} value={control} onChange={() => setControl(v => !v)} />
1745
- </FormRow>
1746
-
1747
- <LineChart chart={chart} />
1748
- </Grid>;
1749
- }`,...b.parameters?.docs?.source}}};const x=[`PartialRangeWithSimilarValues`,`closeToValueInDifferentAxes`,`StressTest`,`DynamicCalloutAnnotations`,`OverlappingBoxAnnotationLabels`,`Test_ControlAnnotation_WithLegend`];export{v as DynamicCalloutAnnotations,y as OverlappingBoxAnnotationLabels,h as PartialRangeWithSimilarValues,_ as StressTest,b as Test_ControlAnnotation_WithLegend,x as __namedExportsOrder,g as closeToValueInDifferentAxes,m as default};