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