@visactor/vrender 0.20.16 → 0.20.17
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 +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +13 -7
- package/dist/index.js +13 -7
- 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 +4 -4
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,7 +21,7 @@ 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");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.20.
|
|
24
|
+
exports.version = "0.20.17", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
|
|
25
25
|
vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
|
|
26
26
|
vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
|
|
27
27
|
(0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,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;AAEnB,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;AACtB,yDAAuC;AACvC,yDAAuC","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 } 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';\n// 导出版本号\nexport const version = \"0.20.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,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;AAEnB,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;AACtB,yDAAuC;AACvC,yDAAuC","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 } 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';\n// 导出版本号\nexport const version = \"0.20.17\";\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();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -1696,7 +1696,9 @@ class TextMeasure {
|
|
|
1696
1696
|
} = this.textSpec;
|
|
1697
1697
|
return {
|
|
1698
1698
|
width: metrics.width,
|
|
1699
|
-
height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize
|
|
1699
|
+
height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize,
|
|
1700
|
+
fontBoundingBoxAscent: metrics.fontBoundingBoxAscent,
|
|
1701
|
+
fontBoundingBoxDescent: metrics.fontBoundingBoxDescent
|
|
1700
1702
|
};
|
|
1701
1703
|
}
|
|
1702
1704
|
quickMeasure(text) {
|
|
@@ -1710,7 +1712,7 @@ class TextMeasure {
|
|
|
1710
1712
|
for (let i = 0; i < text.length; i++) {
|
|
1711
1713
|
const char = text[i];
|
|
1712
1714
|
let size = this._measureSpecialChar(char);
|
|
1713
|
-
isNil$1(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$1(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$1(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height);
|
|
1715
|
+
isNil$1(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$1(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$1(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height), !isNil$1(size.fontBoundingBoxAscent) && (totalSize.fontBoundingBoxAscent = size.fontBoundingBoxAscent), !isNil$1(size.fontBoundingBoxDescent) && (totalSize.fontBoundingBoxDescent = size.fontBoundingBoxDescent);
|
|
1714
1716
|
}
|
|
1715
1717
|
return totalSize;
|
|
1716
1718
|
}
|
|
@@ -1759,7 +1761,9 @@ class TextMeasure {
|
|
|
1759
1761
|
const numberBounds = this._standardMethod(TextMeasure.NUMBERS_CHAR_SET);
|
|
1760
1762
|
this._numberCharSize = {
|
|
1761
1763
|
width: numberBounds.width / TextMeasure.NUMBERS_CHAR_SET.length,
|
|
1762
|
-
height: numberBounds.height
|
|
1764
|
+
height: numberBounds.height,
|
|
1765
|
+
fontBoundingBoxAscent: numberBounds.fontBoundingBoxAscent,
|
|
1766
|
+
fontBoundingBoxDescent: numberBounds.fontBoundingBoxDescent
|
|
1763
1767
|
};
|
|
1764
1768
|
}
|
|
1765
1769
|
return this._numberCharSize;
|
|
@@ -1772,7 +1776,9 @@ class TextMeasure {
|
|
|
1772
1776
|
const alphabetBounds = this._standardMethod(TextMeasure.ALPHABET_CHAR_SET);
|
|
1773
1777
|
this._letterCharSize = {
|
|
1774
1778
|
width: alphabetBounds.width / TextMeasure.ALPHABET_CHAR_SET.length,
|
|
1775
|
-
height: alphabetBounds.height
|
|
1779
|
+
height: alphabetBounds.height,
|
|
1780
|
+
fontBoundingBoxAscent: alphabetBounds.fontBoundingBoxAscent,
|
|
1781
|
+
fontBoundingBoxDescent: alphabetBounds.fontBoundingBoxDescent
|
|
1776
1782
|
};
|
|
1777
1783
|
}
|
|
1778
1784
|
return this._letterCharSize;
|
|
@@ -12685,7 +12691,7 @@ function drawEachCurve(path, curve, lastCurve, defined0, offsetX, offsetY, offse
|
|
|
12685
12691
|
originP2: originP2
|
|
12686
12692
|
} = curve;
|
|
12687
12693
|
let validP;
|
|
12688
|
-
if (originP1 && !1 !== originP1.defined ? validP = p0 : originP1 && !1 !== originP2.defined && (validP = null !== (_a = curve.p3) && void 0 !== _a ? _a : curve.p1), defined0) {
|
|
12694
|
+
if (originP1 && !1 !== originP1.defined && !lastCurve ? validP = p0 : originP1 && !1 !== originP2.defined && (validP = null !== (_a = curve.p3) && void 0 !== _a ? _a : curve.p1), defined0) {
|
|
12689
12695
|
newDefined0 = !defined0;
|
|
12690
12696
|
const x = validP ? validP.x : curve.p0.x,
|
|
12691
12697
|
y = validP ? validP.y : curve.p0.y;
|
|
@@ -16677,7 +16683,7 @@ class Wrapper {
|
|
|
16677
16683
|
}
|
|
16678
16684
|
}
|
|
16679
16685
|
|
|
16680
|
-
const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", "fill", "stroke", "fontSize", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16686
|
+
const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", "fill", "stroke", "fontSize", "fontFamily", "fontStyle", "fontWeight", "lineWidth", "opacity", "fillOpacity", "strokeOpacity", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16681
16687
|
class RichText extends Graphic {
|
|
16682
16688
|
constructor(params) {
|
|
16683
16689
|
super(params), this.type = "richtext", this._currentHoverIcon = null, this.numberType = RICHTEXT_NUMBER_TYPE, this.onBeforeAttributeUpdate = (val, attributes, key) => {
|
|
@@ -28629,7 +28635,7 @@ const registerWrapText = _registerWrapText;
|
|
|
28629
28635
|
|
|
28630
28636
|
const roughModule = _roughModule;
|
|
28631
28637
|
|
|
28632
|
-
const version = "0.20.
|
|
28638
|
+
const version = "0.20.17";
|
|
28633
28639
|
preLoadAllModule();
|
|
28634
28640
|
if (isBrowserEnv()) {
|
|
28635
28641
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -1702,7 +1702,9 @@
|
|
|
1702
1702
|
} = this.textSpec;
|
|
1703
1703
|
return {
|
|
1704
1704
|
width: metrics.width,
|
|
1705
|
-
height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize
|
|
1705
|
+
height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize,
|
|
1706
|
+
fontBoundingBoxAscent: metrics.fontBoundingBoxAscent,
|
|
1707
|
+
fontBoundingBoxDescent: metrics.fontBoundingBoxDescent
|
|
1706
1708
|
};
|
|
1707
1709
|
}
|
|
1708
1710
|
quickMeasure(text) {
|
|
@@ -1716,7 +1718,7 @@
|
|
|
1716
1718
|
for (let i = 0; i < text.length; i++) {
|
|
1717
1719
|
const char = text[i];
|
|
1718
1720
|
let size = this._measureSpecialChar(char);
|
|
1719
|
-
isNil$1(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$1(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$1(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height);
|
|
1721
|
+
isNil$1(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$1(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$1(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height), !isNil$1(size.fontBoundingBoxAscent) && (totalSize.fontBoundingBoxAscent = size.fontBoundingBoxAscent), !isNil$1(size.fontBoundingBoxDescent) && (totalSize.fontBoundingBoxDescent = size.fontBoundingBoxDescent);
|
|
1720
1722
|
}
|
|
1721
1723
|
return totalSize;
|
|
1722
1724
|
}
|
|
@@ -1765,7 +1767,9 @@
|
|
|
1765
1767
|
const numberBounds = this._standardMethod(TextMeasure.NUMBERS_CHAR_SET);
|
|
1766
1768
|
this._numberCharSize = {
|
|
1767
1769
|
width: numberBounds.width / TextMeasure.NUMBERS_CHAR_SET.length,
|
|
1768
|
-
height: numberBounds.height
|
|
1770
|
+
height: numberBounds.height,
|
|
1771
|
+
fontBoundingBoxAscent: numberBounds.fontBoundingBoxAscent,
|
|
1772
|
+
fontBoundingBoxDescent: numberBounds.fontBoundingBoxDescent
|
|
1769
1773
|
};
|
|
1770
1774
|
}
|
|
1771
1775
|
return this._numberCharSize;
|
|
@@ -1778,7 +1782,9 @@
|
|
|
1778
1782
|
const alphabetBounds = this._standardMethod(TextMeasure.ALPHABET_CHAR_SET);
|
|
1779
1783
|
this._letterCharSize = {
|
|
1780
1784
|
width: alphabetBounds.width / TextMeasure.ALPHABET_CHAR_SET.length,
|
|
1781
|
-
height: alphabetBounds.height
|
|
1785
|
+
height: alphabetBounds.height,
|
|
1786
|
+
fontBoundingBoxAscent: alphabetBounds.fontBoundingBoxAscent,
|
|
1787
|
+
fontBoundingBoxDescent: alphabetBounds.fontBoundingBoxDescent
|
|
1782
1788
|
};
|
|
1783
1789
|
}
|
|
1784
1790
|
return this._letterCharSize;
|
|
@@ -12691,7 +12697,7 @@
|
|
|
12691
12697
|
originP2: originP2
|
|
12692
12698
|
} = curve;
|
|
12693
12699
|
let validP;
|
|
12694
|
-
if (originP1 && !1 !== originP1.defined ? validP = p0 : originP1 && !1 !== originP2.defined && (validP = null !== (_a = curve.p3) && void 0 !== _a ? _a : curve.p1), defined0) {
|
|
12700
|
+
if (originP1 && !1 !== originP1.defined && !lastCurve ? validP = p0 : originP1 && !1 !== originP2.defined && (validP = null !== (_a = curve.p3) && void 0 !== _a ? _a : curve.p1), defined0) {
|
|
12695
12701
|
newDefined0 = !defined0;
|
|
12696
12702
|
const x = validP ? validP.x : curve.p0.x,
|
|
12697
12703
|
y = validP ? validP.y : curve.p0.y;
|
|
@@ -16683,7 +16689,7 @@
|
|
|
16683
16689
|
}
|
|
16684
16690
|
}
|
|
16685
16691
|
|
|
16686
|
-
const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", "fill", "stroke", "fontSize", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16692
|
+
const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", "fill", "stroke", "fontSize", "fontFamily", "fontStyle", "fontWeight", "lineWidth", "opacity", "fillOpacity", "strokeOpacity", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16687
16693
|
class RichText extends Graphic {
|
|
16688
16694
|
constructor(params) {
|
|
16689
16695
|
super(params), this.type = "richtext", this._currentHoverIcon = null, this.numberType = RICHTEXT_NUMBER_TYPE, this.onBeforeAttributeUpdate = (val, attributes, key) => {
|
|
@@ -28635,7 +28641,7 @@
|
|
|
28635
28641
|
|
|
28636
28642
|
const roughModule = _roughModule;
|
|
28637
28643
|
|
|
28638
|
-
const version = "0.20.
|
|
28644
|
+
const version = "0.20.17";
|
|
28639
28645
|
preLoadAllModule();
|
|
28640
28646
|
if (isBrowserEnv()) {
|
|
28641
28647
|
loadBrowserEnv(container);
|