billboard.js 4.1.4 → 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 (233) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +154 -87
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +19 -19
  5. package/dist/billboard.pkgd.js +154 -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 +1 -1
  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/tooltip.ts +24 -6
  227. package/src/ChartInternal/shape/point.ts +6 -3
  228. package/src/ChartInternal/shape/shape.ts +15 -3
  229. package/src/canvas/CanvasAxisRenderer.ts +19 -22
  230. package/src/config/Options/interaction/subchart.ts +4 -0
  231. package/src/config/Store/State.ts +1 -0
  232. package/src/config/resolver/canvas.ts +20 -2
  233. 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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { notEmpty } from "../../module/util/type-checks.js";
11
11
  import { callFn, capitalize, getOption } from "../../module/util/object.js";
@@ -51,13 +51,13 @@ var redraw_default = {
51
51
  $$.updateSizes(initializing);
52
52
  if (state.isCanvasMode) {
53
53
  const zoomScale = $$.scale.zoom;
54
- const zoomDomain = zoomScale?.domain();
54
+ const zoomDomain = zoomScale?.orgDomain?.() ?? zoomScale?.domain();
55
55
  zoomScale && ($$.scale.zoom = null);
56
56
  $$.updateScales(initializing, wth.UpdateXDomain);
57
57
  if (zoomScale) {
58
58
  zoomScale.range($$.scale.x.range());
59
59
  zoomDomain && zoomScale.domain(zoomDomain);
60
- $$.scale.zoom = $$.getCustomizedXScale(zoomScale);
60
+ $$.scale.zoom = $$.getCustomizedXScale(zoomScale.orgScale?.() ?? zoomScale);
61
61
  $$.axis.x.scale($$.scale.zoom);
62
62
  $$.scale.x.domain(config.zoom_rescale ? zoomDomain : $$.org.xDomain);
63
63
  $$.scale.subX.domain($$.org.xDomain);
@@ -115,7 +115,7 @@ var redraw_default = {
115
115
  treemap && $$.updateTreemap(durationForExit);
116
116
  }
117
117
  if (!state.resizing && !treemap && ($$.hasPointType() || state.hasRadar)) {
118
- if (needShapeUpdate) $$.updateCircle();
118
+ if (needShapeUpdate) $$.updateCircle(false, !!flow);
119
119
  } else if ($$.hasLegendDefsPoint?.()) $$.data.targets.forEach($$.point("create", this));
120
120
  if ($$.hasDataLabel() && !$$.hasArcType(null, ["radar"])) {
121
121
  if (needShapeUpdate) $$.updateText();
@@ -137,9 +137,9 @@ var redraw_default = {
137
137
  generateRedrawList(targets, flow, duration, withSubchart, needShapeRegen = true) {
138
138
  const $$ = this;
139
139
  const { config, state } = $$;
140
+ if (state.hasAxis) config.subchart_show && $$.redrawSubchart(withSubchart, duration);
140
141
  const shape = needShapeRegen ? $$.getDrawShape() : state._cachedDrawShape || $$.getDrawShape();
141
142
  if (needShapeRegen) state._cachedDrawShape = shape;
142
- if (state.hasAxis) config.subchart_show && $$.redrawSubchart(withSubchart, duration, shape);
143
143
  const flowFn = flow && $$.generateFlow({
144
144
  targets,
145
145
  flow,
@@ -147,7 +147,7 @@ var redraw_default = {
147
147
  shape,
148
148
  xv: $$.xv.bind($$)
149
149
  });
150
- const withTransition = (duration || flowFn) && isTabVisible();
150
+ const withTransition = !flowFn && duration && isTabVisible();
151
151
  const redrawList = $$.getRedrawList(shape, flow, flowFn, withTransition);
152
152
  const afterRedraw = () => {
153
153
  flowFn && flowFn();
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isString, isValue } from "../../module/util/type-checks.js";
11
11
  import { parseDate } from "../../module/util/object.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isString, isValue } from "../../module/util/type-checks.js";
11
11
  import { parseDate } from "../../module/util/object.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { callFn } from "../../module/util/object.js";
11
11
  import { $SELECT, $SHAPE } from "../../config/classes.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isNumber } from "../../module/util/type-checks.js";
11
11
  //#region src/ChartInternal/internals/size.axis.ts
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { document as doc } from "../../module/browser.js";
11
11
  import { ceil10, isEmpty, isNumber, isString, isUndefined } from "../../module/util/type-checks.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isFunction, isString } from "../../module/util/type-checks.js";
11
11
  import { addCssRules } from "../../module/util/dom.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  //#region src/ChartInternal/internals/subchart.util.ts
11
11
  /**
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { window as win } from "../../module/browser.js";
11
11
  import { isFunction, isObjectType } from "../../module/util/type-checks.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isFunction, isNumber, isObject, isString } from "../../module/util/type-checks.js";
11
11
  import { capitalize, getRandom } from "../../module/util/object.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isFunction, isNumber } from "../../module/util/type-checks.js";
11
11
  import { parseShorthand, toMap, tplProcess } from "../../module/util/object.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isNumber } from "../../module/util/type-checks.js";
11
11
  import { getBBox, getBoundingRect, getElementPos, setTextValue } from "../../module/util/dom.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { document as doc } from "../../module/browser.js";
11
11
  import { isEmpty, isFunction, isObject, isString, isUndefined, isValue } from "../../module/util/type-checks.js";
@@ -21,6 +21,15 @@ import { select } from "d3-selection";
21
21
  */
22
22
  const RE_WHITESPACE = /(\r?\n|\t)/g;
23
23
  const RE_TOOLTIP_TPL = /{{(.*)}}/;
24
+ /**
25
+ * Get the tooltip value of ranged data: one row per value, aligned on the colon of the names
26
+ * @param {Array} values [name, value] pairs
27
+ * @returns {string} html string
28
+ * @private
29
+ */
30
+ function getRangeValueHtml(values) {
31
+ 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("")}</div>`;
32
+ }
24
33
  var tooltip_default = {
25
34
  /**
26
35
  * Initializes the tooltip
@@ -143,7 +152,11 @@ var tooltip_default = {
143
152
  ];
144
153
  if ($$.isAreaRangeType(row)) {
145
154
  const [high, low] = ["high", "low"].map((v) => valueFormat($$.getRangedData(row, v), ...param));
146
- value = `<b>Mid:</b> ${valueFormat(getRowValue(row), ...param)} <b>High:</b> ${high} <b>Low:</b> ${low}`;
155
+ value = getRangeValueHtml([
156
+ ["Mid", valueFormat(getRowValue(row), ...param)],
157
+ ["High", high],
158
+ ["Low", low]
159
+ ]);
147
160
  } else if ($$.isCandlestickType(row)) {
148
161
  const [open, high, low, close, volume] = [
149
162
  "open",
@@ -154,7 +167,13 @@ var tooltip_default = {
154
167
  ].map((v) => {
155
168
  return $$.getRangedData(row, v, "candlestick") ? valueFormat($$.getRangedData(row, v, "candlestick"), ...param) : void 0;
156
169
  });
157
- value = `<b>Open:</b> ${open} <b>High:</b> ${high} <b>Low:</b> ${low} <b>Close:</b> ${close}${volume ? ` <b>Volume:</b> ${volume}` : ""}`;
170
+ value = getRangeValueHtml([
171
+ ["Open", open],
172
+ ["High", high],
173
+ ["Low", low],
174
+ ["Close", close],
175
+ ...volume ? [["Volume", volume]] : []
176
+ ]);
158
177
  } else if ($$.isBarRangeType(row)) {
159
178
  const { value: rangeValue, id, index } = row;
160
179
  value = `${valueFormat(rangeValue, void 0, id, index)}`;
@@ -440,7 +459,7 @@ var tooltip_default = {
440
459
  updateTooltipOnRedraw(context, index) {
441
460
  const $$ = this;
442
461
  const { config, $el: { eventRect, svg, tooltip }, state: { event, hasAxis, hasRadar, hasTreemap } } = $$;
443
- if ($$.state.isCanvasMode) return;
462
+ if ($$.state.isCanvasMode || $$.state.flowing) return;
444
463
  if (tooltip?.style("display") === "block" && event) {
445
464
  const rect = context ?? (hasRadar ? svg : eventRect)?.node();
446
465
  if (hasAxis || hasRadar) {
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { asHalfPixel } from "../../module/util/type-checks.js";
11
11
  import { $ARC, $AXIS } from "../../config/classes.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { TYPE, TYPE_BY_CATEGORY } from "../../config/const.js";
11
11
  import { isArray, isNumber, isString } from "../../module/util/type-checks.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { document as doc } from "../../module/browser.js";
11
11
  import { isDefined, isFunction, isNumber, isObject, isUndefined } from "../../module/util/type-checks.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { getRandom } from "../../module/util/object.js";
11
11
  import { $AREA, $CIRCLE, $LINE } from "../../config/classes.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isNumber } from "../../module/util/type-checks.js";
11
11
  import { getRandom } from "../../module/util/object.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import bubble_default$1 from "./core/bubble.js";
11
11
  //#region src/ChartInternal/shape/bubble.ts
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isObject } from "../../module/util/type-checks.js";
11
11
  import { getRandom } from "../../module/util/object.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isNumber } from "../../../module/util/type-checks.js";
11
11
  //#region src/ChartInternal/shape/core/barRadius.ts
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isFunction, isNumber, isObject } from "../../../module/util/type-checks.js";
11
11
  import { getMinMax } from "../../../module/util/object.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isArray, isNumber, isObject } from "../../../module/util/type-checks.js";
11
11
  //#region src/ChartInternal/shape/core/candlestick.ts
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isUndefined, isValue } from "../../../module/util/type-checks.js";
11
11
  import { parseDate } from "../../../module/util/object.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  //#region src/ChartInternal/shape/core/geometry.ts
11
11
  /**
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { area, line } from "d3-shape";
11
11
  //#region src/ChartInternal/shape/core/path.ts
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { document as doc } from "../../../module/browser.js";
11
11
  import { isFunction, isObjectType, notEmpty } from "../../../module/util/type-checks.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { hierarchy, treemap, treemapBinary, treemapDice, treemapResquarify, treemapSlice, treemapSliceDice, treemapSquarify } from "d3-hierarchy";
11
11
  //#region src/ChartInternal/shape/core/treemap.ts
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isObject } from "../../module/util/type-checks.js";
11
11
  import { $COMMON, $FUNNEL } from "../../config/classes.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isFunction } from "../../module/util/type-checks.js";
11
11
  import { $ARC, $COMMON, $GAUGE } from "../../config/classes.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isArray, isUndefined, isValue } from "../../module/util/type-checks.js";
11
11
  import { getRandom } from "../../module/util/object.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isObject, isUndefined, isValue } from "../../module/util/type-checks.js";
11
11
  import { getRandom } from "../../module/util/object.js";
@@ -93,7 +93,7 @@ var point_default = {
93
93
  });
94
94
  });
95
95
  },
96
- updateCircle(isSub = false) {
96
+ updateCircle(isSub = false, withFlow = false) {
97
97
  const $$ = this;
98
98
  const { config, state, $el } = $$;
99
99
  const focusOnly = $$.isPointFocusOnly();
@@ -108,8 +108,9 @@ var point_default = {
108
108
  const pointR = $$.pointR.bind($$);
109
109
  const updateCircleColor = $$.generateUpdateCircleColor();
110
110
  const initialOpacityForCircle = $$.initialOpacityForCircle.bind($$);
111
- circles.enter().filter(Boolean).append($$.point("create", this, pointR, updateCircleColor));
112
- $root.circle = $root.main.selectAll(`.${$CIRCLE.circles} .${$CIRCLE.circle}`).style("stroke", $$.getStylePropValue($$.color)).style("opacity", initialOpacityForCircle);
111
+ const entered = circles.enter().filter(Boolean).append($$.point("create", this, pointR, updateCircleColor));
112
+ $root.circle = $root.main.selectAll(`.${$CIRCLE.circles} .${$CIRCLE.circle}`).style("stroke", $$.getStylePropValue($$.color));
113
+ (focusOnly && withFlow ? entered : $root.circle).style("opacity", initialOpacityForCircle);
113
114
  }
114
115
  },
115
116
  /**
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { getRange } from "../../module/util/object.js";
11
11
  import { $LEVEL } from "../../config/classes.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isDefined, isEmpty, isNumber, isUndefined } from "../../module/util/type-checks.js";
11
11
  import { getMinMax, getRange, toArray } from "../../module/util/object.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { TYPE } from "../../config/const.js";
11
11
  import { isFunction, isNumber, isObjectType, isUndefined, isValue, notEmpty } from "../../module/util/type-checks.js";
@@ -85,7 +85,10 @@ function getSubchartCandlestickShapeValue($$, d, isSub) {
85
85
  if (!isSub || $$.isCandlestickType?.(d) || !$$.isSubchartSourceTypeOf?.(d, TYPE.CANDLESTICK)) return;
86
86
  const value = $$.getCandlestickData?.(d);
87
87
  if (!value) return;
88
- if ($$.isBarType(d)) return isNumber(value.open) && isNumber(value.close) ? value._isUp ? value.close : value.open : void 0;
88
+ if ($$.isBarType(d)) {
89
+ if (isNumber(value.volume)) return value.volume;
90
+ return isNumber(value.open) && isNumber(value.close) ? value._isUp ? value.close : value.open : void 0;
91
+ }
89
92
  return isNumber(value.close) ? value.close : void 0;
90
93
  }
91
94
  /**
@@ -702,14 +705,15 @@ var shape_default = {
702
705
  const maxDataCount = $$.getMaxDataCount();
703
706
  const isGrouped = type === "bar" && config.data_groups?.length;
704
707
  const configName = `${type}_width`;
705
- const { k } = $$.getZoomTransform?.() ?? { k: 1 };
706
708
  const xMinMax = [config.axis_x_min ?? org.xDomain[0], config.axis_x_max ?? org.xDomain[1]].map((v) => $$.axis.isTimeSeries() ? parseDate.call($$, v) : Number(v));
707
709
  let tickInterval = axis.tickInterval(maxDataCount);
708
- if (scale.zoom && !$$.axis.isCategorized() && k > 1) {
710
+ const xScale = scale.zoom ?? scale.x;
711
+ const getSpan = ([min, max]) => Math.abs(+max - +min);
712
+ if (axis !== $$.axis.subX && !$$.axis.isCategorized() && getSpan(xScale.domain()) < getSpan(org.xDomain)) {
709
713
  const isSameMinMax = xMinMax.every((v, i) => v === org.xDomain[i]);
710
714
  tickInterval = org.xDomain.map((v, i) => {
711
715
  const value = isSameMinMax ? v : v - Math.abs(xMinMax[i]);
712
- return scale.zoom(value);
716
+ return xScale(value);
713
717
  }).reduce((a, c) => Math.abs(a) + c) / maxDataCount;
714
718
  }
715
719
  const getWidth = (id) => {
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isFunction } from "../../module/util/type-checks.js";
11
11
  import { getRandom } from "../../module/util/object.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { getFontSize } from "./util.js";
11
11
  import { getAdditionalAxisScale, getAdditionalAxisTickFormat, getAdditionalAxisTickValues, getSubXTickLineValues, getSubXTickValues, getXScale, getXTickLinePosition, getXTickLineValues, getXTickValues, getYGridTickValues, getYTickValues, isSameTickValue, normalizeXValue, normalizeYValue } from "./axisTicks.js";
@@ -250,22 +250,25 @@ function resolveTextOffset(value, fontSize) {
250
250
  function splitTickTextByWidth(text, width, painter) {
251
251
  if (!width) return [text];
252
252
  const charWidth = painter.measureText("0").width || 5.5;
253
- /**
254
- * Split a text fragment recursively.
255
- * @param {Array} lines Accumulated text lines
256
- * @param {string} value Remaining text fragment
257
- * @returns {Array} Text lines
258
- * @private
259
- */
260
- function split(lines, value) {
253
+ const lines = [];
254
+ let start = 0;
255
+ while (true) {
261
256
  let spaceIndex;
262
- for (let i = 1; i < value.length; i++) {
263
- if (value.charAt(i) === " ") spaceIndex = i;
264
- if (width < charWidth * (i + 1)) return split(lines.concat(value.slice(0, spaceIndex || i)), value.slice(spaceIndex ? spaceIndex + 1 : i));
257
+ let splitAt = -1;
258
+ for (let i = 1; start + i < text.length; i++) {
259
+ if (text.charAt(start + i) === " ") spaceIndex = i;
260
+ if (width < charWidth * (i + 1)) {
261
+ splitAt = i;
262
+ break;
263
+ }
264
+ }
265
+ if (splitAt === -1) {
266
+ lines.push(text.slice(start));
267
+ return lines;
265
268
  }
266
- return lines.concat(value);
269
+ lines.push(text.slice(start, start + (spaceIndex || splitAt)));
270
+ start += spaceIndex ? spaceIndex + 1 : splitAt;
267
271
  }
268
- return split([], text);
269
272
  }
270
273
  /**
271
274
  * Get max width for splitting canvas x axis tick text.
@@ -1288,4 +1291,4 @@ var CanvasAxisRenderer = class {
1288
1291
  }
1289
1292
  };
1290
1293
  //#endregion
1291
- export { CanvasAxisRenderer as default };
1294
+ export { CanvasAxisRenderer as default, getXTickTextLines };
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { document as doc, window as win } from "../module/browser.js";
11
11
  import { $CANVAS } from "./classes.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { getFontSize } from "./util.js";
11
11
  //#region src/canvas/CanvasPainter.ts
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { SUBCHART_BRUSH_HANDLE_PATH, TYPE } from "../config/const.js";
11
11
  import { window as win } from "../module/browser.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { document as doc, window as win } from "../module/browser.js";
11
11
  import { mergeObj } from "../module/util/object.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { TYPE } from "../config/const.js";
11
11
  import { getTreemapNodeRect } from "../ChartInternal/shape/core/geometry.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  import { parseDate } from "../module/util/object.js";
11
11
  import { getScale } from "../ChartInternal/internals/scale.js";
@@ -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.4
8
+ * @version 4.1.5
9
9
  */
10
10
  //#region src/canvas/classes.ts
11
11
  /**