@363045841yyt/klinechart 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -10940,7 +10940,7 @@ function Uc(e) {
10940
10940
  var Wc = 8, Gc = 6, Kc = class e {
10941
10941
  chart;
10942
10942
  activeTool = "cursor";
10943
- pendingAnchor = null;
10943
+ pendingAnchors = [];
10944
10944
  drawings = [];
10945
10945
  callbacks = {};
10946
10946
  previewDrawingId = "__preview__";
@@ -10955,7 +10955,13 @@ var Wc = 8, Gc = 6, Kc = class e {
10955
10955
  static DOUBLE_ANCHOR_TOOLS = [
10956
10956
  "trend-line",
10957
10957
  "ray",
10958
- "info-line"
10958
+ "info-line",
10959
+ "regression-channel"
10960
+ ];
10961
+ static TRIPLE_ANCHOR_TOOLS = [
10962
+ "parallel-channel",
10963
+ "flat-line",
10964
+ "disjoint-channel"
10959
10965
  ];
10960
10966
  constructor(e) {
10961
10967
  this.chart = e;
@@ -10967,7 +10973,7 @@ var Wc = 8, Gc = 6, Kc = class e {
10967
10973
  return this.activeTool;
10968
10974
  }
10969
10975
  setTool(e) {
10970
- this.activeTool = e, this.pendingAnchor = null, this.removePreview(), this.dragState = null, this.setSelected(null), this.callbacks.onToolChange?.(e);
10976
+ this.activeTool = e, this.pendingAnchors = [], this.removePreview(), this.dragState = null, this.setSelected(null), this.callbacks.onToolChange?.(e);
10971
10977
  }
10972
10978
  getDrawings() {
10973
10979
  return this.drawings;
@@ -10976,7 +10982,7 @@ var Wc = 8, Gc = 6, Kc = class e {
10976
10982
  this.drawings = e, this.chart.setDrawings(e);
10977
10983
  }
10978
10984
  clear() {
10979
- this.pendingAnchor = null, this.removePreview(), this.dragState = null, this.setSelected(null);
10985
+ this.pendingAnchors = [], this.removePreview(), this.dragState = null, this.setSelected(null);
10980
10986
  }
10981
10987
  getSelectedDrawing() {
10982
10988
  return this.selectedDrawingId ? this.drawings.find((e) => e.id === this.selectedDrawingId) ?? null : null;
@@ -10999,7 +11005,13 @@ var Wc = 8, Gc = 6, Kc = class e {
10999
11005
  onPointerDown(t, n) {
11000
11006
  if (this.activeTool === "cursor") return this.handleCursorDown(t, n);
11001
11007
  let r = this.resolveAnchorFromPointer(t, n);
11002
- return r ? e.SINGLE_ANCHOR_TOOLS.includes(this.activeTool) ? (this.createSingleAnchorDrawing(r), !0) : e.DOUBLE_ANCHOR_TOOLS.includes(this.activeTool) ? this.pendingAnchor ? (this.createDoubleAnchorDrawing(this.pendingAnchor, r), this.pendingAnchor = null, !0) : (this.pendingAnchor = r, !0) : !1 : !1;
11008
+ if (!r) return !1;
11009
+ if (e.SINGLE_ANCHOR_TOOLS.includes(this.activeTool)) return this.createSingleAnchorDrawing(r), !0;
11010
+ let i = e.DOUBLE_ANCHOR_TOOLS.includes(this.activeTool), a = e.TRIPLE_ANCHOR_TOOLS.includes(this.activeTool);
11011
+ if (!i && !a) return !1;
11012
+ this.pendingAnchors.push(r);
11013
+ let o = i ? 2 : 3;
11014
+ return this.pendingAnchors.length >= o && (this.createMultiAnchorDrawing(this.pendingAnchors), this.pendingAnchors = []), !0;
11003
11015
  }
11004
11016
  onPointerUp(e, t) {
11005
11017
  return this.dragState ? (this.dragState = null, !0) : !1;
@@ -11029,19 +11041,23 @@ var Wc = 8, Gc = 6, Kc = class e {
11029
11041
  index: r.index,
11030
11042
  time: r.time,
11031
11043
  price: r.price
11032
- };
11044
+ }, n.kind === "flat-line" && e === 1 && n.anchors.length >= 3 && (n.anchors[2] = {
11045
+ ...n.anchors[2],
11046
+ index: r.index,
11047
+ time: r.time
11048
+ });
11033
11049
  }
11034
11050
  } else {
11035
11051
  let r = t.getBoundingClientRect(), i = e.clientX - r.left, a = e.clientY - r.top, o = i - this.dragState.startMouse.x, s = a - this.dragState.startMouse.y;
11036
11052
  for (let e = 0; e < n.anchors.length; e++) {
11037
- let r = this.dragState.snapshot[e], i = this.anchorToScreen(r);
11038
- if (!i) continue;
11039
- let a = i.x + o, c = i.y + s, l = this.screenToAnchor(a, c, t);
11040
- l && (n.anchors[e] = {
11053
+ let t = this.dragState.snapshot[e], r = this.anchorToScreen(t);
11054
+ if (!r) continue;
11055
+ let i = r.x + o, a = r.y + s, c = this.screenToAnchor(i, a);
11056
+ c && (n.anchors[e] = {
11041
11057
  ...n.anchors[e],
11042
- index: l.index,
11043
- time: l.time,
11044
- price: l.price
11058
+ index: c.index,
11059
+ time: c.time,
11060
+ price: c.price
11045
11061
  });
11046
11062
  }
11047
11063
  }
@@ -11050,10 +11066,10 @@ var Wc = 8, Gc = 6, Kc = class e {
11050
11066
  handlePreviewMove(t, n) {
11051
11067
  let r = this.resolveAnchorFromPointer(t, n);
11052
11068
  if (!r) return this.removePreview(), !1;
11053
- let i = e.SINGLE_ANCHOR_TOOLS.includes(this.activeTool), a = e.DOUBLE_ANCHOR_TOOLS.includes(this.activeTool);
11054
- if (!i && !a) return !1;
11055
- let o;
11056
- if (i) o = {
11069
+ let i = e.SINGLE_ANCHOR_TOOLS.includes(this.activeTool), a = e.DOUBLE_ANCHOR_TOOLS.includes(this.activeTool), o = e.TRIPLE_ANCHOR_TOOLS.includes(this.activeTool);
11070
+ if (!i && !a && !o) return !1;
11071
+ let s;
11072
+ if (i) s = {
11057
11073
  id: this.previewDrawingId,
11058
11074
  kind: this.getDrawingKind(this.activeTool),
11059
11075
  paneId: "main",
@@ -11071,40 +11087,113 @@ var Wc = 8, Gc = 6, Kc = class e {
11071
11087
  strokeStyle: "dashed"
11072
11088
  }
11073
11089
  };
11074
- else if (this.pendingAnchor) o = {
11090
+ else if (a && this.pendingAnchors.length >= 1) s = {
11075
11091
  id: this.previewDrawingId,
11076
- kind: this.activeTool,
11092
+ kind: this.getDrawingKind(this.activeTool),
11077
11093
  paneId: "main",
11078
11094
  visible: !0,
11079
11095
  anchors: [{
11080
11096
  id: `${this.previewDrawingId}-a`,
11081
- index: this.pendingAnchor.index,
11082
- time: this.pendingAnchor.time,
11083
- price: this.pendingAnchor.price
11097
+ index: this.pendingAnchors[0].index,
11098
+ time: this.pendingAnchors[0].time,
11099
+ price: this.pendingAnchors[0].price
11084
11100
  }, {
11085
11101
  id: `${this.previewDrawingId}-b`,
11086
11102
  index: r.index,
11087
11103
  time: r.time,
11088
11104
  price: r.price
11089
11105
  }],
11090
- params: {},
11106
+ params: this.activeTool === "regression-channel" ? { sigma: 2 } : {},
11091
11107
  style: {
11092
11108
  stroke: "#2962ff",
11093
11109
  strokeWidth: 1,
11094
- strokeStyle: "dashed"
11110
+ strokeStyle: "dashed",
11111
+ ...this.activeTool === "regression-channel" ? { fillOpacity: .1 } : {}
11095
11112
  }
11096
11113
  };
11097
- else return !1;
11098
- return this.drawings = this.drawings.filter((e) => e.id !== this.previewDrawingId), this.drawings = [...this.drawings, o], this.chart.setDrawings(this.drawings), !0;
11114
+ else if (o) {
11115
+ if (this.pendingAnchors.length === 0) return !1;
11116
+ if (this.pendingAnchors.length === 1) s = {
11117
+ id: this.previewDrawingId,
11118
+ kind: "trend-line",
11119
+ paneId: "main",
11120
+ visible: !0,
11121
+ anchors: [{
11122
+ id: `${this.previewDrawingId}-a`,
11123
+ index: this.pendingAnchors[0].index,
11124
+ time: this.pendingAnchors[0].time,
11125
+ price: this.pendingAnchors[0].price
11126
+ }, {
11127
+ id: `${this.previewDrawingId}-b`,
11128
+ index: r.index,
11129
+ time: r.time,
11130
+ price: r.price
11131
+ }],
11132
+ params: {},
11133
+ style: {
11134
+ stroke: "#2962ff",
11135
+ strokeWidth: 1,
11136
+ strokeStyle: "dashed"
11137
+ }
11138
+ };
11139
+ else {
11140
+ let e = this.activeTool === "flat-line" ? {
11141
+ id: `${this.previewDrawingId}-c`,
11142
+ index: this.pendingAnchors[1].index,
11143
+ time: this.pendingAnchors[1].time,
11144
+ price: r.price
11145
+ } : {
11146
+ id: `${this.previewDrawingId}-c`,
11147
+ index: r.index,
11148
+ time: r.time,
11149
+ price: r.price
11150
+ };
11151
+ s = {
11152
+ id: this.previewDrawingId,
11153
+ kind: this.getDrawingKind(this.activeTool),
11154
+ paneId: "main",
11155
+ visible: !0,
11156
+ anchors: [
11157
+ {
11158
+ id: `${this.previewDrawingId}-a`,
11159
+ index: this.pendingAnchors[0].index,
11160
+ time: this.pendingAnchors[0].time,
11161
+ price: this.pendingAnchors[0].price
11162
+ },
11163
+ {
11164
+ id: `${this.previewDrawingId}-b`,
11165
+ index: this.pendingAnchors[1].index,
11166
+ time: this.pendingAnchors[1].time,
11167
+ price: this.pendingAnchors[1].price
11168
+ },
11169
+ e
11170
+ ],
11171
+ params: {},
11172
+ style: {
11173
+ stroke: "#2962ff",
11174
+ strokeWidth: 1,
11175
+ strokeStyle: "dashed",
11176
+ fillOpacity: .1
11177
+ }
11178
+ };
11179
+ }
11180
+ } else return !1;
11181
+ return this.drawings = this.drawings.filter((e) => e.id !== this.previewDrawingId), this.drawings = [...this.drawings, s], this.chart.setDrawings(this.drawings), !0;
11099
11182
  }
11100
11183
  hitTest(e, t) {
11101
11184
  let n = this.drawings.filter((e) => e.id !== this.previewDrawingId && e.visible);
11102
- for (let r of n) for (let n = 0; n < r.anchors.length; n++) {
11103
- let i = this.anchorToScreen(r.anchors[n]);
11104
- if (i && Math.hypot(e - i.x, t - i.y) <= Wc) return {
11105
- drawing: r,
11106
- anchorIndex: n
11107
- };
11185
+ for (let r of n) {
11186
+ if (r.kind === "regression-channel" && r.anchors.length >= 2) {
11187
+ let n = this.hitTestRegressionEndpoints(r, e, t);
11188
+ if (n) return n;
11189
+ }
11190
+ for (let n = 0; n < r.anchors.length; n++) {
11191
+ let i = this.anchorToScreen(r.anchors[n]);
11192
+ if (i && Math.hypot(e - i.x, t - i.y) <= Wc) return {
11193
+ drawing: r,
11194
+ anchorIndex: n
11195
+ };
11196
+ }
11108
11197
  }
11109
11198
  for (let r of n) {
11110
11199
  let n = this.getDrawingLineSegments(r);
@@ -11175,7 +11264,48 @@ var Wc = 8, Gc = 6, Kc = class e {
11175
11264
  if (n.length < 2) return [];
11176
11265
  let r = [];
11177
11266
  if (n.length === 2) {
11178
- let i = n[0], a = n[1], o = a.x - i.x, s = a.y - i.y, c = i, l = a, u = this.getExtendMode(e), d = Math.max(t.plotWidth, t.plotHeight) * 4;
11267
+ let i = n[0], a = n[1];
11268
+ if (e.kind === "regression-channel") {
11269
+ let t = this.chart.getData(), n = Math.round(e.anchors[0].index), i = Math.round(e.anchors[1].index), a = Math.min(Math.max(n, 0), Math.max(i, 0)), o = Math.max(Math.max(n, 0), Math.max(i, 0)), s = Math.min(Math.max(a, 0), t.length - 1), c = Math.min(Math.max(o, 0), t.length - 1), l = t.slice(s, c + 1), u = nl(l.map((e) => e.close));
11270
+ if (u) {
11271
+ let t = e.params?.sigma ?? 2, a = u.stdDev * t, o = u.intercept, s = u.intercept + u.slope * (l.length - 1), c = this.anchorToScreen({
11272
+ id: "",
11273
+ index: n,
11274
+ price: o
11275
+ }), d = this.anchorToScreen({
11276
+ id: "",
11277
+ index: i,
11278
+ price: s
11279
+ }), f = this.anchorToScreen({
11280
+ id: "",
11281
+ index: n,
11282
+ price: o + a
11283
+ }), p = this.anchorToScreen({
11284
+ id: "",
11285
+ index: i,
11286
+ price: s + a
11287
+ }), m = this.anchorToScreen({
11288
+ id: "",
11289
+ index: n,
11290
+ price: o - a
11291
+ }), h = this.anchorToScreen({
11292
+ id: "",
11293
+ index: i,
11294
+ price: s - a
11295
+ });
11296
+ return c && d && r.push({
11297
+ a: c,
11298
+ b: d
11299
+ }), f && p && r.push({
11300
+ a: f,
11301
+ b: p
11302
+ }), m && h && r.push({
11303
+ a: m,
11304
+ b: h
11305
+ }), r;
11306
+ }
11307
+ }
11308
+ let o = a.x - i.x, s = a.y - i.y, c = i, l = a, u = this.getExtendMode(e), d = Math.max(t.plotWidth, t.plotHeight) * 4;
11179
11309
  (u === "right" || u === "both") && (l = {
11180
11310
  x: a.x + o * d,
11181
11311
  y: a.y + s * d
@@ -11186,12 +11316,103 @@ var Wc = 8, Gc = 6, Kc = class e {
11186
11316
  a: c,
11187
11317
  b: l
11188
11318
  });
11189
- } else for (let e = 0; e < n.length - 1; e++) r.push({
11190
- a: n[e],
11191
- b: n[e + 1]
11192
- });
11319
+ } else if (n.length >= 3) switch (e.kind) {
11320
+ case "parallel-channel": {
11321
+ let [e, t, i] = n, a = t.x - e.x, o = t.y - e.y, s = {
11322
+ x: i.x + a,
11323
+ y: i.y + o
11324
+ };
11325
+ r.push({
11326
+ a: e,
11327
+ b: t
11328
+ }, {
11329
+ a: i,
11330
+ b: s
11331
+ });
11332
+ break;
11333
+ }
11334
+ case "flat-line": {
11335
+ let [e, t, i] = n, a = {
11336
+ x: e.x,
11337
+ y: i.y
11338
+ }, o = {
11339
+ x: t.x,
11340
+ y: i.y
11341
+ };
11342
+ r.push({
11343
+ a: e,
11344
+ b: t
11345
+ }), r.push({
11346
+ a,
11347
+ b: o
11348
+ });
11349
+ break;
11350
+ }
11351
+ case "disjoint-channel": {
11352
+ let [e, t, i] = n, a = t.x - e.x, o = t.y - e.y, s = {
11353
+ x: i.x + a,
11354
+ y: i.y - o
11355
+ };
11356
+ r.push({
11357
+ a: e,
11358
+ b: t
11359
+ }), r.push({
11360
+ a: i,
11361
+ b: s
11362
+ });
11363
+ break;
11364
+ }
11365
+ default: for (let e = 0; e < n.length - 1; e++) r.push({
11366
+ a: n[e],
11367
+ b: n[e + 1]
11368
+ });
11369
+ }
11193
11370
  return r;
11194
11371
  }
11372
+ hitTestRegressionEndpoints(e, t, n) {
11373
+ let r = this.chart.getData();
11374
+ if (r.length === 0) return null;
11375
+ let i = Math.round(e.anchors[0].index), a = Math.round(e.anchors[1].index), o = Math.min(Math.max(i, 0), r.length - 1), s = Math.min(Math.max(a, 0), r.length - 1), c = Math.min(o, s), l = Math.max(o, s), u = r.slice(c, l + 1), d = nl(u.map((e) => e.close));
11376
+ if (!d) return null;
11377
+ let f = e.params?.sigma ?? 2, p = d.stdDev * f, m = d.intercept, h = d.intercept + d.slope * (u.length - 1), g = [
11378
+ {
11379
+ index: i,
11380
+ price: m
11381
+ },
11382
+ {
11383
+ index: a,
11384
+ price: h
11385
+ },
11386
+ {
11387
+ index: i,
11388
+ price: m + p
11389
+ },
11390
+ {
11391
+ index: a,
11392
+ price: h + p
11393
+ },
11394
+ {
11395
+ index: i,
11396
+ price: m - p
11397
+ },
11398
+ {
11399
+ index: a,
11400
+ price: h - p
11401
+ }
11402
+ ];
11403
+ for (let r of g) {
11404
+ let o = this.anchorToScreen({
11405
+ id: "",
11406
+ index: r.index,
11407
+ price: r.price
11408
+ });
11409
+ if (o && Math.hypot(t - o.x, n - o.y) <= Wc) return {
11410
+ drawing: e,
11411
+ anchorIndex: r.index <= Math.min(i, a) ? 0 : 1
11412
+ };
11413
+ }
11414
+ return null;
11415
+ }
11195
11416
  getExtendMode(e) {
11196
11417
  switch (e.kind) {
11197
11418
  case "ray": return "right";
@@ -11203,7 +11424,7 @@ var Wc = 8, Gc = 6, Kc = class e {
11203
11424
  let t = this.chart.getViewport();
11204
11425
  if (!t) return null;
11205
11426
  let n = this.chart.getOption(), r = this.chart.getCurrentDpr(), { startXPx: i, unitPx: a } = Ms(n.kWidth, n.kGap, r);
11206
- if (!Number.isFinite(e.index) || e.index < 0) return null;
11427
+ if (!Number.isFinite(e.index)) return null;
11207
11428
  let o = (i + e.index * a + (a - 1) / 2) / r - t.scrollLeft, s = this.chart.getPaneRenderers().find((e) => e.getPane().id === "main")?.getPane();
11208
11429
  return s ? {
11209
11430
  x: o,
@@ -11268,32 +11489,41 @@ var Wc = 8, Gc = 6, Kc = class e {
11268
11489
  };
11269
11490
  this.drawings = [...this.drawings, t], this.chart.setDrawings(this.drawings), this.callbacks.onDrawingCreated?.(t), this.activeTool = "cursor", this.callbacks.onToolChange?.("cursor");
11270
11491
  }
11271
- createDoubleAnchorDrawing(e, t) {
11492
+ createMultiAnchorDrawing(e) {
11272
11493
  this.drawings = this.drawings.filter((e) => e.id !== this.previewDrawingId);
11273
- let n = {
11494
+ let t = this.getDrawingKind(this.activeTool), n = t === "regression-channel" ? { sigma: 2 } : {}, r = t === "flat-line" && e.length >= 3 ? [
11495
+ e[0],
11496
+ e[1],
11497
+ {
11498
+ index: e[1].index,
11499
+ time: e[1].time,
11500
+ price: e[2].price
11501
+ }
11502
+ ] : e, i = [
11503
+ "parallel-channel",
11504
+ "regression-channel",
11505
+ "flat-line",
11506
+ "disjoint-channel"
11507
+ ].includes(t), a = {
11274
11508
  id: `drawing-${Date.now()}`,
11275
- kind: this.activeTool,
11509
+ kind: t,
11276
11510
  paneId: "main",
11277
11511
  visible: !0,
11278
- anchors: [{
11279
- id: `${Date.now()}-a`,
11512
+ anchors: r.map((e, t) => ({
11513
+ id: `${Date.now()}-${String.fromCharCode(97 + t)}`,
11280
11514
  index: e.index,
11281
11515
  time: e.time,
11282
11516
  price: e.price
11283
- }, {
11284
- id: `${Date.now()}-b`,
11285
- index: t.index,
11286
- time: t.time,
11287
- price: t.price
11288
- }],
11289
- params: {},
11517
+ })),
11518
+ params: n,
11290
11519
  style: {
11291
11520
  stroke: "#2962ff",
11292
11521
  strokeWidth: 1,
11293
- strokeStyle: "solid"
11522
+ strokeStyle: "solid",
11523
+ ...i ? { fillOpacity: .1 } : {}
11294
11524
  }
11295
11525
  };
11296
- this.drawings = [...this.drawings, n], this.chart.setDrawings(this.drawings), this.callbacks.onDrawingCreated?.(n), this.activeTool = "cursor", this.callbacks.onToolChange?.("cursor");
11526
+ this.drawings = [...this.drawings, a], this.chart.setDrawings(this.drawings), this.callbacks.onDrawingCreated?.(a), this.activeTool = "cursor", this.callbacks.onToolChange?.("cursor");
11297
11527
  }
11298
11528
  getDrawingKind(e) {
11299
11529
  switch (e) {
@@ -11652,16 +11882,97 @@ function sl() {
11652
11882
  b: u,
11653
11883
  extend: d,
11654
11884
  style: e.style
11885
+ }
11886
+ ] };
11887
+ }
11888
+ };
11889
+ }
11890
+ function cl() {
11891
+ return {
11892
+ kind: "flat-line",
11893
+ minAnchors: 3,
11894
+ maxAnchors: 3,
11895
+ compute(e, t) {
11896
+ let [n, r, i] = e.anchors;
11897
+ if (!n || !r || !i) return { primitives: [] };
11898
+ let a = t.toScreen(n), o = t.toScreen(r), s = t.toScreen(i), c = {
11899
+ x: a.x,
11900
+ y: s.y
11901
+ }, l = {
11902
+ x: o.x,
11903
+ y: s.y
11904
+ };
11905
+ return { primitives: [
11906
+ {
11907
+ kind: "area",
11908
+ points: [
11909
+ a,
11910
+ o,
11911
+ l,
11912
+ c
11913
+ ],
11914
+ closed: !0,
11915
+ style: e.style
11916
+ },
11917
+ {
11918
+ kind: "line",
11919
+ a,
11920
+ b: o,
11921
+ style: e.style
11922
+ },
11923
+ {
11924
+ kind: "line",
11925
+ a: c,
11926
+ b: l,
11927
+ style: e.style
11928
+ },
11929
+ {
11930
+ kind: "point",
11931
+ point: c,
11932
+ style: e.style
11933
+ },
11934
+ {
11935
+ kind: "point",
11936
+ point: l,
11937
+ style: e.style
11938
+ }
11939
+ ] };
11940
+ }
11941
+ };
11942
+ }
11943
+ function ll() {
11944
+ return {
11945
+ kind: "disjoint-channel",
11946
+ minAnchors: 3,
11947
+ maxAnchors: 3,
11948
+ compute(e, t) {
11949
+ let [n, r, i] = e.anchors;
11950
+ if (!n || !r || !i) return { primitives: [] };
11951
+ let a = t.toScreen(n), o = t.toScreen(r), s = t.toScreen(i), c = o.x - a.x, l = o.y - a.y, u = {
11952
+ x: s.x + c,
11953
+ y: s.y - l
11954
+ };
11955
+ return { primitives: [
11956
+ {
11957
+ kind: "area",
11958
+ points: [
11959
+ a,
11960
+ o,
11961
+ u,
11962
+ s
11963
+ ],
11964
+ closed: !0,
11965
+ style: e.style
11655
11966
  },
11656
11967
  {
11657
11968
  kind: "line",
11658
11969
  a,
11659
- b: s,
11970
+ b: o,
11660
11971
  style: e.style
11661
11972
  },
11662
11973
  {
11663
11974
  kind: "line",
11664
- a: o,
11975
+ a: s,
11665
11976
  b: u,
11666
11977
  style: e.style
11667
11978
  }
@@ -11669,7 +11980,7 @@ function sl() {
11669
11980
  }
11670
11981
  };
11671
11982
  }
11672
- function cl() {
11983
+ function ul() {
11673
11984
  return {
11674
11985
  kind: "regression-channel",
11675
11986
  minAnchors: 2,
@@ -11749,14 +12060,14 @@ function cl() {
11749
12060
  }
11750
12061
  };
11751
12062
  }
11752
- function ll(e) {
11753
- e.register(il("trend-line", "none")), e.register(il("ray", "right")), e.register(il("extended-line", "both")), e.register(al("horizontal-line")), e.register(al("horizontal-ray")), e.register(al("vertical-line")), e.register(al("cross-line")), e.register(ol()), e.register(sl()), e.register(cl());
12063
+ function dl(e) {
12064
+ e.register(il("trend-line", "none")), e.register(il("ray", "right")), e.register(il("extended-line", "both")), e.register(al("horizontal-line")), e.register(al("horizontal-ray")), e.register(al("vertical-line")), e.register(al("cross-line")), e.register(ol()), e.register(sl()), e.register(ul()), e.register(cl()), e.register(ll());
11754
12065
  }
11755
12066
  //#endregion
11756
12067
  //#region src/core/drawing/plugin.ts
11757
- function ul(e) {
12068
+ function fl(e) {
11758
12069
  let t = e.store, n = e.definitions ?? new Yc(), r = e.renderers ?? rl();
11759
- return ll(n), {
12070
+ return dl(n), {
11760
12071
  name: "drawingRenderer",
11761
12072
  version: "0.1.0",
11762
12073
  description: "绘图渲染器",
@@ -11800,7 +12111,7 @@ function ul(e) {
11800
12111
  }
11801
12112
  });
11802
12113
  if (!o) continue;
11803
- let v = t.getSelectedId() === e.id ? o.primitives.map((t) => dl(t, e.style)) : o.primitives;
12114
+ let v = t.getSelectedId() === e.id ? o.primitives.map((t) => pl(t, e.style)) : o.primitives;
11804
12115
  for (let e of v) {
11805
12116
  if (e.kind === "point") {
11806
12117
  r.point(i, e, c);
@@ -11821,7 +12132,7 @@ function ul(e) {
11821
12132
  }
11822
12133
  };
11823
12134
  }
11824
- function dl(e, t) {
12135
+ function pl(e, t) {
11825
12136
  let n = t.stroke ?? "#2962ff", r = (t.strokeWidth ?? 1) + 1, i = (t.pointRadius ?? 4) + 2;
11826
12137
  return e.kind === "point" ? {
11827
12138
  ...e,
@@ -11854,7 +12165,7 @@ function dl(e, t) {
11854
12165
  }
11855
12166
  //#endregion
11856
12167
  //#region src/core/chart.ts
11857
- var fl = class e {
12168
+ var ml = class e {
11858
12169
  dom;
11859
12170
  opt;
11860
12171
  data = [];
@@ -11885,7 +12196,7 @@ var fl = class e {
11885
12196
  ...i,
11886
12197
  kWidth: n ?? 0,
11887
12198
  kGap: r ?? 0
11888
- }, this.interaction = new Rs(this), this.markerManager = new jo(), this.pluginHost = Sa(), this.rendererPluginManager = new wa(), this.rendererPluginManager.setPluginHost(this.pluginHost), this.rendererPluginManager.setInvalidateCallback(() => this.scheduleDraw()), this.syncPaneRatiosFromSpecs(this.opt.panes), this.zoomLevelCount = Math.max(2, Math.round(this.opt.zoomLevels ?? 20)), this.currentZoomLevel = this.opt.initialZoomLevel ?? 1, this.currentZoomLevel = Math.max(1, Math.min(this.zoomLevelCount, this.currentZoomLevel)), this.initPanes(), this.useRenderer(ul({ store: this.drawingStore })), this.initResizeObserver();
12199
+ }, this.interaction = new Rs(this), this.markerManager = new jo(), this.pluginHost = Sa(), this.rendererPluginManager = new wa(), this.rendererPluginManager.setPluginHost(this.pluginHost), this.rendererPluginManager.setInvalidateCallback(() => this.scheduleDraw()), this.syncPaneRatiosFromSpecs(this.opt.panes), this.zoomLevelCount = Math.max(2, Math.round(this.opt.zoomLevels ?? 20)), this.currentZoomLevel = this.opt.initialZoomLevel ?? 1, this.currentZoomLevel = Math.max(1, Math.min(this.zoomLevelCount, this.currentZoomLevel)), this.initPanes(), this.useRenderer(fl({ store: this.drawingStore })), this.initResizeObserver();
11889
12200
  }
11890
12201
  initResizeObserver() {
11891
12202
  if (typeof ResizeObserver > "u") return;
@@ -12460,18 +12771,18 @@ var fl = class e {
12460
12771
  };
12461
12772
  return this.viewport = u, this.onViewportChange?.(u), u;
12462
12773
  }
12463
- }, pl = 3;
12464
- function ml(e, t) {
12774
+ }, hl = 3;
12775
+ function gl(e, t) {
12465
12776
  let n = (e - 1) / (t.zoomLevelCount - 1);
12466
12777
  return t.minKWidth + n * (t.maxKWidth - t.minKWidth);
12467
12778
  }
12468
- function hl(e) {
12469
- return pl / e;
12779
+ function _l(e) {
12780
+ return hl / e;
12470
12781
  }
12471
- function gl(e, t, n, r, i, a, o) {
12782
+ function vl(e, t, n, r, i, a, o) {
12472
12783
  let s = Math.max(1, Math.min(o.zoomLevelCount, r + e));
12473
12784
  if (s === r) return null;
12474
- let c = ml(s, o), l = hl(o.dpr), u = Ms(i, a, o.dpr), d = Ms(c, l, o.dpr), f = (Math.round((n + t) * o.dpr) - u.startXPx) / u.unitPx;
12785
+ let c = gl(s, o), l = _l(o.dpr), u = Ms(i, a, o.dpr), d = Ms(c, l, o.dpr), f = (Math.round((n + t) * o.dpr) - u.startXPx) / u.unitPx;
12475
12786
  return {
12476
12787
  targetLevel: s,
12477
12788
  newKWidth: c,
@@ -12479,24 +12790,24 @@ function gl(e, t, n, r, i, a, o) {
12479
12790
  newScrollLeft: (d.startXPx + f * d.unitPx) / o.dpr - t
12480
12791
  };
12481
12792
  }
12482
- function _l(e, t, n, r, i, a, o) {
12793
+ function yl(e, t, n, r, i, a, o) {
12483
12794
  let s = Math.max(1, Math.min(o.zoomLevelCount, Math.round(e))) - r;
12484
- return s === 0 ? null : gl(s, t, n, r, i, a, o);
12795
+ return s === 0 ? null : vl(s, t, n, r, i, a, o);
12485
12796
  }
12486
12797
  //#endregion
12487
12798
  //#region src/types/kLine.ts
12488
- function vl(e) {
12799
+ function bl(e) {
12489
12800
  return e.open > e.close ? "down" : e.open < e.close ? "up" : "flat";
12490
12801
  }
12491
12802
  //#endregion
12492
12803
  //#region src/types/volumePrice.ts
12493
12804
  var $ = /* @__PURE__ */ function(e) {
12494
12805
  return e.RISE_WITH_VOLUME = "rise_with_volume", e.RISE_WITHOUT_VOLUME = "rise_without_volume", e.FALL_WITH_VOLUME = "fall_with_volume", e.FALL_WITHOUT_VOLUME = "fall_without_volume", e.OTHERS = "others", e;
12495
- }({}), yl = {
12806
+ }({}), xl = {
12496
12807
  volumeAmplifyThreshold: 1.5,
12497
12808
  volumeShrinkThreshold: .8,
12498
12809
  avgPeriod: 20
12499
- }, bl = class {
12810
+ }, Sl = class {
12500
12811
  prefixSum = [];
12501
12812
  dataLength = 0;
12502
12813
  build(e) {
@@ -12521,8 +12832,8 @@ var $ = /* @__PURE__ */ function(e) {
12521
12832
  return this.dataLength;
12522
12833
  }
12523
12834
  };
12524
- function xl(e, t, n, r = yl) {
12525
- let i = new bl();
12835
+ function Cl(e, t, n, r = xl) {
12836
+ let i = new Sl();
12526
12837
  i.build(e);
12527
12838
  let a = [], { volumeAmplifyThreshold: o, volumeShrinkThreshold: s, avgPeriod: c } = r;
12528
12839
  for (let r = t; r < n && r < e.length; r++) {
@@ -12543,7 +12854,7 @@ function xl(e, t, n, r = yl) {
12543
12854
  }
12544
12855
  //#endregion
12545
12856
  //#region src/core/renderers/candle.ts
12546
- function Sl() {
12857
+ function wl() {
12547
12858
  return {
12548
12859
  name: "candle",
12549
12860
  version: "1.0.0",
@@ -12556,14 +12867,14 @@ function Sl() {
12556
12867
  if (!d.length) return;
12557
12868
  let { kWidthPx: f } = Ms(o, s, c);
12558
12869
  t.save(), t.translate(-a, 0);
12559
- let p = l || [], m = xl(d, i.start, i.end, yl);
12870
+ let p = l || [], m = Cl(d, i.start, i.end, xl);
12560
12871
  for (let r = i.start; r < i.end && r < d.length; r++) {
12561
12872
  let a = d[r];
12562
12873
  if (!a) continue;
12563
12874
  let s = n.yAxis.priceToY(a.open), l = n.yAxis.priceToY(a.close), h = n.yAxis.priceToY(a.high), g = n.yAxis.priceToY(a.low), _ = p[r - i.start];
12564
12875
  if (!_) continue;
12565
12876
  let v = (e) => Math.round(e * c) / c, y = v(s), b = v(l), x = v(h), S = v(g), C = Math.min(y, b), w = Math.max(Math.abs(y - b), 1), T = Js(Math.round(_ * c), C, f, w, c);
12566
- t.fillStyle = vl(a) === "up" ? za.UP : za.DOWN, t.fillRect(T.bodyRect.x, T.bodyRect.y, T.bodyRect.width, T.bodyRect.height);
12877
+ t.fillStyle = bl(a) === "up" ? za.UP : za.DOWN, t.fillRect(T.bodyRect.x, T.bodyRect.y, T.bodyRect.width, T.bodyRect.height);
12567
12878
  let E = T.wickRect.width, D = T.wickRect.x, O = T.bodyRect.y, k = T.bodyRect.y + T.bodyRect.height, A = Math.max(a.open, a.close), j = Math.min(a.open, a.close);
12568
12879
  if (a.high > A) {
12569
12880
  let e = Ks(D, x, O, c);
@@ -12576,14 +12887,14 @@ function Sl() {
12576
12887
  let M = m[r - i.start];
12577
12888
  if (M !== $.OTHERS && u && (e.zoomLevel ?? 1) >= 2) {
12578
12889
  let e = M === $.RISE_WITH_VOLUME || M === $.RISE_WITHOUT_VOLUME ? x - 15 : S + 15;
12579
- Cl(t, T.bodyRect.x + T.bodyRect.width / 2, e, M, r, o, 4, u, c);
12890
+ Tl(t, T.bodyRect.x + T.bodyRect.width / 2, e, M, r, o, 4, u, c);
12580
12891
  }
12581
12892
  }
12582
12893
  t.restore();
12583
12894
  }
12584
12895
  };
12585
12896
  }
12586
- function Cl(e, t, n, r, i, a, o = 4, s, c) {
12897
+ function Tl(e, t, n, r, i, a, o = 4, s, c) {
12587
12898
  let l = (e) => Math.round(e * c) / c;
12588
12899
  t = l(t), n = l(n);
12589
12900
  let u = Math.min(a, 20), d = u * Math.sqrt(3) / 2, f, p;
@@ -12649,12 +12960,12 @@ function Cl(e, t, n, r, i, a, o = 4, s, c) {
12649
12960
  }
12650
12961
  //#endregion
12651
12962
  //#region src/core/utils/tickCount.ts
12652
- function wl(e, t) {
12963
+ function El(e, t) {
12653
12964
  return Math.max(3, Math.round(e / 60) + 1);
12654
12965
  }
12655
12966
  //#endregion
12656
12967
  //#region src/core/renderers/gridLines.ts
12657
- function Tl() {
12968
+ function Dl() {
12658
12969
  return {
12659
12970
  name: "gridLines",
12660
12971
  version: "1.0.0",
@@ -12665,7 +12976,7 @@ function Tl() {
12665
12976
  draw(e) {
12666
12977
  let { ctx: t, pane: n, data: r, range: i, scrollLeft: a, kWidth: o, dpr: s, kLinePositions: c } = e, l = r;
12667
12978
  if (!l.length) return;
12668
- let u = wl(n.height);
12979
+ let u = El(n.height);
12669
12980
  t.save(), t.fillStyle = Ha.HORIZONTAL, t.translate(-a, 0);
12670
12981
  let d = t.canvas.width / s, f = a, p = a + d, m = n.yAxis.getPaddingTop(), h = n.yAxis.getPaddingBottom(), g = m, _ = Math.max(m, n.height - h), v = Math.max(0, _ - g);
12671
12982
  for (let e = 0; e < u; e++) {
@@ -12686,7 +12997,7 @@ function Tl() {
12686
12997
  }
12687
12998
  //#endregion
12688
12999
  //#region src/core/renderers/lastPrice.ts
12689
- function El() {
13000
+ function Ol() {
12690
13001
  return {
12691
13002
  name: "lastPriceLine",
12692
13003
  version: "1.0.0",
@@ -12707,7 +13018,7 @@ function El() {
12707
13018
  }
12708
13019
  //#endregion
12709
13020
  //#region src/core/renderers/extremaMarkers.ts
12710
- function Dl() {
13021
+ function kl() {
12711
13022
  return {
12712
13023
  name: "extremaMarkers",
12713
13024
  version: "1.0.0",
@@ -12730,11 +13041,11 @@ function Dl() {
12730
13041
  let t = e - i.start;
12731
13042
  return t < 0 || t >= l.length ? 0 : l[t] + o / 2;
12732
13043
  };
12733
- t.save(), t.translate(-a, 0), Ol(t, _(h), n.yAxis.priceToY(p), p, s, c, a), Ol(t, _(g), n.yAxis.priceToY(m), m, s, c, a), t.restore();
13044
+ t.save(), t.translate(-a, 0), Al(t, _(h), n.yAxis.priceToY(p), p, s, c, a), Al(t, _(g), n.yAxis.priceToY(m), m, s, c, a), t.restore();
12734
13045
  }
12735
13046
  };
12736
13047
  }
12737
- function Ol(e, t, n, r, i, a, o) {
13048
+ function Al(e, t, n, r, i, a, o) {
12738
13049
  let s = r.toFixed(2);
12739
13050
  e.font = "12px Arial";
12740
13051
  let c = e.measureText(s).width, l = t - o + 30 + 4 + c > a, u = t, d = l ? t - 30 : t + 30;
@@ -12746,27 +13057,27 @@ function Ol(e, t, n, r, i, a, o) {
12746
13057
  }
12747
13058
  //#endregion
12748
13059
  //#region src/utils/priceToY.ts
12749
- function kl(e, t, n, r, i, a) {
13060
+ function jl(e, t, n, r, i, a) {
12750
13061
  let o = t - n || 1, s = Math.max(1, r - i - a);
12751
13062
  return n + (1 - (Math.min(Math.max(e, i), i + s) - i) / s) * o;
12752
13063
  }
12753
13064
  //#endregion
12754
13065
  //#region src/utils/kLineDraw/axis.ts
12755
- function Al(e, t) {
13066
+ function Ml(e, t) {
12756
13067
  let { x: n, y: r, width: i, height: a, crosshairX: o, timestamp: s, dpr: c, fontSize: l = 16, paddingX: u = 8 } = t, d = Ia(s);
12757
13068
  e.save(), e.font = `${l}px -apple-system,BlinkMacSystemFont,Trebuchet MS,Roboto,Ubuntu,sans-serif`, e.textBaseline = "middle", e.textAlign = "center";
12758
13069
  let f = Math.round(e.measureText(d).width), p = Math.min(i, f + u * 2), m = a, h = Math.min(Math.max(o, n + p / 2), n + i - p / 2), g = r + a / 2, _ = h - p / 2, v = r;
12759
13070
  e.fillStyle = "rgba(0, 0, 0, 0.8)", e.fillRect(Z(_, c), Z(v, c), Z(p, c), Z(m, c)), e.fillStyle = "#ffffff", e.fillText(d, Z(h, c), Z(g, c)), e.restore();
12760
13071
  }
12761
- function jl(e, t) {
12762
- let { x: n, y: r, width: i, height: a, crosshairY: o, priceRange: s, yPaddingPx: c = 0, dpr: l, bgColor: u = "rgba(0, 0, 0, 0.8)", borderColor: d, textColor: f = "#ffffff", fontSize: p = 16, priceOffset: m = 0, price: h, formatPrice: g } = t, _ = Math.max(0, Math.min(c, Math.floor(a / 2) - 1)), { maxPrice: v, minPrice: y } = s, b = h ?? kl(o - r, v, y, a, _, _) + m, x = g ? g(b) : b.toFixed(2);
13072
+ function Nl(e, t) {
13073
+ let { x: n, y: r, width: i, height: a, crosshairY: o, priceRange: s, yPaddingPx: c = 0, dpr: l, bgColor: u = "rgba(0, 0, 0, 0.8)", borderColor: d, textColor: f = "#ffffff", fontSize: p = 16, priceOffset: m = 0, price: h, formatPrice: g } = t, _ = Math.max(0, Math.min(c, Math.floor(a / 2) - 1)), { maxPrice: v, minPrice: y } = s, b = h ?? jl(o - r, v, y, a, _, _) + m, x = g ? g(b) : b.toFixed(2);
12763
13074
  e.save(), e.font = `${p}px -apple-system,BlinkMacSystemFont,Trebuchet MS,Roboto,Ubuntu,sans-serif`, e.textBaseline = "middle", e.textAlign = "center";
12764
13075
  let S = p + 4, C = Math.min(Math.max(o, r + S / 2), r + a - S / 2), w = C - S / 2, T = n, E = Z(w, l), D = i, O = Z(S, l);
12765
13076
  e.fillStyle = u, e.fillRect(T, E, D, O), d && (e.strokeStyle = d, e.lineWidth = 1, e.strokeRect(Q(T, l), Q(E, l), Math.max(0, D - 1 / l), Math.max(0, O - 1 / l)));
12766
13077
  let k = n + i / 2;
12767
13078
  e.fillStyle = f, e.fillText(x, Z(k, l), Z(C, l)), e.restore();
12768
13079
  }
12769
- function Ml(e, t) {
13080
+ function Pl(e, t) {
12770
13081
  let { x: n, y: r, width: i, height: a, data: o, scrollLeft: s, kWidth: c, kGap: l, startIndex: u, endIndex: d, dpr: f, bgColor: p = Ba.TRANSPARENT, textColor: m = Ra.SECONDARY, lineColor: h = Va.DARK, fontSize: g = 12, paddingX: _ = 8, drawTopBorder: v = !0, drawBottomBorder: y = !0 } = t, b = Math.round(c * f), x = b % 2 == 0 ? b + 1 : b, S = Math.round(l * f), C = x + S, w = S, T = C / f, E = w / f, D = x / f;
12771
13082
  e.fillStyle = p, e.fillRect(n, r, i, a), v && (e.strokeStyle = h, e.lineWidth = 1, e.beginPath(), e.moveTo(n, Q(r, f)), e.lineTo(n + i, Q(r, f)), e.stroke()), y && (e.strokeStyle = h, e.lineWidth = 1, e.beginPath(), e.moveTo(n, Q(r + a, f)), e.lineTo(n + i, Q(r + a, f)), e.stroke()), e.textAlign = "center", e.textBaseline = "middle";
12772
13083
  let O = r + a / 2 + 1, k = La(o).filter((e) => e >= u && e < d);
@@ -12782,10 +13093,10 @@ function Ml(e, t) {
12782
13093
  }
12783
13094
  //#endregion
12784
13095
  //#region src/core/renderers/Indicator/scale/indicator_scale.ts
12785
- function Nl(e) {
13096
+ function Fl(e) {
12786
13097
  let { ctx: t, dpr: n, axisWidth: r, height: i, paddingTop: a, paddingBottom: o, valueMin: s, valueMax: c, isMain: l, decimals: u = 2, hideEdgeTicks: d = !0, formatLabel: f } = e, p = c - s || 1;
12787
13098
  t.save(), t.clearRect(0, 0, r, i), t.font = "12px -apple-system,BlinkMacSystemFont,Trebuchet MS,Roboto,Ubuntu,sans-serif", t.textBaseline = "middle", t.textAlign = "center";
12788
- let m = r / 2, h = a, g = Math.max(a, i - o), _ = Math.max(0, g - h), v = wl(i, l), y = p / Math.max(1, v - 1);
13099
+ let m = r / 2, h = a, g = Math.max(a, i - o), _ = Math.max(0, g - h), v = El(i, l), y = p / Math.max(1, v - 1);
12789
13100
  for (let e = 0; e < v; e++) {
12790
13101
  if (d && (e === 0 || e === v - 1)) continue;
12791
13102
  let r = c - y * e, i = h + (v <= 1 ? 0 : e / (v - 1)) * _;
@@ -12793,7 +13104,7 @@ function Nl(e) {
12793
13104
  }
12794
13105
  t.restore();
12795
13106
  }
12796
- function Pl(e) {
13107
+ function Il(e) {
12797
13108
  let { axisWidth: t, paneId: n, indicatorKey: r, label: i, decimals: a = 2, yPaddingPx: o = 0, getCrosshair: s, formatTickLabel: c, formatCrosshairLabel: l } = e, u = Hs(r, n), d = null;
12798
13109
  return {
12799
13110
  name: `${r}Scale_${n}`,
@@ -12814,7 +13125,7 @@ function Pl(e) {
12814
13125
  minPrice: f.valueMin,
12815
13126
  maxPrice: f.valueMax
12816
13127
  });
12817
- Nl({
13128
+ Fl({
12818
13129
  ctx: n,
12819
13130
  dpr: i,
12820
13131
  axisWidth: t,
@@ -12831,7 +13142,7 @@ function Pl(e) {
12831
13142
  let m = s?.();
12832
13143
  if (!m || m.activePaneId !== r.id) return;
12833
13144
  let h = m.y - r.top, g = r.yAxis.getPaddingTop(), _ = r.yAxis.getPaddingBottom(), v = g, y = Math.max(g, r.height - _), b = Math.max(1, y - v), x = (Math.min(Math.max(h, v), y) - v) / b, S = p.maxPrice - x * (p.maxPrice - p.minPrice);
12834
- jl(n, {
13145
+ Nl(n, {
12835
13146
  x: 0,
12836
13147
  y: 0,
12837
13148
  width: t,
@@ -12850,7 +13161,7 @@ function Pl(e) {
12850
13161
  }
12851
13162
  //#endregion
12852
13163
  //#region src/core/renderers/yAxis.ts
12853
- function Fl(e) {
13164
+ function Ll(e) {
12854
13165
  return {
12855
13166
  name: "yAxis",
12856
13167
  version: "1.0.0",
@@ -12860,7 +13171,7 @@ function Fl(e) {
12860
13171
  priority: X.SYSTEM_YAXIS,
12861
13172
  draw(t) {
12862
13173
  let { ctx: n, pane: r, dpr: i, yAxisCtx: a, data: o } = t, s = a || n, c = a?.canvas ? a.canvas.width / i : e.axisWidth, l = r.yAxis.getDisplayRange(r.priceRange);
12863
- r.capabilities.showPriceAxisTicks && Nl({
13174
+ r.capabilities.showPriceAxisTicks && Fl({
12864
13175
  ctx: s,
12865
13176
  dpr: i,
12866
13177
  axisWidth: c,
@@ -12876,7 +13187,7 @@ function Fl(e) {
12876
13187
  let u = o, d = r.id === "main" ? u[u.length - 1] : null;
12877
13188
  if (d) {
12878
13189
  let t = r.yAxis.priceToY(d.close);
12879
- jl(s, {
13190
+ Nl(s, {
12880
13191
  x: 0,
12881
13192
  y: r.top,
12882
13193
  width: c,
@@ -12894,7 +13205,7 @@ function Fl(e) {
12894
13205
  });
12895
13206
  }
12896
13207
  let f = e.getCrosshair?.();
12897
- f && f.activePaneId === r.id && f.price !== null && jl(s, {
13208
+ f && f.activePaneId === r.id && f.price !== null && Nl(s, {
12898
13209
  x: 0,
12899
13210
  y: r.top,
12900
13211
  width: c,
@@ -12912,8 +13223,8 @@ function Fl(e) {
12912
13223
  }
12913
13224
  //#endregion
12914
13225
  //#region src/core/renderers/Indicator/scale/macd_scale.ts
12915
- function Il(e) {
12916
- return Pl({
13226
+ function Rl(e) {
13227
+ return Il({
12917
13228
  axisWidth: e.axisWidth,
12918
13229
  paneId: e.paneId,
12919
13230
  indicatorKey: "macd",
@@ -12925,9 +13236,9 @@ function Il(e) {
12925
13236
  }
12926
13237
  //#endregion
12927
13238
  //#region src/core/renderers/Indicator/scale/volume_scale.ts
12928
- var Ll = 1e8;
12929
- function Rl(e) {
12930
- return Pl({
13239
+ var zl = 1e8;
13240
+ function Bl(e) {
13241
+ return Il({
12931
13242
  axisWidth: e.axisWidth,
12932
13243
  paneId: e.paneId,
12933
13244
  indicatorKey: "volume",
@@ -12935,14 +13246,14 @@ function Rl(e) {
12935
13246
  decimals: 2,
12936
13247
  yPaddingPx: e.yPaddingPx,
12937
13248
  getCrosshair: e.getCrosshair,
12938
- formatTickLabel: (e) => (e / Ll).toFixed(2),
12939
- formatCrosshairLabel: (e) => `${(e / Ll).toFixed(2)}亿`
13249
+ formatTickLabel: (e) => (e / zl).toFixed(2),
13250
+ formatCrosshairLabel: (e) => `${(e / zl).toFixed(2)}亿`
12940
13251
  });
12941
13252
  }
12942
13253
  //#endregion
12943
13254
  //#region src/core/renderers/Indicator/scale/rsi_scale.ts
12944
- function zl(e) {
12945
- return Pl({
13255
+ function Vl(e) {
13256
+ return Il({
12946
13257
  axisWidth: e.axisWidth,
12947
13258
  paneId: e.paneId,
12948
13259
  indicatorKey: "rsi",
@@ -12954,8 +13265,8 @@ function zl(e) {
12954
13265
  }
12955
13266
  //#endregion
12956
13267
  //#region src/core/renderers/Indicator/scale/cci_scale.ts
12957
- function Bl(e) {
12958
- return Pl({
13268
+ function Hl(e) {
13269
+ return Il({
12959
13270
  axisWidth: e.axisWidth,
12960
13271
  paneId: e.paneId,
12961
13272
  indicatorKey: "cci",
@@ -12967,8 +13278,8 @@ function Bl(e) {
12967
13278
  }
12968
13279
  //#endregion
12969
13280
  //#region src/core/renderers/Indicator/scale/stoch_scale.ts
12970
- function Vl(e) {
12971
- return Pl({
13281
+ function Ul(e) {
13282
+ return Il({
12972
13283
  axisWidth: e.axisWidth,
12973
13284
  paneId: e.paneId,
12974
13285
  indicatorKey: "stoch",
@@ -12980,8 +13291,8 @@ function Vl(e) {
12980
13291
  }
12981
13292
  //#endregion
12982
13293
  //#region src/core/renderers/Indicator/scale/mom_scale.ts
12983
- function Hl(e) {
12984
- return Pl({
13294
+ function Wl(e) {
13295
+ return Il({
12985
13296
  axisWidth: e.axisWidth,
12986
13297
  paneId: e.paneId,
12987
13298
  indicatorKey: "mom",
@@ -12993,8 +13304,8 @@ function Hl(e) {
12993
13304
  }
12994
13305
  //#endregion
12995
13306
  //#region src/core/renderers/Indicator/scale/wmsr_scale.ts
12996
- function Ul(e) {
12997
- return Pl({
13307
+ function Gl(e) {
13308
+ return Il({
12998
13309
  axisWidth: e.axisWidth,
12999
13310
  paneId: e.paneId,
13000
13311
  indicatorKey: "wmsr",
@@ -13006,8 +13317,8 @@ function Ul(e) {
13006
13317
  }
13007
13318
  //#endregion
13008
13319
  //#region src/core/renderers/Indicator/scale/kst_scale.ts
13009
- function Wl(e) {
13010
- return Pl({
13320
+ function Kl(e) {
13321
+ return Il({
13011
13322
  axisWidth: e.axisWidth,
13012
13323
  paneId: e.paneId,
13013
13324
  indicatorKey: "kst",
@@ -13019,8 +13330,8 @@ function Wl(e) {
13019
13330
  }
13020
13331
  //#endregion
13021
13332
  //#region src/core/renderers/Indicator/scale/fastk_scale.ts
13022
- function Gl(e) {
13023
- return Pl({
13333
+ function ql(e) {
13334
+ return Il({
13024
13335
  axisWidth: e.axisWidth,
13025
13336
  paneId: e.paneId,
13026
13337
  indicatorKey: "fastk",
@@ -13032,19 +13343,19 @@ function Gl(e) {
13032
13343
  }
13033
13344
  //#endregion
13034
13345
  //#region src/core/renderers/timeAxis.ts
13035
- var Kl = Symbol("time-axis");
13036
- function ql(e) {
13346
+ var Jl = Symbol("time-axis");
13347
+ function Yl(e) {
13037
13348
  return {
13038
13349
  name: "timeAxis",
13039
13350
  version: "1.0.0",
13040
13351
  description: "时间轴渲染器",
13041
13352
  debugName: "时间轴",
13042
- paneId: Kl,
13353
+ paneId: Jl,
13043
13354
  priority: X.SYSTEM_XAXIS,
13044
13355
  isSystem: !0,
13045
13356
  draw(t) {
13046
13357
  let { ctx: n, data: r, range: i, scrollLeft: a, kWidth: o, kGap: s, dpr: c, paneWidth: l } = t, u = r, d = n, f = l, p = e.height;
13047
- d.setTransform(1, 0, 0, 1, 0, 0), d.scale(c, c), d.clearRect(0, 0, f, p), Ml(d, {
13358
+ d.setTransform(1, 0, 0, 1, 0, 0), d.scale(c, c), d.clearRect(0, 0, f, p), Pl(d, {
13048
13359
  x: 0,
13049
13360
  y: 0,
13050
13361
  width: f,
@@ -13062,7 +13373,7 @@ function ql(e) {
13062
13373
  let m = e.getCrosshair?.();
13063
13374
  if (m && typeof m.index == "number") {
13064
13375
  let e = u[m.index];
13065
- e && Al(d, {
13376
+ e && Ml(d, {
13066
13377
  x: 0,
13067
13378
  y: 0,
13068
13379
  width: f,
@@ -13078,7 +13389,7 @@ function ql(e) {
13078
13389
  }
13079
13390
  //#endregion
13080
13391
  //#region src/core/renderers/crosshair.ts
13081
- function Jl(e) {
13392
+ function Xl(e) {
13082
13393
  return {
13083
13394
  name: "crosshair",
13084
13395
  version: "1.0.0",
@@ -13102,7 +13413,7 @@ function Jl(e) {
13102
13413
  }
13103
13414
  //#endregion
13104
13415
  //#region src/core/renderers/paneTitle.ts
13105
- function Yl(e) {
13416
+ function Zl(e) {
13106
13417
  let t = { ...e };
13107
13418
  return {
13108
13419
  name: `paneTitle_${e.paneId}`,
@@ -13143,13 +13454,13 @@ function Yl(e) {
13143
13454
  }
13144
13455
  //#endregion
13145
13456
  //#region ~icons/tabler/pointer
13146
- var Xl = {
13457
+ var Ql = {
13147
13458
  viewBox: "0 0 24 24",
13148
13459
  width: "1.2em",
13149
13460
  height: "1.2em"
13150
13461
  };
13151
- function Zl(e, t) {
13152
- return _(), o("svg", Xl, [...t[0] ||= [s("path", {
13462
+ function $l(e, t) {
13463
+ return _(), o("svg", Ql, [...t[0] ||= [s("path", {
13153
13464
  fill: "none",
13154
13465
  stroke: "currentColor",
13155
13466
  "stroke-linecap": "round",
@@ -13158,16 +13469,16 @@ function Zl(e, t) {
13158
13469
  d: "M7.904 17.563a1.2 1.2 0 0 0 2.228.308l2.09-3.093l4.907 4.907a1.067 1.067 0 0 0 1.509 0l1.047-1.047a1.067 1.067 0 0 0 0-1.509l-4.907-4.907l3.113-2.09a1.2 1.2 0 0 0-.309-2.228L4 4z"
13159
13470
  }, null, -1)]]);
13160
13471
  }
13161
- var Ql = d({
13472
+ var eu = d({
13162
13473
  name: "tabler-pointer",
13163
- render: Zl
13164
- }), $l = {
13474
+ render: $l
13475
+ }), tu = {
13165
13476
  viewBox: "0 0 24 24",
13166
13477
  width: "1.2em",
13167
13478
  height: "1.2em"
13168
13479
  };
13169
- function eu(e, t) {
13170
- return _(), o("svg", $l, [...t[0] ||= [s("path", {
13480
+ function nu(e, t) {
13481
+ return _(), o("svg", tu, [...t[0] ||= [s("path", {
13171
13482
  fill: "none",
13172
13483
  stroke: "currentColor",
13173
13484
  "stroke-linecap": "round",
@@ -13176,16 +13487,16 @@ function eu(e, t) {
13176
13487
  d: "M4 19h16M4 15l4-6l4 2l4-5l4 4"
13177
13488
  }, null, -1)]]);
13178
13489
  }
13179
- var tu = d({
13490
+ var ru = d({
13180
13491
  name: "tabler-chart-line",
13181
- render: eu
13182
- }), nu = {
13492
+ render: nu
13493
+ }), iu = {
13183
13494
  viewBox: "0 0 24 24",
13184
13495
  width: "1.2em",
13185
13496
  height: "1.2em"
13186
13497
  };
13187
- function ru(e, t) {
13188
- return _(), o("svg", nu, [...t[0] ||= [s("path", {
13498
+ function au(e, t) {
13499
+ return _(), o("svg", iu, [...t[0] ||= [s("path", {
13189
13500
  fill: "none",
13190
13501
  stroke: "currentColor",
13191
13502
  "stroke-linecap": "round",
@@ -13194,16 +13505,16 @@ function ru(e, t) {
13194
13505
  d: "M17 7L7 17M8 7h9v9"
13195
13506
  }, null, -1)]]);
13196
13507
  }
13197
- var iu = d({
13508
+ var ou = d({
13198
13509
  name: "tabler-arrow-up-right",
13199
- render: ru
13200
- }), au = {
13510
+ render: au
13511
+ }), su = {
13201
13512
  viewBox: "0 0 24 24",
13202
13513
  width: "1.2em",
13203
13514
  height: "1.2em"
13204
13515
  };
13205
- function ou(e, t) {
13206
- return _(), o("svg", au, [...t[0] ||= [s("path", {
13516
+ function cu(e, t) {
13517
+ return _(), o("svg", su, [...t[0] ||= [s("path", {
13207
13518
  fill: "none",
13208
13519
  stroke: "currentColor",
13209
13520
  "stroke-linecap": "round",
@@ -13212,16 +13523,16 @@ function ou(e, t) {
13212
13523
  d: "M5 12h14m-6 6l6-6m-6-6l6 6"
13213
13524
  }, null, -1)]]);
13214
13525
  }
13215
- var su = d({
13526
+ var lu = d({
13216
13527
  name: "tabler-arrow-right",
13217
- render: ou
13218
- }), cu = {
13528
+ render: cu
13529
+ }), uu = {
13219
13530
  viewBox: "0 0 24 24",
13220
13531
  width: "1.2em",
13221
13532
  height: "1.2em"
13222
13533
  };
13223
- function lu(e, t) {
13224
- return _(), o("svg", cu, [...t[0] ||= [s("path", {
13534
+ function du(e, t) {
13535
+ return _(), o("svg", uu, [...t[0] ||= [s("path", {
13225
13536
  fill: "none",
13226
13537
  stroke: "currentColor",
13227
13538
  "stroke-linecap": "round",
@@ -13230,16 +13541,16 @@ function lu(e, t) {
13230
13541
  d: "M5 12h14"
13231
13542
  }, null, -1)]]);
13232
13543
  }
13233
- var uu = d({
13544
+ var fu = d({
13234
13545
  name: "tabler-minus",
13235
- render: lu
13236
- }), du = {
13546
+ render: du
13547
+ }), pu = {
13237
13548
  viewBox: "0 0 24 24",
13238
13549
  width: "1.2em",
13239
13550
  height: "1.2em"
13240
13551
  };
13241
- function fu(e, t) {
13242
- return _(), o("svg", du, [...t[0] ||= [s("path", {
13552
+ function mu(e, t) {
13553
+ return _(), o("svg", pu, [...t[0] ||= [s("path", {
13243
13554
  fill: "none",
13244
13555
  stroke: "currentColor",
13245
13556
  "stroke-linecap": "round",
@@ -13248,16 +13559,16 @@ function fu(e, t) {
13248
13559
  d: "M3 12v.01M7 12h10m4 0v.01"
13249
13560
  }, null, -1)]]);
13250
13561
  }
13251
- var pu = d({
13562
+ var hu = d({
13252
13563
  name: "tabler-separator",
13253
- render: fu
13254
- }), mu = {
13564
+ render: mu
13565
+ }), gu = {
13255
13566
  viewBox: "0 0 24 24",
13256
13567
  width: "1.2em",
13257
13568
  height: "1.2em"
13258
13569
  };
13259
- function hu(e, t) {
13260
- return _(), o("svg", mu, [...t[0] ||= [s("path", {
13570
+ function _u(e, t) {
13571
+ return _(), o("svg", gu, [...t[0] ||= [s("path", {
13261
13572
  fill: "none",
13262
13573
  stroke: "currentColor",
13263
13574
  "stroke-linecap": "round",
@@ -13266,16 +13577,16 @@ function hu(e, t) {
13266
13577
  d: "M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2m8-16h2a2 2 0 0 1 2 2v2m-4 12h2a2 2 0 0 0 2-2v-2M9 12h6m-3-3v6"
13267
13578
  }, null, -1)]]);
13268
13579
  }
13269
- var gu = d({
13580
+ var vu = d({
13270
13581
  name: "tabler-crosshair",
13271
- render: hu
13272
- }), _u = {
13582
+ render: _u
13583
+ }), yu = {
13273
13584
  viewBox: "0 0 24 24",
13274
13585
  width: "1.2em",
13275
13586
  height: "1.2em"
13276
13587
  };
13277
- function vu(e, t) {
13278
- return _(), o("svg", _u, [...t[0] ||= [s("g", {
13588
+ function bu(e, t) {
13589
+ return _(), o("svg", yu, [...t[0] ||= [s("g", {
13279
13590
  fill: "none",
13280
13591
  stroke: "currentColor",
13281
13592
  "stroke-linecap": "round",
@@ -13283,16 +13594,16 @@ function vu(e, t) {
13283
13594
  "stroke-width": "2"
13284
13595
  }, [s("path", { d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0m9-3h.01" }), s("path", { d: "M11 12h1v4h1" })], -1)]]);
13285
13596
  }
13286
- var yu = d({
13597
+ var xu = d({
13287
13598
  name: "tabler-info-circle",
13288
- render: vu
13289
- }), bu = {
13599
+ render: bu
13600
+ }), Su = {
13290
13601
  viewBox: "0 0 24 24",
13291
13602
  width: "1.2em",
13292
13603
  height: "1.2em"
13293
13604
  };
13294
- function xu(e, t) {
13295
- return _(), o("svg", bu, [...t[0] ||= [s("path", {
13605
+ function Cu(e, t) {
13606
+ return _(), o("svg", Su, [...t[0] ||= [s("path", {
13296
13607
  fill: "none",
13297
13608
  stroke: "currentColor",
13298
13609
  "stroke-linecap": "round",
@@ -13301,16 +13612,16 @@ function xu(e, t) {
13301
13612
  d: "M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2m8-16h2a2 2 0 0 1 2 2v2m-4 12h2a2 2 0 0 0 2-2v-2"
13302
13613
  }, null, -1)]]);
13303
13614
  }
13304
- var Su = d({
13615
+ var wu = d({
13305
13616
  name: "tabler-maximize",
13306
- render: xu
13307
- }), Cu = {
13617
+ render: Cu
13618
+ }), Tu = {
13308
13619
  viewBox: "0 0 24 24",
13309
13620
  width: "1.2em",
13310
13621
  height: "1.2em"
13311
13622
  };
13312
- function wu(e, t) {
13313
- return _(), o("svg", Cu, [...t[0] ||= [s("path", {
13623
+ function Eu(e, t) {
13624
+ return _(), o("svg", Tu, [...t[0] ||= [s("path", {
13314
13625
  fill: "none",
13315
13626
  stroke: "currentColor",
13316
13627
  "stroke-linecap": "round",
@@ -13319,16 +13630,16 @@ function wu(e, t) {
13319
13630
  d: "M15 19v-2a2 2 0 0 1 2-2h2M15 5v2a2 2 0 0 0 2 2h2M5 15h2a2 2 0 0 1 2 2v2M5 9h2a2 2 0 0 0 2-2V5"
13320
13631
  }, null, -1)]]);
13321
13632
  }
13322
- var Tu = d({
13633
+ var Du = d({
13323
13634
  name: "tabler-minimize",
13324
- render: wu
13325
- }), Eu = {
13635
+ render: Eu
13636
+ }), Ou = {
13326
13637
  viewBox: "0 0 24 24",
13327
13638
  width: "1.2em",
13328
13639
  height: "1.2em"
13329
13640
  };
13330
- function Du(e, t) {
13331
- return _(), o("svg", Eu, [...t[0] ||= [s("path", {
13641
+ function ku(e, t) {
13642
+ return _(), o("svg", Ou, [...t[0] ||= [s("path", {
13332
13643
  fill: "none",
13333
13644
  stroke: "currentColor",
13334
13645
  "stroke-linecap": "round",
@@ -13337,16 +13648,16 @@ function Du(e, t) {
13337
13648
  d: "M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m4 0h6m-3-3v6m11 8l-6-6"
13338
13649
  }, null, -1)]]);
13339
13650
  }
13340
- var Ou = d({
13651
+ var Au = d({
13341
13652
  name: "tabler-zoom-in",
13342
- render: Du
13343
- }), ku = {
13653
+ render: ku
13654
+ }), ju = {
13344
13655
  viewBox: "0 0 24 24",
13345
13656
  width: "1.2em",
13346
13657
  height: "1.2em"
13347
13658
  };
13348
- function Au(e, t) {
13349
- return _(), o("svg", ku, [...t[0] ||= [s("path", {
13659
+ function Mu(e, t) {
13660
+ return _(), o("svg", ju, [...t[0] ||= [s("path", {
13350
13661
  fill: "none",
13351
13662
  stroke: "currentColor",
13352
13663
  "stroke-linecap": "round",
@@ -13355,21 +13666,93 @@ function Au(e, t) {
13355
13666
  d: "M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m4 0h6m8 11l-6-6"
13356
13667
  }, null, -1)]]);
13357
13668
  }
13358
- var ju = d({
13669
+ var Nu = d({
13359
13670
  name: "tabler-zoom-out",
13360
- render: Au
13361
- }), Mu = {
13671
+ render: Mu
13672
+ }), Pu = {
13673
+ viewBox: "0 0 24 24",
13674
+ width: "1.2em",
13675
+ height: "1.2em"
13676
+ };
13677
+ function Fu(e, t) {
13678
+ return _(), o("svg", Pu, [...t[0] ||= [s("path", {
13679
+ fill: "none",
13680
+ stroke: "currentColor",
13681
+ "stroke-linecap": "round",
13682
+ "stroke-linejoin": "round",
13683
+ "stroke-width": "2",
13684
+ d: "M3 5a2 2 0 1 0 4 0a2 2 0 1 0-4 0m14 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0M3 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m14 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0M5 7v10M7 5h10M7 19h10m2-12v10"
13685
+ }, null, -1)]]);
13686
+ }
13687
+ var Iu = d({
13688
+ name: "tabler-shape",
13689
+ render: Fu
13690
+ }), Lu = {
13691
+ viewBox: "0 0 24 24",
13692
+ width: "1.2em",
13693
+ height: "1.2em"
13694
+ };
13695
+ function Ru(e, t) {
13696
+ return _(), o("svg", Lu, [...t[0] ||= [s("path", {
13697
+ fill: "none",
13698
+ stroke: "currentColor",
13699
+ "stroke-linecap": "round",
13700
+ "stroke-linejoin": "round",
13701
+ "stroke-width": "2",
13702
+ d: "M3 7a2 2 0 1 0 4 0a2 2 0 1 0-4 0m11 8a2 2 0 1 0 4 0a2 2 0 1 0-4 0m1-9a3 3 0 1 0 6 0a3 3 0 1 0-6 0M3 18a3 3 0 1 0 6 0a3 3 0 1 0-6 0m6-1l5-1.5m-7.5-7l7.81 5.37M7 7l8-1"
13703
+ }, null, -1)]]);
13704
+ }
13705
+ var zu = d({
13706
+ name: "tabler-chart-dots-3",
13707
+ render: Ru
13708
+ }), Bu = {
13709
+ viewBox: "0 0 24 24",
13710
+ width: "1.2em",
13711
+ height: "1.2em"
13712
+ };
13713
+ function Vu(e, t) {
13714
+ return _(), o("svg", Bu, [...t[0] ||= [s("path", {
13715
+ fill: "none",
13716
+ stroke: "currentColor",
13717
+ "stroke-linecap": "round",
13718
+ "stroke-linejoin": "round",
13719
+ "stroke-width": "2",
13720
+ d: "m18 10l-6-6l-6 6zm0 4l-6 6l-6-6z"
13721
+ }, null, -1)]]);
13722
+ }
13723
+ var Hu = d({
13724
+ name: "tabler-caret-up-down",
13725
+ render: Vu
13726
+ }), Uu = {
13727
+ viewBox: "0 0 24 24",
13728
+ width: "1.2em",
13729
+ height: "1.2em"
13730
+ };
13731
+ function Wu(e, t) {
13732
+ return _(), o("svg", Uu, [...t[0] ||= [s("path", {
13733
+ fill: "none",
13734
+ stroke: "currentColor",
13735
+ "stroke-linecap": "round",
13736
+ "stroke-linejoin": "round",
13737
+ "stroke-width": "2",
13738
+ d: "M8 4H5v16h3m8-16h3v16h-3"
13739
+ }, null, -1)]]);
13740
+ }
13741
+ var Gu = d({
13742
+ name: "tabler-brackets",
13743
+ render: Wu
13744
+ }), Ku = {
13362
13745
  class: "left-toolbar",
13363
13746
  "aria-label": "图表工具栏"
13364
- }, Nu = { class: "left-toolbar__group" }, Pu = [
13747
+ }, qu = { class: "left-toolbar__group" }, Ju = [
13365
13748
  "title",
13366
13749
  "aria-label",
13367
13750
  "onClick"
13368
- ], Fu = ["onClick"], Iu = [
13751
+ ], Yu = ["onClick"], Xu = [
13369
13752
  "title",
13370
13753
  "aria-label",
13371
13754
  "onClick"
13372
- ], Lu = { class: "left-toolbar__group" }, Ru = { class: "left-toolbar__group" }, zu = ["title", "aria-label"], Bu = /* @__PURE__ */ Oo(/* @__PURE__ */ u({
13755
+ ], Zu = { class: "left-toolbar__group" }, Qu = { class: "left-toolbar__group" }, $u = ["title", "aria-label"], ed = /* @__PURE__ */ Oo(/* @__PURE__ */ u({
13373
13756
  __name: "LeftToolbar",
13374
13757
  props: { isFullscreen: { type: Boolean } },
13375
13758
  emits: [
@@ -13379,52 +13762,82 @@ var ju = d({
13379
13762
  "zoomOut"
13380
13763
  ],
13381
13764
  setup(t, { emit: r }) {
13382
- let c = r, u = [{
13383
- id: "cursor",
13384
- title: "光标",
13385
- icon: Ql
13386
- }, {
13387
- id: "lines",
13388
- title: "线条",
13389
- icon: tu,
13390
- children: [
13391
- {
13392
- id: "trend-line",
13393
- title: "线段",
13394
- icon: tu
13395
- },
13396
- {
13397
- id: "ray",
13398
- title: "射线",
13399
- icon: iu
13400
- },
13401
- {
13402
- id: "h-line",
13403
- title: "水平线",
13404
- icon: uu
13405
- },
13406
- {
13407
- id: "h-ray",
13408
- title: "水平射线",
13409
- icon: su
13410
- },
13411
- {
13412
- id: "v-line",
13413
- title: "垂直线",
13414
- icon: pu
13415
- },
13416
- {
13417
- id: "crosshair-line",
13418
- title: "十字线",
13419
- icon: gu
13420
- },
13421
- {
13422
- id: "info-line",
13423
- title: "信息线",
13424
- icon: yu
13425
- }
13426
- ]
13427
- }], d = y("cursor"), f = y(null);
13765
+ let c = r, u = [
13766
+ {
13767
+ id: "cursor",
13768
+ title: "光标",
13769
+ icon: eu
13770
+ },
13771
+ {
13772
+ id: "lines",
13773
+ title: "线条",
13774
+ icon: ru,
13775
+ children: [
13776
+ {
13777
+ id: "trend-line",
13778
+ title: "线段",
13779
+ icon: ru
13780
+ },
13781
+ {
13782
+ id: "ray",
13783
+ title: "射线",
13784
+ icon: ou
13785
+ },
13786
+ {
13787
+ id: "h-line",
13788
+ title: "水平线",
13789
+ icon: fu
13790
+ },
13791
+ {
13792
+ id: "h-ray",
13793
+ title: "水平射线",
13794
+ icon: lu
13795
+ },
13796
+ {
13797
+ id: "v-line",
13798
+ title: "垂直线",
13799
+ icon: hu
13800
+ },
13801
+ {
13802
+ id: "crosshair-line",
13803
+ title: "十字线",
13804
+ icon: vu
13805
+ },
13806
+ {
13807
+ id: "info-line",
13808
+ title: "信息线",
13809
+ icon: xu
13810
+ }
13811
+ ]
13812
+ },
13813
+ {
13814
+ id: "channels",
13815
+ title: "通道",
13816
+ icon: Iu,
13817
+ children: [
13818
+ {
13819
+ id: "parallel-channel",
13820
+ title: "平行通道",
13821
+ icon: Iu
13822
+ },
13823
+ {
13824
+ id: "regression-channel",
13825
+ title: "回归趋势",
13826
+ icon: zu
13827
+ },
13828
+ {
13829
+ id: "flat-line",
13830
+ title: "平滑顶底",
13831
+ icon: Hu
13832
+ },
13833
+ {
13834
+ id: "disjoint-channel",
13835
+ title: "不相交通道",
13836
+ icon: Gu
13837
+ }
13838
+ ]
13839
+ }
13840
+ ], d = y("cursor"), f = y(null);
13428
13841
  function m(e) {
13429
13842
  return d.value === e.id ? !0 : e.children ? e.children.some((e) => e.id === d.value) : !1;
13430
13843
  }
@@ -13452,8 +13865,8 @@ var ju = d({
13452
13865
  document.addEventListener("click", T, !0);
13453
13866
  }), g(() => {
13454
13867
  document.removeEventListener("click", T, !0);
13455
- }), (r, c) => (_(), o("nav", Mu, [
13456
- s("div", Nu, [(_(), o(e, null, b(u, (t) => s("div", {
13868
+ }), (r, c) => (_(), o("nav", Ku, [
13869
+ s("div", qu, [(_(), o(e, null, b(u, (t) => s("div", {
13457
13870
  key: t.id,
13458
13871
  class: "tool-item"
13459
13872
  }, [s("button", {
@@ -13473,7 +13886,7 @@ var ju = d({
13473
13886
  class: p(["corner-indicator", { open: f.value === t.id }]),
13474
13887
  onClick: D((e) => C(t.id), ["stop"]),
13475
13888
  "aria-label": "展开子菜单"
13476
- }, null, 10, Fu)) : a("", !0)], 42, Pu), l(n, { name: "dropdown" }, {
13889
+ }, null, 10, Yu)) : a("", !0)], 42, Ju), l(n, { name: "dropdown" }, {
13477
13890
  default: E(() => [f.value === t.id && t.children && t.children.length ? (_(), o("div", {
13478
13891
  key: 0,
13479
13892
  class: "tool-dropdown",
@@ -13490,11 +13903,11 @@ var ju = d({
13490
13903
  }, [(_(), i(x(e.icon), {
13491
13904
  class: "tool-icon",
13492
13905
  "aria-hidden": "true"
13493
- }))], 10, Iu))), 128))], 32)) : a("", !0)]),
13906
+ }))], 10, Xu))), 128))], 32)) : a("", !0)]),
13494
13907
  _: 2
13495
13908
  }, 1024)])), 64))]),
13496
13909
  c[18] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
13497
- s("div", Lu, [s("button", {
13910
+ s("div", Zu, [s("button", {
13498
13911
  type: "button",
13499
13912
  class: "left-toolbar__button",
13500
13913
  title: "放大",
@@ -13503,7 +13916,7 @@ var ju = d({
13503
13916
  onPointerdown: c[7] ||= D(() => {}, ["stop"]),
13504
13917
  onPointermove: c[8] ||= D(() => {}, ["stop"]),
13505
13918
  onPointerup: c[9] ||= D(() => {}, ["stop"])
13506
- }, [l(w(Ou), {
13919
+ }, [l(w(Au), {
13507
13920
  class: "tool-icon",
13508
13921
  "aria-hidden": "true"
13509
13922
  })], 32), s("button", {
@@ -13515,12 +13928,12 @@ var ju = d({
13515
13928
  onPointerdown: c[11] ||= D(() => {}, ["stop"]),
13516
13929
  onPointermove: c[12] ||= D(() => {}, ["stop"]),
13517
13930
  onPointerup: c[13] ||= D(() => {}, ["stop"])
13518
- }, [l(w(ju), {
13931
+ }, [l(w(Nu), {
13519
13932
  class: "tool-icon",
13520
13933
  "aria-hidden": "true"
13521
13934
  })], 32)]),
13522
13935
  c[19] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
13523
- s("div", Ru, [s("button", {
13936
+ s("div", Qu, [s("button", {
13524
13937
  type: "button",
13525
13938
  class: "left-toolbar__button",
13526
13939
  title: t.isFullscreen ? "退出全屏" : "全屏显示",
@@ -13529,21 +13942,21 @@ var ju = d({
13529
13942
  onPointerdown: c[15] ||= D(() => {}, ["stop"]),
13530
13943
  onPointermove: c[16] ||= D(() => {}, ["stop"]),
13531
13944
  onPointerup: c[17] ||= D(() => {}, ["stop"])
13532
- }, [t.isFullscreen ? (_(), i(w(Tu), {
13945
+ }, [t.isFullscreen ? (_(), i(w(Du), {
13533
13946
  key: 0,
13534
13947
  class: "tool-icon",
13535
13948
  "aria-hidden": "true"
13536
- })) : (_(), i(w(Su), {
13949
+ })) : (_(), i(w(wu), {
13537
13950
  key: 1,
13538
13951
  class: "tool-icon",
13539
13952
  "aria-hidden": "true"
13540
- }))], 40, zu)])
13953
+ }))], 40, $u)])
13541
13954
  ]));
13542
13955
  }
13543
- }), [["__scopeId", "data-v-b530debe"]]), Vu = { class: "chart-wrapper" }, Hu = { class: "chart-main" }, Uu = {
13956
+ }), [["__scopeId", "data-v-f1125609"]]), td = { class: "chart-wrapper" }, nd = { class: "chart-main" }, rd = {
13544
13957
  class: "pane-separator-layer",
13545
13958
  "aria-hidden": "true"
13546
- }, Wu = 4, Gu = /* @__PURE__ */ Oo(/* @__PURE__ */ u({
13959
+ }, id = 4, ad = /* @__PURE__ */ Oo(/* @__PURE__ */ u({
13547
13960
  __name: "KLineChart",
13548
13961
  props: {
13549
13962
  semanticConfig: {},
@@ -13570,12 +13983,12 @@ var ju = d({
13570
13983
  rightAxisWidth: u.rightAxisWidth,
13571
13984
  priceLabelWidth: u.priceLabelWidth
13572
13985
  });
13573
- k.actions.setZoomState(k.state.zoomLevel, ml(k.state.zoomLevel, {
13986
+ k.actions.setZoomState(k.state.zoomLevel, gl(k.state.zoomLevel, {
13574
13987
  minKWidth: u.minKWidth,
13575
13988
  maxKWidth: u.maxKWidth,
13576
13989
  zoomLevelCount: u.zoomLevels,
13577
13990
  dpr: k.state.viewportDpr
13578
- }), hl(k.state.viewportDpr)), r(() => k.state.dataLength), r(() => k.state.viewportDpr);
13991
+ }), _l(k.state.viewportDpr)), r(() => k.state.dataLength), r(() => k.state.viewportDpr);
13579
13992
  let A = r(() => k.state.zoomLevel), j = r(() => k.state.kWidth), M = r(() => k.state.kGap), N = r(() => k.state.paneRatios), ee = r(() => k.state.selectedDrawingId), P = r(() => k.state.dataVersion);
13580
13993
  function F() {
13581
13994
  D.value?.scheduleDraw();
@@ -13775,11 +14188,11 @@ var ju = d({
13775
14188
  return { ...Ne[e].defaultParams };
13776
14189
  }
13777
14190
  function Le(e = "VOLUME", t) {
13778
- if (U.value.length >= Wu) return !1;
14191
+ if (U.value.length >= id) return !1;
13779
14192
  let n = `sub_${e}`;
13780
14193
  if (U.value.some((e) => e.id === n)) return !0;
13781
14194
  if (!D.value?.createSubPane(e, t ?? Ie(e))) return !1;
13782
- let r = Yl({
14195
+ let r = Zl({
13783
14196
  paneId: n,
13784
14197
  title: e,
13785
14198
  getTitleInfo: () => Ue(n)
@@ -13831,7 +14244,7 @@ var ju = d({
13831
14244
  let e = D.value?.getSubPaneIndicators() ?? [];
13832
14245
  U.value = [];
13833
14246
  for (let t of e) {
13834
- let e = `sub_${t}`, n = Yl({
14247
+ let e = `sub_${t}`, n = Zl({
13835
14248
  paneId: e,
13836
14249
  title: t,
13837
14250
  getTitleInfo: () => Ue(e)
@@ -13851,7 +14264,7 @@ var ju = d({
13851
14264
  if (!n) return;
13852
14265
  let r = n.indicatorId;
13853
14266
  D.value?.removeRenderer(n.paneTitleRendererName), D.value?.removeSubPane(r), D.value?.createSubPane(t, Ie(t));
13854
- let i = `sub_${t}`, a = Yl({
14267
+ let i = `sub_${t}`, a = Zl({
13855
14268
  paneId: i,
13856
14269
  title: t,
13857
14270
  getTitleInfo: () => Ue(i)
@@ -13940,13 +14353,17 @@ var ju = d({
13940
14353
  }
13941
14354
  let Je = r(() => u.rightAxisWidth + u.priceLabelWidth), Ye = k.computed.totalWidth;
13942
14355
  function Xe() {
13943
- let e = E.value;
13944
- e && (e.scrollLeft = e.scrollWidth, F());
14356
+ let e = E.value, t = D.value;
14357
+ if (!e || !t) return;
14358
+ let n = t.getData()?.length ?? 0;
14359
+ if (n === 0) return;
14360
+ let r = t.getCurrentDpr(), { unitPx: i, startXPx: a } = Ms(j.value, M.value, r), o = (a + n * i) / r, s = Math.max(0, e.scrollWidth - e.clientWidth), c = Math.min(s, Math.max(0, o - e.clientWidth));
14361
+ e.scrollLeft = Math.round(c * r) / r, F();
13945
14362
  }
13946
14363
  function Ze(e, t) {
13947
14364
  let n = D.value, r = E.value;
13948
14365
  if (!n || !r) return;
13949
- let i = n.getCurrentDpr(), a = _l(e, t ?? (n.getViewport()?.plotWidth ?? r.clientWidth) / 2, r.scrollLeft, A.value, j.value, M.value, {
14366
+ let i = n.getCurrentDpr(), a = yl(e, t ?? (n.getViewport()?.plotWidth ?? r.clientWidth) / 2, r.scrollLeft, A.value, j.value, M.value, {
13950
14367
  minKWidth: u.minKWidth,
13951
14368
  maxKWidth: u.maxKWidth,
13952
14369
  zoomLevelCount: u.zoomLevels,
@@ -13982,7 +14399,7 @@ var ju = d({
13982
14399
  t.preventDefault();
13983
14400
  let n = D.value;
13984
14401
  if (!n) return;
13985
- let r = e.getBoundingClientRect(), i = t.clientX - r.left, a = e.scrollLeft, o = n.getCurrentDpr(), s = gl(t.deltaY > 0 ? -1 : 1, i, a, A.value, j.value, M.value, {
14402
+ let r = e.getBoundingClientRect(), i = t.clientX - r.left, a = e.scrollLeft, o = n.getCurrentDpr(), s = vl(t.deltaY > 0 ? -1 : 1, i, a, A.value, j.value, M.value, {
13986
14403
  minKWidth: u.minKWidth,
13987
14404
  maxKWidth: u.maxKWidth,
13988
14405
  zoomLevelCount: u.zoomLevels,
@@ -13996,7 +14413,7 @@ var ju = d({
13996
14413
  }));
13997
14414
  };
13998
14415
  e.addEventListener("wheel", i, { passive: !1 });
13999
- let a = new fl({
14416
+ let a = new ml({
14000
14417
  container: e,
14001
14418
  canvasLayer: t,
14002
14419
  rightAxisLayer: n,
@@ -14016,13 +14433,13 @@ var ju = d({
14016
14433
  zoomLevels: u.zoomLevels,
14017
14434
  initialZoomLevel: u.initialZoomLevel
14018
14435
  });
14019
- a.useRenderer(Tl()), a.useRenderer(Dl()), a.useRenderer(Xs({
14436
+ a.useRenderer(Dl()), a.useRenderer(kl()), a.useRenderer(Xs({
14020
14437
  ma5: !0,
14021
14438
  ma10: !0,
14022
14439
  ma20: !0,
14023
14440
  ma30: !0,
14024
14441
  ma60: !0
14025
- })), a.useRenderer(Qs()), a.setRendererEnabled("boll", !1), a.useRenderer(nc()), a.setRendererEnabled("expma", !1), a.useRenderer(ac()), a.setRendererEnabled("ene", !1), a.useRenderer(Sl()), a.useRenderer(El()), a.useRenderer(ka());
14442
+ })), a.useRenderer(Qs()), a.setRendererEnabled("boll", !1), a.useRenderer(nc()), a.setRendererEnabled("expma", !1), a.useRenderer(ac()), a.setRendererEnabled("ene", !1), a.useRenderer(wl()), a.useRenderer(Ol()), a.useRenderer(ka());
14026
14443
  let o = u.rightAxisWidth + u.priceLabelWidth, s = () => {
14027
14444
  let e = a.interaction.crosshairPos, t = a.interaction.crosshairPrice, n = a.interaction.activePaneId;
14028
14445
  return e && t !== null ? {
@@ -14031,46 +14448,46 @@ var ju = d({
14031
14448
  activePaneId: n
14032
14449
  } : null;
14033
14450
  };
14034
- a.useRenderer(Fl({
14451
+ a.useRenderer(Ll({
14035
14452
  axisWidth: o,
14036
14453
  yPaddingPx: u.yPaddingPx,
14037
14454
  getCrosshair: s
14038
14455
  })), a.useRenderer(sc({ yPaddingPx: u.yPaddingPx }));
14039
14456
  let c = [
14040
14457
  {
14041
- create: Rl,
14458
+ create: Bl,
14042
14459
  paneId: "sub_VOLUME"
14043
14460
  },
14044
14461
  {
14045
- create: Il,
14462
+ create: Rl,
14046
14463
  paneId: "sub_MACD"
14047
14464
  },
14048
14465
  {
14049
- create: zl,
14466
+ create: Vl,
14050
14467
  paneId: "sub_RSI"
14051
14468
  },
14052
14469
  {
14053
- create: Bl,
14470
+ create: Hl,
14054
14471
  paneId: "sub_CCI"
14055
14472
  },
14056
14473
  {
14057
- create: Vl,
14474
+ create: Ul,
14058
14475
  paneId: "sub_STOCH"
14059
14476
  },
14060
14477
  {
14061
- create: Hl,
14478
+ create: Wl,
14062
14479
  paneId: "sub_MOM"
14063
14480
  },
14064
14481
  {
14065
- create: Ul,
14482
+ create: Gl,
14066
14483
  paneId: "sub_WMSR"
14067
14484
  },
14068
14485
  {
14069
- create: Wl,
14486
+ create: Kl,
14070
14487
  paneId: "sub_KST"
14071
14488
  },
14072
14489
  {
14073
- create: Gl,
14490
+ create: ql,
14074
14491
  paneId: "sub_FASTK"
14075
14492
  }
14076
14493
  ];
@@ -14080,12 +14497,12 @@ var ju = d({
14080
14497
  yPaddingPx: u.yPaddingPx,
14081
14498
  getCrosshair: s
14082
14499
  }));
14083
- a.useRenderer(Jl({ getCrosshairState: () => ({
14500
+ a.useRenderer(Xl({ getCrosshairState: () => ({
14084
14501
  pos: a.interaction.crosshairPos,
14085
14502
  activePaneId: a.interaction.activePaneId,
14086
14503
  isDragging: a.interaction.isDraggingState(),
14087
14504
  price: a.interaction.crosshairPrice
14088
- }) })), a.useRenderer(ql({
14505
+ }) })), a.useRenderer(Yl({
14089
14506
  height: u.bottomAxisHeight,
14090
14507
  getCrosshair: () => {
14091
14508
  let e = a.interaction.crosshairPos, t = a.interaction.crosshairIndex;
@@ -14096,7 +14513,7 @@ var ju = d({
14096
14513
  }
14097
14514
  })), a.setOnViewportChange((e) => {
14098
14515
  k.actions.setViewportDpr(e.dpr), k.actions.setViewWidth(e.plotWidth);
14099
- let t = hl(e.dpr);
14516
+ let t = _l(e.dpr);
14100
14517
  k.actions.setZoomState(k.state.zoomLevel, k.state.kWidth, t), a.applyRenderState(k.state.kWidth, t, k.state.zoomLevel);
14101
14518
  }), a.setOnPaneLayoutChange((e) => {
14102
14519
  let t = {};
@@ -14125,7 +14542,7 @@ var ju = d({
14125
14542
  }), a.interaction.setOnPinchZoom((e, t) => {
14126
14543
  let n = E.value;
14127
14544
  if (!n || !a) return;
14128
- let r = t - n.getBoundingClientRect().left, i = n.scrollLeft, o = a.getCurrentDpr(), s = gl(e, r, i, A.value, j.value, M.value, {
14545
+ let r = t - n.getBoundingClientRect().left, i = n.scrollLeft, o = a.getCurrentDpr(), s = vl(e, r, i, A.value, j.value, M.value, {
14129
14546
  minKWidth: u.minKWidth,
14130
14547
  maxKWidth: u.maxKWidth,
14131
14548
  zoomLevelCount: u.zoomLevels,
@@ -14158,20 +14575,20 @@ var ju = d({
14158
14575
  let t = await O.value?.applyConfig(e);
14159
14576
  t && !t.success && console.error("Semantic config apply failed:", t.errors);
14160
14577
  }
14161
- }, { deep: !0 }), (n, r) => (_(), o("div", Vu, [s("div", { class: p(["chart-stage", {
14578
+ }, { deep: !0 }), (n, r) => (_(), o("div", td, [s("div", { class: p(["chart-stage", {
14162
14579
  "is-dragging": ce.value,
14163
14580
  "is-resizing-pane": le.value,
14164
14581
  "is-hovering-pane-separator": ue.value,
14165
14582
  "is-hovering-right-axis": fe.value,
14166
14583
  "is-hovering-kline": pe.value !== null
14167
- }]) }, [l(Bu, {
14584
+ }]) }, [l(ed, {
14168
14585
  "is-fullscreen": t.isFullscreen,
14169
14586
  onSelectTool: be,
14170
14587
  onToggleFullscreen: r[0] ||= (e) => n.$emit("toggleFullscreen"),
14171
14588
  onZoomIn: r[1] ||= (e) => Ze(A.value + 1),
14172
14589
  onZoomOut: r[2] ||= (e) => Ze(A.value - 1)
14173
- }, null, 8, ["is-fullscreen"]), s("div", Hu, [
14174
- s("div", Uu, [(_(!0), o(e, null, b(ae.value, (e) => (_(), o("div", {
14590
+ }, null, 8, ["is-fullscreen"]), s("div", nd, [
14591
+ s("div", rd, [(_(!0), o(e, null, b(ae.value, (e) => (_(), o("div", {
14175
14592
  key: e.id,
14176
14593
  class: p(["pane-separator-line", { "is-active": de.value === e.id }]),
14177
14594
  style: m({ top: `${e.top}px` })
@@ -14269,8 +14686,8 @@ var ju = d({
14269
14686
  onReorderSubIndicators: qe
14270
14687
  }, null, 8, ["active-indicators", "indicator-params"])]));
14271
14688
  }
14272
- }), [["__scopeId", "data-v-3f35943c"]]), Ku = { install(e) {
14273
- e.component("KLineChart", Gu);
14689
+ }), [["__scopeId", "data-v-3ad2d352"]]), od = { install(e) {
14690
+ e.component("KLineChart", ad);
14274
14691
  } };
14275
14692
  //#endregion
14276
- export { ya as ConfigManager, I as EventBus, ga as GLOBAL_PANE_ID, va as HookSystem, Gu as KLineChart, Ku as KMapPlugin, xa as PluginHostImpl, _a as PluginRegistry, ma as PluginState, X as RENDERER_PRIORITY, wa as RendererPluginManager, Sa as createPluginHost, ha as wrapPaneInfo };
14693
+ export { ya as ConfigManager, I as EventBus, ga as GLOBAL_PANE_ID, va as HookSystem, ad as KLineChart, od as KMapPlugin, xa as PluginHostImpl, _a as PluginRegistry, ma as PluginState, X as RENDERER_PRIORITY, wa as RendererPluginManager, Sa as createPluginHost, ha as wrapPaneInfo };