@design.estate/dees-catalog 3.50.1 → 3.51.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_bundle/bundle.js +402 -499
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-chart/dees-chart-area/component.d.ts +26 -27
- package/dist_ts_web/elements/00group-chart/dees-chart-area/component.js +367 -441
- package/dist_ts_web/elements/00group-chart/dees-chart-area/demo.js +22 -44
- package/dist_ts_web/elements/00group-chart/dees-chart-area/styles.js +16 -22
- package/dist_ts_web/elements/00group-chart/dees-chart-log/dees-chart-log.demo.js +2 -2
- package/dist_ts_web/elements/00group-layout/dees-dashboardgrid/dees-dashboardgrid.demo.js +3 -3
- package/dist_ts_web/elements/00group-simple/dees-simple-appdash/dees-simple-appdash.js +2 -1
- package/dist_ts_web/services/DeesServiceLibLoader.d.ts +29 -7
- package/dist_ts_web/services/DeesServiceLibLoader.js +25 -18
- package/dist_ts_web/services/index.d.ts +1 -1
- package/dist_ts_web/services/versions.d.ts +1 -1
- package/dist_ts_web/services/versions.js +2 -2
- package/dist_watch/bundle.js +400 -497
- package/dist_watch/bundle.js.map +3 -3
- package/package.json +2 -2
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-chart/dees-chart-area/component.ts +402 -514
- package/ts_web/elements/00group-chart/dees-chart-area/demo.ts +22 -44
- package/ts_web/elements/00group-chart/dees-chart-area/styles.ts +15 -22
- package/ts_web/elements/00group-chart/dees-chart-log/dees-chart-log.demo.ts +1 -1
- package/ts_web/elements/00group-layout/dees-dashboardgrid/dees-dashboardgrid.demo.ts +2 -2
- package/ts_web/elements/00group-simple/dees-simple-appdash/dees-simple-appdash.ts +1 -0
- package/ts_web/services/DeesServiceLibLoader.ts +57 -19
- package/ts_web/services/index.ts +1 -1
- package/ts_web/services/versions.ts +1 -1
package/dist_bundle/bundle.js
CHANGED
|
@@ -108413,7 +108413,7 @@ var init_versions = __esm({
|
|
|
108413
108413
|
xtermAddonFit: "0.8.0",
|
|
108414
108414
|
xtermAddonSearch: "0.13.0",
|
|
108415
108415
|
highlightJs: "11.11.1",
|
|
108416
|
-
|
|
108416
|
+
lightweightCharts: "5.1.0",
|
|
108417
108417
|
tiptap: "2.27.2",
|
|
108418
108418
|
fontawesome: "7.2.0"
|
|
108419
108419
|
};
|
|
@@ -108436,14 +108436,14 @@ var init_DeesServiceLibLoader = __esm({
|
|
|
108436
108436
|
xtermFitAddonLib = null;
|
|
108437
108437
|
xtermSearchAddonLib = null;
|
|
108438
108438
|
highlightJsLib = null;
|
|
108439
|
-
|
|
108439
|
+
lightweightChartsLib = null;
|
|
108440
108440
|
tiptapLib = null;
|
|
108441
108441
|
// Loading promises to prevent duplicate concurrent loads
|
|
108442
108442
|
xtermLoadingPromise = null;
|
|
108443
108443
|
xtermFitAddonLoadingPromise = null;
|
|
108444
108444
|
xtermSearchAddonLoadingPromise = null;
|
|
108445
108445
|
highlightJsLoadingPromise = null;
|
|
108446
|
-
|
|
108446
|
+
lightweightChartsLoadingPromise = null;
|
|
108447
108447
|
tiptapLoadingPromise = null;
|
|
108448
108448
|
constructor() {
|
|
108449
108449
|
}
|
|
@@ -108575,26 +108575,33 @@ body > div[style*="top: -50000px"][style*="width: 50000px"] {
|
|
|
108575
108575
|
return this.highlightJsLoadingPromise;
|
|
108576
108576
|
}
|
|
108577
108577
|
/**
|
|
108578
|
-
* Load
|
|
108579
|
-
* @returns Promise resolving to
|
|
108578
|
+
* Load TradingView Lightweight Charts from CDN
|
|
108579
|
+
* @returns Promise resolving to Lightweight Charts bundle
|
|
108580
108580
|
*/
|
|
108581
|
-
async
|
|
108582
|
-
if (this.
|
|
108583
|
-
return this.
|
|
108581
|
+
async loadLightweightCharts() {
|
|
108582
|
+
if (this.lightweightChartsLib) {
|
|
108583
|
+
return this.lightweightChartsLib;
|
|
108584
108584
|
}
|
|
108585
|
-
if (this.
|
|
108586
|
-
return this.
|
|
108585
|
+
if (this.lightweightChartsLoadingPromise) {
|
|
108586
|
+
return this.lightweightChartsLoadingPromise;
|
|
108587
108587
|
}
|
|
108588
|
-
this.
|
|
108589
|
-
const url = `${CDN_BASE}/
|
|
108588
|
+
this.lightweightChartsLoadingPromise = (async () => {
|
|
108589
|
+
const url = `${CDN_BASE}/lightweight-charts@${CDN_VERSIONS.lightweightCharts}/+esm`;
|
|
108590
108590
|
const module = await import(
|
|
108591
108591
|
/* @vite-ignore */
|
|
108592
108592
|
url
|
|
108593
108593
|
);
|
|
108594
|
-
this.
|
|
108595
|
-
|
|
108594
|
+
this.lightweightChartsLib = {
|
|
108595
|
+
createChart: module.createChart,
|
|
108596
|
+
AreaSeries: module.AreaSeries,
|
|
108597
|
+
LineSeries: module.LineSeries,
|
|
108598
|
+
ColorType: module.ColorType,
|
|
108599
|
+
LineType: module.LineType,
|
|
108600
|
+
CrosshairMode: module.CrosshairMode
|
|
108601
|
+
};
|
|
108602
|
+
return this.lightweightChartsLib;
|
|
108596
108603
|
})();
|
|
108597
|
-
return this.
|
|
108604
|
+
return this.lightweightChartsLoadingPromise;
|
|
108598
108605
|
}
|
|
108599
108606
|
/**
|
|
108600
108607
|
* Load Tiptap rich text editor and extensions from CDN
|
|
@@ -108664,7 +108671,7 @@ body > div[style*="top: -50000px"][style*="width: 50000px"] {
|
|
|
108664
108671
|
this.loadXtermFitAddon(),
|
|
108665
108672
|
this.loadXtermSearchAddon(),
|
|
108666
108673
|
this.loadHighlightJs(),
|
|
108667
|
-
this.
|
|
108674
|
+
this.loadLightweightCharts(),
|
|
108668
108675
|
this.loadTiptap()
|
|
108669
108676
|
]);
|
|
108670
108677
|
}
|
|
@@ -108681,8 +108688,8 @@ body > div[style*="top: -50000px"][style*="width: 50000px"] {
|
|
|
108681
108688
|
return this.xtermSearchAddonLib !== null;
|
|
108682
108689
|
case "highlightJs":
|
|
108683
108690
|
return this.highlightJsLib !== null;
|
|
108684
|
-
case "
|
|
108685
|
-
return this.
|
|
108691
|
+
case "lightweightCharts":
|
|
108692
|
+
return this.lightweightChartsLib !== null;
|
|
108686
108693
|
case "tiptap":
|
|
108687
108694
|
return this.tiptapLib !== null;
|
|
108688
108695
|
default:
|
|
@@ -150486,15 +150493,37 @@ var demoFunc36 = /* @__PURE__ */ __name(() => {
|
|
|
150486
150493
|
lastDataPointTime = 0;
|
|
150487
150494
|
connectionsLastUpdate = 0;
|
|
150488
150495
|
}, "randomizeData");
|
|
150496
|
+
const updateButtonStates = /* @__PURE__ */ __name(() => {
|
|
150497
|
+
const allButtons = elementArg.querySelectorAll("dees-button");
|
|
150498
|
+
allButtons.forEach((button) => {
|
|
150499
|
+
const text9 = button.text?.trim();
|
|
150500
|
+
if (text9 === "System Usage") {
|
|
150501
|
+
button.type = currentDataset === "system" ? "highlighted" : "normal";
|
|
150502
|
+
} else if (text9 === "Network Traffic") {
|
|
150503
|
+
button.type = currentDataset === "network" ? "highlighted" : "normal";
|
|
150504
|
+
} else if (text9 === "Sales Data") {
|
|
150505
|
+
button.type = currentDataset === "sales" ? "highlighted" : "normal";
|
|
150506
|
+
}
|
|
150507
|
+
});
|
|
150508
|
+
}, "updateButtonStates");
|
|
150489
150509
|
const buttons = elementArg.querySelectorAll("dees-button");
|
|
150490
150510
|
buttons.forEach((button) => {
|
|
150491
|
-
const text9 = button.
|
|
150511
|
+
const text9 = button.text?.trim();
|
|
150492
150512
|
if (text9 === "System Usage") {
|
|
150493
|
-
button.addEventListener("click", () =>
|
|
150513
|
+
button.addEventListener("click", () => {
|
|
150514
|
+
switchDataset("system");
|
|
150515
|
+
updateButtonStates();
|
|
150516
|
+
});
|
|
150494
150517
|
} else if (text9 === "Network Traffic") {
|
|
150495
|
-
button.addEventListener("click", () =>
|
|
150518
|
+
button.addEventListener("click", () => {
|
|
150519
|
+
switchDataset("network");
|
|
150520
|
+
updateButtonStates();
|
|
150521
|
+
});
|
|
150496
150522
|
} else if (text9 === "Sales Data") {
|
|
150497
|
-
button.addEventListener("click", () =>
|
|
150523
|
+
button.addEventListener("click", () => {
|
|
150524
|
+
switchDataset("sales");
|
|
150525
|
+
updateButtonStates();
|
|
150526
|
+
});
|
|
150498
150527
|
} else if (text9 === "Start Live") {
|
|
150499
150528
|
button.addEventListener("click", () => startRealtime());
|
|
150500
150529
|
} else if (text9 === "Stop Live") {
|
|
@@ -150503,19 +150532,6 @@ var demoFunc36 = /* @__PURE__ */ __name(() => {
|
|
|
150503
150532
|
button.addEventListener("click", () => randomizeData());
|
|
150504
150533
|
}
|
|
150505
150534
|
});
|
|
150506
|
-
const updateButtonStates = /* @__PURE__ */ __name(() => {
|
|
150507
|
-
const buttons2 = elementArg.querySelectorAll("dees-button");
|
|
150508
|
-
buttons2.forEach((button) => {
|
|
150509
|
-
const text9 = button.textContent?.trim();
|
|
150510
|
-
if (text9 === "System Usage") {
|
|
150511
|
-
button.type = currentDataset === "system" ? "highlighted" : "normal";
|
|
150512
|
-
} else if (text9 === "Network Traffic") {
|
|
150513
|
-
button.type = currentDataset === "network" ? "highlighted" : "normal";
|
|
150514
|
-
} else if (text9 === "Sales Data") {
|
|
150515
|
-
button.type = currentDataset === "sales" ? "highlighted" : "normal";
|
|
150516
|
-
}
|
|
150517
|
-
});
|
|
150518
|
-
}, "updateButtonStates");
|
|
150519
150535
|
chartElement.rollingWindow = TIME_WINDOW;
|
|
150520
150536
|
chartElement.realtimeMode = false;
|
|
150521
150537
|
chartElement.yAxisScaling = "percentage";
|
|
@@ -150524,24 +150540,6 @@ var demoFunc36 = /* @__PURE__ */ __name(() => {
|
|
|
150524
150540
|
setTimeout(() => {
|
|
150525
150541
|
chartElement.updateTimeWindow();
|
|
150526
150542
|
}, 100);
|
|
150527
|
-
const originalSwitchDataset = switchDataset;
|
|
150528
|
-
const switchDatasetWithButtonUpdate = /* @__PURE__ */ __name((name) => {
|
|
150529
|
-
originalSwitchDataset(name);
|
|
150530
|
-
updateButtonStates();
|
|
150531
|
-
}, "switchDatasetWithButtonUpdate");
|
|
150532
|
-
buttons.forEach((button) => {
|
|
150533
|
-
const text9 = button.textContent?.trim();
|
|
150534
|
-
if (text9 === "System Usage") {
|
|
150535
|
-
button.removeEventListener("click", () => switchDataset("system"));
|
|
150536
|
-
button.addEventListener("click", () => switchDatasetWithButtonUpdate("system"));
|
|
150537
|
-
} else if (text9 === "Network Traffic") {
|
|
150538
|
-
button.removeEventListener("click", () => switchDataset("network"));
|
|
150539
|
-
button.addEventListener("click", () => switchDatasetWithButtonUpdate("network"));
|
|
150540
|
-
} else if (text9 === "Sales Data") {
|
|
150541
|
-
button.removeEventListener("click", () => switchDataset("sales"));
|
|
150542
|
-
button.addEventListener("click", () => switchDatasetWithButtonUpdate("sales"));
|
|
150543
|
-
}
|
|
150544
|
-
});
|
|
150545
150543
|
if (connectionsChartElement) {
|
|
150546
150544
|
const initialConnectionsData = generateInitialData(previousValues.connections, 30, UPDATE_INTERVAL);
|
|
150547
150545
|
connectionsChartElement.series = [{
|
|
@@ -150650,7 +150648,6 @@ var chartAreaStyles = [
|
|
|
150650
150648
|
:host {
|
|
150651
150649
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
|
150652
150650
|
color: ${cssManager.bdTheme("hsl(0 0% 3.9%)", "hsl(0 0% 98%)")};
|
|
150653
|
-
font-weight: 400;
|
|
150654
150651
|
font-size: 14px;
|
|
150655
150652
|
}
|
|
150656
150653
|
.mainbox {
|
|
@@ -150662,7 +150659,6 @@ var chartAreaStyles = [
|
|
|
150662
150659
|
border-radius: 8px;
|
|
150663
150660
|
overflow: hidden;
|
|
150664
150661
|
}
|
|
150665
|
-
|
|
150666
150662
|
.chartTitle {
|
|
150667
150663
|
position: absolute;
|
|
150668
150664
|
top: 0;
|
|
@@ -150678,26 +150674,22 @@ var chartAreaStyles = [
|
|
|
150678
150674
|
}
|
|
150679
150675
|
.chartContainer {
|
|
150680
150676
|
position: absolute;
|
|
150681
|
-
top:
|
|
150682
|
-
left:
|
|
150683
|
-
bottom:
|
|
150684
|
-
right:
|
|
150685
|
-
padding: 44px 16px 16px 0px;
|
|
150686
|
-
overflow: hidden;
|
|
150687
|
-
background: transparent; /* Ensure container doesn't override chart background */
|
|
150688
|
-
}
|
|
150689
|
-
|
|
150690
|
-
/* ApexCharts theme overrides */
|
|
150691
|
-
.apexcharts-canvas {
|
|
150692
|
-
background: transparent !important;
|
|
150693
|
-
}
|
|
150694
|
-
|
|
150695
|
-
.apexcharts-inner {
|
|
150696
|
-
background: transparent !important;
|
|
150677
|
+
top: 44px;
|
|
150678
|
+
left: 0;
|
|
150679
|
+
bottom: 0;
|
|
150680
|
+
right: 0;
|
|
150697
150681
|
}
|
|
150698
|
-
|
|
150699
|
-
|
|
150700
|
-
|
|
150682
|
+
.lw-tooltip {
|
|
150683
|
+
position: absolute;
|
|
150684
|
+
z-index: 100;
|
|
150685
|
+
pointer-events: none;
|
|
150686
|
+
padding: 12px;
|
|
150687
|
+
border-radius: 6px;
|
|
150688
|
+
border: 1px solid;
|
|
150689
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
150690
|
+
font-size: 12px;
|
|
150691
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15);
|
|
150692
|
+
min-width: 140px;
|
|
150701
150693
|
}
|
|
150702
150694
|
`
|
|
150703
150695
|
];
|
|
@@ -150722,7 +150714,7 @@ _DeesChartArea_decorators = [customElement("dees-chart-area")];
|
|
|
150722
150714
|
var _DeesChartArea = class _DeesChartArea extends (_a53 = DeesElement, _chart_dec = [r5()], _label_dec5 = [n5()], _series_dec = [n5({ type: Array })], _yAxisFormatter_dec = [n5({ attribute: false })], _rollingWindow_dec = [n5({ type: Number })], _realtimeMode_dec = [n5({ type: Boolean })], _yAxisScaling_dec = [n5({ type: String })], _yAxisMax_dec = [n5({ type: Number })], _autoScrollInterval_dec = [n5({ type: Number })], _a53) {
|
|
150723
150715
|
constructor() {
|
|
150724
150716
|
super();
|
|
150725
|
-
__privateAdd(this, _chart, __runInitializers(_init54, 8, this)), __runInitializers(_init54, 11, this);
|
|
150717
|
+
__privateAdd(this, _chart, __runInitializers(_init54, 8, this, null)), __runInitializers(_init54, 11, this);
|
|
150726
150718
|
__privateAdd(this, _label5, __runInitializers(_init54, 12, this, "Untitled Chart")), __runInitializers(_init54, 15, this);
|
|
150727
150719
|
__privateAdd(this, _series, __runInitializers(_init54, 16, this, [])), __runInitializers(_init54, 19, this);
|
|
150728
150720
|
__privateAdd(this, _yAxisFormatter, __runInitializers(_init54, 20, this, /* @__PURE__ */ __name((val) => `${val} Mbps`, "yAxisFormatter"))), __runInitializers(_init54, 23, this);
|
|
@@ -150731,304 +150723,296 @@ var _DeesChartArea = class _DeesChartArea extends (_a53 = DeesElement, _chart_de
|
|
|
150731
150723
|
__privateAdd(this, _yAxisScaling, __runInitializers(_init54, 32, this, "dynamic")), __runInitializers(_init54, 35, this);
|
|
150732
150724
|
__privateAdd(this, _yAxisMax, __runInitializers(_init54, 36, this, 100)), __runInitializers(_init54, 39, this);
|
|
150733
150725
|
__privateAdd(this, _autoScrollInterval, __runInitializers(_init54, 40, this, 1e3)), __runInitializers(_init54, 43, this);
|
|
150734
|
-
// Auto-scroll interval in milliseconds (0 to disable)
|
|
150735
|
-
__publicField(this, "resizeObserver");
|
|
150736
|
-
__publicField(this, "resizeTimeout");
|
|
150737
150726
|
__publicField(this, "internalChartData", []);
|
|
150738
150727
|
__publicField(this, "autoScrollTimer", null);
|
|
150739
|
-
__publicField(this, "
|
|
150740
|
-
|
|
150741
|
-
|
|
150728
|
+
__publicField(this, "lcBundle", null);
|
|
150729
|
+
__publicField(this, "seriesApis", /* @__PURE__ */ new Map());
|
|
150730
|
+
__publicField(this, "priceLines", /* @__PURE__ */ new Map());
|
|
150731
|
+
__publicField(this, "tooltipEl", null);
|
|
150742
150732
|
__publicField(this, "CHART_COLORS", {
|
|
150743
150733
|
dark: [
|
|
150744
150734
|
"hsl(217.2 91.2% 59.8%)",
|
|
150745
|
-
// Blue
|
|
150746
150735
|
"hsl(173.4 80.4% 40%)",
|
|
150747
|
-
// Teal
|
|
150748
150736
|
"hsl(280.3 87.4% 66.7%)",
|
|
150749
|
-
// Purple
|
|
150750
150737
|
"hsl(24.6 95% 53.1%)"
|
|
150751
|
-
// Orange
|
|
150752
150738
|
],
|
|
150753
150739
|
light: [
|
|
150754
150740
|
"hsl(222.2 47.4% 51.2%)",
|
|
150755
|
-
// Blue (shadcn primary)
|
|
150756
150741
|
"hsl(142.1 76.2% 36.3%)",
|
|
150757
|
-
// Green (shadcn success)
|
|
150758
150742
|
"hsl(280.3 47.7% 50.2%)",
|
|
150759
|
-
// Purple (muted)
|
|
150760
150743
|
"hsl(20.5 90.2% 48.2%)"
|
|
150761
|
-
// Orange (shadcn destructive variant)
|
|
150762
150744
|
]
|
|
150763
150745
|
});
|
|
150764
150746
|
domtools_elementbasic_exports.setup();
|
|
150765
|
-
this.resizeObserver = new ResizeObserver((entries) => {
|
|
150766
|
-
if (this.resizeTimeout) {
|
|
150767
|
-
clearTimeout(this.resizeTimeout);
|
|
150768
|
-
}
|
|
150769
|
-
this.resizeTimeout = window.setTimeout(() => {
|
|
150770
|
-
if (this.chart) {
|
|
150771
|
-
if (this.DEBUG_RESIZE && entries.length > 0) {
|
|
150772
|
-
const entry = entries[0];
|
|
150773
|
-
console.log("DeesChartArea - Resize detected:", {
|
|
150774
|
-
width: entry.contentRect.width,
|
|
150775
|
-
height: entry.contentRect.height
|
|
150776
|
-
});
|
|
150777
|
-
}
|
|
150778
|
-
this.resizeChart();
|
|
150779
|
-
}
|
|
150780
|
-
}, 100);
|
|
150781
|
-
});
|
|
150782
150747
|
this.registerGarbageFunction(async () => {
|
|
150783
|
-
if (this.resizeTimeout) {
|
|
150784
|
-
clearTimeout(this.resizeTimeout);
|
|
150785
|
-
}
|
|
150786
|
-
if (this.resizeObserver) {
|
|
150787
|
-
this.resizeObserver.disconnect();
|
|
150788
|
-
}
|
|
150789
150748
|
this.stopAutoScroll();
|
|
150790
150749
|
if (this.chart) {
|
|
150791
150750
|
try {
|
|
150792
|
-
this.chart.
|
|
150751
|
+
this.chart.remove();
|
|
150793
150752
|
this.chart = null;
|
|
150794
|
-
|
|
150795
|
-
|
|
150753
|
+
this.seriesApis.clear();
|
|
150754
|
+
this.priceLines.clear();
|
|
150755
|
+
} catch (e11) {
|
|
150756
|
+
console.error("Error destroying chart:", e11);
|
|
150796
150757
|
}
|
|
150797
150758
|
}
|
|
150798
150759
|
});
|
|
150799
150760
|
}
|
|
150800
|
-
// Override getter to return internal chart data
|
|
150801
150761
|
get chartSeries() {
|
|
150802
150762
|
return this.internalChartData.length > 0 ? this.internalChartData : this.series;
|
|
150803
150763
|
}
|
|
150804
|
-
async connectedCallback() {
|
|
150805
|
-
super.connectedCallback();
|
|
150806
|
-
if (this.chart) {
|
|
150807
|
-
await new Promise((resolve2) => requestAnimationFrame(resolve2));
|
|
150808
|
-
await this.resizeChart();
|
|
150809
|
-
}
|
|
150810
|
-
}
|
|
150811
150764
|
render() {
|
|
150812
150765
|
return renderChartArea(this);
|
|
150813
150766
|
}
|
|
150767
|
+
// --- Helpers ---
|
|
150768
|
+
convertDataToLC(data) {
|
|
150769
|
+
return data.map((point4) => {
|
|
150770
|
+
const ms = typeof point4.x === "number" ? point4.x : new Date(point4.x).getTime();
|
|
150771
|
+
return { time: Math.floor(ms / 1e3), value: point4.y };
|
|
150772
|
+
}).sort((a5, b5) => a5.time - b5.time);
|
|
150773
|
+
}
|
|
150774
|
+
hslToRgba(hslColor, alpha) {
|
|
150775
|
+
const match2 = hslColor.match(/hsl\(([^)]+)\)/);
|
|
150776
|
+
if (!match2) return hslColor;
|
|
150777
|
+
const parts = match2[1].trim().split(/\s+/);
|
|
150778
|
+
if (parts.length < 3) return hslColor;
|
|
150779
|
+
const h8 = parseFloat(parts[0]) / 360;
|
|
150780
|
+
const s10 = parseFloat(parts[1]) / 100;
|
|
150781
|
+
const l6 = parseFloat(parts[2]) / 100;
|
|
150782
|
+
let r11, g4, b5;
|
|
150783
|
+
if (s10 === 0) {
|
|
150784
|
+
r11 = g4 = b5 = l6;
|
|
150785
|
+
} else {
|
|
150786
|
+
const hue2rgb = /* @__PURE__ */ __name((p7, q, t9) => {
|
|
150787
|
+
if (t9 < 0) t9 += 1;
|
|
150788
|
+
if (t9 > 1) t9 -= 1;
|
|
150789
|
+
if (t9 < 1 / 6) return p7 + (q - p7) * 6 * t9;
|
|
150790
|
+
if (t9 < 1 / 2) return q;
|
|
150791
|
+
if (t9 < 2 / 3) return p7 + (q - p7) * (2 / 3 - t9) * 6;
|
|
150792
|
+
return p7;
|
|
150793
|
+
}, "hue2rgb");
|
|
150794
|
+
const q2 = l6 < 0.5 ? l6 * (1 + s10) : l6 + s10 - l6 * s10;
|
|
150795
|
+
const p22 = 2 * l6 - q2;
|
|
150796
|
+
r11 = hue2rgb(p22, q2, h8 + 1 / 3);
|
|
150797
|
+
g4 = hue2rgb(p22, q2, h8);
|
|
150798
|
+
b5 = hue2rgb(p22, q2, h8 - 1 / 3);
|
|
150799
|
+
}
|
|
150800
|
+
return `rgba(${Math.round(r11 * 255)}, ${Math.round(g4 * 255)}, ${Math.round(b5 * 255)}, ${alpha})`;
|
|
150801
|
+
}
|
|
150802
|
+
getSeriesColors(isDark) {
|
|
150803
|
+
return isDark ? this.CHART_COLORS.dark : this.CHART_COLORS.light;
|
|
150804
|
+
}
|
|
150805
|
+
applyTheme() {
|
|
150806
|
+
if (!this.chart || !this.lcBundle) return;
|
|
150807
|
+
const isDark = !this.goBright;
|
|
150808
|
+
const colors8 = this.getSeriesColors(isDark);
|
|
150809
|
+
this.chart.applyOptions({
|
|
150810
|
+
layout: {
|
|
150811
|
+
background: { type: this.lcBundle.ColorType.Solid, color: "transparent" },
|
|
150812
|
+
textColor: isDark ? "hsl(0 0% 63.9%)" : "hsl(0 0% 20%)",
|
|
150813
|
+
attributionLogo: false
|
|
150814
|
+
},
|
|
150815
|
+
grid: {
|
|
150816
|
+
vertLines: { visible: false },
|
|
150817
|
+
horzLines: { color: isDark ? "hsl(0 0% 14.9%)" : "hsl(0 0% 94%)" }
|
|
150818
|
+
}
|
|
150819
|
+
});
|
|
150820
|
+
let idx = 0;
|
|
150821
|
+
for (const [, api2] of this.seriesApis) {
|
|
150822
|
+
const color2 = colors8[idx % colors8.length];
|
|
150823
|
+
api2.applyOptions({
|
|
150824
|
+
topColor: this.hslToRgba(color2, isDark ? 0.2 : 0.3),
|
|
150825
|
+
bottomColor: this.hslToRgba(color2, 0),
|
|
150826
|
+
lineColor: color2
|
|
150827
|
+
});
|
|
150828
|
+
idx++;
|
|
150829
|
+
}
|
|
150830
|
+
}
|
|
150831
|
+
recreateSeries(chartSeries) {
|
|
150832
|
+
if (!this.chart || !this.lcBundle) return;
|
|
150833
|
+
const isDark = !this.goBright;
|
|
150834
|
+
const colors8 = this.getSeriesColors(isDark);
|
|
150835
|
+
for (const [, api2] of this.seriesApis) {
|
|
150836
|
+
this.chart.removeSeries(api2);
|
|
150837
|
+
}
|
|
150838
|
+
this.seriesApis.clear();
|
|
150839
|
+
this.priceLines.clear();
|
|
150840
|
+
chartSeries.forEach((s10, index2) => {
|
|
150841
|
+
const color2 = colors8[index2 % colors8.length];
|
|
150842
|
+
const api2 = this.chart.addSeries(this.lcBundle.AreaSeries, {
|
|
150843
|
+
topColor: this.hslToRgba(color2, isDark ? 0.2 : 0.3),
|
|
150844
|
+
bottomColor: this.hslToRgba(color2, 0),
|
|
150845
|
+
lineColor: color2,
|
|
150846
|
+
lineWidth: 2,
|
|
150847
|
+
lineType: this.lcBundle.LineType.Curved,
|
|
150848
|
+
lastValueVisible: false,
|
|
150849
|
+
priceLineVisible: false,
|
|
150850
|
+
crosshairMarkerVisible: true,
|
|
150851
|
+
crosshairMarkerRadius: 4
|
|
150852
|
+
});
|
|
150853
|
+
api2.setData(this.convertDataToLC(s10.data));
|
|
150854
|
+
this.updatePriceLines(s10.name || `series-${index2}`, api2, s10.data, color2);
|
|
150855
|
+
if (this.yAxisScaling !== "dynamic") {
|
|
150856
|
+
api2.applyOptions({
|
|
150857
|
+
autoscaleInfoProvider: /* @__PURE__ */ __name(() => ({
|
|
150858
|
+
priceRange: { minValue: 0, maxValue: this.yAxisMax }
|
|
150859
|
+
}), "autoscaleInfoProvider")
|
|
150860
|
+
});
|
|
150861
|
+
}
|
|
150862
|
+
this.seriesApis.set(s10.name || `series-${index2}`, api2);
|
|
150863
|
+
});
|
|
150864
|
+
}
|
|
150865
|
+
updatePriceLines(name, api2, data, color2) {
|
|
150866
|
+
const existing = this.priceLines.get(name);
|
|
150867
|
+
if (existing) {
|
|
150868
|
+
for (const line of existing) {
|
|
150869
|
+
api2.removePriceLine(line);
|
|
150870
|
+
}
|
|
150871
|
+
}
|
|
150872
|
+
if (data.length === 0) {
|
|
150873
|
+
this.priceLines.set(name, []);
|
|
150874
|
+
return;
|
|
150875
|
+
}
|
|
150876
|
+
const values = data.map((d5) => d5.y);
|
|
150877
|
+
const avg = values.reduce((sum, v5) => sum + v5, 0) / values.length;
|
|
150878
|
+
const max3 = Math.max(...values);
|
|
150879
|
+
const lines = [];
|
|
150880
|
+
lines.push(api2.createPriceLine({
|
|
150881
|
+
price: Math.round(avg * 100) / 100,
|
|
150882
|
+
color: this.hslToRgba(color2, 0.5),
|
|
150883
|
+
lineWidth: 1,
|
|
150884
|
+
lineStyle: 2,
|
|
150885
|
+
// Dashed
|
|
150886
|
+
axisLabelVisible: true,
|
|
150887
|
+
title: "avg"
|
|
150888
|
+
}));
|
|
150889
|
+
if (avg > 0 && (max3 - avg) / avg > 0.1) {
|
|
150890
|
+
lines.push(api2.createPriceLine({
|
|
150891
|
+
price: max3,
|
|
150892
|
+
color: this.hslToRgba(color2, 0.8),
|
|
150893
|
+
lineWidth: 1,
|
|
150894
|
+
lineStyle: 1,
|
|
150895
|
+
// Dotted
|
|
150896
|
+
axisLabelVisible: true,
|
|
150897
|
+
title: "max"
|
|
150898
|
+
}));
|
|
150899
|
+
}
|
|
150900
|
+
this.priceLines.set(name, lines);
|
|
150901
|
+
}
|
|
150902
|
+
setupTooltip() {
|
|
150903
|
+
if (!this.chart) return;
|
|
150904
|
+
this.tooltipEl = document.createElement("div");
|
|
150905
|
+
this.tooltipEl.className = "lw-tooltip";
|
|
150906
|
+
this.tooltipEl.style.display = "none";
|
|
150907
|
+
this.shadowRoot.querySelector(".chartContainer")?.appendChild(this.tooltipEl);
|
|
150908
|
+
this.chart.subscribeCrosshairMove((param) => {
|
|
150909
|
+
if (!this.tooltipEl) return;
|
|
150910
|
+
if (!param.point || !param.time || param.point.x < 0 || param.point.y < 0) {
|
|
150911
|
+
this.tooltipEl.style.display = "none";
|
|
150912
|
+
return;
|
|
150913
|
+
}
|
|
150914
|
+
const isDark = !this.goBright;
|
|
150915
|
+
const bgColor = isDark ? "hsl(0 0% 9%)" : "hsl(0 0% 100%)";
|
|
150916
|
+
const textColor = isDark ? "hsl(0 0% 95%)" : "hsl(0 0% 9%)";
|
|
150917
|
+
const borderColor = isDark ? "hsl(0 0% 14.9%)" : "hsl(0 0% 89.8%)";
|
|
150918
|
+
const colors8 = this.getSeriesColors(isDark);
|
|
150919
|
+
let html9 = "";
|
|
150920
|
+
let idx = 0;
|
|
150921
|
+
let hasData = false;
|
|
150922
|
+
for (const [name, api2] of this.seriesApis) {
|
|
150923
|
+
const data = param.seriesData.get(api2);
|
|
150924
|
+
if (data && "value" in data && data.value !== void 0) {
|
|
150925
|
+
hasData = true;
|
|
150926
|
+
const color2 = colors8[idx % colors8.length];
|
|
150927
|
+
const formatted = this.yAxisFormatter(data.value);
|
|
150928
|
+
html9 += `<div style="display:flex;align-items:center;gap:8px;margin:${idx > 0 ? "6px" : "0"} 0;">
|
|
150929
|
+
<span style="display:inline-block;width:10px;height:10px;background:${color2};border-radius:2px;"></span>
|
|
150930
|
+
<span style="font-weight:500;">${name}:</span>
|
|
150931
|
+
<span style="margin-left:auto;font-weight:600;">${formatted}</span>
|
|
150932
|
+
</div>`;
|
|
150933
|
+
}
|
|
150934
|
+
idx++;
|
|
150935
|
+
}
|
|
150936
|
+
if (!hasData) {
|
|
150937
|
+
this.tooltipEl.style.display = "none";
|
|
150938
|
+
return;
|
|
150939
|
+
}
|
|
150940
|
+
this.tooltipEl.innerHTML = html9;
|
|
150941
|
+
Object.assign(this.tooltipEl.style, {
|
|
150942
|
+
display: "block",
|
|
150943
|
+
background: bgColor,
|
|
150944
|
+
color: textColor,
|
|
150945
|
+
borderColor
|
|
150946
|
+
});
|
|
150947
|
+
const containerWidth = this.shadowRoot.querySelector(".chartContainer").clientWidth;
|
|
150948
|
+
let left = param.point.x + 16;
|
|
150949
|
+
if (left + 200 > containerWidth) left = param.point.x - 216;
|
|
150950
|
+
this.tooltipEl.style.left = `${left}px`;
|
|
150951
|
+
this.tooltipEl.style.top = `${param.point.y - 16}px`;
|
|
150952
|
+
});
|
|
150953
|
+
}
|
|
150954
|
+
// --- Lifecycle ---
|
|
150814
150955
|
async firstUpdated() {
|
|
150815
150956
|
await this.domtoolsPromise;
|
|
150816
|
-
|
|
150957
|
+
this.lcBundle = await DeesServiceLibLoader.getInstance().loadLightweightCharts();
|
|
150817
150958
|
await new Promise((resolve2) => requestAnimationFrame(resolve2));
|
|
150818
|
-
const mainbox = this.shadowRoot.querySelector(".mainbox");
|
|
150819
150959
|
const chartContainer = this.shadowRoot.querySelector(".chartContainer");
|
|
150820
|
-
if (!
|
|
150821
|
-
console.error("Chart containers not found");
|
|
150822
|
-
return;
|
|
150823
|
-
}
|
|
150824
|
-
const styleChartContainer = window.getComputedStyle(chartContainer);
|
|
150825
|
-
const paddingTop = parseInt(styleChartContainer.paddingTop, 10);
|
|
150826
|
-
const paddingBottom = parseInt(styleChartContainer.paddingBottom, 10);
|
|
150827
|
-
const paddingLeft = parseInt(styleChartContainer.paddingLeft, 10);
|
|
150828
|
-
const paddingRight = parseInt(styleChartContainer.paddingRight, 10);
|
|
150829
|
-
const initialWidth = mainbox.clientWidth - paddingLeft - paddingRight;
|
|
150830
|
-
const initialHeight = mainbox.offsetHeight - paddingTop - paddingBottom;
|
|
150831
|
-
const chartSeries = this.series.length > 0 ? this.series : [
|
|
150832
|
-
{
|
|
150833
|
-
name: "cpu",
|
|
150834
|
-
data: [
|
|
150835
|
-
{ x: "2025-01-15T03:00:00", y: 25 },
|
|
150836
|
-
{ x: "2025-01-15T07:00:00", y: 30 },
|
|
150837
|
-
{ x: "2025-01-15T11:00:00", y: 20 },
|
|
150838
|
-
{ x: "2025-01-15T15:00:00", y: 35 },
|
|
150839
|
-
{ x: "2025-01-15T19:00:00", y: 25 }
|
|
150840
|
-
]
|
|
150841
|
-
},
|
|
150842
|
-
{
|
|
150843
|
-
name: "memory",
|
|
150844
|
-
data: [
|
|
150845
|
-
{ x: "2025-01-15T03:00:00", y: 10 },
|
|
150846
|
-
{ x: "2025-01-15T07:00:00", y: 12 },
|
|
150847
|
-
{ x: "2025-01-15T11:00:00", y: 10 },
|
|
150848
|
-
{ x: "2025-01-15T15:00:00", y: 30 },
|
|
150849
|
-
{ x: "2025-01-15T19:00:00", y: 40 }
|
|
150850
|
-
]
|
|
150851
|
-
}
|
|
150852
|
-
];
|
|
150853
|
-
this.internalChartData = chartSeries;
|
|
150960
|
+
if (!chartContainer) return;
|
|
150854
150961
|
const isDark = !this.goBright;
|
|
150855
|
-
|
|
150856
|
-
|
|
150857
|
-
|
|
150858
|
-
|
|
150859
|
-
|
|
150860
|
-
|
|
150861
|
-
|
|
150862
|
-
|
|
150863
|
-
|
|
150864
|
-
background: "transparent",
|
|
150865
|
-
// Transparent background to inherit from container
|
|
150866
|
-
toolbar: {
|
|
150867
|
-
show: false
|
|
150868
|
-
// This line disables the toolbar
|
|
150869
|
-
},
|
|
150870
|
-
animations: {
|
|
150871
|
-
enabled: !this.realtimeMode,
|
|
150872
|
-
// Disable animations in realtime mode
|
|
150873
|
-
speed: 400,
|
|
150874
|
-
animateGradually: {
|
|
150875
|
-
enabled: false,
|
|
150876
|
-
// Disable gradual animation for cleaner updates
|
|
150877
|
-
delay: 0
|
|
150878
|
-
},
|
|
150879
|
-
dynamicAnimation: {
|
|
150880
|
-
enabled: !this.realtimeMode,
|
|
150881
|
-
speed: 350
|
|
150882
|
-
}
|
|
150883
|
-
},
|
|
150884
|
-
zoom: {
|
|
150885
|
-
enabled: false
|
|
150886
|
-
// Disable zoom for cleaner interaction
|
|
150887
|
-
},
|
|
150888
|
-
selection: {
|
|
150889
|
-
enabled: false
|
|
150890
|
-
// Disable selection
|
|
150891
|
-
}
|
|
150892
|
-
},
|
|
150893
|
-
dataLabels: {
|
|
150894
|
-
enabled: false
|
|
150895
|
-
},
|
|
150896
|
-
stroke: {
|
|
150897
|
-
width: 2,
|
|
150898
|
-
curve: "smooth"
|
|
150899
|
-
},
|
|
150900
|
-
xaxis: {
|
|
150901
|
-
type: "datetime",
|
|
150902
|
-
// Time-series data
|
|
150903
|
-
labels: {
|
|
150904
|
-
format: "HH:mm:ss",
|
|
150905
|
-
// Time formatting with seconds
|
|
150906
|
-
datetimeUTC: false,
|
|
150907
|
-
style: {
|
|
150908
|
-
colors: [isDark ? "hsl(0 0% 63.9%)" : "hsl(0 0% 20%)"],
|
|
150909
|
-
// Label color
|
|
150910
|
-
fontSize: "12px",
|
|
150911
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
150912
|
-
fontWeight: "400"
|
|
150913
|
-
}
|
|
150962
|
+
try {
|
|
150963
|
+
this.chart = this.lcBundle.createChart(chartContainer, {
|
|
150964
|
+
autoSize: true,
|
|
150965
|
+
layout: {
|
|
150966
|
+
background: { type: this.lcBundle.ColorType.Solid, color: "transparent" },
|
|
150967
|
+
textColor: isDark ? "hsl(0 0% 63.9%)" : "hsl(0 0% 20%)",
|
|
150968
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
150969
|
+
fontSize: 12,
|
|
150970
|
+
attributionLogo: false
|
|
150914
150971
|
},
|
|
150915
|
-
|
|
150916
|
-
|
|
150917
|
-
|
|
150972
|
+
grid: {
|
|
150973
|
+
vertLines: { visible: false },
|
|
150974
|
+
horzLines: { color: isDark ? "hsl(0 0% 14.9%)" : "hsl(0 0% 94%)" }
|
|
150918
150975
|
},
|
|
150919
|
-
|
|
150920
|
-
|
|
150921
|
-
|
|
150922
|
-
}
|
|
150923
|
-
},
|
|
150924
|
-
yaxis: {
|
|
150925
|
-
min: 0,
|
|
150926
|
-
max: this.yAxisScaling === "dynamic" ? void 0 : this.yAxisMax,
|
|
150927
|
-
labels: {
|
|
150928
|
-
formatter: this.yAxisFormatter,
|
|
150929
|
-
style: {
|
|
150930
|
-
colors: [isDark ? "hsl(0 0% 63.9%)" : "hsl(0 0% 20%)"],
|
|
150931
|
-
// Label color
|
|
150932
|
-
fontSize: "12px",
|
|
150933
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
150934
|
-
fontWeight: "400"
|
|
150935
|
-
}
|
|
150976
|
+
rightPriceScale: {
|
|
150977
|
+
borderVisible: false,
|
|
150978
|
+
scaleMargins: { top: 0.1, bottom: 0.1 }
|
|
150936
150979
|
},
|
|
150937
|
-
|
|
150938
|
-
|
|
150939
|
-
|
|
150980
|
+
timeScale: {
|
|
150981
|
+
borderVisible: false,
|
|
150982
|
+
timeVisible: true,
|
|
150983
|
+
secondsVisible: true
|
|
150940
150984
|
},
|
|
150941
|
-
|
|
150942
|
-
|
|
150943
|
-
// Hide y-axis ticks
|
|
150944
|
-
}
|
|
150945
|
-
},
|
|
150946
|
-
tooltip: {
|
|
150947
|
-
shared: true,
|
|
150948
|
-
// Enables the tooltip to display across series
|
|
150949
|
-
intersect: false,
|
|
150950
|
-
// Allows hovering anywhere on the chart
|
|
150951
|
-
followCursor: true,
|
|
150952
|
-
// Makes tooltip follow mouse even between points
|
|
150953
|
-
x: {
|
|
150954
|
-
format: "dd/MM/yy HH:mm"
|
|
150985
|
+
crosshair: {
|
|
150986
|
+
mode: this.lcBundle.CrosshairMode.Magnet
|
|
150955
150987
|
},
|
|
150956
|
-
|
|
150957
|
-
|
|
150958
|
-
|
|
150959
|
-
|
|
150960
|
-
|
|
150961
|
-
|
|
150962
|
-
|
|
150963
|
-
|
|
150964
|
-
|
|
150965
|
-
|
|
150966
|
-
|
|
150967
|
-
|
|
150968
|
-
|
|
150969
|
-
tooltipContent += `<div style="display: flex; align-items: center; gap: 8px; margin: ${index2 > 0 ? "6px" : "0"} 0;">
|
|
150970
|
-
<span style="display: inline-block; width: 10px; height: 10px; background: ${color2}; border-radius: 2px;"></span>
|
|
150971
|
-
<span style="font-weight: 500;">${label}:</span>
|
|
150972
|
-
<span style="margin-left: auto; font-weight: 600;">${formattedValue}</span>
|
|
150973
|
-
</div>`;
|
|
150974
|
-
});
|
|
150975
|
-
tooltipContent += `</div>`;
|
|
150976
|
-
return tooltipContent;
|
|
150977
|
-
}, "custom")
|
|
150978
|
-
},
|
|
150979
|
-
grid: {
|
|
150980
|
-
xaxis: {
|
|
150981
|
-
lines: {
|
|
150982
|
-
show: false
|
|
150983
|
-
// Hide vertical grid lines for cleaner look
|
|
150984
|
-
}
|
|
150985
|
-
},
|
|
150986
|
-
yaxis: {
|
|
150987
|
-
lines: {
|
|
150988
|
-
show: true
|
|
150989
|
-
}
|
|
150988
|
+
handleScroll: false,
|
|
150989
|
+
handleScale: false
|
|
150990
|
+
});
|
|
150991
|
+
const chartSeries = this.series.length > 0 ? this.series : [
|
|
150992
|
+
{
|
|
150993
|
+
name: "cpu",
|
|
150994
|
+
data: [
|
|
150995
|
+
{ x: "2025-01-15T03:00:00", y: 25 },
|
|
150996
|
+
{ x: "2025-01-15T07:00:00", y: 30 },
|
|
150997
|
+
{ x: "2025-01-15T11:00:00", y: 20 },
|
|
150998
|
+
{ x: "2025-01-15T15:00:00", y: 35 },
|
|
150999
|
+
{ x: "2025-01-15T19:00:00", y: 25 }
|
|
151000
|
+
]
|
|
150990
151001
|
},
|
|
150991
|
-
|
|
150992
|
-
|
|
150993
|
-
|
|
150994
|
-
|
|
150995
|
-
|
|
150996
|
-
|
|
150997
|
-
|
|
150998
|
-
|
|
150999
|
-
|
|
151000
|
-
}
|
|
151001
|
-
},
|
|
151002
|
-
fill: {
|
|
151003
|
-
type: "gradient",
|
|
151004
|
-
// Gradient fill for the area
|
|
151005
|
-
gradient: {
|
|
151006
|
-
shade: isDark ? "dark" : "light",
|
|
151007
|
-
type: "vertical",
|
|
151008
|
-
shadeIntensity: 0.1,
|
|
151009
|
-
opacityFrom: isDark ? 0.2 : 0.3,
|
|
151010
|
-
opacityTo: 0,
|
|
151011
|
-
stops: [0, 100]
|
|
151012
|
-
}
|
|
151013
|
-
},
|
|
151014
|
-
colors: isDark ? this.CHART_COLORS.dark : this.CHART_COLORS.light,
|
|
151015
|
-
theme: {
|
|
151016
|
-
mode: theme
|
|
151017
|
-
}
|
|
151018
|
-
};
|
|
151019
|
-
try {
|
|
151020
|
-
this.chart = new ApexChartsLib(this.shadowRoot.querySelector(".chartContainer"), options);
|
|
151021
|
-
await this.chart.render();
|
|
151022
|
-
await new Promise((resolve2) => setTimeout(resolve2, 100));
|
|
151023
|
-
await this.resizeChart();
|
|
151024
|
-
const mainbox2 = this.shadowRoot.querySelector(".mainbox");
|
|
151025
|
-
if (mainbox2 && this.resizeObserver) {
|
|
151026
|
-
this.resizeObserver.disconnect();
|
|
151027
|
-
this.resizeObserver.observe(mainbox2);
|
|
151028
|
-
if (this.DEBUG_RESIZE) {
|
|
151029
|
-
console.log("DeesChartArea - ResizeObserver attached to mainbox");
|
|
151002
|
+
{
|
|
151003
|
+
name: "memory",
|
|
151004
|
+
data: [
|
|
151005
|
+
{ x: "2025-01-15T03:00:00", y: 10 },
|
|
151006
|
+
{ x: "2025-01-15T07:00:00", y: 12 },
|
|
151007
|
+
{ x: "2025-01-15T11:00:00", y: 10 },
|
|
151008
|
+
{ x: "2025-01-15T15:00:00", y: 30 },
|
|
151009
|
+
{ x: "2025-01-15T19:00:00", y: 40 }
|
|
151010
|
+
]
|
|
151030
151011
|
}
|
|
151031
|
-
|
|
151012
|
+
];
|
|
151013
|
+
this.internalChartData = chartSeries;
|
|
151014
|
+
this.recreateSeries(chartSeries);
|
|
151015
|
+
this.setupTooltip();
|
|
151032
151016
|
} catch (error) {
|
|
151033
151017
|
console.error("Failed to initialize chart:", error);
|
|
151034
151018
|
}
|
|
@@ -151036,37 +151020,14 @@ var _DeesChartArea = class _DeesChartArea extends (_a53 = DeesElement, _chart_de
|
|
|
151036
151020
|
async updated(changedProperties) {
|
|
151037
151021
|
super.updated(changedProperties);
|
|
151038
151022
|
if (changedProperties.has("goBright") && this.chart) {
|
|
151039
|
-
|
|
151023
|
+
this.applyTheme();
|
|
151040
151024
|
}
|
|
151041
151025
|
if (changedProperties.has("series") && this.chart && this.series.length > 0) {
|
|
151042
151026
|
await this.updateSeries(this.series);
|
|
151043
151027
|
}
|
|
151044
151028
|
if (changedProperties.has("yAxisFormatter") && this.chart) {
|
|
151045
|
-
await this.chart.updateOptions({
|
|
151046
|
-
yaxis: {
|
|
151047
|
-
labels: {
|
|
151048
|
-
formatter: this.yAxisFormatter
|
|
151049
|
-
}
|
|
151050
|
-
}
|
|
151051
|
-
});
|
|
151052
151029
|
}
|
|
151053
151030
|
if (changedProperties.has("realtimeMode") && this.chart) {
|
|
151054
|
-
await this.chart.updateOptions({
|
|
151055
|
-
chart: {
|
|
151056
|
-
animations: {
|
|
151057
|
-
enabled: !this.realtimeMode,
|
|
151058
|
-
speed: 400,
|
|
151059
|
-
animateGradually: {
|
|
151060
|
-
enabled: false,
|
|
151061
|
-
delay: 0
|
|
151062
|
-
},
|
|
151063
|
-
dynamicAnimation: {
|
|
151064
|
-
enabled: !this.realtimeMode,
|
|
151065
|
-
speed: 350
|
|
151066
|
-
}
|
|
151067
|
-
}
|
|
151068
|
-
}
|
|
151069
|
-
});
|
|
151070
151031
|
if (this.realtimeMode && this.rollingWindow > 0 && this.autoScrollInterval > 0) {
|
|
151071
151032
|
this.startAutoScroll();
|
|
151072
151033
|
} else {
|
|
@@ -151080,143 +151041,120 @@ var _DeesChartArea = class _DeesChartArea extends (_a53 = DeesElement, _chart_de
|
|
|
151080
151041
|
}
|
|
151081
151042
|
}
|
|
151082
151043
|
if ((changedProperties.has("yAxisScaling") || changedProperties.has("yAxisMax")) && this.chart) {
|
|
151083
|
-
|
|
151084
|
-
|
|
151085
|
-
|
|
151086
|
-
|
|
151044
|
+
for (const [, api2] of this.seriesApis) {
|
|
151045
|
+
if (this.yAxisScaling === "dynamic") {
|
|
151046
|
+
api2.applyOptions({ autoscaleInfoProvider: void 0 });
|
|
151047
|
+
} else {
|
|
151048
|
+
api2.applyOptions({
|
|
151049
|
+
autoscaleInfoProvider: /* @__PURE__ */ __name(() => ({ priceRange: { minValue: 0, maxValue: this.yAxisMax } }), "autoscaleInfoProvider")
|
|
151050
|
+
});
|
|
151087
151051
|
}
|
|
151088
|
-
}
|
|
151052
|
+
}
|
|
151089
151053
|
}
|
|
151090
151054
|
}
|
|
151055
|
+
// --- Public API ---
|
|
151091
151056
|
async updateSeries(newSeries, animate = true) {
|
|
151092
|
-
if (!this.chart)
|
|
151093
|
-
return;
|
|
151094
|
-
}
|
|
151057
|
+
if (!this.chart) return;
|
|
151095
151058
|
try {
|
|
151096
151059
|
this.internalChartData = newSeries;
|
|
151097
151060
|
if (this.rollingWindow > 0 && this.realtimeMode) {
|
|
151098
151061
|
const now2 = Date.now();
|
|
151099
151062
|
const cutoffTime = now2 - this.rollingWindow;
|
|
151100
|
-
|
|
151101
|
-
|
|
151102
|
-
|
|
151103
|
-
|
|
151104
|
-
|
|
151105
|
-
}
|
|
151106
|
-
|
|
151107
|
-
|
|
151108
|
-
|
|
151109
|
-
|
|
151110
|
-
|
|
151111
|
-
|
|
151112
|
-
|
|
151113
|
-
|
|
151114
|
-
|
|
151115
|
-
|
|
151116
|
-
|
|
151117
|
-
|
|
151118
|
-
|
|
151119
|
-
|
|
151120
|
-
|
|
151063
|
+
if (newSeries.length !== this.seriesApis.size) {
|
|
151064
|
+
this.recreateSeries(newSeries);
|
|
151065
|
+
} else {
|
|
151066
|
+
const colors8 = this.getSeriesColors(!this.goBright);
|
|
151067
|
+
newSeries.forEach((s10, index2) => {
|
|
151068
|
+
const name = s10.name || `series-${index2}`;
|
|
151069
|
+
const api2 = this.seriesApis.get(name);
|
|
151070
|
+
if (!api2) return;
|
|
151071
|
+
const filtered = s10.data.filter((point4) => {
|
|
151072
|
+
const ms = typeof point4.x === "number" ? point4.x : new Date(point4.x).getTime();
|
|
151073
|
+
return ms > cutoffTime;
|
|
151074
|
+
});
|
|
151075
|
+
api2.setData(this.convertDataToLC(filtered));
|
|
151076
|
+
this.updatePriceLines(name, api2, filtered, colors8[index2 % colors8.length]);
|
|
151077
|
+
});
|
|
151078
|
+
}
|
|
151079
|
+
try {
|
|
151080
|
+
this.chart.timeScale().setVisibleRange({
|
|
151081
|
+
from: Math.floor(cutoffTime / 1e3),
|
|
151082
|
+
to: Math.floor(now2 / 1e3)
|
|
151083
|
+
});
|
|
151084
|
+
} catch (e11) {
|
|
151085
|
+
}
|
|
151086
|
+
if (this.yAxisScaling === "dynamic") {
|
|
151087
|
+
const allValues = newSeries.flatMap(
|
|
151088
|
+
(s10) => s10.data.filter((p7) => {
|
|
151089
|
+
const ms = typeof p7.x === "number" ? p7.x : new Date(p7.x).getTime();
|
|
151090
|
+
return ms > cutoffTime;
|
|
151091
|
+
}).map((d5) => d5.y)
|
|
151092
|
+
);
|
|
151093
|
+
if (allValues.length > 0) {
|
|
151094
|
+
const dynamicMax = Math.ceil(Math.max(...allValues) * 1.1);
|
|
151095
|
+
for (const [, api2] of this.seriesApis) {
|
|
151096
|
+
api2.applyOptions({
|
|
151097
|
+
autoscaleInfoProvider: /* @__PURE__ */ __name(() => ({ priceRange: { minValue: 0, maxValue: dynamicMax } }), "autoscaleInfoProvider")
|
|
151098
|
+
});
|
|
151121
151099
|
}
|
|
151122
151100
|
}
|
|
151123
|
-
await this.chart.updateSeries(filteredSeries, false);
|
|
151124
151101
|
}
|
|
151125
151102
|
} else {
|
|
151126
|
-
|
|
151103
|
+
if (newSeries.length !== this.seriesApis.size) {
|
|
151104
|
+
this.recreateSeries(newSeries);
|
|
151105
|
+
} else {
|
|
151106
|
+
const colors8 = this.getSeriesColors(!this.goBright);
|
|
151107
|
+
newSeries.forEach((s10, index2) => {
|
|
151108
|
+
const name = s10.name || `series-${index2}`;
|
|
151109
|
+
const api2 = this.seriesApis.get(name);
|
|
151110
|
+
if (!api2) return;
|
|
151111
|
+
api2.setData(this.convertDataToLC(s10.data));
|
|
151112
|
+
this.updatePriceLines(name, api2, s10.data, colors8[index2 % colors8.length]);
|
|
151113
|
+
});
|
|
151114
|
+
}
|
|
151127
151115
|
}
|
|
151128
151116
|
} catch (error) {
|
|
151129
151117
|
console.error("Failed to update chart series:", error);
|
|
151130
151118
|
}
|
|
151131
151119
|
}
|
|
151132
|
-
// Update just the x-axis for smooth scrolling in realtime mode
|
|
151133
|
-
// Public for advanced usage in demos, but typically handled automatically
|
|
151134
151120
|
async updateTimeWindow() {
|
|
151135
|
-
if (!this.chart || this.rollingWindow <= 0)
|
|
151136
|
-
return;
|
|
151137
|
-
}
|
|
151121
|
+
if (!this.chart || this.rollingWindow <= 0) return;
|
|
151138
151122
|
const now2 = Date.now();
|
|
151139
151123
|
const cutoffTime = now2 - this.rollingWindow;
|
|
151140
|
-
|
|
151141
|
-
|
|
151142
|
-
|
|
151143
|
-
|
|
151144
|
-
|
|
151145
|
-
|
|
151146
|
-
|
|
151147
|
-
style: {
|
|
151148
|
-
colors: [!this.goBright ? "hsl(0 0% 63.9%)" : "hsl(0 0% 20%)"],
|
|
151149
|
-
fontSize: "12px",
|
|
151150
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
151151
|
-
fontWeight: "400"
|
|
151152
|
-
}
|
|
151153
|
-
},
|
|
151154
|
-
tickAmount: 6
|
|
151155
|
-
}
|
|
151156
|
-
}, false, false);
|
|
151124
|
+
try {
|
|
151125
|
+
this.chart.timeScale().setVisibleRange({
|
|
151126
|
+
from: Math.floor(cutoffTime / 1e3),
|
|
151127
|
+
to: Math.floor(now2 / 1e3)
|
|
151128
|
+
});
|
|
151129
|
+
} catch (e11) {
|
|
151130
|
+
}
|
|
151157
151131
|
}
|
|
151158
151132
|
async appendData(newData) {
|
|
151159
|
-
if (!this.chart)
|
|
151160
|
-
|
|
151161
|
-
|
|
151162
|
-
|
|
151133
|
+
if (!this.chart) return;
|
|
151134
|
+
newData.forEach((s10, index2) => {
|
|
151135
|
+
const name = s10.name || `series-${index2}`;
|
|
151136
|
+
const api2 = this.seriesApis.get(name);
|
|
151137
|
+
if (!api2 || s10.data.length === 0) return;
|
|
151138
|
+
for (const point4 of s10.data) {
|
|
151139
|
+
const lcPoints = this.convertDataToLC([point4]);
|
|
151140
|
+
if (lcPoints.length > 0) api2.update(lcPoints[0]);
|
|
151141
|
+
}
|
|
151142
|
+
});
|
|
151163
151143
|
}
|
|
151164
|
-
async updateOptions(options
|
|
151165
|
-
if (!this.chart)
|
|
151166
|
-
|
|
151167
|
-
}
|
|
151168
|
-
return this.chart.updateOptions(options, redrawPaths, animate);
|
|
151144
|
+
async updateOptions(options) {
|
|
151145
|
+
if (!this.chart) return;
|
|
151146
|
+
this.chart.applyOptions(options);
|
|
151169
151147
|
}
|
|
151170
151148
|
async resizeChart() {
|
|
151171
|
-
if (
|
|
151172
|
-
|
|
151173
|
-
}
|
|
151174
|
-
if (this.DEBUG_RESIZE) {
|
|
151175
|
-
console.log("DeesChartArea - resizeChart called");
|
|
151176
|
-
}
|
|
151177
|
-
try {
|
|
151178
|
-
const mainbox = this.shadowRoot.querySelector(".mainbox");
|
|
151179
|
-
const chartContainer = this.shadowRoot.querySelector(".chartContainer");
|
|
151180
|
-
if (!mainbox || !chartContainer) {
|
|
151181
|
-
return;
|
|
151182
|
-
}
|
|
151183
|
-
void mainbox.offsetHeight;
|
|
151184
|
-
const styleChartContainer = window.getComputedStyle(chartContainer);
|
|
151185
|
-
const paddingTop = parseInt(styleChartContainer.paddingTop, 10);
|
|
151186
|
-
const paddingBottom = parseInt(styleChartContainer.paddingBottom, 10);
|
|
151187
|
-
const paddingLeft = parseInt(styleChartContainer.paddingLeft, 10);
|
|
151188
|
-
const paddingRight = parseInt(styleChartContainer.paddingRight, 10);
|
|
151189
|
-
const actualWidth = mainbox.clientWidth - paddingLeft - paddingRight;
|
|
151190
|
-
const actualHeight = mainbox.offsetHeight - paddingTop - paddingBottom;
|
|
151191
|
-
if (actualWidth > 0 && actualHeight > 0) {
|
|
151192
|
-
if (this.DEBUG_RESIZE) {
|
|
151193
|
-
console.log("DeesChartArea - Updating chart dimensions:", {
|
|
151194
|
-
width: actualWidth,
|
|
151195
|
-
height: actualHeight
|
|
151196
|
-
});
|
|
151197
|
-
}
|
|
151198
|
-
await this.chart.updateOptions({
|
|
151199
|
-
chart: {
|
|
151200
|
-
width: actualWidth,
|
|
151201
|
-
height: actualHeight
|
|
151202
|
-
}
|
|
151203
|
-
}, true, false);
|
|
151204
|
-
}
|
|
151205
|
-
} catch (error) {
|
|
151206
|
-
console.error("Failed to resize chart:", error);
|
|
151149
|
+
if (this.chart) {
|
|
151150
|
+
this.chart.timeScale().fitContent();
|
|
151207
151151
|
}
|
|
151208
151152
|
}
|
|
151209
|
-
/**
|
|
151210
|
-
* Manually trigger a chart resize. Useful when automatic detection doesn't work.
|
|
151211
|
-
* This is a convenience method that can be called from outside the component.
|
|
151212
|
-
*/
|
|
151213
151153
|
async forceResize() {
|
|
151214
151154
|
await this.resizeChart();
|
|
151215
151155
|
}
|
|
151216
151156
|
startAutoScroll() {
|
|
151217
|
-
if (this.autoScrollTimer)
|
|
151218
|
-
return;
|
|
151219
|
-
}
|
|
151157
|
+
if (this.autoScrollTimer) return;
|
|
151220
151158
|
this.autoScrollTimer = window.setInterval(() => {
|
|
151221
151159
|
this.updateTimeWindow();
|
|
151222
151160
|
}, this.autoScrollInterval);
|
|
@@ -151227,42 +151165,6 @@ var _DeesChartArea = class _DeesChartArea extends (_a53 = DeesElement, _chart_de
|
|
|
151227
151165
|
this.autoScrollTimer = null;
|
|
151228
151166
|
}
|
|
151229
151167
|
}
|
|
151230
|
-
async updateChartTheme() {
|
|
151231
|
-
if (!this.chart) {
|
|
151232
|
-
return;
|
|
151233
|
-
}
|
|
151234
|
-
const isDark = !this.goBright;
|
|
151235
|
-
const theme = isDark ? "dark" : "light";
|
|
151236
|
-
await this.chart.updateOptions({
|
|
151237
|
-
theme: {
|
|
151238
|
-
mode: theme
|
|
151239
|
-
},
|
|
151240
|
-
colors: isDark ? this.CHART_COLORS.dark : this.CHART_COLORS.light,
|
|
151241
|
-
xaxis: {
|
|
151242
|
-
labels: {
|
|
151243
|
-
style: {
|
|
151244
|
-
colors: [isDark ? "hsl(0 0% 63.9%)" : "hsl(0 0% 20%)"]
|
|
151245
|
-
}
|
|
151246
|
-
}
|
|
151247
|
-
},
|
|
151248
|
-
yaxis: {
|
|
151249
|
-
labels: {
|
|
151250
|
-
style: {
|
|
151251
|
-
colors: [isDark ? "hsl(0 0% 63.9%)" : "hsl(0 0% 20%)"]
|
|
151252
|
-
}
|
|
151253
|
-
}
|
|
151254
|
-
},
|
|
151255
|
-
grid: {
|
|
151256
|
-
borderColor: isDark ? "hsl(0 0% 14.9%)" : "hsl(0 0% 94%)"
|
|
151257
|
-
},
|
|
151258
|
-
fill: {
|
|
151259
|
-
gradient: {
|
|
151260
|
-
shade: isDark ? "dark" : "light",
|
|
151261
|
-
opacityFrom: isDark ? 0.2 : 0.3
|
|
151262
|
-
}
|
|
151263
|
-
}
|
|
151264
|
-
});
|
|
151265
|
-
}
|
|
151266
151168
|
};
|
|
151267
151169
|
_init54 = __decoratorStart(_a53);
|
|
151268
151170
|
_chart = new WeakMap();
|
|
@@ -151419,7 +151321,7 @@ var demoFunc37 = /* @__PURE__ */ __name(() => {
|
|
|
151419
151321
|
}, "stopRawSimulation");
|
|
151420
151322
|
const buttons = elementArg.querySelectorAll("dees-button");
|
|
151421
151323
|
buttons.forEach((button) => {
|
|
151422
|
-
const text9 = button.
|
|
151324
|
+
const text9 = button.text?.trim();
|
|
151423
151325
|
switch (text9) {
|
|
151424
151326
|
case "Add Structured Log":
|
|
151425
151327
|
button.addEventListener("click", () => generateRandomLog());
|
|
@@ -159521,7 +159423,7 @@ var demoFunc47 = /* @__PURE__ */ __name(() => {
|
|
|
159521
159423
|
let widgetCounter = 4;
|
|
159522
159424
|
const buttons = elementArg.querySelectorAll("dees-button");
|
|
159523
159425
|
buttons.forEach((button) => {
|
|
159524
|
-
const text9 = button.
|
|
159426
|
+
const text9 = button.text?.trim();
|
|
159525
159427
|
switch (text9) {
|
|
159526
159428
|
case "Toggle Animation":
|
|
159527
159429
|
button.addEventListener("click", () => {
|
|
@@ -159564,7 +159466,7 @@ var demoFunc47 = /* @__PURE__ */ __name(() => {
|
|
|
159564
159466
|
case "Toggle Edit Mode":
|
|
159565
159467
|
button.addEventListener("click", () => {
|
|
159566
159468
|
grid.editable = !grid.editable;
|
|
159567
|
-
button.
|
|
159469
|
+
button.text = grid.editable ? "Lock Grid" : "Unlock Grid";
|
|
159568
159470
|
});
|
|
159569
159471
|
break;
|
|
159570
159472
|
case "Reset Layout":
|
|
@@ -168590,6 +168492,7 @@ var _DeesSimpleAppDash = class _DeesSimpleAppDash extends (_a89 = DeesElement, _
|
|
|
168590
168492
|
terminal.style.top = "var(--banner-area-height, 0px)";
|
|
168591
168493
|
terminal.style.left = "240px";
|
|
168592
168494
|
terminal.style.right = "0px";
|
|
168495
|
+
terminal.style.height = "auto";
|
|
168593
168496
|
terminal.style.bottom = "24px";
|
|
168594
168497
|
terminal.style.opacity = "0";
|
|
168595
168498
|
terminal.style.transform = "translateY(8px) scale(0.99)";
|
|
@@ -174722,7 +174625,7 @@ init_group_runtime();
|
|
|
174722
174625
|
// ts_web/00_commitinfo_data.ts
|
|
174723
174626
|
var commitinfo = {
|
|
174724
174627
|
name: "@design.estate/dees-catalog",
|
|
174725
|
-
version: "3.
|
|
174628
|
+
version: "3.51.0",
|
|
174726
174629
|
description: "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript."
|
|
174727
174630
|
};
|
|
174728
174631
|
export {
|
|
@@ -176688,4 +176591,4 @@ ibantools/jsnext/ibantools.js:
|
|
|
176688
176591
|
* @preferred
|
|
176689
176592
|
*)
|
|
176690
176593
|
*/
|
|
176691
|
-
//# sourceMappingURL=bundle-
|
|
176594
|
+
//# sourceMappingURL=bundle-1775211113131.js.map
|