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