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