@visactor/vrender 1.0.24 → 1.0.25-alpha.1
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/cjs/index.d.ts +1 -1
- package/cjs/index.js +11 -10
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +103 -3
- package/dist/index.js +103 -3
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +7 -7
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,16 +21,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits"), vrender_animate_1 = require("@visactor/vrender-animate");
|
|
23
23
|
|
|
24
|
-
exports.version = "1.0.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0, vrender_kits_2.
|
|
28
|
-
(0, vrender_kits_2.
|
|
29
|
-
(0, vrender_kits_2.
|
|
30
|
-
(0, vrender_kits_2.
|
|
31
|
-
vrender_kits_2.
|
|
32
|
-
(0, vrender_kits_2.
|
|
33
|
-
(0,
|
|
24
|
+
exports.version = "1.0.25-alpha.1", (0, vrender_core_1.preLoadAllModule)(), (0,
|
|
25
|
+
vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
|
|
26
|
+
vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
|
|
27
|
+
(0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
|
|
28
|
+
(0, vrender_kits_2.registerCircle)(), (0, vrender_kits_2.registerGlyph)(), (0, vrender_kits_2.registerGroup)(),
|
|
29
|
+
(0, vrender_kits_2.registerImage)(), (0, vrender_kits_2.registerLine)(), (0, vrender_kits_2.registerPath)(),
|
|
30
|
+
(0, vrender_kits_2.registerPolygon)(), (0, vrender_kits_2.registerPyramid3d)(),
|
|
31
|
+
(0, vrender_kits_2.registerRect)(), (0, vrender_kits_2.registerRect3d)(), (0, vrender_kits_2.registerRichtext)(),
|
|
32
|
+
(0, vrender_kits_2.registerShadowRoot)(), (0, vrender_kits_2.registerSymbol)(),
|
|
33
|
+
(0, vrender_kits_2.registerText)(), (0, vrender_kits_2.registerWrapText)(), (0,
|
|
34
|
+
vrender_kits_1.registerStar)(), (0, vrender_core_1.registerFlexLayoutPlugin)(),
|
|
34
35
|
(0, vrender_core_1.registerViewTransform3dPlugin)(), (0, vrender_core_1.registerHtmlAttributePlugin)(),
|
|
35
36
|
(0, vrender_core_1.registerReactAttributePlugin)(), (0, vrender_core_1.registerDirectionalLight)(),
|
|
36
37
|
(0, vrender_core_1.registerOrthoCamera)(), (0, vrender_animate_1.registerCustomAnimate)(),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAmF;AACnF,yDAmBgC;AAChC,+DAAmF;AAEtE,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAmF;AACnF,yDAmBgC;AAChC,+DAAmF;AAEtE,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,2BAAY,GAAE,CAAC;AAEf,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AAEtB,IAAA,uCAAqB,GAAE,CAAC;AACxB,IAAA,iCAAe,GAAE,CAAC;AAElB,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C;AAC1C,+DAA6C;AAG7C,6DAAkD;AAAzC,wGAAA,KAAK,OAAA;AACd,uDAAmD;AAA1C,yGAAA,SAAS,OAAA","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv, registerStar } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\nimport { registerCustomAnimate, registerAnimate } from '@visactor/vrender-animate';\n// 导出版本号\nexport const version = \"1.0.25-alpha.1\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nregisterStar();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\n\nregisterCustomAnimate();\nregisterAnimate();\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-animate';\nexport * from '@visactor/vrender-components';\n\n// avoid naming conflicts with 'State' & 'Direction' in '@visactor/vrender-components'\nexport { State } from '@visactor/vrender-animate';\nexport { Direction } from '@visactor/vrender-core';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -39269,7 +39269,7 @@ class ArcSegment extends Segment {
|
|
|
39269
39269
|
|
|
39270
39270
|
var AXIS_ELEMENT_NAME;
|
|
39271
39271
|
!function (AXIS_ELEMENT_NAME) {
|
|
39272
|
-
AXIS_ELEMENT_NAME.innerView = "inner-view", AXIS_ELEMENT_NAME.axisContainer = "axis-container", AXIS_ELEMENT_NAME.labelContainer = "axis-label-container", AXIS_ELEMENT_NAME.tickContainer = "axis-tick-container", AXIS_ELEMENT_NAME.tick = "axis-tick", AXIS_ELEMENT_NAME.subTick = "axis-sub-tick", AXIS_ELEMENT_NAME.label = "axis-label", AXIS_ELEMENT_NAME.title = "axis-title", AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container", AXIS_ELEMENT_NAME.grid = "axis-grid", AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region", AXIS_ELEMENT_NAME.line = "axis-line", AXIS_ELEMENT_NAME.background = "axis-background", AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background", AXIS_ELEMENT_NAME.axisBreak = "axis-break", AXIS_ELEMENT_NAME.axisBreakSymbol = "axis-break-symbol";
|
|
39272
|
+
AXIS_ELEMENT_NAME.innerView = "inner-view", AXIS_ELEMENT_NAME.axisContainer = "axis-container", AXIS_ELEMENT_NAME.labelContainer = "axis-label-container", AXIS_ELEMENT_NAME.tickContainer = "axis-tick-container", AXIS_ELEMENT_NAME.tick = "axis-tick", AXIS_ELEMENT_NAME.subTick = "axis-sub-tick", AXIS_ELEMENT_NAME.label = "axis-label", AXIS_ELEMENT_NAME.title = "axis-title", AXIS_ELEMENT_NAME.labelHoverOnAxis = "axis-label-hover-on-axis", AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container", AXIS_ELEMENT_NAME.grid = "axis-grid", AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region", AXIS_ELEMENT_NAME.line = "axis-line", AXIS_ELEMENT_NAME.background = "axis-background", AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background", AXIS_ELEMENT_NAME.axisBreak = "axis-break", AXIS_ELEMENT_NAME.axisBreakSymbol = "axis-break-symbol";
|
|
39273
39273
|
}(AXIS_ELEMENT_NAME || (AXIS_ELEMENT_NAME = {}));
|
|
39274
39274
|
var AxisStateValue;
|
|
39275
39275
|
!function (AxisStateValue) {
|
|
@@ -40297,7 +40297,7 @@ var __rest$b = undefined && undefined.__rest || function (s, e) {
|
|
|
40297
40297
|
loadLineAxisComponent();
|
|
40298
40298
|
class LineAxis extends AxisBase {
|
|
40299
40299
|
constructor(attributes, options) {
|
|
40300
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options);
|
|
40300
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options), this.labelHoverOnAxisGroup = null;
|
|
40301
40301
|
}
|
|
40302
40302
|
_renderInner(container) {
|
|
40303
40303
|
var _a;
|
|
@@ -40359,6 +40359,15 @@ class LineAxis extends AxisBase {
|
|
|
40359
40359
|
}, panel.style));
|
|
40360
40360
|
bgRect.name = AXIS_ELEMENT_NAME.background, bgRect.id = this._getNodeId("background"), bgRect.states = merge({}, DEFAULT_STATES$1, null !== (_a = panel.state) && void 0 !== _a ? _a : {}), axisContainer.insertBefore(bgRect, axisContainer.firstChild);
|
|
40361
40361
|
}
|
|
40362
|
+
const {
|
|
40363
|
+
labelHoverOnAxis: labelHoverOnAxis
|
|
40364
|
+
} = this.attribute;
|
|
40365
|
+
labelHoverOnAxis && labelHoverOnAxis.visible && this.renderLabelHoverOnAxis();
|
|
40366
|
+
}
|
|
40367
|
+
renderLabelHoverOnAxis() {
|
|
40368
|
+
const hoverOnLabelAttributes = this.getLabelHoverOnAxisAttribute(),
|
|
40369
|
+
hoverOnLabel = new Tag(Object.assign({}, hoverOnLabelAttributes));
|
|
40370
|
+
hoverOnLabel.name = AXIS_ELEMENT_NAME.title, hoverOnLabel.id = this._getNodeId("hover-on-label"), this.labelHoverOnAxisGroup = hoverOnLabel, this.axisContainer.add(hoverOnLabel);
|
|
40362
40371
|
}
|
|
40363
40372
|
renderLine(container) {
|
|
40364
40373
|
const {
|
|
@@ -40499,6 +40508,78 @@ class LineAxis extends AxisBase {
|
|
|
40499
40508
|
visible: !0
|
|
40500
40509
|
}, background.style)), attrs;
|
|
40501
40510
|
}
|
|
40511
|
+
getLabelHoverOnAxisAttribute() {
|
|
40512
|
+
var _a, _b;
|
|
40513
|
+
const {
|
|
40514
|
+
orient: orient
|
|
40515
|
+
} = this.attribute,
|
|
40516
|
+
_c = this.attribute.labelHoverOnAxis,
|
|
40517
|
+
{
|
|
40518
|
+
position = 0,
|
|
40519
|
+
space = 4,
|
|
40520
|
+
autoRotate = !0,
|
|
40521
|
+
textStyle = {},
|
|
40522
|
+
background = {},
|
|
40523
|
+
formatMethod: formatMethod,
|
|
40524
|
+
text: textContent = ""
|
|
40525
|
+
} = _c,
|
|
40526
|
+
restAttrs = __rest$b(_c, ["position", "space", "autoRotate", "textStyle", "background", "formatMethod", "text"]),
|
|
40527
|
+
point = this.getTickCoord(0);
|
|
40528
|
+
"bottom" === orient || "top" === orient ? point.x = position : point.y = position;
|
|
40529
|
+
let tickLength = 0;
|
|
40530
|
+
(null === (_a = this.attribute.tick) || void 0 === _a ? void 0 : _a.visible) && !1 === this.attribute.tick.inside && (tickLength = this.attribute.tick.length || 4), (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));
|
|
40531
|
+
const offset = tickLength + 0 + space,
|
|
40532
|
+
labelPoint = this.getVerticalCoord(point, offset, !1),
|
|
40533
|
+
vector = this.getVerticalVector(offset, !1, {
|
|
40534
|
+
x: 0,
|
|
40535
|
+
y: 0
|
|
40536
|
+
});
|
|
40537
|
+
let textBaseline,
|
|
40538
|
+
{
|
|
40539
|
+
angle: angle
|
|
40540
|
+
} = restAttrs,
|
|
40541
|
+
textAlign = "center";
|
|
40542
|
+
if (isNil$1(angle) && autoRotate) {
|
|
40543
|
+
const axisVector = this.getRelativeVector();
|
|
40544
|
+
angle = angleTo(axisVector, [1, 0], !0);
|
|
40545
|
+
const {
|
|
40546
|
+
verticalFactor = 1
|
|
40547
|
+
} = this.attribute;
|
|
40548
|
+
textBaseline = 1 === -1 * verticalFactor ? "bottom" : "top";
|
|
40549
|
+
} else textAlign = this.getTextAlign(vector), textBaseline = this.getTextBaseline(vector, !1);
|
|
40550
|
+
let maxTagWidth = 100;
|
|
40551
|
+
if (isNil$1(maxTagWidth)) {
|
|
40552
|
+
const {
|
|
40553
|
+
verticalLimitSize: verticalLimitSize,
|
|
40554
|
+
verticalMinSize: verticalMinSize,
|
|
40555
|
+
orient: orient
|
|
40556
|
+
} = this.attribute,
|
|
40557
|
+
limitSize = Math.min(verticalLimitSize || 1 / 0, verticalMinSize || 1 / 0);
|
|
40558
|
+
if (isValidNumber$1(limitSize)) {
|
|
40559
|
+
if ("bottom" === orient || "top" === orient) {
|
|
40560
|
+
if (angle !== Math.PI / 2) {
|
|
40561
|
+
const cosValue = Math.abs(Math.cos(null != angle ? angle : 0));
|
|
40562
|
+
maxTagWidth = cosValue < 1e-6 ? 1 / 0 : this.attribute.end.x / cosValue;
|
|
40563
|
+
} else maxTagWidth = limitSize - offset;
|
|
40564
|
+
} else if (angle && 0 !== angle) {
|
|
40565
|
+
const sinValue = Math.abs(Math.sin(angle));
|
|
40566
|
+
maxTagWidth = sinValue < 1e-6 ? 1 / 0 : this.attribute.end.y / sinValue;
|
|
40567
|
+
} else maxTagWidth = limitSize - offset;
|
|
40568
|
+
}
|
|
40569
|
+
}
|
|
40570
|
+
const text = formatMethod ? formatMethod(textContent) : textContent,
|
|
40571
|
+
attrs = Object.assign(Object.assign(Object.assign({}, labelPoint), restAttrs), {
|
|
40572
|
+
maxWidth: maxTagWidth,
|
|
40573
|
+
textStyle: Object.assign({
|
|
40574
|
+
textAlign: textAlign,
|
|
40575
|
+
textBaseline: textBaseline
|
|
40576
|
+
}, textStyle),
|
|
40577
|
+
text: text
|
|
40578
|
+
});
|
|
40579
|
+
return attrs.angle = angle, background && background.visible && (attrs.panel = Object.assign(Object.assign({
|
|
40580
|
+
visible: !0
|
|
40581
|
+
}, restAttrs.panel), background.style)), attrs;
|
|
40582
|
+
}
|
|
40502
40583
|
getTextBaseline(vector, inside) {
|
|
40503
40584
|
let base = "middle";
|
|
40504
40585
|
const {
|
|
@@ -40689,6 +40770,25 @@ class LineAxis extends AxisBase {
|
|
|
40689
40770
|
}
|
|
40690
40771
|
return limitLength && (limitLength = (limitLength - labelSpace - titleSpacing - titleHeight - axisLineWidth - tickLength) / layerCount), limitLength;
|
|
40691
40772
|
}
|
|
40773
|
+
showLabelHoverOnAxis(position, text) {
|
|
40774
|
+
if (this.attribute.labelHoverOnAxis) if (this.labelHoverOnAxisGroup) {
|
|
40775
|
+
const {
|
|
40776
|
+
formatMethod: formatMethod
|
|
40777
|
+
} = this.attribute.labelHoverOnAxis,
|
|
40778
|
+
textStr = formatMethod ? formatMethod(text) : text;
|
|
40779
|
+
this.labelHoverOnAxisGroup.setAttribute("text", textStr), this.labelHoverOnAxisGroup.setAttribute("visible", !0), this.labelHoverOnAxisGroup.setAttribute("visibleAll", !0), "left" === this.attribute.orient || "right" === this.attribute.orient ? this.labelHoverOnAxisGroup.setAttributes({
|
|
40780
|
+
y: position
|
|
40781
|
+
}) : this.labelHoverOnAxisGroup.setAttributes({
|
|
40782
|
+
x: position
|
|
40783
|
+
});
|
|
40784
|
+
} else this.attribute.labelHoverOnAxis.visible = !0, this.attribute.labelHoverOnAxis.position = position, this.attribute.labelHoverOnAxis.text = text, this.renderLabelHoverOnAxis();
|
|
40785
|
+
}
|
|
40786
|
+
hideLabelHoverOnAxis() {
|
|
40787
|
+
this.attribute.labelHoverOnAxis && this.labelHoverOnAxisGroup && this.labelHoverOnAxisGroup.setAttributes({
|
|
40788
|
+
visible: !1,
|
|
40789
|
+
visibleAll: !1
|
|
40790
|
+
});
|
|
40791
|
+
}
|
|
40692
40792
|
release() {
|
|
40693
40793
|
super.release(), this._breaks = null;
|
|
40694
40794
|
}
|
|
@@ -52747,7 +52847,7 @@ TableSeriesNumber.defaultAttributes = {
|
|
|
52747
52847
|
select: !0
|
|
52748
52848
|
};
|
|
52749
52849
|
|
|
52750
|
-
const version = "1.0.
|
|
52850
|
+
const version = "1.0.25-alpha.1";
|
|
52751
52851
|
preLoadAllModule();
|
|
52752
52852
|
if (isBrowserEnv()) {
|
|
52753
52853
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -39275,7 +39275,7 @@
|
|
|
39275
39275
|
|
|
39276
39276
|
exports.AXIS_ELEMENT_NAME = void 0;
|
|
39277
39277
|
!function (AXIS_ELEMENT_NAME) {
|
|
39278
|
-
AXIS_ELEMENT_NAME.innerView = "inner-view", AXIS_ELEMENT_NAME.axisContainer = "axis-container", AXIS_ELEMENT_NAME.labelContainer = "axis-label-container", AXIS_ELEMENT_NAME.tickContainer = "axis-tick-container", AXIS_ELEMENT_NAME.tick = "axis-tick", AXIS_ELEMENT_NAME.subTick = "axis-sub-tick", AXIS_ELEMENT_NAME.label = "axis-label", AXIS_ELEMENT_NAME.title = "axis-title", AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container", AXIS_ELEMENT_NAME.grid = "axis-grid", AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region", AXIS_ELEMENT_NAME.line = "axis-line", AXIS_ELEMENT_NAME.background = "axis-background", AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background", AXIS_ELEMENT_NAME.axisBreak = "axis-break", AXIS_ELEMENT_NAME.axisBreakSymbol = "axis-break-symbol";
|
|
39278
|
+
AXIS_ELEMENT_NAME.innerView = "inner-view", AXIS_ELEMENT_NAME.axisContainer = "axis-container", AXIS_ELEMENT_NAME.labelContainer = "axis-label-container", AXIS_ELEMENT_NAME.tickContainer = "axis-tick-container", AXIS_ELEMENT_NAME.tick = "axis-tick", AXIS_ELEMENT_NAME.subTick = "axis-sub-tick", AXIS_ELEMENT_NAME.label = "axis-label", AXIS_ELEMENT_NAME.title = "axis-title", AXIS_ELEMENT_NAME.labelHoverOnAxis = "axis-label-hover-on-axis", AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container", AXIS_ELEMENT_NAME.grid = "axis-grid", AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region", AXIS_ELEMENT_NAME.line = "axis-line", AXIS_ELEMENT_NAME.background = "axis-background", AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background", AXIS_ELEMENT_NAME.axisBreak = "axis-break", AXIS_ELEMENT_NAME.axisBreakSymbol = "axis-break-symbol";
|
|
39279
39279
|
}(exports.AXIS_ELEMENT_NAME || (exports.AXIS_ELEMENT_NAME = {}));
|
|
39280
39280
|
exports.AxisStateValue = void 0;
|
|
39281
39281
|
!function (AxisStateValue) {
|
|
@@ -40303,7 +40303,7 @@
|
|
|
40303
40303
|
loadLineAxisComponent();
|
|
40304
40304
|
class LineAxis extends AxisBase {
|
|
40305
40305
|
constructor(attributes, options) {
|
|
40306
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options);
|
|
40306
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options), this.labelHoverOnAxisGroup = null;
|
|
40307
40307
|
}
|
|
40308
40308
|
_renderInner(container) {
|
|
40309
40309
|
var _a;
|
|
@@ -40365,6 +40365,15 @@
|
|
|
40365
40365
|
}, panel.style));
|
|
40366
40366
|
bgRect.name = exports.AXIS_ELEMENT_NAME.background, bgRect.id = this._getNodeId("background"), bgRect.states = merge({}, DEFAULT_STATES$1, null !== (_a = panel.state) && void 0 !== _a ? _a : {}), axisContainer.insertBefore(bgRect, axisContainer.firstChild);
|
|
40367
40367
|
}
|
|
40368
|
+
const {
|
|
40369
|
+
labelHoverOnAxis: labelHoverOnAxis
|
|
40370
|
+
} = this.attribute;
|
|
40371
|
+
labelHoverOnAxis && labelHoverOnAxis.visible && this.renderLabelHoverOnAxis();
|
|
40372
|
+
}
|
|
40373
|
+
renderLabelHoverOnAxis() {
|
|
40374
|
+
const hoverOnLabelAttributes = this.getLabelHoverOnAxisAttribute(),
|
|
40375
|
+
hoverOnLabel = new Tag(Object.assign({}, hoverOnLabelAttributes));
|
|
40376
|
+
hoverOnLabel.name = exports.AXIS_ELEMENT_NAME.title, hoverOnLabel.id = this._getNodeId("hover-on-label"), this.labelHoverOnAxisGroup = hoverOnLabel, this.axisContainer.add(hoverOnLabel);
|
|
40368
40377
|
}
|
|
40369
40378
|
renderLine(container) {
|
|
40370
40379
|
const {
|
|
@@ -40505,6 +40514,78 @@
|
|
|
40505
40514
|
visible: !0
|
|
40506
40515
|
}, background.style)), attrs;
|
|
40507
40516
|
}
|
|
40517
|
+
getLabelHoverOnAxisAttribute() {
|
|
40518
|
+
var _a, _b;
|
|
40519
|
+
const {
|
|
40520
|
+
orient: orient
|
|
40521
|
+
} = this.attribute,
|
|
40522
|
+
_c = this.attribute.labelHoverOnAxis,
|
|
40523
|
+
{
|
|
40524
|
+
position = 0,
|
|
40525
|
+
space = 4,
|
|
40526
|
+
autoRotate = !0,
|
|
40527
|
+
textStyle = {},
|
|
40528
|
+
background = {},
|
|
40529
|
+
formatMethod: formatMethod,
|
|
40530
|
+
text: textContent = ""
|
|
40531
|
+
} = _c,
|
|
40532
|
+
restAttrs = __rest$b(_c, ["position", "space", "autoRotate", "textStyle", "background", "formatMethod", "text"]),
|
|
40533
|
+
point = this.getTickCoord(0);
|
|
40534
|
+
"bottom" === orient || "top" === orient ? point.x = position : point.y = position;
|
|
40535
|
+
let tickLength = 0;
|
|
40536
|
+
(null === (_a = this.attribute.tick) || void 0 === _a ? void 0 : _a.visible) && !1 === this.attribute.tick.inside && (tickLength = this.attribute.tick.length || 4), (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));
|
|
40537
|
+
const offset = tickLength + 0 + space,
|
|
40538
|
+
labelPoint = this.getVerticalCoord(point, offset, !1),
|
|
40539
|
+
vector = this.getVerticalVector(offset, !1, {
|
|
40540
|
+
x: 0,
|
|
40541
|
+
y: 0
|
|
40542
|
+
});
|
|
40543
|
+
let textBaseline,
|
|
40544
|
+
{
|
|
40545
|
+
angle: angle
|
|
40546
|
+
} = restAttrs,
|
|
40547
|
+
textAlign = "center";
|
|
40548
|
+
if (isNil$1(angle) && autoRotate) {
|
|
40549
|
+
const axisVector = this.getRelativeVector();
|
|
40550
|
+
angle = angleTo(axisVector, [1, 0], !0);
|
|
40551
|
+
const {
|
|
40552
|
+
verticalFactor = 1
|
|
40553
|
+
} = this.attribute;
|
|
40554
|
+
textBaseline = 1 === -1 * verticalFactor ? "bottom" : "top";
|
|
40555
|
+
} else textAlign = this.getTextAlign(vector), textBaseline = this.getTextBaseline(vector, !1);
|
|
40556
|
+
let maxTagWidth = 100;
|
|
40557
|
+
if (isNil$1(maxTagWidth)) {
|
|
40558
|
+
const {
|
|
40559
|
+
verticalLimitSize: verticalLimitSize,
|
|
40560
|
+
verticalMinSize: verticalMinSize,
|
|
40561
|
+
orient: orient
|
|
40562
|
+
} = this.attribute,
|
|
40563
|
+
limitSize = Math.min(verticalLimitSize || 1 / 0, verticalMinSize || 1 / 0);
|
|
40564
|
+
if (isValidNumber$1(limitSize)) {
|
|
40565
|
+
if ("bottom" === orient || "top" === orient) {
|
|
40566
|
+
if (angle !== Math.PI / 2) {
|
|
40567
|
+
const cosValue = Math.abs(Math.cos(null != angle ? angle : 0));
|
|
40568
|
+
maxTagWidth = cosValue < 1e-6 ? 1 / 0 : this.attribute.end.x / cosValue;
|
|
40569
|
+
} else maxTagWidth = limitSize - offset;
|
|
40570
|
+
} else if (angle && 0 !== angle) {
|
|
40571
|
+
const sinValue = Math.abs(Math.sin(angle));
|
|
40572
|
+
maxTagWidth = sinValue < 1e-6 ? 1 / 0 : this.attribute.end.y / sinValue;
|
|
40573
|
+
} else maxTagWidth = limitSize - offset;
|
|
40574
|
+
}
|
|
40575
|
+
}
|
|
40576
|
+
const text = formatMethod ? formatMethod(textContent) : textContent,
|
|
40577
|
+
attrs = Object.assign(Object.assign(Object.assign({}, labelPoint), restAttrs), {
|
|
40578
|
+
maxWidth: maxTagWidth,
|
|
40579
|
+
textStyle: Object.assign({
|
|
40580
|
+
textAlign: textAlign,
|
|
40581
|
+
textBaseline: textBaseline
|
|
40582
|
+
}, textStyle),
|
|
40583
|
+
text: text
|
|
40584
|
+
});
|
|
40585
|
+
return attrs.angle = angle, background && background.visible && (attrs.panel = Object.assign(Object.assign({
|
|
40586
|
+
visible: !0
|
|
40587
|
+
}, restAttrs.panel), background.style)), attrs;
|
|
40588
|
+
}
|
|
40508
40589
|
getTextBaseline(vector, inside) {
|
|
40509
40590
|
let base = "middle";
|
|
40510
40591
|
const {
|
|
@@ -40695,6 +40776,25 @@
|
|
|
40695
40776
|
}
|
|
40696
40777
|
return limitLength && (limitLength = (limitLength - labelSpace - titleSpacing - titleHeight - axisLineWidth - tickLength) / layerCount), limitLength;
|
|
40697
40778
|
}
|
|
40779
|
+
showLabelHoverOnAxis(position, text) {
|
|
40780
|
+
if (this.attribute.labelHoverOnAxis) if (this.labelHoverOnAxisGroup) {
|
|
40781
|
+
const {
|
|
40782
|
+
formatMethod: formatMethod
|
|
40783
|
+
} = this.attribute.labelHoverOnAxis,
|
|
40784
|
+
textStr = formatMethod ? formatMethod(text) : text;
|
|
40785
|
+
this.labelHoverOnAxisGroup.setAttribute("text", textStr), this.labelHoverOnAxisGroup.setAttribute("visible", !0), this.labelHoverOnAxisGroup.setAttribute("visibleAll", !0), "left" === this.attribute.orient || "right" === this.attribute.orient ? this.labelHoverOnAxisGroup.setAttributes({
|
|
40786
|
+
y: position
|
|
40787
|
+
}) : this.labelHoverOnAxisGroup.setAttributes({
|
|
40788
|
+
x: position
|
|
40789
|
+
});
|
|
40790
|
+
} else this.attribute.labelHoverOnAxis.visible = !0, this.attribute.labelHoverOnAxis.position = position, this.attribute.labelHoverOnAxis.text = text, this.renderLabelHoverOnAxis();
|
|
40791
|
+
}
|
|
40792
|
+
hideLabelHoverOnAxis() {
|
|
40793
|
+
this.attribute.labelHoverOnAxis && this.labelHoverOnAxisGroup && this.labelHoverOnAxisGroup.setAttributes({
|
|
40794
|
+
visible: !1,
|
|
40795
|
+
visibleAll: !1
|
|
40796
|
+
});
|
|
40797
|
+
}
|
|
40698
40798
|
release() {
|
|
40699
40799
|
super.release(), this._breaks = null;
|
|
40700
40800
|
}
|
|
@@ -52753,7 +52853,7 @@
|
|
|
52753
52853
|
select: !0
|
|
52754
52854
|
};
|
|
52755
52855
|
|
|
52756
|
-
const version = "1.0.
|
|
52856
|
+
const version = "1.0.25-alpha.1";
|
|
52757
52857
|
preLoadAllModule();
|
|
52758
52858
|
if (isBrowserEnv()) {
|
|
52759
52859
|
loadBrowserEnv(container);
|