@tradecanvas/chart 1.27.0 → 1.29.0
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/Chart.d.ts +42 -1
- package/dist/Chart.d.ts.map +1 -1
- package/dist/LayoutSession-DhB5RGm1.cjs +2 -0
- package/dist/LayoutSession-DhB5RGm1.cjs.map +1 -0
- package/dist/{LayoutSession-CUS33zmB.js → LayoutSession-goRU8aOv.js} +92 -9
- package/dist/LayoutSession-goRU8aOv.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/widget/ChartWidget.d.ts +2 -0
- package/dist/widget/ChartWidget.d.ts.map +1 -1
- package/dist/widget/index.cjs +50 -11
- package/dist/widget/index.cjs.map +1 -1
- package/dist/widget/index.js +216 -192
- package/dist/widget/index.js.map +1 -1
- package/dist/widget/keyboardInset.d.ts +9 -0
- package/dist/widget/keyboardInset.d.ts.map +1 -0
- package/package.json +3 -3
- package/dist/LayoutSession-CUS33zmB.js.map +0 -1
- package/dist/LayoutSession-CYdvbLA3.cjs +0 -2
- package/dist/LayoutSession-CYdvbLA3.cjs.map +0 -1
|
@@ -901,7 +901,7 @@ function Pn(e) {
|
|
|
901
901
|
if (typeof e == "number" && !Number.isFinite(e)) throw RangeError(`Invalid UTC offset: ${e}`);
|
|
902
902
|
}
|
|
903
903
|
var Fn = 2, In = .08, Ln = 800, Rn = 20, zn = 8, Bn = new Set(["horizontalLine", "crossLine"]), Vn = new Set(["verticalLine", "crossLine"]), Hn = class {
|
|
904
|
-
static version = "1.
|
|
904
|
+
static version = "1.29.0";
|
|
905
905
|
engine;
|
|
906
906
|
viewport;
|
|
907
907
|
dataManager;
|
|
@@ -925,6 +925,7 @@ var Fn = 2, In = .08, Ln = 800, Rn = 20, zn = 8, Bn = new Set(["horizontalLine",
|
|
|
925
925
|
paneStyles = /* @__PURE__ */ new Map();
|
|
926
926
|
lastBackground = null;
|
|
927
927
|
renderScheduled = !1;
|
|
928
|
+
renderDeferred = !1;
|
|
928
929
|
priceAxisWidth = a;
|
|
929
930
|
measureCtx;
|
|
930
931
|
containerSizeCache = null;
|
|
@@ -949,6 +950,12 @@ var Fn = 2, In = .08, Ln = 800, Rn = 20, zn = 8, Bn = new Set(["horizontalLine",
|
|
|
949
950
|
hostSessionHours = { ...De };
|
|
950
951
|
compareRenderer;
|
|
951
952
|
countdownInterval = null;
|
|
953
|
+
pausedFor = {
|
|
954
|
+
host: !1,
|
|
955
|
+
page: !1,
|
|
956
|
+
offscreen: !1
|
|
957
|
+
};
|
|
958
|
+
stopWatchingVisibility = null;
|
|
952
959
|
volumeRenderer;
|
|
953
960
|
volumeProfile;
|
|
954
961
|
marketProfile;
|
|
@@ -1084,7 +1091,7 @@ var Fn = 2, In = .08, Ln = 800, Rn = 20, zn = 8, Bn = new Set(["horizontalLine",
|
|
|
1084
1091
|
contextMenu: { enabled: this.features.tradingContextMenu }
|
|
1085
1092
|
}), this.tradingRenderer = new ut(this.tradingManager), this.tradingManager.setContainer(e), this.tradingManager.setRequestRender(() => this.engine.requestRender(r.Overlay)), this.tradingManager.setEventCallback((e, t) => {
|
|
1086
1093
|
this.eventBus.emit(e, t);
|
|
1087
|
-
}), this.engine = new Xe(e);
|
|
1094
|
+
}), this.engine = new Xe(e, t.maxPixelRatio);
|
|
1088
1095
|
let a = this.engine.dprManager.getContainerSize();
|
|
1089
1096
|
if (this.viewport = new ft(a.width, a.height, t.minBarSpacing ?? 2, t.maxBarSpacing ?? 30, t.rightMargin ?? 5), this.viewport.setPanLimits({
|
|
1090
1097
|
freePan: t.freePan ?? !0,
|
|
@@ -1333,7 +1340,7 @@ var Fn = 2, In = .08, Ln = 800, Rn = 20, zn = 8, Bn = new Set(["horizontalLine",
|
|
|
1333
1340
|
}
|
|
1334
1341
|
}), this.interactionManager.setOverlayDirtyCallback((e) => {
|
|
1335
1342
|
this.engine.requestRender(e ? r.Hover : r.Overlay);
|
|
1336
|
-
}), this.interactionManager.attach(), t.timeZone !== void 0 && t.timeZone !== null && this.setTimezone(t.timeZone), t.leftPriceScale && (this.leftScaleRequested = !0), this.syncRenderContext(), this.engine.start(), this.engine.onGpuLost = () => this.eventBus.emit("rendererChange", {
|
|
1343
|
+
}), this.interactionManager.setPageScroll(t.pageScroll ?? !1), this.interactionManager.attach(), t.timeZone !== void 0 && t.timeZone !== null && this.setTimezone(t.timeZone), t.leftPriceScale && (this.leftScaleRequested = !0), this.syncRenderContext(), this.engine.start(), this.watchVisibility(e, t.pauseWhenHidden !== !1), this.engine.onGpuLost = () => this.eventBus.emit("rendererChange", {
|
|
1337
1344
|
renderer: "canvas",
|
|
1338
1345
|
reason: "contextLost"
|
|
1339
1346
|
}), this.engine.onGpuRestored = () => this.eventBus.emit("rendererChange", {
|
|
@@ -2358,7 +2365,7 @@ var Fn = 2, In = .08, Ln = 800, Rn = 20, zn = 8, Bn = new Set(["horizontalLine",
|
|
|
2358
2365
|
return;
|
|
2359
2366
|
}
|
|
2360
2367
|
let n = this.dataManager.getData();
|
|
2361
|
-
this.
|
|
2368
|
+
this.indicatorEngine.deferRecalculateFrom(n, n.length - 1), this.announceIndicatorUpdate(n.length - 1), this.scheduleRender();
|
|
2362
2369
|
}), this.setBidAsk(null), this.streamManager.on("quote", (e) => {
|
|
2363
2370
|
let t = this.priceLines.getBidAsk();
|
|
2364
2371
|
this.setBidAsk({
|
|
@@ -2534,6 +2541,63 @@ var Fn = 2, In = .08, Ln = 800, Rn = 20, zn = 8, Bn = new Set(["horizontalLine",
|
|
|
2534
2541
|
let r = N(Math.min(e, t), n), i = N(Math.max(e, t), n);
|
|
2535
2542
|
this.viewport.zoomToBarRange(r, i), this.updateViewportAndRender();
|
|
2536
2543
|
}
|
|
2544
|
+
suspend() {
|
|
2545
|
+
this.setPaused("host", !0);
|
|
2546
|
+
}
|
|
2547
|
+
resume() {
|
|
2548
|
+
this.setPaused("host", !1);
|
|
2549
|
+
}
|
|
2550
|
+
isSuspended() {
|
|
2551
|
+
return this.pausedFor.host || this.pausedFor.page || this.pausedFor.offscreen;
|
|
2552
|
+
}
|
|
2553
|
+
setPaused(e, t) {
|
|
2554
|
+
let n = this.isSuspended();
|
|
2555
|
+
this.pausedFor = {
|
|
2556
|
+
...this.pausedFor,
|
|
2557
|
+
[e]: t
|
|
2558
|
+
};
|
|
2559
|
+
let r = this.isSuspended();
|
|
2560
|
+
if (!(n === r || this.disposed)) {
|
|
2561
|
+
if (r) {
|
|
2562
|
+
this.engine.renderLoop.pause();
|
|
2563
|
+
return;
|
|
2564
|
+
}
|
|
2565
|
+
this.renderDeferred && (this.renderDeferred = !1, this.scheduleRender()), this.engine.renderLoop.resume();
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
watchVisibility(e, t) {
|
|
2569
|
+
let n = [];
|
|
2570
|
+
if (t && typeof IntersectionObserver < "u") {
|
|
2571
|
+
let t = new IntersectionObserver((e) => {
|
|
2572
|
+
let t = e[e.length - 1];
|
|
2573
|
+
t && this.setPaused("offscreen", !t.isIntersecting);
|
|
2574
|
+
});
|
|
2575
|
+
t.observe(e), n.push(() => t.disconnect());
|
|
2576
|
+
}
|
|
2577
|
+
if (typeof document < "u") {
|
|
2578
|
+
let e = () => {
|
|
2579
|
+
t && this.setPaused("page", document.hidden), document.hidden || this.streamManager?.wake("visible");
|
|
2580
|
+
};
|
|
2581
|
+
document.addEventListener("visibilitychange", e), n.push(() => document.removeEventListener("visibilitychange", e)), t && document.hidden && this.setPaused("page", !0);
|
|
2582
|
+
}
|
|
2583
|
+
if (typeof window < "u") {
|
|
2584
|
+
let e = () => this.streamManager?.wake("online");
|
|
2585
|
+
window.addEventListener("online", e), n.push(() => window.removeEventListener("online", e));
|
|
2586
|
+
}
|
|
2587
|
+
this.stopWatchingVisibility = () => n.forEach((e) => e());
|
|
2588
|
+
}
|
|
2589
|
+
setPageScroll(e) {
|
|
2590
|
+
this.options.pageScroll = e, this.interactionManager.setPageScroll(e);
|
|
2591
|
+
}
|
|
2592
|
+
getPageScroll() {
|
|
2593
|
+
return this.options.pageScroll ?? !1;
|
|
2594
|
+
}
|
|
2595
|
+
setMaxPixelRatio(e) {
|
|
2596
|
+
this.engine.dprManager.setMaxPixelRatio(e);
|
|
2597
|
+
}
|
|
2598
|
+
getMaxPixelRatio() {
|
|
2599
|
+
return this.engine.dprManager.getMaxPixelRatio();
|
|
2600
|
+
}
|
|
2537
2601
|
setMinBarUnit(e) {
|
|
2538
2602
|
this.viewport.setMinBarUnit(e), this.updateViewportAndRender();
|
|
2539
2603
|
}
|
|
@@ -2804,6 +2868,10 @@ var Fn = 2, In = .08, Ln = 800, Rn = 20, zn = 8, Bn = new Set(["horizontalLine",
|
|
|
2804
2868
|
} : { renderer: r });
|
|
2805
2869
|
}
|
|
2806
2870
|
freshFrame() {
|
|
2871
|
+
if (this.isSuspended()) {
|
|
2872
|
+
this.renderDeferred && (this.renderDeferred = !1, this.refitForTick()), this.engine.renderNow();
|
|
2873
|
+
return;
|
|
2874
|
+
}
|
|
2807
2875
|
this.engine.getGpu() && this.engine.renderNow();
|
|
2808
2876
|
}
|
|
2809
2877
|
screenshot(e) {
|
|
@@ -3398,7 +3466,7 @@ var Fn = 2, In = .08, Ln = 800, Rn = 20, zn = 8, Bn = new Set(["horizontalLine",
|
|
|
3398
3466
|
this.viewport.resize(e.width, e.height), this.layoutManager.resize(e.width, e.height), this.updateViewportAndRender(n), this.eventBus.emit("resize", e);
|
|
3399
3467
|
}
|
|
3400
3468
|
destroy() {
|
|
3401
|
-
this.disposed = !0, this.waitForGpu(null), this.countdownInterval && clearInterval(this.countdownInterval), this.history.setLoader(null), this.disableAutoSave(), this.disconnectStream(), this.disconnectExecution(), this.onWindowKeyDown &&= (window.removeEventListener("keydown", this.onWindowKeyDown), null), this.keyboardHandler = null, this.a11y?.destroy(), this.a11y = null, this.interactionManager.detach(), this.tradingManager.destroy(), this.animator.dispose(), this.crosshairTooltip.destroy(), this.pinnedTooltip.destroy(), this.replayRestarting = !0, this.replayManager.dispose(), this.alertManager.dispose(), this.undoRedoManager.clear(), this.engine.destroy(), this.eventBus.destroy(), this.container.innerHTML = "";
|
|
3469
|
+
this.disposed = !0, this.stopWatchingVisibility?.(), this.stopWatchingVisibility = null, this.waitForGpu(null), this.countdownInterval && clearInterval(this.countdownInterval), this.history.setLoader(null), this.disableAutoSave(), this.disconnectStream(), this.disconnectExecution(), this.onWindowKeyDown &&= (window.removeEventListener("keydown", this.onWindowKeyDown), null), this.keyboardHandler = null, this.a11y?.destroy(), this.a11y = null, this.interactionManager.detach(), this.tradingManager.destroy(), this.animator.dispose(), this.crosshairTooltip.destroy(), this.pinnedTooltip.destroy(), this.replayRestarting = !0, this.replayManager.dispose(), this.alertManager.dispose(), this.undoRedoManager.clear(), this.engine.destroy(), this.eventBus.destroy(), this.container.innerHTML = "";
|
|
3402
3470
|
}
|
|
3403
3471
|
createChartRenderer(e) {
|
|
3404
3472
|
let t = en(e, (e) => this.pluginManager.getChartType(e));
|
|
@@ -3434,9 +3502,24 @@ var Fn = 2, In = .08, Ln = 800, Rn = 20, zn = 8, Bn = new Set(["horizontalLine",
|
|
|
3434
3502
|
this.scheduleRender();
|
|
3435
3503
|
}
|
|
3436
3504
|
scheduleRender() {
|
|
3437
|
-
this.renderScheduled || this.disposed
|
|
3438
|
-
|
|
3439
|
-
|
|
3505
|
+
if (!(this.renderScheduled || this.disposed)) {
|
|
3506
|
+
if (this.isSuspended()) {
|
|
3507
|
+
this.renderDeferred = !0;
|
|
3508
|
+
return;
|
|
3509
|
+
}
|
|
3510
|
+
this.renderScheduled = !0, requestAnimationFrame(() => {
|
|
3511
|
+
if (this.renderScheduled = !1, !this.disposed) {
|
|
3512
|
+
if (this.isSuspended()) {
|
|
3513
|
+
this.renderDeferred = !0;
|
|
3514
|
+
return;
|
|
3515
|
+
}
|
|
3516
|
+
this.refitForTick();
|
|
3517
|
+
}
|
|
3518
|
+
});
|
|
3519
|
+
}
|
|
3520
|
+
}
|
|
3521
|
+
refitForTick() {
|
|
3522
|
+
this.panelInfoCache = null, this.fitDataAndAxes(), this.syncRenderContext(), this.engine.requestRender(), this.emitViewportEvents();
|
|
3440
3523
|
}
|
|
3441
3524
|
applyDataToViewport(e = !1) {
|
|
3442
3525
|
let t = this.getDisplayData(), n = this.options.autoScale !== !1;
|
|
@@ -4268,4 +4351,4 @@ var Er = class {
|
|
|
4268
4351
|
//#endregion
|
|
4269
4352
|
export { Jt as C, B as S, H as _, xr as a, sn as b, Hn as c, Dn as d, En as f, Cn as g, Sn as h, Sr as i, Nn as l, Tn as m, Cr as n, vr as o, wn as p, $ as r, ur as s, Er as t, On as u, mn as v, an as x, ln as y };
|
|
4270
4353
|
|
|
4271
|
-
//# sourceMappingURL=LayoutSession-
|
|
4354
|
+
//# sourceMappingURL=LayoutSession-goRU8aOv.js.map
|