@visactor/vrender-components 1.0.27-alpha.0 → 1.0.28-alpha.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 (42) hide show
  1. package/cjs/axis/circle.d.ts +0 -20
  2. package/cjs/axis/config.d.ts +0 -20
  3. package/cjs/axis/config.js +0 -20
  4. package/cjs/axis/config.js.map +1 -1
  5. package/cjs/axis/constant.d.ts +0 -1
  6. package/cjs/axis/constant.js +4 -5
  7. package/cjs/axis/constant.js.map +1 -1
  8. package/cjs/axis/line.d.ts +2 -27
  9. package/cjs/axis/line.js +4 -77
  10. package/cjs/axis/line.js.map +1 -1
  11. package/cjs/axis/tick-data/discrete/polar-angle.js +1 -1
  12. package/cjs/axis/tick-data/discrete/polar-angle.js.map +1 -1
  13. package/cjs/axis/type.d.ts +0 -12
  14. package/cjs/axis/type.js.map +1 -1
  15. package/cjs/brush/config.js +1 -2
  16. package/cjs/index.d.ts +1 -1
  17. package/cjs/index.js +1 -1
  18. package/cjs/index.js.map +1 -1
  19. package/cjs/label/base.js +18 -14
  20. package/cjs/label/base.js.map +1 -1
  21. package/dist/index.es.js +25 -189
  22. package/es/axis/circle.d.ts +0 -20
  23. package/es/axis/config.d.ts +0 -20
  24. package/es/axis/config.js +0 -20
  25. package/es/axis/config.js.map +1 -1
  26. package/es/axis/constant.d.ts +0 -1
  27. package/es/axis/constant.js +4 -5
  28. package/es/axis/constant.js.map +1 -1
  29. package/es/axis/line.d.ts +2 -27
  30. package/es/axis/line.js +3 -77
  31. package/es/axis/line.js.map +1 -1
  32. package/es/axis/tick-data/discrete/polar-angle.js +1 -1
  33. package/es/axis/tick-data/discrete/polar-angle.js.map +1 -1
  34. package/es/axis/type.d.ts +0 -12
  35. package/es/axis/type.js.map +1 -1
  36. package/es/brush/config.js +1 -2
  37. package/es/index.d.ts +1 -1
  38. package/es/index.js +1 -1
  39. package/es/index.js.map +1 -1
  40. package/es/label/base.js +18 -14
  41. package/es/label/base.js.map +1 -1
  42. package/package.json +4 -4
package/dist/index.es.js CHANGED
@@ -8586,9 +8586,10 @@ let Symbol$1 = class Symbol extends Graphic {
8586
8586
  }
8587
8587
  updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds) {
8588
8588
  const {
8589
- size = symbolTheme.size
8590
- } = attribute;
8591
- return this.getParsedPath().bounds(size, aabbBounds), aabbBounds;
8589
+ size = symbolTheme.size
8590
+ } = attribute,
8591
+ symbolClass = this.getParsedPath();
8592
+ return symbolClass ? (symbolClass.bounds(size, aabbBounds), aabbBounds) : aabbBounds;
8592
8593
  }
8593
8594
  needUpdateTags(keys) {
8594
8595
  return super.needUpdateTags(keys, SYMBOL_UPDATE_TAG_KEY);
@@ -8597,8 +8598,9 @@ let Symbol$1 = class Symbol extends Graphic {
8597
8598
  return super.needUpdateTag(key, SYMBOL_UPDATE_TAG_KEY);
8598
8599
  }
8599
8600
  toCustomPath() {
8600
- const symbolInstance = this.getParsedPath(),
8601
- size = this.attribute.size,
8601
+ const symbolInstance = this.getParsedPath();
8602
+ if (!symbolInstance) return null;
8603
+ const size = this.attribute.size,
8602
8604
  formattedSize = isArray(size) ? size : [size, size];
8603
8605
  return symbolInstance.path ? new CustomPath2D().fromCustomPath2D(symbolInstance.path, 0, 0, formattedSize[0], formattedSize[1]) : new CustomPath2D().fromString(symbolInstance.pathStr, 0, 0, formattedSize[0], formattedSize[1]);
8604
8606
  }
@@ -17391,7 +17393,6 @@ var AXIS_ELEMENT_NAME;
17391
17393
  AXIS_ELEMENT_NAME["subTick"] = "axis-sub-tick";
17392
17394
  AXIS_ELEMENT_NAME["label"] = "axis-label";
17393
17395
  AXIS_ELEMENT_NAME["title"] = "axis-title";
17394
- AXIS_ELEMENT_NAME["labelHoverOnAxis"] = "axis-label-hover-on-axis";
17395
17396
  AXIS_ELEMENT_NAME["gridContainer"] = "axis-grid-container";
17396
17397
  AXIS_ELEMENT_NAME["grid"] = "axis-grid";
17397
17398
  AXIS_ELEMENT_NAME["gridRegion"] = "axis-grid-region";
@@ -17439,26 +17440,6 @@ const DEFAULT_AXIS_THEME = {
17439
17440
  fillOpacity: 1
17440
17441
  }
17441
17442
  },
17442
- labelHoverOnAxis: {
17443
- visible: false,
17444
- space: 7,
17445
- padding: 2,
17446
- position: 0,
17447
- autoRotate: false,
17448
- textStyle: {
17449
- fontSize: 12,
17450
- fill: 'red',
17451
- fontWeight: 'normal',
17452
- fillOpacity: 1
17453
- },
17454
- background: {
17455
- visible: true,
17456
- style: {
17457
- cornerRadius: 2,
17458
- fill: 'black'
17459
- }
17460
- }
17461
- },
17462
17443
  tick: {
17463
17444
  visible: true,
17464
17445
  inside: false,
@@ -20294,25 +20275,7 @@ function loadCircleAxisGridComponent() {
20294
20275
  loadLineAxisComponent();
20295
20276
  class LineAxis extends AxisBase {
20296
20277
  constructor(attributes, options) {
20297
- var _a;
20298
- if (attributes.labelHoverOnAxis) {
20299
- attributes.labelHoverOnAxis.textStyle = Object.assign({}, attributes.label.style, attributes.labelHoverOnAxis.textStyle);
20300
- if (attributes.labelHoverOnAxis.space === undefined) {
20301
- const { padding = 2 } = attributes.labelHoverOnAxis;
20302
- const parsedPadding = normalizePadding(padding);
20303
- const toDiffPadding = attributes.orient === 'bottom'
20304
- ? parsedPadding[0]
20305
- : attributes.orient === 'left'
20306
- ? parsedPadding[1]
20307
- : attributes.orient === 'top'
20308
- ? parsedPadding[2]
20309
- : parsedPadding[3];
20310
- const space = ((_a = attributes.label.space) !== null && _a !== void 0 ? _a : LineAxis.defaultAttributes.label.space) - toDiffPadding;
20311
- attributes.labelHoverOnAxis.space = space;
20312
- }
20313
- }
20314
20278
  super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options);
20315
- this.labelHoverOnAxisGroup = null;
20316
20279
  }
20317
20280
  _renderInner(container) {
20318
20281
  var _a;
@@ -20364,18 +20327,6 @@ class LineAxis extends AxisBase {
20364
20327
  bgRect.states = merge({}, DEFAULT_STATES$1, (_a = panel.state) !== null && _a !== void 0 ? _a : {});
20365
20328
  axisContainer.insertBefore(bgRect, axisContainer.firstChild);
20366
20329
  }
20367
- const { labelHoverOnAxis } = this.attribute;
20368
- if (labelHoverOnAxis && labelHoverOnAxis.visible) {
20369
- this.renderLabelHoverOnAxis();
20370
- }
20371
- }
20372
- renderLabelHoverOnAxis() {
20373
- const hoverOnLabelAttributes = this.getLabelHoverOnAxisAttribute();
20374
- const hoverOnLabel = new Tag(Object.assign({}, hoverOnLabelAttributes));
20375
- hoverOnLabel.name = AXIS_ELEMENT_NAME.title;
20376
- hoverOnLabel.id = this._getNodeId('hover-on-label');
20377
- this.labelHoverOnAxisGroup = hoverOnLabel;
20378
- this.axisContainer.add(hoverOnLabel);
20379
20330
  }
20380
20331
  renderLine(container) {
20381
20332
  const { start, end, line } = this.attribute;
@@ -20570,60 +20521,6 @@ class LineAxis extends AxisBase {
20570
20521
  }
20571
20522
  return attrs;
20572
20523
  }
20573
- getLabelHoverOnAxisAttribute() {
20574
- var _a, _b;
20575
- const { orient } = this.attribute;
20576
- const _c = this.attribute.labelHoverOnAxis, { position = 0, space = 4, autoRotate = true, textStyle = {}, background = {}, formatMethod, text: textContent = '', maxWidth } = _c, restAttrs = __rest(_c, ["position", "space", "autoRotate", "textStyle", "background", "formatMethod", "text", "maxWidth"]);
20577
- const point = this.getTickCoord(0);
20578
- if (orient === 'bottom' || orient === 'top') {
20579
- point.x = position;
20580
- }
20581
- else {
20582
- point.y = position;
20583
- }
20584
- let tickLength = 0;
20585
- if (((_a = this.attribute.tick) === null || _a === void 0 ? void 0 : _a.visible) && this.attribute.tick.inside === false) {
20586
- tickLength = this.attribute.tick.length || 4;
20587
- }
20588
- if (((_b = this.attribute.subTick) === null || _b === void 0 ? void 0 : _b.visible) && this.attribute.subTick.inside === false) {
20589
- tickLength = Math.max(tickLength, this.attribute.subTick.length || 2);
20590
- }
20591
- const labelLength = 0;
20592
- const offset = tickLength + labelLength + space;
20593
- const labelPoint = this.getVerticalCoord(point, offset, false);
20594
- const vector = this.getVerticalVector(offset, false, { x: 0, y: 0 });
20595
- let { angle } = restAttrs;
20596
- let textAlign = 'center';
20597
- let textBaseline;
20598
- if (isNil(angle) && autoRotate) {
20599
- const axisVector = this.getRelativeVector();
20600
- const v1 = [1, 0];
20601
- const radian = angleTo(axisVector, v1, true);
20602
- angle = radian;
20603
- const { verticalFactor = 1 } = this.attribute;
20604
- const factor = -1 * verticalFactor;
20605
- if (factor === 1) {
20606
- textBaseline = 'bottom';
20607
- }
20608
- else {
20609
- textBaseline = 'top';
20610
- }
20611
- }
20612
- else {
20613
- const { textAlign: textAlign2, textBaseline: textBaseline2 } = this.getLabelAlign(vector, false, textStyle.angle);
20614
- textAlign = textAlign2;
20615
- textBaseline = textBaseline2;
20616
- }
20617
- const maxTagWidth = maxWidth;
20618
- const text = formatMethod ? formatMethod(textContent) : textContent;
20619
- const attrs = Object.assign(Object.assign(Object.assign({}, labelPoint), restAttrs), { maxWidth: maxTagWidth, textStyle: Object.assign({ textAlign,
20620
- textBaseline }, textStyle), text });
20621
- attrs.angle = angle;
20622
- if (background && background.visible) {
20623
- attrs.panel = Object.assign(Object.assign({ visible: true }, restAttrs.panel), background.style);
20624
- }
20625
- return attrs;
20626
- }
20627
20524
  getTextBaseline(vector, inside) {
20628
20525
  let base = 'middle';
20629
20526
  const { verticalFactor = 1 } = this.attribute;
@@ -20856,8 +20753,8 @@ class LineAxis extends AxisBase {
20856
20753
  let limitLength = limitSize;
20857
20754
  let titleHeight = 0;
20858
20755
  let titleSpacing = 0;
20859
- const axisLineWidth = line && line.visible ? (_b = line.style.lineWidth) !== null && _b !== void 0 ? _b : 1 : 0;
20860
- const tickLength = tick && tick.visible ? (_c = tick.length) !== null && _c !== void 0 ? _c : 4 : 0;
20756
+ const axisLineWidth = line && line.visible ? ((_b = line.style.lineWidth) !== null && _b !== void 0 ? _b : 1) : 0;
20757
+ const tickLength = tick && tick.visible ? ((_c = tick.length) !== null && _c !== void 0 ? _c : 4) : 0;
20861
20758
  if (title && title.visible && typeof title.text === 'string') {
20862
20759
  titleHeight = measureTextSize(title.text, title.textStyle, (_e = (_d = this.stage) === null || _d === void 0 ? void 0 : _d.getTheme()) === null || _e === void 0 ? void 0 : _e.text).height;
20863
20760
  const padding = normalizePadding(title.padding);
@@ -20868,71 +20765,6 @@ class LineAxis extends AxisBase {
20868
20765
  }
20869
20766
  return limitLength;
20870
20767
  }
20871
- showLabelHoverOnAxis(position, text, adjustPosition = true) {
20872
- if (this.attribute.labelHoverOnAxis) {
20873
- const preContainerBounds = this.axisContainer.AABBBounds;
20874
- const preWidth = preContainerBounds.width();
20875
- const preHeight = preContainerBounds.height();
20876
- const preX1 = preContainerBounds.x1;
20877
- const preY1 = preContainerBounds.y1;
20878
- const preX2 = preContainerBounds.x2;
20879
- const preY2 = preContainerBounds.y2;
20880
- if (this.labelHoverOnAxisGroup) {
20881
- const { formatMethod } = this.attribute.labelHoverOnAxis;
20882
- const textStr = formatMethod ? formatMethod(text) : text;
20883
- this.labelHoverOnAxisGroup.setAttribute('text', textStr);
20884
- this.labelHoverOnAxisGroup.setAttribute('visible', true);
20885
- this.labelHoverOnAxisGroup.setAttribute('visibleAll', true);
20886
- if (this.attribute.orient === 'left' || this.attribute.orient === 'right') {
20887
- this.labelHoverOnAxisGroup.setAttributes({
20888
- y: position
20889
- });
20890
- }
20891
- else {
20892
- this.labelHoverOnAxisGroup.setAttributes({
20893
- x: position
20894
- });
20895
- }
20896
- }
20897
- else {
20898
- this.attribute.labelHoverOnAxis.visible = true;
20899
- this.attribute.labelHoverOnAxis.position = position;
20900
- this.attribute.labelHoverOnAxis.text = text;
20901
- this.renderLabelHoverOnAxis();
20902
- }
20903
- if (adjustPosition) {
20904
- const afterContainerBounds = this.axisContainer.AABBBounds;
20905
- const afterWidth = afterContainerBounds.width();
20906
- const afterHeight = afterContainerBounds.height();
20907
- const diffWidth = afterWidth - preWidth;
20908
- const diffHeight = afterHeight - preHeight;
20909
- if (diffWidth > 0 && (this.attribute.orient === 'top' || this.attribute.orient === 'bottom')) {
20910
- if (afterContainerBounds.x1 < preX1) {
20911
- this.showLabelHoverOnAxis(position + diffWidth, text, false);
20912
- }
20913
- else if (afterContainerBounds.x2 > preX2) {
20914
- this.showLabelHoverOnAxis(position - diffWidth, text, false);
20915
- }
20916
- }
20917
- if (diffHeight > 0 && (this.attribute.orient === 'left' || this.attribute.orient === 'right')) {
20918
- if (afterContainerBounds.y1 < preY1) {
20919
- this.showLabelHoverOnAxis(position + diffHeight, text, false);
20920
- }
20921
- else if (afterContainerBounds.y2 > preY2) {
20922
- this.showLabelHoverOnAxis(position - diffHeight, text, false);
20923
- }
20924
- }
20925
- }
20926
- }
20927
- }
20928
- hideLabelHoverOnAxis() {
20929
- if (this.attribute.labelHoverOnAxis && this.labelHoverOnAxisGroup) {
20930
- this.labelHoverOnAxisGroup.setAttributes({
20931
- visible: false,
20932
- visibleAll: false
20933
- });
20934
- }
20935
- }
20936
20768
  release() {
20937
20769
  super.release();
20938
20770
  this._breaks = null;
@@ -21840,7 +21672,7 @@ const getPolarAngleLabelBounds = (scale, domain, op) => {
21840
21672
  const polarAngleAxisDiscreteTicks = (scale, op) => {
21841
21673
  const { tickCount, forceTickCount, tickStep, getRadius, labelOffset, labelGap = 0, labelStyle } = op;
21842
21674
  const radius = getRadius === null || getRadius === void 0 ? void 0 : getRadius();
21843
- if (!radius) {
21675
+ if (!radius || radius <= 0) {
21844
21676
  return convertDomainToTickData(scale.domain());
21845
21677
  }
21846
21678
  let scaleTicks;
@@ -23364,16 +23196,20 @@ class LabelBase extends AnimateComponent {
23364
23196
  }
23365
23197
  const relatedGraphic = this.getRelatedGraphic(text.attribute);
23366
23198
  const { enter } = this._animationConfig;
23367
- [text, labelLine].filter(Boolean).forEach(item => item.applyAnimationState(['enter'], [
23368
- {
23369
- name: 'enter',
23370
- animation: Object.assign(Object.assign({}, enter), { type: 'labelEnter', selfOnly: true, customParameters: {
23371
- relatedGraphic,
23372
- relatedGraphics: this._idToGraphic,
23373
- config: Object.assign(Object.assign({}, enter), { type: item === text ? enter.type : 'fadeIn' })
23374
- } })
23375
- }
23376
- ]));
23199
+ [text, labelLine].filter(Boolean).forEach(item => {
23200
+ var _a;
23201
+ (_a = item.setFinalAttributes) === null || _a === void 0 ? void 0 : _a.call(item, item.attribute);
23202
+ item.applyAnimationState(['enter'], [
23203
+ {
23204
+ name: 'enter',
23205
+ animation: Object.assign(Object.assign({}, enter), { type: 'labelEnter', selfOnly: true, customParameters: {
23206
+ relatedGraphic,
23207
+ relatedGraphics: this._idToGraphic,
23208
+ config: Object.assign(Object.assign({}, enter), { type: item === text ? enter.type : 'fadeIn' })
23209
+ } })
23210
+ }
23211
+ ]);
23212
+ });
23377
23213
  }
23378
23214
  _runUpdateAnimation(prevLabel, currentLabel) {
23379
23215
  const { text: prevText, labelLine: prevLabelLine } = prevLabel;
@@ -34765,6 +34601,6 @@ TableSeriesNumber.defaultAttributes = {
34765
34601
  select: true
34766
34602
  };
34767
34603
 
34768
- const version = "1.0.27-alpha.0";
34604
+ const version = "1.0.28-alpha.0";
34769
34605
 
34770
34606
  export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IDataZoomEvent, IDataZoomInteractiveEvent, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SeriesNumberCellStateValue, SeriesNumberEvent, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, TableSeriesNumber, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
@@ -30,26 +30,6 @@ export declare class CircleAxis extends AxisBase<CircleAxisAttributes> {
30
30
  fillOpacity: number;
31
31
  };
32
32
  };
33
- labelHoverOnAxis: {
34
- visible: boolean;
35
- space: number;
36
- padding: number;
37
- position: number;
38
- autoRotate: boolean;
39
- textStyle: {
40
- fontSize: number;
41
- fill: string;
42
- fontWeight: string;
43
- fillOpacity: number;
44
- };
45
- background: {
46
- visible: boolean;
47
- style: {
48
- cornerRadius: number;
49
- fill: string;
50
- };
51
- };
52
- };
53
33
  tick: {
54
34
  visible: boolean;
55
35
  inside: boolean;
@@ -21,26 +21,6 @@ export declare const DEFAULT_AXIS_THEME: {
21
21
  fillOpacity: number;
22
22
  };
23
23
  };
24
- labelHoverOnAxis: {
25
- visible: boolean;
26
- space: number;
27
- padding: number;
28
- position: number;
29
- autoRotate: boolean;
30
- textStyle: {
31
- fontSize: number;
32
- fill: string;
33
- fontWeight: string;
34
- fillOpacity: number;
35
- };
36
- background: {
37
- visible: boolean;
38
- style: {
39
- cornerRadius: number;
40
- fill: string;
41
- };
42
- };
43
- };
44
24
  tick: {
45
25
  visible: boolean;
46
26
  inside: boolean;
package/es/axis/config.js CHANGED
@@ -21,26 +21,6 @@ export const DEFAULT_AXIS_THEME = {
21
21
  fillOpacity: 1
22
22
  }
23
23
  },
24
- labelHoverOnAxis: {
25
- visible: !1,
26
- space: 7,
27
- padding: 2,
28
- position: 0,
29
- autoRotate: !1,
30
- textStyle: {
31
- fontSize: 12,
32
- fill: "red",
33
- fontWeight: "normal",
34
- fillOpacity: 1
35
- },
36
- background: {
37
- visible: !0,
38
- style: {
39
- cornerRadius: 2,
40
- fill: "black"
41
- }
42
- }
43
- },
44
24
  tick: {
45
25
  visible: !0,
46
26
  inside: !1,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/axis/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE;QACL,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;QACV,SAAS,EAAE;YACT,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;SACf;KACF;IACD,KAAK,EAAE;QACL,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;QACV,KAAK,EAAE;YACL,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;SACf;KACF;IACD,gBAAgB,EAAE;QAChB,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,CAAC;QACX,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE;YACT,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,KAAK;YACX,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;SACf;QACD,UAAU,EAAE;YACV,OAAO,EAAE,IAAI;YACb,KAAK,EAAE;gBACL,YAAY,EAAE,CAAC;gBACf,IAAI,EAAE,OAAO;aACd;SACF;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,KAAK;QACb,cAAc,EAAE,IAAI;QACpB,MAAM,EAAE,CAAC;QACT,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,CAAC;SACjB;KACF;IACD,OAAO,EAAE;QACP,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,CAAC;SACjB;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,CAAC;SACjB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,CAAC;IACZ,MAAM,EAAE,CAAC;CACV,CAAC","file":"config.js","sourcesContent":["export const DEFAULT_AXIS_THEME = {\n title: {\n space: 4,\n padding: 0,\n textStyle: {\n fontSize: 12,\n fill: '#333333',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n label: {\n visible: true,\n inside: false,\n space: 4,\n padding: 0,\n style: {\n fontSize: 12,\n fill: '#333',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n labelHoverOnAxis: {\n visible: false,\n space: 7,\n padding: 2,\n position: 0,\n autoRotate: false,\n textStyle: {\n fontSize: 12,\n fill: 'red',\n fontWeight: 'normal',\n fillOpacity: 1\n },\n background: {\n visible: true,\n style: {\n cornerRadius: 2,\n fill: 'black'\n }\n }\n },\n tick: {\n visible: true,\n inside: false,\n alignWithLabel: true,\n length: 4,\n style: {\n lineWidth: 1,\n stroke: '#000',\n strokeOpacity: 1\n }\n },\n subTick: {\n visible: false,\n inside: false,\n count: 4,\n length: 2,\n style: {\n lineWidth: 1,\n stroke: '#999',\n strokeOpacity: 1\n }\n },\n line: {\n visible: true,\n style: {\n lineWidth: 1,\n stroke: '#000',\n strokeOpacity: 1\n }\n }\n};\n\nexport const DEFAULT_AXIS_BREAK_SYMBOL_STYLE = {\n size: 8,\n stroke: '#000',\n lineWidth: 1,\n zIndex: 1\n};\n"]}
1
+ {"version":3,"sources":["../src/axis/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE;QACL,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;QACV,SAAS,EAAE;YACT,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;SACf;KACF;IACD,KAAK,EAAE;QACL,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;QACV,KAAK,EAAE;YACL,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;SACf;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,KAAK;QACb,cAAc,EAAE,IAAI;QACpB,MAAM,EAAE,CAAC;QACT,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,CAAC;SACjB;KACF;IACD,OAAO,EAAE;QACP,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,CAAC;SACjB;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,CAAC;SACjB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,CAAC;IACZ,MAAM,EAAE,CAAC;CACV,CAAC","file":"config.js","sourcesContent":["export const DEFAULT_AXIS_THEME = {\n title: {\n space: 4,\n padding: 0,\n textStyle: {\n fontSize: 12,\n fill: '#333333',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n label: {\n visible: true,\n inside: false,\n space: 4,\n padding: 0,\n style: {\n fontSize: 12,\n fill: '#333',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n tick: {\n visible: true,\n inside: false,\n alignWithLabel: true,\n length: 4,\n style: {\n lineWidth: 1,\n stroke: '#000',\n strokeOpacity: 1\n }\n },\n subTick: {\n visible: false,\n inside: false,\n count: 4,\n length: 2,\n style: {\n lineWidth: 1,\n stroke: '#999',\n strokeOpacity: 1\n }\n },\n line: {\n visible: true,\n style: {\n lineWidth: 1,\n stroke: '#000',\n strokeOpacity: 1\n }\n }\n};\n\nexport const DEFAULT_AXIS_BREAK_SYMBOL_STYLE = {\n size: 8,\n stroke: '#000',\n lineWidth: 1,\n zIndex: 1\n};\n"]}
@@ -7,7 +7,6 @@ export declare enum AXIS_ELEMENT_NAME {
7
7
  subTick = "axis-sub-tick",
8
8
  label = "axis-label",
9
9
  title = "axis-title",
10
- labelHoverOnAxis = "axis-label-hover-on-axis",
11
10
  gridContainer = "axis-grid-container",
12
11
  grid = "axis-grid",
13
12
  gridRegion = "axis-grid-region",
@@ -5,11 +5,10 @@ export var AXIS_ELEMENT_NAME;
5
5
  AXIS_ELEMENT_NAME.labelContainer = "axis-label-container", AXIS_ELEMENT_NAME.tickContainer = "axis-tick-container",
6
6
  AXIS_ELEMENT_NAME.tick = "axis-tick", AXIS_ELEMENT_NAME.subTick = "axis-sub-tick",
7
7
  AXIS_ELEMENT_NAME.label = "axis-label", AXIS_ELEMENT_NAME.title = "axis-title",
8
- AXIS_ELEMENT_NAME.labelHoverOnAxis = "axis-label-hover-on-axis", AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container",
9
- AXIS_ELEMENT_NAME.grid = "axis-grid", AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region",
10
- AXIS_ELEMENT_NAME.line = "axis-line", AXIS_ELEMENT_NAME.background = "axis-background",
11
- AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background", AXIS_ELEMENT_NAME.axisBreak = "axis-break",
12
- AXIS_ELEMENT_NAME.axisBreakSymbol = "axis-break-symbol";
8
+ AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container", AXIS_ELEMENT_NAME.grid = "axis-grid",
9
+ AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region", AXIS_ELEMENT_NAME.line = "axis-line",
10
+ AXIS_ELEMENT_NAME.background = "axis-background", AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background",
11
+ AXIS_ELEMENT_NAME.axisBreak = "axis-break", AXIS_ELEMENT_NAME.axisBreakSymbol = "axis-break-symbol";
13
12
  }(AXIS_ELEMENT_NAME || (AXIS_ELEMENT_NAME = {}));
14
13
 
15
14
  export var AxisStateValue;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/axis/constant.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAkBX;AAlBD,WAAY,iBAAiB;IAC3B,6CAAwB,CAAA;IACxB,qDAAgC,CAAA;IAChC,4DAAuC,CAAA;IACvC,0DAAqC,CAAA;IACrC,uCAAkB,CAAA;IAClB,8CAAyB,CAAA;IACzB,yCAAoB,CAAA;IACpB,yCAAoB,CAAA;IACpB,kEAA6C,CAAA;IAC7C,0DAAqC,CAAA;IACrC,uCAAkB,CAAA;IAClB,oDAA+B,CAAA;IAC/B,uCAAkB,CAAA;IAClB,mDAA8B,CAAA;IAC9B,kEAA6C,CAAA;IAC7C,6CAAwB,CAAA;IACxB,0DAAqC,CAAA;AACvC,CAAC,EAlBW,iBAAiB,KAAjB,iBAAiB,QAkB5B;AAED,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,sDAAoC,CAAA;IACpC,iCAAe,CAAA;IACf,gDAA8B,CAAA;AAChC,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB;AAED,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,EAAE;IACpC,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE;IAC7B,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,EAAE;IAC1B,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,EAAE;CAClC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC","file":"constant.js","sourcesContent":["export enum AXIS_ELEMENT_NAME {\n innerView = 'inner-view',\n axisContainer = 'axis-container',\n labelContainer = 'axis-label-container',\n tickContainer = 'axis-tick-container',\n tick = 'axis-tick',\n subTick = 'axis-sub-tick',\n label = 'axis-label',\n title = 'axis-title',\n labelHoverOnAxis = 'axis-label-hover-on-axis',\n gridContainer = 'axis-grid-container',\n grid = 'axis-grid',\n gridRegion = 'axis-grid-region',\n line = 'axis-line',\n background = 'axis-background',\n axisLabelBackground = 'axis-label-background',\n axisBreak = 'axis-break',\n axisBreakSymbol = 'axis-break-symbol'\n}\n\nexport enum AxisStateValue {\n selected = 'selected',\n selectedReverse = 'selected_reverse',\n hover = 'hover',\n hoverReverse = 'hover_reverse'\n}\n\nexport const DEFAULT_STATES = {\n [AxisStateValue.selectedReverse]: {},\n [AxisStateValue.selected]: {},\n [AxisStateValue.hover]: {},\n [AxisStateValue.hoverReverse]: {}\n};\n\nexport const TopZIndex = 999;\n"]}
1
+ {"version":3,"sources":["../src/axis/constant.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAiBX;AAjBD,WAAY,iBAAiB;IAC3B,6CAAwB,CAAA;IACxB,qDAAgC,CAAA;IAChC,4DAAuC,CAAA;IACvC,0DAAqC,CAAA;IACrC,uCAAkB,CAAA;IAClB,8CAAyB,CAAA;IACzB,yCAAoB,CAAA;IACpB,yCAAoB,CAAA;IACpB,0DAAqC,CAAA;IACrC,uCAAkB,CAAA;IAClB,oDAA+B,CAAA;IAC/B,uCAAkB,CAAA;IAClB,mDAA8B,CAAA;IAC9B,kEAA6C,CAAA;IAC7C,6CAAwB,CAAA;IACxB,0DAAqC,CAAA;AACvC,CAAC,EAjBW,iBAAiB,KAAjB,iBAAiB,QAiB5B;AAED,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,sDAAoC,CAAA;IACpC,iCAAe,CAAA;IACf,gDAA8B,CAAA;AAChC,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB;AAED,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,EAAE;IACpC,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE;IAC7B,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,EAAE;IAC1B,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,EAAE;CAClC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC","file":"constant.js","sourcesContent":["export enum AXIS_ELEMENT_NAME {\n innerView = 'inner-view',\n axisContainer = 'axis-container',\n labelContainer = 'axis-label-container',\n tickContainer = 'axis-tick-container',\n tick = 'axis-tick',\n subTick = 'axis-sub-tick',\n label = 'axis-label',\n title = 'axis-title',\n gridContainer = 'axis-grid-container',\n grid = 'axis-grid',\n gridRegion = 'axis-grid-region',\n line = 'axis-line',\n background = 'axis-background',\n axisLabelBackground = 'axis-label-background',\n axisBreak = 'axis-break',\n axisBreakSymbol = 'axis-break-symbol'\n}\n\nexport enum AxisStateValue {\n selected = 'selected',\n selectedReverse = 'selected_reverse',\n hover = 'hover',\n hoverReverse = 'hover_reverse'\n}\n\nexport const DEFAULT_STATES = {\n [AxisStateValue.selectedReverse]: {},\n [AxisStateValue.selected]: {},\n [AxisStateValue.hover]: {},\n [AxisStateValue.hoverReverse]: {}\n};\n\nexport const TopZIndex = 999;\n"]}
package/es/axis/line.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { TextAlignType, IGroup, IText, TextBaselineType } from '@visactor/vrender-core';
2
- import { type TagAttributes } from '../tag';
2
+ import type { TagAttributes } from '../tag';
3
3
  import type { LineAxisAttributes, AxisItem } from './type';
4
4
  import { AxisBase } from './base';
5
5
  import { LineAxisMixin } from './mixin/line';
@@ -30,26 +30,6 @@ export declare class LineAxis extends AxisBase<LineAxisAttributes> {
30
30
  fillOpacity: number;
31
31
  };
32
32
  };
33
- labelHoverOnAxis: {
34
- visible: boolean;
35
- space: number;
36
- padding: number;
37
- position: number;
38
- autoRotate: boolean;
39
- textStyle: {
40
- fontSize: number;
41
- fill: string;
42
- fontWeight: string;
43
- fillOpacity: number;
44
- };
45
- background: {
46
- visible: boolean;
47
- style: {
48
- cornerRadius: number;
49
- fill: string;
50
- };
51
- };
52
- };
53
33
  tick: {
54
34
  visible: boolean;
55
35
  inside: boolean;
@@ -81,15 +61,12 @@ export declare class LineAxis extends AxisBase<LineAxisAttributes> {
81
61
  };
82
62
  };
83
63
  };
84
- private _breaks;
85
- private labelHoverOnAxisGroup;
86
64
  constructor(attributes: LineAxisAttributes, options?: ComponentOptions);
65
+ private _breaks;
87
66
  protected _renderInner(container: IGroup): void;
88
- protected renderLabelHoverOnAxis(): void;
89
67
  protected renderLine(container: IGroup): void;
90
68
  protected getTextAlign(vector: number[]): TextAlignType;
91
69
  protected getTitleAttribute(): TagAttributes;
92
- protected getLabelHoverOnAxisAttribute(): TagAttributes;
93
70
  protected getTextBaseline(vector: number[], inside?: boolean): TextBaselineType;
94
71
  protected getLabelAlign(vector: [number, number], inside?: boolean, angle?: number): {
95
72
  textAlign: TextAlignType;
@@ -99,7 +76,5 @@ export declare class LineAxis extends AxisBase<LineAxisAttributes> {
99
76
  protected handleLabelsOverlap(labelShapes: IText[], labelData: AxisItem[], labelContainer: IGroup, layer: number, layerCount: number): void;
100
77
  protected afterLabelsOverlap(labelShapes: IText[], labelData: AxisItem[], labelContainer: IGroup, layer: number, layerCount: number): void;
101
78
  private _getAxisLabelLimitLength;
102
- showLabelHoverOnAxis(position: number, text: string, adjustPosition?: boolean): void;
103
- hideLabelHoverOnAxis(): void;
104
79
  release(): void;
105
80
  }
package/es/axis/line.js CHANGED
@@ -16,8 +16,6 @@ import { Segment } from "../segment";
16
16
 
17
17
  import { angleTo } from "../util/matrix";
18
18
 
19
- import { Tag } from "../tag";
20
-
21
19
  import { AxisBase } from "./base";
22
20
 
23
21
  import { DEFAULT_AXIS_THEME } from "./config";
@@ -46,14 +44,7 @@ loadLineAxisComponent();
46
44
 
47
45
  export class LineAxis extends AxisBase {
48
46
  constructor(attributes, options) {
49
- var _a;
50
- if (attributes.labelHoverOnAxis && (attributes.labelHoverOnAxis.textStyle = Object.assign({}, attributes.label.style, attributes.labelHoverOnAxis.textStyle),
51
- void 0 === attributes.labelHoverOnAxis.space)) {
52
- const {padding: padding = 2} = attributes.labelHoverOnAxis, parsedPadding = normalizePadding(padding), toDiffPadding = "bottom" === attributes.orient ? parsedPadding[0] : "left" === attributes.orient ? parsedPadding[1] : "top" === attributes.orient ? parsedPadding[2] : parsedPadding[3], space = (null !== (_a = attributes.label.space) && void 0 !== _a ? _a : LineAxis.defaultAttributes.label.space) - toDiffPadding;
53
- attributes.labelHoverOnAxis.space = space;
54
- }
55
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options),
56
- this.labelHoverOnAxisGroup = null;
47
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options);
57
48
  }
58
49
  _renderInner(container) {
59
50
  var _a;
@@ -104,13 +95,6 @@ export class LineAxis extends AxisBase {
104
95
  bgRect.states = merge({}, DEFAULT_STATES, null !== (_a = panel.state) && void 0 !== _a ? _a : {}),
105
96
  axisContainer.insertBefore(bgRect, axisContainer.firstChild);
106
97
  }
107
- const {labelHoverOnAxis: labelHoverOnAxis} = this.attribute;
108
- labelHoverOnAxis && labelHoverOnAxis.visible && this.renderLabelHoverOnAxis();
109
- }
110
- renderLabelHoverOnAxis() {
111
- const hoverOnLabelAttributes = this.getLabelHoverOnAxisAttribute(), hoverOnLabel = new Tag(Object.assign({}, hoverOnLabelAttributes));
112
- hoverOnLabel.name = AXIS_ELEMENT_NAME.title, hoverOnLabel.id = this._getNodeId("hover-on-label"),
113
- this.labelHoverOnAxisGroup = hoverOnLabel, this.axisContainer.add(hoverOnLabel);
114
98
  }
115
99
  renderLine(container) {
116
100
  const {start: start, end: end, line: line} = this.attribute, _a = line, {startSymbol: startSymbol, endSymbol: endSymbol, style: style, state: state} = _a, restLineAttrs = __rest(_a, [ "startSymbol", "endSymbol", "style", "state" ]), lineAttrs = Object.assign({
@@ -205,39 +189,6 @@ export class LineAxis extends AxisBase {
205
189
  visible: !0
206
190
  }, background.style)), attrs;
207
191
  }
208
- getLabelHoverOnAxisAttribute() {
209
- var _a, _b;
210
- const {orient: orient} = this.attribute, _c = this.attribute.labelHoverOnAxis, {position: position = 0, space: space = 4, autoRotate: autoRotate = !0, textStyle: textStyle = {}, background: background = {}, formatMethod: formatMethod, text: textContent = "", maxWidth: maxWidth} = _c, restAttrs = __rest(_c, [ "position", "space", "autoRotate", "textStyle", "background", "formatMethod", "text", "maxWidth" ]), point = this.getTickCoord(0);
211
- "bottom" === orient || "top" === orient ? point.x = position : point.y = position;
212
- let tickLength = 0;
213
- (null === (_a = this.attribute.tick) || void 0 === _a ? void 0 : _a.visible) && !1 === this.attribute.tick.inside && (tickLength = this.attribute.tick.length || 4),
214
- (null === (_b = this.attribute.subTick) || void 0 === _b ? void 0 : _b.visible) && !1 === this.attribute.subTick.inside && (tickLength = Math.max(tickLength, this.attribute.subTick.length || 2));
215
- const offset = tickLength + 0 + space, labelPoint = this.getVerticalCoord(point, offset, !1), vector = this.getVerticalVector(offset, !1, {
216
- x: 0,
217
- y: 0
218
- });
219
- let textBaseline, {angle: angle} = restAttrs, textAlign = "center";
220
- if (isNil(angle) && autoRotate) {
221
- const axisVector = this.getRelativeVector();
222
- angle = angleTo(axisVector, [ 1, 0 ], !0);
223
- const {verticalFactor: verticalFactor = 1} = this.attribute;
224
- textBaseline = 1 === -1 * verticalFactor ? "bottom" : "top";
225
- } else {
226
- const {textAlign: textAlign2, textBaseline: textBaseline2} = this.getLabelAlign(vector, !1, textStyle.angle);
227
- textAlign = textAlign2, textBaseline = textBaseline2;
228
- }
229
- const maxTagWidth = maxWidth, text = formatMethod ? formatMethod(textContent) : textContent, attrs = Object.assign(Object.assign(Object.assign({}, labelPoint), restAttrs), {
230
- maxWidth: maxTagWidth,
231
- textStyle: Object.assign({
232
- textAlign: textAlign,
233
- textBaseline: textBaseline
234
- }, textStyle),
235
- text: text
236
- });
237
- return attrs.angle = angle, background && background.visible && (attrs.panel = Object.assign(Object.assign({
238
- visible: !0
239
- }, restAttrs.panel), background.style)), attrs;
240
- }
241
192
  getTextBaseline(vector, inside) {
242
193
  let base = "middle";
243
194
  const {verticalFactor: verticalFactor = 1} = this.attribute, factor = (inside ? 1 : -1) * verticalFactor;
@@ -376,35 +327,10 @@ export class LineAxis extends AxisBase {
376
327
  return limitLength && (limitLength = (limitLength - labelSpace - titleSpacing - titleHeight - axisLineWidth - tickLength) / layerCount),
377
328
  limitLength;
378
329
  }
379
- showLabelHoverOnAxis(position, text, adjustPosition = !0) {
380
- if (this.attribute.labelHoverOnAxis) {
381
- const preContainerBounds = this.axisContainer.AABBBounds, preWidth = preContainerBounds.width(), preHeight = preContainerBounds.height(), preX1 = preContainerBounds.x1, preY1 = preContainerBounds.y1, preX2 = preContainerBounds.x2, preY2 = preContainerBounds.y2;
382
- if (this.labelHoverOnAxisGroup) {
383
- const {formatMethod: formatMethod} = this.attribute.labelHoverOnAxis, textStr = formatMethod ? formatMethod(text) : text;
384
- this.labelHoverOnAxisGroup.setAttribute("text", textStr), this.labelHoverOnAxisGroup.setAttribute("visible", !0),
385
- this.labelHoverOnAxisGroup.setAttribute("visibleAll", !0), "left" === this.attribute.orient || "right" === this.attribute.orient ? this.labelHoverOnAxisGroup.setAttributes({
386
- y: position
387
- }) : this.labelHoverOnAxisGroup.setAttributes({
388
- x: position
389
- });
390
- } else this.attribute.labelHoverOnAxis.visible = !0, this.attribute.labelHoverOnAxis.position = position,
391
- this.attribute.labelHoverOnAxis.text = text, this.renderLabelHoverOnAxis();
392
- if (adjustPosition) {
393
- const afterContainerBounds = this.axisContainer.AABBBounds, diffWidth = afterContainerBounds.width() - preWidth, diffHeight = afterContainerBounds.height() - preHeight;
394
- diffWidth > 0 && ("top" === this.attribute.orient || "bottom" === this.attribute.orient) && (afterContainerBounds.x1 < preX1 ? this.showLabelHoverOnAxis(position + diffWidth, text, !1) : afterContainerBounds.x2 > preX2 && this.showLabelHoverOnAxis(position - diffWidth, text, !1)),
395
- diffHeight > 0 && ("left" === this.attribute.orient || "right" === this.attribute.orient) && (afterContainerBounds.y1 < preY1 ? this.showLabelHoverOnAxis(position + diffHeight, text, !1) : afterContainerBounds.y2 > preY2 && this.showLabelHoverOnAxis(position - diffHeight, text, !1));
396
- }
397
- }
398
- }
399
- hideLabelHoverOnAxis() {
400
- this.attribute.labelHoverOnAxis && this.labelHoverOnAxisGroup && this.labelHoverOnAxisGroup.setAttributes({
401
- visible: !1,
402
- visibleAll: !1
403
- });
404
- }
405
330
  release() {
406
331
  super.release(), this._breaks = null;
407
332
  }
408
333
  }
409
334
 
410
- LineAxis.defaultAttributes = DEFAULT_AXIS_THEME, mixin(LineAxis, LineAxisMixin);
335
+ LineAxis.defaultAttributes = DEFAULT_AXIS_THEME, mixin(LineAxis, LineAxisMixin);
336
+ //# sourceMappingURL=line.js.map