@visactor/vrender 1.0.27-alpha.0 → 1.0.27
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 +10 -11
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +4 -138
- package/dist/index.js +4 -138
- 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,17 +21,16 @@ 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.27
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0, vrender_kits_2.
|
|
28
|
-
(0, vrender_kits_2.
|
|
29
|
-
(0, vrender_kits_2.
|
|
30
|
-
(0, vrender_kits_2.
|
|
31
|
-
|
|
32
|
-
(0, vrender_kits_2.
|
|
33
|
-
(0,
|
|
34
|
-
vrender_kits_1.registerStar)(), (0, vrender_core_1.registerFlexLayoutPlugin)(),
|
|
24
|
+
exports.version = "1.0.27", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
|
|
25
|
+
vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
|
|
26
|
+
vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
|
|
27
|
+
(0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
|
|
28
|
+
(0, vrender_kits_2.registerGlyph)(), (0, vrender_kits_2.registerGroup)(), (0, vrender_kits_2.registerImage)(),
|
|
29
|
+
(0, vrender_kits_2.registerLine)(), (0, vrender_kits_2.registerPath)(), (0, vrender_kits_2.registerPolygon)(),
|
|
30
|
+
(0, vrender_kits_2.registerPyramid3d)(), (0, vrender_kits_2.registerRect)(), (0,
|
|
31
|
+
vrender_kits_2.registerRect3d)(), (0, vrender_kits_2.registerRichtext)(), (0, vrender_kits_2.registerShadowRoot)(),
|
|
32
|
+
(0, vrender_kits_2.registerSymbol)(), (0, vrender_kits_2.registerText)(), (0, vrender_kits_2.registerWrapText)(),
|
|
33
|
+
(0, vrender_kits_1.registerStar)(), (0, vrender_core_1.registerFlexLayoutPlugin)(),
|
|
35
34
|
(0, vrender_core_1.registerViewTransform3dPlugin)(), (0, vrender_core_1.registerHtmlAttributePlugin)(),
|
|
36
35
|
(0, vrender_core_1.registerReactAttributePlugin)(), (0, vrender_core_1.registerDirectionalLight)(),
|
|
37
36
|
(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,QAAQ,CAAC;AAEhC,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.27\";\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
|
@@ -39324,7 +39324,7 @@ class ArcSegment extends Segment {
|
|
|
39324
39324
|
|
|
39325
39325
|
var AXIS_ELEMENT_NAME;
|
|
39326
39326
|
!function (AXIS_ELEMENT_NAME) {
|
|
39327
|
-
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.
|
|
39327
|
+
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";
|
|
39328
39328
|
}(AXIS_ELEMENT_NAME || (AXIS_ELEMENT_NAME = {}));
|
|
39329
39329
|
var AxisStateValue;
|
|
39330
39330
|
!function (AxisStateValue) {
|
|
@@ -39361,26 +39361,6 @@ const DEFAULT_AXIS_THEME = {
|
|
|
39361
39361
|
fillOpacity: 1
|
|
39362
39362
|
}
|
|
39363
39363
|
},
|
|
39364
|
-
labelHoverOnAxis: {
|
|
39365
|
-
visible: !1,
|
|
39366
|
-
space: 7,
|
|
39367
|
-
padding: 2,
|
|
39368
|
-
position: 0,
|
|
39369
|
-
autoRotate: !1,
|
|
39370
|
-
textStyle: {
|
|
39371
|
-
fontSize: 12,
|
|
39372
|
-
fill: "red",
|
|
39373
|
-
fontWeight: "normal",
|
|
39374
|
-
fillOpacity: 1
|
|
39375
|
-
},
|
|
39376
|
-
background: {
|
|
39377
|
-
visible: !0,
|
|
39378
|
-
style: {
|
|
39379
|
-
cornerRadius: 2,
|
|
39380
|
-
fill: "black"
|
|
39381
|
-
}
|
|
39382
|
-
}
|
|
39383
|
-
},
|
|
39384
39364
|
tick: {
|
|
39385
39365
|
visible: !0,
|
|
39386
39366
|
inside: !1,
|
|
@@ -40372,17 +40352,7 @@ var __rest$b = undefined && undefined.__rest || function (s, e) {
|
|
|
40372
40352
|
loadLineAxisComponent();
|
|
40373
40353
|
class LineAxis extends AxisBase {
|
|
40374
40354
|
constructor(attributes, options) {
|
|
40375
|
-
|
|
40376
|
-
if (attributes.labelHoverOnAxis && (attributes.labelHoverOnAxis.textStyle = Object.assign({}, attributes.label.style, attributes.labelHoverOnAxis.textStyle), void 0 === attributes.labelHoverOnAxis.space)) {
|
|
40377
|
-
const {
|
|
40378
|
-
padding = 2
|
|
40379
|
-
} = attributes.labelHoverOnAxis,
|
|
40380
|
-
parsedPadding = normalizePadding(padding),
|
|
40381
|
-
toDiffPadding = "bottom" === attributes.orient ? parsedPadding[0] : "left" === attributes.orient ? parsedPadding[1] : "top" === attributes.orient ? parsedPadding[2] : parsedPadding[3],
|
|
40382
|
-
space = (null !== (_a = attributes.label.space) && void 0 !== _a ? _a : LineAxis.defaultAttributes.label.space) - toDiffPadding;
|
|
40383
|
-
attributes.labelHoverOnAxis.space = space;
|
|
40384
|
-
}
|
|
40385
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options), this.labelHoverOnAxisGroup = null;
|
|
40355
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options);
|
|
40386
40356
|
}
|
|
40387
40357
|
_renderInner(container) {
|
|
40388
40358
|
var _a;
|
|
@@ -40444,15 +40414,6 @@ class LineAxis extends AxisBase {
|
|
|
40444
40414
|
}, panel.style));
|
|
40445
40415
|
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);
|
|
40446
40416
|
}
|
|
40447
|
-
const {
|
|
40448
|
-
labelHoverOnAxis: labelHoverOnAxis
|
|
40449
|
-
} = this.attribute;
|
|
40450
|
-
labelHoverOnAxis && labelHoverOnAxis.visible && this.renderLabelHoverOnAxis();
|
|
40451
|
-
}
|
|
40452
|
-
renderLabelHoverOnAxis() {
|
|
40453
|
-
const hoverOnLabelAttributes = this.getLabelHoverOnAxisAttribute(),
|
|
40454
|
-
hoverOnLabel = new Tag(Object.assign({}, hoverOnLabelAttributes));
|
|
40455
|
-
hoverOnLabel.name = AXIS_ELEMENT_NAME.title, hoverOnLabel.id = this._getNodeId("hover-on-label"), this.labelHoverOnAxisGroup = hoverOnLabel, this.axisContainer.add(hoverOnLabel);
|
|
40456
40417
|
}
|
|
40457
40418
|
renderLine(container) {
|
|
40458
40419
|
const {
|
|
@@ -40593,66 +40554,6 @@ class LineAxis extends AxisBase {
|
|
|
40593
40554
|
visible: !0
|
|
40594
40555
|
}, background.style)), attrs;
|
|
40595
40556
|
}
|
|
40596
|
-
getLabelHoverOnAxisAttribute() {
|
|
40597
|
-
var _a, _b;
|
|
40598
|
-
const {
|
|
40599
|
-
orient: orient
|
|
40600
|
-
} = this.attribute,
|
|
40601
|
-
_c = this.attribute.labelHoverOnAxis,
|
|
40602
|
-
{
|
|
40603
|
-
position = 0,
|
|
40604
|
-
space = 4,
|
|
40605
|
-
autoRotate = !0,
|
|
40606
|
-
textStyle = {},
|
|
40607
|
-
background = {},
|
|
40608
|
-
formatMethod: formatMethod,
|
|
40609
|
-
text: textContent = "",
|
|
40610
|
-
maxWidth: maxWidth
|
|
40611
|
-
} = _c,
|
|
40612
|
-
restAttrs = __rest$b(_c, ["position", "space", "autoRotate", "textStyle", "background", "formatMethod", "text", "maxWidth"]),
|
|
40613
|
-
point = this.getTickCoord(0);
|
|
40614
|
-
"bottom" === orient || "top" === orient ? point.x = position : point.y = position;
|
|
40615
|
-
let tickLength = 0;
|
|
40616
|
-
(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));
|
|
40617
|
-
const offset = tickLength + 0 + space,
|
|
40618
|
-
labelPoint = this.getVerticalCoord(point, offset, !1),
|
|
40619
|
-
vector = this.getVerticalVector(offset, !1, {
|
|
40620
|
-
x: 0,
|
|
40621
|
-
y: 0
|
|
40622
|
-
});
|
|
40623
|
-
let textBaseline,
|
|
40624
|
-
{
|
|
40625
|
-
angle: angle
|
|
40626
|
-
} = restAttrs,
|
|
40627
|
-
textAlign = "center";
|
|
40628
|
-
if (isNil$1(angle) && autoRotate) {
|
|
40629
|
-
const axisVector = this.getRelativeVector();
|
|
40630
|
-
angle = angleTo(axisVector, [1, 0], !0);
|
|
40631
|
-
const {
|
|
40632
|
-
verticalFactor = 1
|
|
40633
|
-
} = this.attribute;
|
|
40634
|
-
textBaseline = 1 === -1 * verticalFactor ? "bottom" : "top";
|
|
40635
|
-
} else {
|
|
40636
|
-
const {
|
|
40637
|
-
textAlign: textAlign2,
|
|
40638
|
-
textBaseline: textBaseline2
|
|
40639
|
-
} = this.getLabelAlign(vector, !1, textStyle.angle);
|
|
40640
|
-
textAlign = textAlign2, textBaseline = textBaseline2;
|
|
40641
|
-
}
|
|
40642
|
-
const maxTagWidth = maxWidth,
|
|
40643
|
-
text = formatMethod ? formatMethod(textContent) : textContent,
|
|
40644
|
-
attrs = Object.assign(Object.assign(Object.assign({}, labelPoint), restAttrs), {
|
|
40645
|
-
maxWidth: maxTagWidth,
|
|
40646
|
-
textStyle: Object.assign({
|
|
40647
|
-
textAlign: textAlign,
|
|
40648
|
-
textBaseline: textBaseline
|
|
40649
|
-
}, textStyle),
|
|
40650
|
-
text: text
|
|
40651
|
-
});
|
|
40652
|
-
return attrs.angle = angle, background && background.visible && (attrs.panel = Object.assign(Object.assign({
|
|
40653
|
-
visible: !0
|
|
40654
|
-
}, restAttrs.panel), background.style)), attrs;
|
|
40655
|
-
}
|
|
40656
40557
|
getTextBaseline(vector, inside) {
|
|
40657
40558
|
let base = "middle";
|
|
40658
40559
|
const {
|
|
@@ -40843,41 +40744,6 @@ class LineAxis extends AxisBase {
|
|
|
40843
40744
|
}
|
|
40844
40745
|
return limitLength && (limitLength = (limitLength - labelSpace - titleSpacing - titleHeight - axisLineWidth - tickLength) / layerCount), limitLength;
|
|
40845
40746
|
}
|
|
40846
|
-
showLabelHoverOnAxis(position, text) {
|
|
40847
|
-
let adjustPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
40848
|
-
if (this.attribute.labelHoverOnAxis) {
|
|
40849
|
-
const preContainerBounds = this.axisContainer.AABBBounds,
|
|
40850
|
-
preWidth = preContainerBounds.width(),
|
|
40851
|
-
preHeight = preContainerBounds.height(),
|
|
40852
|
-
preX1 = preContainerBounds.x1,
|
|
40853
|
-
preY1 = preContainerBounds.y1,
|
|
40854
|
-
preX2 = preContainerBounds.x2,
|
|
40855
|
-
preY2 = preContainerBounds.y2;
|
|
40856
|
-
if (this.labelHoverOnAxisGroup) {
|
|
40857
|
-
const {
|
|
40858
|
-
formatMethod: formatMethod
|
|
40859
|
-
} = this.attribute.labelHoverOnAxis,
|
|
40860
|
-
textStr = formatMethod ? formatMethod(text) : text;
|
|
40861
|
-
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({
|
|
40862
|
-
y: position
|
|
40863
|
-
}) : this.labelHoverOnAxisGroup.setAttributes({
|
|
40864
|
-
x: position
|
|
40865
|
-
});
|
|
40866
|
-
} else this.attribute.labelHoverOnAxis.visible = !0, this.attribute.labelHoverOnAxis.position = position, this.attribute.labelHoverOnAxis.text = text, this.renderLabelHoverOnAxis();
|
|
40867
|
-
if (adjustPosition) {
|
|
40868
|
-
const afterContainerBounds = this.axisContainer.AABBBounds,
|
|
40869
|
-
diffWidth = afterContainerBounds.width() - preWidth,
|
|
40870
|
-
diffHeight = afterContainerBounds.height() - preHeight;
|
|
40871
|
-
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)), 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));
|
|
40872
|
-
}
|
|
40873
|
-
}
|
|
40874
|
-
}
|
|
40875
|
-
hideLabelHoverOnAxis() {
|
|
40876
|
-
this.attribute.labelHoverOnAxis && this.labelHoverOnAxisGroup && this.labelHoverOnAxisGroup.setAttributes({
|
|
40877
|
-
visible: !1,
|
|
40878
|
-
visibleAll: !1
|
|
40879
|
-
});
|
|
40880
|
-
}
|
|
40881
40747
|
release() {
|
|
40882
40748
|
super.release(), this._breaks = null;
|
|
40883
40749
|
}
|
|
@@ -42059,7 +41925,7 @@ const polarAngleAxisDiscreteTicks = (scale, op) => {
|
|
|
42059
41925
|
labelStyle: labelStyle
|
|
42060
41926
|
} = op,
|
|
42061
41927
|
radius = null == getRadius ? void 0 : getRadius();
|
|
42062
|
-
if (!radius) return convertDomainToTickData(scale.domain());
|
|
41928
|
+
if (!radius || radius <= 0) return convertDomainToTickData(scale.domain());
|
|
42063
41929
|
let scaleTicks;
|
|
42064
41930
|
if (isValid$1(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$1(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$1(tickCount)) {
|
|
42065
41931
|
const range = scale.range(),
|
|
@@ -52952,7 +52818,7 @@ TableSeriesNumber.defaultAttributes = {
|
|
|
52952
52818
|
select: !0
|
|
52953
52819
|
};
|
|
52954
52820
|
|
|
52955
|
-
const version = "1.0.27
|
|
52821
|
+
const version = "1.0.27";
|
|
52956
52822
|
preLoadAllModule();
|
|
52957
52823
|
if (isBrowserEnv()) {
|
|
52958
52824
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -39330,7 +39330,7 @@
|
|
|
39330
39330
|
|
|
39331
39331
|
exports.AXIS_ELEMENT_NAME = void 0;
|
|
39332
39332
|
!function (AXIS_ELEMENT_NAME) {
|
|
39333
|
-
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.
|
|
39333
|
+
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";
|
|
39334
39334
|
}(exports.AXIS_ELEMENT_NAME || (exports.AXIS_ELEMENT_NAME = {}));
|
|
39335
39335
|
exports.AxisStateValue = void 0;
|
|
39336
39336
|
!function (AxisStateValue) {
|
|
@@ -39367,26 +39367,6 @@
|
|
|
39367
39367
|
fillOpacity: 1
|
|
39368
39368
|
}
|
|
39369
39369
|
},
|
|
39370
|
-
labelHoverOnAxis: {
|
|
39371
|
-
visible: !1,
|
|
39372
|
-
space: 7,
|
|
39373
|
-
padding: 2,
|
|
39374
|
-
position: 0,
|
|
39375
|
-
autoRotate: !1,
|
|
39376
|
-
textStyle: {
|
|
39377
|
-
fontSize: 12,
|
|
39378
|
-
fill: "red",
|
|
39379
|
-
fontWeight: "normal",
|
|
39380
|
-
fillOpacity: 1
|
|
39381
|
-
},
|
|
39382
|
-
background: {
|
|
39383
|
-
visible: !0,
|
|
39384
|
-
style: {
|
|
39385
|
-
cornerRadius: 2,
|
|
39386
|
-
fill: "black"
|
|
39387
|
-
}
|
|
39388
|
-
}
|
|
39389
|
-
},
|
|
39390
39370
|
tick: {
|
|
39391
39371
|
visible: !0,
|
|
39392
39372
|
inside: !1,
|
|
@@ -40378,17 +40358,7 @@
|
|
|
40378
40358
|
loadLineAxisComponent();
|
|
40379
40359
|
class LineAxis extends AxisBase {
|
|
40380
40360
|
constructor(attributes, options) {
|
|
40381
|
-
|
|
40382
|
-
if (attributes.labelHoverOnAxis && (attributes.labelHoverOnAxis.textStyle = Object.assign({}, attributes.label.style, attributes.labelHoverOnAxis.textStyle), void 0 === attributes.labelHoverOnAxis.space)) {
|
|
40383
|
-
const {
|
|
40384
|
-
padding = 2
|
|
40385
|
-
} = attributes.labelHoverOnAxis,
|
|
40386
|
-
parsedPadding = normalizePadding(padding),
|
|
40387
|
-
toDiffPadding = "bottom" === attributes.orient ? parsedPadding[0] : "left" === attributes.orient ? parsedPadding[1] : "top" === attributes.orient ? parsedPadding[2] : parsedPadding[3],
|
|
40388
|
-
space = (null !== (_a = attributes.label.space) && void 0 !== _a ? _a : LineAxis.defaultAttributes.label.space) - toDiffPadding;
|
|
40389
|
-
attributes.labelHoverOnAxis.space = space;
|
|
40390
|
-
}
|
|
40391
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options), this.labelHoverOnAxisGroup = null;
|
|
40361
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options);
|
|
40392
40362
|
}
|
|
40393
40363
|
_renderInner(container) {
|
|
40394
40364
|
var _a;
|
|
@@ -40450,15 +40420,6 @@
|
|
|
40450
40420
|
}, panel.style));
|
|
40451
40421
|
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);
|
|
40452
40422
|
}
|
|
40453
|
-
const {
|
|
40454
|
-
labelHoverOnAxis: labelHoverOnAxis
|
|
40455
|
-
} = this.attribute;
|
|
40456
|
-
labelHoverOnAxis && labelHoverOnAxis.visible && this.renderLabelHoverOnAxis();
|
|
40457
|
-
}
|
|
40458
|
-
renderLabelHoverOnAxis() {
|
|
40459
|
-
const hoverOnLabelAttributes = this.getLabelHoverOnAxisAttribute(),
|
|
40460
|
-
hoverOnLabel = new Tag(Object.assign({}, hoverOnLabelAttributes));
|
|
40461
|
-
hoverOnLabel.name = exports.AXIS_ELEMENT_NAME.title, hoverOnLabel.id = this._getNodeId("hover-on-label"), this.labelHoverOnAxisGroup = hoverOnLabel, this.axisContainer.add(hoverOnLabel);
|
|
40462
40423
|
}
|
|
40463
40424
|
renderLine(container) {
|
|
40464
40425
|
const {
|
|
@@ -40599,66 +40560,6 @@
|
|
|
40599
40560
|
visible: !0
|
|
40600
40561
|
}, background.style)), attrs;
|
|
40601
40562
|
}
|
|
40602
|
-
getLabelHoverOnAxisAttribute() {
|
|
40603
|
-
var _a, _b;
|
|
40604
|
-
const {
|
|
40605
|
-
orient: orient
|
|
40606
|
-
} = this.attribute,
|
|
40607
|
-
_c = this.attribute.labelHoverOnAxis,
|
|
40608
|
-
{
|
|
40609
|
-
position = 0,
|
|
40610
|
-
space = 4,
|
|
40611
|
-
autoRotate = !0,
|
|
40612
|
-
textStyle = {},
|
|
40613
|
-
background = {},
|
|
40614
|
-
formatMethod: formatMethod,
|
|
40615
|
-
text: textContent = "",
|
|
40616
|
-
maxWidth: maxWidth
|
|
40617
|
-
} = _c,
|
|
40618
|
-
restAttrs = __rest$b(_c, ["position", "space", "autoRotate", "textStyle", "background", "formatMethod", "text", "maxWidth"]),
|
|
40619
|
-
point = this.getTickCoord(0);
|
|
40620
|
-
"bottom" === orient || "top" === orient ? point.x = position : point.y = position;
|
|
40621
|
-
let tickLength = 0;
|
|
40622
|
-
(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));
|
|
40623
|
-
const offset = tickLength + 0 + space,
|
|
40624
|
-
labelPoint = this.getVerticalCoord(point, offset, !1),
|
|
40625
|
-
vector = this.getVerticalVector(offset, !1, {
|
|
40626
|
-
x: 0,
|
|
40627
|
-
y: 0
|
|
40628
|
-
});
|
|
40629
|
-
let textBaseline,
|
|
40630
|
-
{
|
|
40631
|
-
angle: angle
|
|
40632
|
-
} = restAttrs,
|
|
40633
|
-
textAlign = "center";
|
|
40634
|
-
if (isNil$1(angle) && autoRotate) {
|
|
40635
|
-
const axisVector = this.getRelativeVector();
|
|
40636
|
-
angle = angleTo(axisVector, [1, 0], !0);
|
|
40637
|
-
const {
|
|
40638
|
-
verticalFactor = 1
|
|
40639
|
-
} = this.attribute;
|
|
40640
|
-
textBaseline = 1 === -1 * verticalFactor ? "bottom" : "top";
|
|
40641
|
-
} else {
|
|
40642
|
-
const {
|
|
40643
|
-
textAlign: textAlign2,
|
|
40644
|
-
textBaseline: textBaseline2
|
|
40645
|
-
} = this.getLabelAlign(vector, !1, textStyle.angle);
|
|
40646
|
-
textAlign = textAlign2, textBaseline = textBaseline2;
|
|
40647
|
-
}
|
|
40648
|
-
const maxTagWidth = maxWidth,
|
|
40649
|
-
text = formatMethod ? formatMethod(textContent) : textContent,
|
|
40650
|
-
attrs = Object.assign(Object.assign(Object.assign({}, labelPoint), restAttrs), {
|
|
40651
|
-
maxWidth: maxTagWidth,
|
|
40652
|
-
textStyle: Object.assign({
|
|
40653
|
-
textAlign: textAlign,
|
|
40654
|
-
textBaseline: textBaseline
|
|
40655
|
-
}, textStyle),
|
|
40656
|
-
text: text
|
|
40657
|
-
});
|
|
40658
|
-
return attrs.angle = angle, background && background.visible && (attrs.panel = Object.assign(Object.assign({
|
|
40659
|
-
visible: !0
|
|
40660
|
-
}, restAttrs.panel), background.style)), attrs;
|
|
40661
|
-
}
|
|
40662
40563
|
getTextBaseline(vector, inside) {
|
|
40663
40564
|
let base = "middle";
|
|
40664
40565
|
const {
|
|
@@ -40849,41 +40750,6 @@
|
|
|
40849
40750
|
}
|
|
40850
40751
|
return limitLength && (limitLength = (limitLength - labelSpace - titleSpacing - titleHeight - axisLineWidth - tickLength) / layerCount), limitLength;
|
|
40851
40752
|
}
|
|
40852
|
-
showLabelHoverOnAxis(position, text) {
|
|
40853
|
-
let adjustPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
40854
|
-
if (this.attribute.labelHoverOnAxis) {
|
|
40855
|
-
const preContainerBounds = this.axisContainer.AABBBounds,
|
|
40856
|
-
preWidth = preContainerBounds.width(),
|
|
40857
|
-
preHeight = preContainerBounds.height(),
|
|
40858
|
-
preX1 = preContainerBounds.x1,
|
|
40859
|
-
preY1 = preContainerBounds.y1,
|
|
40860
|
-
preX2 = preContainerBounds.x2,
|
|
40861
|
-
preY2 = preContainerBounds.y2;
|
|
40862
|
-
if (this.labelHoverOnAxisGroup) {
|
|
40863
|
-
const {
|
|
40864
|
-
formatMethod: formatMethod
|
|
40865
|
-
} = this.attribute.labelHoverOnAxis,
|
|
40866
|
-
textStr = formatMethod ? formatMethod(text) : text;
|
|
40867
|
-
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({
|
|
40868
|
-
y: position
|
|
40869
|
-
}) : this.labelHoverOnAxisGroup.setAttributes({
|
|
40870
|
-
x: position
|
|
40871
|
-
});
|
|
40872
|
-
} else this.attribute.labelHoverOnAxis.visible = !0, this.attribute.labelHoverOnAxis.position = position, this.attribute.labelHoverOnAxis.text = text, this.renderLabelHoverOnAxis();
|
|
40873
|
-
if (adjustPosition) {
|
|
40874
|
-
const afterContainerBounds = this.axisContainer.AABBBounds,
|
|
40875
|
-
diffWidth = afterContainerBounds.width() - preWidth,
|
|
40876
|
-
diffHeight = afterContainerBounds.height() - preHeight;
|
|
40877
|
-
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)), 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));
|
|
40878
|
-
}
|
|
40879
|
-
}
|
|
40880
|
-
}
|
|
40881
|
-
hideLabelHoverOnAxis() {
|
|
40882
|
-
this.attribute.labelHoverOnAxis && this.labelHoverOnAxisGroup && this.labelHoverOnAxisGroup.setAttributes({
|
|
40883
|
-
visible: !1,
|
|
40884
|
-
visibleAll: !1
|
|
40885
|
-
});
|
|
40886
|
-
}
|
|
40887
40753
|
release() {
|
|
40888
40754
|
super.release(), this._breaks = null;
|
|
40889
40755
|
}
|
|
@@ -42065,7 +41931,7 @@
|
|
|
42065
41931
|
labelStyle: labelStyle
|
|
42066
41932
|
} = op,
|
|
42067
41933
|
radius = null == getRadius ? void 0 : getRadius();
|
|
42068
|
-
if (!radius) return convertDomainToTickData(scale.domain());
|
|
41934
|
+
if (!radius || radius <= 0) return convertDomainToTickData(scale.domain());
|
|
42069
41935
|
let scaleTicks;
|
|
42070
41936
|
if (isValid$1(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$1(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$1(tickCount)) {
|
|
42071
41937
|
const range = scale.range(),
|
|
@@ -52958,7 +52824,7 @@
|
|
|
52958
52824
|
select: !0
|
|
52959
52825
|
};
|
|
52960
52826
|
|
|
52961
|
-
const version = "1.0.27
|
|
52827
|
+
const version = "1.0.27";
|
|
52962
52828
|
preLoadAllModule();
|
|
52963
52829
|
if (isBrowserEnv()) {
|
|
52964
52830
|
loadBrowserEnv(container);
|