vvplot 0.5.1 → 0.5.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/dist/vvplot.esm.js +437 -454
- package/dist/vvplot.esm.min.js +13 -13
- package/dist/vvplot.global.js +437 -454
- package/dist/vvplot.global.min.js +10 -10
- package/package.json +1 -1
package/dist/vvplot.global.js
CHANGED
|
@@ -7350,9 +7350,9 @@ var VVPlot = (function(exports, vue) {
|
|
|
7350
7350
|
}
|
|
7351
7351
|
getComputedLayers() {
|
|
7352
7352
|
return this.layers.map((layer) => {
|
|
7353
|
-
let data =
|
|
7353
|
+
let data = layer.data.$group.map(
|
|
7354
7354
|
(_, i) => vvgeom[layer.geom].validate(object_map(layer.data, (k, v) => v?.[i]))
|
|
7355
|
-
).filter((x2) => x2 != null)
|
|
7355
|
+
).filter((x2) => x2 != null);
|
|
7356
7356
|
return { data, geom: layer.geom, vBind: layer.vBind };
|
|
7357
7357
|
});
|
|
7358
7358
|
}
|
|
@@ -16038,83 +16038,81 @@ var VVPlot = (function(exports, vue) {
|
|
|
16038
16038
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16039
16039
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16040
16040
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16041
|
-
for (
|
|
16042
|
-
|
|
16043
|
-
|
|
16044
|
-
|
|
16045
|
-
|
|
16046
|
-
|
|
16047
|
-
|
|
16048
|
-
|
|
16049
|
-
|
|
16050
|
-
|
|
16051
|
-
|
|
16052
|
-
|
|
16053
|
-
|
|
16054
|
-
|
|
16055
|
-
|
|
16056
|
-
|
|
16057
|
-
|
|
16058
|
-
|
|
16059
|
-
|
|
16060
|
-
|
|
16061
|
-
|
|
16062
|
-
|
|
16063
|
-
|
|
16064
|
-
|
|
16065
|
-
|
|
16066
|
-
|
|
16067
|
-
}
|
|
16068
|
-
|
|
16069
|
-
|
|
16070
|
-
|
|
16071
|
-
|
|
16072
|
-
|
|
16073
|
-
|
|
16074
|
-
|
|
16075
|
-
|
|
16076
|
-
|
|
16077
|
-
|
|
16078
|
-
|
|
16079
|
-
|
|
16080
|
-
|
|
16081
|
-
|
|
16082
|
-
|
|
16083
|
-
|
|
16084
|
-
|
|
16085
|
-
|
|
16086
|
-
|
|
16087
|
-
|
|
16088
|
-
|
|
16089
|
-
|
|
16090
|
-
|
|
16091
|
-
|
|
16092
|
-
|
|
16093
|
-
|
|
16094
|
-
|
|
16095
|
-
|
|
16096
|
-
|
|
16097
|
-
|
|
16098
|
-
|
|
16099
|
-
|
|
16100
|
-
|
|
16101
|
-
|
|
16102
|
-
|
|
16041
|
+
for (let {
|
|
16042
|
+
x: x2,
|
|
16043
|
+
xmin,
|
|
16044
|
+
xmax,
|
|
16045
|
+
y: y2,
|
|
16046
|
+
ymin,
|
|
16047
|
+
ymax,
|
|
16048
|
+
lwisker,
|
|
16049
|
+
Q1,
|
|
16050
|
+
median,
|
|
16051
|
+
Q3,
|
|
16052
|
+
uwisker,
|
|
16053
|
+
outliers,
|
|
16054
|
+
$xmin,
|
|
16055
|
+
$xmax,
|
|
16056
|
+
$ymin,
|
|
16057
|
+
$ymax,
|
|
16058
|
+
fill = "white",
|
|
16059
|
+
color: color2 = "black",
|
|
16060
|
+
linewidth = 1,
|
|
16061
|
+
linetype,
|
|
16062
|
+
alpha: alpha2,
|
|
16063
|
+
"translate-x": translateX = 0,
|
|
16064
|
+
"translate-y": translateY = 0,
|
|
16065
|
+
$raw
|
|
16066
|
+
} of __props.data) {
|
|
16067
|
+
const { hmin: rx1, hmax: rx2, vmin: ry1, vmax: ry2 } = __props.coord2pos(x2 == null ? { ymin, ymax, xmin: Q1, xmax: Q3 } : { xmin, xmax, ymin: Q1, ymax: Q3 });
|
|
16068
|
+
const { h: lx1, v: ly1 } = __props.coord2pos(x2 == null ? { y: y2, x: lwisker } : { x: x2, y: lwisker });
|
|
16069
|
+
const { h: lx2, v: ly2 } = __props.coord2pos(x2 == null ? { y: y2, x: uwisker } : { x: x2, y: uwisker });
|
|
16070
|
+
const { h: mx1, v: my1 } = __props.coord2pos(x2 == null ? { y: ymin, x: median } : { x: xmin, y: median });
|
|
16071
|
+
const { h: mx2, v: my2 } = __props.coord2pos(x2 == null ? { y: ymax, x: median } : { x: xmax, y: median });
|
|
16072
|
+
const { h: uwx1, v: uwy1 } = __props.coord2pos(x2 == null ? { y: ymin * 0.25 + ymax * 0.75, x: uwisker } : { x: xmin * 0.25 + xmax * 0.75, y: uwisker });
|
|
16073
|
+
const { h: uwx2, v: uwy2 } = __props.coord2pos(x2 == null ? { y: ymin * 0.75 + ymax * 0.25, x: uwisker } : { x: xmin * 0.75 + xmax * 0.25, y: uwisker });
|
|
16074
|
+
const { h: lwx1, v: lwy1 } = __props.coord2pos(x2 == null ? { y: ymin * 0.25 + ymax * 0.75, x: lwisker } : { x: xmin * 0.25 + xmax * 0.75, y: lwisker });
|
|
16075
|
+
const { h: lwx2, v: lwy2 } = __props.coord2pos(x2 == null ? { y: ymin * 0.75 + ymax * 0.25, x: lwisker } : { x: xmin * 0.75 + xmax * 0.25, y: lwisker });
|
|
16076
|
+
ctx.globalAlpha = alpha2;
|
|
16077
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16078
|
+
const linepath2d = new Path2D();
|
|
16079
|
+
linepath2d.moveTo(lx1 + translateX, ly1 + translateY);
|
|
16080
|
+
linepath2d.lineTo(lx2 + translateX, ly2 + translateY);
|
|
16081
|
+
const wiskerpath2d = new Path2D();
|
|
16082
|
+
wiskerpath2d.moveTo(uwx1 + translateX, uwy1 + translateY);
|
|
16083
|
+
wiskerpath2d.lineTo(uwx2 + translateX, uwy2 + translateY);
|
|
16084
|
+
wiskerpath2d.moveTo(lwx1 + translateX, lwy1 + translateY);
|
|
16085
|
+
wiskerpath2d.lineTo(lwx2 + translateX, lwy2 + translateY);
|
|
16086
|
+
const rectpath2d = new Path2D();
|
|
16087
|
+
rectpath2d.rect(rx1 + translateX, ry1 + translateY, rx2 - rx1, ry2 - ry1);
|
|
16088
|
+
_path_data.set(rectpath2d, $raw);
|
|
16089
|
+
const medianpath2d = new Path2D();
|
|
16090
|
+
medianpath2d.moveTo(mx1 + translateX, my1 + translateY);
|
|
16091
|
+
medianpath2d.lineTo(mx2 + translateX, my2 + translateY);
|
|
16092
|
+
if (color2 != null && color2 !== "none") {
|
|
16093
|
+
ctx.strokeStyle = color2;
|
|
16094
|
+
ctx.lineWidth = linewidth;
|
|
16095
|
+
ctx.stroke(linepath2d);
|
|
16096
|
+
ctx.stroke(wiskerpath2d);
|
|
16097
|
+
}
|
|
16098
|
+
if (fill !== "none") {
|
|
16099
|
+
ctx.fillStyle = fill;
|
|
16100
|
+
ctx.fill(rectpath2d);
|
|
16101
|
+
}
|
|
16102
|
+
if (color2 != null && color2 !== "none") {
|
|
16103
|
+
ctx.stroke(rectpath2d);
|
|
16104
|
+
ctx.lineWidth = linewidth * 2;
|
|
16105
|
+
ctx.stroke(medianpath2d);
|
|
16106
|
+
}
|
|
16107
|
+
for (let { x: x3, y: y3, $raw: $raw2 } of outliers) {
|
|
16108
|
+
const { h: ox, v: oy } = __props.coord2pos({ x: x3, y: y3 });
|
|
16109
|
+
const outlierpath2d = new Path2D();
|
|
16110
|
+
outlierpath2d.arc(ox + translateX, oy + translateY, 2, 0, Math.PI * 2);
|
|
16103
16111
|
if (color2 != null && color2 !== "none") {
|
|
16104
|
-
ctx.
|
|
16105
|
-
ctx.
|
|
16106
|
-
ctx.stroke(medianpath2d);
|
|
16107
|
-
}
|
|
16108
|
-
for (let { x: x3, y: y3, $raw: $raw2 } of outliers) {
|
|
16109
|
-
const { h: ox, v: oy } = __props.coord2pos({ x: x3, y: y3 });
|
|
16110
|
-
const outlierpath2d = new Path2D();
|
|
16111
|
-
outlierpath2d.arc(ox + translateX, oy + translateY, 2, 0, Math.PI * 2);
|
|
16112
|
-
if (color2 != null && color2 !== "none") {
|
|
16113
|
-
ctx.fillStyle = color2;
|
|
16114
|
-
ctx.fill(outlierpath2d);
|
|
16115
|
-
}
|
|
16116
|
-
_path_data.set(outlierpath2d, $raw2);
|
|
16112
|
+
ctx.fillStyle = color2;
|
|
16113
|
+
ctx.fill(outlierpath2d);
|
|
16117
16114
|
}
|
|
16115
|
+
_path_data.set(outlierpath2d, $raw2);
|
|
16118
16116
|
}
|
|
16119
16117
|
}
|
|
16120
16118
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16180,41 +16178,39 @@ var VVPlot = (function(exports, vue) {
|
|
|
16180
16178
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16181
16179
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16182
16180
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16183
|
-
for (
|
|
16184
|
-
|
|
16185
|
-
|
|
16186
|
-
|
|
16187
|
-
|
|
16188
|
-
|
|
16189
|
-
|
|
16190
|
-
|
|
16191
|
-
|
|
16192
|
-
|
|
16193
|
-
|
|
16194
|
-
|
|
16195
|
-
}
|
|
16196
|
-
|
|
16197
|
-
|
|
16198
|
-
|
|
16199
|
-
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
|
|
16203
|
-
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
|
|
16209
|
-
|
|
16210
|
-
|
|
16211
|
-
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
|
|
16215
|
-
|
|
16216
|
-
ctx.stroke(path2d);
|
|
16217
|
-
}
|
|
16181
|
+
for (let {
|
|
16182
|
+
points,
|
|
16183
|
+
fill,
|
|
16184
|
+
color: color2,
|
|
16185
|
+
linewidth,
|
|
16186
|
+
linetype,
|
|
16187
|
+
alpha: alpha2,
|
|
16188
|
+
"translate-x": translateX = 0,
|
|
16189
|
+
"translate-y": translateY = 0,
|
|
16190
|
+
$raw,
|
|
16191
|
+
interpolate: interpolate2
|
|
16192
|
+
} of __props.data) {
|
|
16193
|
+
points = points.map((p) => (({ h: x2, v: y2 }) => ({ x: x2, y: y2 }))(__props.coord2pos(p))).filter((p) => p.x != null && p.y != null);
|
|
16194
|
+
if (points.length === 0) continue;
|
|
16195
|
+
const path2d = new Path2D();
|
|
16196
|
+
let interpolatorFn = typeof interpolate2 == "function" ? interpolate2 : interpolators[interpolate2] ?? natural$1;
|
|
16197
|
+
let interpolator = interpolatorFn(path2d);
|
|
16198
|
+
interpolator.lineStart();
|
|
16199
|
+
for (let i = 0; i < points.length; i++) {
|
|
16200
|
+
interpolator.point(points[i].x + translateX, points[i].y + translateY);
|
|
16201
|
+
}
|
|
16202
|
+
interpolator.lineEnd();
|
|
16203
|
+
_path_data.set(path2d, $raw);
|
|
16204
|
+
ctx.lineWidth = linewidth;
|
|
16205
|
+
ctx.globalAlpha = alpha2;
|
|
16206
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16207
|
+
if (fill !== "none") {
|
|
16208
|
+
ctx.fillStyle = fill;
|
|
16209
|
+
ctx.fill(path2d);
|
|
16210
|
+
}
|
|
16211
|
+
if (color2 != null && color2 !== "none") {
|
|
16212
|
+
ctx.strokeStyle = color2;
|
|
16213
|
+
ctx.stroke(path2d);
|
|
16218
16214
|
}
|
|
16219
16215
|
}
|
|
16220
16216
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16289,46 +16285,44 @@ var VVPlot = (function(exports, vue) {
|
|
|
16289
16285
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16290
16286
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16291
16287
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16292
|
-
for (
|
|
16293
|
-
|
|
16294
|
-
|
|
16295
|
-
|
|
16296
|
-
|
|
16297
|
-
|
|
16298
|
-
|
|
16299
|
-
|
|
16300
|
-
|
|
16301
|
-
|
|
16302
|
-
|
|
16303
|
-
|
|
16304
|
-
|
|
16305
|
-
|
|
16306
|
-
|
|
16307
|
-
|
|
16308
|
-
|
|
16309
|
-
|
|
16310
|
-
|
|
16311
|
-
|
|
16312
|
-
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
|
|
16318
|
-
|
|
16319
|
-
|
|
16320
|
-
|
|
16321
|
-
|
|
16322
|
-
|
|
16323
|
-
|
|
16324
|
-
|
|
16325
|
-
|
|
16326
|
-
|
|
16327
|
-
|
|
16328
|
-
|
|
16329
|
-
|
|
16330
|
-
ctx.stroke(path2d);
|
|
16331
|
-
}
|
|
16288
|
+
for (let {
|
|
16289
|
+
cx,
|
|
16290
|
+
cy,
|
|
16291
|
+
A,
|
|
16292
|
+
B,
|
|
16293
|
+
C,
|
|
16294
|
+
fill,
|
|
16295
|
+
color: color2,
|
|
16296
|
+
linewidth,
|
|
16297
|
+
linetype,
|
|
16298
|
+
alpha: alpha2,
|
|
16299
|
+
"translate-x": translateX = 0,
|
|
16300
|
+
"translate-y": translateY = 0,
|
|
16301
|
+
$raw
|
|
16302
|
+
} of __props.data) {
|
|
16303
|
+
let dx = Math.sqrt(C / (A * C - B * B)), dy = Math.sqrt(A / (A * C - B * B));
|
|
16304
|
+
const { h: ch, v: cv } = __props.coord2pos({ x: cx, y: cy });
|
|
16305
|
+
let { h: h1, v: v1 } = __props.coord2pos({ x: cx - dx, y: cy - dy }), { h: h2, v: v2 } = __props.coord2pos({ x: cx + dx, y: cy + dy });
|
|
16306
|
+
let scaleX = (h2 - h1) / (2 * dx), scaleY = (v2 - v1) / (2 * dy);
|
|
16307
|
+
A /= scaleX * scaleX;
|
|
16308
|
+
B /= scaleX * scaleY;
|
|
16309
|
+
C /= scaleY * scaleY;
|
|
16310
|
+
const tr = A + C, det = A * C - B * B;
|
|
16311
|
+
const disc = Math.sqrt(Math.max(0, tr * tr / 4 - det));
|
|
16312
|
+
let rx2 = 1 / Math.sqrt(tr / 2 + disc), ry = 1 / Math.sqrt(tr / 2 - disc), angle2 = Math.atan2(2 * B, A - C) / 2;
|
|
16313
|
+
const path2d = new Path2D();
|
|
16314
|
+
path2d.ellipse(ch + translateX, cv + translateY, rx2, ry, angle2, 0, 2 * Math.PI);
|
|
16315
|
+
_path_data.set(path2d, $raw);
|
|
16316
|
+
ctx.lineWidth = linewidth;
|
|
16317
|
+
ctx.globalAlpha = alpha2;
|
|
16318
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16319
|
+
if (fill !== "none") {
|
|
16320
|
+
ctx.fillStyle = fill;
|
|
16321
|
+
ctx.fill(path2d);
|
|
16322
|
+
}
|
|
16323
|
+
if (color2 != null && color2 !== "none") {
|
|
16324
|
+
ctx.strokeStyle = color2;
|
|
16325
|
+
ctx.stroke(path2d);
|
|
16332
16326
|
}
|
|
16333
16327
|
}
|
|
16334
16328
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16394,33 +16388,31 @@ var VVPlot = (function(exports, vue) {
|
|
|
16394
16388
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16395
16389
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16396
16390
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16397
|
-
for (
|
|
16398
|
-
|
|
16399
|
-
|
|
16400
|
-
|
|
16401
|
-
|
|
16402
|
-
|
|
16403
|
-
|
|
16404
|
-
|
|
16405
|
-
|
|
16406
|
-
|
|
16407
|
-
|
|
16408
|
-
|
|
16409
|
-
|
|
16410
|
-
}
|
|
16411
|
-
|
|
16412
|
-
|
|
16413
|
-
|
|
16414
|
-
|
|
16415
|
-
|
|
16416
|
-
|
|
16417
|
-
|
|
16418
|
-
|
|
16419
|
-
|
|
16420
|
-
|
|
16421
|
-
|
|
16422
|
-
ctx.stroke(path2d);
|
|
16423
|
-
}
|
|
16391
|
+
for (let {
|
|
16392
|
+
x: x2,
|
|
16393
|
+
y: y2,
|
|
16394
|
+
xend,
|
|
16395
|
+
yend,
|
|
16396
|
+
color: color2 = "black",
|
|
16397
|
+
linewidth,
|
|
16398
|
+
alpha: alpha2,
|
|
16399
|
+
linetype,
|
|
16400
|
+
"translate-x": translateX = 0,
|
|
16401
|
+
"translate-y": translateY = 0,
|
|
16402
|
+
$raw
|
|
16403
|
+
} of __props.data) {
|
|
16404
|
+
const { h: x1, v: y1 } = __props.coord2pos({ x: x2, y: y2 });
|
|
16405
|
+
const { h: x22, v: y22 } = __props.coord2pos({ x: xend, y: yend });
|
|
16406
|
+
const path2d = new Path2D();
|
|
16407
|
+
path2d.moveTo(x1 + translateX, y1 + translateY);
|
|
16408
|
+
path2d.lineTo(x22 + translateX, y22 + translateY);
|
|
16409
|
+
_path_data.set(path2d, $raw);
|
|
16410
|
+
ctx.lineWidth = linewidth;
|
|
16411
|
+
ctx.globalAlpha = alpha2;
|
|
16412
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16413
|
+
if (color2 != null && color2 !== "none") {
|
|
16414
|
+
ctx.strokeStyle = color2;
|
|
16415
|
+
ctx.stroke(path2d);
|
|
16424
16416
|
}
|
|
16425
16417
|
}
|
|
16426
16418
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16494,55 +16486,53 @@ var VVPlot = (function(exports, vue) {
|
|
|
16494
16486
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16495
16487
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16496
16488
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16497
|
-
for (
|
|
16498
|
-
|
|
16499
|
-
|
|
16500
|
-
|
|
16501
|
-
|
|
16502
|
-
|
|
16503
|
-
|
|
16504
|
-
|
|
16505
|
-
|
|
16506
|
-
|
|
16507
|
-
|
|
16508
|
-
|
|
16509
|
-
|
|
16510
|
-
|
|
16511
|
-
|
|
16512
|
-
}
|
|
16513
|
-
|
|
16514
|
-
|
|
16515
|
-
|
|
16516
|
-
|
|
16517
|
-
|
|
16518
|
-
|
|
16519
|
-
|
|
16520
|
-
|
|
16521
|
-
|
|
16522
|
-
|
|
16523
|
-
|
|
16524
|
-
|
|
16525
|
-
|
|
16526
|
-
|
|
16527
|
-
|
|
16528
|
-
|
|
16529
|
-
|
|
16530
|
-
|
|
16531
|
-
|
|
16532
|
-
|
|
16533
|
-
|
|
16534
|
-
|
|
16535
|
-
|
|
16536
|
-
|
|
16537
|
-
|
|
16538
|
-
|
|
16539
|
-
|
|
16540
|
-
|
|
16541
|
-
|
|
16542
|
-
|
|
16543
|
-
|
|
16544
|
-
ctx.stroke(path2d);
|
|
16545
|
-
}
|
|
16489
|
+
for (let {
|
|
16490
|
+
x: x2,
|
|
16491
|
+
y: y2,
|
|
16492
|
+
size = 6,
|
|
16493
|
+
shape: shape2,
|
|
16494
|
+
color: color2,
|
|
16495
|
+
stroke,
|
|
16496
|
+
linewidth,
|
|
16497
|
+
linetype,
|
|
16498
|
+
alpha: alpha2,
|
|
16499
|
+
"translate-x": translateX = 0,
|
|
16500
|
+
"translate-y": translateY = 0,
|
|
16501
|
+
angle: angle2 = 0,
|
|
16502
|
+
$raw
|
|
16503
|
+
} of __props.data) {
|
|
16504
|
+
const { h: cx, v: cy } = __props.coord2pos({ x: x2, y: y2 });
|
|
16505
|
+
if (typeof angle2 == "object") {
|
|
16506
|
+
let { dx = 0, dy = 0 } = angle2;
|
|
16507
|
+
let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
|
|
16508
|
+
angle2 = Math.atan2(v - cy, h - cx) * 180 / Math.PI;
|
|
16509
|
+
}
|
|
16510
|
+
const path2d = new Path2D();
|
|
16511
|
+
if (String(shape2).startsWith("path:")) {
|
|
16512
|
+
path2d.addPath(
|
|
16513
|
+
new Path2D(shape2.slice(5)),
|
|
16514
|
+
new DOMMatrix().translateSelf(cx + translateX, cy + translateY).rotate(angle2)
|
|
16515
|
+
);
|
|
16516
|
+
} else if (shape2 in paths) {
|
|
16517
|
+
path2d.addPath(
|
|
16518
|
+
new Path2D(paths[shape2](size)),
|
|
16519
|
+
new DOMMatrix().translate(cx + translateX, cy + translateY).rotate(angle2)
|
|
16520
|
+
);
|
|
16521
|
+
} else {
|
|
16522
|
+
path2d.arc(cx + translateX, cy + translateY, size / 2, 0, Math.PI * 2);
|
|
16523
|
+
}
|
|
16524
|
+
_path_data.set(path2d, $raw);
|
|
16525
|
+
ctx.lineWidth = linewidth;
|
|
16526
|
+
ctx.globalAlpha = alpha2;
|
|
16527
|
+
ctx.beginPath();
|
|
16528
|
+
if (color2 !== "none") {
|
|
16529
|
+
ctx.fillStyle = color2;
|
|
16530
|
+
ctx.fill(path2d);
|
|
16531
|
+
}
|
|
16532
|
+
if (stroke != null && stroke !== "none") {
|
|
16533
|
+
ctx.strokeStyle = stroke;
|
|
16534
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16535
|
+
ctx.stroke(path2d);
|
|
16546
16536
|
}
|
|
16547
16537
|
}
|
|
16548
16538
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16608,38 +16598,36 @@ var VVPlot = (function(exports, vue) {
|
|
|
16608
16598
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16609
16599
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16610
16600
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16611
|
-
for (
|
|
16612
|
-
|
|
16613
|
-
|
|
16614
|
-
|
|
16615
|
-
|
|
16616
|
-
|
|
16617
|
-
|
|
16618
|
-
|
|
16619
|
-
|
|
16620
|
-
|
|
16621
|
-
|
|
16622
|
-
}
|
|
16623
|
-
|
|
16624
|
-
|
|
16625
|
-
|
|
16626
|
-
|
|
16627
|
-
|
|
16628
|
-
|
|
16629
|
-
|
|
16630
|
-
|
|
16631
|
-
|
|
16632
|
-
|
|
16633
|
-
|
|
16634
|
-
|
|
16635
|
-
|
|
16636
|
-
|
|
16637
|
-
|
|
16638
|
-
|
|
16639
|
-
|
|
16640
|
-
|
|
16641
|
-
ctx.stroke(path2d);
|
|
16642
|
-
}
|
|
16601
|
+
for (let {
|
|
16602
|
+
points,
|
|
16603
|
+
fill,
|
|
16604
|
+
color: color2,
|
|
16605
|
+
linewidth,
|
|
16606
|
+
linetype,
|
|
16607
|
+
alpha: alpha2,
|
|
16608
|
+
"translate-x": translateX = 0,
|
|
16609
|
+
"translate-y": translateY = 0,
|
|
16610
|
+
$raw
|
|
16611
|
+
} of __props.data) {
|
|
16612
|
+
points = points.map((p) => (({ h: x2, v: y2 }) => ({ x: x2, y: y2 }))(__props.coord2pos(p))).filter((p) => p.x != null && p.y != null);
|
|
16613
|
+
if (points.length === 0) continue;
|
|
16614
|
+
const path2d = new Path2D();
|
|
16615
|
+
path2d.moveTo(points[0].x + translateX, points[0].y + translateY);
|
|
16616
|
+
for (let i = 1; i < points.length; i++) {
|
|
16617
|
+
path2d.lineTo(points[i].x + translateX, points[i].y + translateY);
|
|
16618
|
+
}
|
|
16619
|
+
path2d.closePath();
|
|
16620
|
+
_path_data.set(path2d, $raw);
|
|
16621
|
+
ctx.lineWidth = linewidth;
|
|
16622
|
+
ctx.globalAlpha = alpha2;
|
|
16623
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16624
|
+
if (fill !== "none") {
|
|
16625
|
+
ctx.fillStyle = fill;
|
|
16626
|
+
ctx.fill(path2d);
|
|
16627
|
+
}
|
|
16628
|
+
if (color2 != null && color2 !== "none") {
|
|
16629
|
+
ctx.strokeStyle = color2;
|
|
16630
|
+
ctx.stroke(path2d);
|
|
16643
16631
|
}
|
|
16644
16632
|
}
|
|
16645
16633
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16705,36 +16693,34 @@ var VVPlot = (function(exports, vue) {
|
|
|
16705
16693
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16706
16694
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16707
16695
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16708
|
-
for (
|
|
16709
|
-
|
|
16710
|
-
|
|
16711
|
-
|
|
16712
|
-
|
|
16713
|
-
|
|
16714
|
-
|
|
16715
|
-
|
|
16716
|
-
|
|
16717
|
-
|
|
16718
|
-
|
|
16719
|
-
|
|
16720
|
-
|
|
16721
|
-
|
|
16722
|
-
}
|
|
16723
|
-
|
|
16724
|
-
|
|
16725
|
-
|
|
16726
|
-
|
|
16727
|
-
|
|
16728
|
-
|
|
16729
|
-
|
|
16730
|
-
|
|
16731
|
-
|
|
16732
|
-
|
|
16733
|
-
|
|
16734
|
-
|
|
16735
|
-
|
|
16736
|
-
ctx.stroke(path2d);
|
|
16737
|
-
}
|
|
16696
|
+
for (let {
|
|
16697
|
+
xmin,
|
|
16698
|
+
xmax,
|
|
16699
|
+
ymin,
|
|
16700
|
+
ymax,
|
|
16701
|
+
fill,
|
|
16702
|
+
color: color2,
|
|
16703
|
+
linewidth,
|
|
16704
|
+
linetype,
|
|
16705
|
+
alpha: alpha2,
|
|
16706
|
+
"translate-x": translateX = 0,
|
|
16707
|
+
"translate-y": translateY = 0,
|
|
16708
|
+
$raw
|
|
16709
|
+
} of __props.data) {
|
|
16710
|
+
const { hmin: x1, hmax: x2, vmin: y1, vmax: y2 } = __props.coord2pos({ xmin, xmax, ymin, ymax });
|
|
16711
|
+
const path2d = new Path2D();
|
|
16712
|
+
path2d.rect(x1 + translateX, y1 + translateY, x2 - x1, y2 - y1);
|
|
16713
|
+
_path_data.set(path2d, $raw);
|
|
16714
|
+
ctx.lineWidth = linewidth;
|
|
16715
|
+
ctx.globalAlpha = alpha2;
|
|
16716
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16717
|
+
if (fill !== "none") {
|
|
16718
|
+
ctx.fillStyle = fill;
|
|
16719
|
+
ctx.fill(path2d);
|
|
16720
|
+
}
|
|
16721
|
+
if (color2 !== "none" && color2 != null) {
|
|
16722
|
+
ctx.strokeStyle = color2;
|
|
16723
|
+
ctx.stroke(path2d);
|
|
16738
16724
|
}
|
|
16739
16725
|
}
|
|
16740
16726
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16800,77 +16786,75 @@ var VVPlot = (function(exports, vue) {
|
|
|
16800
16786
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16801
16787
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16802
16788
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16803
|
-
for (
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
|
|
16810
|
-
|
|
16811
|
-
|
|
16812
|
-
|
|
16813
|
-
|
|
16814
|
-
|
|
16815
|
-
|
|
16816
|
-
|
|
16817
|
-
|
|
16818
|
-
|
|
16819
|
-
|
|
16820
|
-
|
|
16821
|
-
|
|
16822
|
-
|
|
16823
|
-
|
|
16824
|
-
|
|
16825
|
-
|
|
16826
|
-
|
|
16827
|
-
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
|
|
16831
|
-
|
|
16832
|
-
|
|
16833
|
-
|
|
16834
|
-
|
|
16835
|
-
|
|
16836
|
-
|
|
16837
|
-
|
|
16838
|
-
|
|
16839
|
-
|
|
16840
|
-
|
|
16841
|
-
|
|
16842
|
-
|
|
16843
|
-
|
|
16844
|
-
|
|
16845
|
-
|
|
16846
|
-
|
|
16847
|
-
|
|
16848
|
-
|
|
16849
|
-
|
|
16850
|
-
|
|
16851
|
-
|
|
16852
|
-
|
|
16853
|
-
|
|
16854
|
-
|
|
16855
|
-
}
|
|
16856
|
-
|
|
16857
|
-
|
|
16858
|
-
|
|
16859
|
-
|
|
16860
|
-
|
|
16861
|
-
|
|
16862
|
-
|
|
16863
|
-
|
|
16864
|
-
|
|
16865
|
-
|
|
16866
|
-
|
|
16867
|
-
|
|
16868
|
-
|
|
16869
|
-
|
|
16870
|
-
ctx.strokeText(label, 0, 0);
|
|
16871
|
-
}
|
|
16872
|
-
ctx.restore();
|
|
16789
|
+
for (let {
|
|
16790
|
+
x: x2,
|
|
16791
|
+
y: y2,
|
|
16792
|
+
color: color2,
|
|
16793
|
+
size = 4,
|
|
16794
|
+
label = "",
|
|
16795
|
+
title,
|
|
16796
|
+
stroke,
|
|
16797
|
+
linewidth,
|
|
16798
|
+
linetype,
|
|
16799
|
+
alpha: alpha2,
|
|
16800
|
+
"anchor-x": anchorX,
|
|
16801
|
+
"anchor-y": anchorY,
|
|
16802
|
+
"dock-x": dockX,
|
|
16803
|
+
"dock-y": dockY,
|
|
16804
|
+
"translate-x": translateX = 0,
|
|
16805
|
+
"translate-y": translateY = 0,
|
|
16806
|
+
angle: angle2,
|
|
16807
|
+
"text-length": textLength,
|
|
16808
|
+
"font-family": fontFamily = "sans-serif",
|
|
16809
|
+
$raw
|
|
16810
|
+
} of __props.data) {
|
|
16811
|
+
ctx.save();
|
|
16812
|
+
const { h: tx, v: ty } = __props.coord2pos({ x: x2, y: y2 });
|
|
16813
|
+
ctx.textAlign = "center";
|
|
16814
|
+
ctx.textBaseline = "middle";
|
|
16815
|
+
ctx.lineWidth = linewidth;
|
|
16816
|
+
ctx.globalAlpha = alpha2;
|
|
16817
|
+
ctx.font = `${size * 4}px ${fontFamily}`;
|
|
16818
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16819
|
+
ctx.translate(tx + translateX, ty + translateY);
|
|
16820
|
+
let { width: w, fontBoundingBoxAscent: a, fontBoundingBoxDescent: d } = ctx.measureText(label), width = w, height = a + d;
|
|
16821
|
+
if (typeof textLength == "object") {
|
|
16822
|
+
let { x: lx = 0, y: ly = 0 } = textLength;
|
|
16823
|
+
let { h: h1, v: v1 } = __props.coord2pos({ x: x2 + lx / 2, y: y2 + ly / 2 }), { h: h2, v: v2 } = __props.coord2pos({ x: x2 - lx / 2, y: y2 - ly / 2 });
|
|
16824
|
+
width = Math.hypot(h1 - h2 || 0, v1 - v2 || 0);
|
|
16825
|
+
} else if (textLength != null) {
|
|
16826
|
+
width = textLength;
|
|
16827
|
+
}
|
|
16828
|
+
if (typeof angle2 == "object") {
|
|
16829
|
+
let { dx = 0, dy = 0 } = angle2;
|
|
16830
|
+
let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
|
|
16831
|
+
angle2 = Math.atan2(v - ty, h - tx) * 180 / Math.PI;
|
|
16832
|
+
}
|
|
16833
|
+
if (dockX != null || dockY != null) {
|
|
16834
|
+
let alnX = { left: 0, center: 0.5, right: 1 }[dockX] ?? +(dockX ?? 0.5), alnY = { bottom: 0, center: 0.5, top: 1 }[dockY] ?? +(dockY ?? 0.5);
|
|
16835
|
+
if (isNaN(alnX)) alnX = 0.5;
|
|
16836
|
+
if (isNaN(alnY)) alnY = 0.5;
|
|
16837
|
+
let w2 = width * Math.abs(Math.cos(angle2 * Math.PI / 180)) + height * Math.abs(Math.sin(angle2 * Math.PI / 180)), h = width * Math.abs(Math.sin(angle2 * Math.PI / 180)) + height * Math.abs(Math.cos(angle2 * Math.PI / 180));
|
|
16838
|
+
ctx.translate(w2 * (0.5 - alnX), h * (alnY - 0.5));
|
|
16839
|
+
ctx.rotate(angle2 * Math.PI / 180);
|
|
16840
|
+
} else {
|
|
16841
|
+
let alnX = { left: 0, center: 0.5, right: 1 }[anchorX] ?? +(anchorX ?? 0.5), alnY = { bottom: 0, center: 0.5, top: 1 }[anchorY] ?? +(anchorY ?? 0.5);
|
|
16842
|
+
if (isNaN(alnX)) alnX = 0.5;
|
|
16843
|
+
if (isNaN(alnY)) alnY = 0.5;
|
|
16844
|
+
let w2 = width, h = height;
|
|
16845
|
+
ctx.rotate(angle2 * Math.PI / 180);
|
|
16846
|
+
ctx.translate(w2 * (0.5 - alnX), h * (alnY - 0.5));
|
|
16847
|
+
}
|
|
16848
|
+
if (width != w) ctx.scale(width / w, 1);
|
|
16849
|
+
if (color2 !== "none") {
|
|
16850
|
+
ctx.fillStyle = color2;
|
|
16851
|
+
ctx.fillText(label, 0, 0);
|
|
16852
|
+
}
|
|
16853
|
+
if (stroke != null && stroke !== "none") {
|
|
16854
|
+
ctx.strokeStyle = stroke;
|
|
16855
|
+
ctx.strokeText(label, 0, 0);
|
|
16873
16856
|
}
|
|
16857
|
+
ctx.restore();
|
|
16874
16858
|
}
|
|
16875
16859
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
16876
16860
|
path_data.set(path2, _path_data.get(path2));
|
|
@@ -16935,69 +16919,86 @@ var VVPlot = (function(exports, vue) {
|
|
|
16935
16919
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16936
16920
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16937
16921
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16938
|
-
for (
|
|
16939
|
-
|
|
16940
|
-
|
|
16941
|
-
|
|
16942
|
-
|
|
16943
|
-
|
|
16944
|
-
|
|
16945
|
-
|
|
16946
|
-
|
|
16947
|
-
|
|
16948
|
-
|
|
16949
|
-
|
|
16950
|
-
|
|
16951
|
-
|
|
16952
|
-
|
|
16953
|
-
|
|
16954
|
-
|
|
16955
|
-
|
|
16956
|
-
|
|
16957
|
-
|
|
16958
|
-
|
|
16959
|
-
|
|
16960
|
-
}
|
|
16961
|
-
|
|
16962
|
-
|
|
16963
|
-
|
|
16964
|
-
|
|
16965
|
-
|
|
16966
|
-
|
|
16967
|
-
|
|
16968
|
-
|
|
16969
|
-
|
|
16970
|
-
|
|
16971
|
-
|
|
16972
|
-
|
|
16973
|
-
|
|
16974
|
-
|
|
16975
|
-
|
|
16976
|
-
|
|
16977
|
-
|
|
16978
|
-
|
|
16979
|
-
|
|
16980
|
-
|
|
16981
|
-
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
|
|
16989
|
-
|
|
16990
|
-
|
|
16991
|
-
|
|
16992
|
-
|
|
16993
|
-
|
|
16994
|
-
|
|
16995
|
-
|
|
16996
|
-
|
|
16922
|
+
for (let {
|
|
16923
|
+
x: x2,
|
|
16924
|
+
xend,
|
|
16925
|
+
y: y2,
|
|
16926
|
+
yend,
|
|
16927
|
+
size = 4,
|
|
16928
|
+
label = "",
|
|
16929
|
+
title,
|
|
16930
|
+
color: color2,
|
|
16931
|
+
stroke,
|
|
16932
|
+
linewidth,
|
|
16933
|
+
linetype,
|
|
16934
|
+
alpha: alpha2,
|
|
16935
|
+
"translate-x": translateX = 0,
|
|
16936
|
+
"translate-y": translateY = 0,
|
|
16937
|
+
"text-length": textLength,
|
|
16938
|
+
"font-family": fontFamily = "sans-serif",
|
|
16939
|
+
"text-align": textAlign = "justify",
|
|
16940
|
+
angle: angle2 = "auto",
|
|
16941
|
+
inset = 0,
|
|
16942
|
+
$raw
|
|
16943
|
+
} of __props.data) {
|
|
16944
|
+
const { h: x1, v: y1 } = __props.coord2pos({ x: x2, y: y2 });
|
|
16945
|
+
const { h: x22, v: y22 } = __props.coord2pos({ x: xend, y: yend });
|
|
16946
|
+
ctx.save();
|
|
16947
|
+
ctx.translate(translateX, translateY);
|
|
16948
|
+
ctx.textBaseline = "middle";
|
|
16949
|
+
ctx.lineWidth = linewidth;
|
|
16950
|
+
ctx.globalAlpha = alpha2;
|
|
16951
|
+
ctx.font = `${size * 4}px ${fontFamily}`;
|
|
16952
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16953
|
+
if (["stretch", "pre", "start", "center", "end", "post"].includes(textAlign)) {
|
|
16954
|
+
let radian = Math.atan2(y22 - y1, x22 - x1);
|
|
16955
|
+
let text2 = String(label).replace(/\x01|\x02/g, "");
|
|
16956
|
+
let insetX = Math.cos(radian) * inset, insetY = Math.sin(radian) * inset;
|
|
16957
|
+
switch (textAlign) {
|
|
16958
|
+
case "stretch":
|
|
16959
|
+
case "center":
|
|
16960
|
+
ctx.translate((x1 + x22) / 2, (y1 + y22) / 2);
|
|
16961
|
+
ctx.textAlign = "center";
|
|
16962
|
+
break;
|
|
16963
|
+
case "pre":
|
|
16964
|
+
ctx.translate(x1 - insetX, y1 - insetY);
|
|
16965
|
+
ctx.textAlign = "end";
|
|
16966
|
+
break;
|
|
16967
|
+
case "start":
|
|
16968
|
+
ctx.translate(x1 + insetX, y1 + insetY);
|
|
16969
|
+
ctx.textAlign = "start";
|
|
16970
|
+
break;
|
|
16971
|
+
case "end":
|
|
16972
|
+
ctx.translate(x22 - insetX, y22 - insetY);
|
|
16973
|
+
ctx.textAlign = "end";
|
|
16974
|
+
break;
|
|
16975
|
+
case "post":
|
|
16976
|
+
ctx.translate(x22 + insetX, y22 + insetY);
|
|
16977
|
+
ctx.textAlign = "start";
|
|
16978
|
+
break;
|
|
16979
|
+
}
|
|
16980
|
+
ctx.rotate(radian);
|
|
16981
|
+
if (textAlign === "stretch") {
|
|
16982
|
+
ctx.scale(Math.hypot(x22 - x1 || 0, y22 - y1 || 0) / ctx.measureText(text2).width, 1);
|
|
16983
|
+
}
|
|
16984
|
+
if (color2 !== "none") {
|
|
16985
|
+
ctx.fillStyle = color2;
|
|
16986
|
+
ctx.fillText(text2, 0, 0);
|
|
16987
|
+
}
|
|
16988
|
+
if (stroke != null && stroke !== "none") {
|
|
16989
|
+
ctx.strokeStyle = stroke;
|
|
16990
|
+
ctx.strokeText(text2, 0, 0);
|
|
16991
|
+
}
|
|
16992
|
+
} else {
|
|
16993
|
+
let radian = angle2 === "auto" ? Math.atan2(y22 - y1, x22 - x1) : angle2 * Math.PI / 180;
|
|
16994
|
+
ctx.textAlign = "center";
|
|
16995
|
+
let parts = splitLabel(String(label));
|
|
16996
|
+
let dx = (x22 - x1) / (parts.length - 1 || 1), dy = (y22 - y1) / (parts.length - 1 || 1);
|
|
16997
|
+
for (let i = 0; i < parts.length; i++) {
|
|
16998
|
+
ctx.save();
|
|
16999
|
+
ctx.translate(x1 + i * dx, y1 + i * dy);
|
|
16997
17000
|
ctx.rotate(radian);
|
|
16998
|
-
|
|
16999
|
-
ctx.scale(Math.hypot(x22 - x1 || 0, y22 - y1 || 0) / ctx.measureText(text2).width, 1);
|
|
17000
|
-
}
|
|
17001
|
+
let text2 = parts[i];
|
|
17001
17002
|
if (color2 !== "none") {
|
|
17002
17003
|
ctx.fillStyle = color2;
|
|
17003
17004
|
ctx.fillText(text2, 0, 0);
|
|
@@ -17006,29 +17007,10 @@ var VVPlot = (function(exports, vue) {
|
|
|
17006
17007
|
ctx.strokeStyle = stroke;
|
|
17007
17008
|
ctx.strokeText(text2, 0, 0);
|
|
17008
17009
|
}
|
|
17009
|
-
|
|
17010
|
-
let radian = angle2 === "auto" ? Math.atan2(y22 - y1, x22 - x1) : angle2 * Math.PI / 180;
|
|
17011
|
-
ctx.textAlign = "center";
|
|
17012
|
-
let parts = splitLabel(String(label));
|
|
17013
|
-
let dx = (x22 - x1) / (parts.length - 1 || 1), dy = (y22 - y1) / (parts.length - 1 || 1);
|
|
17014
|
-
for (let i = 0; i < parts.length; i++) {
|
|
17015
|
-
ctx.save();
|
|
17016
|
-
ctx.translate(x1 + i * dx, y1 + i * dy);
|
|
17017
|
-
ctx.rotate(radian);
|
|
17018
|
-
let text2 = parts[i];
|
|
17019
|
-
if (color2 !== "none") {
|
|
17020
|
-
ctx.fillStyle = color2;
|
|
17021
|
-
ctx.fillText(text2, 0, 0);
|
|
17022
|
-
}
|
|
17023
|
-
if (stroke != null && stroke !== "none") {
|
|
17024
|
-
ctx.strokeStyle = stroke;
|
|
17025
|
-
ctx.strokeText(text2, 0, 0);
|
|
17026
|
-
}
|
|
17027
|
-
ctx.restore();
|
|
17028
|
-
}
|
|
17010
|
+
ctx.restore();
|
|
17029
17011
|
}
|
|
17030
|
-
ctx.restore();
|
|
17031
17012
|
}
|
|
17013
|
+
ctx.restore();
|
|
17032
17014
|
}
|
|
17033
17015
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
17034
17016
|
path_data.set(path2, _path_data.get(path2));
|
|
@@ -17265,7 +17247,7 @@ var VVPlot = (function(exports, vue) {
|
|
|
17265
17247
|
const emit = __emit;
|
|
17266
17248
|
const binds = vue.computed(() => {
|
|
17267
17249
|
let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
|
|
17268
|
-
return __props.data.map((group) => group.map(({
|
|
17250
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17269
17251
|
x: x2,
|
|
17270
17252
|
xmin,
|
|
17271
17253
|
xmax,
|
|
@@ -17495,7 +17477,7 @@ var VVPlot = (function(exports, vue) {
|
|
|
17495
17477
|
const emit = __emit;
|
|
17496
17478
|
const binds = vue.computed(() => {
|
|
17497
17479
|
let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
|
|
17498
|
-
return __props.data.map((group) => group.map(({
|
|
17480
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17499
17481
|
points,
|
|
17500
17482
|
fill,
|
|
17501
17483
|
color: color2,
|
|
@@ -17613,7 +17595,7 @@ var VVPlot = (function(exports, vue) {
|
|
|
17613
17595
|
const emit = __emit;
|
|
17614
17596
|
const binds = vue.computed(() => {
|
|
17615
17597
|
let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
|
|
17616
|
-
return __props.data.map((group) => group.map(({
|
|
17598
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17617
17599
|
cx,
|
|
17618
17600
|
cy,
|
|
17619
17601
|
A,
|
|
@@ -17695,7 +17677,7 @@ var VVPlot = (function(exports, vue) {
|
|
|
17695
17677
|
const emit = __emit;
|
|
17696
17678
|
const binds = vue.computed(() => {
|
|
17697
17679
|
let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
|
|
17698
|
-
return __props.data.map((group) => group.map(({
|
|
17680
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17699
17681
|
x: x2,
|
|
17700
17682
|
y: y2,
|
|
17701
17683
|
xend,
|
|
@@ -17770,7 +17752,7 @@ var VVPlot = (function(exports, vue) {
|
|
|
17770
17752
|
const emit = __emit;
|
|
17771
17753
|
const binds = vue.computed(() => {
|
|
17772
17754
|
let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
|
|
17773
|
-
return __props.data.map((group) => group.map(({
|
|
17755
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17774
17756
|
x: x2,
|
|
17775
17757
|
y: y2,
|
|
17776
17758
|
size = 4,
|
|
@@ -17869,7 +17851,7 @@ var VVPlot = (function(exports, vue) {
|
|
|
17869
17851
|
const emit = __emit;
|
|
17870
17852
|
const binds = vue.computed(() => {
|
|
17871
17853
|
let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
|
|
17872
|
-
return __props.data.map((group) => group.map(({
|
|
17854
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17873
17855
|
x: x2,
|
|
17874
17856
|
xend,
|
|
17875
17857
|
y: y2,
|
|
@@ -17990,7 +17972,7 @@ var VVPlot = (function(exports, vue) {
|
|
|
17990
17972
|
const emit = __emit;
|
|
17991
17973
|
const binds = vue.computed(() => {
|
|
17992
17974
|
let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
|
|
17993
|
-
return __props.data.map((group) => group.map(({
|
|
17975
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17994
17976
|
x: x2,
|
|
17995
17977
|
y: y2,
|
|
17996
17978
|
shape: shape2,
|
|
@@ -18104,7 +18086,7 @@ var VVPlot = (function(exports, vue) {
|
|
|
18104
18086
|
const emit = __emit;
|
|
18105
18087
|
const binds = vue.computed(() => {
|
|
18106
18088
|
let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
|
|
18107
|
-
return __props.data.map((group) => group.map(({
|
|
18089
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
18108
18090
|
points,
|
|
18109
18091
|
fill,
|
|
18110
18092
|
color: color2,
|
|
@@ -18176,7 +18158,7 @@ var VVPlot = (function(exports, vue) {
|
|
|
18176
18158
|
const emit = __emit;
|
|
18177
18159
|
const binds = vue.computed(() => {
|
|
18178
18160
|
let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
|
|
18179
|
-
return __props.data.map((group) => group.map(({
|
|
18161
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
18180
18162
|
xmin,
|
|
18181
18163
|
xmax,
|
|
18182
18164
|
ymin,
|
|
@@ -18248,7 +18230,7 @@ var VVPlot = (function(exports, vue) {
|
|
|
18248
18230
|
const emit = __emit;
|
|
18249
18231
|
const binds = vue.computed(() => {
|
|
18250
18232
|
let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
|
|
18251
|
-
return __props.data.map((group) => group.map(({
|
|
18233
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
18252
18234
|
x: x2,
|
|
18253
18235
|
y: y2,
|
|
18254
18236
|
size = 4,
|
|
@@ -18347,7 +18329,7 @@ var VVPlot = (function(exports, vue) {
|
|
|
18347
18329
|
const emit = __emit;
|
|
18348
18330
|
const binds = vue.computed(() => {
|
|
18349
18331
|
let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
|
|
18350
|
-
return __props.data.map((group) => group.map(({
|
|
18332
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
18351
18333
|
x: x2,
|
|
18352
18334
|
xend,
|
|
18353
18335
|
y: y2,
|
|
@@ -20634,6 +20616,7 @@ var VVPlot = (function(exports, vue) {
|
|
|
20634
20616
|
let oldSize = { width: 0, height: 0 };
|
|
20635
20617
|
useResizeObserver(plotRef, (e) => {
|
|
20636
20618
|
let { width: w, height: h } = e[0].contentRect;
|
|
20619
|
+
if (width.value - w < 0.5 && height.value - h < 0.5) return;
|
|
20637
20620
|
if (wrapperRef.value.style.width) width.value = w;
|
|
20638
20621
|
if (wrapperRef.value.style.height) height.value = h;
|
|
20639
20622
|
if ((w > 0 || h > 0) && (oldSize.width > 0 || oldSize.height > 0))
|