@visactor/vchart-extension 2.1.0-alpha.25 → 2.1.0-alpha.26

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 (143) hide show
  1. package/build/index.js +118 -17
  2. package/build/index.min.js +1 -1
  3. package/cjs/charts/3d/plugin.js +1 -1
  4. package/cjs/charts/3d/pyramid-3d.js +1 -1
  5. package/cjs/charts/3d/rect-3d.js +1 -1
  6. package/cjs/charts/3d/util.js +1 -1
  7. package/cjs/charts/axis-3d/axis-3d-mixin.js +1 -1
  8. package/cjs/charts/axis-3d/band-axis.js +1 -1
  9. package/cjs/charts/axis-3d/index.js +1 -1
  10. package/cjs/charts/axis-3d/linear-axis.js +1 -2
  11. package/cjs/charts/axis-3d/log-axis.js +1 -1
  12. package/cjs/charts/axis-3d/symlog-axis.js +1 -1
  13. package/cjs/charts/axis-3d/theme.js +1 -1
  14. package/cjs/charts/axis-3d/time-axis.js +1 -1
  15. package/cjs/charts/axis-3d/util.js +1 -1
  16. package/cjs/charts/combination-candlestick/combination-candlestick-transformer.js +1 -1
  17. package/cjs/charts/combination-candlestick/combination-candlestick.js +1 -1
  18. package/cjs/charts/combination-candlestick/constant.js +1 -1
  19. package/cjs/charts/combination-candlestick/index.js +1 -1
  20. package/cjs/charts/combination-candlestick/interface.js +1 -1
  21. package/cjs/charts/conversion-funnel/arrow-data-transform.js +1 -1
  22. package/cjs/charts/conversion-funnel/constants.js +1 -1
  23. package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js +1 -1
  24. package/cjs/charts/conversion-funnel/conversion-funnel.js +1 -1
  25. package/cjs/charts/conversion-funnel/index.js +1 -1
  26. package/cjs/charts/conversion-funnel/interface.js +1 -1
  27. package/cjs/charts/conversion-funnel/util.js +1 -1
  28. package/cjs/charts/funnel-3d/chart.js +1 -1
  29. package/cjs/charts/funnel-3d/constant.js +1 -1
  30. package/cjs/charts/funnel-3d/index.js +1 -1
  31. package/cjs/charts/funnel-3d/interface.js +1 -1
  32. package/cjs/charts/funnel-3d/series-spec-transformer.js +1 -1
  33. package/cjs/charts/histogram-3d/chart.js +1 -2
  34. package/cjs/charts/histogram-3d/index.js +1 -1
  35. package/cjs/charts/histogram-3d/interface.js +1 -1
  36. package/cjs/charts/storyline/layouts/wing.js +92 -19
  37. package/cjs/charts/storyline/layouts/wing.js.map +1 -1
  38. package/cjs/charts/storyline/storyline-transformer.js +7 -3
  39. package/cjs/charts/storyline/storyline-transformer.js.map +1 -1
  40. package/cjs/components/bar-link/bar-link.js +1 -1
  41. package/cjs/components/bar-link/constant.js +1 -1
  42. package/cjs/components/bar-link/index.js +1 -1
  43. package/cjs/components/bar-link/type.js +1 -1
  44. package/cjs/components/bar-link/util.js +1 -1
  45. package/cjs/components/bar-regression-line/index.js +1 -1
  46. package/cjs/components/bar-regression-line/type.js +2 -1
  47. package/cjs/components/extension-mark-sync-state/extension-mark-sync-state.js +1 -1
  48. package/cjs/components/extension-mark-sync-state/index.js +1 -1
  49. package/cjs/components/extension-mark-sync-state/type.js +1 -1
  50. package/cjs/components/histogram-regression-line/index.js +1 -1
  51. package/cjs/components/histogram-regression-line/type.js +1 -1
  52. package/cjs/components/map-label/index.js +1 -1
  53. package/cjs/components/map-label/layout.js +1 -1
  54. package/cjs/components/map-label/map-label-transformer.js +1 -1
  55. package/cjs/components/map-label/map-label.js +1 -1
  56. package/cjs/components/map-label/theme.js +1 -1
  57. package/cjs/components/map-label/type.js +1 -1
  58. package/cjs/components/regression-line/index.js +1 -1
  59. package/cjs/components/regression-line/regression-line.js +1 -1
  60. package/cjs/components/regression-line/type.js +1 -1
  61. package/cjs/components/scatter-regression-line/index.js +1 -1
  62. package/cjs/components/scatter-regression-line/type.js +1 -1
  63. package/cjs/components/series-break/constant.js +1 -1
  64. package/cjs/components/series-break/index.js +1 -1
  65. package/cjs/components/series-break/series-break.js +1 -1
  66. package/cjs/components/series-break/type.js +1 -1
  67. package/cjs/components/series-break/util.js +1 -1
  68. package/cjs/components/series-label/constant.js +1 -1
  69. package/cjs/components/series-label/index.js +2 -1
  70. package/cjs/components/series-label/series-label.js +1 -1
  71. package/cjs/components/series-label/type.js +1 -1
  72. package/cjs/components/series-label/util.js +1 -1
  73. package/esm/charts/3d/plugin.js +1 -1
  74. package/esm/charts/3d/pyramid-3d.js +1 -1
  75. package/esm/charts/3d/rect-3d.js +1 -1
  76. package/esm/charts/3d/util.js +1 -1
  77. package/esm/charts/axis-3d/axis-3d-mixin.js +1 -1
  78. package/esm/charts/axis-3d/band-axis.js +1 -1
  79. package/esm/charts/axis-3d/index.js +1 -1
  80. package/esm/charts/axis-3d/linear-axis.js +1 -2
  81. package/esm/charts/axis-3d/log-axis.js +1 -1
  82. package/esm/charts/axis-3d/symlog-axis.js +1 -1
  83. package/esm/charts/axis-3d/theme.js +1 -1
  84. package/esm/charts/axis-3d/time-axis.js +1 -1
  85. package/esm/charts/axis-3d/util.js +1 -1
  86. package/esm/charts/combination-candlestick/combination-candlestick-transformer.js +1 -1
  87. package/esm/charts/combination-candlestick/combination-candlestick.js +1 -1
  88. package/esm/charts/combination-candlestick/constant.js +1 -1
  89. package/esm/charts/combination-candlestick/index.js +1 -1
  90. package/esm/charts/combination-candlestick/interface.js +1 -1
  91. package/esm/charts/conversion-funnel/arrow-data-transform.js +1 -1
  92. package/esm/charts/conversion-funnel/constants.js +1 -1
  93. package/esm/charts/conversion-funnel/conversion-funnel-transformer.js +1 -1
  94. package/esm/charts/conversion-funnel/conversion-funnel.js +1 -1
  95. package/esm/charts/conversion-funnel/index.js +1 -1
  96. package/esm/charts/conversion-funnel/interface.js +1 -1
  97. package/esm/charts/conversion-funnel/util.js +1 -1
  98. package/esm/charts/funnel-3d/chart.js +1 -1
  99. package/esm/charts/funnel-3d/constant.js +1 -1
  100. package/esm/charts/funnel-3d/index.js +1 -1
  101. package/esm/charts/funnel-3d/interface.js +1 -1
  102. package/esm/charts/funnel-3d/series-spec-transformer.js +1 -1
  103. package/esm/charts/histogram-3d/chart.js +1 -2
  104. package/esm/charts/histogram-3d/index.js +1 -1
  105. package/esm/charts/histogram-3d/interface.js +1 -1
  106. package/esm/charts/storyline/layouts/wing.js +92 -19
  107. package/esm/charts/storyline/layouts/wing.js.map +1 -1
  108. package/esm/charts/storyline/storyline-transformer.js +5 -3
  109. package/esm/charts/storyline/storyline-transformer.js.map +1 -1
  110. package/esm/components/bar-link/bar-link.js +1 -1
  111. package/esm/components/bar-link/constant.js +1 -1
  112. package/esm/components/bar-link/index.js +1 -1
  113. package/esm/components/bar-link/type.js +1 -1
  114. package/esm/components/bar-link/util.js +1 -1
  115. package/esm/components/bar-regression-line/index.js +1 -1
  116. package/esm/components/bar-regression-line/type.js +2 -1
  117. package/esm/components/extension-mark-sync-state/extension-mark-sync-state.js +1 -1
  118. package/esm/components/extension-mark-sync-state/index.js +1 -1
  119. package/esm/components/extension-mark-sync-state/type.js +1 -1
  120. package/esm/components/histogram-regression-line/index.js +1 -1
  121. package/esm/components/histogram-regression-line/type.js +1 -1
  122. package/esm/components/map-label/index.js +1 -1
  123. package/esm/components/map-label/layout.js +1 -1
  124. package/esm/components/map-label/map-label-transformer.js +1 -1
  125. package/esm/components/map-label/map-label.js +1 -1
  126. package/esm/components/map-label/theme.js +1 -1
  127. package/esm/components/map-label/type.js +1 -1
  128. package/esm/components/regression-line/index.js +1 -1
  129. package/esm/components/regression-line/regression-line.js +1 -1
  130. package/esm/components/regression-line/type.js +1 -1
  131. package/esm/components/scatter-regression-line/index.js +1 -1
  132. package/esm/components/scatter-regression-line/type.js +1 -1
  133. package/esm/components/series-break/constant.js +1 -1
  134. package/esm/components/series-break/index.js +1 -1
  135. package/esm/components/series-break/series-break.js +1 -1
  136. package/esm/components/series-break/type.js +1 -1
  137. package/esm/components/series-break/util.js +1 -1
  138. package/esm/components/series-label/constant.js +1 -1
  139. package/esm/components/series-label/index.js +2 -1
  140. package/esm/components/series-label/series-label.js +1 -1
  141. package/esm/components/series-label/type.js +1 -1
  142. package/esm/components/series-label/util.js +1 -1
  143. package/package.json +4 -4
@@ -32,4 +32,4 @@ const register3DPlugin = () => {
32
32
  };
33
33
 
34
34
  exports.register3DPlugin = register3DPlugin;
35
- //# sourceMappingURL=plugin.js.map
35
+ //# sourceMappingURL=plugin.js.map
@@ -27,4 +27,4 @@ const registerPyramid3dMark = () => {
27
27
  };
28
28
 
29
29
  exports.registerPyramid3dMark = registerPyramid3dMark;
30
- //# sourceMappingURL=pyramid-3d.js.map
30
+ //# sourceMappingURL=pyramid-3d.js.map
@@ -33,4 +33,4 @@ const registerRect3dMark = () => {
33
33
  };
34
34
 
35
35
  exports.registerRect3dMark = registerRect3dMark;
36
- //# sourceMappingURL=rect-3d.js.map
36
+ //# sourceMappingURL=rect-3d.js.map
@@ -16,4 +16,4 @@ const is3DChart = spec => !!spec && ((0, exports.is3DChartType)(spec.type) || (0
16
16
  exports.is3DAxisChart)(spec), !0);
17
17
 
18
18
  exports.is3DChart = is3DChart;
19
- //# sourceMappingURL=util.js.map
19
+ //# sourceMappingURL=util.js.map
@@ -63,4 +63,4 @@ class Axis3dMixin {
63
63
  }
64
64
 
65
65
  exports.Axis3dMixin = Axis3dMixin;
66
- //# sourceMappingURL=axis-3d-mixin.js.map
66
+ //# sourceMappingURL=axis-3d-mixin.js.map
@@ -13,4 +13,4 @@ const vchart_1 = require("@visactor/vchart"), theme_1 = require("./theme"), vcha
13
13
  };
14
14
 
15
15
  exports.registerCartesianBandAxis3d = registerCartesianBandAxis3d;
16
- //# sourceMappingURL=band-axis.js.map
16
+ //# sourceMappingURL=band-axis.js.map
@@ -11,4 +11,4 @@ const layout_1 = require("../3d/layout"), plugin_1 = require("../3d/plugin"), ba
11
11
  };
12
12
 
13
13
  exports.registerAxis3dPlugin = registerAxis3dPlugin;
14
- //# sourceMappingURL=index.js.map
14
+ //# sourceMappingURL=index.js.map
@@ -12,5 +12,4 @@ const vchart_1 = require("@visactor/vchart"), theme_1 = require("./theme"), vcha
12
12
  }), (0, vchart_2.mixin)(AxisCls, axis_3d_mixin_1.Axis3dMixin);
13
13
  };
14
14
 
15
- exports.registerCartesianLinearAxis3d = registerCartesianLinearAxis3d;
16
- //# sourceMappingURL=linear-axis.js.map
15
+ exports.registerCartesianLinearAxis3d = registerCartesianLinearAxis3d;
@@ -13,4 +13,4 @@ const vchart_1 = require("@visactor/vchart"), theme_1 = require("./theme"), vcha
13
13
  };
14
14
 
15
15
  exports.registerCartesianLogAxis3d = registerCartesianLogAxis3d;
16
- //# sourceMappingURL=log-axis.js.map
16
+ //# sourceMappingURL=log-axis.js.map
@@ -13,4 +13,4 @@ const vchart_1 = require("@visactor/vchart"), theme_1 = require("./theme"), vcha
13
13
  };
14
14
 
15
15
  exports.registerCartesianSymlogAxis3d = registerCartesianSymlogAxis3d;
16
- //# sourceMappingURL=symlog-axis.js.map
16
+ //# sourceMappingURL=symlog-axis.js.map
@@ -7,4 +7,4 @@ Object.defineProperty(exports, "__esModule", {
7
7
  space: 0
8
8
  }
9
9
  };
10
- //# sourceMappingURL=theme.js.map
10
+ //# sourceMappingURL=theme.js.map
@@ -13,4 +13,4 @@ const vchart_1 = require("@visactor/vchart"), theme_1 = require("./theme"), vcha
13
13
  };
14
14
 
15
15
  exports.registerCartesianTimeAxis3d = registerCartesianTimeAxis3d;
16
- //# sourceMappingURL=time-axis.js.map
16
+ //# sourceMappingURL=time-axis.js.map
@@ -43,4 +43,4 @@ const vchart_1 = require("@visactor/vchart"), getUpdateAttributeOfZAxis = (axis,
43
43
  };
44
44
 
45
45
  exports.getUpdateAttributeOfZAxis = getUpdateAttributeOfZAxis;
46
- //# sourceMappingURL=util.js.map
46
+ //# sourceMappingURL=util.js.map
@@ -201,4 +201,4 @@ class CombinationCandlestickChartSpecTransformer extends vchart_1.CartesianChart
201
201
  }
202
202
 
203
203
  exports.CombinationCandlestickChartSpecTransformer = CombinationCandlestickChartSpecTransformer;
204
- //# sourceMappingURL=combination-candlestick-transformer.js.map
204
+ //# sourceMappingURL=combination-candlestick-transformer.js.map
@@ -28,4 +28,4 @@ const registerCombinationCandlestickChart = () => {
28
28
  };
29
29
 
30
30
  exports.registerCombinationCandlestickChart = registerCombinationCandlestickChart;
31
- //# sourceMappingURL=combination-candlestick.js.map
31
+ //# sourceMappingURL=combination-candlestick.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.CombinationCandlestickChart_TYPE = void 0, exports.CombinationCandlestickChart_TYPE = "combinationCandlestick";
6
- //# sourceMappingURL=constant.js.map
6
+ //# sourceMappingURL=constant.js.map
@@ -19,4 +19,4 @@ Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
20
  }), __exportStar(require("./combination-candlestick"), exports), __exportStar(require("./interface"), exports),
21
21
  __exportStar(require("./constant"), exports);
22
- //# sourceMappingURL=index.js.map
22
+ //# sourceMappingURL=index.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=interface.js.map
6
+ //# sourceMappingURL=interface.js.map
@@ -95,5 +95,5 @@ function computeIndex(arrow, totalArrows) {
95
95
  return index;
96
96
  }
97
97
 
98
- exports.conversionArrowTransform = conversionArrowTransform;
99
98
  //# sourceMappingURL=arrow-data-transform.js.map
99
+ exports.conversionArrowTransform = conversionArrowTransform;
@@ -21,4 +21,4 @@ exports.DEFAULT_ARROW_MARK_STYLE = {
21
21
  }, exports.DEFAULT_FUNNEL_BACKGROUND_MARK_STYLE = {
22
22
  fill: "#eff1f9"
23
23
  };
24
- //# sourceMappingURL=constants.js.map
24
+ //# sourceMappingURL=constants.js.map
@@ -193,5 +193,5 @@ function addFunnelBackgroundMark(funnelBackground) {
193
193
  });
194
194
  }
195
195
 
196
- exports.ConversionFunnelChartSpecTransformer = ConversionFunnelChartSpecTransformer;
197
196
  //# sourceMappingURL=conversion-funnel-transformer.js.map
197
+ exports.ConversionFunnelChartSpecTransformer = ConversionFunnelChartSpecTransformer;
@@ -59,4 +59,4 @@ const registerConversionFunnelChart = option => {
59
59
  };
60
60
 
61
61
  exports.registerConversionFunnelChart = registerConversionFunnelChart;
62
- //# sourceMappingURL=conversion-funnel.js.map
62
+ //# sourceMappingURL=conversion-funnel.js.map
@@ -18,4 +18,4 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
20
  }), __exportStar(require("./interface"), exports), __exportStar(require("./conversion-funnel"), exports);
21
- //# sourceMappingURL=index.js.map
21
+ //# sourceMappingURL=index.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=interface.js.map
6
+ //# sourceMappingURL=interface.js.map
@@ -14,4 +14,4 @@ Object.defineProperty(exports, "__esModule", {
14
14
  value: !0
15
15
  }), exports.isSameArrow = exports.isArrowCross = void 0, exports.isArrowCross = isArrowCross,
16
16
  exports.isSameArrow = isSameArrow;
17
- //# sourceMappingURL=util.js.map
17
+ //# sourceMappingURL=util.js.map
@@ -22,4 +22,4 @@ const registerFunnel3dChart = () => {
22
22
  };
23
23
 
24
24
  exports.registerFunnel3dChart = registerFunnel3dChart;
25
- //# sourceMappingURL=chart.js.map
25
+ //# sourceMappingURL=chart.js.map
@@ -28,4 +28,4 @@ exports.funnel3dSeriesMark = Object.assign(Object.assign({}, vchart_1.baseSeries
28
28
  type: "rule"
29
29
  }
30
30
  });
31
- //# sourceMappingURL=constant.js.map
31
+ //# sourceMappingURL=constant.js.map
@@ -19,4 +19,4 @@ Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
20
  }), __exportStar(require("./chart"), exports), __exportStar(require("./series"), exports),
21
21
  __exportStar(require("./series-spec-transformer"), exports), __exportStar(require("./interface"), exports);
22
- //# sourceMappingURL=index.js.map
22
+ //# sourceMappingURL=index.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=interface.js.map
6
+ //# sourceMappingURL=interface.js.map
@@ -13,4 +13,4 @@ class Funnel3dSeriesSpecTransformer extends vchart_1.FunnelSeriesSpecTransformer
13
13
  }
14
14
 
15
15
  exports.Funnel3dSeriesSpecTransformer = Funnel3dSeriesSpecTransformer;
16
- //# sourceMappingURL=series-spec-transformer.js.map
16
+ //# sourceMappingURL=series-spec-transformer.js.map
@@ -27,5 +27,4 @@ const registerHistogram3dChart = () => {
27
27
  (0, series_1.registerBar3dSeries)(), vchart_1.Factory.registerChart(Histogram3dChart.type, Histogram3dChart);
28
28
  };
29
29
 
30
- exports.registerHistogram3dChart = registerHistogram3dChart;
31
- //# sourceMappingURL=chart.js.map
30
+ exports.registerHistogram3dChart = registerHistogram3dChart;
@@ -18,4 +18,4 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
20
  }), __exportStar(require("./chart"), exports), __exportStar(require("./interface"), exports);
21
- //# sourceMappingURL=index.js.map
21
+ //# sourceMappingURL=index.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=interface.js.map
6
+ //# sourceMappingURL=interface.js.map
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.buildWingBlockMark = exports.buildWingTitleImageMark = exports.buildWingArcMark = void 0;
6
6
 
7
- const vchart_1 = require("@visactor/vchart"), common_1 = require("./common"), WING_BLOCK_IMAGE_SIZE = 160, WING_TEXT_GAP_FROM_IMAGE = 14, WING_TITLE_LINE_HEIGHT = 30, WING_TITLE_FONT_SIZE = 22, WING_CONTENT_LINE_HEIGHT = 17, WING_CONTENT_FONT_SIZE = 12, WING_TEXT_BOX_WIDTH = 240, WING_TEXT_BOX_HEIGHT = 110, WING_TITLE_TO_CONTENT_GAP = 4, WING_TITLE_IMAGE_WIDTH_RATIO = .6, WING_TITLE_IMAGE_MAX_WIDTH = 820, WING_DEFAULT_PATH_END_WIDTH = 350, WING_IMAGE_MIN_SCALE = .52, WING_IMAGE_MAX_SCALE = 1.2, WING_BOTTOM_TEXT_IMAGE_GAP_RATIO = 1.35, clamp = (value, min, max) => Math.max(min, Math.min(max, value)), getWingDirection = spec => "right" === (0,
7
+ const vchart_1 = require("@visactor/vchart"), common_1 = require("./common"), WING_BLOCK_IMAGE_SIZE = 160, WING_TEXT_GAP_FROM_IMAGE = 14, WING_TITLE_LINE_HEIGHT = 30, WING_TITLE_FONT_SIZE = 22, WING_TITLE_MIN_FONT_SIZE = 14, WING_TITLE_MAX_FONT_SIZE = 30, WING_CONTENT_LINE_HEIGHT = 17, WING_CONTENT_FONT_SIZE = 12, WING_TEXT_BOX_WIDTH = 240, WING_TEXT_BOX_MIN_WIDTH = 240, WING_TEXT_BOX_MAX_WIDTH = 360, WING_TEXT_BOX_WIDTH_RATIO = .24, WING_TEXT_BOX_HEIGHT = 110, WING_TITLE_TO_CONTENT_GAP = 4, WING_TITLE_IMAGE_WIDTH_RATIO = .6, WING_TITLE_IMAGE_MAX_WIDTH = 820, WING_DEFAULT_PATH_END_WIDTH = 350, WING_IMAGE_MIN_SCALE = .52, WING_IMAGE_MAX_SCALE = 1.2, WING_BOTTOM_TEXT_IMAGE_GAP_RATIO = 1.35, WING_PATH_EDGE_GAP = 8, clamp = (value, min, max) => Math.max(min, Math.min(max, value)), getWingDirection = spec => "right" === (0,
8
8
  common_1.normalizeLayout)(spec.layout).direction ? "right" : "left", getWingPathWidthRange = spec => {
9
9
  var _a, _b, _c, _e, _f;
10
10
  const lineStyle = null !== (_b = null === (_a = spec.line) || void 0 === _a ? void 0 : _a.style) && void 0 !== _b ? _b : {}, startWidth = Math.max(Number(null !== (_c = lineStyle.startWidth) && void 0 !== _c ? _c : 50), .5);
@@ -19,15 +19,47 @@ common_1.normalizeLayout)(spec.layout).direction ? "right" : "left", getWingPath
19
19
  }, getWingBlockImageScale = (spec, index) => {
20
20
  const {startWidth: startWidth, endWidth: endWidth} = getWingPathWidthRange(spec), startScale = clamp(startWidth / 350, .52, 1.2);
21
21
  return startScale + (clamp(endWidth / 350, .52, 1.2) - startScale) * getWingBlockPathRatio(spec, index);
22
+ }, getConfiguredTextBoxWidth = spec => {
23
+ var _a, _b, _c;
24
+ const style = null === (_a = spec.title) || void 0 === _a ? void 0 : _a.style, width = Number(null !== (_c = null !== (_b = null == style ? void 0 : style.width) && void 0 !== _b ? _b : null == style ? void 0 : style.maxLineWidth) && void 0 !== _c ? _c : 240);
25
+ return Number.isFinite(width) && width > 0 ? width : 240;
26
+ }, getWingTextBoxWidth = (spec, ctx) => {
27
+ const {width: width} = (0, common_1.getRegionGeometry)(ctx, spec), configuredWidth = getConfiguredTextBoxWidth(spec), adaptiveWidth = Math.max(configuredWidth, Math.round(.24 * width));
28
+ return clamp(adaptiveWidth, 240, 360);
29
+ }, estimateTextWidth = (text, fontSize) => Array.from(text).reduce(((sum, char) => 0 === char.trim().length ? sum + .32 * fontSize : sum + fontSize * (char.charCodeAt(0) > 255 ? 1.05 : .62)), 0), measureWingTitleWidth = (title, fontSize, style) => {
30
+ var _a;
31
+ if (!title) return 0;
32
+ try {
33
+ const size = (0, vchart_1.measureText)(title, {
34
+ fontSize: fontSize,
35
+ fontFamily: style.fontFamily,
36
+ fontWeight: null !== (_a = style.fontWeight) && void 0 !== _a ? _a : "bold"
37
+ });
38
+ return Number.isFinite(size.width) && size.width > 0 ? size.width : estimateTextWidth(title, fontSize);
39
+ } catch (_err) {
40
+ return estimateTextWidth(title, fontSize);
41
+ }
42
+ }, getMeasuredTitleLineCount = (title, fontSize, textWidth, style) => {
43
+ if (!title) return 0;
44
+ const measuredWidth = measureWingTitleWidth(title, fontSize, style);
45
+ return Math.max(1, Math.min(common_1.BLOCK_TITLE_MAX_LINES, Math.ceil(measuredWidth / Math.max(.96 * textWidth, 1))));
46
+ }, resolveWingTitleFontSize = (spec, index, textWidth) => {
47
+ var _a, _b, _c, _e;
48
+ const style = null !== (_b = null === (_a = spec.title) || void 0 === _a ? void 0 : _a.style) && void 0 !== _b ? _b : {}, configuredFontSize = style.fontSize;
49
+ if (null != configuredFontSize) return Number(configuredFontSize);
50
+ const title = null === (_e = null === (_c = spec.data) || void 0 === _c ? void 0 : _c[index]) || void 0 === _e ? void 0 : _e.title, measuredWidth = measureWingTitleWidth(title, 22, style);
51
+ if (!measuredWidth) return 22;
52
+ const widthLimit = textWidth * common_1.BLOCK_TITLE_MAX_LINES * .96, measuredPerFont = measuredWidth / 22, fittedFontSize = Math.floor(widthLimit / Math.max(measuredPerFont, 1));
53
+ return clamp(fittedFontSize, 14, 30);
22
54
  }, getWingArcGeometry = (spec, ctx) => {
23
55
  var _a, _b, _c;
24
56
  const {width: width, height: height, startX: startX, startY: startY} = (0, common_1.getRegionGeometry)(ctx), innerWidth = Math.max(width, 1), innerHeight = Math.max(height, 1), layoutOpt = (0,
25
- common_1.normalizeLayout)(spec.layout), direction = getWingDirection(spec), defaultStart = "right" === direction ? 110 : -70, defaultEnd = "right" === direction ? 250 : 70, startAngle = null !== (_a = layoutOpt.startAngle) && void 0 !== _a ? _a : defaultStart, endAngle = null !== (_b = layoutOpt.endAngle) && void 0 !== _b ? _b : defaultEnd, ratio = null !== (_c = layoutOpt.radiusRatio) && void 0 !== _c ? _c : .92, rx = .6 * innerWidth * ratio;
57
+ common_1.normalizeLayout)(spec.layout), direction = getWingDirection(spec), defaultStart = "right" === direction ? 110 : -70, defaultEnd = "right" === direction ? 250 : 70, startAngle = null !== (_a = layoutOpt.startAngle) && void 0 !== _a ? _a : defaultStart, endAngle = null !== (_b = layoutOpt.endAngle) && void 0 !== _b ? _b : defaultEnd, ratio = null !== (_c = layoutOpt.radiusRatio) && void 0 !== _c ? _c : .92, {startWidth: startWidth, endWidth: endWidth} = getWingPathWidthRange(spec), topPathWidth = "right" === direction ? endWidth : startWidth, pathTopInset = Math.min(Math.max(innerHeight / 2 - 1, 0), Math.ceil(topPathWidth / 2 + 8)), ry = Math.max(innerHeight - pathTopInset, 1) / 2 * ratio, rx = .6 * innerWidth * ratio;
26
58
  return {
27
59
  cx: "right" === direction ? startX + innerWidth - .1 * rx : startX + .1 * rx,
28
- cy: startY + innerHeight / 2,
60
+ cy: startY + pathTopInset - Math.min(Math.sin(startAngle / 180 * Math.PI), Math.sin(endAngle / 180 * Math.PI), 0) * ry,
29
61
  rx: rx,
30
- ry: innerHeight / 2 * ratio,
62
+ ry: ry,
31
63
  startAngle: startAngle,
32
64
  endAngle: endAngle
33
65
  };
@@ -107,11 +139,51 @@ const buildWingTitleImageMark = spec => {
107
139
  name: "storyline-wing-title-image",
108
140
  zIndex: vchart_1.LayoutZIndex.Mark + 8,
109
141
  children: [ Object.assign(Object.assign({
142
+ type: "rect",
143
+ name: "storyline-wing-title-image-node",
144
+ interactive: !1
145
+ }, spec.titleImage), {
146
+ _debug_bounds: !0,
147
+ style: Object.assign({
148
+ _debug_bounds: !0,
149
+ x: (_d, ctx) => {
150
+ const {width: width, height: height, startX: startX} = (0, common_1.getChartGeometry)(ctx, spec), size = (0,
151
+ common_1.getTitleImageSize)(spec, width, height, {
152
+ widthRatio: .6,
153
+ maxWidth: 820
154
+ });
155
+ return "right" === getWingDirection(spec) ? startX : startX + width - size.width;
156
+ },
157
+ fill: "red",
158
+ y: (_d, ctx) => (0, common_1.getChartGeometry)(ctx, spec).startY + 12,
159
+ width: (_d, ctx) => {
160
+ const {width: width, height: height} = (0, common_1.getChartGeometry)(ctx, spec);
161
+ return (0, common_1.getTitleImageSize)(spec, width, height, {
162
+ widthRatio: .6,
163
+ maxWidth: 820
164
+ }).width;
165
+ },
166
+ height: (_d, ctx) => {
167
+ const {width: width, height: height} = (0, common_1.getChartGeometry)(ctx, spec);
168
+ return (0, common_1.getTitleImageSize)(spec, width, height, {
169
+ widthRatio: .6,
170
+ maxWidth: 820
171
+ }).height;
172
+ },
173
+ image: spec.titleImage.image,
174
+ repeatX: "no-repeat",
175
+ repeatY: "no-repeat",
176
+ imageMode: "contain",
177
+ imagePosition: "center"
178
+ }, spec.titleImage.style)
179
+ }), Object.assign(Object.assign({
110
180
  type: "image",
111
181
  name: "storyline-wing-title-image-node",
112
182
  interactive: !1
113
183
  }, spec.titleImage), {
184
+ _debug_bounds: !0,
114
185
  style: Object.assign({
186
+ _debug_bounds: !0,
115
187
  x: (_d, ctx) => {
116
188
  const {width: width, height: height, startX: startX} = (0, common_1.getChartGeometry)(ctx, spec), size = (0,
117
189
  common_1.getTitleImageSize)(spec, width, height, {
@@ -148,27 +220,26 @@ const buildWingTitleImageMark = spec => {
148
220
  exports.buildWingTitleImageMark = buildWingTitleImageMark;
149
221
 
150
222
  const WING_TEXT_IMAGE_GAP = 120, getWingBlockMetrics = (spec, ctx, index) => {
151
- var _a, _b, _c, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
152
- const titleFontSize = (0, common_1.resolveTitleFontSize)(spec, ctx, null === (_b = null === (_a = spec.data) || void 0 === _a ? void 0 : _a[index]) || void 0 === _b ? void 0 : _b.title, 240, 22, [ 8, 30 ]), titleLineHeight = (0,
153
- common_1.resolveAdaptiveLineHeight)(titleFontSize, null === (_c = spec.title) || void 0 === _c ? void 0 : _c.style, 30, 1.3), titleHeight = (0,
154
- common_1.getBlockTitleHeight)(titleLineHeight, null === (_f = null === (_e = spec.data) || void 0 === _e ? void 0 : _e[index]) || void 0 === _f ? void 0 : _f.title, 240, titleFontSize), contentFontSize = Number(null !== (_j = null === (_h = null === (_g = spec.content) || void 0 === _g ? void 0 : _g.style) || void 0 === _h ? void 0 : _h.fontSize) && void 0 !== _j ? _j : 12), contentLineHeight = Number(null !== (_m = null === (_l = null === (_k = spec.content) || void 0 === _k ? void 0 : _k.style) || void 0 === _l ? void 0 : _l.lineHeight) && void 0 !== _m ? _m : 17), imageScale = getWingBlockImageScale(spec, index), imageWidth = Math.round(Number(null !== (_p = null === (_o = spec.image) || void 0 === _o ? void 0 : _o.width) && void 0 !== _p ? _p : 160) * imageScale), imageHeight = Math.round(Number(null !== (_r = null === (_q = spec.image) || void 0 === _q ? void 0 : _q.height) && void 0 !== _r ? _r : 160) * imageScale), imageBox = {
223
+ var _a, _b, _c, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
224
+ const textWidth = getWingTextBoxWidth(spec, ctx), titleStyle = null !== (_b = null === (_a = spec.title) || void 0 === _a ? void 0 : _a.style) && void 0 !== _b ? _b : {}, titleFontSize = resolveWingTitleFontSize(spec, index, textWidth), titleLineHeight = (0,
225
+ common_1.resolveAdaptiveLineHeight)(titleFontSize, titleStyle, 30, 1.3), titleHeight = titleLineHeight * getMeasuredTitleLineCount(null === (_e = null === (_c = spec.data) || void 0 === _c ? void 0 : _c[index]) || void 0 === _e ? void 0 : _e.title, titleFontSize, textWidth, titleStyle), contentFontSize = Number(null !== (_h = null === (_g = null === (_f = spec.content) || void 0 === _f ? void 0 : _f.style) || void 0 === _g ? void 0 : _g.fontSize) && void 0 !== _h ? _h : 12), contentLineHeight = Number(null !== (_l = null === (_k = null === (_j = spec.content) || void 0 === _j ? void 0 : _j.style) || void 0 === _k ? void 0 : _k.lineHeight) && void 0 !== _l ? _l : 17), imageScale = getWingBlockImageScale(spec, index), imageWidth = Math.round(Number(null !== (_o = null === (_m = spec.image) || void 0 === _m ? void 0 : _m.width) && void 0 !== _o ? _o : 160) * imageScale), imageHeight = Math.round(Number(null !== (_q = null === (_p = spec.image) || void 0 === _p ? void 0 : _p.height) && void 0 !== _q ? _q : 160) * imageScale), imageBox = {
155
226
  x: -imageWidth / 2,
156
227
  y: -imageHeight / 2,
157
228
  width: imageWidth,
158
229
  height: imageHeight
159
- }, direction = getWingDirection(spec), count = null !== (_t = null === (_s = spec.data) || void 0 === _s ? void 0 : _s.length) && void 0 !== _t ? _t : 0, isSpecialBelow = "right" === direction && count > 0 && index === count - 1 || "left" === direction && 0 === index, isBottomAbove = isWingBottomBlock(spec, ctx, index), isVerticalLayout = isBottomAbove || isSpecialBelow;
230
+ }, direction = getWingDirection(spec), count = null !== (_s = null === (_r = spec.data) || void 0 === _r ? void 0 : _r.length) && void 0 !== _s ? _s : 0, isSpecialBelow = "right" === direction && count > 0 && index === count - 1 || "left" === direction && 0 === index, isBottomAbove = isWingBottomBlock(spec, ctx, index), isVerticalLayout = isBottomAbove || isSpecialBelow;
160
231
  let textBox, contentBox, connectorBox, onLeft, verticalAlign;
161
232
  if (isBottomAbove) {
162
- const bottomTextImageGap = Math.round(162), textX = -120, textY = -imageHeight / 2 - bottomTextImageGap - 110;
233
+ const bottomTextImageGap = Math.round(162), textX = -textWidth / 2, textY = -imageHeight / 2 - bottomTextImageGap - 110;
163
234
  textBox = {
164
235
  x: textX,
165
236
  y: textY,
166
- width: 240,
237
+ width: textWidth,
167
238
  height: 110
168
239
  }, contentBox = {
169
240
  x: textX,
170
241
  y: textY + titleHeight + 4,
171
- width: 240,
242
+ width: textWidth,
172
243
  height: 1e5
173
244
  }, connectorBox = {
174
245
  x: -1,
@@ -177,16 +248,16 @@ const WING_TEXT_IMAGE_GAP = 120, getWingBlockMetrics = (spec, ctx, index) => {
177
248
  height: bottomTextImageGap
178
249
  }, onLeft = !1, verticalAlign = "above";
179
250
  } else if (isVerticalLayout) {
180
- const textX = -120, textY = imageHeight / 2 + 120;
251
+ const textX = -textWidth / 2, textY = imageHeight / 2 + 120;
181
252
  textBox = {
182
253
  x: textX,
183
254
  y: textY,
184
- width: 240,
255
+ width: textWidth,
185
256
  height: 110
186
257
  }, contentBox = {
187
258
  x: textX,
188
259
  y: textY + titleHeight + 4,
189
- width: 240,
260
+ width: textWidth,
190
261
  height: 1e5
191
262
  }, connectorBox = {
192
263
  x: -1,
@@ -195,19 +266,19 @@ const WING_TEXT_IMAGE_GAP = 120, getWingBlockMetrics = (spec, ctx, index) => {
195
266
  height: 120
196
267
  }, onLeft = !1, verticalAlign = "below";
197
268
  } else {
198
- const textOnLeft = "right" === direction, textX = textOnLeft ? -imageWidth / 2 - 120 - 240 : imageWidth / 2 + 120, textY = -55;
269
+ const textOnLeft = "right" === direction, textX = textOnLeft ? -imageWidth / 2 - 120 - textWidth : imageWidth / 2 + 120, textY = -55;
199
270
  textBox = {
200
271
  x: textX,
201
272
  y: textY,
202
- width: 240,
273
+ width: textWidth,
203
274
  height: 110
204
275
  }, contentBox = {
205
276
  x: textX,
206
277
  y: textY + titleHeight + 4,
207
- width: 240,
278
+ width: textWidth,
208
279
  height: 1e5
209
280
  };
210
- const imageEdgeX = textOnLeft ? -imageWidth / 2 : imageWidth / 2, textEdgeX = textOnLeft ? textX + 240 : textX;
281
+ const imageEdgeX = textOnLeft ? -imageWidth / 2 : imageWidth / 2, textEdgeX = textOnLeft ? textX + textWidth : textX;
211
282
  connectorBox = {
212
283
  x: Math.min(imageEdgeX, textEdgeX),
213
284
  y: 0,
@@ -306,6 +377,8 @@ const WING_TEXT_IMAGE_GAP = 120, getWingBlockMetrics = (spec, ctx, index) => {
306
377
  return m.verticalAlign ? m.textBox.x + m.textBox.width / 2 : m.onLeft ? m.textBox.x + m.textBox.width : m.textBox.x;
307
378
  },
308
379
  y: (_d, ctx) => getWingBlockMetrics(spec, ctx, index).textBox.y,
380
+ width: (_d, ctx) => getWingBlockMetrics(spec, ctx, index).textBox.width,
381
+ maxLineWidth: (_d, ctx) => getWingBlockMetrics(spec, ctx, index).textBox.width,
309
382
  text: block.title,
310
383
  height: (_d, ctx) => getWingBlockMetrics(spec, ctx, index).titleHeight,
311
384
  heightLimit: (_d, ctx) => getWingBlockMetrics(spec, ctx, index).titleLineHeight * common_1.BLOCK_TITLE_MAX_LINES,