billboard.js 4.1.0-next.2 → 4.1.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 (233) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +268 -107
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +16 -16
  5. package/dist/billboard.pkgd.js +3198 -1755
  6. package/dist/billboard.pkgd.min.js +23 -23
  7. package/dist/billboard.react.js +28 -49
  8. package/dist/billboard.react.min.js +2 -2
  9. package/dist/billboard.worker.js +1 -1
  10. package/dist/plugin/billboardjs-plugin-bubblecompare.js +14 -31
  11. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  12. package/dist/plugin/billboardjs-plugin-sparkline.js +14 -31
  13. package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
  14. package/dist/plugin/billboardjs-plugin-stanford.js +21 -35
  15. package/dist/plugin/billboardjs-plugin-stanford.min.js +7 -7
  16. package/dist/plugin/billboardjs-plugin-tableview.js +15 -30
  17. package/dist/plugin/billboardjs-plugin-tableview.min.js +5 -5
  18. package/dist/plugin/billboardjs-plugin-textoverlap.js +15 -30
  19. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  20. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2959 -1684
  21. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +8 -8
  22. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2960 -1685
  23. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +10 -10
  24. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2961 -1686
  25. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +18 -18
  26. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2962 -1687
  27. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +11 -11
  28. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2963 -1688
  29. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +8 -8
  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 +9 -7
  44. package/dist-esm/Chart/api/color.js +1 -1
  45. package/dist-esm/Chart/api/data.js +3 -3
  46. package/dist-esm/Chart/api/export.js +1 -1
  47. package/dist-esm/Chart/api/flow.js +1 -1
  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 +11 -9
  60. package/dist-esm/Chart/api/zoom.js +8 -7
  61. package/dist-esm/ChartInternal/Axis/Axis.js +7 -6
  62. package/dist-esm/ChartInternal/Axis/AxisRenderer.js +1 -1
  63. package/dist-esm/ChartInternal/Axis/AxisRendererHelper.js +1 -1
  64. package/dist-esm/ChartInternal/ChartInternal.js +32 -8
  65. package/dist-esm/ChartInternal/data/convert.helper.js +7 -5
  66. package/dist-esm/ChartInternal/data/convert.js +1 -1
  67. package/dist-esm/ChartInternal/data/data.js +64 -33
  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 +17 -15
  72. package/dist-esm/ChartInternal/interactions/interaction.js +1 -1
  73. package/dist-esm/ChartInternal/interactions/subchart.js +8 -6
  74. package/dist-esm/ChartInternal/interactions/zoom.js +8 -6
  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 +13 -9
  80. package/dist-esm/ChartInternal/internals/format.js +5 -3
  81. package/dist-esm/ChartInternal/internals/grid.js +5 -4
  82. package/dist-esm/ChartInternal/internals/legend.js +8 -7
  83. package/dist-esm/ChartInternal/internals/redraw.js +2 -2
  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 +56 -10
  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 +12 -9
  93. package/dist-esm/ChartInternal/internals/text.util.js +4 -4
  94. package/dist-esm/ChartInternal/internals/title.js +3 -2
  95. package/dist-esm/ChartInternal/internals/tooltip.js +25 -20
  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 +3 -2
  99. package/dist-esm/ChartInternal/shape/area.js +3 -2
  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 +3 -2
  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 +3 -2
  114. package/dist-esm/ChartInternal/shape/point.js +1 -1
  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 +3 -2
  118. package/dist-esm/ChartInternal/shape/treemap.js +1 -1
  119. package/dist-esm/canvas/CanvasAxisRenderer.js +27 -21
  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 +7 -8
  124. package/dist-esm/canvas/HitDetector.js +1 -1
  125. package/dist-esm/canvas/axisTicks.js +3 -2
  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 +4 -4
  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 -13
  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 +44 -2
  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 +1 -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 +4 -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 +17 -12
  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 +5 -4
  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 +2 -2
  203. package/dist-esm/module/browser.js +2 -2
  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 +16 -3
  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 +9 -7
  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 -40
  215. package/dist-esm/plugin/billboardjs-plugin-stanford.js +4 -41
  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 +36 -36
  220. package/src/Chart/api/chart.ts +1 -0
  221. package/src/Chart/api/data.ts +5 -3
  222. package/src/ChartInternal/ChartInternal.ts +72 -25
  223. package/src/ChartInternal/data/data.ts +68 -34
  224. package/src/ChartInternal/internals/redraw.ts +8 -1
  225. package/src/ChartInternal/internals/size.ts +99 -2
  226. package/src/config/Options/axis/y2.ts +0 -13
  227. package/src/config/Options/common/main.ts +43 -1
  228. package/src/config/Store/State.ts +4 -0
  229. package/src/config/const.ts +4 -0
  230. package/src/config/resolver/canvas.ts +3 -0
  231. package/src/module/Cache.ts +1 -1
  232. package/src/module/generator.ts +27 -2
  233. package/types/options.d.ts +38 -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.0-next.2
8
+ * @version 4.1.0
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";
@@ -265,11 +265,13 @@ var text_default = {
265
265
  const isFunnelType = $$.isFunnelType(d);
266
266
  const isTreemapType = $$.isTreemapType(d);
267
267
  let xPos = points ? points[0][0] : 0;
268
- if ($$.isCandlestickType(d)) if (isRotated) xPos = $$.getCandlestickData(d)?._isUp ? points[2][2] + 4 : points[2][1] - 4;
269
- else xPos += (points[1][0] - xPos) / 2;
270
- else if (isFunnelType) if (points) xPos = points[2]?.[0] ?? xPos;
271
- else return getElementPos(textElement, "x");
272
- else if (isTreemapType) xPos += config.data_labels.centered ? 0 : 5;
268
+ if ($$.isCandlestickType(d)) {
269
+ if (isRotated) xPos = $$.getCandlestickData(d)?._isUp ? points[2][2] + 4 : points[2][1] - 4;
270
+ else xPos += (points[1][0] - xPos) / 2;
271
+ } else if (isFunnelType) {
272
+ if (points) xPos = points[2]?.[0] ?? xPos;
273
+ else return getElementPos(textElement, "x");
274
+ } else if (isTreemapType) xPos += config.data_labels.centered ? 0 : 5;
273
275
  else if (isRotated) {
274
276
  const isInverted = config[`axis_${$$.axis.getId(d.id)}_inverted`];
275
277
  const padding = $$.isBarType(d) ? 4 : 6;
@@ -311,9 +313,10 @@ var text_default = {
311
313
  yPos = value && value._isUp ? points[2][2] - baseY : points[2][1] + baseY * 4;
312
314
  if (isInverted) yPos += 15 * (value._isUp ? 1 : -1);
313
315
  }
314
- } else if (isFunnelType) if (points) yPos = (points[2]?.[1] ?? points[0][1]) + rect.height / 2 - 3;
315
- else return getElementPos(textElement, "y");
316
- else if (isTreemapType) yPos = points[0][1] + (config.data_labels.centered ? 0 : rect.height + 5);
316
+ } else if (isFunnelType) {
317
+ if (points) yPos = (points[2]?.[1] ?? points[0][1]) + rect.height / 2 - 3;
318
+ else return getElementPos(textElement, "y");
319
+ } else if (isTreemapType) yPos = points[0][1] + (config.data_labels.centered ? 0 : rect.height + 5);
317
320
  else if (isRotated) yPos = (points[0][0] + points[2][0] + rect.height * .6) / 2;
318
321
  else {
319
322
  yPos = points[2][1];
@@ -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.0-next.2
8
+ * @version 4.1.0
9
9
  */
10
10
  import { isFunction, isNumber } from "../../module/util/type-checks.js";
11
11
  import { parseShorthand, toMap, tplProcess } from "../../module/util/object.js";
@@ -48,7 +48,7 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
48
48
  const isNegative = isNumber(value) && value < 0 || isCandlestickType && !$$.getCandlestickData(d)?._isUp;
49
49
  let { x, y } = pos;
50
50
  const gap = 4;
51
- const doubleGap = gap * 2;
51
+ const doubleGap = 8;
52
52
  if (isRotated) {
53
53
  if (anchor === "start") {
54
54
  x += isNegative ? 0 : doubleGap;
@@ -63,11 +63,11 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
63
63
  } else {
64
64
  if (anchor === "start") {
65
65
  x += gap;
66
- isNegative && (y += doubleGap * 2);
66
+ isNegative && (y += 16);
67
67
  } else if (anchor === "middle") y -= doubleGap;
68
68
  else if (anchor === "end") {
69
69
  x -= gap;
70
- isNegative && (y += doubleGap * 2);
70
+ isNegative && (y += 16);
71
71
  }
72
72
  if (isInverted) y += isNegative ? -17 : isCandlestickType ? 13 : 7;
73
73
  }
@@ -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.0-next.2
8
+ * @version 4.1.0
9
9
  */
10
10
  import { isNumber } from "../../module/util/type-checks.js";
11
11
  import { getBBox, getBoundingRect, getElementPos, setTextValue } from "../../module/util/dom.js";
@@ -63,7 +63,8 @@ var title_default = {
63
63
  const { config, $el } = this;
64
64
  if (config.title_text) {
65
65
  $el.title = $el.svg.append("g");
66
- setTextValue($el.title.append("text").style("text-anchor", _getTextXPos(config.title_position)).attr("class", $TEXT.title), config.title_text, [.3, 1.5]);
66
+ const text = $el.title.append("text").style("text-anchor", _getTextXPos(config.title_position)).attr("class", $TEXT.title);
67
+ setTextValue(text, config.title_text, [.3, 1.5]);
67
68
  }
68
69
  },
69
70
  /**
@@ -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.0-next.2
8
+ * @version 4.1.0
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";
@@ -83,8 +83,10 @@ var tooltip_default = {
83
83
  const boundValueFn = isFunction(valueFn) ? valueFn.bind(api) : null;
84
84
  const valueFormat = (v, ratio, id, index) => {
85
85
  let fn = boundValueFn;
86
- if (!fn) if (state.hasTreemap || $$.isStackNormalized() && (!$$.isStackNormalizedPerGroup() || $$.isGrouped(id))) fn = (v, ratio) => `${(ratio * 100).toFixed(2)}%`;
87
- else fn = defaultValueFormat;
86
+ if (!fn) {
87
+ if (state.hasTreemap || $$.isStackNormalized() && (!$$.isStackNormalizedPerGroup() || $$.isGrouped(id))) fn = (v, ratio) => `${(ratio * 100).toFixed(2)}%`;
88
+ else fn = defaultValueFormat;
89
+ }
88
90
  return fn(v, ratio, id, index);
89
91
  };
90
92
  const order = config.tooltip_order;
@@ -118,8 +120,8 @@ var tooltip_default = {
118
120
  let row;
119
121
  let param;
120
122
  let value;
121
- let i;
122
- for (i = 0; i < len; i++) {
123
+ let i = 0;
124
+ for (; i < len; i++) {
123
125
  row = d[i];
124
126
  const rowValue = row && getRowValue(row);
125
127
  if (!row || !(rowValue || rowValue === 0)) continue;
@@ -253,12 +255,14 @@ var tooltip_default = {
253
255
  const size = getTransformCTM(target, 20, 0, false).x;
254
256
  let top = ctm.y;
255
257
  let left = ctm.x + tWidth / 2 + size;
256
- if (hasArcType) if (state.hasFunnel || state.hasTreemap || state.hasRadar) {
257
- left -= tWidth / 2 + size;
258
- top += tHeight;
259
- } else {
260
- top += rect.height / 2;
261
- left += rect.width / 2 - (tWidth - size);
258
+ if (hasArcType) {
259
+ if (state.hasFunnel || state.hasTreemap || state.hasRadar) {
260
+ left -= tWidth / 2 + size;
261
+ top += tHeight;
262
+ } else {
263
+ top += rect.height / 2;
264
+ left += rect.width / 2 - (tWidth - size);
265
+ }
262
266
  }
263
267
  if (left + tWidth > rect.width) left = rect.width - tWidth - size;
264
268
  if (top + tHeight > rect.height) top -= tHeight * 2;
@@ -311,7 +315,7 @@ var tooltip_default = {
311
315
  y += padding.top - 5;
312
316
  }
313
317
  }
314
- if (x + tWidth + 15 > chartRight) x -= tWidth + (hasFunnel || hasTreemap || hasArcType ? 0 : isRotated ? size * 2 : 38);
318
+ if (x + tWidth + 15 > chartRight) x -= tWidth + (hasFunnel || hasTreemap || hasArcType ? 0 : isRotated ? 40 : 38);
315
319
  if (y + tHeight > current.height) {
316
320
  const gap = hasTreemap ? tHeight + 10 : 30;
317
321
  y -= hasGauge ? tHeight * 1.5 : tHeight + gap;
@@ -439,16 +443,17 @@ var tooltip_default = {
439
443
  if ($$.state.isCanvasMode) return;
440
444
  if (tooltip?.style("display") === "block" && event) {
441
445
  const rect = context ?? (hasRadar ? svg : eventRect)?.node();
442
- if (hasAxis || hasRadar) if ($$.isMultipleX()) $$.selectRectForMultipleXs(rect, false);
443
- else {
444
- const idx = index ?? $$.getDataIndexFromEvent(event);
445
- if (index === -1) $$.api.tooltip.hide();
446
+ if (hasAxis || hasRadar) {
447
+ if ($$.isMultipleX()) $$.selectRectForMultipleXs(rect, false);
446
448
  else {
447
- $$.selectRectForSingle(rect, idx);
448
- $$.setExpand(idx, null, true);
449
+ const idx = index ?? $$.getDataIndexFromEvent(event);
450
+ if (index === -1) $$.api.tooltip.hide();
451
+ else {
452
+ $$.selectRectForSingle(rect, idx);
453
+ $$.setExpand(idx, null, true);
454
+ }
449
455
  }
450
- }
451
- else {
456
+ } else {
452
457
  const { clientX, clientY } = event;
453
458
  setTimeout(() => {
454
459
  let target = [clientX, clientY].every(Number.isFinite) && doc.elementFromPoint(clientX, clientY);
@@ -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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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";
@@ -446,7 +446,8 @@ var arc_default = {
446
446
  };
447
447
  if (meetsThreshold) {
448
448
  const { value } = updated || d;
449
- setTextValue(node, ($$.getArcLabelConfig("format") || $$.defaultArcValueFormat)(value, ratio, d.data.id).toString(), [-1, 1], hasGauge);
449
+ const text = ($$.getArcLabelConfig("format") || $$.defaultArcValueFormat)(value, ratio, d.data.id).toString();
450
+ setTextValue(node, text, [-1, 1], hasGauge);
450
451
  } else node.text("");
451
452
  });
452
453
  },
@@ -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.0-next.2
8
+ * @version 4.1.0
9
9
  */
10
10
  import { getRandom } from "../../module/util/object.js";
11
11
  import { $AREA, $CIRCLE, $LINE } from "../../config/classes.js";
@@ -76,7 +76,8 @@ var area_default = {
76
76
  * @private
77
77
  */
78
78
  generateDrawArea(areaIndices, isSub) {
79
- return generateDrawAreaPath(this, areaIndices, isSub);
79
+ const $$ = this;
80
+ return generateDrawAreaPath($$, areaIndices, isSub);
80
81
  }
81
82
  };
82
83
  //#endregion
@@ -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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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
@@ -86,7 +86,8 @@ var treemap_default = {
86
86
  */
87
87
  getTreemapRoot(targets) {
88
88
  const $$ = this;
89
- const hierarchyData = hierarchy($$.getTreemapData(targets ?? $$.data.targets)).sum((d) => d.value);
89
+ const data = $$.getTreemapData(targets ?? $$.data.targets);
90
+ const hierarchyData = hierarchy(data).sum((d) => d.value);
90
91
  const sortFn = $$.getSortCompareFn(true);
91
92
  if (!$$.treemap) $$.initTreemapLayout();
92
93
  return $$.treemap(sortFn ? hierarchyData.sort(sortFn) : hierarchyData);
@@ -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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
9
9
  */
10
10
  import { isArray, isUndefined, isValue } from "../../module/util/type-checks.js";
11
11
  import { getRandom } from "../../module/util/object.js";
@@ -100,7 +100,8 @@ var line_default = {
100
100
  return [$T(line, withTransition, getRandom()).attr("d", drawFn).style("stroke", this.color).style("opacity", null)];
101
101
  },
102
102
  generateDrawLine(lineIndices, isSub) {
103
- return generateDrawLinePath(this, lineIndices, isSub);
103
+ const $$ = this;
104
+ return generateDrawLinePath($$, lineIndices, isSub);
104
105
  },
105
106
  /**
106
107
  * Set regions dasharray and get path
@@ -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.0-next.2
8
+ * @version 4.1.0
9
9
  */
10
10
  import { isObject, 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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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";
@@ -97,7 +97,8 @@ function getSubchartCandlestickShapeValue($$, d, isSub) {
97
97
  * @private
98
98
  */
99
99
  function isSubchartCandlestickBarValue($$, d, isSub) {
100
- return isNumber(getSubchartCandlestickShapeValue($$, d, isSub)) && $$.isBarType(d);
100
+ const value = getSubchartCandlestickShapeValue($$, d, isSub);
101
+ return isNumber(value) && $$.isBarType(d);
101
102
  }
102
103
  /**
103
104
  * Get subchart bar color projected from candlestick up/down state.
@@ -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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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";
@@ -82,7 +82,7 @@ function getHorizontalXAxisClipRect(margin, width, height) {
82
82
  return {
83
83
  x: margin.left - X_AXIS_TICK_TEXT_HORIZONTAL_CLIP_PADDING,
84
84
  y: 0,
85
- w: width + X_AXIS_TICK_TEXT_HORIZONTAL_CLIP_PADDING * 2,
85
+ w: width + 40,
86
86
  h: height
87
87
  };
88
88
  }
@@ -99,7 +99,7 @@ function getRotatedXAxisClipRect(margin, width, height) {
99
99
  x: 0,
100
100
  y: margin.top - X_AXIS_TICK_TEXT_VERTICAL_CLIP_PADDING,
101
101
  w: width,
102
- h: height + X_AXIS_TICK_TEXT_VERTICAL_CLIP_PADDING * 2
102
+ h: height + 30
103
103
  };
104
104
  }
105
105
  /**
@@ -615,12 +615,14 @@ var CanvasAxisRenderer = class {
615
615
  painter.strokePath(() => {
616
616
  if (isRotated) painter.traceLine(x, y1, x, y2);
617
617
  else painter.traceLine(x1, y, x2, y);
618
- if (outerTick) if (isRotated) {
619
- painter.traceLine(x, y1, x + 6 * outerTickDirection, y1);
620
- painter.traceLine(x, y2, x + 6 * outerTickDirection, y2);
621
- } else {
622
- painter.traceLine(x1, y, x1, y + 6 * outerTickDirection);
623
- painter.traceLine(x2, y, x2, y + 6 * outerTickDirection);
618
+ if (outerTick) {
619
+ if (isRotated) {
620
+ painter.traceLine(x, y1, x + 6 * outerTickDirection, y1);
621
+ painter.traceLine(x, y2, x + 6 * outerTickDirection, y2);
622
+ } else {
623
+ painter.traceLine(x1, y, x1, y + 6 * outerTickDirection);
624
+ painter.traceLine(x2, y, x2, y + 6 * outerTickDirection);
625
+ }
624
626
  }
625
627
  });
626
628
  const tickFont = getAxisTickFont(axis, "x");
@@ -995,12 +997,14 @@ var CanvasAxisRenderer = class {
995
997
  painter.strokePath(() => {
996
998
  if (isRotated) painter.traceLine(x, y1, x, y2);
997
999
  else painter.traceLine(x1, y, x2, y);
998
- if (outerTick) if (isRotated) {
999
- painter.traceLine(x, y1, x + 6 * outerTickDirection, y1);
1000
- painter.traceLine(x, y2, x + 6 * outerTickDirection, y2);
1001
- } else {
1002
- painter.traceLine(x1, y, x1, y + 6 * outerTickDirection);
1003
- painter.traceLine(x2, y, x2, y + 6 * outerTickDirection);
1000
+ if (outerTick) {
1001
+ if (isRotated) {
1002
+ painter.traceLine(x, y1, x + 6 * outerTickDirection, y1);
1003
+ painter.traceLine(x, y2, x + 6 * outerTickDirection, y2);
1004
+ } else {
1005
+ painter.traceLine(x1, y, x1, y + 6 * outerTickDirection);
1006
+ painter.traceLine(x2, y, x2, y + 6 * outerTickDirection);
1007
+ }
1004
1008
  }
1005
1009
  });
1006
1010
  ctx.font = getAxisTickFont(axis, "x");
@@ -1242,12 +1246,14 @@ var CanvasAxisRenderer = class {
1242
1246
  painter.strokePath(() => {
1243
1247
  if (isRotated) painter.traceLine(x1, y, x2, y);
1244
1248
  else painter.traceLine(x, y1, x, y2);
1245
- if (outerTick) if (isRotated) {
1246
- painter.traceLine(x1, y, x1, y + 6 * outerTickDirection);
1247
- painter.traceLine(x2, y, x2, y + 6 * outerTickDirection);
1248
- } else {
1249
- painter.traceLine(x, y1, x + 6 * outerTickDirection, y1);
1250
- painter.traceLine(x, y2, x + 6 * outerTickDirection, y2);
1249
+ if (outerTick) {
1250
+ if (isRotated) {
1251
+ painter.traceLine(x1, y, x1, y + 6 * outerTickDirection);
1252
+ painter.traceLine(x2, y, x2, y + 6 * outerTickDirection);
1253
+ } else {
1254
+ painter.traceLine(x, y1, x + 6 * outerTickDirection, y1);
1255
+ painter.traceLine(x, y2, x + 6 * outerTickDirection, y2);
1256
+ }
1251
1257
  }
1252
1258
  });
1253
1259
  const tickFont = getAxisTickFont(axis, 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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
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.0-next.2
8
+ * @version 4.1.0
9
9
  */
10
10
  import { document as doc, window as win } from "../module/browser.js";
11
11
  import { mergeObj } from "../module/util/object.js";
@@ -562,12 +562,10 @@ function applySelectorStyle(target, selector, style) {
562
562
  font: readFontValue(style)
563
563
  });
564
564
  break;
565
- case ".bb-title":
566
- mergeThemeSection(target, "title", {
567
- color: readColorValue(style, "fill"),
568
- font: readFontValue(style)
569
- });
570
- break;
565
+ case ".bb-title": mergeThemeSection(target, "title", {
566
+ color: readColorValue(style, "fill"),
567
+ font: readFontValue(style)
568
+ });
571
569
  }
572
570
  }
573
571
  /**
@@ -883,7 +881,8 @@ var CanvasTheme = class {
883
881
  color: toColor(title.fill, "#000")
884
882
  }
885
883
  };
886
- const style = mergeObj(defaultStyle, getThemeOverride(userOverride));
884
+ const themeOverride = getThemeOverride(userOverride);
885
+ const style = mergeObj(defaultStyle, themeOverride);
887
886
  const userAxisOverride = userOverride?.axis;
888
887
  const hasUserAxisLabelColor = !!userAxisOverride && Object.prototype.hasOwnProperty.call(userAxisOverride, "labelColor");
889
888
  const hasUserAxisLabelFont = !!userAxisOverride && Object.prototype.hasOwnProperty.call(userAxisOverride, "labelFont");
@@ -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.0-next.2
8
+ * @version 4.1.0
9
9
  */
10
10
  import { TYPE } from "../config/const.js";
11
11
  import { getTreemapNodeRect } from "../ChartInternal/shape/core/geometry.js";