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.
@@ -7350,9 +7350,9 @@ var VVPlot = (function(exports, vue) {
7350
7350
  }
7351
7351
  getComputedLayers() {
7352
7352
  return this.layers.map((layer) => {
7353
- let data = Object.values(Object.groupBy(layer.data.$group.map(
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), (d) => d.$group));
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 (const group of __props.data) {
16042
- for (let {
16043
- x: x2,
16044
- xmin,
16045
- xmax,
16046
- y: y2,
16047
- ymin,
16048
- ymax,
16049
- lwisker,
16050
- Q1,
16051
- median,
16052
- Q3,
16053
- uwisker,
16054
- outliers,
16055
- $xmin,
16056
- $xmax,
16057
- $ymin,
16058
- $ymax,
16059
- fill = "white",
16060
- color: color2 = "black",
16061
- linewidth = 1,
16062
- linetype,
16063
- alpha: alpha2,
16064
- "translate-x": translateX = 0,
16065
- "translate-y": translateY = 0,
16066
- $raw
16067
- } of group) {
16068
- 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 });
16069
- const { h: lx1, v: ly1 } = __props.coord2pos(x2 == null ? { y: y2, x: lwisker } : { x: x2, y: lwisker });
16070
- const { h: lx2, v: ly2 } = __props.coord2pos(x2 == null ? { y: y2, x: uwisker } : { x: x2, y: uwisker });
16071
- const { h: mx1, v: my1 } = __props.coord2pos(x2 == null ? { y: ymin, x: median } : { x: xmin, y: median });
16072
- const { h: mx2, v: my2 } = __props.coord2pos(x2 == null ? { y: ymax, x: median } : { x: xmax, y: median });
16073
- 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 });
16074
- 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 });
16075
- 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 });
16076
- 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 });
16077
- ctx.globalAlpha = alpha2;
16078
- ctx.setLineDash(parseLinetype(linetype));
16079
- const linepath2d = new Path2D();
16080
- linepath2d.moveTo(lx1 + translateX, ly1 + translateY);
16081
- linepath2d.lineTo(lx2 + translateX, ly2 + translateY);
16082
- const wiskerpath2d = new Path2D();
16083
- wiskerpath2d.moveTo(uwx1 + translateX, uwy1 + translateY);
16084
- wiskerpath2d.lineTo(uwx2 + translateX, uwy2 + translateY);
16085
- wiskerpath2d.moveTo(lwx1 + translateX, lwy1 + translateY);
16086
- wiskerpath2d.lineTo(lwx2 + translateX, lwy2 + translateY);
16087
- const rectpath2d = new Path2D();
16088
- rectpath2d.rect(rx1 + translateX, ry1 + translateY, rx2 - rx1, ry2 - ry1);
16089
- _path_data.set(rectpath2d, $raw);
16090
- const medianpath2d = new Path2D();
16091
- medianpath2d.moveTo(mx1 + translateX, my1 + translateY);
16092
- medianpath2d.lineTo(mx2 + translateX, my2 + translateY);
16093
- if (color2 != null && color2 !== "none") {
16094
- ctx.strokeStyle = color2;
16095
- ctx.lineWidth = linewidth;
16096
- ctx.stroke(linepath2d);
16097
- ctx.stroke(wiskerpath2d);
16098
- }
16099
- if (fill !== "none") {
16100
- ctx.fillStyle = fill;
16101
- ctx.fill(rectpath2d);
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.stroke(rectpath2d);
16105
- ctx.lineWidth = linewidth * 2;
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 (const group of __props.data) {
16184
- for (let {
16185
- points,
16186
- fill,
16187
- color: color2,
16188
- linewidth,
16189
- linetype,
16190
- alpha: alpha2,
16191
- "translate-x": translateX = 0,
16192
- "translate-y": translateY = 0,
16193
- $raw,
16194
- interpolate: interpolate2
16195
- } of group) {
16196
- points = points.map((p) => (({ h: x2, v: y2 }) => ({ x: x2, y: y2 }))(__props.coord2pos(p))).filter((p) => p.x != null && p.y != null);
16197
- if (points.length === 0) continue;
16198
- const path2d = new Path2D();
16199
- let interpolatorFn = typeof interpolate2 == "function" ? interpolate2 : interpolators[interpolate2] ?? natural$1;
16200
- let interpolator = interpolatorFn(path2d);
16201
- interpolator.lineStart();
16202
- for (let i = 0; i < points.length; i++) {
16203
- interpolator.point(points[i].x + translateX, points[i].y + translateY);
16204
- }
16205
- interpolator.lineEnd();
16206
- _path_data.set(path2d, $raw);
16207
- ctx.lineWidth = linewidth;
16208
- ctx.globalAlpha = alpha2;
16209
- ctx.setLineDash(parseLinetype(linetype));
16210
- if (fill !== "none") {
16211
- ctx.fillStyle = fill;
16212
- ctx.fill(path2d);
16213
- }
16214
- if (color2 != null && color2 !== "none") {
16215
- ctx.strokeStyle = color2;
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 (const group of __props.data) {
16293
- for (let {
16294
- cx,
16295
- cy,
16296
- A,
16297
- B,
16298
- C,
16299
- fill,
16300
- color: color2,
16301
- linewidth,
16302
- linetype,
16303
- alpha: alpha2,
16304
- "translate-x": translateX = 0,
16305
- "translate-y": translateY = 0,
16306
- $raw
16307
- } of group) {
16308
- let dx = Math.sqrt(C / (A * C - B * B)), dy = Math.sqrt(A / (A * C - B * B));
16309
- const { h: ch, v: cv } = __props.coord2pos({ x: cx, y: cy });
16310
- 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 });
16311
- let scaleX = (h2 - h1) / (2 * dx), scaleY = (v2 - v1) / (2 * dy);
16312
- A /= scaleX * scaleX;
16313
- B /= scaleX * scaleY;
16314
- C /= scaleY * scaleY;
16315
- const tr = A + C, det = A * C - B * B;
16316
- const disc = Math.sqrt(Math.max(0, tr * tr / 4 - det));
16317
- let rx2 = 1 / Math.sqrt(tr / 2 + disc), ry = 1 / Math.sqrt(tr / 2 - disc), angle2 = Math.atan2(2 * B, A - C) / 2;
16318
- const path2d = new Path2D();
16319
- path2d.ellipse(ch + translateX, cv + translateY, rx2, ry, angle2, 0, 2 * Math.PI);
16320
- _path_data.set(path2d, $raw);
16321
- ctx.lineWidth = linewidth;
16322
- ctx.globalAlpha = alpha2;
16323
- ctx.setLineDash(parseLinetype(linetype));
16324
- if (fill !== "none") {
16325
- ctx.fillStyle = fill;
16326
- ctx.fill(path2d);
16327
- }
16328
- if (color2 != null && color2 !== "none") {
16329
- ctx.strokeStyle = color2;
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 (const group of __props.data) {
16398
- for (let {
16399
- x: x2,
16400
- y: y2,
16401
- xend,
16402
- yend,
16403
- color: color2 = "black",
16404
- linewidth,
16405
- alpha: alpha2,
16406
- linetype,
16407
- "translate-x": translateX = 0,
16408
- "translate-y": translateY = 0,
16409
- $raw
16410
- } of group) {
16411
- const { h: x1, v: y1 } = __props.coord2pos({ x: x2, y: y2 });
16412
- const { h: x22, v: y22 } = __props.coord2pos({ x: xend, y: yend });
16413
- const path2d = new Path2D();
16414
- path2d.moveTo(x1 + translateX, y1 + translateY);
16415
- path2d.lineTo(x22 + translateX, y22 + translateY);
16416
- _path_data.set(path2d, $raw);
16417
- ctx.lineWidth = linewidth;
16418
- ctx.globalAlpha = alpha2;
16419
- ctx.setLineDash(parseLinetype(linetype));
16420
- if (color2 != null && color2 !== "none") {
16421
- ctx.strokeStyle = color2;
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 (const group of __props.data) {
16498
- for (let {
16499
- x: x2,
16500
- y: y2,
16501
- size = 6,
16502
- shape: shape2,
16503
- color: color2,
16504
- stroke,
16505
- linewidth,
16506
- linetype,
16507
- alpha: alpha2,
16508
- "translate-x": translateX = 0,
16509
- "translate-y": translateY = 0,
16510
- angle: angle2 = 0,
16511
- $raw
16512
- } of group) {
16513
- const { h: cx, v: cy } = __props.coord2pos({ x: x2, y: y2 });
16514
- if (typeof angle2 == "object") {
16515
- let { dx = 0, dy = 0 } = angle2;
16516
- let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
16517
- angle2 = Math.atan2(v - cy, h - cx) * 180 / Math.PI;
16518
- }
16519
- const path2d = new Path2D();
16520
- if (String(shape2).startsWith("path:")) {
16521
- path2d.addPath(
16522
- new Path2D(shape2.slice(5)),
16523
- new DOMMatrix().translateSelf(cx + translateX, cy + translateY).rotate(angle2)
16524
- );
16525
- } else if (shape2 in paths) {
16526
- path2d.addPath(
16527
- new Path2D(paths[shape2](size)),
16528
- new DOMMatrix().translate(cx + translateX, cy + translateY).rotate(angle2)
16529
- );
16530
- } else {
16531
- path2d.arc(cx + translateX, cy + translateY, size / 2, 0, Math.PI * 2);
16532
- }
16533
- _path_data.set(path2d, $raw);
16534
- ctx.lineWidth = linewidth;
16535
- ctx.globalAlpha = alpha2;
16536
- ctx.beginPath();
16537
- if (color2 !== "none") {
16538
- ctx.fillStyle = color2;
16539
- ctx.fill(path2d);
16540
- }
16541
- if (stroke != null && stroke !== "none") {
16542
- ctx.strokeStyle = stroke;
16543
- ctx.setLineDash(parseLinetype(linetype));
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 (const group of __props.data) {
16612
- for (let {
16613
- points,
16614
- fill,
16615
- color: color2,
16616
- linewidth,
16617
- linetype,
16618
- alpha: alpha2,
16619
- "translate-x": translateX = 0,
16620
- "translate-y": translateY = 0,
16621
- $raw
16622
- } of group) {
16623
- points = points.map((p) => (({ h: x2, v: y2 }) => ({ x: x2, y: y2 }))(__props.coord2pos(p))).filter((p) => p.x != null && p.y != null);
16624
- if (points.length === 0) continue;
16625
- const path2d = new Path2D();
16626
- path2d.moveTo(points[0].x + translateX, points[0].y + translateY);
16627
- for (let i = 1; i < points.length; i++) {
16628
- path2d.lineTo(points[i].x + translateX, points[i].y + translateY);
16629
- }
16630
- path2d.closePath();
16631
- _path_data.set(path2d, $raw);
16632
- ctx.lineWidth = linewidth;
16633
- ctx.globalAlpha = alpha2;
16634
- ctx.setLineDash(parseLinetype(linetype));
16635
- if (fill !== "none") {
16636
- ctx.fillStyle = fill;
16637
- ctx.fill(path2d);
16638
- }
16639
- if (color2 != null && color2 !== "none") {
16640
- ctx.strokeStyle = color2;
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 (const group of __props.data) {
16709
- for (let {
16710
- xmin,
16711
- xmax,
16712
- ymin,
16713
- ymax,
16714
- fill,
16715
- color: color2,
16716
- linewidth,
16717
- linetype,
16718
- alpha: alpha2,
16719
- "translate-x": translateX = 0,
16720
- "translate-y": translateY = 0,
16721
- $raw
16722
- } of group) {
16723
- const { hmin: x1, hmax: x2, vmin: y1, vmax: y2 } = __props.coord2pos({ xmin, xmax, ymin, ymax });
16724
- const path2d = new Path2D();
16725
- path2d.rect(x1 + translateX, y1 + translateY, x2 - x1, y2 - y1);
16726
- _path_data.set(path2d, $raw);
16727
- ctx.lineWidth = linewidth;
16728
- ctx.globalAlpha = alpha2;
16729
- ctx.setLineDash(parseLinetype(linetype));
16730
- if (fill !== "none") {
16731
- ctx.fillStyle = fill;
16732
- ctx.fill(path2d);
16733
- }
16734
- if (color2 !== "none" && color2 != null) {
16735
- ctx.strokeStyle = color2;
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 (const group of __props.data) {
16804
- for (let {
16805
- x: x2,
16806
- y: y2,
16807
- color: color2,
16808
- size = 4,
16809
- label = "",
16810
- title,
16811
- stroke,
16812
- linewidth,
16813
- linetype,
16814
- alpha: alpha2,
16815
- "anchor-x": anchorX,
16816
- "anchor-y": anchorY,
16817
- "dock-x": dockX,
16818
- "dock-y": dockY,
16819
- "translate-x": translateX = 0,
16820
- "translate-y": translateY = 0,
16821
- angle: angle2,
16822
- "text-length": textLength,
16823
- "font-family": fontFamily = "sans-serif",
16824
- $raw
16825
- } of group) {
16826
- ctx.save();
16827
- const { h: tx, v: ty } = __props.coord2pos({ x: x2, y: y2 });
16828
- ctx.textAlign = "center";
16829
- ctx.textBaseline = "middle";
16830
- ctx.lineWidth = linewidth;
16831
- ctx.globalAlpha = alpha2;
16832
- ctx.font = `${size * 4}px ${fontFamily}`;
16833
- ctx.setLineDash(parseLinetype(linetype));
16834
- ctx.translate(tx + translateX, ty + translateY);
16835
- let { width: w, fontBoundingBoxAscent: a, fontBoundingBoxDescent: d } = ctx.measureText(label), width = w, height = a + d;
16836
- if (typeof textLength == "object") {
16837
- let { x: lx = 0, y: ly = 0 } = textLength;
16838
- 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 });
16839
- width = Math.hypot(h1 - h2 || 0, v1 - v2 || 0);
16840
- } else if (textLength != null) {
16841
- width = textLength;
16842
- }
16843
- if (typeof angle2 == "object") {
16844
- let { dx = 0, dy = 0 } = angle2;
16845
- let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
16846
- angle2 = Math.atan2(v - ty, h - tx) * 180 / Math.PI;
16847
- }
16848
- if (dockX != null || dockY != null) {
16849
- 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);
16850
- if (isNaN(alnX)) alnX = 0.5;
16851
- if (isNaN(alnY)) alnY = 0.5;
16852
- 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));
16853
- ctx.translate(w2 * (0.5 - alnX), h * (alnY - 0.5));
16854
- ctx.rotate(angle2 * Math.PI / 180);
16855
- } else {
16856
- 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);
16857
- if (isNaN(alnX)) alnX = 0.5;
16858
- if (isNaN(alnY)) alnY = 0.5;
16859
- let w2 = width, h = height;
16860
- ctx.rotate(angle2 * Math.PI / 180);
16861
- ctx.translate(w2 * (0.5 - alnX), h * (alnY - 0.5));
16862
- }
16863
- if (width != w) ctx.scale(width / w, 1);
16864
- if (color2 !== "none") {
16865
- ctx.fillStyle = color2;
16866
- ctx.fillText(label, 0, 0);
16867
- }
16868
- if (stroke != null && stroke !== "none") {
16869
- ctx.strokeStyle = stroke;
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 (const group of __props.data) {
16939
- for (let {
16940
- x: x2,
16941
- xend,
16942
- y: y2,
16943
- yend,
16944
- size = 4,
16945
- label = "",
16946
- title,
16947
- color: color2,
16948
- stroke,
16949
- linewidth,
16950
- linetype,
16951
- alpha: alpha2,
16952
- "translate-x": translateX = 0,
16953
- "translate-y": translateY = 0,
16954
- "text-length": textLength,
16955
- "font-family": fontFamily = "sans-serif",
16956
- "text-align": textAlign = "justify",
16957
- angle: angle2 = "auto",
16958
- inset = 0,
16959
- $raw
16960
- } of group) {
16961
- const { h: x1, v: y1 } = __props.coord2pos({ x: x2, y: y2 });
16962
- const { h: x22, v: y22 } = __props.coord2pos({ x: xend, y: yend });
16963
- ctx.save();
16964
- ctx.translate(translateX, translateY);
16965
- ctx.textBaseline = "middle";
16966
- ctx.lineWidth = linewidth;
16967
- ctx.globalAlpha = alpha2;
16968
- ctx.font = `${size * 4}px ${fontFamily}`;
16969
- ctx.setLineDash(parseLinetype(linetype));
16970
- if (["stretch", "pre", "start", "center", "end", "post"].includes(textAlign)) {
16971
- let radian = Math.atan2(y22 - y1, x22 - x1);
16972
- let text2 = String(label).replace(/\x01|\x02/g, "");
16973
- let insetX = Math.cos(radian) * inset, insetY = Math.sin(radian) * inset;
16974
- switch (textAlign) {
16975
- case "stretch":
16976
- case "center":
16977
- ctx.translate((x1 + x22) / 2, (y1 + y22) / 2);
16978
- ctx.textAlign = "center";
16979
- break;
16980
- case "pre":
16981
- ctx.translate(x1 - insetX, y1 - insetY);
16982
- ctx.textAlign = "end";
16983
- break;
16984
- case "start":
16985
- ctx.translate(x1 + insetX, y1 + insetY);
16986
- ctx.textAlign = "start";
16987
- break;
16988
- case "end":
16989
- ctx.translate(x22 - insetX, y22 - insetY);
16990
- ctx.textAlign = "end";
16991
- break;
16992
- case "post":
16993
- ctx.translate(x22 + insetX, y22 + insetY);
16994
- ctx.textAlign = "start";
16995
- break;
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
- if (textAlign === "stretch") {
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
- } else {
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))