@visactor/vrender 1.0.25-alpha.0 → 1.0.25
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 +645 -684
- package/dist/index.js +645 -684
- 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/dist/index.es.js
CHANGED
|
@@ -21673,42 +21673,41 @@ const registerFlexLayoutPlugin = () => {
|
|
|
21673
21673
|
|
|
21674
21674
|
function t(t, e, s) {
|
|
21675
21675
|
if (t && t.length) {
|
|
21676
|
-
const [n,
|
|
21677
|
-
|
|
21678
|
-
h = Math.cos(
|
|
21679
|
-
r = Math.sin(
|
|
21680
|
-
|
|
21681
|
-
const [
|
|
21682
|
-
|
|
21683
|
-
}
|
|
21676
|
+
const [n, o] = e,
|
|
21677
|
+
a = Math.PI / 180 * s,
|
|
21678
|
+
h = Math.cos(a),
|
|
21679
|
+
r = Math.sin(a);
|
|
21680
|
+
for (const e of t) {
|
|
21681
|
+
const [t, s] = e;
|
|
21682
|
+
e[0] = (t - n) * h - (s - o) * r + n, e[1] = (t - n) * r + (s - o) * h + o;
|
|
21683
|
+
}
|
|
21684
21684
|
}
|
|
21685
21685
|
}
|
|
21686
|
-
function e(t) {
|
|
21687
|
-
|
|
21688
|
-
s = t[1];
|
|
21689
|
-
return Math.sqrt(Math.pow(e[0] - s[0], 2) + Math.pow(e[1] - s[1], 2));
|
|
21686
|
+
function e(t, e) {
|
|
21687
|
+
return t[0] === e[0] && t[1] === e[1];
|
|
21690
21688
|
}
|
|
21691
|
-
function s(
|
|
21692
|
-
|
|
21693
|
-
|
|
21694
|
-
|
|
21695
|
-
|
|
21696
|
-
|
|
21697
|
-
|
|
21698
|
-
|
|
21699
|
-
|
|
21700
|
-
|
|
21701
|
-
|
|
21689
|
+
function s(s, n, o) {
|
|
21690
|
+
let a = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
21691
|
+
const h = o,
|
|
21692
|
+
r = Math.max(n, .1),
|
|
21693
|
+
i = s[0] && s[0][0] && "number" == typeof s[0][0] ? [s] : s,
|
|
21694
|
+
c = [0, 0];
|
|
21695
|
+
if (h) for (const e of i) t(e, c, h);
|
|
21696
|
+
const l = function (t, s, n) {
|
|
21697
|
+
const o = [];
|
|
21698
|
+
for (const s of t) {
|
|
21699
|
+
const t = [...s];
|
|
21700
|
+
e(t[0], t[t.length - 1]) || t.push([t[0][0], t[0][1]]), t.length > 2 && o.push(t);
|
|
21702
21701
|
}
|
|
21703
|
-
const n = [];
|
|
21704
|
-
e = Math.max(e, .1);
|
|
21705
21702
|
const a = [];
|
|
21706
|
-
|
|
21703
|
+
s = Math.max(s, .1);
|
|
21704
|
+
const h = [];
|
|
21705
|
+
for (const t of o) for (let e = 0; e < t.length - 1; e++) {
|
|
21707
21706
|
const s = t[e],
|
|
21708
21707
|
n = t[e + 1];
|
|
21709
21708
|
if (s[1] !== n[1]) {
|
|
21710
21709
|
const t = Math.min(s[1], n[1]);
|
|
21711
|
-
|
|
21710
|
+
h.push({
|
|
21712
21711
|
ymin: t,
|
|
21713
21712
|
ymax: Math.max(s[1], n[1]),
|
|
21714
21713
|
x: t === s[1] ? s[0] : n[0],
|
|
@@ -21716,43 +21715,52 @@ function s(e, s) {
|
|
|
21716
21715
|
});
|
|
21717
21716
|
}
|
|
21718
21717
|
}
|
|
21719
|
-
if (
|
|
21720
|
-
let
|
|
21721
|
-
|
|
21722
|
-
|
|
21723
|
-
|
|
21718
|
+
if (h.sort((t, e) => t.ymin < e.ymin ? -1 : t.ymin > e.ymin ? 1 : t.x < e.x ? -1 : t.x > e.x ? 1 : t.ymax === e.ymax ? 0 : (t.ymax - e.ymax) / Math.abs(t.ymax - e.ymax)), !h.length) return a;
|
|
21719
|
+
let r = [],
|
|
21720
|
+
i = h[0].ymin,
|
|
21721
|
+
c = 0;
|
|
21722
|
+
for (; r.length || h.length;) {
|
|
21723
|
+
if (h.length) {
|
|
21724
21724
|
let t = -1;
|
|
21725
|
-
for (let e = 0; e <
|
|
21726
|
-
|
|
21727
|
-
|
|
21728
|
-
s:
|
|
21725
|
+
for (let e = 0; e < h.length && !(h[e].ymin > i); e++) t = e;
|
|
21726
|
+
h.splice(0, t + 1).forEach(t => {
|
|
21727
|
+
r.push({
|
|
21728
|
+
s: i,
|
|
21729
21729
|
edge: t
|
|
21730
21730
|
});
|
|
21731
21731
|
});
|
|
21732
21732
|
}
|
|
21733
|
-
if (
|
|
21733
|
+
if (r = r.filter(t => !(t.edge.ymax <= i)), r.sort((t, e) => t.edge.x === e.edge.x ? 0 : (t.edge.x - e.edge.x) / Math.abs(t.edge.x - e.edge.x)), (1 !== n || c % s == 0) && r.length > 1) for (let t = 0; t < r.length; t += 2) {
|
|
21734
21734
|
const e = t + 1;
|
|
21735
|
-
if (e >=
|
|
21736
|
-
const s =
|
|
21737
|
-
|
|
21738
|
-
|
|
21735
|
+
if (e >= r.length) break;
|
|
21736
|
+
const s = r[t].edge,
|
|
21737
|
+
n = r[e].edge;
|
|
21738
|
+
a.push([[Math.round(s.x), i], [Math.round(n.x), i]]);
|
|
21739
21739
|
}
|
|
21740
|
-
|
|
21741
|
-
t.edge.x = t.edge.x +
|
|
21742
|
-
})
|
|
21740
|
+
i += n, r.forEach(t => {
|
|
21741
|
+
t.edge.x = t.edge.x + n * t.edge.islope;
|
|
21742
|
+
}), c++;
|
|
21743
21743
|
}
|
|
21744
|
-
return
|
|
21745
|
-
}(
|
|
21746
|
-
if (
|
|
21747
|
-
for (const
|
|
21744
|
+
return a;
|
|
21745
|
+
}(i, r, a);
|
|
21746
|
+
if (h) {
|
|
21747
|
+
for (const e of i) t(e, c, -h);
|
|
21748
21748
|
!function (e, s, n) {
|
|
21749
|
-
const
|
|
21750
|
-
e.forEach(t =>
|
|
21751
|
-
}(
|
|
21749
|
+
const o = [];
|
|
21750
|
+
e.forEach(t => o.push(...t)), t(o, s, n);
|
|
21751
|
+
}(l, c, -h);
|
|
21752
21752
|
}
|
|
21753
|
-
return
|
|
21753
|
+
return l;
|
|
21754
|
+
}
|
|
21755
|
+
function n(t, e) {
|
|
21756
|
+
var n;
|
|
21757
|
+
const o = e.hachureAngle + 90;
|
|
21758
|
+
let a = e.hachureGap;
|
|
21759
|
+
a < 0 && (a = 4 * e.strokeWidth), a = Math.round(Math.max(a, .1));
|
|
21760
|
+
let h = 1;
|
|
21761
|
+
return e.roughness >= 1 && ((null === (n = e.randomizer) || void 0 === n ? void 0 : n.next()) || Math.random()) > .7 && (h = a), s(t, a, o, h || 1);
|
|
21754
21762
|
}
|
|
21755
|
-
class
|
|
21763
|
+
class o {
|
|
21756
21764
|
constructor(t) {
|
|
21757
21765
|
this.helper = t;
|
|
21758
21766
|
}
|
|
@@ -21760,10 +21768,10 @@ class n {
|
|
|
21760
21768
|
return this._fillPolygons(t, e);
|
|
21761
21769
|
}
|
|
21762
21770
|
_fillPolygons(t, e) {
|
|
21763
|
-
const
|
|
21771
|
+
const s = n(t, e);
|
|
21764
21772
|
return {
|
|
21765
21773
|
type: "fillSketch",
|
|
21766
|
-
ops: this.renderLines(
|
|
21774
|
+
ops: this.renderLines(s, e)
|
|
21767
21775
|
};
|
|
21768
21776
|
}
|
|
21769
21777
|
renderLines(t, e) {
|
|
@@ -21772,143 +21780,148 @@ class n {
|
|
|
21772
21780
|
return s;
|
|
21773
21781
|
}
|
|
21774
21782
|
}
|
|
21775
|
-
|
|
21776
|
-
|
|
21777
|
-
|
|
21778
|
-
|
|
21779
|
-
|
|
21780
|
-
|
|
21783
|
+
function a(t) {
|
|
21784
|
+
const e = t[0],
|
|
21785
|
+
s = t[1];
|
|
21786
|
+
return Math.sqrt(Math.pow(e[0] - s[0], 2) + Math.pow(e[1] - s[1], 2));
|
|
21787
|
+
}
|
|
21788
|
+
class h extends o {
|
|
21789
|
+
fillPolygons(t, e) {
|
|
21790
|
+
let s = e.hachureGap;
|
|
21791
|
+
s < 0 && (s = 4 * e.strokeWidth), s = Math.max(s, .1);
|
|
21792
|
+
const o = n(t, Object.assign({}, e, {
|
|
21793
|
+
hachureGap: s
|
|
21781
21794
|
})),
|
|
21782
|
-
h = Math.PI / 180 *
|
|
21795
|
+
h = Math.PI / 180 * e.hachureAngle,
|
|
21783
21796
|
r = [],
|
|
21784
|
-
i = .5 *
|
|
21785
|
-
c = .5 *
|
|
21786
|
-
for (const [t,
|
|
21797
|
+
i = .5 * s * Math.cos(h),
|
|
21798
|
+
c = .5 * s * Math.sin(h);
|
|
21799
|
+
for (const [t, e] of o) a([t, e]) && r.push([[t[0] - i, t[1] + c], [...e]], [[t[0] + i, t[1] - c], [...e]]);
|
|
21787
21800
|
return {
|
|
21788
21801
|
type: "fillSketch",
|
|
21789
|
-
ops: this.renderLines(r,
|
|
21802
|
+
ops: this.renderLines(r, e)
|
|
21790
21803
|
};
|
|
21791
21804
|
}
|
|
21792
21805
|
}
|
|
21793
|
-
class
|
|
21806
|
+
class r extends o {
|
|
21794
21807
|
fillPolygons(t, e) {
|
|
21795
21808
|
const s = this._fillPolygons(t, e),
|
|
21796
21809
|
n = Object.assign({}, e, {
|
|
21797
21810
|
hachureAngle: e.hachureAngle + 90
|
|
21798
21811
|
}),
|
|
21799
|
-
|
|
21800
|
-
return s.ops = s.ops.concat(
|
|
21812
|
+
o = this._fillPolygons(t, n);
|
|
21813
|
+
return s.ops = s.ops.concat(o.ops), s;
|
|
21801
21814
|
}
|
|
21802
21815
|
}
|
|
21803
|
-
class
|
|
21816
|
+
class i {
|
|
21804
21817
|
constructor(t) {
|
|
21805
21818
|
this.helper = t;
|
|
21806
21819
|
}
|
|
21807
21820
|
fillPolygons(t, e) {
|
|
21808
|
-
const
|
|
21821
|
+
const s = n(t, e = Object.assign({}, e, {
|
|
21809
21822
|
hachureAngle: 0
|
|
21810
21823
|
}));
|
|
21811
|
-
return this.dotsOnLines(
|
|
21824
|
+
return this.dotsOnLines(s, e);
|
|
21812
21825
|
}
|
|
21813
|
-
dotsOnLines(t,
|
|
21814
|
-
const
|
|
21815
|
-
let
|
|
21816
|
-
|
|
21817
|
-
let o =
|
|
21818
|
-
o < 0 && (o =
|
|
21819
|
-
const h =
|
|
21826
|
+
dotsOnLines(t, e) {
|
|
21827
|
+
const s = [];
|
|
21828
|
+
let n = e.hachureGap;
|
|
21829
|
+
n < 0 && (n = 4 * e.strokeWidth), n = Math.max(n, .1);
|
|
21830
|
+
let o = e.fillWeight;
|
|
21831
|
+
o < 0 && (o = e.strokeWidth / 2);
|
|
21832
|
+
const h = n / 4;
|
|
21820
21833
|
for (const r of t) {
|
|
21821
|
-
const t =
|
|
21822
|
-
i = t /
|
|
21834
|
+
const t = a(r),
|
|
21835
|
+
i = t / n,
|
|
21823
21836
|
c = Math.ceil(i) - 1,
|
|
21824
|
-
l = t - c *
|
|
21825
|
-
u = (r[0][0] + r[1][0]) / 2 -
|
|
21837
|
+
l = t - c * n,
|
|
21838
|
+
u = (r[0][0] + r[1][0]) / 2 - n / 4,
|
|
21826
21839
|
p = Math.min(r[0][1], r[1][1]);
|
|
21827
21840
|
for (let t = 0; t < c; t++) {
|
|
21828
|
-
const
|
|
21841
|
+
const a = p + l + t * n,
|
|
21829
21842
|
r = u - h + 2 * Math.random() * h,
|
|
21830
|
-
i =
|
|
21831
|
-
c = this.helper.ellipse(r, i, o, o,
|
|
21832
|
-
|
|
21843
|
+
i = a - h + 2 * Math.random() * h,
|
|
21844
|
+
c = this.helper.ellipse(r, i, o, o, e);
|
|
21845
|
+
s.push(...c.ops);
|
|
21833
21846
|
}
|
|
21834
21847
|
}
|
|
21835
21848
|
return {
|
|
21836
21849
|
type: "fillSketch",
|
|
21837
|
-
ops:
|
|
21850
|
+
ops: s
|
|
21838
21851
|
};
|
|
21839
21852
|
}
|
|
21840
21853
|
}
|
|
21841
|
-
class
|
|
21854
|
+
class c {
|
|
21842
21855
|
constructor(t) {
|
|
21843
21856
|
this.helper = t;
|
|
21844
21857
|
}
|
|
21845
21858
|
fillPolygons(t, e) {
|
|
21846
|
-
const
|
|
21859
|
+
const s = n(t, e);
|
|
21847
21860
|
return {
|
|
21848
21861
|
type: "fillSketch",
|
|
21849
|
-
ops: this.dashedLine(
|
|
21862
|
+
ops: this.dashedLine(s, e)
|
|
21850
21863
|
};
|
|
21851
21864
|
}
|
|
21852
|
-
dashedLine(t,
|
|
21853
|
-
const
|
|
21854
|
-
|
|
21865
|
+
dashedLine(t, e) {
|
|
21866
|
+
const s = e.dashOffset < 0 ? e.hachureGap < 0 ? 4 * e.strokeWidth : e.hachureGap : e.dashOffset,
|
|
21867
|
+
n = e.dashGap < 0 ? e.hachureGap < 0 ? 4 * e.strokeWidth : e.hachureGap : e.dashGap,
|
|
21855
21868
|
o = [];
|
|
21856
21869
|
return t.forEach(t => {
|
|
21857
|
-
const h =
|
|
21858
|
-
r = Math.floor(h / (
|
|
21859
|
-
i = (h +
|
|
21870
|
+
const h = a(t),
|
|
21871
|
+
r = Math.floor(h / (s + n)),
|
|
21872
|
+
i = (h + n - r * (s + n)) / 2;
|
|
21860
21873
|
let c = t[0],
|
|
21861
21874
|
l = t[1];
|
|
21862
21875
|
c[0] > l[0] && (c = t[1], l = t[0]);
|
|
21863
21876
|
const u = Math.atan((l[1] - c[1]) / (l[0] - c[0]));
|
|
21864
21877
|
for (let t = 0; t < r; t++) {
|
|
21865
|
-
const
|
|
21866
|
-
h =
|
|
21867
|
-
r = [c[0] +
|
|
21878
|
+
const a = t * (s + n),
|
|
21879
|
+
h = a + s,
|
|
21880
|
+
r = [c[0] + a * Math.cos(u) + i * Math.cos(u), c[1] + a * Math.sin(u) + i * Math.sin(u)],
|
|
21868
21881
|
l = [c[0] + h * Math.cos(u) + i * Math.cos(u), c[1] + h * Math.sin(u) + i * Math.sin(u)];
|
|
21869
|
-
o.push(...this.helper.doubleLineOps(r[0], r[1], l[0], l[1],
|
|
21882
|
+
o.push(...this.helper.doubleLineOps(r[0], r[1], l[0], l[1], e));
|
|
21870
21883
|
}
|
|
21871
21884
|
}), o;
|
|
21872
21885
|
}
|
|
21873
21886
|
}
|
|
21874
|
-
class
|
|
21887
|
+
class l {
|
|
21875
21888
|
constructor(t) {
|
|
21876
21889
|
this.helper = t;
|
|
21877
21890
|
}
|
|
21878
21891
|
fillPolygons(t, e) {
|
|
21879
|
-
const
|
|
21880
|
-
|
|
21881
|
-
|
|
21882
|
-
hachureGap:
|
|
21892
|
+
const s = e.hachureGap < 0 ? 4 * e.strokeWidth : e.hachureGap,
|
|
21893
|
+
o = e.zigzagOffset < 0 ? s : e.zigzagOffset,
|
|
21894
|
+
a = n(t, e = Object.assign({}, e, {
|
|
21895
|
+
hachureGap: s + o
|
|
21883
21896
|
}));
|
|
21884
21897
|
return {
|
|
21885
21898
|
type: "fillSketch",
|
|
21886
|
-
ops: this.zigzagLines(
|
|
21899
|
+
ops: this.zigzagLines(a, o, e)
|
|
21887
21900
|
};
|
|
21888
21901
|
}
|
|
21889
|
-
zigzagLines(t,
|
|
21890
|
-
const
|
|
21902
|
+
zigzagLines(t, e, s) {
|
|
21903
|
+
const n = [];
|
|
21891
21904
|
return t.forEach(t => {
|
|
21892
|
-
const o =
|
|
21893
|
-
h = Math.round(o / (2 *
|
|
21905
|
+
const o = a(t),
|
|
21906
|
+
h = Math.round(o / (2 * e));
|
|
21894
21907
|
let r = t[0],
|
|
21895
21908
|
i = t[1];
|
|
21896
21909
|
r[0] > i[0] && (r = t[1], i = t[0]);
|
|
21897
21910
|
const c = Math.atan((i[1] - r[1]) / (i[0] - r[0]));
|
|
21898
21911
|
for (let t = 0; t < h; t++) {
|
|
21899
|
-
const
|
|
21900
|
-
|
|
21901
|
-
h = Math.sqrt(2 * Math.pow(
|
|
21902
|
-
i = [r[0] +
|
|
21903
|
-
l = [r[0] +
|
|
21912
|
+
const o = 2 * t * e,
|
|
21913
|
+
a = 2 * (t + 1) * e,
|
|
21914
|
+
h = Math.sqrt(2 * Math.pow(e, 2)),
|
|
21915
|
+
i = [r[0] + o * Math.cos(c), r[1] + o * Math.sin(c)],
|
|
21916
|
+
l = [r[0] + a * Math.cos(c), r[1] + a * Math.sin(c)],
|
|
21904
21917
|
u = [i[0] + h * Math.cos(c + Math.PI / 4), i[1] + h * Math.sin(c + Math.PI / 4)];
|
|
21905
|
-
|
|
21918
|
+
n.push(...this.helper.doubleLineOps(i[0], i[1], u[0], u[1], s), ...this.helper.doubleLineOps(u[0], u[1], l[0], l[1], s));
|
|
21906
21919
|
}
|
|
21907
|
-
}),
|
|
21920
|
+
}), n;
|
|
21908
21921
|
}
|
|
21909
21922
|
}
|
|
21910
|
-
const
|
|
21911
|
-
class
|
|
21923
|
+
const u = {};
|
|
21924
|
+
class p {
|
|
21912
21925
|
constructor(t) {
|
|
21913
21926
|
this.seed = t;
|
|
21914
21927
|
}
|
|
@@ -21916,113 +21929,116 @@ class l {
|
|
|
21916
21929
|
return this.seed ? (2 ** 31 - 1 & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31 : Math.random();
|
|
21917
21930
|
}
|
|
21918
21931
|
}
|
|
21919
|
-
const
|
|
21920
|
-
|
|
21921
|
-
|
|
21922
|
-
|
|
21923
|
-
|
|
21924
|
-
|
|
21925
|
-
|
|
21926
|
-
|
|
21927
|
-
|
|
21928
|
-
|
|
21929
|
-
|
|
21930
|
-
|
|
21931
|
-
|
|
21932
|
-
|
|
21933
|
-
|
|
21934
|
-
|
|
21935
|
-
|
|
21936
|
-
|
|
21937
|
-
|
|
21938
|
-
|
|
21939
|
-
|
|
21940
|
-
|
|
21941
|
-
|
|
21932
|
+
const f = 0,
|
|
21933
|
+
d = 1,
|
|
21934
|
+
g = 2,
|
|
21935
|
+
M = {
|
|
21936
|
+
A: 7,
|
|
21937
|
+
a: 7,
|
|
21938
|
+
C: 6,
|
|
21939
|
+
c: 6,
|
|
21940
|
+
H: 1,
|
|
21941
|
+
h: 1,
|
|
21942
|
+
L: 2,
|
|
21943
|
+
l: 2,
|
|
21944
|
+
M: 2,
|
|
21945
|
+
m: 2,
|
|
21946
|
+
Q: 4,
|
|
21947
|
+
q: 4,
|
|
21948
|
+
S: 4,
|
|
21949
|
+
s: 4,
|
|
21950
|
+
T: 2,
|
|
21951
|
+
t: 2,
|
|
21952
|
+
V: 1,
|
|
21953
|
+
v: 1,
|
|
21954
|
+
Z: 0,
|
|
21955
|
+
z: 0
|
|
21956
|
+
};
|
|
21957
|
+
function k(t, e) {
|
|
21942
21958
|
return t.type === e;
|
|
21943
21959
|
}
|
|
21944
|
-
function
|
|
21960
|
+
function b(t) {
|
|
21945
21961
|
const e = [],
|
|
21946
21962
|
s = function (t) {
|
|
21947
21963
|
const e = new Array();
|
|
21948
21964
|
for (; "" !== t;) if (t.match(/^([ \t\r\n,]+)/)) t = t.substr(RegExp.$1.length);else if (t.match(/^([aAcChHlLmMqQsStTvVzZ])/)) e[e.length] = {
|
|
21949
|
-
type:
|
|
21965
|
+
type: f,
|
|
21950
21966
|
text: RegExp.$1
|
|
21951
21967
|
}, t = t.substr(RegExp.$1.length);else {
|
|
21952
21968
|
if (!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/)) return [];
|
|
21953
21969
|
e[e.length] = {
|
|
21954
|
-
type:
|
|
21970
|
+
type: d,
|
|
21955
21971
|
text: `${parseFloat(RegExp.$1)}`
|
|
21956
21972
|
}, t = t.substr(RegExp.$1.length);
|
|
21957
21973
|
}
|
|
21958
21974
|
return e[e.length] = {
|
|
21959
|
-
type:
|
|
21975
|
+
type: g,
|
|
21960
21976
|
text: ""
|
|
21961
21977
|
}, e;
|
|
21962
21978
|
}(t);
|
|
21963
21979
|
let n = "BOD",
|
|
21964
|
-
|
|
21965
|
-
|
|
21966
|
-
for (; !
|
|
21980
|
+
o = 0,
|
|
21981
|
+
a = s[o];
|
|
21982
|
+
for (; !k(a, g);) {
|
|
21967
21983
|
let h = 0;
|
|
21968
21984
|
const r = [];
|
|
21969
21985
|
if ("BOD" === n) {
|
|
21970
|
-
if ("M" !==
|
|
21971
|
-
|
|
21972
|
-
} else
|
|
21973
|
-
if (!(
|
|
21974
|
-
for (let t =
|
|
21986
|
+
if ("M" !== a.text && "m" !== a.text) return b("M0,0" + t);
|
|
21987
|
+
o++, h = M[a.text], n = a.text;
|
|
21988
|
+
} else k(a, d) ? h = M[n] : (o++, h = M[a.text], n = a.text);
|
|
21989
|
+
if (!(o + h < s.length)) throw new Error("Path data ended short");
|
|
21990
|
+
for (let t = o; t < o + h; t++) {
|
|
21975
21991
|
const e = s[t];
|
|
21976
|
-
if (!
|
|
21992
|
+
if (!k(e, d)) throw new Error("Param not a number: " + n + "," + e.text);
|
|
21977
21993
|
r[r.length] = +e.text;
|
|
21978
21994
|
}
|
|
21979
|
-
if ("number" != typeof
|
|
21995
|
+
if ("number" != typeof M[n]) throw new Error("Bad segment: " + n);
|
|
21980
21996
|
{
|
|
21981
21997
|
const t = {
|
|
21982
21998
|
key: n,
|
|
21983
21999
|
data: r
|
|
21984
22000
|
};
|
|
21985
|
-
e.push(t),
|
|
22001
|
+
e.push(t), o += h, a = s[o], "M" === n && (n = "L"), "m" === n && (n = "l");
|
|
21986
22002
|
}
|
|
21987
22003
|
}
|
|
21988
22004
|
return e;
|
|
21989
22005
|
}
|
|
21990
|
-
function
|
|
22006
|
+
function y(t) {
|
|
21991
22007
|
let e = 0,
|
|
21992
22008
|
s = 0,
|
|
21993
22009
|
n = 0,
|
|
21994
|
-
|
|
21995
|
-
const
|
|
22010
|
+
o = 0;
|
|
22011
|
+
const a = [];
|
|
21996
22012
|
for (const {
|
|
21997
22013
|
key: h,
|
|
21998
22014
|
data: r
|
|
21999
22015
|
} of t) switch (h) {
|
|
22000
22016
|
case "M":
|
|
22001
|
-
|
|
22017
|
+
a.push({
|
|
22002
22018
|
key: "M",
|
|
22003
22019
|
data: [...r]
|
|
22004
|
-
}), [e, s] = r, [n,
|
|
22020
|
+
}), [e, s] = r, [n, o] = r;
|
|
22005
22021
|
break;
|
|
22006
22022
|
case "m":
|
|
22007
|
-
e += r[0], s += r[1],
|
|
22023
|
+
e += r[0], s += r[1], a.push({
|
|
22008
22024
|
key: "M",
|
|
22009
22025
|
data: [e, s]
|
|
22010
|
-
}), n = e,
|
|
22026
|
+
}), n = e, o = s;
|
|
22011
22027
|
break;
|
|
22012
22028
|
case "L":
|
|
22013
|
-
|
|
22029
|
+
a.push({
|
|
22014
22030
|
key: "L",
|
|
22015
22031
|
data: [...r]
|
|
22016
22032
|
}), [e, s] = r;
|
|
22017
22033
|
break;
|
|
22018
22034
|
case "l":
|
|
22019
|
-
e += r[0], s += r[1],
|
|
22035
|
+
e += r[0], s += r[1], a.push({
|
|
22020
22036
|
key: "L",
|
|
22021
22037
|
data: [e, s]
|
|
22022
22038
|
});
|
|
22023
22039
|
break;
|
|
22024
22040
|
case "C":
|
|
22025
|
-
|
|
22041
|
+
a.push({
|
|
22026
22042
|
key: "C",
|
|
22027
22043
|
data: [...r]
|
|
22028
22044
|
}), e = r[4], s = r[5];
|
|
@@ -22030,14 +22046,14 @@ function d(t) {
|
|
|
22030
22046
|
case "c":
|
|
22031
22047
|
{
|
|
22032
22048
|
const t = r.map((t, n) => n % 2 ? t + s : t + e);
|
|
22033
|
-
|
|
22049
|
+
a.push({
|
|
22034
22050
|
key: "C",
|
|
22035
22051
|
data: t
|
|
22036
22052
|
}), e = t[4], s = t[5];
|
|
22037
22053
|
break;
|
|
22038
22054
|
}
|
|
22039
22055
|
case "Q":
|
|
22040
|
-
|
|
22056
|
+
a.push({
|
|
22041
22057
|
key: "Q",
|
|
22042
22058
|
data: [...r]
|
|
22043
22059
|
}), e = r[2], s = r[3];
|
|
@@ -22045,50 +22061,50 @@ function d(t) {
|
|
|
22045
22061
|
case "q":
|
|
22046
22062
|
{
|
|
22047
22063
|
const t = r.map((t, n) => n % 2 ? t + s : t + e);
|
|
22048
|
-
|
|
22064
|
+
a.push({
|
|
22049
22065
|
key: "Q",
|
|
22050
22066
|
data: t
|
|
22051
22067
|
}), e = t[2], s = t[3];
|
|
22052
22068
|
break;
|
|
22053
22069
|
}
|
|
22054
22070
|
case "A":
|
|
22055
|
-
|
|
22071
|
+
a.push({
|
|
22056
22072
|
key: "A",
|
|
22057
22073
|
data: [...r]
|
|
22058
22074
|
}), e = r[5], s = r[6];
|
|
22059
22075
|
break;
|
|
22060
22076
|
case "a":
|
|
22061
|
-
e += r[5], s += r[6],
|
|
22077
|
+
e += r[5], s += r[6], a.push({
|
|
22062
22078
|
key: "A",
|
|
22063
22079
|
data: [r[0], r[1], r[2], r[3], r[4], e, s]
|
|
22064
22080
|
});
|
|
22065
22081
|
break;
|
|
22066
22082
|
case "H":
|
|
22067
|
-
|
|
22083
|
+
a.push({
|
|
22068
22084
|
key: "H",
|
|
22069
22085
|
data: [...r]
|
|
22070
22086
|
}), e = r[0];
|
|
22071
22087
|
break;
|
|
22072
22088
|
case "h":
|
|
22073
|
-
e += r[0],
|
|
22089
|
+
e += r[0], a.push({
|
|
22074
22090
|
key: "H",
|
|
22075
22091
|
data: [e]
|
|
22076
22092
|
});
|
|
22077
22093
|
break;
|
|
22078
22094
|
case "V":
|
|
22079
|
-
|
|
22095
|
+
a.push({
|
|
22080
22096
|
key: "V",
|
|
22081
22097
|
data: [...r]
|
|
22082
22098
|
}), s = r[0];
|
|
22083
22099
|
break;
|
|
22084
22100
|
case "v":
|
|
22085
|
-
s += r[0],
|
|
22101
|
+
s += r[0], a.push({
|
|
22086
22102
|
key: "V",
|
|
22087
22103
|
data: [s]
|
|
22088
22104
|
});
|
|
22089
22105
|
break;
|
|
22090
22106
|
case "S":
|
|
22091
|
-
|
|
22107
|
+
a.push({
|
|
22092
22108
|
key: "S",
|
|
22093
22109
|
data: [...r]
|
|
22094
22110
|
}), e = r[2], s = r[3];
|
|
@@ -22096,39 +22112,39 @@ function d(t) {
|
|
|
22096
22112
|
case "s":
|
|
22097
22113
|
{
|
|
22098
22114
|
const t = r.map((t, n) => n % 2 ? t + s : t + e);
|
|
22099
|
-
|
|
22115
|
+
a.push({
|
|
22100
22116
|
key: "S",
|
|
22101
22117
|
data: t
|
|
22102
22118
|
}), e = t[2], s = t[3];
|
|
22103
22119
|
break;
|
|
22104
22120
|
}
|
|
22105
22121
|
case "T":
|
|
22106
|
-
|
|
22122
|
+
a.push({
|
|
22107
22123
|
key: "T",
|
|
22108
22124
|
data: [...r]
|
|
22109
22125
|
}), e = r[0], s = r[1];
|
|
22110
22126
|
break;
|
|
22111
22127
|
case "t":
|
|
22112
|
-
e += r[0], s += r[1],
|
|
22128
|
+
e += r[0], s += r[1], a.push({
|
|
22113
22129
|
key: "T",
|
|
22114
22130
|
data: [e, s]
|
|
22115
22131
|
});
|
|
22116
22132
|
break;
|
|
22117
22133
|
case "Z":
|
|
22118
22134
|
case "z":
|
|
22119
|
-
|
|
22135
|
+
a.push({
|
|
22120
22136
|
key: "Z",
|
|
22121
22137
|
data: []
|
|
22122
|
-
}), e = n, s =
|
|
22138
|
+
}), e = n, s = o;
|
|
22123
22139
|
}
|
|
22124
|
-
return
|
|
22140
|
+
return a;
|
|
22125
22141
|
}
|
|
22126
|
-
function
|
|
22142
|
+
function m$2(t) {
|
|
22127
22143
|
const e = [];
|
|
22128
22144
|
let s = "",
|
|
22129
22145
|
n = 0,
|
|
22130
|
-
a = 0,
|
|
22131
22146
|
o = 0,
|
|
22147
|
+
a = 0,
|
|
22132
22148
|
h = 0,
|
|
22133
22149
|
r = 0,
|
|
22134
22150
|
i = 0;
|
|
@@ -22141,90 +22157,90 @@ function g(t) {
|
|
|
22141
22157
|
e.push({
|
|
22142
22158
|
key: "M",
|
|
22143
22159
|
data: [...l]
|
|
22144
|
-
}), [n,
|
|
22160
|
+
}), [n, o] = l, [a, h] = l;
|
|
22145
22161
|
break;
|
|
22146
22162
|
case "C":
|
|
22147
22163
|
e.push({
|
|
22148
22164
|
key: "C",
|
|
22149
22165
|
data: [...l]
|
|
22150
|
-
}), n = l[4],
|
|
22166
|
+
}), n = l[4], o = l[5], r = l[2], i = l[3];
|
|
22151
22167
|
break;
|
|
22152
22168
|
case "L":
|
|
22153
22169
|
e.push({
|
|
22154
22170
|
key: "L",
|
|
22155
22171
|
data: [...l]
|
|
22156
|
-
}), [n,
|
|
22172
|
+
}), [n, o] = l;
|
|
22157
22173
|
break;
|
|
22158
22174
|
case "H":
|
|
22159
22175
|
n = l[0], e.push({
|
|
22160
22176
|
key: "L",
|
|
22161
|
-
data: [n,
|
|
22177
|
+
data: [n, o]
|
|
22162
22178
|
});
|
|
22163
22179
|
break;
|
|
22164
22180
|
case "V":
|
|
22165
|
-
|
|
22181
|
+
o = l[0], e.push({
|
|
22166
22182
|
key: "L",
|
|
22167
|
-
data: [n,
|
|
22183
|
+
data: [n, o]
|
|
22168
22184
|
});
|
|
22169
22185
|
break;
|
|
22170
22186
|
case "S":
|
|
22171
22187
|
{
|
|
22172
22188
|
let t = 0,
|
|
22173
|
-
|
|
22174
|
-
"C" === s || "S" === s ? (t = n + (n - r),
|
|
22189
|
+
a = 0;
|
|
22190
|
+
"C" === s || "S" === s ? (t = n + (n - r), a = o + (o - i)) : (t = n, a = o), e.push({
|
|
22175
22191
|
key: "C",
|
|
22176
|
-
data: [t,
|
|
22177
|
-
}), r = l[0], i = l[1], n = l[2],
|
|
22192
|
+
data: [t, a, ...l]
|
|
22193
|
+
}), r = l[0], i = l[1], n = l[2], o = l[3];
|
|
22178
22194
|
break;
|
|
22179
22195
|
}
|
|
22180
22196
|
case "T":
|
|
22181
22197
|
{
|
|
22182
|
-
const [t,
|
|
22198
|
+
const [t, a] = l;
|
|
22183
22199
|
let h = 0,
|
|
22184
22200
|
c = 0;
|
|
22185
|
-
"Q" === s || "T" === s ? (h = n + (n - r), c =
|
|
22201
|
+
"Q" === s || "T" === s ? (h = n + (n - r), c = o + (o - i)) : (h = n, c = o);
|
|
22186
22202
|
const u = n + 2 * (h - n) / 3,
|
|
22187
|
-
p =
|
|
22203
|
+
p = o + 2 * (c - o) / 3,
|
|
22188
22204
|
f = t + 2 * (h - t) / 3,
|
|
22189
|
-
d =
|
|
22205
|
+
d = a + 2 * (c - a) / 3;
|
|
22190
22206
|
e.push({
|
|
22191
22207
|
key: "C",
|
|
22192
|
-
data: [u, p, f, d, t,
|
|
22193
|
-
}), r = h, i = c, n = t,
|
|
22208
|
+
data: [u, p, f, d, t, a]
|
|
22209
|
+
}), r = h, i = c, n = t, o = a;
|
|
22194
22210
|
break;
|
|
22195
22211
|
}
|
|
22196
22212
|
case "Q":
|
|
22197
22213
|
{
|
|
22198
|
-
const [t, s,
|
|
22214
|
+
const [t, s, a, h] = l,
|
|
22199
22215
|
c = n + 2 * (t - n) / 3,
|
|
22200
|
-
u =
|
|
22201
|
-
p =
|
|
22216
|
+
u = o + 2 * (s - o) / 3,
|
|
22217
|
+
p = a + 2 * (t - a) / 3,
|
|
22202
22218
|
f = h + 2 * (s - h) / 3;
|
|
22203
22219
|
e.push({
|
|
22204
22220
|
key: "C",
|
|
22205
|
-
data: [c, u, p, f,
|
|
22206
|
-
}), r = t, i = s, n =
|
|
22221
|
+
data: [c, u, p, f, a, h]
|
|
22222
|
+
}), r = t, i = s, n = a, o = h;
|
|
22207
22223
|
break;
|
|
22208
22224
|
}
|
|
22209
22225
|
case "A":
|
|
22210
22226
|
{
|
|
22211
22227
|
const t = Math.abs(l[0]),
|
|
22212
22228
|
s = Math.abs(l[1]),
|
|
22213
|
-
|
|
22229
|
+
a = l[2],
|
|
22214
22230
|
h = l[3],
|
|
22215
22231
|
r = l[4],
|
|
22216
22232
|
i = l[5],
|
|
22217
22233
|
c = l[6];
|
|
22218
22234
|
if (0 === t || 0 === s) e.push({
|
|
22219
22235
|
key: "C",
|
|
22220
|
-
data: [n,
|
|
22221
|
-
}), n = i,
|
|
22222
|
-
|
|
22236
|
+
data: [n, o, i, c, i, c]
|
|
22237
|
+
}), n = i, o = c;else if (n !== i || o !== c) {
|
|
22238
|
+
x(n, o, i, c, t, s, a, h, r).forEach(function (t) {
|
|
22223
22239
|
e.push({
|
|
22224
22240
|
key: "C",
|
|
22225
22241
|
data: t
|
|
22226
22242
|
});
|
|
22227
|
-
}), n = i,
|
|
22243
|
+
}), n = i, o = c;
|
|
22228
22244
|
}
|
|
22229
22245
|
break;
|
|
22230
22246
|
}
|
|
@@ -22232,171 +22248,180 @@ function g(t) {
|
|
|
22232
22248
|
e.push({
|
|
22233
22249
|
key: "Z",
|
|
22234
22250
|
data: []
|
|
22235
|
-
}), n =
|
|
22251
|
+
}), n = a, o = h;
|
|
22236
22252
|
}
|
|
22237
22253
|
s = c;
|
|
22238
22254
|
}
|
|
22239
22255
|
return e;
|
|
22240
22256
|
}
|
|
22241
|
-
function
|
|
22257
|
+
function w(t, e, s) {
|
|
22242
22258
|
return [t * Math.cos(s) - e * Math.sin(s), t * Math.sin(s) + e * Math.cos(s)];
|
|
22243
22259
|
}
|
|
22244
|
-
function
|
|
22260
|
+
function x(t, e, s, n, o, a, h, r, i, c) {
|
|
22245
22261
|
const l = (u = h, Math.PI * u / 180);
|
|
22246
22262
|
var u;
|
|
22247
22263
|
let p = [],
|
|
22248
22264
|
f = 0,
|
|
22249
22265
|
d = 0,
|
|
22250
22266
|
g = 0,
|
|
22251
|
-
|
|
22252
|
-
if (c) [f, d, g,
|
|
22253
|
-
[t, e] =
|
|
22267
|
+
M = 0;
|
|
22268
|
+
if (c) [f, d, g, M] = c;else {
|
|
22269
|
+
[t, e] = w(t, e, -l), [s, n] = w(s, n, -l);
|
|
22254
22270
|
const h = (t - s) / 2,
|
|
22255
22271
|
c = (e - n) / 2;
|
|
22256
|
-
let u = h * h / (
|
|
22257
|
-
u > 1 && (u = Math.sqrt(u),
|
|
22258
|
-
const p =
|
|
22259
|
-
k =
|
|
22260
|
-
|
|
22261
|
-
|
|
22262
|
-
|
|
22263
|
-
g =
|
|
22264
|
-
}
|
|
22265
|
-
let
|
|
22266
|
-
if (Math.abs(
|
|
22272
|
+
let u = h * h / (o * o) + c * c / (a * a);
|
|
22273
|
+
u > 1 && (u = Math.sqrt(u), o *= u, a *= u);
|
|
22274
|
+
const p = o * o,
|
|
22275
|
+
k = a * a,
|
|
22276
|
+
b = p * k - p * c * c - k * h * h,
|
|
22277
|
+
y = p * c * c + k * h * h,
|
|
22278
|
+
m = (r === i ? -1 : 1) * Math.sqrt(Math.abs(b / y));
|
|
22279
|
+
g = m * o * c / a + (t + s) / 2, M = m * -a * h / o + (e + n) / 2, f = Math.asin(parseFloat(((e - M) / a).toFixed(9))), d = Math.asin(parseFloat(((n - M) / a).toFixed(9))), t < g && (f = Math.PI - f), s < g && (d = Math.PI - d), f < 0 && (f = 2 * Math.PI + f), d < 0 && (d = 2 * Math.PI + d), i && f > d && (f -= 2 * Math.PI), !i && d > f && (d -= 2 * Math.PI);
|
|
22280
|
+
}
|
|
22281
|
+
let k = d - f;
|
|
22282
|
+
if (Math.abs(k) > 120 * Math.PI / 180) {
|
|
22267
22283
|
const t = d,
|
|
22268
22284
|
e = s,
|
|
22269
22285
|
r = n;
|
|
22270
|
-
d = i && d > f ? f + 120 * Math.PI / 180 * 1 : f + 120 * Math.PI / 180 * -1, p =
|
|
22286
|
+
d = i && d > f ? f + 120 * Math.PI / 180 * 1 : f + 120 * Math.PI / 180 * -1, p = x(s = g + o * Math.cos(d), n = M + a * Math.sin(d), e, r, o, a, h, 0, i, [d, t, g, M]);
|
|
22271
22287
|
}
|
|
22272
|
-
|
|
22273
|
-
const
|
|
22274
|
-
|
|
22275
|
-
|
|
22288
|
+
k = d - f;
|
|
22289
|
+
const b = Math.cos(f),
|
|
22290
|
+
y = Math.sin(f),
|
|
22291
|
+
m = Math.cos(d),
|
|
22276
22292
|
P = Math.sin(d),
|
|
22277
|
-
v = Math.tan(
|
|
22278
|
-
O = 4 / 3 * a * v,
|
|
22293
|
+
v = Math.tan(k / 4),
|
|
22279
22294
|
S = 4 / 3 * o * v,
|
|
22295
|
+
O = 4 / 3 * a * v,
|
|
22280
22296
|
L = [t, e],
|
|
22281
|
-
T = [t +
|
|
22282
|
-
D = [s +
|
|
22297
|
+
T = [t + S * y, e - O * b],
|
|
22298
|
+
D = [s + S * P, n - O * m],
|
|
22283
22299
|
A = [s, n];
|
|
22284
22300
|
if (T[0] = 2 * L[0] - T[0], T[1] = 2 * L[1] - T[1], c) return [T, D, A].concat(p);
|
|
22285
22301
|
{
|
|
22286
22302
|
p = [T, D, A].concat(p);
|
|
22287
22303
|
const t = [];
|
|
22288
22304
|
for (let e = 0; e < p.length; e += 3) {
|
|
22289
|
-
const s =
|
|
22290
|
-
n =
|
|
22291
|
-
|
|
22292
|
-
t.push([s[0], s[1], n[0], n[1],
|
|
22305
|
+
const s = w(p[e][0], p[e][1], l),
|
|
22306
|
+
n = w(p[e + 1][0], p[e + 1][1], l),
|
|
22307
|
+
o = w(p[e + 2][0], p[e + 2][1], l);
|
|
22308
|
+
t.push([s[0], s[1], n[0], n[1], o[0], o[1]]);
|
|
22293
22309
|
}
|
|
22294
22310
|
return t;
|
|
22295
22311
|
}
|
|
22296
22312
|
}
|
|
22297
|
-
const
|
|
22313
|
+
const P = {
|
|
22298
22314
|
randOffset: function (t, e) {
|
|
22299
|
-
return
|
|
22315
|
+
return G(t, e);
|
|
22300
22316
|
},
|
|
22301
22317
|
randOffsetWithRange: function (t, e, s) {
|
|
22302
|
-
return
|
|
22318
|
+
return E(t, e, s);
|
|
22303
22319
|
},
|
|
22304
|
-
ellipse: function (t, e, s, n,
|
|
22305
|
-
const
|
|
22306
|
-
return
|
|
22320
|
+
ellipse: function (t, e, s, n, o) {
|
|
22321
|
+
const a = T(s, n, o);
|
|
22322
|
+
return D(t, e, o, a).opset;
|
|
22307
22323
|
},
|
|
22308
|
-
doubleLineOps: function (t, e, s, n,
|
|
22309
|
-
return
|
|
22324
|
+
doubleLineOps: function (t, e, s, n, o) {
|
|
22325
|
+
return $(t, e, s, n, o, !0);
|
|
22310
22326
|
}
|
|
22311
22327
|
};
|
|
22312
|
-
function
|
|
22328
|
+
function v(t, e, s, n, o) {
|
|
22313
22329
|
return {
|
|
22314
22330
|
type: "path",
|
|
22315
|
-
ops:
|
|
22331
|
+
ops: $(t, e, s, n, o)
|
|
22316
22332
|
};
|
|
22317
22333
|
}
|
|
22318
|
-
function
|
|
22334
|
+
function S(t, e, s) {
|
|
22319
22335
|
const n = (t || []).length;
|
|
22320
22336
|
if (n > 2) {
|
|
22321
|
-
const
|
|
22322
|
-
for (let e = 0; e < n - 1; e++)
|
|
22323
|
-
return e &&
|
|
22337
|
+
const o = [];
|
|
22338
|
+
for (let e = 0; e < n - 1; e++) o.push(...$(t[e][0], t[e][1], t[e + 1][0], t[e + 1][1], s));
|
|
22339
|
+
return e && o.push(...$(t[n - 1][0], t[n - 1][1], t[0][0], t[0][1], s)), {
|
|
22324
22340
|
type: "path",
|
|
22325
|
-
ops:
|
|
22341
|
+
ops: o
|
|
22326
22342
|
};
|
|
22327
22343
|
}
|
|
22328
|
-
return 2 === n ?
|
|
22344
|
+
return 2 === n ? v(t[0][0], t[0][1], t[1][0], t[1][1], s) : {
|
|
22329
22345
|
type: "path",
|
|
22330
22346
|
ops: []
|
|
22331
22347
|
};
|
|
22332
22348
|
}
|
|
22333
|
-
function
|
|
22349
|
+
function O(t, e, s, n, o) {
|
|
22334
22350
|
return function (t, e) {
|
|
22335
|
-
return
|
|
22336
|
-
}([[t, e], [t + s, e], [t + s, e + n], [t, e + n]],
|
|
22337
|
-
}
|
|
22338
|
-
function
|
|
22339
|
-
|
|
22340
|
-
|
|
22341
|
-
|
|
22342
|
-
|
|
22343
|
-
|
|
22344
|
-
|
|
22345
|
-
|
|
22346
|
-
|
|
22351
|
+
return S(t, !0, e);
|
|
22352
|
+
}([[t, e], [t + s, e], [t + s, e + n], [t, e + n]], o);
|
|
22353
|
+
}
|
|
22354
|
+
function L(t, e) {
|
|
22355
|
+
if (t.length) {
|
|
22356
|
+
const s = "number" == typeof t[0][0] ? [t] : t,
|
|
22357
|
+
n = j(s[0], 1 * (1 + .2 * e.roughness), e),
|
|
22358
|
+
o = e.disableMultiStroke ? [] : j(s[0], 1.5 * (1 + .22 * e.roughness), z(e));
|
|
22359
|
+
for (let t = 1; t < s.length; t++) {
|
|
22360
|
+
const a = s[t];
|
|
22361
|
+
if (a.length) {
|
|
22362
|
+
const t = j(a, 1 * (1 + .2 * e.roughness), e),
|
|
22363
|
+
s = e.disableMultiStroke ? [] : j(a, 1.5 * (1 + .22 * e.roughness), z(e));
|
|
22364
|
+
for (const e of t) "move" !== e.op && n.push(e);
|
|
22365
|
+
for (const t of s) "move" !== t.op && o.push(t);
|
|
22366
|
+
}
|
|
22367
|
+
}
|
|
22368
|
+
return {
|
|
22369
|
+
type: "path",
|
|
22370
|
+
ops: n.concat(o)
|
|
22371
|
+
};
|
|
22347
22372
|
}
|
|
22348
22373
|
return {
|
|
22349
22374
|
type: "path",
|
|
22350
|
-
ops:
|
|
22375
|
+
ops: []
|
|
22351
22376
|
};
|
|
22352
22377
|
}
|
|
22353
|
-
function
|
|
22378
|
+
function T(t, e, s) {
|
|
22354
22379
|
const n = Math.sqrt(2 * Math.PI * Math.sqrt((Math.pow(t / 2, 2) + Math.pow(e / 2, 2)) / 2)),
|
|
22355
|
-
|
|
22356
|
-
|
|
22380
|
+
o = Math.ceil(Math.max(s.curveStepCount, s.curveStepCount / Math.sqrt(200) * n)),
|
|
22381
|
+
a = 2 * Math.PI / o;
|
|
22357
22382
|
let h = Math.abs(t / 2),
|
|
22358
22383
|
r = Math.abs(e / 2);
|
|
22359
22384
|
const i = 1 - s.curveFitting;
|
|
22360
|
-
return h +=
|
|
22361
|
-
increment:
|
|
22385
|
+
return h += G(h * i, s), r += G(r * i, s), {
|
|
22386
|
+
increment: a,
|
|
22362
22387
|
rx: h,
|
|
22363
22388
|
ry: r
|
|
22364
22389
|
};
|
|
22365
22390
|
}
|
|
22366
|
-
function
|
|
22367
|
-
const [
|
|
22368
|
-
let h =
|
|
22391
|
+
function D(t, e, s, n) {
|
|
22392
|
+
const [o, a] = F(n.increment, t, e, n.rx, n.ry, 1, n.increment * E(.1, E(.4, 1, s), s), s);
|
|
22393
|
+
let h = q(o, null, s);
|
|
22369
22394
|
if (!s.disableMultiStroke && 0 !== s.roughness) {
|
|
22370
|
-
const [
|
|
22371
|
-
|
|
22372
|
-
h = h.concat(
|
|
22395
|
+
const [o] = F(n.increment, t, e, n.rx, n.ry, 1.5, 0, s),
|
|
22396
|
+
a = q(o, null, s);
|
|
22397
|
+
h = h.concat(a);
|
|
22373
22398
|
}
|
|
22374
22399
|
return {
|
|
22375
|
-
estimatedPoints:
|
|
22400
|
+
estimatedPoints: a,
|
|
22376
22401
|
opset: {
|
|
22377
22402
|
type: "path",
|
|
22378
22403
|
ops: h
|
|
22379
22404
|
}
|
|
22380
22405
|
};
|
|
22381
22406
|
}
|
|
22382
|
-
function
|
|
22407
|
+
function A(t, e, s, n, o, a, h, r, i) {
|
|
22383
22408
|
const c = t,
|
|
22384
22409
|
l = e;
|
|
22385
22410
|
let u = Math.abs(s / 2),
|
|
22386
22411
|
p = Math.abs(n / 2);
|
|
22387
|
-
u +=
|
|
22388
|
-
let f =
|
|
22389
|
-
d =
|
|
22412
|
+
u += G(.01 * u, i), p += G(.01 * p, i);
|
|
22413
|
+
let f = o,
|
|
22414
|
+
d = a;
|
|
22390
22415
|
for (; f < 0;) f += 2 * Math.PI, d += 2 * Math.PI;
|
|
22391
22416
|
d - f > 2 * Math.PI && (f = 0, d = 2 * Math.PI);
|
|
22392
22417
|
const g = 2 * Math.PI / i.curveStepCount,
|
|
22393
22418
|
M = Math.min(g / 2, (d - f) / 2),
|
|
22394
|
-
k =
|
|
22419
|
+
k = V(M, c, l, u, p, f, d, 1, i);
|
|
22395
22420
|
if (!i.disableMultiStroke) {
|
|
22396
|
-
const t =
|
|
22421
|
+
const t = V(M, c, l, u, p, f, d, 1.5, i);
|
|
22397
22422
|
k.push(...t);
|
|
22398
22423
|
}
|
|
22399
|
-
return h && (r ? k.push(
|
|
22424
|
+
return h && (r ? k.push(...$(c, l, c + u * Math.cos(f), l + p * Math.sin(f), i), ...$(c, l, c + u * Math.cos(d), l + p * Math.sin(d), i)) : k.push({
|
|
22400
22425
|
op: "lineTo",
|
|
22401
22426
|
data: [c, l]
|
|
22402
22427
|
}, {
|
|
@@ -22407,19 +22432,48 @@ function O(t, e, s, n, a, o, h, r, i) {
|
|
|
22407
22432
|
ops: k
|
|
22408
22433
|
};
|
|
22409
22434
|
}
|
|
22410
|
-
function
|
|
22435
|
+
function _(t, e) {
|
|
22436
|
+
const s = m$2(y(b(t))),
|
|
22437
|
+
n = [];
|
|
22438
|
+
let o = [0, 0],
|
|
22439
|
+
a = [0, 0];
|
|
22440
|
+
for (const {
|
|
22441
|
+
key: t,
|
|
22442
|
+
data: h
|
|
22443
|
+
} of s) switch (t) {
|
|
22444
|
+
case "M":
|
|
22445
|
+
a = [h[0], h[1]], o = [h[0], h[1]];
|
|
22446
|
+
break;
|
|
22447
|
+
case "L":
|
|
22448
|
+
n.push(...$(a[0], a[1], h[0], h[1], e)), a = [h[0], h[1]];
|
|
22449
|
+
break;
|
|
22450
|
+
case "C":
|
|
22451
|
+
{
|
|
22452
|
+
const [t, s, o, r, i, c] = h;
|
|
22453
|
+
n.push(...Z(t, s, o, r, i, c, a, e)), a = [i, c];
|
|
22454
|
+
break;
|
|
22455
|
+
}
|
|
22456
|
+
case "Z":
|
|
22457
|
+
n.push(...$(a[0], a[1], o[0], o[1], e)), a = [o[0], o[1]];
|
|
22458
|
+
}
|
|
22459
|
+
return {
|
|
22460
|
+
type: "path",
|
|
22461
|
+
ops: n
|
|
22462
|
+
};
|
|
22463
|
+
}
|
|
22464
|
+
function I(t, e) {
|
|
22411
22465
|
const s = [];
|
|
22412
22466
|
for (const n of t) if (n.length) {
|
|
22413
22467
|
const t = e.maxRandomnessOffset || 0,
|
|
22414
|
-
|
|
22415
|
-
if (
|
|
22468
|
+
o = n.length;
|
|
22469
|
+
if (o > 2) {
|
|
22416
22470
|
s.push({
|
|
22417
22471
|
op: "move",
|
|
22418
|
-
data: [n[0][0] +
|
|
22472
|
+
data: [n[0][0] + G(t, e), n[0][1] + G(t, e)]
|
|
22419
22473
|
});
|
|
22420
|
-
for (let
|
|
22474
|
+
for (let a = 1; a < o; a++) s.push({
|
|
22421
22475
|
op: "lineTo",
|
|
22422
|
-
data: [n[
|
|
22476
|
+
data: [n[a][0] + G(t, e), n[a][1] + G(t, e)]
|
|
22423
22477
|
});
|
|
22424
22478
|
}
|
|
22425
22479
|
}
|
|
@@ -22428,73 +22482,76 @@ function S(t, e) {
|
|
|
22428
22482
|
ops: s
|
|
22429
22483
|
};
|
|
22430
22484
|
}
|
|
22431
|
-
function
|
|
22485
|
+
function C(t, e) {
|
|
22432
22486
|
return function (t, e) {
|
|
22433
22487
|
let s = t.fillStyle || "hachure";
|
|
22434
|
-
if (!
|
|
22488
|
+
if (!u[s]) switch (s) {
|
|
22435
22489
|
case "zigzag":
|
|
22436
|
-
|
|
22490
|
+
u[s] || (u[s] = new h(e));
|
|
22437
22491
|
break;
|
|
22438
22492
|
case "cross-hatch":
|
|
22439
|
-
|
|
22493
|
+
u[s] || (u[s] = new r(e));
|
|
22440
22494
|
break;
|
|
22441
22495
|
case "dots":
|
|
22442
|
-
|
|
22496
|
+
u[s] || (u[s] = new i(e));
|
|
22443
22497
|
break;
|
|
22444
22498
|
case "dashed":
|
|
22445
|
-
|
|
22499
|
+
u[s] || (u[s] = new c(e));
|
|
22446
22500
|
break;
|
|
22447
22501
|
case "zigzag-line":
|
|
22448
|
-
|
|
22502
|
+
u[s] || (u[s] = new l(e));
|
|
22449
22503
|
break;
|
|
22450
|
-
case "hachure":
|
|
22451
22504
|
default:
|
|
22452
|
-
s = "hachure",
|
|
22505
|
+
s = "hachure", u[s] || (u[s] = new o(e));
|
|
22453
22506
|
}
|
|
22454
|
-
return
|
|
22455
|
-
}(e,
|
|
22507
|
+
return u[s];
|
|
22508
|
+
}(e, P).fillPolygons(t, e);
|
|
22509
|
+
}
|
|
22510
|
+
function z(t) {
|
|
22511
|
+
const e = Object.assign({}, t);
|
|
22512
|
+
return e.randomizer = void 0, t.seed && (e.seed = t.seed + 1), e;
|
|
22456
22513
|
}
|
|
22457
|
-
function
|
|
22458
|
-
return t.randomizer || (t.randomizer = new
|
|
22514
|
+
function W(t) {
|
|
22515
|
+
return t.randomizer || (t.randomizer = new p(t.seed || 0)), t.randomizer.next();
|
|
22459
22516
|
}
|
|
22460
|
-
function
|
|
22517
|
+
function E(t, e, s) {
|
|
22461
22518
|
let n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
22462
|
-
return s.roughness * n * (
|
|
22519
|
+
return s.roughness * n * (W(s) * (e - t) + t);
|
|
22463
22520
|
}
|
|
22464
|
-
function
|
|
22521
|
+
function G(t, e) {
|
|
22465
22522
|
let s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
22466
|
-
return
|
|
22523
|
+
return E(-t, t, e, s);
|
|
22467
22524
|
}
|
|
22468
|
-
function
|
|
22469
|
-
let
|
|
22470
|
-
const h =
|
|
22471
|
-
r =
|
|
22525
|
+
function $(t, e, s, n, o) {
|
|
22526
|
+
let a = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !1;
|
|
22527
|
+
const h = a ? o.disableMultiStrokeFill : o.disableMultiStroke,
|
|
22528
|
+
r = R(t, e, s, n, o, !0, !1);
|
|
22472
22529
|
if (h) return r;
|
|
22473
|
-
const i =
|
|
22530
|
+
const i = R(t, e, s, n, o, !0, !0);
|
|
22474
22531
|
return r.concat(i);
|
|
22475
22532
|
}
|
|
22476
|
-
function
|
|
22533
|
+
function R(t, e, s, n, o, a, h) {
|
|
22477
22534
|
const r = Math.pow(t - s, 2) + Math.pow(e - n, 2),
|
|
22478
22535
|
i = Math.sqrt(r);
|
|
22479
22536
|
let c = 1;
|
|
22480
22537
|
c = i < 200 ? 1 : i > 500 ? .4 : -.0016668 * i + 1.233334;
|
|
22481
|
-
let l =
|
|
22538
|
+
let l = o.maxRandomnessOffset || 0;
|
|
22482
22539
|
l * l * 100 > r && (l = i / 10);
|
|
22483
22540
|
const u = l / 2,
|
|
22484
|
-
p = .2 + .2 *
|
|
22485
|
-
let f =
|
|
22486
|
-
d =
|
|
22487
|
-
f =
|
|
22541
|
+
p = .2 + .2 * W(o);
|
|
22542
|
+
let f = o.bowing * o.maxRandomnessOffset * (n - e) / 200,
|
|
22543
|
+
d = o.bowing * o.maxRandomnessOffset * (t - s) / 200;
|
|
22544
|
+
f = G(f, o, c), d = G(d, o, c);
|
|
22488
22545
|
const g = [],
|
|
22489
|
-
M = () =>
|
|
22490
|
-
k = () =>
|
|
22491
|
-
b =
|
|
22492
|
-
return
|
|
22546
|
+
M = () => G(u, o, c),
|
|
22547
|
+
k = () => G(l, o, c),
|
|
22548
|
+
b = o.preserveVertices;
|
|
22549
|
+
return a && (h ? g.push({
|
|
22493
22550
|
op: "move",
|
|
22494
22551
|
data: [t + (b ? 0 : M()), e + (b ? 0 : M())]
|
|
22495
22552
|
}) : g.push({
|
|
22496
22553
|
op: "move",
|
|
22497
|
-
data: [t + (b ? 0 :
|
|
22554
|
+
data: [t + (b ? 0 : G(l, o, c)), e + (b ? 0 : G(l, o, c))]
|
|
22498
22555
|
})), h ? g.push({
|
|
22499
22556
|
op: "bcurveTo",
|
|
22500
22557
|
data: [f + t + (s - t) * p + M(), d + e + (n - e) * p + M(), f + t + 2 * (s - t) * p + M(), d + e + 2 * (n - e) * p + M(), s + (b ? 0 : M()), n + (b ? 0 : M())]
|
|
@@ -22503,75 +22560,76 @@ function C(t, e, s, n, a, o, h) {
|
|
|
22503
22560
|
data: [f + t + (s - t) * p + k(), d + e + (n - e) * p + k(), f + t + 2 * (s - t) * p + k(), d + e + 2 * (n - e) * p + k(), s + (b ? 0 : k()), n + (b ? 0 : k())]
|
|
22504
22561
|
}), g;
|
|
22505
22562
|
}
|
|
22506
|
-
function
|
|
22563
|
+
function j(t, e, s) {
|
|
22564
|
+
if (!t.length) return [];
|
|
22507
22565
|
const n = [];
|
|
22508
|
-
n.push([t[0][0] +
|
|
22509
|
-
for (let
|
|
22510
|
-
return
|
|
22566
|
+
n.push([t[0][0] + G(e, s), t[0][1] + G(e, s)]), n.push([t[0][0] + G(e, s), t[0][1] + G(e, s)]);
|
|
22567
|
+
for (let o = 1; o < t.length; o++) n.push([t[o][0] + G(e, s), t[o][1] + G(e, s)]), o === t.length - 1 && n.push([t[o][0] + G(e, s), t[o][1] + G(e, s)]);
|
|
22568
|
+
return q(n, null, s);
|
|
22511
22569
|
}
|
|
22512
|
-
function
|
|
22570
|
+
function q(t, e, s) {
|
|
22513
22571
|
const n = t.length,
|
|
22514
|
-
|
|
22572
|
+
o = [];
|
|
22515
22573
|
if (n > 3) {
|
|
22516
|
-
const
|
|
22574
|
+
const a = [],
|
|
22517
22575
|
h = 1 - s.curveTightness;
|
|
22518
|
-
|
|
22576
|
+
o.push({
|
|
22519
22577
|
op: "move",
|
|
22520
22578
|
data: [t[1][0], t[1][1]]
|
|
22521
22579
|
});
|
|
22522
22580
|
for (let e = 1; e + 2 < n; e++) {
|
|
22523
22581
|
const s = t[e];
|
|
22524
|
-
|
|
22582
|
+
a[0] = [s[0], s[1]], a[1] = [s[0] + (h * t[e + 1][0] - h * t[e - 1][0]) / 6, s[1] + (h * t[e + 1][1] - h * t[e - 1][1]) / 6], a[2] = [t[e + 1][0] + (h * t[e][0] - h * t[e + 2][0]) / 6, t[e + 1][1] + (h * t[e][1] - h * t[e + 2][1]) / 6], a[3] = [t[e + 1][0], t[e + 1][1]], o.push({
|
|
22525
22583
|
op: "bcurveTo",
|
|
22526
|
-
data: [
|
|
22584
|
+
data: [a[1][0], a[1][1], a[2][0], a[2][1], a[3][0], a[3][1]]
|
|
22527
22585
|
});
|
|
22528
22586
|
}
|
|
22529
22587
|
if (e && 2 === e.length) {
|
|
22530
22588
|
const t = s.maxRandomnessOffset;
|
|
22531
|
-
|
|
22589
|
+
o.push({
|
|
22532
22590
|
op: "lineTo",
|
|
22533
|
-
data: [e[0] +
|
|
22591
|
+
data: [e[0] + G(t, s), e[1] + G(t, s)]
|
|
22534
22592
|
});
|
|
22535
22593
|
}
|
|
22536
|
-
} else 3 === n ? (
|
|
22594
|
+
} else 3 === n ? (o.push({
|
|
22537
22595
|
op: "move",
|
|
22538
22596
|
data: [t[1][0], t[1][1]]
|
|
22539
|
-
}),
|
|
22597
|
+
}), o.push({
|
|
22540
22598
|
op: "bcurveTo",
|
|
22541
22599
|
data: [t[1][0], t[1][1], t[2][0], t[2][1], t[2][0], t[2][1]]
|
|
22542
|
-
})) : 2 === n &&
|
|
22543
|
-
return
|
|
22600
|
+
})) : 2 === n && o.push(...R(t[0][0], t[0][1], t[1][0], t[1][1], s, !0, !0));
|
|
22601
|
+
return o;
|
|
22544
22602
|
}
|
|
22545
|
-
function
|
|
22603
|
+
function F(t, e, s, n, o, a, h, r) {
|
|
22546
22604
|
const i = [],
|
|
22547
22605
|
c = [];
|
|
22548
22606
|
if (0 === r.roughness) {
|
|
22549
|
-
t /= 4, c.push([e + n * Math.cos(-t), s +
|
|
22550
|
-
for (let
|
|
22551
|
-
const t = [e + n * Math.cos(
|
|
22607
|
+
t /= 4, c.push([e + n * Math.cos(-t), s + o * Math.sin(-t)]);
|
|
22608
|
+
for (let a = 0; a <= 2 * Math.PI; a += t) {
|
|
22609
|
+
const t = [e + n * Math.cos(a), s + o * Math.sin(a)];
|
|
22552
22610
|
i.push(t), c.push(t);
|
|
22553
22611
|
}
|
|
22554
|
-
c.push([e + n * Math.cos(0), s +
|
|
22612
|
+
c.push([e + n * Math.cos(0), s + o * Math.sin(0)]), c.push([e + n * Math.cos(t), s + o * Math.sin(t)]);
|
|
22555
22613
|
} else {
|
|
22556
|
-
const l =
|
|
22557
|
-
c.push([
|
|
22614
|
+
const l = G(.5, r) - Math.PI / 2;
|
|
22615
|
+
c.push([G(a, r) + e + .9 * n * Math.cos(l - t), G(a, r) + s + .9 * o * Math.sin(l - t)]);
|
|
22558
22616
|
const u = 2 * Math.PI + l - .01;
|
|
22559
22617
|
for (let h = l; h < u; h += t) {
|
|
22560
|
-
const t = [
|
|
22618
|
+
const t = [G(a, r) + e + n * Math.cos(h), G(a, r) + s + o * Math.sin(h)];
|
|
22561
22619
|
i.push(t), c.push(t);
|
|
22562
22620
|
}
|
|
22563
|
-
c.push([
|
|
22621
|
+
c.push([G(a, r) + e + n * Math.cos(l + 2 * Math.PI + .5 * h), G(a, r) + s + o * Math.sin(l + 2 * Math.PI + .5 * h)]), c.push([G(a, r) + e + .98 * n * Math.cos(l + h), G(a, r) + s + .98 * o * Math.sin(l + h)]), c.push([G(a, r) + e + .9 * n * Math.cos(l + .5 * h), G(a, r) + s + .9 * o * Math.sin(l + .5 * h)]);
|
|
22564
22622
|
}
|
|
22565
22623
|
return [c, i];
|
|
22566
22624
|
}
|
|
22567
|
-
function
|
|
22568
|
-
const c =
|
|
22625
|
+
function V(t, e, s, n, o, a, h, r, i) {
|
|
22626
|
+
const c = a + G(.1, i),
|
|
22569
22627
|
l = [];
|
|
22570
|
-
l.push([
|
|
22571
|
-
for (let
|
|
22572
|
-
return l.push([e + n * Math.cos(h), s +
|
|
22628
|
+
l.push([G(r, i) + e + .9 * n * Math.cos(c - t), G(r, i) + s + .9 * o * Math.sin(c - t)]);
|
|
22629
|
+
for (let a = c; a <= h; a += t) l.push([G(r, i) + e + n * Math.cos(a), G(r, i) + s + o * Math.sin(a)]);
|
|
22630
|
+
return l.push([e + n * Math.cos(h), s + o * Math.sin(h)]), l.push([e + n * Math.cos(h), s + o * Math.sin(h)]), q(l, null, i);
|
|
22573
22631
|
}
|
|
22574
|
-
function
|
|
22632
|
+
function Z(t, e, s, n, o, a, h, r) {
|
|
22575
22633
|
const i = [],
|
|
22576
22634
|
c = [r.maxRandomnessOffset || 1, (r.maxRandomnessOffset || 1) + .3];
|
|
22577
22635
|
let l = [0, 0];
|
|
@@ -22582,93 +22640,112 @@ function $(t, e, s, n, a, o, h, r) {
|
|
|
22582
22640
|
data: [h[0], h[1]]
|
|
22583
22641
|
}) : i.push({
|
|
22584
22642
|
op: "move",
|
|
22585
|
-
data: [h[0] + (p ? 0 :
|
|
22586
|
-
}), l = p ? [
|
|
22643
|
+
data: [h[0] + (p ? 0 : G(c[0], r)), h[1] + (p ? 0 : G(c[0], r))]
|
|
22644
|
+
}), l = p ? [o, a] : [o + G(c[f], r), a + G(c[f], r)], i.push({
|
|
22587
22645
|
op: "bcurveTo",
|
|
22588
|
-
data: [t +
|
|
22646
|
+
data: [t + G(c[f], r), e + G(c[f], r), s + G(c[f], r), n + G(c[f], r), l[0], l[1]]
|
|
22589
22647
|
});
|
|
22590
22648
|
return i;
|
|
22591
22649
|
}
|
|
22592
|
-
function
|
|
22650
|
+
function Q(t) {
|
|
22593
22651
|
return [...t];
|
|
22594
22652
|
}
|
|
22595
|
-
function
|
|
22653
|
+
function H(t) {
|
|
22654
|
+
let e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
22655
|
+
const s = t.length;
|
|
22656
|
+
if (s < 3) throw new Error("A curve must have at least three points.");
|
|
22657
|
+
const n = [];
|
|
22658
|
+
if (3 === s) n.push(Q(t[0]), Q(t[1]), Q(t[2]), Q(t[2]));else {
|
|
22659
|
+
const s = [];
|
|
22660
|
+
s.push(t[0], t[0]);
|
|
22661
|
+
for (let e = 1; e < t.length; e++) s.push(t[e]), e === t.length - 1 && s.push(t[e]);
|
|
22662
|
+
const o = [],
|
|
22663
|
+
a = 1 - e;
|
|
22664
|
+
n.push(Q(s[0]));
|
|
22665
|
+
for (let t = 1; t + 2 < s.length; t++) {
|
|
22666
|
+
const e = s[t];
|
|
22667
|
+
o[0] = [e[0], e[1]], o[1] = [e[0] + (a * s[t + 1][0] - a * s[t - 1][0]) / 6, e[1] + (a * s[t + 1][1] - a * s[t - 1][1]) / 6], o[2] = [s[t + 1][0] + (a * s[t][0] - a * s[t + 2][0]) / 6, s[t + 1][1] + (a * s[t][1] - a * s[t + 2][1]) / 6], o[3] = [s[t + 1][0], s[t + 1][1]], n.push(o[1], o[2], o[3]);
|
|
22668
|
+
}
|
|
22669
|
+
}
|
|
22670
|
+
return n;
|
|
22671
|
+
}
|
|
22672
|
+
function N(t, e) {
|
|
22596
22673
|
return Math.pow(t[0] - e[0], 2) + Math.pow(t[1] - e[1], 2);
|
|
22597
22674
|
}
|
|
22598
|
-
function
|
|
22599
|
-
const n =
|
|
22600
|
-
if (0 === n) return
|
|
22601
|
-
let
|
|
22602
|
-
return
|
|
22675
|
+
function B(t, e, s) {
|
|
22676
|
+
const n = N(e, s);
|
|
22677
|
+
if (0 === n) return N(t, e);
|
|
22678
|
+
let o = ((t[0] - e[0]) * (s[0] - e[0]) + (t[1] - e[1]) * (s[1] - e[1])) / n;
|
|
22679
|
+
return o = Math.max(0, Math.min(1, o)), N(t, J(e, s, o));
|
|
22603
22680
|
}
|
|
22604
|
-
function
|
|
22681
|
+
function J(t, e, s) {
|
|
22605
22682
|
return [t[0] + (e[0] - t[0]) * s, t[1] + (e[1] - t[1]) * s];
|
|
22606
22683
|
}
|
|
22607
|
-
function
|
|
22608
|
-
const
|
|
22684
|
+
function K(t, e, s, n) {
|
|
22685
|
+
const o = n || [];
|
|
22609
22686
|
if (function (t, e) {
|
|
22610
22687
|
const s = t[e + 0],
|
|
22611
22688
|
n = t[e + 1],
|
|
22612
|
-
|
|
22613
|
-
|
|
22614
|
-
let h = 3 * n[0] - 2 * s[0] -
|
|
22689
|
+
o = t[e + 2],
|
|
22690
|
+
a = t[e + 3];
|
|
22691
|
+
let h = 3 * n[0] - 2 * s[0] - a[0];
|
|
22615
22692
|
h *= h;
|
|
22616
|
-
let r = 3 * n[1] - 2 * s[1] -
|
|
22693
|
+
let r = 3 * n[1] - 2 * s[1] - a[1];
|
|
22617
22694
|
r *= r;
|
|
22618
|
-
let i = 3 *
|
|
22695
|
+
let i = 3 * o[0] - 2 * a[0] - s[0];
|
|
22619
22696
|
i *= i;
|
|
22620
|
-
let c = 3 *
|
|
22697
|
+
let c = 3 * o[1] - 2 * a[1] - s[1];
|
|
22621
22698
|
return c *= c, h < i && (h = i), r < c && (r = c), h + r;
|
|
22622
22699
|
}(t, e) < s) {
|
|
22623
22700
|
const s = t[e + 0];
|
|
22624
|
-
if (
|
|
22625
|
-
(
|
|
22626
|
-
} else
|
|
22627
|
-
|
|
22701
|
+
if (o.length) {
|
|
22702
|
+
(a = o[o.length - 1], h = s, Math.sqrt(N(a, h))) > 1 && o.push(s);
|
|
22703
|
+
} else o.push(s);
|
|
22704
|
+
o.push(t[e + 3]);
|
|
22628
22705
|
} else {
|
|
22629
22706
|
const n = .5,
|
|
22630
|
-
|
|
22707
|
+
a = t[e + 0],
|
|
22631
22708
|
h = t[e + 1],
|
|
22632
22709
|
r = t[e + 2],
|
|
22633
22710
|
i = t[e + 3],
|
|
22634
|
-
c =
|
|
22635
|
-
l =
|
|
22636
|
-
u =
|
|
22637
|
-
p =
|
|
22638
|
-
f =
|
|
22639
|
-
d =
|
|
22640
|
-
|
|
22641
|
-
}
|
|
22642
|
-
var
|
|
22643
|
-
return
|
|
22711
|
+
c = J(a, h, n),
|
|
22712
|
+
l = J(h, r, n),
|
|
22713
|
+
u = J(r, i, n),
|
|
22714
|
+
p = J(c, l, n),
|
|
22715
|
+
f = J(l, u, n),
|
|
22716
|
+
d = J(p, f, n);
|
|
22717
|
+
K([a, c, p, d], 0, s, o), K([d, f, u, i], 0, s, o);
|
|
22718
|
+
}
|
|
22719
|
+
var a, h;
|
|
22720
|
+
return o;
|
|
22644
22721
|
}
|
|
22645
|
-
function
|
|
22646
|
-
return
|
|
22722
|
+
function U(t, e) {
|
|
22723
|
+
return X(t, 0, t.length, e);
|
|
22647
22724
|
}
|
|
22648
|
-
function
|
|
22649
|
-
const
|
|
22725
|
+
function X(t, e, s, n, o) {
|
|
22726
|
+
const a = o || [],
|
|
22650
22727
|
h = t[e],
|
|
22651
22728
|
r = t[s - 1];
|
|
22652
22729
|
let i = 0,
|
|
22653
22730
|
c = 1;
|
|
22654
22731
|
for (let n = e + 1; n < s - 1; ++n) {
|
|
22655
|
-
const e =
|
|
22732
|
+
const e = B(t[n], h, r);
|
|
22656
22733
|
e > i && (i = e, c = n);
|
|
22657
22734
|
}
|
|
22658
|
-
return Math.sqrt(i) > n ? (
|
|
22735
|
+
return Math.sqrt(i) > n ? (X(t, e, c + 1, n, a), X(t, c, s, n, a)) : (a.length || a.push(h), a.push(r)), a;
|
|
22659
22736
|
}
|
|
22660
|
-
function
|
|
22737
|
+
function Y(t) {
|
|
22661
22738
|
let e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .15;
|
|
22662
22739
|
let s = arguments.length > 2 ? arguments[2] : undefined;
|
|
22663
22740
|
const n = [],
|
|
22664
|
-
|
|
22665
|
-
for (let s = 0; s <
|
|
22666
|
-
|
|
22741
|
+
o = (t.length - 1) / 3;
|
|
22742
|
+
for (let s = 0; s < o; s++) {
|
|
22743
|
+
K(t, 3 * s, e, n);
|
|
22667
22744
|
}
|
|
22668
|
-
return s && s > 0 ?
|
|
22745
|
+
return s && s > 0 ? X(n, 0, n.length, s) : n;
|
|
22669
22746
|
}
|
|
22670
|
-
const
|
|
22671
|
-
class
|
|
22747
|
+
const tt$1 = "none";
|
|
22748
|
+
class et {
|
|
22672
22749
|
constructor(t) {
|
|
22673
22750
|
this.defaultOptions = {
|
|
22674
22751
|
maxRandomnessOffset: 2,
|
|
@@ -22689,7 +22766,8 @@ class N {
|
|
|
22689
22766
|
seed: 0,
|
|
22690
22767
|
disableMultiStroke: !1,
|
|
22691
22768
|
disableMultiStrokeFill: !1,
|
|
22692
|
-
preserveVertices: !1
|
|
22769
|
+
preserveVertices: !1,
|
|
22770
|
+
fillShapeRoughnessGain: .8
|
|
22693
22771
|
}, this.config = t || {}, this.config.options && (this.defaultOptions = this._o(this.config.options));
|
|
22694
22772
|
}
|
|
22695
22773
|
static newSeed() {
|
|
@@ -22705,187 +22783,161 @@ class N {
|
|
|
22705
22783
|
options: s || this.defaultOptions
|
|
22706
22784
|
};
|
|
22707
22785
|
}
|
|
22708
|
-
line(t, e, s, n,
|
|
22709
|
-
const
|
|
22710
|
-
return this._d("line", [
|
|
22786
|
+
line(t, e, s, n, o) {
|
|
22787
|
+
const a = this._o(o);
|
|
22788
|
+
return this._d("line", [v(t, e, s, n, a)], a);
|
|
22711
22789
|
}
|
|
22712
|
-
rectangle(t, e, s, n,
|
|
22713
|
-
const
|
|
22790
|
+
rectangle(t, e, s, n, o) {
|
|
22791
|
+
const a = this._o(o),
|
|
22714
22792
|
h = [],
|
|
22715
|
-
r =
|
|
22716
|
-
if (
|
|
22717
|
-
const
|
|
22718
|
-
"solid" ===
|
|
22793
|
+
r = O(t, e, s, n, a);
|
|
22794
|
+
if (a.fill) {
|
|
22795
|
+
const o = [[t, e], [t + s, e], [t + s, e + n], [t, e + n]];
|
|
22796
|
+
"solid" === a.fillStyle ? h.push(I([o], a)) : h.push(C([o], a));
|
|
22719
22797
|
}
|
|
22720
|
-
return
|
|
22798
|
+
return a.stroke !== tt$1 && h.push(r), this._d("rectangle", h, a);
|
|
22721
22799
|
}
|
|
22722
|
-
ellipse(t, e, s, n,
|
|
22723
|
-
const
|
|
22800
|
+
ellipse(t, e, s, n, o) {
|
|
22801
|
+
const a = this._o(o),
|
|
22724
22802
|
h = [],
|
|
22725
|
-
r =
|
|
22726
|
-
i =
|
|
22727
|
-
if (
|
|
22728
|
-
const s =
|
|
22803
|
+
r = T(s, n, a),
|
|
22804
|
+
i = D(t, e, a, r);
|
|
22805
|
+
if (a.fill) if ("solid" === a.fillStyle) {
|
|
22806
|
+
const s = D(t, e, a, r).opset;
|
|
22729
22807
|
s.type = "fillPath", h.push(s);
|
|
22730
|
-
} else h.push(
|
|
22731
|
-
return
|
|
22808
|
+
} else h.push(C([i.estimatedPoints], a));
|
|
22809
|
+
return a.stroke !== tt$1 && h.push(i.opset), this._d("ellipse", h, a);
|
|
22732
22810
|
}
|
|
22733
22811
|
circle(t, e, s, n) {
|
|
22734
|
-
const
|
|
22735
|
-
return
|
|
22812
|
+
const o = this.ellipse(t, e, s, s, n);
|
|
22813
|
+
return o.shape = "circle", o;
|
|
22736
22814
|
}
|
|
22737
22815
|
linearPath(t, e) {
|
|
22738
22816
|
const s = this._o(e);
|
|
22739
|
-
return this._d("linearPath", [
|
|
22817
|
+
return this._d("linearPath", [S(t, !1, s)], s);
|
|
22740
22818
|
}
|
|
22741
|
-
arc(t, e, s, n,
|
|
22819
|
+
arc(t, e, s, n, o, a) {
|
|
22742
22820
|
let h = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
|
|
22743
22821
|
let r = arguments.length > 7 ? arguments[7] : undefined;
|
|
22744
22822
|
const i = this._o(r),
|
|
22745
22823
|
c = [],
|
|
22746
|
-
l =
|
|
22824
|
+
l = A(t, e, s, n, o, a, h, !0, i);
|
|
22747
22825
|
if (h && i.fill) if ("solid" === i.fillStyle) {
|
|
22748
22826
|
const h = Object.assign({}, i);
|
|
22749
22827
|
h.disableMultiStroke = !0;
|
|
22750
|
-
const r =
|
|
22828
|
+
const r = A(t, e, s, n, o, a, !0, !1, h);
|
|
22751
22829
|
r.type = "fillPath", c.push(r);
|
|
22752
|
-
} else c.push(function (t, e, s, n,
|
|
22830
|
+
} else c.push(function (t, e, s, n, o, a, h) {
|
|
22753
22831
|
const r = t,
|
|
22754
22832
|
i = e;
|
|
22755
22833
|
let c = Math.abs(s / 2),
|
|
22756
22834
|
l = Math.abs(n / 2);
|
|
22757
|
-
c +=
|
|
22758
|
-
let u =
|
|
22759
|
-
p =
|
|
22835
|
+
c += G(.01 * c, h), l += G(.01 * l, h);
|
|
22836
|
+
let u = o,
|
|
22837
|
+
p = a;
|
|
22760
22838
|
for (; u < 0;) u += 2 * Math.PI, p += 2 * Math.PI;
|
|
22761
22839
|
p - u > 2 * Math.PI && (u = 0, p = 2 * Math.PI);
|
|
22762
22840
|
const f = (p - u) / h.curveStepCount,
|
|
22763
22841
|
d = [];
|
|
22764
22842
|
for (let t = u; t <= p; t += f) d.push([r + c * Math.cos(t), i + l * Math.sin(t)]);
|
|
22765
|
-
return d.push([r + c * Math.cos(p), i + l * Math.sin(p)]), d.push([r, i]),
|
|
22766
|
-
}(t, e, s, n,
|
|
22767
|
-
return i.stroke !==
|
|
22843
|
+
return d.push([r + c * Math.cos(p), i + l * Math.sin(p)]), d.push([r, i]), C([d], h);
|
|
22844
|
+
}(t, e, s, n, o, a, i));
|
|
22845
|
+
return i.stroke !== tt$1 && c.push(l), this._d("arc", c, i);
|
|
22768
22846
|
}
|
|
22769
22847
|
curve(t, e) {
|
|
22770
22848
|
const s = this._o(e),
|
|
22771
22849
|
n = [],
|
|
22772
|
-
|
|
22773
|
-
if (s.fill && s.fill !==
|
|
22774
|
-
const e =
|
|
22775
|
-
|
|
22776
|
-
|
|
22777
|
-
|
|
22778
|
-
|
|
22779
|
-
|
|
22780
|
-
|
|
22781
|
-
|
|
22782
|
-
|
|
22783
|
-
|
|
22784
|
-
|
|
22785
|
-
|
|
22786
|
-
|
|
22787
|
-
|
|
22788
|
-
|
|
22789
|
-
|
|
22790
|
-
}
|
|
22791
|
-
return n;
|
|
22792
|
-
}(t), 10, (1 + s.roughness) / 2);
|
|
22793
|
-
"solid" === s.fillStyle ? n.push(S([e], s)) : n.push(L([e], s));
|
|
22850
|
+
o = L(t, s);
|
|
22851
|
+
if (s.fill && s.fill !== tt$1) if ("solid" === s.fillStyle) {
|
|
22852
|
+
const e = L(t, Object.assign(Object.assign({}, s), {
|
|
22853
|
+
disableMultiStroke: !0,
|
|
22854
|
+
roughness: s.roughness ? s.roughness + s.fillShapeRoughnessGain : 0
|
|
22855
|
+
}));
|
|
22856
|
+
n.push({
|
|
22857
|
+
type: "fillPath",
|
|
22858
|
+
ops: this._mergedShape(e.ops)
|
|
22859
|
+
});
|
|
22860
|
+
} else {
|
|
22861
|
+
const e = [],
|
|
22862
|
+
o = t;
|
|
22863
|
+
if (o.length) {
|
|
22864
|
+
const t = "number" == typeof o[0][0] ? [o] : o;
|
|
22865
|
+
for (const n of t) n.length < 3 ? e.push(...n) : 3 === n.length ? e.push(...Y(H([n[0], n[0], n[1], n[2]]), 10, (1 + s.roughness) / 2)) : e.push(...Y(H(n), 10, (1 + s.roughness) / 2));
|
|
22866
|
+
}
|
|
22867
|
+
e.length && n.push(C([e], s));
|
|
22794
22868
|
}
|
|
22795
|
-
return s.stroke !==
|
|
22869
|
+
return s.stroke !== tt$1 && n.push(o), this._d("curve", n, s);
|
|
22796
22870
|
}
|
|
22797
22871
|
polygon(t, e) {
|
|
22798
22872
|
const s = this._o(e),
|
|
22799
22873
|
n = [],
|
|
22800
|
-
|
|
22801
|
-
return s.fill && ("solid" === s.fillStyle ? n.push(
|
|
22874
|
+
o = S(t, !0, s);
|
|
22875
|
+
return s.fill && ("solid" === s.fillStyle ? n.push(I([t], s)) : n.push(C([t], s))), s.stroke !== tt$1 && n.push(o), this._d("polygon", n, s);
|
|
22802
22876
|
}
|
|
22803
22877
|
path(t, e) {
|
|
22804
22878
|
const s = this._o(e),
|
|
22805
22879
|
n = [];
|
|
22806
22880
|
if (!t) return this._d("path", n, s);
|
|
22807
22881
|
t = (t || "").replace(/\n/g, " ").replace(/(-\s)/g, "-").replace("/(ss)/g", " ");
|
|
22808
|
-
const
|
|
22809
|
-
|
|
22882
|
+
const o = s.fill && "transparent" !== s.fill && s.fill !== tt$1,
|
|
22883
|
+
a = s.stroke !== tt$1,
|
|
22810
22884
|
h = !!(s.simplification && s.simplification < 1),
|
|
22811
22885
|
r = function (t, e, s) {
|
|
22812
|
-
const n =
|
|
22813
|
-
|
|
22814
|
-
let
|
|
22886
|
+
const n = m$2(y(b(t))),
|
|
22887
|
+
o = [];
|
|
22888
|
+
let a = [],
|
|
22815
22889
|
h = [0, 0],
|
|
22816
22890
|
r = [];
|
|
22817
22891
|
const i = () => {
|
|
22818
|
-
r.length >= 4 &&
|
|
22892
|
+
r.length >= 4 && a.push(...Y(r, e)), r = [];
|
|
22819
22893
|
},
|
|
22820
22894
|
c = () => {
|
|
22821
|
-
i(),
|
|
22895
|
+
i(), a.length && (o.push(a), a = []);
|
|
22822
22896
|
};
|
|
22823
22897
|
for (const {
|
|
22824
22898
|
key: t,
|
|
22825
22899
|
data: e
|
|
22826
22900
|
} of n) switch (t) {
|
|
22827
22901
|
case "M":
|
|
22828
|
-
c(), h = [e[0], e[1]],
|
|
22902
|
+
c(), h = [e[0], e[1]], a.push(h);
|
|
22829
22903
|
break;
|
|
22830
22904
|
case "L":
|
|
22831
|
-
i(),
|
|
22905
|
+
i(), a.push([e[0], e[1]]);
|
|
22832
22906
|
break;
|
|
22833
22907
|
case "C":
|
|
22834
22908
|
if (!r.length) {
|
|
22835
|
-
const t =
|
|
22909
|
+
const t = a.length ? a[a.length - 1] : h;
|
|
22836
22910
|
r.push([t[0], t[1]]);
|
|
22837
22911
|
}
|
|
22838
22912
|
r.push([e[0], e[1]]), r.push([e[2], e[3]]), r.push([e[4], e[5]]);
|
|
22839
22913
|
break;
|
|
22840
22914
|
case "Z":
|
|
22841
|
-
i(),
|
|
22915
|
+
i(), a.push([h[0], h[1]]);
|
|
22842
22916
|
}
|
|
22843
|
-
if (c(), !s) return
|
|
22917
|
+
if (c(), !s) return o;
|
|
22844
22918
|
const l = [];
|
|
22845
|
-
for (const t of
|
|
22846
|
-
const e =
|
|
22919
|
+
for (const t of o) {
|
|
22920
|
+
const e = U(t, s);
|
|
22847
22921
|
e.length && l.push(e);
|
|
22848
22922
|
}
|
|
22849
22923
|
return l;
|
|
22850
|
-
}(t, 1, h ? 4 - 4 * s.simplification : (1 + s.roughness) / 2)
|
|
22851
|
-
|
|
22852
|
-
|
|
22853
|
-
|
|
22854
|
-
|
|
22855
|
-
|
|
22856
|
-
|
|
22857
|
-
|
|
22858
|
-
|
|
22859
|
-
|
|
22860
|
-
|
|
22861
|
-
|
|
22862
|
-
|
|
22863
|
-
|
|
22864
|
-
|
|
22865
|
-
|
|
22866
|
-
|
|
22867
|
-
op: "move",
|
|
22868
|
-
data: h.map(n => n + (s ? 0 : A(t, e)))
|
|
22869
|
-
}), o = [h[0], h[1]], a = [h[0], h[1]];
|
|
22870
|
-
break;
|
|
22871
|
-
}
|
|
22872
|
-
case "L":
|
|
22873
|
-
n.push(...I(o[0], o[1], h[0], h[1], e)), o = [h[0], h[1]];
|
|
22874
|
-
break;
|
|
22875
|
-
case "C":
|
|
22876
|
-
{
|
|
22877
|
-
const [t, s, a, r, i, c] = h;
|
|
22878
|
-
n.push(...$(t, s, a, r, i, c, o, e)), o = [i, c];
|
|
22879
|
-
break;
|
|
22880
|
-
}
|
|
22881
|
-
case "Z":
|
|
22882
|
-
n.push(...I(o[0], o[1], a[0], a[1], e)), o = [a[0], a[1]];
|
|
22883
|
-
}
|
|
22884
|
-
return {
|
|
22885
|
-
type: "path",
|
|
22886
|
-
ops: n
|
|
22887
|
-
};
|
|
22888
|
-
}(t, s))), this._d("path", n, s);
|
|
22924
|
+
}(t, 1, h ? 4 - 4 * (s.simplification || 1) : (1 + s.roughness) / 2),
|
|
22925
|
+
i = _(t, s);
|
|
22926
|
+
if (o) if ("solid" === s.fillStyle) {
|
|
22927
|
+
if (1 === r.length) {
|
|
22928
|
+
const e = _(t, Object.assign(Object.assign({}, s), {
|
|
22929
|
+
disableMultiStroke: !0,
|
|
22930
|
+
roughness: s.roughness ? s.roughness + s.fillShapeRoughnessGain : 0
|
|
22931
|
+
}));
|
|
22932
|
+
n.push({
|
|
22933
|
+
type: "fillPath",
|
|
22934
|
+
ops: this._mergedShape(e.ops)
|
|
22935
|
+
});
|
|
22936
|
+
} else n.push(I(r, s));
|
|
22937
|
+
} else n.push(C(r, s));
|
|
22938
|
+
return a && (h ? r.forEach(t => {
|
|
22939
|
+
n.push(S(t, !1, s));
|
|
22940
|
+
}) : n.push(i)), this._d("path", n, s);
|
|
22889
22941
|
}
|
|
22890
22942
|
opsToPath(t, e) {
|
|
22891
22943
|
let s = "";
|
|
@@ -22916,15 +22968,15 @@ class N {
|
|
|
22916
22968
|
d: this.opsToPath(t),
|
|
22917
22969
|
stroke: s.stroke,
|
|
22918
22970
|
strokeWidth: s.strokeWidth,
|
|
22919
|
-
fill:
|
|
22971
|
+
fill: tt$1
|
|
22920
22972
|
};
|
|
22921
22973
|
break;
|
|
22922
22974
|
case "fillPath":
|
|
22923
22975
|
e = {
|
|
22924
22976
|
d: this.opsToPath(t),
|
|
22925
|
-
stroke:
|
|
22977
|
+
stroke: tt$1,
|
|
22926
22978
|
strokeWidth: 0,
|
|
22927
|
-
fill: s.fill ||
|
|
22979
|
+
fill: s.fill || tt$1
|
|
22928
22980
|
};
|
|
22929
22981
|
break;
|
|
22930
22982
|
case "fillSketch":
|
|
@@ -22938,34 +22990,37 @@ class N {
|
|
|
22938
22990
|
let s = e.fillWeight;
|
|
22939
22991
|
return s < 0 && (s = e.strokeWidth / 2), {
|
|
22940
22992
|
d: this.opsToPath(t),
|
|
22941
|
-
stroke: e.fill ||
|
|
22993
|
+
stroke: e.fill || tt$1,
|
|
22942
22994
|
strokeWidth: s,
|
|
22943
|
-
fill:
|
|
22995
|
+
fill: tt$1
|
|
22944
22996
|
};
|
|
22945
22997
|
}
|
|
22998
|
+
_mergedShape(t) {
|
|
22999
|
+
return t.filter((t, e) => 0 === e || "move" !== t.op);
|
|
23000
|
+
}
|
|
22946
23001
|
}
|
|
22947
|
-
class
|
|
23002
|
+
class st {
|
|
22948
23003
|
constructor(t, e) {
|
|
22949
|
-
this.canvas = t, this.ctx = this.canvas.getContext("2d"), this.gen = new
|
|
23004
|
+
this.canvas = t, this.ctx = this.canvas.getContext("2d"), this.gen = new et(e);
|
|
22950
23005
|
}
|
|
22951
23006
|
draw(t) {
|
|
22952
23007
|
const e = t.sets || [],
|
|
22953
23008
|
s = t.options || this.getDefaultOptions(),
|
|
22954
23009
|
n = this.ctx,
|
|
22955
|
-
|
|
22956
|
-
for (const
|
|
23010
|
+
o = t.options.fixedDecimalPlaceDigits;
|
|
23011
|
+
for (const a of e) switch (a.type) {
|
|
22957
23012
|
case "path":
|
|
22958
|
-
n.save(), n.strokeStyle = "none" === s.stroke ? "transparent" : s.stroke, n.lineWidth = s.strokeWidth, s.strokeLineDash && n.setLineDash(s.strokeLineDash), s.strokeLineDashOffset && (n.lineDashOffset = s.strokeLineDashOffset), this._drawToContext(n,
|
|
23013
|
+
n.save(), n.strokeStyle = "none" === s.stroke ? "transparent" : s.stroke, n.lineWidth = s.strokeWidth, s.strokeLineDash && n.setLineDash(s.strokeLineDash), s.strokeLineDashOffset && (n.lineDashOffset = s.strokeLineDashOffset), this._drawToContext(n, a, o), n.restore();
|
|
22959
23014
|
break;
|
|
22960
23015
|
case "fillPath":
|
|
22961
23016
|
{
|
|
22962
23017
|
n.save(), n.fillStyle = s.fill || "";
|
|
22963
23018
|
const e = "curve" === t.shape || "polygon" === t.shape || "path" === t.shape ? "evenodd" : "nonzero";
|
|
22964
|
-
this._drawToContext(n,
|
|
23019
|
+
this._drawToContext(n, a, o, e), n.restore();
|
|
22965
23020
|
break;
|
|
22966
23021
|
}
|
|
22967
23022
|
case "fillSketch":
|
|
22968
|
-
this.fillSketch(n,
|
|
23023
|
+
this.fillSketch(n, a, s);
|
|
22969
23024
|
}
|
|
22970
23025
|
}
|
|
22971
23026
|
fillSketch(t, e, s) {
|
|
@@ -22996,21 +23051,21 @@ class B {
|
|
|
22996
23051
|
getDefaultOptions() {
|
|
22997
23052
|
return this.gen.defaultOptions;
|
|
22998
23053
|
}
|
|
22999
|
-
line(t, e, s, n,
|
|
23000
|
-
const
|
|
23001
|
-
return this.draw(
|
|
23054
|
+
line(t, e, s, n, o) {
|
|
23055
|
+
const a = this.gen.line(t, e, s, n, o);
|
|
23056
|
+
return this.draw(a), a;
|
|
23002
23057
|
}
|
|
23003
|
-
rectangle(t, e, s, n,
|
|
23004
|
-
const
|
|
23005
|
-
return this.draw(
|
|
23058
|
+
rectangle(t, e, s, n, o) {
|
|
23059
|
+
const a = this.gen.rectangle(t, e, s, n, o);
|
|
23060
|
+
return this.draw(a), a;
|
|
23006
23061
|
}
|
|
23007
|
-
ellipse(t, e, s, n,
|
|
23008
|
-
const
|
|
23009
|
-
return this.draw(
|
|
23062
|
+
ellipse(t, e, s, n, o) {
|
|
23063
|
+
const a = this.gen.ellipse(t, e, s, n, o);
|
|
23064
|
+
return this.draw(a), a;
|
|
23010
23065
|
}
|
|
23011
23066
|
circle(t, e, s, n) {
|
|
23012
|
-
const
|
|
23013
|
-
return this.draw(
|
|
23067
|
+
const o = this.gen.circle(t, e, s, n);
|
|
23068
|
+
return this.draw(o), o;
|
|
23014
23069
|
}
|
|
23015
23070
|
linearPath(t, e) {
|
|
23016
23071
|
const s = this.gen.linearPath(t, e);
|
|
@@ -23020,10 +23075,10 @@ class B {
|
|
|
23020
23075
|
const s = this.gen.polygon(t, e);
|
|
23021
23076
|
return this.draw(s), s;
|
|
23022
23077
|
}
|
|
23023
|
-
arc(t, e, s, n,
|
|
23078
|
+
arc(t, e, s, n, o, a) {
|
|
23024
23079
|
let h = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
|
|
23025
23080
|
let r = arguments.length > 7 ? arguments[7] : undefined;
|
|
23026
|
-
const i = this.gen.arc(t, e, s, n,
|
|
23081
|
+
const i = this.gen.arc(t, e, s, n, o, a, h, r);
|
|
23027
23082
|
return this.draw(i), i;
|
|
23028
23083
|
}
|
|
23029
23084
|
curve(t, e) {
|
|
@@ -23035,38 +23090,38 @@ class B {
|
|
|
23035
23090
|
return this.draw(s), s;
|
|
23036
23091
|
}
|
|
23037
23092
|
}
|
|
23038
|
-
const
|
|
23039
|
-
class
|
|
23093
|
+
const nt = "http://www.w3.org/2000/svg";
|
|
23094
|
+
class ot {
|
|
23040
23095
|
constructor(t, e) {
|
|
23041
|
-
this.svg = t, this.gen = new
|
|
23096
|
+
this.svg = t, this.gen = new et(e);
|
|
23042
23097
|
}
|
|
23043
23098
|
draw(t) {
|
|
23044
23099
|
const e = t.sets || [],
|
|
23045
23100
|
s = t.options || this.getDefaultOptions(),
|
|
23046
23101
|
n = this.svg.ownerDocument || window.document,
|
|
23047
|
-
|
|
23048
|
-
|
|
23102
|
+
o = n.createElementNS(nt, "g"),
|
|
23103
|
+
a = t.options.fixedDecimalPlaceDigits;
|
|
23049
23104
|
for (const h of e) {
|
|
23050
23105
|
let e = null;
|
|
23051
23106
|
switch (h.type) {
|
|
23052
23107
|
case "path":
|
|
23053
|
-
e = n.createElementNS(
|
|
23108
|
+
e = n.createElementNS(nt, "path"), e.setAttribute("d", this.opsToPath(h, a)), e.setAttribute("stroke", s.stroke), e.setAttribute("stroke-width", s.strokeWidth + ""), e.setAttribute("fill", "none"), s.strokeLineDash && e.setAttribute("stroke-dasharray", s.strokeLineDash.join(" ").trim()), s.strokeLineDashOffset && e.setAttribute("stroke-dashoffset", `${s.strokeLineDashOffset}`);
|
|
23054
23109
|
break;
|
|
23055
23110
|
case "fillPath":
|
|
23056
|
-
e = n.createElementNS(
|
|
23111
|
+
e = n.createElementNS(nt, "path"), e.setAttribute("d", this.opsToPath(h, a)), e.setAttribute("stroke", "none"), e.setAttribute("stroke-width", "0"), e.setAttribute("fill", s.fill || ""), "curve" !== t.shape && "polygon" !== t.shape || e.setAttribute("fill-rule", "evenodd");
|
|
23057
23112
|
break;
|
|
23058
23113
|
case "fillSketch":
|
|
23059
23114
|
e = this.fillSketch(n, h, s);
|
|
23060
23115
|
}
|
|
23061
|
-
e &&
|
|
23116
|
+
e && o.appendChild(e);
|
|
23062
23117
|
}
|
|
23063
|
-
return
|
|
23118
|
+
return o;
|
|
23064
23119
|
}
|
|
23065
23120
|
fillSketch(t, e, s) {
|
|
23066
23121
|
let n = s.fillWeight;
|
|
23067
23122
|
n < 0 && (n = s.strokeWidth / 2);
|
|
23068
|
-
const
|
|
23069
|
-
return
|
|
23123
|
+
const o = t.createElementNS(nt, "path");
|
|
23124
|
+
return o.setAttribute("d", this.opsToPath(e, s.fixedDecimalPlaceDigits)), o.setAttribute("stroke", s.fill || ""), o.setAttribute("stroke-width", n + ""), o.setAttribute("fill", "none"), s.fillLineDash && o.setAttribute("stroke-dasharray", s.fillLineDash.join(" ").trim()), s.fillLineDashOffset && o.setAttribute("stroke-dashoffset", `${s.fillLineDashOffset}`), o;
|
|
23070
23125
|
}
|
|
23071
23126
|
get generator() {
|
|
23072
23127
|
return this.gen;
|
|
@@ -23077,21 +23132,21 @@ class K {
|
|
|
23077
23132
|
opsToPath(t, e) {
|
|
23078
23133
|
return this.gen.opsToPath(t, e);
|
|
23079
23134
|
}
|
|
23080
|
-
line(t, e, s, n,
|
|
23081
|
-
const
|
|
23082
|
-
return this.draw(
|
|
23135
|
+
line(t, e, s, n, o) {
|
|
23136
|
+
const a = this.gen.line(t, e, s, n, o);
|
|
23137
|
+
return this.draw(a);
|
|
23083
23138
|
}
|
|
23084
|
-
rectangle(t, e, s, n,
|
|
23085
|
-
const
|
|
23086
|
-
return this.draw(
|
|
23139
|
+
rectangle(t, e, s, n, o) {
|
|
23140
|
+
const a = this.gen.rectangle(t, e, s, n, o);
|
|
23141
|
+
return this.draw(a);
|
|
23087
23142
|
}
|
|
23088
|
-
ellipse(t, e, s, n,
|
|
23089
|
-
const
|
|
23090
|
-
return this.draw(
|
|
23143
|
+
ellipse(t, e, s, n, o) {
|
|
23144
|
+
const a = this.gen.ellipse(t, e, s, n, o);
|
|
23145
|
+
return this.draw(a);
|
|
23091
23146
|
}
|
|
23092
23147
|
circle(t, e, s, n) {
|
|
23093
|
-
const
|
|
23094
|
-
return this.draw(
|
|
23148
|
+
const o = this.gen.circle(t, e, s, n);
|
|
23149
|
+
return this.draw(o);
|
|
23095
23150
|
}
|
|
23096
23151
|
linearPath(t, e) {
|
|
23097
23152
|
const s = this.gen.linearPath(t, e);
|
|
@@ -23101,10 +23156,10 @@ class K {
|
|
|
23101
23156
|
const s = this.gen.polygon(t, e);
|
|
23102
23157
|
return this.draw(s);
|
|
23103
23158
|
}
|
|
23104
|
-
arc(t, e, s, n,
|
|
23159
|
+
arc(t, e, s, n, o, a) {
|
|
23105
23160
|
let h = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
|
|
23106
23161
|
let r = arguments.length > 7 ? arguments[7] : undefined;
|
|
23107
|
-
const i = this.gen.arc(t, e, s, n,
|
|
23162
|
+
const i = this.gen.arc(t, e, s, n, o, a, h, r);
|
|
23108
23163
|
return this.draw(i);
|
|
23109
23164
|
}
|
|
23110
23165
|
curve(t, e) {
|
|
@@ -23116,11 +23171,11 @@ class K {
|
|
|
23116
23171
|
return this.draw(s);
|
|
23117
23172
|
}
|
|
23118
23173
|
}
|
|
23119
|
-
var
|
|
23120
|
-
canvas: (t, e) => new
|
|
23121
|
-
svg: (t, e) => new
|
|
23122
|
-
generator: t => new
|
|
23123
|
-
newSeed: () =>
|
|
23174
|
+
var at = {
|
|
23175
|
+
canvas: (t, e) => new st(t, e),
|
|
23176
|
+
svg: (t, e) => new ot(t, e),
|
|
23177
|
+
generator: t => new et(t),
|
|
23178
|
+
newSeed: () => et.newSeed()
|
|
23124
23179
|
};
|
|
23125
23180
|
|
|
23126
23181
|
const defaultRouthThemeSpec = {
|
|
@@ -23559,7 +23614,7 @@ class RoughBaseRender {
|
|
|
23559
23614
|
} = drawContext;
|
|
23560
23615
|
if (!context) return;
|
|
23561
23616
|
const canvas = context.canvas.nativeCanvas,
|
|
23562
|
-
rc =
|
|
23617
|
+
rc = at.canvas(canvas),
|
|
23563
23618
|
customPath = new CustomPath2D(),
|
|
23564
23619
|
roughContext = new RoughContext2d(context, customPath);
|
|
23565
23620
|
context.save(), context.transformFromMatrix(graphic.transMatrix, !0);
|
|
@@ -23657,7 +23712,7 @@ let RoughCanvasArcRender = class extends RoughBaseRender {
|
|
|
23657
23712
|
} = drawContext;
|
|
23658
23713
|
if (!context) return;
|
|
23659
23714
|
const canvas = context.canvas.nativeCanvas,
|
|
23660
|
-
rc =
|
|
23715
|
+
rc = at.canvas(canvas);
|
|
23661
23716
|
context.highPerformanceSave();
|
|
23662
23717
|
const arcAttribute = arc.getGraphicTheme();
|
|
23663
23718
|
let {
|
|
@@ -23745,7 +23800,7 @@ let RoughCanvasAreaRender = class extends DefaultCanvasAreaRender {
|
|
|
23745
23800
|
if (fillCb) return super.drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb);
|
|
23746
23801
|
context.highPerformanceSave();
|
|
23747
23802
|
const canvas = context.canvas.nativeCanvas,
|
|
23748
|
-
rc =
|
|
23803
|
+
rc = at.canvas(canvas, {}),
|
|
23749
23804
|
customPath = new CustomPath2D();
|
|
23750
23805
|
drawAreaSegments(customPath, cache, clipRange, {
|
|
23751
23806
|
offsetX: offsetX,
|
|
@@ -23835,7 +23890,7 @@ let RoughCanvasCircleRender = class extends RoughBaseRender {
|
|
|
23835
23890
|
} = drawContext;
|
|
23836
23891
|
if (!context) return;
|
|
23837
23892
|
const canvas = context.canvas.nativeCanvas,
|
|
23838
|
-
rc =
|
|
23893
|
+
rc = at.canvas(canvas, {}),
|
|
23839
23894
|
circleAttribute = circle.getGraphicTheme();
|
|
23840
23895
|
let {
|
|
23841
23896
|
x = circleAttribute.x,
|
|
@@ -23909,7 +23964,7 @@ let RoughCanvasPathRender = class extends RoughBaseRender {
|
|
|
23909
23964
|
} = drawContext;
|
|
23910
23965
|
if (!context) return;
|
|
23911
23966
|
const canvas = context.canvas.nativeCanvas,
|
|
23912
|
-
rc =
|
|
23967
|
+
rc = at.canvas(canvas, {});
|
|
23913
23968
|
context.highPerformanceSave();
|
|
23914
23969
|
const pathAttribute = path.getGraphicTheme();
|
|
23915
23970
|
context.transformFromMatrix(path.transMatrix, !0);
|
|
@@ -39269,7 +39324,7 @@ class ArcSegment extends Segment {
|
|
|
39269
39324
|
|
|
39270
39325
|
var AXIS_ELEMENT_NAME;
|
|
39271
39326
|
!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.
|
|
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";
|
|
39273
39328
|
}(AXIS_ELEMENT_NAME || (AXIS_ELEMENT_NAME = {}));
|
|
39274
39329
|
var AxisStateValue;
|
|
39275
39330
|
!function (AxisStateValue) {
|
|
@@ -40297,7 +40352,7 @@ var __rest$b = undefined && undefined.__rest || function (s, e) {
|
|
|
40297
40352
|
loadLineAxisComponent();
|
|
40298
40353
|
class LineAxis extends AxisBase {
|
|
40299
40354
|
constructor(attributes, options) {
|
|
40300
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options)
|
|
40355
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options);
|
|
40301
40356
|
}
|
|
40302
40357
|
_renderInner(container) {
|
|
40303
40358
|
var _a;
|
|
@@ -40359,15 +40414,6 @@ class LineAxis extends AxisBase {
|
|
|
40359
40414
|
}, panel.style));
|
|
40360
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);
|
|
40361
40416
|
}
|
|
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);
|
|
40371
40417
|
}
|
|
40372
40418
|
renderLine(container) {
|
|
40373
40419
|
const {
|
|
@@ -40508,78 +40554,6 @@ class LineAxis extends AxisBase {
|
|
|
40508
40554
|
visible: !0
|
|
40509
40555
|
}, background.style)), attrs;
|
|
40510
40556
|
}
|
|
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
|
-
}
|
|
40583
40557
|
getTextBaseline(vector, inside) {
|
|
40584
40558
|
let base = "middle";
|
|
40585
40559
|
const {
|
|
@@ -40770,28 +40744,6 @@ class LineAxis extends AxisBase {
|
|
|
40770
40744
|
}
|
|
40771
40745
|
return limitLength && (limitLength = (limitLength - labelSpace - titleSpacing - titleHeight - axisLineWidth - tickLength) / layerCount), limitLength;
|
|
40772
40746
|
}
|
|
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), "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
|
-
}), "left" === this.attribute.orient || "right" === this.attribute.orient ? this.labelHoverOnAxisGroup.setAttributes({
|
|
40790
|
-
y: -1e5
|
|
40791
|
-
}) : this.labelHoverOnAxisGroup.setAttributes({
|
|
40792
|
-
x: -1e5
|
|
40793
|
-
}));
|
|
40794
|
-
}
|
|
40795
40747
|
release() {
|
|
40796
40748
|
super.release(), this._breaks = null;
|
|
40797
40749
|
}
|
|
@@ -42850,7 +42802,16 @@ class LabelBase extends AnimateComponent {
|
|
|
42850
42802
|
data = data.filter(d => !seenIds.has(d.id) && seenIds.add(d.id));
|
|
42851
42803
|
}
|
|
42852
42804
|
let labels = this._initText(data);
|
|
42853
|
-
labels = isFunction$1(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this) : this._layout(labels)
|
|
42805
|
+
labels = isFunction$1(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this) : this._layout(labels);
|
|
42806
|
+
const filteredLabels = [],
|
|
42807
|
+
overlapLabels = labels;
|
|
42808
|
+
if (!isBoolean$1(overlap) && isFunction$1(overlap.filterBeforeOverlap)) {
|
|
42809
|
+
const getRelatedGraphic = this.getRelatedGraphic.bind(this);
|
|
42810
|
+
labels.forEach(label => {
|
|
42811
|
+
overlap.filterBeforeOverlap(label, getRelatedGraphic, this) ? overlapLabels.push(label) : filteredLabels.push(label);
|
|
42812
|
+
});
|
|
42813
|
+
}
|
|
42814
|
+
isFunction$1(customOverlapFunc) ? labels = customOverlapFunc(overlapLabels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this).concat(filteredLabels) : !1 !== overlap && (labels = this._overlapping(overlapLabels).concat(filteredLabels)), isFunction$1(this.attribute.onAfterOverlapping) && this.attribute.onAfterOverlapping(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this), labels && labels.length && labels.forEach(label => {
|
|
42854
42815
|
this._bindEvent(label), this._setStatesOfText(label);
|
|
42855
42816
|
}), !1 !== smartInvert && this._smartInvert(labels), this._renderLabels(labels), !1 !== this._enableAnimation && this._baseMarks.forEach((mark, index) => {
|
|
42856
42817
|
mark.initAttributes(markAttributeList[index]);
|
|
@@ -52850,7 +52811,7 @@ TableSeriesNumber.defaultAttributes = {
|
|
|
52850
52811
|
select: !0
|
|
52851
52812
|
};
|
|
52852
52813
|
|
|
52853
|
-
const version = "1.0.25
|
|
52814
|
+
const version = "1.0.25";
|
|
52854
52815
|
preLoadAllModule();
|
|
52855
52816
|
if (isBrowserEnv()) {
|
|
52856
52817
|
loadBrowserEnv(container);
|