apexcharts 8.0.1 → 8.2.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 (267) hide show
  1. package/README.md +14 -8
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +2310 -2274
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.esm.js +1367 -1110
  6. package/dist/apexcharts.full.js +3880 -3531
  7. package/dist/apexcharts.full.min.js +2 -2
  8. package/dist/apexcharts.js +3676 -3409
  9. package/dist/apexcharts.min.js +2 -2
  10. package/dist/apexcharts.ssr.common.js +2 -2
  11. package/dist/apexcharts.ssr.esm.js +4114 -3591
  12. package/dist/area.common.js +2 -2
  13. package/dist/area.esm.js +25 -67
  14. package/dist/bar.common.js +2 -2
  15. package/dist/bar.esm.js +159 -163
  16. package/dist/bar.js +2 -2
  17. package/dist/boxPlot.common.js +2 -2
  18. package/dist/boxPlot.esm.js +125 -106
  19. package/dist/bubble.common.js +2 -2
  20. package/dist/bubble.esm.js +25 -67
  21. package/dist/candlestick.common.js +2 -2
  22. package/dist/candlestick.esm.js +125 -106
  23. package/dist/candlestick.js +2 -2
  24. package/dist/column.common.js +2 -2
  25. package/dist/column.esm.js +159 -163
  26. package/dist/core.common.js +2 -2
  27. package/dist/core.esm.js +2310 -2274
  28. package/dist/donut.common.js +2 -2
  29. package/dist/donut.esm.js +100 -78
  30. package/dist/dumbbell.common.js +2 -2
  31. package/dist/dumbbell.esm.js +192 -167
  32. package/dist/features/all.common.js +2 -2
  33. package/dist/features/all.esm.js +945 -640
  34. package/dist/features/annotations.common.js +2 -2
  35. package/dist/features/annotations.esm.js +46 -21
  36. package/dist/features/annotations.js +2 -2
  37. package/dist/features/context-menu.common.js +1 -1
  38. package/dist/features/context-menu.esm.js +1 -1
  39. package/dist/features/context-menu.js +1 -1
  40. package/dist/features/drilldown.common.js +2 -2
  41. package/dist/features/drilldown.esm.js +22 -2
  42. package/dist/features/drilldown.js +2 -2
  43. package/dist/features/dumbbell.common.js +2 -2
  44. package/dist/features/dumbbell.esm.js +34 -5
  45. package/dist/features/dumbbell.js +2 -2
  46. package/dist/features/exports.common.js +2 -2
  47. package/dist/features/exports.esm.js +203 -204
  48. package/dist/features/exports.js +2 -2
  49. package/dist/features/facet.common.js +1 -1
  50. package/dist/features/facet.esm.js +1 -1
  51. package/dist/features/facet.js +1 -1
  52. package/dist/features/highlight-filter.common.js +2 -2
  53. package/dist/features/highlight-filter.esm.js +97 -41
  54. package/dist/features/highlight-filter.js +2 -2
  55. package/dist/features/history.common.js +2 -2
  56. package/dist/features/history.esm.js +4 -3
  57. package/dist/features/history.js +2 -2
  58. package/dist/features/ink.common.js +1 -1
  59. package/dist/features/ink.esm.js +1 -1
  60. package/dist/features/ink.js +1 -1
  61. package/dist/features/keyboard.common.js +2 -2
  62. package/dist/features/keyboard.esm.js +20 -23
  63. package/dist/features/keyboard.js +2 -2
  64. package/dist/features/legend.common.js +2 -2
  65. package/dist/features/legend.esm.js +61 -41
  66. package/dist/features/legend.js +2 -2
  67. package/dist/features/link.common.js +2 -2
  68. package/dist/features/link.esm.js +8 -8
  69. package/dist/features/link.js +2 -2
  70. package/dist/features/marks.common.js +2 -2
  71. package/dist/features/marks.esm.js +1 -1
  72. package/dist/features/marks.js +1 -1
  73. package/dist/features/measure.common.js +1 -1
  74. package/dist/features/measure.esm.js +1 -1
  75. package/dist/features/measure.js +1 -1
  76. package/dist/features/morph.common.js +2 -2
  77. package/dist/features/morph.esm.js +260 -279
  78. package/dist/features/morph.js +2 -2
  79. package/dist/features/perspectives.common.js +2 -2
  80. package/dist/features/perspectives.esm.js +28 -19
  81. package/dist/features/perspectives.js +2 -2
  82. package/dist/features/raincloud.common.js +2 -2
  83. package/dist/features/raincloud.esm.js +54 -36
  84. package/dist/features/raincloud.js +2 -2
  85. package/dist/features/renderer-canvas.common.js +1 -1
  86. package/dist/features/renderer-canvas.esm.js +1 -1
  87. package/dist/features/renderer-canvas.js +1 -1
  88. package/dist/features/stats.common.js +2 -2
  89. package/dist/features/stats.esm.js +66 -18
  90. package/dist/features/stats.js +2 -2
  91. package/dist/features/storyboard.common.js +2 -2
  92. package/dist/features/storyboard.esm.js +24 -15
  93. package/dist/features/storyboard.js +2 -2
  94. package/dist/features/streamgraph.common.js +2 -2
  95. package/dist/features/streamgraph.esm.js +34 -5
  96. package/dist/features/streamgraph.js +2 -2
  97. package/dist/features/toolbar.common.js +2 -2
  98. package/dist/features/toolbar.esm.js +211 -217
  99. package/dist/features/toolbar.js +2 -2
  100. package/dist/features/trellis.common.js +2 -2
  101. package/dist/features/trellis.esm.js +31 -19
  102. package/dist/features/trellis.js +2 -2
  103. package/dist/features/waterfall.common.js +2 -2
  104. package/dist/features/waterfall.esm.js +34 -5
  105. package/dist/features/waterfall.js +2 -2
  106. package/dist/features/weave.common.js +2 -2
  107. package/dist/features/weave.esm.js +290 -48
  108. package/dist/features/weave.js +2 -2
  109. package/dist/full.common.js +2 -2
  110. package/dist/full.esm.js +289 -150
  111. package/dist/heatmap.common.js +2 -2
  112. package/dist/heatmap.esm.js +48 -17
  113. package/dist/heatmap.js +2 -2
  114. package/dist/histogram.common.js +2 -2
  115. package/dist/histogram.esm.js +224 -180
  116. package/dist/icicle.common.js +2 -2
  117. package/dist/icicle.esm.js +1 -1
  118. package/dist/icicle.js +1 -1
  119. package/dist/line.common.js +2 -2
  120. package/dist/line.esm.js +25 -67
  121. package/dist/line.js +2 -2
  122. package/dist/pictograms.common.js +1 -1
  123. package/dist/pictograms.esm.js +1 -1
  124. package/dist/pictograms.js +1 -1
  125. package/dist/pie.common.js +2 -2
  126. package/dist/pie.esm.js +100 -78
  127. package/dist/pie.js +2 -2
  128. package/dist/polarArea.common.js +2 -2
  129. package/dist/polarArea.esm.js +100 -78
  130. package/dist/radar.common.js +2 -2
  131. package/dist/radar.esm.js +8 -5
  132. package/dist/radar.js +2 -2
  133. package/dist/radialBar.common.js +2 -2
  134. package/dist/radialBar.esm.js +166 -133
  135. package/dist/radialBar.js +2 -2
  136. package/dist/raincloud.common.js +2 -2
  137. package/dist/raincloud.esm.js +55 -42
  138. package/dist/rangeArea.common.js +2 -2
  139. package/dist/rangeArea.esm.js +25 -67
  140. package/dist/rangeBar.common.js +2 -2
  141. package/dist/rangeBar.esm.js +159 -163
  142. package/dist/scatter.common.js +2 -2
  143. package/dist/scatter.esm.js +25 -67
  144. package/dist/streamgraph.common.js +2 -2
  145. package/dist/streamgraph.esm.js +58 -71
  146. package/dist/sunburst.common.js +2 -2
  147. package/dist/sunburst.esm.js +1 -1
  148. package/dist/sunburst.js +1 -1
  149. package/dist/treemap.common.js +2 -2
  150. package/dist/treemap.esm.js +28 -90
  151. package/dist/treemap.js +2 -2
  152. package/dist/unit-shapes.common.js +2 -2
  153. package/dist/unit-shapes.esm.js +1 -1
  154. package/dist/unit-shapes.js +1 -1
  155. package/dist/unit.common.js +2 -2
  156. package/dist/unit.esm.js +30 -6
  157. package/dist/unit.js +2 -2
  158. package/dist/violin.common.js +2 -2
  159. package/dist/violin.esm.js +2 -7
  160. package/dist/violin.js +2 -2
  161. package/dist/waterfall.common.js +2 -2
  162. package/dist/waterfall.esm.js +192 -167
  163. package/package.json +3 -1
  164. package/src/apexcharts.js +260 -201
  165. package/src/charts/Bar.js +16 -5
  166. package/src/charts/BarStacked.js +42 -88
  167. package/src/charts/BoxCandleStick.js +1 -7
  168. package/src/charts/HeatMap.js +73 -16
  169. package/src/charts/Line.js +21 -71
  170. package/src/charts/Pie.js +142 -89
  171. package/src/charts/Radar.js +4 -1
  172. package/src/charts/Radial.js +91 -63
  173. package/src/charts/RangeBar.js +1 -7
  174. package/src/charts/Treemap.js +25 -78
  175. package/src/charts/Unit.js +28 -10
  176. package/src/charts/Violin.js +1 -7
  177. package/src/charts/common/Hierarchy.js +0 -22
  178. package/src/charts/common/OuterLabels.js +12 -5
  179. package/src/charts/common/Stats.js +55 -28
  180. package/src/charts/common/bar/DataLabels.js +94 -83
  181. package/src/charts/common/bar/Helpers.js +34 -57
  182. package/src/charts/common/circle/Helpers.js +5 -2
  183. package/src/charts/common/treemap/Helpers.js +1 -1
  184. package/src/entries/full.js +0 -17
  185. package/src/features/link.js +9 -10
  186. package/src/features/perspectives.js +20 -19
  187. package/src/features/raincloud.js +51 -53
  188. package/src/features/stats.js +23 -35
  189. package/src/libs/Treemap-squared.js +7 -47
  190. package/src/modules/Animations.js +55 -73
  191. package/src/modules/Base.js +3 -2
  192. package/src/modules/ChartFactory.js +6 -1
  193. package/src/modules/Core.js +57 -30
  194. package/src/modules/CoreUtils.js +32 -33
  195. package/src/modules/Crosshairs.js +29 -11
  196. package/src/modules/Data.js +279 -153
  197. package/src/modules/DataLabels.js +18 -2
  198. package/src/modules/Events.js +1 -4
  199. package/src/modules/Exports.js +284 -305
  200. package/src/modules/Fill.js +23 -10
  201. package/src/modules/Formatters.js +14 -3
  202. package/src/modules/Graphics.js +8 -14
  203. package/src/modules/MorphPieces.js +4 -2
  204. package/src/modules/MorphTypeChange.js +332 -316
  205. package/src/modules/Range.js +56 -99
  206. package/src/modules/Responsive.js +186 -61
  207. package/src/modules/Scales.js +4 -47
  208. package/src/modules/Series.js +14 -45
  209. package/src/modules/Theme.js +108 -57
  210. package/src/modules/Toolbar.js +7 -13
  211. package/src/modules/accessibility/KeyboardNavigation.js +29 -28
  212. package/src/modules/animations/AxisTransition.js +54 -16
  213. package/src/modules/animations/CircleTransition.js +1 -4
  214. package/src/modules/animations/DataLabelTransition.js +15 -10
  215. package/src/modules/animations/StreamScroll.js +6 -4
  216. package/src/modules/annotations/Annotations.js +18 -17
  217. package/src/modules/annotations/Helpers.js +41 -17
  218. package/src/modules/axes/XAxis.js +4 -4
  219. package/src/modules/axes/YAxis.js +1 -6
  220. package/src/modules/dimensions/Dimensions.js +12 -7
  221. package/src/modules/dimensions/Grid.js +15 -3
  222. package/src/modules/dimensions/YAxis.js +7 -6
  223. package/src/modules/drilldown/Drilldown.js +22 -1
  224. package/src/modules/dumbbell/DumbbellData.js +3 -5
  225. package/src/modules/helpers/Destroy.js +10 -1
  226. package/src/modules/helpers/InitCtxVariables.js +19 -16
  227. package/src/modules/helpers/RawStash.js +51 -0
  228. package/src/modules/helpers/UpdateHelpers.js +95 -30
  229. package/src/modules/highlightFilter/HighlightFilter.js +107 -52
  230. package/src/modules/highlightFilter/PiePart.js +1 -1
  231. package/src/modules/highlightFilter/RadialPart.js +1 -1
  232. package/src/modules/history/History.js +7 -2
  233. package/src/modules/legend/Legend.js +100 -62
  234. package/src/modules/license/LicenseEnforcer.js +6 -1
  235. package/src/modules/settings/Config.js +60 -153
  236. package/src/modules/settings/Defaults.js +352 -58
  237. package/src/modules/settings/Globals.js +23 -5
  238. package/src/modules/settings/Options.js +19 -5
  239. package/src/modules/settings/TypeAliases.js +3 -6
  240. package/src/modules/streamgraph/StreamData.js +3 -5
  241. package/src/modules/tooltip/AxesTooltip.js +33 -41
  242. package/src/modules/tooltip/Intersect.js +50 -43
  243. package/src/modules/tooltip/Labels.js +62 -23
  244. package/src/modules/tooltip/Marker.js +6 -7
  245. package/src/modules/tooltip/Position.js +31 -35
  246. package/src/modules/tooltip/Tooltip.js +107 -119
  247. package/src/modules/tooltip/Utils.js +94 -159
  248. package/src/modules/trellis/TrellisExports.js +21 -9
  249. package/src/modules/trellis/TrellisTooltip.js +18 -8
  250. package/src/modules/waterfall/WaterfallData.js +3 -5
  251. package/src/modules/weave/Claims.js +14 -3
  252. package/src/modules/weave/Highlights.js +209 -0
  253. package/src/modules/weave/PluginAPI.js +64 -3
  254. package/src/modules/weave/WeaveHost.js +215 -51
  255. package/src/ssr/BrowserAPIs.js +5 -3
  256. package/src/ssr/DOMShim.js +6 -30
  257. package/src/ssr/Hydration.js +5 -36
  258. package/src/ssr/RenderShim.js +333 -0
  259. package/src/ssr/SSRRenderer.js +81 -36
  260. package/src/svg/SVGAnimation.js +10 -7
  261. package/src/types/internal.d.ts +37 -7
  262. package/src/utils/Constants.js +7 -8
  263. package/src/utils/DateTime.js +21 -195
  264. package/src/utils/MissingFeature.js +7 -9
  265. package/src/utils/Resize.js +4 -0
  266. package/src/utils/Utils.js +102 -171
  267. package/types/apexcharts.d.ts +57 -7
@@ -574,7 +574,7 @@ declare class ApexCharts {
574
574
  * Static, pure Perspectives helpers. Available once the feature is imported:
575
575
  * `import 'apexcharts/features/perspectives'`.
576
576
  */
577
- static perspectives: {
577
+ static readonly perspectives: {
578
578
  decode(str: string): ApexPerspective | null
579
579
  fromURL(href?: string): ApexPerspective | null
580
580
  }
@@ -582,6 +582,8 @@ declare class ApexCharts {
582
582
  /**
583
583
  * SSR: render a chart to an SVG string on the server. Available from the
584
584
  * `apexcharts/ssr` entry (`import ApexCharts from 'apexcharts/ssr'`).
585
+ * The legend is HTML beside the SVG, so this standalone SVG has none and
586
+ * its plot fills the chart; use `renderToHTML` for a chart with its legend.
585
587
  */
586
588
  static renderToString(
587
589
  options: ApexCharts.ApexOptions,
@@ -590,7 +592,8 @@ declare class ApexCharts {
590
592
 
591
593
  /**
592
594
  * SSR: render a chart to hydration-ready HTML (SVG wrapped in the chart
593
- * container). Available from the `apexcharts/ssr` entry.
595
+ * container), with the legend and its stylesheet beside the SVG. Available
596
+ * from the `apexcharts/ssr` entry.
594
597
  */
595
598
  static renderToHTML(
596
599
  options: ApexCharts.ApexOptions,
@@ -959,7 +962,9 @@ interface ApexPluginAPI {
959
962
  * The chart has already resolved this for its own tooltip, so this forwards
960
963
  * the host's answer rather than leaving a plugin to hit-test the SVG and
961
964
  * disagree with it. Nothing here can intercept or cancel: the tooltip,
962
- * selection state and the caller's own events are unaffected.
965
+ * selection state and the caller's own events are unaffected. A handler that
966
+ * throws counts toward the plugin's three failures like a hook does, and a
967
+ * disabled or removed plugin stops being called.
963
968
  *
964
969
  * `category` is the resolved display label rather than an index, because a
965
970
  * plugin coordinating two charts keys on the label; an index means something
@@ -1010,7 +1015,8 @@ interface ApexPluginAPI {
1010
1015
  *
1011
1016
  * Returns null for an option that is not claimable, so a plugin written
1012
1017
  * against a newer host degrades instead of throwing. Every claim is released
1013
- * on teardown, on destroy, and if the host disables the plugin.
1018
+ * on teardown, on destroy, when the plugin is removed from `plugins`, and if
1019
+ * the host disables the plugin.
1014
1020
  *
1015
1021
  * @since Weave v6
1016
1022
  */
@@ -1018,6 +1024,29 @@ interface ApexPluginAPI {
1018
1024
  option: 'stroke.dashArray' | 'dataLabels.enabledOnSeries' | (string & {}),
1019
1025
  entries: Array<{ series: string | number; value: any }>
1020
1026
  ): ApexPluginClaim | null
1027
+ /**
1028
+ * Draw a PART of each value, inside the slot that value already occupies.
1029
+ *
1030
+ * The whole is drawn faded and the part solid in front of it, from the same
1031
+ * baseline. The alternative for a plugin with a second number per datum is
1032
+ * `markDerived()`, which adds a series, and a series costs the caller a
1033
+ * legend entry, a tooltip row, an export column, a rescaled value axis and,
1034
+ * on a bar chart, half the width of every bar they had.
1035
+ *
1036
+ * Null means the parts were not taken, and a plugin that gets null needs
1037
+ * something else to do. The host says null when the highlight-filter feature
1038
+ * is not loaded on the page, when the chart is not an axis chart, when the
1039
+ * type draws no parts, and when the caller is already showing parts of their
1040
+ * own. Check it per call: three of the four can change on the caller's next
1041
+ * update.
1042
+ *
1043
+ * Registering, updating and releasing each re-render the chart, coalesced to
1044
+ * one render per turn. Released on teardown, on destroy, and if the host
1045
+ * disables the plugin.
1046
+ *
1047
+ * @since Weave v7
1048
+ */
1049
+ highlight(entries: ApexPluginHighlightEntry[]): ApexPluginHighlight | null
1021
1050
  /**
1022
1051
  * Everything drawn on this chart, including other features' output: the
1023
1052
  * series, the caller's annotations (ink strokes among them), and whatever
@@ -1131,6 +1160,22 @@ interface ApexPluginClaim {
1131
1160
  update(entries: Array<{ series: string | number; value: any }>): void
1132
1161
  }
1133
1162
 
1163
+ /** One series' parts, parallel to its data. @since Weave v7 */
1164
+ interface ApexPluginHighlightEntry {
1165
+ /** A series NAME (resolved on every parse) or a position. */
1166
+ series: string | number
1167
+ /** Parallel to that series' data; null where a datum has no part. */
1168
+ values: Array<number | null>
1169
+ }
1170
+
1171
+ /** Live highlight parts a plugin registered. @since Weave v7 */
1172
+ interface ApexPluginHighlight {
1173
+ /** Stop drawing these parts and re-render. Idempotent. */
1174
+ release(): void
1175
+ /** Replace the parts, keeping this plugin's place in the resolution order. */
1176
+ update(entries: ApexPluginHighlightEntry[]): void
1177
+ }
1178
+
1134
1179
  interface ApexPlugin {
1135
1180
  name: string
1136
1181
  apiVersion?: number
@@ -4745,9 +4790,10 @@ type ApexTooltipY = {
4745
4790
  }
4746
4791
  /**
4747
4792
  * `val` is `null` wherever the series has a gap, so guard before reaching
4748
- * for a number method: `(val) => val?.toFixed(2) ?? 'n/a'`.
4793
+ * for a number method: `(val) => val?.toFixed(2) ?? 'n/a'`. In a shared
4794
+ * tooltip, returning `null` or `undefined` hides that series' row.
4749
4795
  */
4750
- formatter?(val: number | null, opts?: ApexFormatterOpts): string
4796
+ formatter?(val: number | null, opts?: ApexFormatterOpts): string | null | undefined
4751
4797
  }
4752
4798
 
4753
4799
  /**
@@ -4758,7 +4804,11 @@ type ApexTooltip = {
4758
4804
  enabled?: boolean
4759
4805
  enabledOnSeries?: undefined | number[]
4760
4806
  shared?: boolean
4761
- /** Ignored while `interactive` is enabled. */
4807
+ /**
4808
+ * Ignored while `interactive` is enabled. On horizontal bar and timeline
4809
+ * charts the tooltip arrow pins the box to the hovered bar, so set
4810
+ * `arrow: false` there to have the box follow the pointer.
4811
+ */
4762
4812
  followCursor?: boolean
4763
4813
  intersect?: boolean
4764
4814
  inverseOrder?: boolean