@visactor/react-vchart 2.1.0-alpha.10 → 2.1.0-alpha.11

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.
package/build/index.js CHANGED
@@ -91081,6 +91081,7 @@
91081
91081
  MARKER_STYLE_PLACEHOLDER = "__vchart_marker_style__",
91082
91082
  MARKER_DOMAIN_POSITION_SPEC_KEYS = ["coordinate", "coordinates", "x", "y", "x1", "y1", "angle", "angle1", "radius", "radius1"],
91083
91083
  MARKER_LAYOUT_POSITION_SPEC_KEYS = ["position", "positions", "coordinatesOffset", "regionRelative"],
91084
+ MARKER_ITEM_CONTENT_LAYOUT_SPEC_KEYS = ["offsetX", "offsetY", "confine"],
91084
91085
  normalizeMarkerLabelFormatMethod = label => Array.isArray(label) ? label.map(normalizeMarkerLabelFormatMethod) : label && "object" == typeof label ? "function" != typeof label.formatMethod ? label : Object.assign(Object.assign({}, label), {
91085
91086
  formatMethod: MARKER_FORMAT_METHOD_PLACEHOLDER
91086
91087
  }) : label,
@@ -91093,7 +91094,6 @@
91093
91094
  }), normalized;
91094
91095
  },
91095
91096
  normalizeMarkerSpecForComponentOnlyUpdate = (spec, options) => {
91096
- var _a;
91097
91097
  if (!spec || "object" != typeof spec) return spec;
91098
91098
  const normalized = Object.assign({}, spec);
91099
91099
  options.normalizeDomainPosition && MARKER_DOMAIN_POSITION_SPEC_KEYS.forEach(key => {
@@ -91103,12 +91103,17 @@
91103
91103
  }), "label" in normalized && (normalized.label = normalizeMarkerLabelFormatMethod(normalized.label)), Object.keys(normalized).forEach(key => {
91104
91104
  normalized[key] = normalizeMarkerStyles(normalized[key]);
91105
91105
  });
91106
- const text = null === (_a = normalized.itemContent) || void 0 === _a ? void 0 : _a.text;
91107
- return text && "object" == typeof text && (normalized.itemContent = Object.assign(Object.assign({}, normalized.itemContent), {
91108
- text: Object.assign(Object.assign({}, normalizeMarkerLabelFormatMethod(text)), {
91106
+ const itemContent = normalized.itemContent;
91107
+ if (itemContent && "object" == typeof itemContent) {
91108
+ normalized.itemContent = Object.assign({}, itemContent), MARKER_ITEM_CONTENT_LAYOUT_SPEC_KEYS.forEach(key => {
91109
+ key in normalized.itemContent && (normalized.itemContent[key] = MARKER_COORDINATE_PLACEHOLDER);
91110
+ });
91111
+ const text = normalized.itemContent.text;
91112
+ text && "object" == typeof text && (normalized.itemContent.text = Object.assign(Object.assign({}, normalizeMarkerLabelFormatMethod(text)), {
91109
91113
  text: MARKER_TEXT_PLACEHOLDER
91110
- })
91111
- })), normalized;
91114
+ }));
91115
+ }
91116
+ return normalized;
91112
91117
  };
91113
91118
  class BaseMarker extends BaseComponent {
91114
91119
  constructor() {
@@ -93251,6 +93256,7 @@
93251
93256
  itemLine = {},
93252
93257
  targetSymbol = {}
93253
93258
  } = this._spec,
93259
+ region = this._relativeSeries.getRegion(),
93254
93260
  _10 = itemContent,
93255
93261
  {
93256
93262
  type = "text",
@@ -93300,8 +93306,8 @@
93300
93306
  clipInRange: null !== (_v = this._spec.clip) && void 0 !== _v && _v,
93301
93307
  itemContent: Object.assign(Object.assign({
93302
93308
  type: type,
93303
- offsetX: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()),
93304
- offsetY: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion())
93309
+ offsetX: transformOffset(itemContent.offsetX, region),
93310
+ offsetY: transformOffset(itemContent.offsetY, region)
93305
93311
  }, restItemContent), {
93306
93312
  style: transformStyle(itemContentStyle, this._markerData, this._markAttributeContext)
93307
93313
  }),
@@ -93351,6 +93357,7 @@
93351
93357
  itemLine = {},
93352
93358
  itemContent = {}
93353
93359
  } = this._spec,
93360
+ region = this._relativeSeries.getRegion(),
93354
93361
  {
93355
93362
  visible: itemLineVisible,
93356
93363
  line = {}
@@ -93386,7 +93393,9 @@
93386
93393
  if (this._markerComponent) {
93387
93394
  const attribute = null !== (_d = this._markerComponent.attribute) && void 0 !== _d ? _d : {},
93388
93395
  textStyle = null !== (_f = null === (_e = attribute.itemContent) || void 0 === _e ? void 0 : _e.textStyle) && void 0 !== _f ? _f : {},
93389
- specText = null === (_g = this._spec.itemContent.text) || void 0 === _g ? void 0 : _g.text;
93396
+ specText = null === (_g = this._spec.itemContent.text) || void 0 === _g ? void 0 : _g.text,
93397
+ offsetX = transformOffset(itemContent.offsetX, region),
93398
+ offsetY = transformOffset(itemContent.offsetY, region);
93390
93399
  this._markerComponent.setAttributes({
93391
93400
  position: void 0 === point ? {
93392
93401
  x: null,
@@ -93398,8 +93407,8 @@
93398
93407
  textStyle: Object.assign(Object.assign(Object.assign({}, textStyle), null !== (_m = labelAttrs.textStyle) && void 0 !== _m ? _m : {}), {
93399
93408
  text: (null === (_o = this._spec.itemContent.text) || void 0 === _o ? void 0 : _o.formatMethod) ? this._spec.itemContent.text.formatMethod(dataPoints, seriesData) : isValid$1(specText) ? specText : textStyle.text
93400
93409
  }),
93401
- offsetX: computeOffsetFromRegion(point, attribute.itemContent.offsetX, this._relativeSeries.getRegion()),
93402
- offsetY: computeOffsetFromRegion(point, attribute.itemContent.offsetY, this._relativeSeries.getRegion())
93410
+ offsetX: computeOffsetFromRegion(point, offsetX, region),
93411
+ offsetY: computeOffsetFromRegion(point, offsetY, region)
93403
93412
  }),
93404
93413
  itemLine: itemLineAttrs,
93405
93414
  limitRect: limitRect,