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
  import { isDefined, isNumber, isObjectType, isValue } from "../../module/util/type-checks.js";
11
11
  //#region src/Chart/api/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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isEmpty } from "../../module/util/type-checks.js";
11
11
  //#region src/Chart/api/category.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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { window as win } from "../../module/browser.js";
11
11
  import { isDefined, isEmpty, notEmpty } from "../../module/util/type-checks.js";
@@ -63,7 +63,7 @@ var chart_default = {
63
63
  if (state.resizing) $$.brush?.updateResize();
64
64
  else $$.axis?.setOrient();
65
65
  zoomResetBtn?.style("display", "none");
66
- if ($$.scale.zoom) state.current.zoomDomain = $$.scale.zoom.domain();
66
+ if ($$.scale.zoom) state.current.zoomDomain = $$.zoom?.getDomain() ?? $$.scale.zoom.domain();
67
67
  $$.scale.zoom = null;
68
68
  if (!state.resizing) state.dirty.data = true;
69
69
  soft ? $$.redraw({
@@ -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
  //#region src/Chart/api/color.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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isArray, isUndefined } from "../../module/util/type-checks.js";
11
11
  import { extend } 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { document as doc, window as win } from "../../module/browser.js";
11
11
  import { isFunction } 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isDefined, isValue } from "../../module/util/type-checks.js";
11
11
  import { parseDate } from "../../module/util/object.js";
@@ -88,6 +88,12 @@ flow(args) {
88
88
  const orgDataCount = $$.getMaxDataCount();
89
89
  const targets = $$.convertDataToTargets(data, true);
90
90
  const isTimeSeries = $$.axis.isTimeSeries();
91
+ const isCustomX = !isTimeSeries && $$.axis.isCustomX() && !$$.axis.isCategorized();
92
+ const hasDataX = isTimeSeries || isCustomX;
93
+ const firstValue = $$.data.targets.find((t) => t.values.length)?.values[0];
94
+ const xOffset = firstValue ? firstValue.x - firstValue.index : 0;
95
+ const getX = (index) => isTimeSeries ? $$.getOtherTargetX(index) : index + xOffset;
96
+ const flowedXs = [];
91
97
  $$.data.targets.forEach((t) => {
92
98
  let found = false;
93
99
  for (let i = 0; i < targets.length; i++) if (t.id === targets[i].id) {
@@ -97,7 +103,8 @@ flow(args) {
97
103
  length = values.length;
98
104
  for (let j = 0; j < length; j++) {
99
105
  values[j].index = tail + j;
100
- if (!isTimeSeries) values[j].x = tail + j;
106
+ if (!hasDataX) values[j].x = getX(tail + j);
107
+ flowedXs[j] = values[j].x;
101
108
  t.values.push(values[j]);
102
109
  }
103
110
  targets.splice(i, 1);
@@ -112,7 +119,7 @@ flow(args) {
112
119
  for (let j = 0; j < length; j++) t.values.push({
113
120
  id: t.id,
114
121
  index: tail + j,
115
- x: isTimeSeries ? $$.getOtherTargetX(tail + j) : tail + j,
122
+ x: isCustomX ? flowedXs[j] : getX(tail + j),
116
123
  value: null
117
124
  });
118
125
  }
@@ -130,7 +137,7 @@ flow(args) {
130
137
  values[i] = {
131
138
  id: t.id,
132
139
  index,
133
- x: isTimeSeries ? $$.getOtherTargetX(index) : index,
140
+ x: isCustomX ? $$.data.targets[0].values[i]?.x : getX(index),
134
141
  value: null
135
142
  };
136
143
  }
@@ -138,7 +145,7 @@ flow(args) {
138
145
  for (let i = missingLength; i < values.length; i++) {
139
146
  const v = values[i];
140
147
  v.index += tail;
141
- if (!isTimeSeries) v.x += tail;
148
+ if (!hasDataX) v.x = getX(v.index);
142
149
  }
143
150
  });
144
151
  for (let i = 0; i < targets.length; i++) $$.data.targets.push(targets[i]);
@@ -182,6 +189,7 @@ flow(args) {
182
189
  withUpdateXDomain: true
183
190
  });
184
191
  $$.updateTypesElements();
192
+ $$.updateCanvasFlowFocus?.();
185
193
  args.done?.call($$.api);
186
194
  return;
187
195
  }
@@ -190,7 +198,6 @@ flow(args) {
190
198
  $$.state._eventRectFingerprint = null;
191
199
  $$.redraw({
192
200
  flow: {
193
- index: baseValue.index,
194
201
  length,
195
202
  duration: isValue(args.duration) ? args.duration : $$.config.transition_duration,
196
203
  done: args.done,
@@ -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
  import { $FOCUS, $GAUGE } from "../../config/classes.js";
11
11
  import { select } from "d3-selection";
@@ -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
  import { extend } from "../../module/util/object.js";
11
11
  import { isTabVisible } 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isUndefined } from "../../module/util/type-checks.js";
11
11
  //#region src/Chart/api/group.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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  var legend_default = { legend: {
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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { requestIdleCallback } from "../../module/browser.js";
11
11
  import { isArray, isEmpty, 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { extend, getOption } from "../../module/util/object.js";
11
11
  import { isTabVisible } 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isDefined } from "../../module/util/type-checks.js";
11
11
  import { $AREA, $LINE, $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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { callFn, endall } from "../../module/util/object.js";
11
11
  //#region src/Chart/api/show.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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { extend } from "../../module/util/object.js";
11
11
  import { checkApiModuleImport } from "../../module/error.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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { extend, parseDate } from "../../module/util/object.js";
11
11
  import { $COMMON } 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isDefined } from "../../module/util/type-checks.js";
11
11
  import { $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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isArray, isObject } from "../../module/util/type-checks.js";
11
11
  //#region src/Chart/api/x.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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isDefined, isObject } from "../../module/util/type-checks.js";
11
11
  import { extend, getMinMax, 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isArray, isEmpty, isFunction, isNumber, isObjectType, isString, isValue, notEmpty } from "../../module/util/type-checks.js";
11
11
  import { capitalize, mergeObj, parseDate, sortValue } 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isArray, isFunction, isNumber, isString } from "../../module/util/type-checks.js";
11
11
  import { toArray } from "../../module/util/object.js";
@@ -317,19 +317,26 @@ var AxisRenderer = class {
317
317
  if (isArray(tickText)) return tickText;
318
318
  let tickWidth = params.tickWidth;
319
319
  if (!tickWidth || tickWidth <= 0) tickWidth = isLeftRight ? 95 : params.isCategory ? (params.isInverted ? scale(ticks[0]) - scale(ticks[1]) : scale(ticks[1]) - scale(ticks[0])) - 12 : 110;
320
- function split(splitted, text) {
321
- let subtext;
320
+ const text = String(tickText);
321
+ const result = [];
322
+ let start = 0;
323
+ while (true) {
322
324
  let spaceIndex;
323
- let textWidth;
324
- for (let i = 1; i < text.length; i++) {
325
- if (text.charAt(i) === " ") spaceIndex = i;
326
- subtext = text.substr(0, i + 1);
327
- textWidth = charWidth * subtext.length;
328
- if (tickWidth < textWidth) return split(splitted.concat(text.substr(0, spaceIndex || i)), text.slice(spaceIndex ? spaceIndex + 1 : i));
325
+ let splitAt = -1;
326
+ for (let i = 1; start + i < text.length; i++) {
327
+ if (text.charAt(start + i) === " ") spaceIndex = i;
328
+ if (tickWidth < charWidth * (i + 1)) {
329
+ splitAt = i;
330
+ break;
331
+ }
332
+ }
333
+ if (splitAt === -1) {
334
+ result.push(text.slice(start));
335
+ return result;
329
336
  }
330
- return splitted.concat(text);
337
+ result.push(text.substr(start, spaceIndex || splitAt));
338
+ start += spaceIndex ? spaceIndex + 1 : splitAt;
331
339
  }
332
- return split(splitted, String(tickText));
333
340
  }
334
341
  scale(x) {
335
342
  if (!arguments.length) return this.helper.scale;
@@ -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
  import { isDefined, isValue } from "../../module/util/type-checks.js";
11
11
  import { getBBox } from "../../module/util/dom.js";
@@ -111,7 +111,7 @@ var AxisRendererHelper = class {
111
111
  transitionise(selection) {
112
112
  const { config } = this;
113
113
  let transitionSelection = selection;
114
- if (config.withoutTransition) transitionSelection = selection.interrupt();
114
+ if (config.withoutTransition && !config.transition) transitionSelection = selection.interrupt();
115
115
  else if (config.transition || !this.owner.params.noTransition) try {
116
116
  transitionSelection = selection.transition(config.transition);
117
117
  } catch {}
@@ -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
  import { document as doc, window as win } from "../module/browser.js";
11
11
  import { isBoolean, isFunction, isObject, isString, 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { csvParse, csvParseRows, tsvParse, tsvParseRows } from "../../module/dsv.js";
11
11
  //#region src/ChartInternal/data/convert.helper.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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isArray, isDefined, isEmpty, isObject, isUndefined, isValue, notEmpty } from "../../module/util/type-checks.js";
11
11
  import { toSet } 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { TYPE } from "../../config/const.js";
11
11
  import { isArray, isBoolean, isDefined, isFunction, isNumber, isObject, isObjectType, isString, isUndefined, isValue, 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { endall } from "../../module/util/object.js";
11
11
  import { $LEGEND } 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { getPathBox, scheduleRAFUpdate } from "../../module/util/dom.js";
11
11
  import { $BAR, $CIRCLE, $COMMON, $DRAG, $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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isBoolean, isFunction } from "../../module/util/type-checks.js";
11
11
  import { getBoundingRect, getPointer, getScrollPosition } 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { diffDomain } from "../../module/util/type-checks.js";
11
11
  import classes_default from "../../config/classes.js";
@@ -24,8 +24,9 @@ var flow_default = {
24
24
  */
25
25
  generateFlow(args) {
26
26
  const $$ = this;
27
- const { data, state, $el } = $$;
27
+ const { config, data, state, $el } = $$;
28
28
  return function() {
29
+ if (!$$.$el) return;
29
30
  const flowLength = args.flow.length;
30
31
  state.flowing = true;
31
32
  data.targets.forEach((d) => {
@@ -50,7 +51,12 @@ var flow_default = {
50
51
  if (node && name.length > 1) node = node[name[1]];
51
52
  if (node?.size()) elements[v] = node;
52
53
  });
53
- $$.hideGridFocus?.();
54
+ if (config.axis_rotated) $$.hideGridFocus?.();
55
+ else {
56
+ const xFocus = $el.main.selectAll(`line.${classes_default.xgridFocus}:not(.${classes_default.xgridFocusContinuous})`);
57
+ xFocus.size() && (elements["gridFocus.x"] = xFocus);
58
+ $el.main.selectAll(`line.${classes_default.ygridFocus}`).style("visibility", "hidden");
59
+ }
54
60
  $$.setFlowList(elements, args);
55
61
  };
56
62
  },
@@ -63,8 +69,8 @@ var flow_default = {
63
69
  setFlowList(elements, args) {
64
70
  const $$ = this;
65
71
  const { flow, targets } = args;
66
- const { duration = args.duration, index: flowIndex, length: flowLength, orgDataCount } = flow;
67
- const transform = $$.getFlowTransform(targets, orgDataCount, flowIndex, flowLength);
72
+ const { duration = args.duration, orgDataCount } = flow;
73
+ const transform = $$.getFlowTransform(targets, orgDataCount);
68
74
  const wait = generateWait();
69
75
  let n;
70
76
  wait.add(Object.keys(elements).map((v) => {
@@ -88,12 +94,14 @@ var flow_default = {
88
94
  */
89
95
  cleanUpFlow(elements, args) {
90
96
  const $$ = this;
97
+ if (!$$.$el) return;
91
98
  const { config, state, $el: { svg } } = $$;
92
99
  const isRotated = config.axis_rotated;
93
100
  const { flow, shape, xv } = args;
94
101
  const { cx, cy, xForText, yForText } = shape.pos;
95
102
  const { done = () => {}, length: flowLength } = flow;
96
103
  if (flowLength) {
104
+ const isFocusCircle = $$.isPointFocusOnly() ? (node) => node.parentElement?.classList.contains(classes_default.circles) : () => false;
97
105
  [
98
106
  "circle",
99
107
  "text",
@@ -102,7 +110,9 @@ var flow_default = {
102
110
  ].forEach((v) => {
103
111
  const target = [];
104
112
  for (let i = 0; i < flowLength; i++) target.push(`.${classes_default[v]}-${i}`);
105
- svg.selectAll(`.${classes_default[`${v}s`]}`).selectAll(target).remove();
113
+ svg.selectAll(`.${classes_default[`${v}s`]}`).selectAll(target).filter(function() {
114
+ return !isFocusCircle(this);
115
+ }).remove();
106
116
  });
107
117
  svg.select(`.${classes_default.xgrid}`).remove();
108
118
  }
@@ -125,36 +135,33 @@ var flow_default = {
125
135
  } else if (v === "region.list") n.select("rect").filter($$.isRegionOnX).attr("x", $$.regionX.bind($$)).attr("width", $$.regionWidth.bind($$));
126
136
  });
127
137
  config.interaction_enabled && $$.redrawEventRect();
128
- done.call($$.api);
129
138
  state.flowing = false;
139
+ if ($$.$el.tooltip?.style("display") === "block") $$.updateTooltipOnRedraw();
140
+ else $$.hideGridFocus?.();
141
+ done.call($$.api);
130
142
  },
131
143
  /**
132
144
  * Get flow transform value
133
145
  * @param {object} targets target
134
146
  * @param {number} orgDataCount original data count
135
- * @param {number} flowIndex flow index
136
- * @param {number} flowLength flow length
137
147
  * @returns {string}
138
148
  * @private
139
149
  */
140
- getFlowTransform(targets, orgDataCount, flowIndex, flowLength) {
150
+ getFlowTransform(targets, orgDataCount) {
141
151
  const $$ = this;
142
152
  const { data, scale: { x } } = $$;
143
153
  const dataValues = data.targets[0].values;
144
- let flowStart = $$.getValueOnIndex(dataValues, flowIndex);
145
- let flowEnd = $$.getValueOnIndex(dataValues, flowIndex + flowLength);
146
154
  let translateX;
147
155
  const orgDomain = x.domain();
148
156
  const domain = $$.updateXDomain(targets, true, true);
149
157
  if (!orgDataCount) {
150
158
  if (dataValues.length !== 1) translateX = x(orgDomain[0]) - x(domain[0]);
151
159
  else if ($$.axis.isTimeSeries()) {
152
- flowStart = $$.getValueOnIndex(dataValues, 0);
153
- flowEnd = $$.getValueOnIndex(dataValues, dataValues.length - 1);
160
+ const flowStart = $$.getValueOnIndex(dataValues, 0);
161
+ const flowEnd = $$.getValueOnIndex(dataValues, dataValues.length - 1);
154
162
  translateX = x(flowStart.x) - x(flowEnd.x);
155
163
  } else translateX = diffDomain(domain) / 2;
156
- } else if (orgDataCount === 1 || flowStart?.x === flowEnd?.x) translateX = x(orgDomain[0]) - x(domain[0]);
157
- else translateX = $$.axis.isTimeSeries() ? x(orgDomain[0]) - x(domain[0]) : x(flowStart?.x || 0) - x(flowEnd.x);
164
+ } else translateX = x(orgDomain[0]) - x(domain[0]);
158
165
  const scaleX = diffDomain(orgDomain) / diffDomain(domain);
159
166
  return `translate(${translateX},0) scale(${scaleX},1)`;
160
167
  }
@@ -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
  import { isNumber, isObject } from "../../module/util/type-checks.js";
11
11
  import { emulateEvent, getBoundingRect, getPointer, getTransformCTM, hasViewBox } 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { SUBCHART_BRUSH_HANDLE_PATH } 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { window as win } from "../../module/browser.js";
11
11
  import { diffDomain, isFunction } 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  //#region src/ChartInternal/internals/category.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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import classes_default from "../../config/classes.js";
11
11
  //#region src/ChartInternal/internals/class.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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  //#region src/ChartInternal/internals/clip.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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { document as doc } from "../../module/browser.js";
11
11
  import { isFunction, isObject, isString, 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { TYPE, TYPE_BY_CATEGORY } from "../../config/const.js";
11
11
  import { diffDomain, isDefined, isNumber, isObject, isValue, 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isArray, isFunction, isObject, isObjectType, isValue } from "../../module/util/type-checks.js";
11
11
  //#region src/ChartInternal/internals/format.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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { isArray, isValue } from "../../module/util/type-checks.js";
11
11
  import { getPointer } 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.3
8
+ * @version 4.1.5
9
9
  */
10
10
  import { document as doc } from "../../module/browser.js";
11
11
  import { isBoolean, isDefined, isEmpty, isFunction } from "../../module/util/type-checks.js";