billboard.js 4.0.0-next.3 → 4.0.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 (228) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +240 -149
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +20 -20
  5. package/dist/billboard.pkgd.js +240 -149
  6. package/dist/billboard.pkgd.min.js +27 -27
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +11 -13
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
  11. package/dist/plugin/billboardjs-plugin-stanford.js +11 -13
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +4 -4
  13. package/dist/plugin/billboardjs-plugin-tableview.js +28 -15
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +4 -4
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
  19. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +11 -13
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +9 -9
  21. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +11 -13
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +3 -3
  23. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +28 -15
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +6 -6
  25. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
  27. package/dist/theme/dark.css +1 -1
  28. package/dist/theme/dark.min.css +1 -1
  29. package/dist/theme/datalab.css +1 -1
  30. package/dist/theme/datalab.min.css +1 -1
  31. package/dist/theme/graph.css +1 -1
  32. package/dist/theme/graph.min.css +1 -1
  33. package/dist/theme/insight.css +1 -1
  34. package/dist/theme/insight.min.css +1 -1
  35. package/dist/theme/modern.css +1 -1
  36. package/dist/theme/modern.min.css +1 -1
  37. package/dist-esm/Chart/Chart.js +1 -1
  38. package/dist-esm/Chart/api/axis.js +1 -1
  39. package/dist-esm/Chart/api/category.js +1 -1
  40. package/dist-esm/Chart/api/chart.js +1 -1
  41. package/dist-esm/Chart/api/color.js +1 -1
  42. package/dist-esm/Chart/api/data.js +1 -1
  43. package/dist-esm/Chart/api/export.js +1 -1
  44. package/dist-esm/Chart/api/flow.js +1 -1
  45. package/dist-esm/Chart/api/focus.js +1 -1
  46. package/dist-esm/Chart/api/grid.js +1 -1
  47. package/dist-esm/Chart/api/group.js +1 -1
  48. package/dist-esm/Chart/api/legend.js +1 -1
  49. package/dist-esm/Chart/api/load.js +1 -1
  50. package/dist-esm/Chart/api/regions.js +1 -1
  51. package/dist-esm/Chart/api/selection.js +1 -1
  52. package/dist-esm/Chart/api/show.js +1 -1
  53. package/dist-esm/Chart/api/stubs.js +53 -0
  54. package/dist-esm/Chart/api/subchart.js +2 -2
  55. package/dist-esm/Chart/api/tooltip.js +1 -1
  56. package/dist-esm/Chart/api/x.js +1 -1
  57. package/dist-esm/Chart/api/zoom.js +2 -2
  58. package/dist-esm/ChartInternal/Axis/Axis.js +1 -1
  59. package/dist-esm/ChartInternal/Axis/AxisRenderer.js +149 -96
  60. package/dist-esm/ChartInternal/Axis/AxisRendererHelper.js +1 -1
  61. package/dist-esm/ChartInternal/ChartInternal.js +8 -4
  62. package/dist-esm/ChartInternal/data/convert.helper.js +1 -1
  63. package/dist-esm/ChartInternal/data/convert.js +1 -1
  64. package/dist-esm/ChartInternal/data/data.js +1 -1
  65. package/dist-esm/ChartInternal/data/load.js +1 -1
  66. package/dist-esm/ChartInternal/interactions/drag.js +1 -1
  67. package/dist-esm/ChartInternal/interactions/eventrect.js +2 -2
  68. package/dist-esm/ChartInternal/interactions/flow.js +1 -1
  69. package/dist-esm/ChartInternal/interactions/interaction.js +1 -1
  70. package/dist-esm/ChartInternal/interactions/subchart.js +1 -1
  71. package/dist-esm/ChartInternal/interactions/zoom.js +1 -1
  72. package/dist-esm/ChartInternal/internals/category.js +1 -1
  73. package/dist-esm/ChartInternal/internals/class.js +1 -1
  74. package/dist-esm/ChartInternal/internals/clip.js +1 -1
  75. package/dist-esm/ChartInternal/internals/color.js +1 -1
  76. package/dist-esm/ChartInternal/internals/domain.js +1 -1
  77. package/dist-esm/ChartInternal/internals/format.js +1 -1
  78. package/dist-esm/ChartInternal/internals/grid.js +1 -1
  79. package/dist-esm/ChartInternal/internals/legend.js +1 -1
  80. package/dist-esm/ChartInternal/internals/redraw.js +1 -1
  81. package/dist-esm/ChartInternal/internals/region.js +1 -1
  82. package/dist-esm/ChartInternal/internals/scale.js +1 -1
  83. package/dist-esm/ChartInternal/internals/selection.js +1 -1
  84. package/dist-esm/ChartInternal/internals/size.axis.js +1 -1
  85. package/dist-esm/ChartInternal/internals/size.js +1 -1
  86. package/dist-esm/ChartInternal/internals/style.js +1 -1
  87. package/dist-esm/ChartInternal/internals/text.arc.js +1 -1
  88. package/dist-esm/ChartInternal/internals/text.js +1 -1
  89. package/dist-esm/ChartInternal/internals/text.util.js +1 -1
  90. package/dist-esm/ChartInternal/internals/title.js +1 -1
  91. package/dist-esm/ChartInternal/internals/tooltip.js +1 -1
  92. package/dist-esm/ChartInternal/internals/transform.js +1 -1
  93. package/dist-esm/ChartInternal/internals/type.js +1 -1
  94. package/dist-esm/ChartInternal/shape/arc.js +1 -1
  95. package/dist-esm/ChartInternal/shape/area.js +1 -1
  96. package/dist-esm/ChartInternal/shape/bar.js +1 -1
  97. package/dist-esm/ChartInternal/shape/bubble.js +1 -1
  98. package/dist-esm/ChartInternal/shape/candlestick.js +1 -1
  99. package/dist-esm/ChartInternal/shape/core/barRadius.js +1 -1
  100. package/dist-esm/ChartInternal/shape/core/bubble.js +1 -1
  101. package/dist-esm/ChartInternal/shape/core/candlestick.js +1 -1
  102. package/dist-esm/ChartInternal/shape/core/dataRegion.js +1 -1
  103. package/dist-esm/ChartInternal/shape/core/geometry.js +1 -1
  104. package/dist-esm/ChartInternal/shape/core/path.js +1 -1
  105. package/dist-esm/ChartInternal/shape/core/point.js +1 -1
  106. package/dist-esm/ChartInternal/shape/core/treemap.js +1 -1
  107. package/dist-esm/ChartInternal/shape/funnel.js +1 -1
  108. package/dist-esm/ChartInternal/shape/gauge.js +1 -1
  109. package/dist-esm/ChartInternal/shape/line.js +1 -1
  110. package/dist-esm/ChartInternal/shape/point.js +1 -1
  111. package/dist-esm/ChartInternal/shape/polar.js +1 -1
  112. package/dist-esm/ChartInternal/shape/radar.js +1 -1
  113. package/dist-esm/ChartInternal/shape/shape.js +6 -4
  114. package/dist-esm/ChartInternal/shape/treemap.js +1 -1
  115. package/dist-esm/canvas/CanvasAxisRenderer.js +1 -1
  116. package/dist-esm/canvas/CanvasEngine.js +18 -5
  117. package/dist-esm/canvas/CanvasPainter.js +1 -1
  118. package/dist-esm/canvas/CanvasRenderer.js +58 -35
  119. package/dist-esm/canvas/CanvasTheme.js +1 -1
  120. package/dist-esm/canvas/HitDetector.js +1 -1
  121. package/dist-esm/canvas/axisTicks.js +1 -1
  122. package/dist-esm/canvas/classes.js +1 -1
  123. package/dist-esm/canvas/color.js +1 -1
  124. package/dist-esm/canvas/geometry.js +1 -1
  125. package/dist-esm/canvas/labels.js +1 -1
  126. package/dist-esm/canvas/pointPattern.js +1 -1
  127. package/dist-esm/canvas/util.js +1 -1
  128. package/dist-esm/config/Options/Options.js +1 -1
  129. package/dist-esm/config/Options/axis/axis.js +1 -1
  130. package/dist-esm/config/Options/axis/x.js +1 -1
  131. package/dist-esm/config/Options/axis/y.js +1 -1
  132. package/dist-esm/config/Options/axis/y2.js +1 -13
  133. package/dist-esm/config/Options/common/boost.js +1 -1
  134. package/dist-esm/config/Options/common/color.js +1 -1
  135. package/dist-esm/config/Options/common/grid.js +1 -1
  136. package/dist-esm/config/Options/common/legend.js +1 -1
  137. package/dist-esm/config/Options/common/main.js +1 -1
  138. package/dist-esm/config/Options/common/point.js +1 -1
  139. package/dist-esm/config/Options/common/title.js +1 -1
  140. package/dist-esm/config/Options/common/tooltip.js +1 -1
  141. package/dist-esm/config/Options/data/axis.js +1 -1
  142. package/dist-esm/config/Options/data/data.js +1 -1
  143. package/dist-esm/config/Options/data/selection.js +1 -1
  144. package/dist-esm/config/Options/interaction/interaction.js +1 -1
  145. package/dist-esm/config/Options/interaction/subchart.js +1 -1
  146. package/dist-esm/config/Options/interaction/zoom.js +1 -1
  147. package/dist-esm/config/Options/shape/arc.js +1 -1
  148. package/dist-esm/config/Options/shape/area.js +1 -1
  149. package/dist-esm/config/Options/shape/bar.js +1 -1
  150. package/dist-esm/config/Options/shape/bubble.js +1 -1
  151. package/dist-esm/config/Options/shape/candlestick.js +1 -1
  152. package/dist-esm/config/Options/shape/donut.js +1 -1
  153. package/dist-esm/config/Options/shape/funnel.js +1 -1
  154. package/dist-esm/config/Options/shape/gauge.js +1 -1
  155. package/dist-esm/config/Options/shape/line.js +1 -1
  156. package/dist-esm/config/Options/shape/pie.js +1 -1
  157. package/dist-esm/config/Options/shape/polar.js +1 -1
  158. package/dist-esm/config/Options/shape/radar.js +1 -1
  159. package/dist-esm/config/Options/shape/scatter.js +1 -1
  160. package/dist-esm/config/Options/shape/spline.js +1 -1
  161. package/dist-esm/config/Options/shape/treemap.js +1 -1
  162. package/dist-esm/config/Store/Element.js +1 -1
  163. package/dist-esm/config/Store/State.js +1 -1
  164. package/dist-esm/config/Store/Store.js +1 -1
  165. package/dist-esm/config/classes.js +1 -1
  166. package/dist-esm/config/config.js +1 -1
  167. package/dist-esm/config/const.js +17 -2
  168. package/dist-esm/config/resolver/axis.core.js +1 -1
  169. package/dist-esm/config/resolver/axis.js +1 -1
  170. package/dist-esm/config/resolver/canvas.js +1 -1
  171. package/dist-esm/config/resolver/canvasShape.js +1 -1
  172. package/dist-esm/config/resolver/category.js +1 -1
  173. package/dist-esm/config/resolver/export.js +1 -1
  174. package/dist-esm/config/resolver/flow.js +1 -1
  175. package/dist-esm/config/resolver/grid.js +1 -1
  176. package/dist-esm/config/resolver/interaction/selection.js +1 -1
  177. package/dist-esm/config/resolver/interaction/subchart.js +1 -1
  178. package/dist-esm/config/resolver/interaction/zoom.js +1 -1
  179. package/dist-esm/config/resolver/regions.js +1 -1
  180. package/dist-esm/config/resolver/shape/arc.helpers.js +1 -1
  181. package/dist-esm/config/resolver/shape/area.js +1 -1
  182. package/dist-esm/config/resolver/shape/axis.helpers.js +1 -1
  183. package/dist-esm/config/resolver/shape/bar.js +1 -1
  184. package/dist-esm/config/resolver/shape/bubble.js +1 -1
  185. package/dist-esm/config/resolver/shape/candlestick.js +1 -1
  186. package/dist-esm/config/resolver/shape/donut.js +1 -1
  187. package/dist-esm/config/resolver/shape/funnel.js +1 -1
  188. package/dist-esm/config/resolver/shape/gauge.js +1 -1
  189. package/dist-esm/config/resolver/shape/line.js +1 -1
  190. package/dist-esm/config/resolver/shape/pie.js +1 -1
  191. package/dist-esm/config/resolver/shape/polar.js +1 -1
  192. package/dist-esm/config/resolver/shape/radar.js +1 -1
  193. package/dist-esm/config/resolver/shape/scatter.js +1 -1
  194. package/dist-esm/config/resolver/shape/treemap.js +1 -1
  195. package/dist-esm/core.js +3 -3
  196. package/dist-esm/index.canvas.js +2 -1
  197. package/dist-esm/index.esm.js +2 -1
  198. package/dist-esm/module/Cache.js +1 -1
  199. package/dist-esm/module/browser.js +1 -1
  200. package/dist-esm/module/dsv.js +1 -1
  201. package/dist-esm/module/error.js +16 -3
  202. package/dist-esm/module/generator.js +1 -1
  203. package/dist-esm/module/sanitize.js +14 -18
  204. package/dist-esm/module/util/brush.js +1 -1
  205. package/dist-esm/module/util/dom.js +1 -1
  206. package/dist-esm/module/util/object.js +7 -4
  207. package/dist-esm/module/util/type-checks.js +1 -1
  208. package/dist-esm/module/worker.js +32 -22
  209. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  210. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  211. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  212. package/dist-esm/plugin/billboardjs-plugin-tableview.js +32 -21
  213. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  214. package/package.json +37 -11
  215. package/src/ChartInternal/Axis/AxisRenderer.ts +179 -105
  216. package/src/ChartInternal/ChartInternal.ts +11 -3
  217. package/src/ChartInternal/interactions/eventrect.ts +3 -1
  218. package/src/ChartInternal/shape/shape.ts +5 -3
  219. package/src/Plugin/tableview/Options.ts +17 -1
  220. package/src/Plugin/tableview/index.ts +1 -1
  221. package/src/canvas/CanvasEngine.ts +18 -5
  222. package/src/canvas/CanvasRenderer.ts +71 -36
  223. package/src/config/Options/axis/y2.ts +0 -13
  224. package/src/module/sanitize.ts +13 -20
  225. package/src/module/util/object.ts +4 -2
  226. package/src/module/worker.ts +34 -24
  227. package/types/index.d.ts +0 -3
  228. package/types/plugin/tableview/options.d.ts +5 -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.0.0-next.3
8
+ * @version 4.0.0
9
9
  *
10
10
  * All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
11
11
  * - @types/d3-selection ^3.0.11
@@ -26598,7 +26598,7 @@ const DANGEROUS_CSS_PATTERNS = [
26598
26598
  "-moz-binding:"
26599
26599
  ];
26600
26600
  function decodeHTMLEntities(str) {
26601
- return str.replace(/&colon;/gi, ":").replace(/&newline;/gi, "\n").replace(/&tab;/gi, " ").replace(/&nbsp;/gi, " ").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&amp;/gi, "&").replace(/&quot;/gi, '"').replace(/&apos;/gi, "'").replace(/&#(\d+);/gi, (_, code) => String.fromCharCode(parseInt(code, 10))).replace(/&#x([0-9a-f]+);/gi, (_, code) => String.fromCharCode(parseInt(code, 16)));
26601
+ return str.replace(/&colon;/gi, ":").replace(/&newline;/gi, "\n").replace(/&tab;/gi, " ").replace(/&nbsp;/gi, " ").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&amp;/gi, "&").replace(/&quot;/gi, '"').replace(/&apos;/gi, "'").replace(/&#(\d+);?/gi, (_, code) => String.fromCharCode(parseInt(code, 10))).replace(/&#x([0-9a-f]+);?/gi, (_, code) => String.fromCharCode(parseInt(code, 16)));
26602
26602
  }
26603
26603
  function isSafeURI(uri) {
26604
26604
  const decoded = decodeHTMLEntities(uri).trim();
@@ -26606,15 +26606,11 @@ function isSafeURI(uri) {
26606
26606
  if (!normalized || normalized.startsWith("#")) {
26607
26607
  return true;
26608
26608
  }
26609
- if (normalized.startsWith("/") || normalized.startsWith("./") || normalized.startsWith("../") || !normalized.includes(":")) {
26610
- return true;
26611
- }
26612
- const colonIndex = normalized.indexOf(":");
26613
- if (colonIndex > 0) {
26614
- const protocol = normalized.substring(0, colonIndex + 1);
26615
- return ALLOWED_URI_PROTOCOLS.has(protocol);
26609
+ const schemeMatch = normalized.match(/^[^/?#]*:/);
26610
+ if (schemeMatch) {
26611
+ return ALLOWED_URI_PROTOCOLS.has(schemeMatch[0]);
26616
26612
  }
26617
- return false;
26613
+ return true;
26618
26614
  }
26619
26615
  function sanitizeStyleValue(style) {
26620
26616
  const decoded = decodeHTMLEntities(style);
@@ -26770,7 +26766,7 @@ var __spreadValues = (a, b) => {
26770
26766
  function _forEachValidItem(items, callback) {
26771
26767
  for (let i = 0; i < items.length; i++) {
26772
26768
  const item = items[i];
26773
- if (item) {
26769
+ if (item !== null && isDefined(item)) {
26774
26770
  callback(item, i);
26775
26771
  }
26776
26772
  }
@@ -26850,7 +26846,9 @@ function mergeObj(target, ...objectN) {
26850
26846
  Object.keys(source).forEach((key) => {
26851
26847
  if (!/^(__proto__|constructor|prototype)$/i.test(key)) {
26852
26848
  const value = source[key];
26853
- if (isObject(value)) {
26849
+ if (value instanceof Date) {
26850
+ target[key] = new Date(value.getTime());
26851
+ } else if (isObject(value)) {
26854
26852
  !target[key] && (target[key] = {});
26855
26853
  target[key] = mergeObj(target[key], value);
26856
26854
  } else {
@@ -29634,6 +29632,7 @@ class CanvasEngine {
29634
29632
  CanvasEngine_publicField(this, "dpr", 1);
29635
29633
  CanvasEngine_publicField(this, "frame", null);
29636
29634
  CanvasEngine_publicField(this, "frameCtx", null);
29635
+ CanvasEngine_publicField(this, "frameValid", false);
29637
29636
  }
29638
29637
  /**
29639
29638
  * Create and attach the canvas element.
@@ -29668,13 +29667,14 @@ class CanvasEngine {
29668
29667
  this.ctx.setTransform(this.dpr, 0, 0, this.dpr, 0, 0);
29669
29668
  this.frame = null;
29670
29669
  this.frameCtx = null;
29670
+ this.frameValid = false;
29671
29671
  }
29672
29672
  /**
29673
29673
  * Clear transient overlay drawings by restoring the captured frame.
29674
29674
  * @private
29675
29675
  */
29676
29676
  clearOverlay() {
29677
- this.restoreFrame();
29677
+ this.frameValid && this.restoreFrame();
29678
29678
  }
29679
29679
  /**
29680
29680
  * Draw transient overlay content on the single visible canvas.
@@ -29683,7 +29683,12 @@ class CanvasEngine {
29683
29683
  */
29684
29684
  withOverlay(draw) {
29685
29685
  const { ctx } = this;
29686
- this.clearOverlay();
29686
+ const hasFrame = this.frameValid;
29687
+ if (hasFrame) {
29688
+ this.clearOverlay();
29689
+ } else {
29690
+ this.captureFrame();
29691
+ }
29687
29692
  ctx.save();
29688
29693
  ctx.setTransform(this.dpr, 0, 0, this.dpr, 0, 0);
29689
29694
  try {
@@ -29700,6 +29705,7 @@ class CanvasEngine {
29700
29705
  */
29701
29706
  beginFrame(w, h) {
29702
29707
  const { ctx } = this;
29708
+ this.frameValid = false;
29703
29709
  ctx.save();
29704
29710
  ctx.setTransform(this.dpr, 0, 0, this.dpr, 0, 0);
29705
29711
  ctx.clearRect(0, 0, w, h);
@@ -29710,7 +29716,6 @@ class CanvasEngine {
29710
29716
  */
29711
29717
  endFrame() {
29712
29718
  this.ctx.restore();
29713
- this.captureFrame();
29714
29719
  }
29715
29720
  /**
29716
29721
  * Capture the rendered frame for focus overlay restoration.
@@ -29718,6 +29723,7 @@ class CanvasEngine {
29718
29723
  */
29719
29724
  captureFrame() {
29720
29725
  const { canvas } = this;
29726
+ this.frameValid = false;
29721
29727
  if (canvas.width && canvas.height) {
29722
29728
  let { frame, frameCtx } = this;
29723
29729
  if (!frame) {
@@ -29738,6 +29744,7 @@ class CanvasEngine {
29738
29744
  frameCtx.clearRect(0, 0, canvas.width, canvas.height);
29739
29745
  }
29740
29746
  frameCtx.drawImage(canvas, 0, 0);
29747
+ this.frameValid = true;
29741
29748
  }
29742
29749
  }
29743
29750
  /**
@@ -29745,7 +29752,7 @@ class CanvasEngine {
29745
29752
  * @private
29746
29753
  */
29747
29754
  restoreFrame() {
29748
- if (!this.frame || !this.frameCtx) {
29755
+ if (!this.frameValid || !this.frame || !this.frameCtx) {
29749
29756
  return;
29750
29757
  }
29751
29758
  const { canvas, ctx } = this;
@@ -29765,6 +29772,7 @@ class CanvasEngine {
29765
29772
  (_a = this.canvas) == null ? void 0 : _a.remove();
29766
29773
  this.frame = null;
29767
29774
  this.frameCtx = null;
29775
+ this.frameValid = false;
29768
29776
  }
29769
29777
  }
29770
29778
 
@@ -31292,6 +31300,12 @@ function drawCanvasArea($$, target, indices, painter, isSub = false) {
31292
31300
  generateDrawAreaPath($$, indices, isSub, ctx)(target);
31293
31301
  });
31294
31302
  }
31303
+ function getVisibleCanvasTarget($$, target) {
31304
+ const range = getCanvasTargetVisibleRange($$, target);
31305
+ return range.start === 0 && range.end === target.values.length ? target : CanvasRenderer_spreadProps(CanvasRenderer_spreadValues({}, target), {
31306
+ values: target.values.slice(range.start, range.end)
31307
+ });
31308
+ }
31295
31309
  function getFocusedCanvasDatum(focusData, d) {
31296
31310
  if (!(focusData == null ? void 0 : focusData.length) || !(d == null ? void 0 : d.id)) {
31297
31311
  return null;
@@ -32295,7 +32309,7 @@ class CanvasRenderer {
32295
32309
  */
32296
32310
  hasExpandedShapeFocus($$, selectedData) {
32297
32311
  return !!(selectedData == null ? void 0 : selectedData.some(
32298
- (d) => d && (isCanvasBarType($$, d) || isCanvasCandlestickType($$, d) || isCanvasPointType($$, d) && getPointOpacity($$, d) < 1)
32312
+ (d) => d && (isCanvasBarType($$, d) || isCanvasCandlestickType($$, d))
32299
32313
  ));
32300
32314
  }
32301
32315
  /**
@@ -32316,13 +32330,14 @@ class CanvasRenderer {
32316
32330
  painter.withTranslation(margin.left, margin.top, () => {
32317
32331
  var _a;
32318
32332
  for (const target of targets) {
32319
- if (!target.values.some(hasCanvasDrawableValue.bind(null, $$))) {
32333
+ const visibleTarget = getVisibleCanvasTarget($$, target);
32334
+ if (!visibleTarget.values.some(hasCanvasDrawableValue.bind(null, $$))) {
32320
32335
  continue;
32321
32336
  }
32322
32337
  ctx.globalAlpha = getCanvasTargetFocusOpacity($$, target);
32323
32338
  ctx.lineWidth = isCanvasTargetFocused($$, target) ? style.shape.lineFocusedWidth : style.shape.lineWidth;
32324
32339
  ctx.strokeStyle = $$.color(target.id);
32325
- ((_a = $$.config.data_regions) == null ? void 0 : _a[target.id]) ? drawCanvasLineWithDataRegions($$, target, painter) : drawCanvasLine($$, target, indices, painter);
32340
+ ((_a = $$.config.data_regions) == null ? void 0 : _a[visibleTarget.id]) ? drawCanvasLineWithDataRegions($$, visibleTarget, painter) : drawCanvasLine($$, visibleTarget, indices, painter);
32326
32341
  }
32327
32342
  ctx.globalAlpha = 1;
32328
32343
  });
@@ -32345,21 +32360,23 @@ class CanvasRenderer {
32345
32360
  }
32346
32361
  painter.withTranslation(margin.left, margin.top, () => {
32347
32362
  for (const target of targets) {
32348
- if (!target.values.some(hasCanvasDrawableValue.bind(null, $$))) {
32363
+ const visibleTarget = getVisibleCanvasTarget($$, target);
32364
+ if (!visibleTarget.values.some(hasCanvasDrawableValue.bind(null, $$))) {
32349
32365
  continue;
32350
32366
  }
32351
- const color = getCanvasRenderColor($$, target, focusData);
32367
+ const color = getCanvasRenderColor($$, visibleTarget, focusData);
32352
32368
  ctx.globalAlpha = style.shape.areaOpacity * getCanvasTargetFocusOpacity($$, target);
32353
32369
  ctx.fillStyle = getCanvasLinearGradientFill(
32354
32370
  $$,
32355
32371
  ctx,
32356
- target,
32372
+ visibleTarget,
32357
32373
  "area",
32358
- // bounds computation is a full O(n) pass: skip when no gradient is set
32374
+ // Bounds computation walks visible rows, so skip it when no gradient is set.
32375
+ // Use the original target so the range cache stays aligned with unsliced values.
32359
32376
  $$.config.area_linearGradient ? getCanvasAreaBounds($$, target, indices) : null,
32360
32377
  color
32361
32378
  );
32362
- drawCanvasArea($$, target, indices, painter);
32379
+ drawCanvasArea($$, visibleTarget, indices, painter);
32363
32380
  }
32364
32381
  ctx.globalAlpha = 1;
32365
32382
  });
@@ -32630,7 +32647,7 @@ class CanvasRenderer {
32630
32647
  const d = data[i];
32631
32648
  const text = getLabelText($$, d);
32632
32649
  if (text && d.index >= range.start && d.index < range.end && hasCanvasDrawableValue($$, d)) {
32633
- rows.push({ d, i, text });
32650
+ rows.push({ d, text });
32634
32651
  }
32635
32652
  }
32636
32653
  labelCount += rows.length;
@@ -32643,12 +32660,12 @@ class CanvasRenderer {
32643
32660
  ctx.font = style.label.font;
32644
32661
  ctx.textAlign = "center";
32645
32662
  targetRows.forEach((rows) => {
32646
- var _a2;
32647
- for (const { d, i, text } of rows) {
32663
+ var _a2, _b;
32664
+ for (const { d, text } of rows) {
32648
32665
  let x;
32649
32666
  let y;
32650
32667
  if (isCanvasBarType($$, d) && barPoints) {
32651
- const geometry = getCanvasBarGeometry($$, barPoints, d, i);
32668
+ const geometry = getCanvasBarGeometry($$, barPoints, d, d.index);
32652
32669
  if (!geometry) {
32653
32670
  continue;
32654
32671
  }
@@ -32667,19 +32684,21 @@ class CanvasRenderer {
32667
32684
  $$,
32668
32685
  candlestickPoints,
32669
32686
  d,
32670
- i
32687
+ d.index
32671
32688
  );
32672
32689
  const isUp = value == null ? void 0 : value._isUp;
32673
32690
  if (!geometry) {
32674
32691
  continue;
32675
32692
  }
32676
- const { body } = geometry;
32677
- x = $$.config.axis_rotated ? isUp ? body.x + body.w + 4 : body.x - 4 : body.x + body.w / 2;
32678
- y = $$.config.axis_rotated ? body.y + body.h / 2 : isUp ? body.y - 4 : body.y + body.h + 13;
32693
+ const { wickEnd, wickStart } = geometry;
32694
+ const isInverted = $$.config[`axis_${(_b = $$.axis) == null ? void 0 : _b.getId(d.id)}_inverted`];
32695
+ x = $$.config.axis_rotated ? isUp ? wickEnd[0] + 4 : wickStart[0] - 4 : wickStart[0];
32696
+ y = $$.config.axis_rotated ? wickStart[1] + 3 : isUp ? wickEnd[1] - 3 : wickStart[1] + 12;
32697
+ !$$.config.axis_rotated && isInverted && (y += 15 * (isUp ? 1 : -1));
32679
32698
  ctx.textAlign = $$.config.axis_rotated ? isUp ? "left" : "right" : "center";
32680
- ctx.textBaseline = $$.config.axis_rotated ? "middle" : isUp ? "bottom" : "top";
32699
+ ctx.textBaseline = "alphabetic";
32681
32700
  } else if (cx && cy) {
32682
- ({ x, y } = getShapePoint(shape.pos, d, i));
32701
+ ({ x, y } = getShapePoint(shape.pos, d, d.index));
32683
32702
  ({ x, y } = getPointLabelAnchor($$, ctx, d, x, y));
32684
32703
  }
32685
32704
  x += getLabelPosition($$, d, "x", texts);
@@ -32909,15 +32928,24 @@ class CanvasRenderer {
32909
32928
  const r = (_d = (_c = $$.pointExpandedR) == null ? void 0 : _c.call($$, d)) != null ? _d : baseR * 1.75;
32910
32929
  const overColor = getCanvasOverColor($$, d);
32911
32930
  const color = overColor || $$.color(d.id);
32931
+ const fill = overColor || style.focusPoint.fill || style.shape.pointFillColor || color;
32932
+ const stroke = overColor || style.focusPoint.stroke || color;
32933
+ const lineWidth = style.focusPoint.lineWidth;
32934
+ const alpha = getPointOpacity($$, d);
32935
+ const hasStroke = !!stroke && (lineWidth != null ? lineWidth : 0) > 0;
32936
+ const mergeSameColorStroke = pointType === "circle" && hasStroke && isNumber(alpha) && alpha < 1 && fill === stroke;
32912
32937
  if (!isFiniteCanvasCoordinate(x, y)) {
32913
32938
  return;
32914
32939
  }
32915
- drawPointPattern(painter, pointType, x, y, r, {
32916
- fill: overColor || style.focusPoint.fill || style.shape.pointFillColor || color,
32917
- lineWidth: style.focusPoint.lineWidth,
32918
- stroke: overColor || style.focusPoint.stroke || color,
32919
- alpha: getPointOpacity($$, d)
32920
- }, baseR);
32940
+ drawPointPattern(
32941
+ painter,
32942
+ pointType,
32943
+ x,
32944
+ y,
32945
+ mergeSameColorStroke ? r + (lineWidth || 0) / 2 : r,
32946
+ hasStroke && !mergeSameColorStroke ? { fill, lineWidth, stroke, alpha } : { fill, alpha },
32947
+ baseR
32948
+ );
32921
32949
  });
32922
32950
  }
32923
32951
  this.drawFocusLabels($$, selectedData);
@@ -37269,20 +37297,24 @@ function getOrCreateWorkerResources(fn, depsFn) {
37269
37297
  const depsString = (_a = depsFn == null ? void 0 : depsFn.map(String).join(";")) != null ? _a : "";
37270
37298
  const key = (fnString + depsString).replace(/(function|[\s\W\n])/g, "").substring(0, 30);
37271
37299
  if (!(key in cache)) {
37272
- const blob = new win.Blob([
37273
- `${depsString}
37274
-
37275
- self.onmessage=function({data}) {
37276
- const result = (${fnString}).apply(null, data.args);
37277
- self.postMessage({id: data.id, result});
37278
- };`
37279
- ], {
37280
- type: "text/javascript"
37281
- });
37282
- cache[key] = {
37283
- src: win.URL.createObjectURL(blob),
37284
- worker: null
37285
- };
37300
+ try {
37301
+ const blob = new win.Blob([
37302
+ `${depsString}
37303
+
37304
+ self.onmessage=function({data}) {
37305
+ const result = (${fnString}).apply(null, data.args);
37306
+ self.postMessage({id: data.id, result});
37307
+ };`
37308
+ ], {
37309
+ type: "text/javascript"
37310
+ });
37311
+ cache[key] = {
37312
+ src: win.URL.createObjectURL(blob),
37313
+ worker: null
37314
+ };
37315
+ } catch (e) {
37316
+ return null;
37317
+ }
37286
37318
  }
37287
37319
  return { key, src: cache[key].src };
37288
37320
  }
@@ -37292,7 +37324,11 @@ function getWorker(key, src) {
37292
37324
  return null;
37293
37325
  }
37294
37326
  if (!cached.worker) {
37295
- cached.worker = new win.Worker(src);
37327
+ try {
37328
+ cached.worker = new win.Worker(src);
37329
+ } catch (e) {
37330
+ return null;
37331
+ }
37296
37332
  if (cached.worker) {
37297
37333
  cached.worker.onerror = function(e) {
37298
37334
  console.error ? console.error(e) : console.log(e);
@@ -37307,10 +37343,10 @@ function runWorker(useWorker = true, fn, callback, depsFn) {
37307
37343
  callback(res);
37308
37344
  };
37309
37345
  if (win.Worker && useWorker) {
37310
- const { key, src } = getOrCreateWorkerResources(fn, depsFn);
37311
- const worker = getWorker(key, src);
37312
- runFn = function(...args) {
37313
- if (worker) {
37346
+ const workerResources = getOrCreateWorkerResources(fn, depsFn);
37347
+ const worker = workerResources && getWorker(workerResources.key, workerResources.src);
37348
+ if (worker) {
37349
+ runFn = function(...args) {
37314
37350
  const id = ++messageId;
37315
37351
  const handler = function(e) {
37316
37352
  var _a;
@@ -37321,8 +37357,8 @@ function runWorker(useWorker = true, fn, callback, depsFn) {
37321
37357
  };
37322
37358
  worker.addEventListener("message", handler);
37323
37359
  worker.postMessage({ id, args });
37324
- }
37325
- };
37360
+ };
37361
+ }
37326
37362
  }
37327
37363
  return runFn;
37328
37364
  }
@@ -46143,10 +46179,11 @@ function updateTargetsForShape(targets, config) {
46143
46179
  const targets = $$.orderTargets(
46144
46180
  $$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$))
46145
46181
  );
46182
+ const dataGeneration = $$.state.dataGeneration;
46146
46183
  const targetIds = targets.map((t) => t.id).join("_");
46147
46184
  const cacheKey = `${KEY.shapeOffset}_${targetIds}`;
46148
46185
  const cachedData = $$.cache.get(cacheKey);
46149
- if (cachedData) {
46186
+ if ((cachedData == null ? void 0 : cachedData.generation) === dataGeneration) {
46150
46187
  return cachedData;
46151
46188
  }
46152
46189
  const isStackNormalized = $$.isStackNormalized();
@@ -46174,7 +46211,7 @@ function updateTargetsForShape(targets, config) {
46174
46211
  out[id] = index;
46175
46212
  return out;
46176
46213
  }, {});
46177
- const result = { indexMapByTargetId, shapeOffsetTargets };
46214
+ const result = { generation: dataGeneration, indexMapByTargetId, shapeOffsetTargets };
46178
46215
  $$.cache.add(cacheKey, result);
46179
46216
  return result;
46180
46217
  },
@@ -46940,7 +46977,7 @@ class ChartInternal {
46940
46977
  if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || labelsBGColor || ((_b = $$.hasLegendDefsPoint) == null ? void 0 : _b.call($$))) {
46941
46978
  $el.defs = $el.svg.append("defs");
46942
46979
  if (hasAxis) {
46943
- ["id", "idXAxis", "idYAxis", "idY2Axis", "idGrid"].forEach((v) => {
46980
+ ["id", "idXAxis", "idYAxis", "idGrid"].forEach((v) => {
46944
46981
  $$.appendClip($el.defs, state.clip[v]);
46945
46982
  });
46946
46983
  }
@@ -47184,6 +47221,7 @@ class ChartInternal {
47184
47221
  return $$.getBaseValue(d) !== null && withoutFadeIn[d.id] ? null : "0";
47185
47222
  }
47186
47223
  bindResize() {
47224
+ var _a, _b;
47187
47225
  const $$ = this;
47188
47226
  const { $el, config, state } = $$;
47189
47227
  const resizeFunction = generateResize(config.resize_timer);
@@ -47192,7 +47230,7 @@ class ChartInternal {
47192
47230
  list.push(() => callFn(config.onresize, $$.api));
47193
47231
  if (/^(true|parent)$/.test(resize_auto)) {
47194
47232
  list.push(() => {
47195
- var _a;
47233
+ var _a2;
47196
47234
  const prevWidth = state.current.width;
47197
47235
  const prevHeight = state.current.height;
47198
47236
  $$.setContainerSize();
@@ -47202,7 +47240,7 @@ class ChartInternal {
47202
47240
  state.resizing = true;
47203
47241
  if (config.legend_show) {
47204
47242
  $$.updateSizes();
47205
- state.isCanvasMode ? (_a = $$.updateHtmlLegend) == null ? void 0 : _a.call($$) : $$.updateLegend();
47243
+ state.isCanvasMode ? (_a2 = $$.updateHtmlLegend) == null ? void 0 : _a2.call($$) : $$.updateLegend();
47206
47244
  }
47207
47245
  $$.api.flush(false);
47208
47246
  });
@@ -47213,9 +47251,17 @@ class ChartInternal {
47213
47251
  });
47214
47252
  list.forEach((v) => resizeFunction.add(v));
47215
47253
  $$.resizeFunction = resizeFunction;
47216
- if (resize_auto === "parent") {
47217
- ($$.resizeFunction.resizeObserver = new ResizeObserver($$.resizeFunction.bind($$))).observe($el.chart.node().parentNode);
47254
+ if (resize_auto === "parent" && win.ResizeObserver) {
47255
+ ($$.resizeFunction.resizeObserver = new win.ResizeObserver(
47256
+ $$.resizeFunction.bind($$)
47257
+ )).observe($el.chart.node().parentNode);
47218
47258
  } else {
47259
+ if (resize_auto === "parent") {
47260
+ (_b = (_a = win.console) == null ? void 0 : _a.warn) == null ? void 0 : _b.call(
47261
+ _a,
47262
+ "[billboard.js] resize.auto='parent' requires ResizeObserver; falling back to window resize."
47263
+ );
47264
+ }
47219
47265
  win.addEventListener("resize", $$.resizeFunction);
47220
47266
  }
47221
47267
  }
@@ -55875,6 +55921,33 @@ class AxisRenderer {
55875
55921
  this.params = params;
55876
55922
  this.helper = new AxisRendererHelper(this);
55877
55923
  }
55924
+ canReuseTickTextOnResize(isLeftRight) {
55925
+ const { config, params } = this;
55926
+ const { config: chartConfig, id, owner } = params;
55927
+ const isX = /^(x|subX)$/.test(id);
55928
+ const type = id === "subX" ? "x" : id;
55929
+ const customTickFormat = id === "subX" ? chartConfig.subchart_axis_x_tick_format || chartConfig.axis_x_tick_format : chartConfig[`axis_${type}_tick_format`];
55930
+ const categoryAutoWrap = params.tickMultiline && params.isCategory && !isLeftRight && !(params.tickWidth > 0);
55931
+ return !!(owner.state.resizing && !owner.state.flowing && !isFunction(chartConfig.axis_evalTextSize) && !customTickFormat && !params.tickTitle && !(isX && chartConfig.axis_x_tick_autorotate) && !categoryAutoWrap && config.withoutTransition);
55932
+ }
55933
+ canReuseTickNodesOnResize(tickNodes, ticks, isLeftRight, tickShow) {
55934
+ if (tickShow.tick || !tickShow.text || !this.canReuseTickTextOnResize(isLeftRight) || tickNodes.size() !== ticks.length) {
55935
+ return false;
55936
+ }
55937
+ const nodes = tickNodes.nodes();
55938
+ for (let i = 0; i < ticks.length; i++) {
55939
+ const current = nodes[i].__data__;
55940
+ const next = ticks[i];
55941
+ if (current instanceof Date || next instanceof Date) {
55942
+ if (+current !== +next) {
55943
+ return false;
55944
+ }
55945
+ } else if (current !== next) {
55946
+ return false;
55947
+ }
55948
+ }
55949
+ return true;
55950
+ }
55878
55951
  /**
55879
55952
  * Create axis element
55880
55953
  * @param {d3.selection} g Axis selection
@@ -55919,76 +55992,106 @@ class AxisRenderer {
55919
55992
  if (tickShow.tick || tickShow.text) {
55920
55993
  const ticks = config.tickValues || helper.generateTicks(scale1, isLeftRight || params.config.axis_rotated);
55921
55994
  ctx.generatedTicks = ticks;
55922
- let tick = g2.selectAll(".tick").data(ticks, scale1);
55923
- const tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick");
55924
- const tickExit = tick.exit().remove();
55925
- tick = tickEnter.merge(tick);
55926
- tickShow.tick && tickEnter.append("line");
55927
- tickShow.text && tickEnter.append("text");
55928
- const tickText = tick.select("text");
55929
- const counts = [];
55930
- let sizeFor1Char = { w: 0, h: 0 };
55931
- if (isFunction(evalTextSize)) {
55932
- sizeFor1Char = evalTextSize.bind(ctx.params.owner.api)(tickText.node(), id);
55933
- if (this.classList.contains($COMMON.dummy)) {
55934
- this.sizeFor1Char = sizeFor1Char;
55935
- }
55936
- }
55937
- if (!sizeFor1Char || sizeFor1Char.w === 0 || sizeFor1Char.h === 0) {
55938
- sizeFor1Char = ctx.helper.getSizeFor1Char(orient, tickText, !!evalTextSize);
55939
- }
55940
- let tspan = tickText.selectAll("tspan").data((d, index) => {
55941
- let split;
55942
- if (params.tickMultiline) {
55943
- split = splitTickText(d, scale1, ticks, isLeftRight, sizeFor1Char.w);
55944
- } else {
55945
- const formatted = helper.textFormatted(d);
55946
- split = isArray(formatted) ? formatted.concat() : [formatted];
55995
+ let tick = g2.selectAll(".tick");
55996
+ const canReuseTickNodes = ctx.canReuseTickNodesOnResize(
55997
+ tick,
55998
+ ticks,
55999
+ isLeftRight || params.config.axis_rotated,
56000
+ tickShow
56001
+ );
56002
+ if (canReuseTickNodes) {
56003
+ tickTransform(tick, scale1);
56004
+ } else {
56005
+ tick = tick.data(ticks, scale1);
56006
+ const tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick");
56007
+ const tickExit = tick.exit().remove();
56008
+ tick = tickEnter.merge(tick);
56009
+ tickShow.tick && tickEnter.append("line");
56010
+ tickShow.text && tickEnter.append("text");
56011
+ const hasTickChange = !tickEnter.empty() || !tickExit.empty();
56012
+ const reuseTickText = tickShow.text && !hasTickChange && ctx.canReuseTickTextOnResize(isLeftRight || params.config.axis_rotated);
56013
+ let sizeFor1Char = { w: 0, h: 0 };
56014
+ let textUpdate = tick.selectAll("text.__bb-empty");
56015
+ if (tickShow.text && !reuseTickText) {
56016
+ const tickText = tick.select("text");
56017
+ const counts = [];
56018
+ textUpdate = tickText;
56019
+ if (isFunction(evalTextSize)) {
56020
+ sizeFor1Char = evalTextSize.bind(ctx.params.owner.api)(
56021
+ tickText.node(),
56022
+ id
56023
+ );
56024
+ if (this.classList.contains($COMMON.dummy)) {
56025
+ this.sizeFor1Char = sizeFor1Char;
56026
+ }
56027
+ }
56028
+ if (!sizeFor1Char || sizeFor1Char.w === 0 || sizeFor1Char.h === 0) {
56029
+ sizeFor1Char = ctx.helper.getSizeFor1Char(
56030
+ orient,
56031
+ tickText,
56032
+ !!evalTextSize
56033
+ );
56034
+ }
56035
+ let tspan = tickText.selectAll("tspan").data((d, index) => {
56036
+ let split;
56037
+ if (params.tickMultiline) {
56038
+ split = splitTickText(
56039
+ d,
56040
+ scale1,
56041
+ ticks,
56042
+ isLeftRight,
56043
+ sizeFor1Char.w
56044
+ );
56045
+ } else {
56046
+ const formatted = helper.textFormatted(d);
56047
+ split = isArray(formatted) ? formatted.concat() : [formatted];
56048
+ }
56049
+ counts[index] = split.length;
56050
+ return split.map((splitted) => ({ index, splitted }));
56051
+ });
56052
+ tspan.exit().remove();
56053
+ tspan = tspan.enter().append("tspan").merge(tspan).text((d) => d.splitted);
56054
+ tspan.attr("x", isTopBottom ? 0 : tickLength * sign).attr("dx", (() => {
56055
+ let dx = 0;
56056
+ if (/(top|bottom)/.test(orient) && rotate) {
56057
+ dx = 8 * Math.sin(Math.PI * (rotate / 180)) * (orient === "top" ? -1 : 1);
56058
+ }
56059
+ return dx + (tickTextPos.x || 0);
56060
+ })()).attr("dy", (d, i) => {
56061
+ const defValue = ".71em";
56062
+ let dy = 0;
56063
+ if (orient !== "top") {
56064
+ dy = sizeFor1Char.h;
56065
+ if (i === 0) {
56066
+ dy = isLeftRight ? -((counts[d.index] - 1) * (sizeFor1Char.h / 2) - 3) : tickTextPos.y === 0 ? defValue : 0;
56067
+ }
56068
+ }
56069
+ return isNumber(dy) && tickTextPos.y ? dy + tickTextPos.y : dy || defValue;
56070
+ });
55947
56071
  }
55948
- counts[index] = split.length;
55949
- return split.map((splitted) => ({ index, splitted }));
55950
- });
55951
- tspan.exit().remove();
55952
- tspan = tspan.enter().append("tspan").merge(tspan).text((d) => d.splitted);
55953
- tspan.attr("x", isTopBottom ? 0 : tickLength * sign).attr("dx", (() => {
55954
- let dx = 0;
55955
- if (/(top|bottom)/.test(orient) && rotate) {
55956
- dx = 8 * Math.sin(Math.PI * (rotate / 180)) * (orient === "top" ? -1 : 1);
56072
+ const lineUpdate = tick.select("line");
56073
+ tickEnter.select("line").attr(`${axisPx}2`, innerTickSize * sign);
56074
+ tickEnter.select("text").attr(axisPx, tickLength * sign);
56075
+ ctx.setTickLineTextPosition(lineUpdate, textUpdate, sizeFor1Char);
56076
+ if (params.tickTitle) {
56077
+ const title = textUpdate.select("title");
56078
+ const tickTitle = params.tickTitle;
56079
+ (title.empty() ? textUpdate.append("title") : title).text((index) => tickTitle[Number(index)]);
55957
56080
  }
55958
- return dx + (tickTextPos.x || 0);
55959
- })()).attr("dy", (d, i) => {
55960
- const defValue = ".71em";
55961
- let dy = 0;
55962
- if (orient !== "top") {
55963
- dy = sizeFor1Char.h;
55964
- if (i === 0) {
55965
- dy = isLeftRight ? -((counts[d.index] - 1) * (sizeFor1Char.h / 2) - 3) : tickTextPos.y === 0 ? defValue : 0;
55966
- }
56081
+ if (scale1.bandwidth) {
56082
+ const x = scale1;
56083
+ const dx = x.bandwidth() / 2;
56084
+ scale0 = (d) => x(d) + dx;
56085
+ scale1 = scale0;
56086
+ } else if (scale0.bandwidth) {
56087
+ scale0 = scale1;
56088
+ } else {
56089
+ tickTransform(tickExit, scale1);
55967
56090
  }
55968
- return isNumber(dy) && tickTextPos.y ? dy + tickTextPos.y : dy || defValue;
55969
- });
55970
- const lineUpdate = tick.select("line");
55971
- const textUpdate = tick.select("text");
55972
- tickEnter.select("line").attr(`${axisPx}2`, innerTickSize * sign);
55973
- tickEnter.select("text").attr(axisPx, tickLength * sign);
55974
- ctx.setTickLineTextPosition(lineUpdate, textUpdate, sizeFor1Char);
55975
- if (params.tickTitle) {
55976
- const title = textUpdate.select("title");
55977
- (title.empty() ? textUpdate.append("title") : title).text((index) => params.tickTitle[index]);
55978
- }
55979
- if (scale1.bandwidth) {
55980
- const x = scale1;
55981
- const dx = x.bandwidth() / 2;
55982
- scale0 = (d) => x(d) + dx;
55983
- scale1 = scale0;
55984
- } else if (scale0.bandwidth) {
55985
- scale0 = scale1;
55986
- } else {
55987
- tickTransform(tickExit, scale1);
56091
+ tick = params.owner.state.flowing ? helper.transitionise(tick) : params.owner.$T(tick);
56092
+ tickTransform(tickEnter, scale0);
56093
+ tickTransform(tick.style("opacity", null), scale1);
55988
56094
  }
55989
- tick = params.owner.state.flowing ? helper.transitionise(tick) : params.owner.$T(tick);
55990
- tickTransform(tickEnter, scale0);
55991
- tickTransform(tick.style("opacity", null), scale1);
55992
56095
  }
55993
56096
  });
55994
56097
  this.g = $g;
@@ -56071,7 +56174,7 @@ class AxisRenderer {
56071
56174
  switch (orient) {
56072
56175
  case "bottom":
56073
56176
  lineUpdate.attr("x1", tickPos.x).attr("x2", tickPos.x).attr("y2", (d) => this.getTickSize.bind(this)(d) * (tickLineInner ? -1 : 1));
56074
- textUpdate.attr("x", 0).attr("y", yForText(rotate)).style("text-anchor", textAnchorForText(rotate)).style("text-anchor", (d, i, { length }) => {
56177
+ textUpdate.attr("x", 0).attr("y", yForText(rotate)).style("text-anchor", (d, i, { length }) => {
56075
56178
  if (!isRotated && i === 0 && (inner === true || inner.first)) {
56076
56179
  return "start";
56077
56180
  } else if (!isRotated && i === length - 1 && (inner === true || inner.last)) {
@@ -57567,7 +57670,7 @@ var eventrect_pow = Math.pow;
57567
57670
  const isRotated = config.axis_rotated;
57568
57671
  const isMultipleX = $$.isMultipleX();
57569
57672
  const xDomain = xScale == null ? void 0 : xScale.domain();
57570
- const fingerprint = xDomain ? `${xDomain[0]}_${xDomain[1]}_${state.width}_${state.height}_${$$.data.targets.length}_${[...state.hiddenTargetIds].join(",")}` : null;
57673
+ const fingerprint = xDomain ? `${xDomain[0]}_${xDomain[1]}_${state.width}_${state.height}_${$$.data.targets.length}_${state.dataGeneration}_${[...state.hiddenTargetIds].join(",")}` : null;
57571
57674
  if (fingerprint && fingerprint === state._eventRectFingerprint) {
57572
57675
  return;
57573
57676
  }
@@ -59372,18 +59475,6 @@ var eventrect_pow = Math.pow;
59372
59475
 
59373
59476
  ;// ./src/config/Options/axis/y2.ts
59374
59477
  /* harmony default export */ var y2 = ({
59375
- /**
59376
- * Set clip-path attribute for y2 axis element
59377
- * - **NOTE**: `clip-path` attribute for y2 Axis is set only when `axis.y2.inner` option is true.
59378
- * @name axis․y2․clipPath
59379
- * @memberof Options
59380
- * @type {boolean}
59381
- * @default true
59382
- * @example
59383
- * // don't set 'clip-path' attribute
59384
- * clipPath: false
59385
- */
59386
- axis_y2_clipPath: true,
59387
59478
  /**
59388
59479
  * Show or hide y2 axis.
59389
59480
  * - **NOTE**:
@@ -64940,7 +65031,7 @@ const bb = {
64940
65031
  * bb.version; // "1.0.0"
64941
65032
  * @memberof bb
64942
65033
  */
64943
- version: "4.0.0-next.3",
65034
+ version: "4.0.0",
64944
65035
  /**
64945
65036
  * Generate chart
64946
65037
  * - **NOTE:** Bear in mind for the possibility of ***throwing an error***, during the generation when: