@visactor/vchart-extension 2.1.3 → 2.1.4

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 (53) hide show
  1. package/build/index.js +18 -15
  2. package/build/index.min.js +1 -1
  3. package/cjs/charts/3d/arc-3d.js +1 -1
  4. package/cjs/charts/3d/enum.js +2 -1
  5. package/cjs/charts/3d/graphic-creator.js +1 -1
  6. package/cjs/charts/3d/interface.js +1 -1
  7. package/cjs/charts/3d/layout.js +1 -1
  8. package/cjs/charts/3d/plugin.js +1 -1
  9. package/cjs/charts/3d/pyramid-3d.js +1 -1
  10. package/cjs/charts/3d/rect-3d.js +1 -1
  11. package/cjs/charts/3d/util.js +1 -1
  12. package/cjs/charts/axis-3d/band-axis.js +1 -2
  13. package/cjs/charts/bar-3d/animation.js +1 -1
  14. package/cjs/charts/bar-3d/chart-spec-transformer.js +1 -1
  15. package/cjs/charts/bar-3d/chart.js +1 -1
  16. package/cjs/charts/bar-3d/constant.js +1 -1
  17. package/cjs/charts/bar-3d/index.js +1 -1
  18. package/cjs/charts/bar-3d/interface.js +1 -1
  19. package/cjs/charts/bar-3d/series-spec-transformer.js +1 -1
  20. package/cjs/charts/bar-3d/series.js +1 -1
  21. package/cjs/charts/bar-3d/theme.js +1 -1
  22. package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js +15 -13
  23. package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js.map +1 -1
  24. package/cjs/components/histogram-regression-line/type.js +1 -2
  25. package/cjs/components/map-label/map-label-transformer.js +1 -2
  26. package/cjs/components/map-label/type.js +2 -1
  27. package/cjs/components/series-break/index.js +2 -1
  28. package/esm/charts/3d/arc-3d.js +1 -1
  29. package/esm/charts/3d/enum.js +2 -1
  30. package/esm/charts/3d/graphic-creator.js +1 -1
  31. package/esm/charts/3d/interface.js +1 -1
  32. package/esm/charts/3d/layout.js +1 -1
  33. package/esm/charts/3d/plugin.js +1 -1
  34. package/esm/charts/3d/pyramid-3d.js +1 -1
  35. package/esm/charts/3d/rect-3d.js +1 -1
  36. package/esm/charts/3d/util.js +1 -1
  37. package/esm/charts/axis-3d/band-axis.js +1 -2
  38. package/esm/charts/bar-3d/animation.js +1 -1
  39. package/esm/charts/bar-3d/chart-spec-transformer.js +1 -1
  40. package/esm/charts/bar-3d/chart.js +1 -1
  41. package/esm/charts/bar-3d/constant.js +1 -1
  42. package/esm/charts/bar-3d/index.js +1 -1
  43. package/esm/charts/bar-3d/interface.js +1 -1
  44. package/esm/charts/bar-3d/series-spec-transformer.js +1 -1
  45. package/esm/charts/bar-3d/series.js +1 -1
  46. package/esm/charts/bar-3d/theme.js +1 -1
  47. package/esm/charts/conversion-funnel/conversion-funnel-transformer.js +15 -13
  48. package/esm/charts/conversion-funnel/conversion-funnel-transformer.js.map +1 -1
  49. package/esm/components/histogram-regression-line/type.js +1 -2
  50. package/esm/components/map-label/map-label-transformer.js +1 -2
  51. package/esm/components/map-label/type.js +2 -1
  52. package/esm/components/series-break/index.js +2 -1
  53. package/package.json +4 -4
package/build/index.js CHANGED
@@ -1070,9 +1070,11 @@
1070
1070
 
1071
1071
  class ConversionFunnelChartSpecTransformer extends vchart.FunnelChartSpecTransformer {
1072
1072
  transformSpec(spec) {
1073
+ var _a, _b, _c;
1073
1074
  const { conversionArrow, extensionMark = [], funnelBackground } = spec;
1074
1075
  if (conversionArrow && conversionArrow.arrows && conversionArrow.arrows.length) {
1075
- const marks = addArrowMark(conversionArrow);
1076
+ const arrowTheme = (_c = (_b = (_a = this._option) === null || _a === void 0 ? void 0 : _a.getTheme) === null || _b === void 0 ? void 0 : _b.call(_a, 'series', 'funnel')) === null || _c === void 0 ? void 0 : _c.conversionArrow;
1077
+ const marks = addArrowMark(conversionArrow, arrowTheme);
1076
1078
  if (marks && marks.length) {
1077
1079
  extensionMark.push(...marks);
1078
1080
  }
@@ -1093,12 +1095,12 @@
1093
1095
  return seriesSpec;
1094
1096
  }
1095
1097
  }
1096
- function addArrowMark(arrowSpec) {
1098
+ function addArrowMark(arrowSpec, theme) {
1097
1099
  const { arrows } = arrowSpec, style = __rest$4(arrowSpec, ["arrows"]);
1098
1100
  const leftArrows = arrows.filter(arrow => arrow.position === 'left');
1099
1101
  const rightArrows = arrows.filter(arrow => arrow.position === 'right');
1100
- const rightGroup = computeArrows$1(rightArrows, style);
1101
- const leftGroup = computeArrows$1(leftArrows, style);
1102
+ const rightGroup = computeArrows$1(rightArrows, style, theme);
1103
+ const leftGroup = computeArrows$1(leftArrows, style, theme);
1102
1104
  const result = [];
1103
1105
  if (rightGroup) {
1104
1106
  rightGroup.name = 'arrowRight';
@@ -1110,7 +1112,8 @@
1110
1112
  }
1111
1113
  return result;
1112
1114
  }
1113
- function computeArrows$1(arrows, style) {
1115
+ function computeArrows$1(arrows, style, theme) {
1116
+ var _a, _b, _c;
1114
1117
  if ((arrows === null || arrows === void 0 ? void 0 : arrows.length) === 0) {
1115
1118
  return null;
1116
1119
  }
@@ -1121,22 +1124,22 @@
1121
1124
  zIndex: vchart.LayoutZIndex.Mark + 1,
1122
1125
  children: []
1123
1126
  };
1124
- const lineMark = generateArrowLineSpec(line, margin);
1127
+ const lineMark = generateArrowLineSpec(line, margin, (_a = theme === null || theme === void 0 ? void 0 : theme.line) === null || _a === void 0 ? void 0 : _a.style);
1125
1128
  if (lineMark) {
1126
1129
  result.push(lineMark);
1127
1130
  }
1128
- const arrowMark = generateArrowSymbolSpec(symbol, margin);
1131
+ const arrowMark = generateArrowSymbolSpec(symbol, margin, (_b = theme === null || theme === void 0 ? void 0 : theme.symbol) === null || _b === void 0 ? void 0 : _b.style);
1129
1132
  if (arrowMark) {
1130
1133
  result.push(arrowMark);
1131
1134
  }
1132
- const textMark = generateArrowTextSpec(text, margin);
1135
+ const textMark = generateArrowTextSpec(text, margin, (_c = theme === null || theme === void 0 ? void 0 : theme.text) === null || _c === void 0 ? void 0 : _c.style);
1133
1136
  if (textMark) {
1134
1137
  result.push(textMark);
1135
1138
  }
1136
1139
  rootGroup.children = result;
1137
1140
  return rootGroup;
1138
1141
  }
1139
- function generateArrowLineSpec(line = {}, margin) {
1142
+ function generateArrowLineSpec(line = {}, margin, themeStyle = {}) {
1140
1143
  const { style = {} } = line, rest = __rest$4(line, ["style"]);
1141
1144
  const renderable = (arrow, ctx) => {
1142
1145
  var _a, _b;
@@ -1148,7 +1151,7 @@
1148
1151
  }
1149
1152
  return true;
1150
1153
  };
1151
- return Object.assign(Object.assign({ type: 'polygon', interactive: false }, rest), { dataKey: arrow => `${arrow.id}`, style: Object.assign(Object.assign(Object.assign({}, DEFAULT_ARROW_MARK_STYLE), style), { renderable, points: (arrow, ctx) => {
1154
+ return Object.assign(Object.assign({ type: 'polygon', interactive: false }, rest), { dataKey: arrow => `${arrow.id}`, style: Object.assign(Object.assign(Object.assign(Object.assign({}, DEFAULT_ARROW_MARK_STYLE), themeStyle), style), { renderable, points: (arrow, ctx) => {
1152
1155
  if (!renderable(arrow, ctx)) {
1153
1156
  return [];
1154
1157
  }
@@ -1157,9 +1160,9 @@
1157
1160
  return points;
1158
1161
  } }) });
1159
1162
  }
1160
- function generateArrowSymbolSpec(symbol = {}, margin) {
1163
+ function generateArrowSymbolSpec(symbol = {}, margin, themeStyle = {}) {
1161
1164
  const { style = {} } = symbol, rest = __rest$4(symbol, ["style"]);
1162
- return Object.assign(Object.assign({ type: 'symbol', interactive: false, dataKey: arrow => `${arrow.id}` }, rest), { style: Object.assign(Object.assign(Object.assign({}, DEFAULT_ARROW_SYMBOL_MARK_STYLE), style), { x: (arrow, ctx) => {
1165
+ return Object.assign(Object.assign({ type: 'symbol', interactive: false, dataKey: arrow => `${arrow.id}` }, rest), { style: Object.assign(Object.assign(Object.assign(Object.assign({}, DEFAULT_ARROW_SYMBOL_MARK_STYLE), themeStyle), style), { x: (arrow, ctx) => {
1163
1166
  var _a, _b;
1164
1167
  let points = arrow.layout.points;
1165
1168
  points = prepareArrowPoints(arrow, ctx, margin);
@@ -1171,9 +1174,9 @@
1171
1174
  return (_b = (_a = points[(points === null || points === void 0 ? void 0 : points.length) - 1]) === null || _a === void 0 ? void 0 : _a.y) !== null && _b !== void 0 ? _b : NaN;
1172
1175
  }, angle: (arrow) => (arrow.position === 'left' ? 90 : -90) }) });
1173
1176
  }
1174
- function generateArrowTextSpec(text = {}, margin) {
1177
+ function generateArrowTextSpec(text = {}, margin, themeStyle = {}) {
1175
1178
  const { style = {}, formatMethod, textMargin = 4 } = text, rest = __rest$4(text, ["style", "formatMethod", "textMargin"]);
1176
- return Object.assign(Object.assign({ type: 'text', dataKey: arrow => `${arrow.id}`, interactive: false, animation: false }, rest), { style: Object.assign(Object.assign(Object.assign({}, DEFAULT_ARROW_TEXT_MARK_STYLE), { text: (arrow, ctx) => {
1179
+ return Object.assign(Object.assign({ type: 'text', dataKey: arrow => `${arrow.id}`, interactive: false, animation: false }, rest), { style: Object.assign(Object.assign(Object.assign(Object.assign({}, DEFAULT_ARROW_TEXT_MARK_STYLE), themeStyle), { text: (arrow, ctx) => {
1177
1180
  var _a, _b, _c, _d, _e, _f, _g;
1178
1181
  const { text: textContent } = arrow;
1179
1182
  let displayTextContent = textContent;
@@ -10313,7 +10316,7 @@
10313
10316
  }
10314
10317
 
10315
10318
  var _a;
10316
- const factoryRegistryKey = Symbol.for("@visactor/vchart/factory-registry@2.1.3"),
10319
+ const factoryRegistryKey = Symbol.for("@visactor/vchart/factory-registry@2.1.4"),
10317
10320
  globalFactoryRegistry = globalThis;
10318
10321
  const factoryRegistry = null !== (_a = globalFactoryRegistry[factoryRegistryKey]) && void 0 !== _a ? _a : globalFactoryRegistry[factoryRegistryKey] = {
10319
10322
  charts: {},