billboard.js 4.1.3 → 4.1.5

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 (234) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +156 -87
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +19 -19
  5. package/dist/billboard.pkgd.js +156 -87
  6. package/dist/billboard.pkgd.min.js +23 -23
  7. package/dist/billboard.react.js +1 -1
  8. package/dist/billboard.react.min.js +1 -1
  9. package/dist/billboard.worker.js +1 -1
  10. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  12. package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  14. package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
  17. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  18. package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
  19. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  20. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
  21. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
  22. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2 -2
  23. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
  24. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2 -2
  25. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
  26. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2 -2
  27. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
  28. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
  29. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
  30. package/dist/theme/dark.css +1 -1
  31. package/dist/theme/dark.min.css +1 -1
  32. package/dist/theme/datalab.css +1 -1
  33. package/dist/theme/datalab.min.css +1 -1
  34. package/dist/theme/graph.css +1 -1
  35. package/dist/theme/graph.min.css +1 -1
  36. package/dist/theme/insight.css +1 -1
  37. package/dist/theme/insight.min.css +1 -1
  38. package/dist/theme/modern.css +1 -1
  39. package/dist/theme/modern.min.css +1 -1
  40. package/dist-esm/Chart/Chart.js +1 -1
  41. package/dist-esm/Chart/api/axis.js +1 -1
  42. package/dist-esm/Chart/api/category.js +1 -1
  43. package/dist-esm/Chart/api/chart.js +2 -2
  44. package/dist-esm/Chart/api/color.js +1 -1
  45. package/dist-esm/Chart/api/data.js +1 -1
  46. package/dist-esm/Chart/api/export.js +1 -1
  47. package/dist-esm/Chart/api/flow.js +13 -6
  48. package/dist-esm/Chart/api/focus.js +1 -1
  49. package/dist-esm/Chart/api/grid.js +1 -1
  50. package/dist-esm/Chart/api/group.js +1 -1
  51. package/dist-esm/Chart/api/legend.js +1 -1
  52. package/dist-esm/Chart/api/load.js +1 -1
  53. package/dist-esm/Chart/api/regions.js +1 -1
  54. package/dist-esm/Chart/api/selection.js +1 -1
  55. package/dist-esm/Chart/api/show.js +1 -1
  56. package/dist-esm/Chart/api/stubs.js +1 -1
  57. package/dist-esm/Chart/api/subchart.js +1 -1
  58. package/dist-esm/Chart/api/tooltip.js +1 -1
  59. package/dist-esm/Chart/api/x.js +1 -1
  60. package/dist-esm/Chart/api/zoom.js +1 -1
  61. package/dist-esm/ChartInternal/Axis/Axis.js +1 -1
  62. package/dist-esm/ChartInternal/Axis/AxisRenderer.js +18 -11
  63. package/dist-esm/ChartInternal/Axis/AxisRendererHelper.js +2 -2
  64. package/dist-esm/ChartInternal/ChartInternal.js +1 -1
  65. package/dist-esm/ChartInternal/data/convert.helper.js +1 -1
  66. package/dist-esm/ChartInternal/data/convert.js +1 -1
  67. package/dist-esm/ChartInternal/data/data.js +1 -1
  68. package/dist-esm/ChartInternal/data/load.js +1 -1
  69. package/dist-esm/ChartInternal/interactions/drag.js +1 -1
  70. package/dist-esm/ChartInternal/interactions/eventrect.js +1 -1
  71. package/dist-esm/ChartInternal/interactions/flow.js +23 -16
  72. package/dist-esm/ChartInternal/interactions/interaction.js +1 -1
  73. package/dist-esm/ChartInternal/interactions/subchart.js +1 -1
  74. package/dist-esm/ChartInternal/interactions/zoom.js +1 -1
  75. package/dist-esm/ChartInternal/internals/category.js +1 -1
  76. package/dist-esm/ChartInternal/internals/class.js +1 -1
  77. package/dist-esm/ChartInternal/internals/clip.js +1 -1
  78. package/dist-esm/ChartInternal/internals/color.js +1 -1
  79. package/dist-esm/ChartInternal/internals/domain.js +1 -1
  80. package/dist-esm/ChartInternal/internals/format.js +1 -1
  81. package/dist-esm/ChartInternal/internals/grid.js +1 -1
  82. package/dist-esm/ChartInternal/internals/legend.js +1 -1
  83. package/dist-esm/ChartInternal/internals/redraw.js +6 -6
  84. package/dist-esm/ChartInternal/internals/region.js +1 -1
  85. package/dist-esm/ChartInternal/internals/scale.js +1 -1
  86. package/dist-esm/ChartInternal/internals/selection.js +1 -1
  87. package/dist-esm/ChartInternal/internals/size.axis.js +1 -1
  88. package/dist-esm/ChartInternal/internals/size.js +1 -1
  89. package/dist-esm/ChartInternal/internals/style.js +1 -1
  90. package/dist-esm/ChartInternal/internals/subchart.util.js +1 -1
  91. package/dist-esm/ChartInternal/internals/text.arc.js +1 -1
  92. package/dist-esm/ChartInternal/internals/text.js +5 -2
  93. package/dist-esm/ChartInternal/internals/text.util.js +1 -1
  94. package/dist-esm/ChartInternal/internals/title.js +1 -1
  95. package/dist-esm/ChartInternal/internals/tooltip.js +23 -4
  96. package/dist-esm/ChartInternal/internals/transform.js +1 -1
  97. package/dist-esm/ChartInternal/internals/type.js +1 -1
  98. package/dist-esm/ChartInternal/shape/arc.js +1 -1
  99. package/dist-esm/ChartInternal/shape/area.js +1 -1
  100. package/dist-esm/ChartInternal/shape/bar.js +1 -1
  101. package/dist-esm/ChartInternal/shape/bubble.js +1 -1
  102. package/dist-esm/ChartInternal/shape/candlestick.js +1 -1
  103. package/dist-esm/ChartInternal/shape/core/barRadius.js +1 -1
  104. package/dist-esm/ChartInternal/shape/core/bubble.js +1 -1
  105. package/dist-esm/ChartInternal/shape/core/candlestick.js +1 -1
  106. package/dist-esm/ChartInternal/shape/core/dataRegion.js +1 -1
  107. package/dist-esm/ChartInternal/shape/core/geometry.js +1 -1
  108. package/dist-esm/ChartInternal/shape/core/path.js +1 -1
  109. package/dist-esm/ChartInternal/shape/core/point.js +1 -1
  110. package/dist-esm/ChartInternal/shape/core/treemap.js +1 -1
  111. package/dist-esm/ChartInternal/shape/funnel.js +1 -1
  112. package/dist-esm/ChartInternal/shape/gauge.js +1 -1
  113. package/dist-esm/ChartInternal/shape/line.js +1 -1
  114. package/dist-esm/ChartInternal/shape/point.js +5 -4
  115. package/dist-esm/ChartInternal/shape/polar.js +1 -1
  116. package/dist-esm/ChartInternal/shape/radar.js +1 -1
  117. package/dist-esm/ChartInternal/shape/shape.js +9 -5
  118. package/dist-esm/ChartInternal/shape/treemap.js +1 -1
  119. package/dist-esm/canvas/CanvasAxisRenderer.js +18 -15
  120. package/dist-esm/canvas/CanvasEngine.js +1 -1
  121. package/dist-esm/canvas/CanvasPainter.js +1 -1
  122. package/dist-esm/canvas/CanvasRenderer.js +1 -1
  123. package/dist-esm/canvas/CanvasTheme.js +1 -1
  124. package/dist-esm/canvas/HitDetector.js +1 -1
  125. package/dist-esm/canvas/axisTicks.js +1 -1
  126. package/dist-esm/canvas/classes.js +1 -1
  127. package/dist-esm/canvas/color.js +1 -1
  128. package/dist-esm/canvas/geometry.js +1 -1
  129. package/dist-esm/canvas/labels.js +1 -1
  130. package/dist-esm/canvas/pointPattern.js +1 -1
  131. package/dist-esm/canvas/util.js +1 -1
  132. package/dist-esm/config/Options/Options.js +1 -1
  133. package/dist-esm/config/Options/axis/axis.js +1 -1
  134. package/dist-esm/config/Options/axis/x.js +1 -1
  135. package/dist-esm/config/Options/axis/y.js +1 -1
  136. package/dist-esm/config/Options/axis/y2.js +1 -1
  137. package/dist-esm/config/Options/common/boost.js +1 -1
  138. package/dist-esm/config/Options/common/color.js +1 -1
  139. package/dist-esm/config/Options/common/grid.js +1 -1
  140. package/dist-esm/config/Options/common/legend.js +1 -1
  141. package/dist-esm/config/Options/common/main.js +1 -1
  142. package/dist-esm/config/Options/common/point.js +1 -1
  143. package/dist-esm/config/Options/common/title.js +1 -1
  144. package/dist-esm/config/Options/common/tooltip.js +1 -1
  145. package/dist-esm/config/Options/data/axis.js +1 -1
  146. package/dist-esm/config/Options/data/data.js +1 -1
  147. package/dist-esm/config/Options/data/selection.js +1 -1
  148. package/dist-esm/config/Options/interaction/interaction.js +1 -1
  149. package/dist-esm/config/Options/interaction/subchart.js +5 -1
  150. package/dist-esm/config/Options/interaction/zoom.js +1 -1
  151. package/dist-esm/config/Options/shape/arc.js +1 -1
  152. package/dist-esm/config/Options/shape/area.js +1 -1
  153. package/dist-esm/config/Options/shape/bar.js +1 -1
  154. package/dist-esm/config/Options/shape/bubble.js +1 -1
  155. package/dist-esm/config/Options/shape/candlestick.js +1 -1
  156. package/dist-esm/config/Options/shape/donut.js +1 -1
  157. package/dist-esm/config/Options/shape/funnel.js +1 -1
  158. package/dist-esm/config/Options/shape/gauge.js +1 -1
  159. package/dist-esm/config/Options/shape/line.js +1 -1
  160. package/dist-esm/config/Options/shape/pie.js +1 -1
  161. package/dist-esm/config/Options/shape/polar.js +1 -1
  162. package/dist-esm/config/Options/shape/radar.js +1 -1
  163. package/dist-esm/config/Options/shape/scatter.js +1 -1
  164. package/dist-esm/config/Options/shape/spline.js +1 -1
  165. package/dist-esm/config/Options/shape/treemap.js +1 -1
  166. package/dist-esm/config/Store/Element.js +1 -1
  167. package/dist-esm/config/Store/State.js +2 -1
  168. package/dist-esm/config/Store/Store.js +1 -1
  169. package/dist-esm/config/classes.js +1 -1
  170. package/dist-esm/config/config.js +1 -1
  171. package/dist-esm/config/const.js +1 -1
  172. package/dist-esm/config/resolver/axis.core.js +1 -1
  173. package/dist-esm/config/resolver/axis.js +1 -1
  174. package/dist-esm/config/resolver/canvas.js +15 -3
  175. package/dist-esm/config/resolver/canvasShape.js +1 -1
  176. package/dist-esm/config/resolver/category.js +1 -1
  177. package/dist-esm/config/resolver/export.js +1 -1
  178. package/dist-esm/config/resolver/flow.js +1 -1
  179. package/dist-esm/config/resolver/grid.js +1 -1
  180. package/dist-esm/config/resolver/interaction/selection.js +1 -1
  181. package/dist-esm/config/resolver/interaction/subchart.js +1 -1
  182. package/dist-esm/config/resolver/interaction/zoom.js +1 -1
  183. package/dist-esm/config/resolver/regions.js +1 -1
  184. package/dist-esm/config/resolver/shape/arc.helpers.js +1 -1
  185. package/dist-esm/config/resolver/shape/area.js +1 -1
  186. package/dist-esm/config/resolver/shape/axis.helpers.js +1 -1
  187. package/dist-esm/config/resolver/shape/bar.js +1 -1
  188. package/dist-esm/config/resolver/shape/bubble.js +1 -1
  189. package/dist-esm/config/resolver/shape/candlestick.js +1 -1
  190. package/dist-esm/config/resolver/shape/donut.js +1 -1
  191. package/dist-esm/config/resolver/shape/funnel.js +1 -1
  192. package/dist-esm/config/resolver/shape/gauge.js +1 -1
  193. package/dist-esm/config/resolver/shape/line.js +1 -1
  194. package/dist-esm/config/resolver/shape/pie.js +1 -1
  195. package/dist-esm/config/resolver/shape/polar.js +1 -1
  196. package/dist-esm/config/resolver/shape/radar.js +1 -1
  197. package/dist-esm/config/resolver/shape/scatter.js +1 -1
  198. package/dist-esm/config/resolver/shape/treemap.js +1 -1
  199. package/dist-esm/core.js +3 -3
  200. package/dist-esm/index.canvas.js +1 -1
  201. package/dist-esm/index.esm.js +1 -1
  202. package/dist-esm/module/Cache.js +1 -1
  203. package/dist-esm/module/browser.js +1 -1
  204. package/dist-esm/module/dsv.js +1 -1
  205. package/dist-esm/module/error.js +1 -1
  206. package/dist-esm/module/generator.js +1 -1
  207. package/dist-esm/module/sanitize.js +1 -1
  208. package/dist-esm/module/util/brush.js +1 -1
  209. package/dist-esm/module/util/dom.js +1 -1
  210. package/dist-esm/module/util/object.js +1 -1
  211. package/dist-esm/module/util/type-checks.js +1 -1
  212. package/dist-esm/module/worker.js +1 -1
  213. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  214. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  215. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  216. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  217. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  218. package/dist-esm/react/index.js +1 -1
  219. package/package.json +1 -1
  220. package/src/Chart/api/chart.ts +2 -1
  221. package/src/Chart/api/flow.ts +20 -7
  222. package/src/ChartInternal/Axis/AxisRenderer.ts +20 -18
  223. package/src/ChartInternal/Axis/AxisRendererHelper.ts +3 -1
  224. package/src/ChartInternal/interactions/flow.ts +50 -19
  225. package/src/ChartInternal/internals/redraw.ts +15 -9
  226. package/src/ChartInternal/internals/text.ts +4 -0
  227. package/src/ChartInternal/internals/tooltip.ts +24 -6
  228. package/src/ChartInternal/shape/point.ts +6 -3
  229. package/src/ChartInternal/shape/shape.ts +15 -3
  230. package/src/canvas/CanvasAxisRenderer.ts +19 -22
  231. package/src/config/Options/interaction/subchart.ts +4 -0
  232. package/src/config/Store/State.ts +1 -0
  233. package/src/config/resolver/canvas.ts +20 -2
  234. package/types/options.d.ts +3 -0
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 4.1.3
8
+ * @version 4.1.5
9
9
  */
10
10
  /*-- Chart --*/
11
11
  .bb svg {
package/dist/billboard.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 4.1.3
8
+ * @version 4.1.5
9
9
  */
10
10
  (function webpackUniversalModuleDefinition(root, factory) {
11
11
  if(typeof exports === 'object' && typeof module === 'object')
@@ -2493,23 +2493,27 @@ function splitTickTextByWidth(text, width, painter) {
2493
2493
  return [text];
2494
2494
  }
2495
2495
  const charWidth = painter.measureText("0").width || 5.5;
2496
- function split(lines, value) {
2496
+ const lines = [];
2497
+ let start = 0;
2498
+ while (true) {
2497
2499
  let spaceIndex;
2498
- for (let i = 1; i < value.length; i++) {
2499
- if (value.charAt(i) === " ") {
2500
+ let splitAt = -1;
2501
+ for (let i = 1; start + i < text.length; i++) {
2502
+ if (text.charAt(start + i) === " ") {
2500
2503
  spaceIndex = i;
2501
2504
  }
2502
2505
  if (width < charWidth * (i + 1)) {
2503
- const splitIndex = spaceIndex || i;
2504
- return split(
2505
- lines.concat(value.slice(0, splitIndex)),
2506
- value.slice(spaceIndex ? spaceIndex + 1 : i)
2507
- );
2506
+ splitAt = i;
2507
+ break;
2508
2508
  }
2509
2509
  }
2510
- return lines.concat(value);
2510
+ if (splitAt === -1) {
2511
+ lines.push(text.slice(start));
2512
+ return lines;
2513
+ }
2514
+ lines.push(text.slice(start, start + (spaceIndex || splitAt)));
2515
+ start += spaceIndex ? spaceIndex + 1 : splitAt;
2511
2516
  }
2512
- return split([], text);
2513
2517
  }
2514
2518
  function getXTickTextWidth($$, ticks, isRotated, targetScale) {
2515
2519
  var _a, _b;
@@ -10762,6 +10766,7 @@ class State {
10762
10766
  isCanvasMode: false,
10763
10767
  canvasShape: null,
10764
10768
  canvasFocusKey: null,
10769
+ canvasFocusData: null,
10765
10770
  canvasSubchartBrushDragging: false,
10766
10771
  canvasSubchartBrushMode: null,
10767
10772
  canvasSubchartBrushStart: null,
@@ -15344,7 +15349,7 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
15344
15349
 
15345
15350
  /* harmony default export */ var redraw = ({
15346
15351
  redraw(options = {}) {
15347
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
15352
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
15348
15353
  const $$ = this;
15349
15354
  const { config, state, $el } = $$;
15350
15355
  const { main, treemap } = $el;
@@ -15380,27 +15385,27 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
15380
15385
  $$.updateSizes(initializing);
15381
15386
  if (state.isCanvasMode) {
15382
15387
  const zoomScale = $$.scale.zoom;
15383
- const zoomDomain = zoomScale == null ? void 0 : zoomScale.domain();
15388
+ const zoomDomain = (_d = (_c = zoomScale == null ? void 0 : zoomScale.orgDomain) == null ? void 0 : _c.call(zoomScale)) != null ? _d : zoomScale == null ? void 0 : zoomScale.domain();
15384
15389
  zoomScale && ($$.scale.zoom = null);
15385
15390
  $$.updateScales(initializing, wth.UpdateXDomain);
15386
15391
  if (zoomScale) {
15387
15392
  zoomScale.range($$.scale.x.range());
15388
15393
  zoomDomain && zoomScale.domain(zoomDomain);
15389
- $$.scale.zoom = $$.getCustomizedXScale(zoomScale);
15394
+ $$.scale.zoom = $$.getCustomizedXScale((_f = (_e = zoomScale.orgScale) == null ? void 0 : _e.call(zoomScale)) != null ? _f : zoomScale);
15390
15395
  $$.axis.x.scale($$.scale.zoom);
15391
15396
  $$.scale.x.domain(config.zoom_rescale ? zoomDomain : $$.org.xDomain);
15392
15397
  $$.scale.subX.domain($$.org.xDomain);
15393
15398
  }
15394
15399
  state.hasAxis && $$.axis.syncAxisDomains(targetsToShow, wth, flow);
15395
- state.hasAxis && ((_c = $$.applyCanvasSubchartDomain) == null ? void 0 : _c.call($$));
15400
+ state.hasAxis && ((_g = $$.applyCanvasSubchartDomain) == null ? void 0 : _g.call($$));
15396
15401
  const shape = needShapeUpdate ? $$.getDrawShape() : state._cachedDrawShape || $$.getDrawShape();
15397
15402
  if (needShapeUpdate) {
15398
15403
  state._cachedDrawShape = shape;
15399
15404
  }
15400
15405
  if (config.legend_show && $el.legend && !(config.legend_contents_bindto && config.legend_contents_template)) {
15401
- (_d = $$.positionHtmlLegend) == null ? void 0 : _d.call($$);
15406
+ (_h = $$.positionHtmlLegend) == null ? void 0 : _h.call($$);
15402
15407
  }
15403
- (_e = $$.resizeCanvas) == null ? void 0 : _e.call($$);
15408
+ (_i = $$.resizeCanvas) == null ? void 0 : _i.call($$);
15404
15409
  state.canvasFocusKey = null;
15405
15410
  $$.renderCanvasFrame(shape, null, true);
15406
15411
  initializing && $$.updateTypesElements();
@@ -15421,11 +15426,11 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
15421
15426
  $$.updateDimension(true);
15422
15427
  }
15423
15428
  config.data_empty_label_text && main.select(`text.${$TEXT.text}.${$COMMON.empty}`).attr("x", state.width / 2).attr("y", state.height / 2).text(config.data_empty_label_text).style("display", targetsToShow.length ? "none" : null);
15424
- (_f = $$.redrawTitle) == null ? void 0 : _f.call($$);
15429
+ (_j = $$.redrawTitle) == null ? void 0 : _j.call($$);
15425
15430
  if (state.hasAxis) {
15426
15431
  $$.axis.redrawAxis(targetsToShow, wth, transitions, flow, initializing);
15427
- ((_g = $$.hasGrid) == null ? void 0 : _g.call($$)) && $$.updateGrid();
15428
- config.regions.length && ((_h = $$.updateRegion) == null ? void 0 : _h.call($$));
15432
+ ((_k = $$.hasGrid) == null ? void 0 : _k.call($$)) && $$.updateGrid();
15433
+ config.regions.length && ((_l = $$.updateRegion) == null ? void 0 : _l.call($$));
15429
15434
  ["bar", "candlestick", "line", "area"].forEach((v) => {
15430
15435
  const name = capitalize(v);
15431
15436
  if (/^(line|area)$/.test(v) && $$.hasTypeOf(name) || $$.hasType(v)) {
@@ -15437,7 +15442,7 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
15437
15442
  $el.text && main.selectAll(`.${$SELECT.selectedCircles}`).filter($$.isBarType.bind($$)).selectAll("circle").remove();
15438
15443
  if (config.interaction_enabled && !flow && wth.EventRect) {
15439
15444
  $$.redrawEventRect();
15440
- (_i = $$.bindZoomEvent) == null ? void 0 : _i.call($$);
15445
+ (_m = $$.bindZoomEvent) == null ? void 0 : _m.call($$);
15441
15446
  }
15442
15447
  } else {
15443
15448
  $el.arcs && $$.redrawArc(duration, durationForExit, wth.Transform);
@@ -15448,9 +15453,9 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
15448
15453
  }
15449
15454
  if (!state.resizing && !treemap && ($$.hasPointType() || state.hasRadar)) {
15450
15455
  if (needShapeUpdate) {
15451
- $$.updateCircle();
15456
+ $$.updateCircle(false, !!flow);
15452
15457
  }
15453
- } else if ((_j = $$.hasLegendDefsPoint) == null ? void 0 : _j.call($$)) {
15458
+ } else if ((_n = $$.hasLegendDefsPoint) == null ? void 0 : _n.call($$)) {
15454
15459
  $$.data.targets.forEach($$.point("create", this));
15455
15460
  }
15456
15461
  if ($$.hasDataLabel() && !$$.hasArcType(null, ["radar"])) {
@@ -15475,13 +15480,13 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
15475
15480
  generateRedrawList(targets, flow, duration, withSubchart, needShapeRegen = true) {
15476
15481
  const $$ = this;
15477
15482
  const { config, state } = $$;
15483
+ if (state.hasAxis) {
15484
+ config.subchart_show && $$.redrawSubchart(withSubchart, duration);
15485
+ }
15478
15486
  const shape = needShapeRegen ? $$.getDrawShape() : state._cachedDrawShape || $$.getDrawShape();
15479
15487
  if (needShapeRegen) {
15480
15488
  state._cachedDrawShape = shape;
15481
15489
  }
15482
- if (state.hasAxis) {
15483
- config.subchart_show && $$.redrawSubchart(withSubchart, duration, shape);
15484
- }
15485
15490
  const flowFn = flow && $$.generateFlow({
15486
15491
  targets,
15487
15492
  flow,
@@ -15489,7 +15494,7 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
15489
15494
  shape,
15490
15495
  xv: $$.xv.bind($$)
15491
15496
  });
15492
- const withTransition = (duration || flowFn) && isTabVisible();
15497
+ const withTransition = !flowFn && duration && isTabVisible();
15493
15498
  const redrawList = $$.getRedrawList(shape, flow, flowFn, withTransition);
15494
15499
  const afterRedraw = () => {
15495
15500
  flowFn && flowFn();
@@ -16350,6 +16355,7 @@ function batchGetBBox(elements) {
16350
16355
  });
16351
16356
  }
16352
16357
  text.each(function(d, i) {
16358
+ var _a;
16353
16359
  const labelDimension = dimensions.get(this);
16354
16360
  const node = $T(
16355
16361
  hasTreemap && this.childElementCount ? this.parentNode : this,
@@ -16370,6 +16376,7 @@ function batchGetBBox(elements) {
16370
16376
  node.attr("transform", `translate(${pos.x} ${pos.y}) ${rotateString}`);
16371
16377
  } else {
16372
16378
  node.attr("x", pos.x).attr("y", pos.y);
16379
+ hasTreemap && ((_a = this.parentNode) == null ? void 0 : _a.removeAttribute("transform"));
16373
16380
  }
16374
16381
  config.data_labels.border && updateTextBorder.call($$, node.node(), pos, `${$TEXT.textBorderRect}-${i}`);
16375
16382
  });
@@ -16737,6 +16744,11 @@ function _getCanvasTitleHeight($$) {
16737
16744
 
16738
16745
  const RE_WHITESPACE = /(\r?\n|\t)/g;
16739
16746
  const RE_TOOLTIP_TPL = /{{(.*)}}/;
16747
+ function getRangeValueHtml(values) {
16748
+ return `<div style="display:inline-grid;grid-template-columns:auto auto;gap:0 .3em;text-align:left">${values.map(([name, v]) => `<b style="text-align:right">${name}:</b><span>${v}</span>`).join(
16749
+ ""
16750
+ )}</div>`;
16751
+ }
16740
16752
  /* harmony default export */ var internals_tooltip = ({
16741
16753
  /**
16742
16754
  * Initializes the tooltip
@@ -16877,7 +16889,7 @@ const RE_TOOLTIP_TPL = /{{(.*)}}/;
16877
16889
  (v) => valueFormat($$.getRangedData(row, v), ...param)
16878
16890
  );
16879
16891
  const mid = valueFormat(getRowValue(row), ...param);
16880
- value = `<b>Mid:</b> ${mid} <b>High:</b> ${high} <b>Low:</b> ${low}`;
16892
+ value = getRangeValueHtml([["Mid", mid], ["High", high], ["Low", low]]);
16881
16893
  } else if ($$.isCandlestickType(row)) {
16882
16894
  const [open, high, low, close, volume] = ["open", "high", "low", "close", "volume"].map((v) => {
16883
16895
  const value2 = $$.getRangedData(row, v, "candlestick");
@@ -16886,7 +16898,13 @@ const RE_TOOLTIP_TPL = /{{(.*)}}/;
16886
16898
  ...param
16887
16899
  ) : void 0;
16888
16900
  });
16889
- value = `<b>Open:</b> ${open} <b>High:</b> ${high} <b>Low:</b> ${low} <b>Close:</b> ${close}${volume ? ` <b>Volume:</b> ${volume}` : ""}`;
16901
+ value = getRangeValueHtml([
16902
+ ["Open", open],
16903
+ ["High", high],
16904
+ ["Low", low],
16905
+ ["Close", close],
16906
+ ...volume ? [["Volume", volume]] : []
16907
+ ]);
16890
16908
  } else if ($$.isBarRangeType(row)) {
16891
16909
  const { value: rangeValue, id, index } = row;
16892
16910
  value = `${valueFormat(rangeValue, void 0, id, index)}`;
@@ -17229,7 +17247,7 @@ const RE_TOOLTIP_TPL = /{{(.*)}}/;
17229
17247
  $el: { eventRect, svg, tooltip },
17230
17248
  state: { event, hasAxis, hasRadar, hasTreemap }
17231
17249
  } = $$;
17232
- if ($$.state.isCanvasMode) {
17250
+ if ($$.state.isCanvasMode || $$.state.flowing) {
17233
17251
  return;
17234
17252
  }
17235
17253
  if ((tooltip == null ? void 0 : tooltip.style("display")) === "block" && event) {
@@ -17702,6 +17720,9 @@ function getSubchartCandlestickShapeValue($$, d, isSub) {
17702
17720
  return void 0;
17703
17721
  }
17704
17722
  if ($$.isBarType(d)) {
17723
+ if (isNumber(value.volume)) {
17724
+ return value.volume;
17725
+ }
17705
17726
  return isNumber(value.open) && isNumber(value.close) ? value._isUp ? value.close : value.open : void 0;
17706
17727
  }
17707
17728
  return isNumber(value.close) ? value.close : void 0;
@@ -18356,23 +18377,25 @@ function updateTargetsForShape(targets, config) {
18356
18377
  return sensitivity;
18357
18378
  },
18358
18379
  getBarW(type, axis, targetsNum) {
18359
- var _a, _b, _c, _d, _e;
18380
+ var _a, _b, _c, _d;
18360
18381
  const $$ = this;
18361
18382
  const { config, org, scale, state } = $$;
18362
18383
  const maxDataCount = $$.getMaxDataCount();
18363
18384
  const isGrouped = type === "bar" && ((_a = config.data_groups) == null ? void 0 : _a.length);
18364
18385
  const configName = `${type}_width`;
18365
- const { k } = (_c = (_b = $$.getZoomTransform) == null ? void 0 : _b.call($$)) != null ? _c : { k: 1 };
18366
18386
  const xMinMax = [
18367
- (_d = config.axis_x_min) != null ? _d : org.xDomain[0],
18368
- (_e = config.axis_x_max) != null ? _e : org.xDomain[1]
18387
+ (_b = config.axis_x_min) != null ? _b : org.xDomain[0],
18388
+ (_c = config.axis_x_max) != null ? _c : org.xDomain[1]
18369
18389
  ].map((v) => $$.axis.isTimeSeries() ? parseDate.call($$, v) : Number(v));
18370
18390
  let tickInterval = axis.tickInterval(maxDataCount);
18371
- if (scale.zoom && !$$.axis.isCategorized() && k > 1) {
18391
+ const xScale = (_d = scale.zoom) != null ? _d : scale.x;
18392
+ const getSpan = ([min, max]) => Math.abs(+max - +min);
18393
+ const isZoomed = axis !== $$.axis.subX && !$$.axis.isCategorized() && getSpan(xScale.domain()) < getSpan(org.xDomain);
18394
+ if (isZoomed) {
18372
18395
  const isSameMinMax = xMinMax.every((v, i) => v === org.xDomain[i]);
18373
18396
  tickInterval = org.xDomain.map((v, i) => {
18374
18397
  const value = isSameMinMax ? v : v - Math.abs(xMinMax[i]);
18375
- return scale.zoom(value);
18398
+ return xScale(value);
18376
18399
  }).reduce((a, c) => Math.abs(a) + c) / maxDataCount;
18377
18400
  }
18378
18401
  const getWidth = (id) => {
@@ -19847,6 +19870,17 @@ const canvasInternal = {
19847
19870
  }
19848
19871
  callCallback && config.subchart_onbrush.bind($$.api)(scale.x.orgDomain());
19849
19872
  },
19873
+ /**
19874
+ * Show the focus and tooltip of the data the flow moved under the pointer.
19875
+ * @private
19876
+ */
19877
+ updateCanvasFlowFocus() {
19878
+ var _a;
19879
+ const $$ = this;
19880
+ const { state } = $$;
19881
+ state.canvasFocusKey = null;
19882
+ ((_a = $$.$el.tooltip) == null ? void 0 : _a.style("display")) === "block" && state.event && $$.onCanvasMouseMove(state.event);
19883
+ },
19850
19884
  /**
19851
19885
  * Finish a pending canvas flow animation before accepting another flow mutation.
19852
19886
  * @private
@@ -19868,7 +19902,7 @@ const canvasInternal = {
19868
19902
  * @private
19869
19903
  */
19870
19904
  animateCanvasFlow(flow) {
19871
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
19905
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
19872
19906
  const $$ = this;
19873
19907
  const { axis, data, org, scale, state } = $$;
19874
19908
  const { done = () => {
@@ -19881,6 +19915,7 @@ const canvasInternal = {
19881
19915
  const startDomain = scale.x.domain().slice(0, 2);
19882
19916
  const startOrgDomain = (_d = (_c = org.xDomain) == null ? void 0 : _c.slice) == null ? void 0 : _d.call(_c);
19883
19917
  const startSubXDomain = (_h = (_f = (_e = scale.subX) == null ? void 0 : _e.domain) == null ? void 0 : (_g = _f.call(_e)).slice) == null ? void 0 : _h.call(_g);
19918
+ const focusData = state.canvasFocusKey ? state.canvasFocusData : null;
19884
19919
  if (!isCanvasFlowDomain(startDomain, isLog)) {
19885
19920
  return false;
19886
19921
  }
@@ -19930,6 +19965,7 @@ const canvasInternal = {
19930
19965
  state.canvasFlowFrame = null;
19931
19966
  state.canvasFlowFinish = null;
19932
19967
  state.flowing = false;
19968
+ $$.updateCanvasFlowFocus();
19933
19969
  done.call($$.api);
19934
19970
  };
19935
19971
  const render = (timestamp) => {
@@ -19941,7 +19977,7 @@ const canvasInternal = {
19941
19977
  state._cachedDrawShape = null;
19942
19978
  state._canvasVisibleRangeCache = null;
19943
19979
  state._canvasXTickValuesCache = null;
19944
- $$.renderCanvasFrame(void 0, null, false);
19980
+ $$.renderCanvasFrame(void 0, focusData, false);
19945
19981
  if (ratio < 1) {
19946
19982
  state.canvasFlowFrame = requestFrame(render);
19947
19983
  } else {
@@ -19954,7 +19990,6 @@ const canvasInternal = {
19954
19990
  axis.x.scale(scale.x);
19955
19991
  state.flowing = true;
19956
19992
  state.cancelClick = true;
19957
- (_k = $$.hideTooltip) == null ? void 0 : _k.call($$);
19958
19993
  state.canvasFlowFinish = finish;
19959
19994
  state.canvasFlowFrame = requestFrame(render);
19960
19995
  return true;
@@ -21298,6 +21333,7 @@ const canvasInternal = {
21298
21333
  const $$ = this;
21299
21334
  const { state } = $$;
21300
21335
  const withMainRedraw = (_b = (_a = $$.canvasRenderer).hasExpandedShapeFocus) == null ? void 0 : _b.call(_a, $$, focusData);
21336
+ state.canvasFocusData = focusData;
21301
21337
  if (withMainRedraw) {
21302
21338
  const drawShape = state.canvasShape || $$.getDrawShape();
21303
21339
  $$.canvasEngine.beginFrame(state.current.width, $$.getCanvasSurfaceHeight());
@@ -21499,7 +21535,7 @@ function loadConfig(config) {
21499
21535
  * chart.flush(true);
21500
21536
  */
21501
21537
  flush(soft) {
21502
- var _a, _b;
21538
+ var _a, _b, _c, _d;
21503
21539
  const $$ = this.internal;
21504
21540
  const { state, $el: { zoomResetBtn } } = $$;
21505
21541
  if (state.rendered) {
@@ -21510,7 +21546,7 @@ function loadConfig(config) {
21510
21546
  }
21511
21547
  zoomResetBtn == null ? void 0 : zoomResetBtn.style("display", "none");
21512
21548
  if ($$.scale.zoom) {
21513
- state.current.zoomDomain = $$.scale.zoom.domain();
21549
+ state.current.zoomDomain = (_d = (_c = $$.zoom) == null ? void 0 : _c.getDomain()) != null ? _d : $$.scale.zoom.domain();
21514
21550
  }
21515
21551
  $$.scale.zoom = null;
21516
21552
  if (!state.resizing) {
@@ -22887,7 +22923,7 @@ let exportApi = () => {
22887
22923
  });
22888
22924
  }
22889
22925
  function _() {
22890
- var _a, _b, _c;
22926
+ var _a, _b, _c, _d, _e;
22891
22927
  let domain;
22892
22928
  let length = 0;
22893
22929
  let tail = 0;
@@ -22901,6 +22937,12 @@ let exportApi = () => {
22901
22937
  const orgDataCount = $$.getMaxDataCount();
22902
22938
  const targets = $$.convertDataToTargets(data, true);
22903
22939
  const isTimeSeries = $$.axis.isTimeSeries();
22940
+ const isCustomX = !isTimeSeries && $$.axis.isCustomX() && !$$.axis.isCategorized();
22941
+ const hasDataX = isTimeSeries || isCustomX;
22942
+ const firstValue = (_b = $$.data.targets.find((t) => t.values.length)) == null ? void 0 : _b.values[0];
22943
+ const xOffset = firstValue ? firstValue.x - firstValue.index : 0;
22944
+ const getX = (index) => isTimeSeries ? $$.getOtherTargetX(index) : index + xOffset;
22945
+ const flowedXs = [];
22904
22946
  $$.data.targets.forEach((t) => {
22905
22947
  let found = false;
22906
22948
  for (let i = 0; i < targets.length; i++) {
@@ -22913,9 +22955,10 @@ let exportApi = () => {
22913
22955
  length = values.length;
22914
22956
  for (let j = 0; j < length; j++) {
22915
22957
  values[j].index = tail + j;
22916
- if (!isTimeSeries) {
22917
- values[j].x = tail + j;
22958
+ if (!hasDataX) {
22959
+ values[j].x = getX(tail + j);
22918
22960
  }
22961
+ flowedXs[j] = values[j].x;
22919
22962
  t.values.push(values[j]);
22920
22963
  }
22921
22964
  targets.splice(i, 1);
@@ -22935,7 +22978,7 @@ let exportApi = () => {
22935
22978
  t.values.push({
22936
22979
  id: t.id,
22937
22980
  index: tail + j,
22938
- x: isTimeSeries ? $$.getOtherTargetX(tail + j) : tail + j,
22981
+ x: isCustomX ? flowedXs[j] : getX(tail + j),
22939
22982
  value: null
22940
22983
  });
22941
22984
  }
@@ -22944,6 +22987,7 @@ let exportApi = () => {
22944
22987
  });
22945
22988
  if ($$.data.targets.length) {
22946
22989
  targets.forEach((t) => {
22990
+ var _a2;
22947
22991
  const firstIndex = $$.data.targets[0].values[0].index;
22948
22992
  const values = t.values;
22949
22993
  const valueLength = values.length;
@@ -22958,7 +23002,7 @@ let exportApi = () => {
22958
23002
  values[i] = {
22959
23003
  id: t.id,
22960
23004
  index,
22961
- x: isTimeSeries ? $$.getOtherTargetX(index) : index,
23005
+ x: isCustomX ? (_a2 = $$.data.targets[0].values[i]) == null ? void 0 : _a2.x : getX(index),
22962
23006
  value: null
22963
23007
  };
22964
23008
  }
@@ -22966,8 +23010,8 @@ let exportApi = () => {
22966
23010
  for (let i = missingLength; i < values.length; i++) {
22967
23011
  const v = values[i];
22968
23012
  v.index += tail;
22969
- if (!isTimeSeries) {
22970
- v.x += tail;
23013
+ if (!hasDataX) {
23014
+ v.x = getX(v.index);
22971
23015
  }
22972
23016
  }
22973
23017
  });
@@ -23000,7 +23044,7 @@ let exportApi = () => {
23000
23044
  domain && $$.updateXDomain(null, true, true, false, domain);
23001
23045
  if ($$.state.isCanvasMode) {
23002
23046
  const duration = isValue(args.duration) ? args.duration : $$.config.transition_duration;
23003
- const animated = (_b = $$.animateCanvasFlow) == null ? void 0 : _b.call($$, {
23047
+ const animated = (_c = $$.animateCanvasFlow) == null ? void 0 : _c.call($$, {
23004
23048
  done: args.done,
23005
23049
  duration,
23006
23050
  length,
@@ -23025,7 +23069,8 @@ let exportApi = () => {
23025
23069
  withUpdateXDomain: true
23026
23070
  });
23027
23071
  $$.updateTypesElements();
23028
- (_c = args.done) == null ? void 0 : _c.call($$.api);
23072
+ (_d = $$.updateCanvasFlowFocus) == null ? void 0 : _d.call($$);
23073
+ (_e = args.done) == null ? void 0 : _e.call($$.api);
23029
23074
  return;
23030
23075
  }
23031
23076
  $$.updateTargets($$.data.targets);
@@ -23033,7 +23078,6 @@ let exportApi = () => {
23033
23078
  $$.state._eventRectFingerprint = null;
23034
23079
  $$.redraw({
23035
23080
  flow: {
23036
- index: baseValue.index,
23037
23081
  length,
23038
23082
  duration: isValue(args.duration) ? args.duration : $$.config.transition_duration,
23039
23083
  done: args.done,
@@ -23061,9 +23105,12 @@ let exportApi = () => {
23061
23105
  */
23062
23106
  generateFlow(args) {
23063
23107
  const $$ = this;
23064
- const { data, state, $el } = $$;
23108
+ const { config, data, state, $el } = $$;
23065
23109
  return function() {
23066
23110
  var _a;
23111
+ if (!$$.$el) {
23112
+ return;
23113
+ }
23067
23114
  const flowLength = args.flow.length;
23068
23115
  state.flowing = true;
23069
23116
  data.targets.forEach((d) => {
@@ -23094,7 +23141,15 @@ let exportApi = () => {
23094
23141
  elements[v] = node;
23095
23142
  }
23096
23143
  });
23097
- (_a = $$.hideGridFocus) == null ? void 0 : _a.call($$);
23144
+ if (config.axis_rotated) {
23145
+ (_a = $$.hideGridFocus) == null ? void 0 : _a.call($$);
23146
+ } else {
23147
+ const xFocus = $el.main.selectAll(
23148
+ `line.${config_classes.xgridFocus}:not(.${config_classes.xgridFocusContinuous})`
23149
+ );
23150
+ xFocus.size() && (elements["gridFocus.x"] = xFocus);
23151
+ $el.main.selectAll(`line.${config_classes.ygridFocus}`).style("visibility", "hidden");
23152
+ }
23098
23153
  $$.setFlowList(elements, args);
23099
23154
  };
23100
23155
  },
@@ -23109,11 +23164,9 @@ let exportApi = () => {
23109
23164
  const { flow, targets } = args;
23110
23165
  const {
23111
23166
  duration = args.duration,
23112
- index: flowIndex,
23113
- length: flowLength,
23114
23167
  orgDataCount
23115
23168
  } = flow;
23116
- const transform = $$.getFlowTransform(targets, orgDataCount, flowIndex, flowLength);
23169
+ const transform = $$.getFlowTransform(targets, orgDataCount);
23117
23170
  const wait = generateWait();
23118
23171
  let n;
23119
23172
  wait.add(Object.keys(elements).map((v) => {
@@ -23140,7 +23193,11 @@ let exportApi = () => {
23140
23193
  * @private
23141
23194
  */
23142
23195
  cleanUpFlow(elements, args) {
23196
+ var _a, _b;
23143
23197
  const $$ = this;
23198
+ if (!$$.$el) {
23199
+ return;
23200
+ }
23144
23201
  const { config, state, $el: { svg } } = $$;
23145
23202
  const isRotated = config.axis_rotated;
23146
23203
  const { flow, shape, xv } = args;
@@ -23151,12 +23208,18 @@ let exportApi = () => {
23151
23208
  length: flowLength
23152
23209
  } = flow;
23153
23210
  if (flowLength) {
23211
+ const isFocusCircle = $$.isPointFocusOnly() ? (node) => {
23212
+ var _a2;
23213
+ return (_a2 = node.parentElement) == null ? void 0 : _a2.classList.contains(config_classes.circles);
23214
+ } : () => false;
23154
23215
  ["circle", "text", "shape", "eventRect"].forEach((v) => {
23155
23216
  const target = [];
23156
23217
  for (let i = 0; i < flowLength; i++) {
23157
23218
  target.push(`.${config_classes[v]}-${i}`);
23158
23219
  }
23159
- svg.selectAll(`.${config_classes[`${v}s`]}`).selectAll(target).remove();
23220
+ svg.selectAll(`.${config_classes[`${v}s`]}`).selectAll(target).filter(function() {
23221
+ return !isFocusCircle(this);
23222
+ }).remove();
23160
23223
  });
23161
23224
  svg.select(`.${config_classes.xgrid}`).remove();
23162
23225
  }
@@ -23187,24 +23250,25 @@ let exportApi = () => {
23187
23250
  }
23188
23251
  });
23189
23252
  config.interaction_enabled && $$.redrawEventRect();
23190
- done.call($$.api);
23191
23253
  state.flowing = false;
23254
+ if (((_a = $$.$el.tooltip) == null ? void 0 : _a.style("display")) === "block") {
23255
+ $$.updateTooltipOnRedraw();
23256
+ } else {
23257
+ (_b = $$.hideGridFocus) == null ? void 0 : _b.call($$);
23258
+ }
23259
+ done.call($$.api);
23192
23260
  },
23193
23261
  /**
23194
23262
  * Get flow transform value
23195
23263
  * @param {object} targets target
23196
23264
  * @param {number} orgDataCount original data count
23197
- * @param {number} flowIndex flow index
23198
- * @param {number} flowLength flow length
23199
23265
  * @returns {string}
23200
23266
  * @private
23201
23267
  */
23202
- getFlowTransform(targets, orgDataCount, flowIndex, flowLength) {
23268
+ getFlowTransform(targets, orgDataCount) {
23203
23269
  const $$ = this;
23204
23270
  const { data, scale: { x } } = $$;
23205
23271
  const dataValues = data.targets[0].values;
23206
- let flowStart = $$.getValueOnIndex(dataValues, flowIndex);
23207
- let flowEnd = $$.getValueOnIndex(dataValues, flowIndex + flowLength);
23208
23272
  let translateX;
23209
23273
  const orgDomain = x.domain();
23210
23274
  const domain = $$.updateXDomain(targets, true, true);
@@ -23213,17 +23277,15 @@ let exportApi = () => {
23213
23277
  translateX = x(orgDomain[0]) - x(domain[0]);
23214
23278
  } else {
23215
23279
  if ($$.axis.isTimeSeries()) {
23216
- flowStart = $$.getValueOnIndex(dataValues, 0);
23217
- flowEnd = $$.getValueOnIndex(dataValues, dataValues.length - 1);
23280
+ const flowStart = $$.getValueOnIndex(dataValues, 0);
23281
+ const flowEnd = $$.getValueOnIndex(dataValues, dataValues.length - 1);
23218
23282
  translateX = x(flowStart.x) - x(flowEnd.x);
23219
23283
  } else {
23220
23284
  translateX = diffDomain(domain) / 2;
23221
23285
  }
23222
23286
  }
23223
- } else if (orgDataCount === 1 || (flowStart == null ? void 0 : flowStart.x) === (flowEnd == null ? void 0 : flowEnd.x)) {
23224
- translateX = x(orgDomain[0]) - x(domain[0]);
23225
23287
  } else {
23226
- translateX = $$.axis.isTimeSeries() ? x(orgDomain[0]) - x(domain[0]) : x((flowStart == null ? void 0 : flowStart.x) || 0) - x(flowEnd.x);
23288
+ translateX = x(orgDomain[0]) - x(domain[0]);
23227
23289
  }
23228
23290
  const scaleX = diffDomain(orgDomain) / diffDomain(domain);
23229
23291
  return `translate(${translateX},0) scale(${scaleX},1)`;
@@ -25047,6 +25109,10 @@ function dispatchSubchartEvent($$, type, event, context) {
25047
25109
  * - **NOTE:** for ESM imports, needs to import 'subchart' exports and instantiate it by calling `subchart()`.
25048
25110
  * - `show: subchart()`
25049
25111
  * @property {string} [subchart.type] Set chart type for the subchart. Defaults to data.type.
25112
+ * - **NOTE:** When candlestick data is rendered as another type in the subchart, the subchart takes one value of the data:
25113
+ * - `bar`: the `volume` of the data. Without `volume`, the close value for a rise and the open value for a fall, from zero.
25114
+ * - other types (`line`, `area`, etc.): the close value.
25115
+ * - The y axis domain of the subchart follows the taken values. The `volume` is not part of the main chart's y axis domain.
25050
25116
  * @property {object} [subchart.types] Set chart type for each data in the subchart. Defaults to data.types.
25051
25117
  * @property {boolean} [subchart.brush.enabled=true] Enable subchart brush interaction.
25052
25118
  * @property {boolean} [subchart.showHandle=false] Show sub chart's handle.
@@ -26733,7 +26799,7 @@ function getPointBBox(node) {
26733
26799
  });
26734
26800
  });
26735
26801
  },
26736
- updateCircle(isSub = false) {
26802
+ updateCircle(isSub = false, withFlow = false) {
26737
26803
  const $$ = this;
26738
26804
  const { config, state, $el } = $$;
26739
26805
  const focusOnly = $$.isPointFocusOnly();
@@ -26748,8 +26814,9 @@ function getPointBBox(node) {
26748
26814
  const pointR = $$.pointR.bind($$);
26749
26815
  const updateCircleColor = $$.generateUpdateCircleColor();
26750
26816
  const initialOpacityForCircle = $$.initialOpacityForCircle.bind($$);
26751
- circles.enter().filter(Boolean).append($$.point("create", this, pointR, updateCircleColor));
26752
- $root.circle = $root.main.selectAll(`.${$CIRCLE.circles} .${$CIRCLE.circle}`).style("stroke", $$.getStylePropValue($$.color)).style("opacity", initialOpacityForCircle);
26817
+ const entered = circles.enter().filter(Boolean).append($$.point("create", this, pointR, updateCircleColor));
26818
+ $root.circle = $root.main.selectAll(`.${$CIRCLE.circles} .${$CIRCLE.circle}`).style("stroke", $$.getStylePropValue($$.color));
26819
+ (focusOnly && withFlow ? entered : $root.circle).style("opacity", initialOpacityForCircle);
26753
26820
  }
26754
26821
  },
26755
26822
  /**
@@ -27640,7 +27707,7 @@ class AxisRendererHelper {
27640
27707
  transitionise(selection) {
27641
27708
  const { config } = this;
27642
27709
  let transitionSelection = selection;
27643
- if (config.withoutTransition) {
27710
+ if (config.withoutTransition && !config.transition) {
27644
27711
  transitionSelection = selection.interrupt();
27645
27712
  } else if (config.transition || !this.owner.params.noTransition) {
27646
27713
  try {
@@ -27988,26 +28055,28 @@ class AxisRenderer {
27988
28055
  if (!tickWidth || tickWidth <= 0) {
27989
28056
  tickWidth = isLeftRight ? 95 : params.isCategory ? (params.isInverted ? scale(ticks[0]) - scale(ticks[1]) : scale(ticks[1]) - scale(ticks[0])) - 12 : 110;
27990
28057
  }
27991
- function split(splitted2, text) {
27992
- let subtext;
28058
+ const text = String(tickText);
28059
+ const result = [];
28060
+ let start = 0;
28061
+ while (true) {
27993
28062
  let spaceIndex;
27994
- let textWidth;
27995
- for (let i = 1; i < text.length; i++) {
27996
- if (text.charAt(i) === " ") {
28063
+ let splitAt = -1;
28064
+ for (let i = 1; start + i < text.length; i++) {
28065
+ if (text.charAt(start + i) === " ") {
27997
28066
  spaceIndex = i;
27998
28067
  }
27999
- subtext = text.substr(0, i + 1);
28000
- textWidth = charWidth * subtext.length;
28001
- if (tickWidth < textWidth) {
28002
- return split(
28003
- splitted2.concat(text.substr(0, spaceIndex || i)),
28004
- text.slice(spaceIndex ? spaceIndex + 1 : i)
28005
- );
28068
+ if (tickWidth < charWidth * (i + 1)) {
28069
+ splitAt = i;
28070
+ break;
28006
28071
  }
28007
28072
  }
28008
- return splitted2.concat(text);
28073
+ if (splitAt === -1) {
28074
+ result.push(text.slice(start));
28075
+ return result;
28076
+ }
28077
+ result.push(text.substr(start, spaceIndex || splitAt));
28078
+ start += spaceIndex ? spaceIndex + 1 : splitAt;
28009
28079
  }
28010
- return split(splitted, String(tickText));
28011
28080
  }
28012
28081
  scale(x) {
28013
28082
  if (!arguments.length) {
@@ -36292,7 +36361,7 @@ const bb = {
36292
36361
  * bb.version; // "1.0.0"
36293
36362
  * @memberof bb
36294
36363
  */
36295
- version: "4.1.3",
36364
+ version: "4.1.5",
36296
36365
  /**
36297
36366
  * Generate chart
36298
36367
  * - **NOTE:** Bear in mind for the possibility of ***throwing an error***, during the generation when: