acttrader-charts 1.3.0-beta.11 → 1.3.0-beta.13
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/README.md +3 -3
- package/dist/index.cjs +150 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +150 -85
- package/dist/index.js.map +1 -1
- package/dist/webview/chart.html +22 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -442,7 +442,7 @@ chart.on('orderLineMoved', ({ label, fromTimestamp, toTimestamp, data }) => {
|
|
|
442
442
|
| `quantityFieldConfig` | | — | Constraints for the draft order QTY field (only relevant when `showQuantityField` is `true`). Object: `{ minLots?: number, maxLots?: number }`. `minLots` also sets the initial quantity and the step value for the flyout input (default: `1`). `maxLots` caps the input (default: `100`) |
|
|
443
443
|
| `tradesThresholdForHorizontalLine` | | `2` | Level count above which render auto-switches to `"dot"` mode |
|
|
444
444
|
| `timezone` | | `"UTC"` | IANA timezone string for time-axis and crosshair labels. `"UTC"` (default), `"local"` (browser/device timezone), or any IANA string (`"America/New_York"`, `"Europe/London"`, etc.) |
|
|
445
|
-
| `canvasColors` | | — | Per-theme
|
|
445
|
+
| `canvasColors` | | — | Per-theme colour overrides for the **canvas only** (persisted from the Settings dialog). The surface picks — `background`, `grid`, `axisText`, `axisBorder`, `crosshair` — repaint the chart canvas and leave the chart chrome (top/bottom/left bars, dialogs, popovers) on the theme from `themeOverrides`. Series picks (`candleUp`/`candleDown`/`wickUp`/`wickDown`/`borderUp`/`borderDown`/`volumeUp`/`volumeDown`) apply everywhere, so legends and indicator pills keep tracking them |
|
|
446
446
|
| `aggregateFrom` | | — | Fetch finer-grained data and aggregate client-side per timeframe |
|
|
447
447
|
| `onOrderSubmit` | | — | Called when user submits a trade via the floating button |
|
|
448
448
|
| `onLevelEdit` | | — | Called when user confirms a TFC level edit |
|
|
@@ -754,8 +754,8 @@ chart.setTheme('light');
|
|
|
754
754
|
|---|---|---|
|
|
755
755
|
| `background` | `string` | Canvas background color |
|
|
756
756
|
| `grid` | `string` | Grid line color |
|
|
757
|
-
| `axisText` | `string` | Axis tick label color |
|
|
758
|
-
| `axisBorder` | `string` | Axis border / separator color |
|
|
757
|
+
| `axisText` | `string` | Axis tick label color. Also the default label colour for the chart chrome (dialog text, toolbar labels) — set it via `themeOverrides` to restyle both, or via the Settings dialog to restyle the canvas axis alone |
|
|
758
|
+
| `axisBorder` | `string` | Axis border / separator color. Also the default border colour for the chart chrome (dialog frames, toolbar dividers) — same split as `axisText` |
|
|
759
759
|
| `crosshair` | `string` | Crosshair line color |
|
|
760
760
|
| `tooltip` | `{background, text, border}` | Floating label colors |
|
|
761
761
|
| `candle` | `{up, down, wickUp, wickDown}` | Candlestick colors |
|
package/dist/index.cjs
CHANGED
|
@@ -165,6 +165,40 @@ var EventEmitter = class {
|
|
|
165
165
|
};
|
|
166
166
|
|
|
167
167
|
// src/core/themes.ts
|
|
168
|
+
function isLightColor(color) {
|
|
169
|
+
const s = color.trim();
|
|
170
|
+
let r = -1, g = -1, b = -1;
|
|
171
|
+
if (s.startsWith("#")) {
|
|
172
|
+
const hex = s.slice(1);
|
|
173
|
+
if (hex.length === 3 || hex.length === 4) {
|
|
174
|
+
r = parseInt(hex[0] + hex[0], 16);
|
|
175
|
+
g = parseInt(hex[1] + hex[1], 16);
|
|
176
|
+
b = parseInt(hex[2] + hex[2], 16);
|
|
177
|
+
} else if (hex.length === 6 || hex.length === 8) {
|
|
178
|
+
r = parseInt(hex.slice(0, 2), 16);
|
|
179
|
+
g = parseInt(hex.slice(2, 4), 16);
|
|
180
|
+
b = parseInt(hex.slice(4, 6), 16);
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
const m = s.match(/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i);
|
|
184
|
+
if (m) {
|
|
185
|
+
r = parseFloat(m[1]);
|
|
186
|
+
g = parseFloat(m[2]);
|
|
187
|
+
b = parseFloat(m[3]);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (r < 0 || g < 0 || b < 0 || Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
const luminance = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;
|
|
194
|
+
return luminance >= 0.5;
|
|
195
|
+
}
|
|
196
|
+
function contrastOutline(surface, alpha = 0.45) {
|
|
197
|
+
return isLightColor(surface) ? `rgba(0, 0, 0, ${alpha})` : `rgba(255, 255, 255, ${alpha})`;
|
|
198
|
+
}
|
|
199
|
+
function contrastText(surface) {
|
|
200
|
+
return isLightColor(surface) ? "#000000" : "#ffffff";
|
|
201
|
+
}
|
|
168
202
|
function deepMergeTheme(base, override) {
|
|
169
203
|
if (!override) return base;
|
|
170
204
|
return {
|
|
@@ -2097,34 +2131,6 @@ function computeBracketLineX(levels, scale, priceRange, priceH, chartW, dragging
|
|
|
2097
2131
|
}
|
|
2098
2132
|
return result;
|
|
2099
2133
|
}
|
|
2100
|
-
function isLightColor(color) {
|
|
2101
|
-
const s = color.trim();
|
|
2102
|
-
let r = -1, g = -1, b = -1;
|
|
2103
|
-
if (s.startsWith("#")) {
|
|
2104
|
-
const hex = s.slice(1);
|
|
2105
|
-
if (hex.length === 3 || hex.length === 4) {
|
|
2106
|
-
r = parseInt(hex[0] + hex[0], 16);
|
|
2107
|
-
g = parseInt(hex[1] + hex[1], 16);
|
|
2108
|
-
b = parseInt(hex[2] + hex[2], 16);
|
|
2109
|
-
} else if (hex.length === 6 || hex.length === 8) {
|
|
2110
|
-
r = parseInt(hex.slice(0, 2), 16);
|
|
2111
|
-
g = parseInt(hex.slice(2, 4), 16);
|
|
2112
|
-
b = parseInt(hex.slice(4, 6), 16);
|
|
2113
|
-
}
|
|
2114
|
-
} else {
|
|
2115
|
-
const m = s.match(/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i);
|
|
2116
|
-
if (m) {
|
|
2117
|
-
r = parseFloat(m[1]);
|
|
2118
|
-
g = parseFloat(m[2]);
|
|
2119
|
-
b = parseFloat(m[3]);
|
|
2120
|
-
}
|
|
2121
|
-
}
|
|
2122
|
-
if (r < 0 || g < 0 || b < 0 || Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
|
|
2123
|
-
return true;
|
|
2124
|
-
}
|
|
2125
|
-
const luminance = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;
|
|
2126
|
-
return luminance >= 0.5;
|
|
2127
|
-
}
|
|
2128
2134
|
function monoColor(theme) {
|
|
2129
2135
|
return isLightColor(theme.background) ? "#000000" : "#ffffff";
|
|
2130
2136
|
}
|
|
@@ -16831,6 +16837,7 @@ var IndicatorSettingsDialog = class {
|
|
|
16831
16837
|
input.max = String(field.max);
|
|
16832
16838
|
input.step = String(field.step);
|
|
16833
16839
|
input.value = String(currentVal);
|
|
16840
|
+
input.enterKeyHint = "done";
|
|
16834
16841
|
Object.assign(input.style, {
|
|
16835
16842
|
width: "80px",
|
|
16836
16843
|
background: this.theme.background,
|
|
@@ -17310,7 +17317,7 @@ var ChartSettingsDialog = class {
|
|
|
17310
17317
|
flexShrink: "0",
|
|
17311
17318
|
transition: "background 0.18s",
|
|
17312
17319
|
background: this.theme.axisBorder,
|
|
17313
|
-
border: `1px solid ${this.theme.
|
|
17320
|
+
border: `1px solid ${contrastOutline(this.theme.tooltip.background, 0.3)}`,
|
|
17314
17321
|
boxSizing: "border-box"
|
|
17315
17322
|
});
|
|
17316
17323
|
const thumb = document.createElement("div");
|
|
@@ -17447,7 +17454,7 @@ var ChartSettingsDialog = class {
|
|
|
17447
17454
|
}
|
|
17448
17455
|
/** A 24×24 color swatch backed by a hidden <input type="color">. */
|
|
17449
17456
|
makeColorSwatch(initialHex, onChange) {
|
|
17450
|
-
const borderColor =
|
|
17457
|
+
const borderColor = contrastOutline(this.theme.tooltip.background);
|
|
17451
17458
|
const wrap = document.createElement("div");
|
|
17452
17459
|
Object.assign(wrap.style, {
|
|
17453
17460
|
position: "relative",
|
|
@@ -18246,7 +18253,7 @@ var DrawingStylePopover = class {
|
|
|
18246
18253
|
* share the same look.
|
|
18247
18254
|
*/
|
|
18248
18255
|
makeColorSwatch(initialHex, onChange) {
|
|
18249
|
-
const borderColor =
|
|
18256
|
+
const borderColor = contrastOutline(this.theme.tooltip.background);
|
|
18250
18257
|
const safeHex = initialHex.length === 7 && initialHex.startsWith("#") ? initialHex : "#888888";
|
|
18251
18258
|
const wrap = document.createElement("div");
|
|
18252
18259
|
Object.assign(wrap.style, {
|
|
@@ -18417,6 +18424,7 @@ var DrawingStylePopover = class {
|
|
|
18417
18424
|
input.step = "0.001";
|
|
18418
18425
|
input.value = current;
|
|
18419
18426
|
input.title = "Level ratio \u2014 press Enter to apply";
|
|
18427
|
+
input.enterKeyHint = "done";
|
|
18420
18428
|
Object.assign(input.style, {
|
|
18421
18429
|
width: "58px",
|
|
18422
18430
|
padding: "2px 4px",
|
|
@@ -18678,6 +18686,7 @@ var DraftQtyFlyout = class {
|
|
|
18678
18686
|
makeInput() {
|
|
18679
18687
|
const input = document.createElement("input");
|
|
18680
18688
|
input.type = "number";
|
|
18689
|
+
input.enterKeyHint = "done";
|
|
18681
18690
|
Object.assign(input.style, {
|
|
18682
18691
|
width: "64px",
|
|
18683
18692
|
background: "transparent",
|
|
@@ -24849,6 +24858,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
24849
24858
|
this.aggregateFrom = config.aggregateFrom;
|
|
24850
24859
|
const _baseTheme = this.themeName === "dark" ? DARK_THEME : LIGHT_THEME;
|
|
24851
24860
|
this.theme = deepMergeTheme(_baseTheme, this.themeOverrides?.[this.themeName]);
|
|
24861
|
+
this.chromeTheme = this.theme;
|
|
24852
24862
|
this.series = series;
|
|
24853
24863
|
this.showVolume = showVolume;
|
|
24854
24864
|
this.timeframe = timeframe;
|
|
@@ -25161,6 +25171,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
25161
25171
|
this.canvasWrap.appendChild(this.drawCanvas);
|
|
25162
25172
|
this.textInputEl = document.createElement("input");
|
|
25163
25173
|
this.textInputEl.type = "text";
|
|
25174
|
+
this.textInputEl.enterKeyHint = "done";
|
|
25164
25175
|
Object.assign(this.textInputEl.style, {
|
|
25165
25176
|
position: "absolute",
|
|
25166
25177
|
display: "none",
|
|
@@ -25273,7 +25284,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
25273
25284
|
});
|
|
25274
25285
|
} else if (onIsinSelect) {
|
|
25275
25286
|
if (isins) this.isins = isins;
|
|
25276
|
-
this.isinPickerModal = new IsinPickerModal(this.
|
|
25287
|
+
this.isinPickerModal = new IsinPickerModal(this.chromeTheme, onIsinSelect, () => this.emitUiState());
|
|
25277
25288
|
this.getFloatingRoot().appendChild(this.isinPickerModal.el);
|
|
25278
25289
|
Object.assign(this.siSymbolSpan.style, {
|
|
25279
25290
|
cursor: "pointer",
|
|
@@ -25333,7 +25344,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
25333
25344
|
);
|
|
25334
25345
|
this.canvasWrap.appendChild(this.indicatorOverlay.el);
|
|
25335
25346
|
this.indicatorSettingsDialog = new IndicatorSettingsDialog(
|
|
25336
|
-
this.
|
|
25347
|
+
this.chromeTheme,
|
|
25337
25348
|
this.labels.dialogs,
|
|
25338
25349
|
() => this.emitUiState()
|
|
25339
25350
|
);
|
|
@@ -25359,7 +25370,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
25359
25370
|
}
|
|
25360
25371
|
if (onOrderSubmit) {
|
|
25361
25372
|
this.tradePopover = new TradePopover(
|
|
25362
|
-
this.
|
|
25373
|
+
this.chromeTheme,
|
|
25363
25374
|
0.01,
|
|
25364
25375
|
this.symbol,
|
|
25365
25376
|
(side, price, orderType) => {
|
|
@@ -25442,10 +25453,8 @@ var _ChartEngine = class _ChartEngine {
|
|
|
25442
25453
|
container.appendChild(this.wrapper);
|
|
25443
25454
|
if (this.themeOverrides) {
|
|
25444
25455
|
this.theme = this.buildTheme(this.themeName);
|
|
25445
|
-
this.
|
|
25446
|
-
this.
|
|
25447
|
-
this.leftBar?.setTheme(this.theme);
|
|
25448
|
-
this.tradeButton?.setTheme(this.theme, this.priceAxisWidth);
|
|
25456
|
+
this.chromeTheme = this.buildChromeTheme(this.themeName);
|
|
25457
|
+
this.applyThemeToComponents();
|
|
25449
25458
|
}
|
|
25450
25459
|
const ctx = this.canvas.getContext("2d");
|
|
25451
25460
|
if (!ctx) throw new Error("Canvas 2D context unavailable");
|
|
@@ -25478,7 +25487,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
25478
25487
|
this.drawingManager.onStartTextEdit = (drawing) => this.showTextInput(drawing);
|
|
25479
25488
|
this.drawingStylePopover = new DrawingStylePopover(
|
|
25480
25489
|
this.canvasWrap,
|
|
25481
|
-
this.
|
|
25490
|
+
this.chromeTheme,
|
|
25482
25491
|
(id, patch) => this.updateDrawingStyle(id, patch)
|
|
25483
25492
|
);
|
|
25484
25493
|
this.drawingManager.onSelectionChange = (drawing) => {
|
|
@@ -26173,15 +26182,30 @@ var _ChartEngine = class _ChartEngine {
|
|
|
26173
26182
|
on(event, listener) {
|
|
26174
26183
|
return this.emitter.on(event, listener);
|
|
26175
26184
|
}
|
|
26176
|
-
|
|
26177
|
-
|
|
26185
|
+
/**
|
|
26186
|
+
* Turn the user's Chart Settings colour picks into a theme override.
|
|
26187
|
+
*
|
|
26188
|
+
* `includeSurface` decides whether the *surface* colours the settings dialog
|
|
26189
|
+
* exposes — background, grid, axis text, axis border, crosshair — are part of
|
|
26190
|
+
* the result. Those five belong to the canvas alone. The very same
|
|
26191
|
+
* `background` / `axisText` / `axisBorder` tokens also drive every panel,
|
|
26192
|
+
* dialog, toolbar and popover in the chart chrome, so merging a canvas pick
|
|
26193
|
+
* into the chrome theme repainted the top/bottom/left bars with the chart
|
|
26194
|
+
* background and put the user's "Axis Border" colour on the borders of the
|
|
26195
|
+
* settings dialog itself. Series colours (candle / volume) are included
|
|
26196
|
+
* either way — legends and indicator pills are meant to track them.
|
|
26197
|
+
*/
|
|
26198
|
+
canvasColorOverride(mode, includeSurface) {
|
|
26178
26199
|
const c = this.settingsCanvasColors[mode];
|
|
26179
|
-
|
|
26180
|
-
|
|
26181
|
-
...
|
|
26182
|
-
|
|
26183
|
-
|
|
26184
|
-
|
|
26200
|
+
if (!c) return void 0;
|
|
26201
|
+
return {
|
|
26202
|
+
...includeSurface && {
|
|
26203
|
+
...c.background !== void 0 && { background: c.background },
|
|
26204
|
+
...c.grid !== void 0 && { grid: c.grid },
|
|
26205
|
+
...c.axisText !== void 0 && { axisText: c.axisText },
|
|
26206
|
+
...c.axisBorder !== void 0 && { axisBorder: c.axisBorder },
|
|
26207
|
+
...c.crosshair !== void 0 && { crosshair: c.crosshair }
|
|
26208
|
+
},
|
|
26185
26209
|
...(c.candleUp ?? c.candleDown ?? c.wickUp ?? c.wickDown ?? c.borderUp ?? c.borderDown) !== void 0 && {
|
|
26186
26210
|
candle: {
|
|
26187
26211
|
...c.candleUp !== void 0 && { up: c.candleUp },
|
|
@@ -26198,38 +26222,87 @@ var _ChartEngine = class _ChartEngine {
|
|
|
26198
26222
|
...c.volumeDown !== void 0 && { down: c.volumeDown }
|
|
26199
26223
|
}
|
|
26200
26224
|
}
|
|
26201
|
-
}
|
|
26225
|
+
};
|
|
26226
|
+
}
|
|
26227
|
+
/**
|
|
26228
|
+
* Colour for the text laid directly over the canvas — the symbol name and
|
|
26229
|
+
* the OHLC strip.
|
|
26230
|
+
*
|
|
26231
|
+
* Those labels sit on the chart background, so once the user picks their own
|
|
26232
|
+
* background the fixed theme grey can land dark-on-dark and become
|
|
26233
|
+
* unreadable (the reported symptom). Precedence: an explicit "Axis Text"
|
|
26234
|
+
* pick wins; otherwise, if the user chose a custom background, use maximum
|
|
26235
|
+
* contrast against it; otherwise return the stock theme colour untouched, so
|
|
26236
|
+
* the default dark and light themes render exactly as before.
|
|
26237
|
+
*/
|
|
26238
|
+
overlayTextColor(fallback) {
|
|
26239
|
+
const c = this.settingsCanvasColors[this.themeName];
|
|
26240
|
+
if (c?.axisText !== void 0) return c.axisText;
|
|
26241
|
+
if (c?.background !== void 0) return contrastText(this.theme.background);
|
|
26242
|
+
return fallback;
|
|
26243
|
+
}
|
|
26244
|
+
/** Theme used to paint the canvas — includes the user's surface picks. */
|
|
26245
|
+
buildTheme(mode) {
|
|
26246
|
+
const base = mode === "dark" ? DARK_THEME : LIGHT_THEME;
|
|
26202
26247
|
const merged = deepMergeTheme(
|
|
26203
26248
|
deepMergeTheme(base, this.themeOverrides?.[mode]),
|
|
26204
|
-
|
|
26249
|
+
this.canvasColorOverride(mode, true)
|
|
26205
26250
|
);
|
|
26206
26251
|
return resolveCssVarsInTheme(merged, this.wrapper);
|
|
26207
26252
|
}
|
|
26253
|
+
/**
|
|
26254
|
+
* Theme used to paint the chart *chrome* — toolbars, dialogs, popovers.
|
|
26255
|
+
* Identical to the canvas theme except that the user's canvas surface picks
|
|
26256
|
+
* are left out, so recolouring the chart background or axis no longer
|
|
26257
|
+
* repaints the surrounding controls.
|
|
26258
|
+
*/
|
|
26259
|
+
buildChromeTheme(mode) {
|
|
26260
|
+
const base = mode === "dark" ? DARK_THEME : LIGHT_THEME;
|
|
26261
|
+
const merged = deepMergeTheme(
|
|
26262
|
+
deepMergeTheme(base, this.themeOverrides?.[mode]),
|
|
26263
|
+
this.canvasColorOverride(mode, false)
|
|
26264
|
+
);
|
|
26265
|
+
return resolveCssVarsInTheme(merged, this.wrapper);
|
|
26266
|
+
}
|
|
26267
|
+
/**
|
|
26268
|
+
* Push the freshly built themes into every sub-component.
|
|
26269
|
+
*
|
|
26270
|
+
* Chrome components (bars, dialogs, popovers) get `chromeTheme`; components
|
|
26271
|
+
* that are drawn over the canvas and must relate to it — the trade button,
|
|
26272
|
+
* indicator pills, compare legend, sub-pane overlays — get the canvas
|
|
26273
|
+
* `theme`. Called from every place that rebuilds the theme so the routing
|
|
26274
|
+
* lives in exactly one spot.
|
|
26275
|
+
*/
|
|
26276
|
+
applyThemeToComponents() {
|
|
26277
|
+
this._tb?.setTheme(this.chromeTheme);
|
|
26278
|
+
this.bottomBar?.setTheme(this.chromeTheme);
|
|
26279
|
+
this.leftBar?.setTheme(this.chromeTheme);
|
|
26280
|
+
this.tradePopover?.setTheme(this.chromeTheme);
|
|
26281
|
+
this.drawingStylePopover?.setTheme(this.chromeTheme);
|
|
26282
|
+
this._draftQtyFlyout?.setTheme(this.chromeTheme);
|
|
26283
|
+
this.indicatorSettingsDialog?.setTheme(this.chromeTheme);
|
|
26284
|
+
this.chartSettingsDialog?.setTheme(this.chromeTheme);
|
|
26285
|
+
this.layoutPopover?.setTheme(this.chromeTheme);
|
|
26286
|
+
this.snapshotPopover?.setTheme(this.chromeTheme);
|
|
26287
|
+
this.comparePickerModal?.setTheme(this.chromeTheme);
|
|
26288
|
+
this.isinPickerModal?.setTheme(this.chromeTheme);
|
|
26289
|
+
this.tradeButton?.setTheme(this.theme, this.priceAxisWidth);
|
|
26290
|
+
this.compareLegend?.setTheme(this.theme);
|
|
26291
|
+
this.indicatorOverlay?.setTheme(this.theme);
|
|
26292
|
+
for (const overlay of this.subPaneOverlays.values()) overlay.setTheme(this.theme);
|
|
26293
|
+
}
|
|
26208
26294
|
setTheme(theme) {
|
|
26209
26295
|
this.themeName = theme;
|
|
26210
26296
|
this.theme = this.buildTheme(theme);
|
|
26211
|
-
this.
|
|
26212
|
-
this.
|
|
26213
|
-
this.leftBar?.setTheme(this.theme);
|
|
26214
|
-
this.tradeButton?.setTheme(this.theme, this.priceAxisWidth);
|
|
26215
|
-
this.tradePopover?.setTheme(this.theme);
|
|
26216
|
-
this.drawingStylePopover?.setTheme(this.theme);
|
|
26217
|
-
this._draftQtyFlyout?.setTheme(this.theme);
|
|
26218
|
-
this.indicatorSettingsDialog?.setTheme(this.theme);
|
|
26219
|
-
this.chartSettingsDialog?.setTheme(this.theme);
|
|
26220
|
-
this.layoutPopover?.setTheme(this.theme);
|
|
26221
|
-
this.snapshotPopover?.setTheme(this.theme);
|
|
26297
|
+
this.chromeTheme = this.buildChromeTheme(theme);
|
|
26298
|
+
this.applyThemeToComponents();
|
|
26222
26299
|
this.applyScrollToEndBtnStyles();
|
|
26223
26300
|
this.applyResetViewBtnStyles();
|
|
26224
26301
|
this.applyMobileDrawingFlyoutTheme();
|
|
26225
|
-
if (this.siSymbolSpan)
|
|
26302
|
+
if (this.siSymbolSpan)
|
|
26303
|
+
this.siSymbolSpan.style.color = this.overlayTextColor(this.theme.tooltip.text);
|
|
26226
26304
|
if (this.siStreamDot) this.siStreamDot.style.background = this.theme.ui.stream[this.streamStatus];
|
|
26227
26305
|
this.applyOverlayLabelStyles();
|
|
26228
|
-
this.compareLegend?.setTheme(this.theme);
|
|
26229
|
-
this.comparePickerModal?.setTheme(this.theme);
|
|
26230
|
-
this.indicatorOverlay?.setTheme(this.theme);
|
|
26231
|
-
for (const overlay of this.subPaneOverlays.values()) overlay.setTheme(this.theme);
|
|
26232
|
-
this.isinPickerModal?.setTheme(this.theme);
|
|
26233
26306
|
this.scheduleRender();
|
|
26234
26307
|
this.emitStateChange();
|
|
26235
26308
|
return this;
|
|
@@ -26344,17 +26417,8 @@ var _ChartEngine = class _ChartEngine {
|
|
|
26344
26417
|
setThemeOverrides(overrides) {
|
|
26345
26418
|
this.themeOverrides = overrides;
|
|
26346
26419
|
this.theme = this.buildTheme(this.themeName);
|
|
26347
|
-
this.
|
|
26348
|
-
this.
|
|
26349
|
-
this.leftBar?.setTheme(this.theme);
|
|
26350
|
-
this.tradeButton?.setTheme(this.theme, this.priceAxisWidth);
|
|
26351
|
-
this.tradePopover?.setTheme(this.theme);
|
|
26352
|
-
this.drawingStylePopover?.setTheme(this.theme);
|
|
26353
|
-
this._draftQtyFlyout?.setTheme(this.theme);
|
|
26354
|
-
this.indicatorSettingsDialog?.setTheme(this.theme);
|
|
26355
|
-
this.chartSettingsDialog?.setTheme(this.theme);
|
|
26356
|
-
this.layoutPopover?.setTheme(this.theme);
|
|
26357
|
-
this.snapshotPopover?.setTheme(this.theme);
|
|
26420
|
+
this.chromeTheme = this.buildChromeTheme(this.themeName);
|
|
26421
|
+
this.applyThemeToComponents();
|
|
26358
26422
|
this.scheduleRender();
|
|
26359
26423
|
return this;
|
|
26360
26424
|
}
|
|
@@ -26815,6 +26879,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
26815
26879
|
}
|
|
26816
26880
|
const up = bar.close >= bar.open;
|
|
26817
26881
|
const color = up ? this.theme.candle.up : this.theme.candle.down;
|
|
26882
|
+
const labelColor = this.overlayTextColor(this.theme.axisText);
|
|
26818
26883
|
const fmt = (n) => n.toFixed(this.dataStore.getPricePrecision());
|
|
26819
26884
|
const fmtVol = (v) => v >= 1e6 ? (v / 1e6).toFixed(2) + "M" : v >= 1e3 ? (v / 1e3).toFixed(1) + "K" : v.toFixed(0);
|
|
26820
26885
|
const ol = this.labels.ohlc;
|
|
@@ -26825,7 +26890,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
26825
26890
|
span.style.marginRight = "8px";
|
|
26826
26891
|
const key = document.createElement("span");
|
|
26827
26892
|
key.textContent = lbl + "\xA0";
|
|
26828
|
-
key.style.color =
|
|
26893
|
+
key.style.color = labelColor;
|
|
26829
26894
|
key.style.opacity = "0.6";
|
|
26830
26895
|
const num = document.createElement("span");
|
|
26831
26896
|
num.textContent = val;
|
|
@@ -26835,15 +26900,15 @@ var _ChartEngine = class _ChartEngine {
|
|
|
26835
26900
|
}
|
|
26836
26901
|
};
|
|
26837
26902
|
renderFields(this.siOHLCSpan, [
|
|
26838
|
-
[ol.open, fmt(bar.open),
|
|
26839
|
-
[ol.high, fmt(bar.high),
|
|
26903
|
+
[ol.open, fmt(bar.open), labelColor],
|
|
26904
|
+
[ol.high, fmt(bar.high), labelColor]
|
|
26840
26905
|
]);
|
|
26841
26906
|
if (this.siOHLC2Span) {
|
|
26842
26907
|
renderFields(this.siOHLC2Span, [
|
|
26843
|
-
[ol.low, fmt(bar.low),
|
|
26908
|
+
[ol.low, fmt(bar.low), labelColor],
|
|
26844
26909
|
[ol.close, fmt(bar.close), color],
|
|
26845
26910
|
...bar.volume != null && bar.volume !== 0 ? [
|
|
26846
|
-
[ol.volume, fmtVol(bar.volume),
|
|
26911
|
+
[ol.volume, fmtVol(bar.volume), labelColor]
|
|
26847
26912
|
] : []
|
|
26848
26913
|
]);
|
|
26849
26914
|
}
|
|
@@ -26915,7 +26980,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
26915
26980
|
openDraftQtyFlyout(pill) {
|
|
26916
26981
|
if (!this._draftQtyFlyout) {
|
|
26917
26982
|
this._draftQtyFlyout = new DraftQtyFlyout(
|
|
26918
|
-
this.
|
|
26983
|
+
this.chromeTheme,
|
|
26919
26984
|
(qty) => {
|
|
26920
26985
|
if (this._activeQtyPillLabel) this.setLevelQty(this._activeQtyPillLabel, qty);
|
|
26921
26986
|
},
|
|
@@ -27932,7 +27997,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
27932
27997
|
openChartSettings() {
|
|
27933
27998
|
if (!this.chartSettingsDialog) {
|
|
27934
27999
|
this.chartSettingsDialog = new ChartSettingsDialog(
|
|
27935
|
-
this.
|
|
28000
|
+
this.chromeTheme,
|
|
27936
28001
|
{
|
|
27937
28002
|
tradeDisplayFilter: this.tradeDisplayFilter,
|
|
27938
28003
|
positionRenderStyle: this.positionRenderStyle,
|
|
@@ -28694,7 +28759,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
28694
28759
|
if (!this.compareDataLoader) return;
|
|
28695
28760
|
if (!this.comparePickerModal) {
|
|
28696
28761
|
this.comparePickerModal = new IsinPickerModal(
|
|
28697
|
-
this.
|
|
28762
|
+
this.chromeTheme,
|
|
28698
28763
|
(sym) => this.toggleCompare(sym),
|
|
28699
28764
|
() => this.emitUiState()
|
|
28700
28765
|
);
|