@tradecanvas/chart 1.72.0 → 1.72.1
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/{LayoutSession-r7Rgc5Sw.cjs → LayoutSession-DO4bYkUi.cjs} +2 -2
- package/dist/{LayoutSession-r7Rgc5Sw.cjs.map → LayoutSession-DO4bYkUi.cjs.map} +1 -1
- package/dist/{LayoutSession-DjHF7tmL.js → LayoutSession-qRYG8GTD.js} +2 -2
- package/dist/{LayoutSession-DjHF7tmL.js.map → LayoutSession-qRYG8GTD.js.map} +1 -1
- package/dist/WidgetCommandPalette-CeCLHPy1.js +177 -0
- package/dist/WidgetCommandPalette-CeCLHPy1.js.map +1 -0
- package/dist/WidgetCommandPalette-ZZNbWwCZ.cjs +2 -0
- package/dist/WidgetCommandPalette-ZZNbWwCZ.cjs.map +1 -0
- package/dist/{WidgetDrawingSettings-MSpeHFhV.js → WidgetDrawingSettings-BeW8fX7r.js} +5 -5
- package/dist/{WidgetDrawingSettings-MSpeHFhV.js.map → WidgetDrawingSettings-BeW8fX7r.js.map} +1 -1
- package/dist/{WidgetDrawingSettings-B3KAH9Ag.cjs → WidgetDrawingSettings-Cyl2u_u8.cjs} +2 -2
- package/dist/{WidgetDrawingSettings-B3KAH9Ag.cjs.map → WidgetDrawingSettings-Cyl2u_u8.cjs.map} +1 -1
- package/dist/WidgetGoToDate-BNdngHlg.cjs +2 -0
- package/dist/{WidgetGoToDate-CPzfStIm.cjs.map → WidgetGoToDate-BNdngHlg.cjs.map} +1 -1
- package/dist/{WidgetGoToDate-R2teTLpJ.js → WidgetGoToDate-hcDtezRm.js} +6 -5
- package/dist/{WidgetGoToDate-R2teTLpJ.js.map → WidgetGoToDate-hcDtezRm.js.map} +1 -1
- package/dist/{WidgetHotkeySheet-BE0glkVA.js → WidgetHotkeySheet-1lRFSdvt.js} +3 -3
- package/dist/{WidgetHotkeySheet-BE0glkVA.js.map → WidgetHotkeySheet-1lRFSdvt.js.map} +1 -1
- package/dist/{WidgetHotkeySheet-pnsXreK6.cjs → WidgetHotkeySheet-y5LWKSG6.cjs} +2 -2
- package/dist/{WidgetHotkeySheet-pnsXreK6.cjs.map → WidgetHotkeySheet-y5LWKSG6.cjs.map} +1 -1
- package/dist/WidgetIndicatorPicker-CGvZ5kYd.js +245 -0
- package/dist/WidgetIndicatorPicker-CGvZ5kYd.js.map +1 -0
- package/dist/WidgetIndicatorPicker-DuKJFPRC.cjs +2 -0
- package/dist/WidgetIndicatorPicker-DuKJFPRC.cjs.map +1 -0
- package/dist/{WidgetIndicatorSettings-BJUjACzj.cjs → WidgetIndicatorSettings-C7vpco6e.cjs} +2 -2
- package/dist/{WidgetIndicatorSettings-BJUjACzj.cjs.map → WidgetIndicatorSettings-C7vpco6e.cjs.map} +1 -1
- package/dist/{WidgetIndicatorSettings-DgbsZk0h.js → WidgetIndicatorSettings-dDkqzzYo.js} +6 -6
- package/dist/{WidgetIndicatorSettings-DgbsZk0h.js.map → WidgetIndicatorSettings-dDkqzzYo.js.map} +1 -1
- package/dist/{WidgetSettings-Pgt3p6vv.cjs → WidgetSettings-D7Pq42zW.cjs} +2 -2
- package/dist/{WidgetSettings-Pgt3p6vv.cjs.map → WidgetSettings-D7Pq42zW.cjs.map} +1 -1
- package/dist/{WidgetSettings-D35fHGXL.js → WidgetSettings-eOo93L7Z.js} +4 -4
- package/dist/{WidgetSettings-D35fHGXL.js.map → WidgetSettings-eOo93L7Z.js.map} +1 -1
- package/dist/WidgetSymbolSearch-C4OR42nZ.cjs +2 -0
- package/dist/WidgetSymbolSearch-C4OR42nZ.cjs.map +1 -0
- package/dist/WidgetSymbolSearch-CvPpjIwa.js +580 -0
- package/dist/WidgetSymbolSearch-CvPpjIwa.js.map +1 -0
- package/dist/{focusTrap-Hm7AUTBw.js → focusTrap-Br9Zfje0.js} +1 -1
- package/dist/{focusTrap-Hm7AUTBw.js.map → focusTrap-Br9Zfje0.js.map} +1 -1
- package/dist/{focusTrap-B8OoGwHb.cjs → focusTrap-DrhhmG0V.cjs} +1 -1
- package/dist/{focusTrap-B8OoGwHb.cjs.map → focusTrap-DrhhmG0V.cjs.map} +1 -1
- package/dist/{i18n-DFR1Oukq.cjs → i18n-C2nQBZTY.cjs} +1 -1
- package/dist/{i18n-DFR1Oukq.cjs.map → i18n-C2nQBZTY.cjs.map} +1 -1
- package/dist/{i18n-CvnQcfor.js → i18n-C5v6Tzp1.js} +1 -1
- package/dist/{i18n-CvnQcfor.js.map → i18n-C5v6Tzp1.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{indicatorInputWords-D19kY9NO.js → indicatorInputWords-Bd9Pt6qp.js} +2 -2
- package/dist/{indicatorInputWords-D19kY9NO.js.map → indicatorInputWords-Bd9Pt6qp.js.map} +1 -1
- package/dist/{indicatorInputWords-DzrKBU2I.cjs → indicatorInputWords-CTA4IcJR.cjs} +2 -2
- package/dist/{indicatorInputWords-DzrKBU2I.cjs.map → indicatorInputWords-CTA4IcJR.cjs.map} +1 -1
- package/dist/{indicatorSettingsTabs-BLEULMJJ.cjs → indicatorSettingsTabs-B0liE3ST.cjs} +2 -2
- package/dist/{indicatorSettingsTabs-BLEULMJJ.cjs.map → indicatorSettingsTabs-B0liE3ST.cjs.map} +1 -1
- package/dist/{indicatorSettingsTabs-Wxx2v_y4.js → indicatorSettingsTabs-XcgMdbLp.js} +3 -3
- package/dist/{indicatorSettingsTabs-Wxx2v_y4.js.map → indicatorSettingsTabs-XcgMdbLp.js.map} +1 -1
- package/dist/monthView-B-CieFDJ.cjs +2 -0
- package/dist/monthView-B-CieFDJ.cjs.map +1 -0
- package/dist/monthView-N8yDaTqZ.js +198 -0
- package/dist/monthView-N8yDaTqZ.js.map +1 -0
- package/dist/{platformKeys-BAPueZ1I.cjs → platformKeys-B82-j1Fs.cjs} +1 -1
- package/dist/{platformKeys-BAPueZ1I.cjs.map → platformKeys-B82-j1Fs.cjs.map} +1 -1
- package/dist/{platformKeys-D_x_6ZrV.js → platformKeys-Dd1qOCjF.js} +1 -1
- package/dist/{platformKeys-D_x_6ZrV.js.map → platformKeys-Dd1qOCjF.js.map} +1 -1
- package/dist/{settingsControls-ef4j_clQ.js → settingsControls-DIjzCFHI.js} +2 -2
- package/dist/{settingsControls-ef4j_clQ.js.map → settingsControls-DIjzCFHI.js.map} +1 -1
- package/dist/{settingsControls-jNn0If4b.cjs → settingsControls-Tn8_vJJv.cjs} +2 -2
- package/dist/{settingsControls-jNn0If4b.cjs.map → settingsControls-Tn8_vJJv.cjs.map} +1 -1
- package/dist/symbolCatalog-CA1fpz3s.js +90 -0
- package/dist/symbolCatalog-CA1fpz3s.js.map +1 -0
- package/dist/symbolCatalog-Dx1YnZgm.cjs +2 -0
- package/dist/symbolCatalog-Dx1YnZgm.cjs.map +1 -0
- package/dist/widget/ChartWidget.d.ts +67 -579
- package/dist/widget/ChartWidget.d.ts.map +1 -1
- package/dist/widget/WidgetAlerts.d.ts +35 -0
- package/dist/widget/WidgetAlerts.d.ts.map +1 -0
- package/dist/widget/WidgetChartSettings.d.ts +194 -0
- package/dist/widget/WidgetChartSettings.d.ts.map +1 -0
- package/dist/widget/WidgetCommands.d.ts +54 -0
- package/dist/widget/WidgetCommands.d.ts.map +1 -0
- package/dist/widget/WidgetCompares.d.ts +140 -0
- package/dist/widget/WidgetCompares.d.ts.map +1 -0
- package/dist/widget/WidgetDockArea.d.ts +89 -0
- package/dist/widget/WidgetDockArea.d.ts.map +1 -0
- package/dist/widget/WidgetDrawingEdit.d.ts +73 -0
- package/dist/widget/WidgetDrawingEdit.d.ts.map +1 -0
- package/dist/widget/WidgetIntervals.d.ts +66 -0
- package/dist/widget/WidgetIntervals.d.ts.map +1 -0
- package/dist/widget/WidgetLayouts.d.ts +85 -0
- package/dist/widget/WidgetLayouts.d.ts.map +1 -0
- package/dist/widget/WidgetLegendView.d.ts +54 -0
- package/dist/widget/WidgetLegendView.d.ts.map +1 -0
- package/dist/widget/WidgetMenus.d.ts +79 -0
- package/dist/widget/WidgetMenus.d.ts.map +1 -0
- package/dist/widget/WidgetReplay.d.ts +199 -0
- package/dist/widget/WidgetReplay.d.ts.map +1 -0
- package/dist/widget/WidgetTrading.d.ts +48 -0
- package/dist/widget/WidgetTrading.d.ts.map +1 -0
- package/dist/widget/WidgetWatchlists.d.ts +77 -0
- package/dist/widget/WidgetWatchlists.d.ts.map +1 -0
- package/dist/widget/index.cjs +21 -21
- package/dist/widget/index.cjs.map +1 -1
- package/dist/widget/index.js +6779 -7050
- package/dist/widget/index.js.map +1 -1
- package/dist/widget/keyTarget.d.ts +4 -0
- package/dist/widget/keyTarget.d.ts.map +1 -1
- package/dist/widget/locales/index.cjs +1 -1
- package/dist/widget/locales/index.js +1 -1
- package/dist/widget/pageEnv.d.ts +5 -0
- package/dist/widget/pageEnv.d.ts.map +1 -0
- package/dist/widget/widgetDialogs.d.ts +3 -0
- package/dist/widget/widgetDialogs.d.ts.map +1 -1
- package/dist/widgetFeatures-BM6u0u74.js +186 -0
- package/dist/widgetFeatures-BM6u0u74.js.map +1 -0
- package/dist/widgetFeatures-BZ8OVPN2.cjs +3 -0
- package/dist/widgetFeatures-BZ8OVPN2.cjs.map +1 -0
- package/package.json +3 -3
- package/dist/WidgetGoToDate-CPzfStIm.cjs +0 -2
- package/dist/widgetFeatures-BvkTbsQn.js +0 -378
- package/dist/widgetFeatures-BvkTbsQn.js.map +0 -1
- package/dist/widgetFeatures-Cy0fs3Nl.cjs +0 -3
- package/dist/widgetFeatures-Cy0fs3Nl.cjs.map +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { WidgetSelectionToolbar } from './WidgetSelectionToolbar.js';
|
|
2
|
+
import { DrawingTemplateStore } from './DrawingTemplateStore.js';
|
|
3
|
+
import { DrawingTemplateLook } from './WidgetDrawingSettings.js';
|
|
4
|
+
import { WidgetInlineText } from './WidgetInlineText.js';
|
|
5
|
+
import { WidgetNamePrompt } from './WidgetNamePrompt.js';
|
|
6
|
+
import { ChartWidget } from './ChartWidget.js';
|
|
7
|
+
/** What editing a drawing reads of the widget around it, and asks of it. */
|
|
8
|
+
export interface DrawingEditHost {
|
|
9
|
+
readonly chart: ChartWidget['chart'];
|
|
10
|
+
readonly chartContainer: ChartWidget['chartContainer'];
|
|
11
|
+
chartOffset: ChartWidget['chartOffset'];
|
|
12
|
+
readonly destroyed: ChartWidget['destroyed'];
|
|
13
|
+
readonly docking: ChartWidget['docking'];
|
|
14
|
+
readonly drawingSettingsPart: ChartWidget['drawingSettingsPart'];
|
|
15
|
+
drawingToolName: ChartWidget['drawingToolName'];
|
|
16
|
+
readonly featureState: ChartWidget['featureState'];
|
|
17
|
+
readonly root: ChartWidget['root'];
|
|
18
|
+
say: ChartWidget['say'];
|
|
19
|
+
readonly t: ChartWidget['t'];
|
|
20
|
+
readonly ui: ChartWidget['ui'];
|
|
21
|
+
whenLoaded: ChartWidget['whenLoaded'];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Editing a drawing in the widget: the toolbar over the one selected, the words of a text
|
|
25
|
+
* typed in place on the chart, its settings dialog (a text just drawn taken back on Cancel),
|
|
26
|
+
* and saving its look as a template.
|
|
27
|
+
*/
|
|
28
|
+
export declare class WidgetDrawingEdit {
|
|
29
|
+
private readonly host;
|
|
30
|
+
constructor(host: DrawingEditHost);
|
|
31
|
+
/** A text drawn just now whose words the settings ask for: Cancel there takes it back. */
|
|
32
|
+
justDrawnText: string | null;
|
|
33
|
+
/** A text drawing's words typed in place over it. */
|
|
34
|
+
inlineText: WidgetInlineText | null;
|
|
35
|
+
/** The drawing whose words are being typed in place, and whether it was just drawn. */
|
|
36
|
+
inlineTextId: string | null;
|
|
37
|
+
inlineTextNew: boolean;
|
|
38
|
+
/** The chart's type sizes the look last wrote: a host's own change since makes them the new base. */
|
|
39
|
+
chartFontWritten: {
|
|
40
|
+
sizeSmall: number;
|
|
41
|
+
sizeMedium: number;
|
|
42
|
+
sizeLarge: number;
|
|
43
|
+
} | null;
|
|
44
|
+
/** Stops waiting to ask for a just-drawn text's words (the widget goes, or another text is drawn first). */
|
|
45
|
+
cancelTextPrompt: (() => void) | null;
|
|
46
|
+
selectionToolbar: WidgetSelectionToolbar | null;
|
|
47
|
+
selectionToolbarFrame: number | null;
|
|
48
|
+
/** Asks a drawing template's name, over the drawing's settings. */
|
|
49
|
+
drawingTemplatePrompt: WidgetNamePrompt | null;
|
|
50
|
+
/** `updateSelectionToolbar` on the next frame, once, while the toolbar shows. */
|
|
51
|
+
scheduleSelectionToolbar(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Show the selection toolbar over the selected drawings, or hide it: when
|
|
54
|
+
* nothing is selected, or while a tool, the eraser or the zoom area is on.
|
|
55
|
+
*/
|
|
56
|
+
updateSelectionToolbar(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Type a text drawing's words in place, over its box: Enter or a click away
|
|
59
|
+
* keeps them, Escape puts them back. One just drawn (`justDrawn`) is taken
|
|
60
|
+
* back on Escape or with no words. False when its box is not on the chart
|
|
61
|
+
* (hidden, its text turned off): the settings ask for the words instead.
|
|
62
|
+
*/
|
|
63
|
+
editTextInPlace(id: string, justDrawn: boolean): boolean;
|
|
64
|
+
/** Open a drawing's settings (double-click on it, or the object tree's settings button). */
|
|
65
|
+
openDrawingSettings(id: string, how?: {
|
|
66
|
+
tab?: 'text';
|
|
67
|
+
justDrawn?: boolean;
|
|
68
|
+
}): void;
|
|
69
|
+
private showDrawingSettings;
|
|
70
|
+
/** Save a drawing's look as a template of its tool, asking for its name over the drawing's settings. */
|
|
71
|
+
promptSaveDrawingTemplate(templates: DrawingTemplateStore, look: DrawingTemplateLook): void;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=WidgetDrawingEdit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetDrawingEdit.d.ts","sourceRoot":"","sources":["../../src/widget/WidgetDrawingEdit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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F;IAC1F,aAAa,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEpC,qDAAqD;IACrD,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAE3C,uFAAuF;IACvF,YAAY,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEnC,aAAa,UAAS;IAEtB,qGAAqG;IACrG,gBAAgB,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAQ;IAE7F,4GAA4G;IAC5G,gBAAgB,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAQ;IAE7C,gBAAgB,EAAE,sBAAsB,GAAG,IAAI,CAAQ;IAEvD,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE5C,mEAAmE;IACnE,qBAAqB,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAEtD,iFAAiF;IACjF,wBAAwB,IAAI,IAAI;IAQhC;;;OAGG;IACH,sBAAsB,IAAI,IAAI;IAuC9B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO;IAyDxD,4FAA4F;IAC5F,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,GAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,IAAI;IAItF,OAAO,CAAC,mBAAmB;IAyB3B,wGAAwG;IACxG,yBAAyB,CAAC,SAAS,EAAE,oBAAoB,EAAE,IAAI,EAAE,mBAAmB,GAAG,IAAI;CAY5F"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { TimeFrame } from '@tradecanvas/commons';
|
|
2
|
+
import { WidgetIntervalInput } from './WidgetIntervalInput.js';
|
|
3
|
+
import { RangePreset } from '@tradecanvas/core';
|
|
4
|
+
import { ChartWidget } from './ChartWidget.js';
|
|
5
|
+
/** What the intervals read of the widget around them, and ask of them. */
|
|
6
|
+
export interface IntervalsHost {
|
|
7
|
+
readonly adapter: ChartWidget['adapter'];
|
|
8
|
+
readonly baseSeries: ChartWidget['baseSeries'];
|
|
9
|
+
readonly baseTimeframeMs: ChartWidget['baseTimeframeMs'];
|
|
10
|
+
readonly chart: ChartWidget['chart'];
|
|
11
|
+
chosenTimeframe: ChartWidget['chosenTimeframe'];
|
|
12
|
+
readonly customTimeframes: ChartWidget['customTimeframes'];
|
|
13
|
+
readonly destroyed: ChartWidget['destroyed'];
|
|
14
|
+
displayTimezone: ChartWidget['displayTimezone'];
|
|
15
|
+
readonly featureState: ChartWidget['featureState'];
|
|
16
|
+
handleTimeframe: ChartWidget['handleTimeframe'];
|
|
17
|
+
readonly options: ChartWidget['options'];
|
|
18
|
+
say: ChartWidget['say'];
|
|
19
|
+
readonly state: ChartWidget['state'];
|
|
20
|
+
switchTimeframe: ChartWidget['switchTimeframe'];
|
|
21
|
+
readonly timeframeFavorites: ChartWidget['timeframeFavorites'];
|
|
22
|
+
timeframes: ChartWidget['timeframes'];
|
|
23
|
+
readonly toolbar: ChartWidget['toolbar'];
|
|
24
|
+
updateUI: ChartWidget['updateUI'];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The intervals the widget offers: the interval menu and the ones pinned to the toolbar, one
|
|
28
|
+
* added, removed or made a favourite, one typed on the chart, and the range bar's presets with
|
|
29
|
+
* the interval each one switches to.
|
|
30
|
+
*/
|
|
31
|
+
export declare class WidgetIntervals {
|
|
32
|
+
private readonly host;
|
|
33
|
+
constructor(host: IntervalsHost);
|
|
34
|
+
intervalInput: WidgetIntervalInput | null;
|
|
35
|
+
/** Counts range clicks and the user's own picks: a range waiting behind a newer one gives way. */
|
|
36
|
+
rangeSeq: number;
|
|
37
|
+
/** Ranges apply one at a time, each reading the bars the last one brought. */
|
|
38
|
+
private rangeQueue;
|
|
39
|
+
/**
|
|
40
|
+
* A range from the range bar. A long one switches to the timeframe whose
|
|
41
|
+
* bars it fits (five years of days in weeks, decades in months), a short
|
|
42
|
+
* one back toward the user's own (`timeframeForRange`); then the range is
|
|
43
|
+
* shown. Off with `features: { 'statusBar.rangeTimeframe': false }`.
|
|
44
|
+
*/
|
|
45
|
+
applyRangePreset(preset: RangePreset): Promise<void>;
|
|
46
|
+
private runRangePreset;
|
|
47
|
+
/** The timeframe `preset` shows in, from the bars on the chart now. */
|
|
48
|
+
private timeframeForPreset;
|
|
49
|
+
/** Whether a switch to `tf` brings bars: the feed serves it, or the bars here resample to it. */
|
|
50
|
+
private canShowTimeframe;
|
|
51
|
+
/** Pinned timeframes that are still on offer, shortest first. */
|
|
52
|
+
pinnedTimeframes(): TimeFrame[];
|
|
53
|
+
/** The timeframe menu's rows, typed intervals marked so they can be removed. */
|
|
54
|
+
timeframeMenu(): {
|
|
55
|
+
value: TimeFrame;
|
|
56
|
+
label: string;
|
|
57
|
+
custom: boolean;
|
|
58
|
+
}[];
|
|
59
|
+
/** A typed interval: switch to it, adding and pinning it when it is new. False when it isn't one. */
|
|
60
|
+
handleAddTimeframe(text: string): boolean;
|
|
61
|
+
/** A typed interval: one on offer is picked; another joins the menu (not the toolbar's pins). */
|
|
62
|
+
selectTypedTimeframe(tf: TimeFrame): boolean;
|
|
63
|
+
handleRemoveTimeframe(tf: TimeFrame): void;
|
|
64
|
+
handleToggleTimeframeFavorite(tf: TimeFrame): void;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=WidgetIntervals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetIntervals.d.ts","sourceRoot":"","sources":["../../src/widget/WidgetIntervals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAqC,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAA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AAE,aAAa;IAEhD,aAAa,EAAE,mBAAmB,GAAG,IAAI,CAAQ;IAEjD,kGAAkG;IAClG,QAAQ,SAAK;IAEb,8EAA8E;IAC9E,OAAO,CAAC,UAAU,CAAoC;IAEtD;;;;;OAKG;IACH,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;YAWtC,cAAc;IAc5B,uEAAuE;IACvE,OAAO,CAAC,kBAAkB;IA4B1B,iGAAiG;IACjG,OAAO,CAAC,gBAAgB;IAUxB,iEAAiE;IACjE,gBAAgB,IAAI,SAAS,EAAE;IAK/B,gFAAgF;IAChF,aAAa,IAAI;QAAE,KAAK,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,EAAE;IAIvE,qGAAqG;IACrG,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAiBzC,iGAAiG;IACjG,oBAAoB,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO;IAc5C,qBAAqB,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI;IAS1C,6BAA6B,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI;CAKnD"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { WidgetLayoutsUI } from './WidgetLayoutsUI.js';
|
|
2
|
+
import { WidgetLayoutContent } from './widgetLayout.js';
|
|
3
|
+
import { LayoutSession } from '../state/LayoutSession.js';
|
|
4
|
+
import { ChartWidget } from './ChartWidget.js';
|
|
5
|
+
/** What the layouts read of the widget around them, and ask of it. */
|
|
6
|
+
export interface LayoutsHost {
|
|
7
|
+
allowedSettings: ChartWidget['chartSettings']['allowedSettings'];
|
|
8
|
+
applyChartType: ChartWidget['applyChartType'];
|
|
9
|
+
applySettings: ChartWidget['chartSettings']['applySettings'];
|
|
10
|
+
readonly chart: ChartWidget['chart'];
|
|
11
|
+
readonly chosenTimeframe: ChartWidget['chosenTimeframe'];
|
|
12
|
+
claimSettings: ChartWidget['chartSettings']['claimSettings'];
|
|
13
|
+
readonly destroyed: ChartWidget['destroyed'];
|
|
14
|
+
displayTimezone: ChartWidget['displayTimezone'];
|
|
15
|
+
getSettings: ChartWidget['chartSettings']['getSettings'];
|
|
16
|
+
keysShown: ChartWidget['keysShown'];
|
|
17
|
+
readonly options: ChartWidget['options'];
|
|
18
|
+
overViewerTypeOptions: ChartWidget['overViewerTypeOptions'];
|
|
19
|
+
readonly root: ChartWidget['root'];
|
|
20
|
+
say: ChartWidget['say'];
|
|
21
|
+
setSymbol: ChartWidget['setSymbol'];
|
|
22
|
+
setTimeframe: ChartWidget['setTimeframe'];
|
|
23
|
+
readonly settings: ChartWidget['settings'];
|
|
24
|
+
readonly settingsDefaults: ChartWidget['chartSettings']['settingsDefaults'];
|
|
25
|
+
showLinkSettings: ChartWidget['chartSettings']['showLinkSettings'];
|
|
26
|
+
shownSettings: ChartWidget['chartSettings']['shownSettings'];
|
|
27
|
+
state: ChartWidget['state'];
|
|
28
|
+
syncIndicatorsFromChart: ChartWidget['syncIndicatorsFromChart'];
|
|
29
|
+
readonly t: ChartWidget['t'];
|
|
30
|
+
readonly toolbar: ChartWidget['toolbar'];
|
|
31
|
+
updateUI: ChartWidget['updateUI'];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The widget's layouts: what one holds (the chart's state and the widget's), the named layouts
|
|
35
|
+
* and the one in use, saving it as it changes, a symbol's own layout, and the state shared by link.
|
|
36
|
+
*/
|
|
37
|
+
export declare class WidgetLayouts {
|
|
38
|
+
private readonly host;
|
|
39
|
+
constructor(host: LayoutsHost);
|
|
40
|
+
layoutSession: LayoutSession | null;
|
|
41
|
+
layoutsUI: WidgetLayoutsUI | null;
|
|
42
|
+
layoutKeyPrefix: string | null;
|
|
43
|
+
layoutDebounceMs: number;
|
|
44
|
+
private activeLayoutKey;
|
|
45
|
+
/** A view shared in the URL (`#tcw=`), when `shareUrl` is on. */
|
|
46
|
+
restoreSharedView(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Encode the current view (symbol, timeframe, chart type, scale,
|
|
49
|
+
* indicators, drawings, and the Chart Settings changed from the defaults
|
|
50
|
+
* but the viewer's time zone and number format; for the switches the
|
|
51
|
+
* host's features set, from where they set them).
|
|
52
|
+
*/
|
|
53
|
+
exportState(): string;
|
|
54
|
+
/** Restore a view from an `exportState()` string. Returns false if malformed. */
|
|
55
|
+
importState(encoded: string): Promise<boolean>;
|
|
56
|
+
/** Copy a shareable deep-link (current view encoded in the URL hash) to the clipboard. */
|
|
57
|
+
copyShareLink(): Promise<void>;
|
|
58
|
+
/** Named layouts: save, open, rename, delete, auto-save. `null` with `layouts: false`. */
|
|
59
|
+
getLayoutSession(): LayoutSession | null;
|
|
60
|
+
/**
|
|
61
|
+
* This chart as a layout: symbol, interval, scale, the Chart Settings (but
|
|
62
|
+
* the viewer's time zone and number format) and the chart's state (no
|
|
63
|
+
* theme). A copy, free to keep.
|
|
64
|
+
*/
|
|
65
|
+
captureLayout(): WidgetLayoutContent;
|
|
66
|
+
/** Show a layout from `captureLayout()`. */
|
|
67
|
+
restoreLayout(content: WidgetLayoutContent): Promise<void>;
|
|
68
|
+
/** `captureLayout()` as JSON. */
|
|
69
|
+
getLayoutContent(): string;
|
|
70
|
+
/** Show a layout from `getLayoutContent()`; `false` when it is not one. */
|
|
71
|
+
applyLayoutContent(content: string): Promise<boolean>;
|
|
72
|
+
setupLayouts(cfg: import('./types.js').WidgetLayoutsOptions): void;
|
|
73
|
+
/** Save into the open layout, or ask for a name when there is none. */
|
|
74
|
+
saveLayout(): Promise<void>;
|
|
75
|
+
/** Open a saved layout by id; `false` when it could not be. */
|
|
76
|
+
openLayout(id: string): Promise<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* Wipe the layout saved for `symbol` (or the active symbol if omitted).
|
|
79
|
+
* Useful as an "Reset layout" command in user-facing menus.
|
|
80
|
+
*/
|
|
81
|
+
clearSavedLayout(symbol?: string): void;
|
|
82
|
+
applySymbolLayout(symbol: string): void;
|
|
83
|
+
flushActiveLayout(): void;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=WidgetLayouts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetLayouts.d.ts","sourceRoot":"","sources":["../../src/widget/WidgetLayouts.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAuD,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAClH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAUpD,sEAAsE;AACtE,MAAM,WAAW,WAAW;IAC1B,eAAe,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC,iBAAiB,CAAC,CAAC;IACjE,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,aAAa,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC,eAAe,CAAC,CAAC;IAC7D,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACzD,aAAa,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC,eAAe,CAAC,CAAC;IAC7D,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAC7C,eAAe,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAChD,WAAW,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,CAAC;IACzD,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACzC,qBAAqB,EAAE,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAC5D,QAAQ,CAA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aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAWpC,0FAA0F;IAC1F,gBAAgB,IAAI,aAAa,GAAG,IAAI;IAIxC;;;;OAIG;IACH,aAAa,IAAI,mBAAmB;IAmBpC,4CAA4C;IACtC,aAAa,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBhE,iCAAiC;IACjC,gBAAgB,IAAI,MAAM;IAI1B,2EAA2E;IACrE,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAO3D,YAAY,CAAC,GAAG,EAAE,OAAO,YAAY,EAAE,oBAAoB,GAAG,IAAI;IA6BlE,uEAAuE;IACjE,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC,+DAA+D;IACzD,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI9C;;;OAGG;IACH,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAQvC,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAkBvC,iBAAiB,IAAI,IAAI;CAM1B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { WidgetContextMenu } from './WidgetContextMenu.js';
|
|
2
|
+
import { PaneAction } from './WidgetIndicatorLegend.js';
|
|
3
|
+
import { ChartWidget } from './ChartWidget.js';
|
|
4
|
+
/** Gap between the on-chart indicator rows and the plot or pane edge, px. */
|
|
5
|
+
export declare const LEGEND_INSET = 4;
|
|
6
|
+
/** How far under the OHLCV legend's foot the indicator rows start (px). */
|
|
7
|
+
export declare const STACK_GAP = 1;
|
|
8
|
+
/**
|
|
9
|
+
* Whether an indicator's lines are in the chart's own prices, written as it
|
|
10
|
+
* writes them: not another symbol's (a compare, a spread, a ratio), nor one
|
|
11
|
+
* on a scale of its own on the left.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readsChartPrices(ind: {
|
|
14
|
+
id: string;
|
|
15
|
+
scale?: 'left';
|
|
16
|
+
}): boolean;
|
|
17
|
+
/** What the legend reads of the widget around it, and asks of it. */
|
|
18
|
+
export interface LegendHost {
|
|
19
|
+
readonly chart: ChartWidget['chart'];
|
|
20
|
+
readonly destroyed: ChartWidget['destroyed'];
|
|
21
|
+
readonly featureState: ChartWidget['featureState'];
|
|
22
|
+
handleRemoveIndicator: ChartWidget['handleRemoveIndicator'];
|
|
23
|
+
readonly indicatorLegend: ChartWidget['indicatorLegend'];
|
|
24
|
+
indicatorValueText: ChartWidget['indicatorValueText'];
|
|
25
|
+
readonly legendHoverIndex: ChartWidget['legendHoverIndex'];
|
|
26
|
+
openIndicatorSettings: ChartWidget['openIndicatorSettings'];
|
|
27
|
+
readonly options: ChartWidget['options'];
|
|
28
|
+
readonly root: ChartWidget['root'];
|
|
29
|
+
readonly settingsState: ChartWidget['chartSettings']['settingsState'];
|
|
30
|
+
readonly t: ChartWidget['t'];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The legend over the chart: drawn once a frame when something it shows changed, the
|
|
34
|
+
* indicators' rows by pane with their buttons, a pane's actions, and an indicator's menu.
|
|
35
|
+
*/
|
|
36
|
+
export declare class WidgetLegendView {
|
|
37
|
+
private readonly host;
|
|
38
|
+
constructor(host: LegendHost);
|
|
39
|
+
legendFrame: number;
|
|
40
|
+
/** The legend row's "more" menu: move the indicator to another pane. */
|
|
41
|
+
legendMenu: WidgetContextMenu | null;
|
|
42
|
+
/** Redraw the on-chart indicator list on the next frame (coalesced). */
|
|
43
|
+
scheduleLegend(): void;
|
|
44
|
+
private renderLegend;
|
|
45
|
+
/** A pane's button on the chart. */
|
|
46
|
+
runPaneAction(instanceId: string, action: PaneAction): void;
|
|
47
|
+
/**
|
|
48
|
+
* An indicator's "more" menu: into the pane above or below it (the price
|
|
49
|
+
* pane at the top), a pane of its own, back to the price pane; then its
|
|
50
|
+
* settings and remove.
|
|
51
|
+
*/
|
|
52
|
+
openLegendMenu(instanceId: string, anchor: HTMLElement): void;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=WidgetLegendView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetLegendView.d.ts","sourceRoot":"","sources":["../../src/widget/WidgetLegendView.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAyB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAqD,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAKhH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAWpD,6EAA6E;AAC7E,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B,2EAA2E;AAC3E,eAAO,MAAM,SAAS,IAAI,CAAC;AAE3B;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAE7E;AAED,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAC7C,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IACnD,qBAAqB,EAAE,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAC5D,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACzD,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAAC,CAAC;IACtD,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAC3D,qBAAqB,EAAE,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAC5D,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC,eAAe,CAAC,CAAC;IACtE,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;CAC9B;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,WAAW,SAAK;IAEhB,wEAAwE;IACxE,UAAU,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAE5C,wEAAwE;IACxE,cAAc,IAAI,IAAI;IAQtB,OAAO,CAAC,YAAY;IAgEpB,oCAAoC;IACpC,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI;IAO3D;;;;OAIG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;CAwC9D"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { WidgetContextMenu } from './WidgetContextMenu.js';
|
|
2
|
+
import { ChartMenuContext } from './chartMenu.js';
|
|
3
|
+
import { ChartWidget } from './ChartWidget.js';
|
|
4
|
+
/** What the context menus read of the widget around them, and ask of it. */
|
|
5
|
+
export interface MenusHost {
|
|
6
|
+
readonly adapter: ChartWidget['adapter'];
|
|
7
|
+
readonly alerting: ChartWidget['alerting'];
|
|
8
|
+
readonly canExport: ChartWidget['canExport'];
|
|
9
|
+
changeSettings: ChartWidget['chartSettings']['changeSettings'];
|
|
10
|
+
changeStyle: ChartWidget['chartSettings']['changeStyle'];
|
|
11
|
+
readonly chart: ChartWidget['chart'];
|
|
12
|
+
readonly chartContainer: ChartWidget['chartContainer'];
|
|
13
|
+
readonly drawingSettings: ChartWidget['drawingSettings'];
|
|
14
|
+
effectiveScaleMode: ChartWidget['chartSettings']['effectiveScaleMode'];
|
|
15
|
+
readonly featureState: ChartWidget['featureState'];
|
|
16
|
+
formatAlertPrice: ChartWidget['formatAlertPrice'];
|
|
17
|
+
readonly objectTree: ChartWidget['objectTree'];
|
|
18
|
+
openDrawingSettings: ChartWidget['drawingEdit']['openDrawingSettings'];
|
|
19
|
+
openSettings: ChartWidget['chartSettings']['openSettings'];
|
|
20
|
+
readonly options: ChartWidget['options'];
|
|
21
|
+
refreshDrawingsState: ChartWidget['refreshDrawingsState'];
|
|
22
|
+
refreshObjects: ChartWidget['docking']['refreshObjects'];
|
|
23
|
+
resetView: ChartWidget['resetView'];
|
|
24
|
+
readonly root: ChartWidget['root'];
|
|
25
|
+
say: ChartWidget['say'];
|
|
26
|
+
readonly settingsState: ChartWidget['chartSettings']['settingsState'];
|
|
27
|
+
state: ChartWidget['state'];
|
|
28
|
+
readonly t: ChartWidget['t'];
|
|
29
|
+
toggleGoToDate: ChartWidget['toggleGoToDate'];
|
|
30
|
+
readonly trading: ChartWidget['trading'];
|
|
31
|
+
updateUI: ChartWidget['updateUI'];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The widget's context menus: the chart's (what was under the pointer, its price, its pane),
|
|
35
|
+
* a drawing's, and the clear menu, with what each of their entries does.
|
|
36
|
+
*/
|
|
37
|
+
export declare class WidgetMenus {
|
|
38
|
+
private readonly host;
|
|
39
|
+
constructor(host: MenusHost);
|
|
40
|
+
drawingMenu: WidgetContextMenu | null;
|
|
41
|
+
/** The trash button's menu, made the first time it opens. */
|
|
42
|
+
clearMenu: WidgetContextMenu | null;
|
|
43
|
+
chartMenu: WidgetContextMenu | null;
|
|
44
|
+
/** The pane a chart menu was opened on (its scale switches act on it). */
|
|
45
|
+
menuPane: string | null;
|
|
46
|
+
/** The menu of a right-clicked drawing; the chart has selected it (and its group) by now. */
|
|
47
|
+
openDrawingMenu(id: string, x: number, y: number): void;
|
|
48
|
+
private runDrawingMenuAction;
|
|
49
|
+
/** What the chart's menus can offer here, and how the chart is set now. */
|
|
50
|
+
chartMenuContext(price: number | undefined): ChartMenuContext;
|
|
51
|
+
/** The indicators "Remove indicators" takes away: a comparison with another symbol stays, as it has a dialog of its own. */
|
|
52
|
+
private removableIndicators;
|
|
53
|
+
/**
|
|
54
|
+
* The exchange's zone, offered when the chart knows one (the symbol's, or
|
|
55
|
+
* its market's) or the adapter can name the symbol's; its zone is null
|
|
56
|
+
* while unknown.
|
|
57
|
+
*/
|
|
58
|
+
exchangeChoice(): {
|
|
59
|
+
label: string;
|
|
60
|
+
zone: string | null;
|
|
61
|
+
} | undefined;
|
|
62
|
+
/** The time zones on offer, the exchange's among them when there is one. */
|
|
63
|
+
private timezoneChoices;
|
|
64
|
+
/**
|
|
65
|
+
* Open a chart menu at (x, y) in the chart's pixels, the host's own entries
|
|
66
|
+
* last; nothing when it has no entries.
|
|
67
|
+
*/
|
|
68
|
+
openChartMenu(entries: import('./WidgetContextMenu.js').ContextMenuEntry[], x: number, y: number, context: import('./types.js').ChartMenuItemsContext): void;
|
|
69
|
+
private runChartMenuAction;
|
|
70
|
+
/**
|
|
71
|
+
* The trash button's menu: the drawings, the indicators, or both, each with
|
|
72
|
+
* how many would go (locked drawings stay). Nothing to remove, no menu; a
|
|
73
|
+
* second press closes it.
|
|
74
|
+
*/
|
|
75
|
+
openClearMenu(anchor: HTMLElement): void;
|
|
76
|
+
/** Remove the drawings, the indicators or both, as one undo step, and leave any drawing tool. */
|
|
77
|
+
removeAll(what: 'drawings' | 'indicators' | 'all'): void;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=WidgetMenus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetMenus.d.ts","sourceRoot":"","sources":["../../src/widget/WidgetMenus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAyB,MAAM,wBAAwB,CAAC;AAElF,OAAO,EAAsE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAK3H,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,4EAA4E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EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,OAAO,YAAY,EAAE,qBAAqB,GAClD,IAAI;IAcP,OAAO,CAAC,kBAAkB;IAmG1B;;;;OAIG;IACH,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAaxC,iGAAiG;IACjG,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,GAAG,KAAK,GAAG,IAAI;CAOzD"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { DataAdapter, DataSeries, TimeFrame } from '@tradecanvas/commons';
|
|
2
|
+
import { Chart } from '../Chart.js';
|
|
3
|
+
import { MessageKey } from './i18n.js';
|
|
4
|
+
import { ChartWidgetOptions } from './types.js';
|
|
5
|
+
import { WidgetLoadingOverlay } from './WidgetLoadingOverlay.js';
|
|
6
|
+
/**
|
|
7
|
+
* What bar replay reads of the widget around it, and asks of it. `root`, `chartContainer`,
|
|
8
|
+
* `options` and `loading` are given once: the widget keeps the same ones for its whole life.
|
|
9
|
+
*/
|
|
10
|
+
export interface ReplayHost {
|
|
11
|
+
chart(): Chart;
|
|
12
|
+
readonly root: HTMLElement;
|
|
13
|
+
readonly chartContainer: HTMLElement;
|
|
14
|
+
readonly options: ChartWidgetOptions;
|
|
15
|
+
t(key: MessageKey): string;
|
|
16
|
+
/** Whether the replay's switch is on. */
|
|
17
|
+
isOn(): boolean;
|
|
18
|
+
isDestroyed(): boolean;
|
|
19
|
+
/** The overlay over the chart while bars load. */
|
|
20
|
+
readonly loading: WidgetLoadingOverlay;
|
|
21
|
+
symbol(): string;
|
|
22
|
+
timeframe(): TimeFrame;
|
|
23
|
+
/** The widget's feed, if it has one. */
|
|
24
|
+
adapter(): DataAdapter | null;
|
|
25
|
+
/** The bars given without a feed, at their own interval, and that interval (ms). */
|
|
26
|
+
baseSeries(): DataSeries | null;
|
|
27
|
+
baseTimeframeMs(): number;
|
|
28
|
+
resampleOptions(zone: string | null): {
|
|
29
|
+
weekStartsOn: 0 | 1;
|
|
30
|
+
timeZone?: string;
|
|
31
|
+
};
|
|
32
|
+
textLocale(): string;
|
|
33
|
+
intlLocale(): string;
|
|
34
|
+
say(text: string, kind: 'info' | 'error'): void;
|
|
35
|
+
/** Shows the toolbar's Bar replay button on or off. */
|
|
36
|
+
markActive(on: boolean): void;
|
|
37
|
+
/** The widget's body, under its toolbar. */
|
|
38
|
+
bodyEl(): HTMLElement | null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Bar replay in the widget: the panel over the chart, picking the start bar on it, the
|
|
42
|
+
* session it drives on the chart (in whole bars or finer steps), and its keys.
|
|
43
|
+
*/
|
|
44
|
+
export declare class WidgetReplay {
|
|
45
|
+
private readonly host;
|
|
46
|
+
private replayBar;
|
|
47
|
+
private replayPollInterval;
|
|
48
|
+
/** The replay's speed, a multiplier: 1 plays one bar of the chart a second. */
|
|
49
|
+
private replaySpeed;
|
|
50
|
+
/** The chart's bars the replay goes through, and when the step shown opened (from `replayStep`). */
|
|
51
|
+
private replayBarsTotal;
|
|
52
|
+
private replayStepTime;
|
|
53
|
+
/** The symbol and interval of the finer steps given to the replay running (null: none given). */
|
|
54
|
+
private replayStepsKey;
|
|
55
|
+
/** `'auto'`, `'bar'`, or the finer interval a replay steps through. */
|
|
56
|
+
private replayStep;
|
|
57
|
+
private replayStartSeq;
|
|
58
|
+
/** The time of a bar picked while the next bars loaded: the replay starts there once they come. */
|
|
59
|
+
private replayPickTime;
|
|
60
|
+
/** A replay start waiting for its finer steps: a Play pressed meanwhile plays it once it starts. */
|
|
61
|
+
private replayStartPending;
|
|
62
|
+
private replayPlayWanted;
|
|
63
|
+
/** Finer bars fetched or built for the last replay in steps. */
|
|
64
|
+
private replayStepsCache;
|
|
65
|
+
/** While picking the start bar: shades the bars right of the pointer. */
|
|
66
|
+
private replayShade;
|
|
67
|
+
constructor(host: ReplayHost);
|
|
68
|
+
private get chart();
|
|
69
|
+
private get root();
|
|
70
|
+
private get chartContainer();
|
|
71
|
+
private get t();
|
|
72
|
+
/** Whether the replay's panel is open. */
|
|
73
|
+
isOpen(): boolean;
|
|
74
|
+
/** Follows the chart: a click picks the start bar or moves the replay there, and the panel keeps up. */
|
|
75
|
+
attach(): void;
|
|
76
|
+
destroy(): void;
|
|
77
|
+
/** Open (or close) bar replay with its scrubber — what the toolbar's Replay button does. */
|
|
78
|
+
toggleReplay(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Open replay in "pick a start bar" mode: the bars right of the pointer
|
|
81
|
+
* are shaded, and a click cuts the chart there and waits paused. Play
|
|
82
|
+
* starts from a default point; "random bar" picks one.
|
|
83
|
+
*/
|
|
84
|
+
private enterReplay;
|
|
85
|
+
/** While picking the start bar: the shade over the bars a pick would hide. */
|
|
86
|
+
private showReplayShade;
|
|
87
|
+
private removeReplayShade;
|
|
88
|
+
/**
|
|
89
|
+
* Select bar, inside the replay: it pauses and picks again among the bars
|
|
90
|
+
* shown, so the bars still to come stay hidden, the view stays and grid
|
|
91
|
+
* followers go on. Cancel (or Esc) comes back to the same place.
|
|
92
|
+
*/
|
|
93
|
+
private pickReplayBarAgain;
|
|
94
|
+
/** Cancel picking: back to the replay when there is one, else out of it. */
|
|
95
|
+
private cancelReplayPick;
|
|
96
|
+
/**
|
|
97
|
+
* Where the bar sits: on the main pane's foot (bottom panes stay
|
|
98
|
+
* readable), centred on its plot, in the tier its width allows; and how
|
|
99
|
+
* high it reaches, for the toasts and the drawing button to clear it.
|
|
100
|
+
*/
|
|
101
|
+
private layoutReplayBar;
|
|
102
|
+
/**
|
|
103
|
+
* How high the bar reaches over the widget's foot and its body's, for the
|
|
104
|
+
* toasts and the drawing button to clear it. Also run as the panel follows
|
|
105
|
+
* the chart: the bar's height changes with its rows and its words.
|
|
106
|
+
*/
|
|
107
|
+
private liftOverReplayBar;
|
|
108
|
+
/**
|
|
109
|
+
* Where the replay is, as the readout says it: the step's open time in
|
|
110
|
+
* the display timezone and the widget's language; the date alone on a
|
|
111
|
+
* daily chart and above, seconds under a minute (or with no interval),
|
|
112
|
+
* the year only when it isn't this one.
|
|
113
|
+
*/
|
|
114
|
+
private replayTimeText;
|
|
115
|
+
/** The chart's bars the replay goes through (not its steps), or those loaded before it starts. */
|
|
116
|
+
private replayBarCount;
|
|
117
|
+
private readonly hideReplayShade;
|
|
118
|
+
/**
|
|
119
|
+
* Open replay (if it isn't open) and start it at bar `index` — paused, or
|
|
120
|
+
* playing when `play` is set — skipping the pick-a-bar step.
|
|
121
|
+
*/
|
|
122
|
+
replayFrom(index: number, play?: boolean): void;
|
|
123
|
+
/**
|
|
124
|
+
* The steps a replay can take on this interval, the one picked kept while
|
|
125
|
+
* it is still one of them (else whole bars).
|
|
126
|
+
*/
|
|
127
|
+
private replayStepMenu;
|
|
128
|
+
/** The interval changed: the step menu offers its steps. */
|
|
129
|
+
private refreshReplaySteps;
|
|
130
|
+
/**
|
|
131
|
+
* The replay went on over new bars at the same time: the panel shows their
|
|
132
|
+
* total, and a replay in finer steps fetches them for the new bars and
|
|
133
|
+
* goes on from the bar it is on.
|
|
134
|
+
*/
|
|
135
|
+
private afterReplayCarryOver;
|
|
136
|
+
/**
|
|
137
|
+
* A bar picked while the next bars loaded: once they are in, start the replay at the bar
|
|
138
|
+
* holding its time; let it go if they failed or the pick was left.
|
|
139
|
+
*/
|
|
140
|
+
private startPickedReplay;
|
|
141
|
+
/** Whether the bars on screen are about to be replaced: a new symbol's or interval's on their way. */
|
|
142
|
+
private seriesPending;
|
|
143
|
+
/** The panel follows the chart, and whether the bars are on their way, a few times a second. */
|
|
144
|
+
private watchReplayBar;
|
|
145
|
+
/**
|
|
146
|
+
* Cut the chart at `index` and wait paused (or play at once). `ofBars`:
|
|
147
|
+
* `index` is one of the chart's bars (a pick), not a step of the replay.
|
|
148
|
+
*/
|
|
149
|
+
private startReplayAt;
|
|
150
|
+
private replayStepsKeyNow;
|
|
151
|
+
/** How many steps of `tf` make a bar of the chart (1 for whole bars, or a chart without an interval). */
|
|
152
|
+
private replayStepsPerBar;
|
|
153
|
+
/** Finer intervals a replay can step through: they divide the chart's, and the feed (or the bars loaded) has them. */
|
|
154
|
+
private replayStepOptions;
|
|
155
|
+
/** Whether the feed serves `tf`, or the bars loaded build it. */
|
|
156
|
+
private hasReplayStep;
|
|
157
|
+
/** The finer interval the step picked stands for (`'auto'` worked out here); null for whole bars. */
|
|
158
|
+
private replayStepInterval;
|
|
159
|
+
/**
|
|
160
|
+
* Whether the chart fetches a replay's finer bars itself: its bars form, a
|
|
161
|
+
* step is picked and the feed pages back. A feed that can't page back gets
|
|
162
|
+
* its finer bars fetched here, in one request, as before.
|
|
163
|
+
*/
|
|
164
|
+
private chartFetchesReplaySteps;
|
|
165
|
+
/** The finer bars for a replay in `tf` steps: from the feed, or built from the bars loaded. Null when there are none. */
|
|
166
|
+
private replayStepsFor;
|
|
167
|
+
/**
|
|
168
|
+
* The zone the feed's wrapper builds `tf` in for `symbol` ('' when the feed
|
|
169
|
+
* serves it): after no answer about the symbol it builds on UTC's days
|
|
170
|
+
* until the chart loads the symbol afresh, so steps fetched before then
|
|
171
|
+
* are stale after it.
|
|
172
|
+
*/
|
|
173
|
+
private builtStepsZone;
|
|
174
|
+
/** Bars available to replay: the whole series, not the slice on screen. */
|
|
175
|
+
private replayTotal;
|
|
176
|
+
/** Mirror the replay engine in the bar; close it if the session ended elsewhere. */
|
|
177
|
+
syncReplayBar(): void;
|
|
178
|
+
private stepReplay;
|
|
179
|
+
/**
|
|
180
|
+
* Replay shortcuts: Shift+←/→ step one bar, Space on the chart plays or
|
|
181
|
+
* pauses, Escape cancels picking a start bar. Only for the widget used
|
|
182
|
+
* last, with focus in it (or nowhere), not while typing or in a dialog.
|
|
183
|
+
*/
|
|
184
|
+
handleReplayKey(e: KeyboardEvent): boolean;
|
|
185
|
+
/** Focus on the chart itself (its container or the canvas in it), not on a control over it. */
|
|
186
|
+
private onChartSurface;
|
|
187
|
+
private toggleReplayPlay;
|
|
188
|
+
private replayBarAtEnd;
|
|
189
|
+
private positionReplayShade;
|
|
190
|
+
/** Leave replay and return to the live series (with updates that arrived meanwhile). */
|
|
191
|
+
exitReplay(): void;
|
|
192
|
+
private teardownReplayUi;
|
|
193
|
+
/**
|
|
194
|
+
* Focus was in the bar: back to the toolbar's Bar replay button, or the
|
|
195
|
+
* "more" menu that folds it on a narrow toolbar, or the chart.
|
|
196
|
+
*/
|
|
197
|
+
private focusAfterReplay;
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=WidgetReplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetReplay.d.ts","sourceRoot":"","sources":["../../src/widget/WidgetReplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAA6C,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAG1H,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AActE;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,IAAI,KAAK,CAAC;IACf,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,CAAC,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,CAAC;IAC3B,yCAAyC;IACzC,IAAI,IAAI,OAAO,CAAC;IAChB,WAAW,IAAI,OAAO,CAAC;IACvB,kDAAkD;IAClD,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACvC,MAAM,IAAI,MAAM,CAAC;IACjB,SAAS,IAAI,SAAS,CAAC;IACvB,wCAAwC;IACxC,OAAO,IAAI,WAAW,GAAG,IA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B5B;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAQtB,2EAA2E;IAC3E,OAAO,CAAC,WAAW;IAInB,oFAAoF;IACpF,aAAa,IAAI,IAAI;IAwBrB,OAAO,CAAC,UAAU;IAYlB;;;;OAIG;IACH,eAAe,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO;IA8B1C,+FAA+F;IAC/F,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,mBAAmB;IAe3B,wFAAwF;IACxF,UAAU,IAAI,IAAI;IAKlB,OAAO,CAAC,gBAAgB;IAsBxB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;CAOzB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { WidgetAccountPanel } from './WidgetAccountPanel.js';
|
|
2
|
+
import { WidgetOrderTicket } from './WidgetOrderTicket.js';
|
|
3
|
+
import { WidgetBracketBar } from './WidgetBracketBar.js';
|
|
4
|
+
import { WidgetDepthLadder } from './WidgetDepthLadder.js';
|
|
5
|
+
import { DepthData } from '@tradecanvas/commons';
|
|
6
|
+
import { ChartWidget } from './ChartWidget.js';
|
|
7
|
+
/** What trading reads of the widget around it, and asks of it. */
|
|
8
|
+
export interface TradingHost {
|
|
9
|
+
readonly chart: ChartWidget['chart'];
|
|
10
|
+
readonly destroyed: ChartWidget['destroyed'];
|
|
11
|
+
readonly dock: ChartWidget['docking']['dock'];
|
|
12
|
+
readonly featureState: ChartWidget['featureState'];
|
|
13
|
+
formatAlertPrice: ChartWidget['formatAlertPrice'];
|
|
14
|
+
say: ChartWidget['say'];
|
|
15
|
+
readonly state: ChartWidget['state'];
|
|
16
|
+
readonly t: ChartWidget['t'];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Trading in the widget: the account panel, the order ticket and its rules, orders placed at
|
|
20
|
+
* a price on the chart, the depth ladder and the bracket bar.
|
|
21
|
+
*/
|
|
22
|
+
export declare class WidgetTrading {
|
|
23
|
+
private readonly host;
|
|
24
|
+
constructor(host: TradingHost);
|
|
25
|
+
accountPanel: WidgetAccountPanel | null;
|
|
26
|
+
orderTicket: WidgetOrderTicket | null;
|
|
27
|
+
accountFrame: number;
|
|
28
|
+
bracketBar: WidgetBracketBar | null;
|
|
29
|
+
depthLadder: WidgetDepthLadder | null;
|
|
30
|
+
/** Open or close the account panel (no argument: the other way from now). */
|
|
31
|
+
toggleAccountPanel(open?: boolean): void;
|
|
32
|
+
/** The order ticket, at a price from the chart (or the market). */
|
|
33
|
+
openOrderTicket(price?: number): void;
|
|
34
|
+
/** A market's rules for the order ticket (`setMarket`): its step, the day's limits, its lot. */
|
|
35
|
+
private orderRules;
|
|
36
|
+
/** Redraw the account panel once a frame at most (ticks, fills and order changes come in bursts). */
|
|
37
|
+
refreshAccountSoon(): void;
|
|
38
|
+
refreshAccount(): void;
|
|
39
|
+
/** Ask for a limit or stop order at `price` (one unit), and say so. */
|
|
40
|
+
placeOrderAt(kind: 'buyLimit' | 'sellLimit' | 'buyStop' | 'sellStop', price: number): void;
|
|
41
|
+
/** The depth ladder, a page of the dock: open or shut it (the Trade menu's entry). */
|
|
42
|
+
toggleLadder(): void;
|
|
43
|
+
/** Feed order-book depth to the chart overlay, depth ladder, and heatmap. */
|
|
44
|
+
setDepth(depth: DepthData | null): void;
|
|
45
|
+
/** Begin a draggable bracket order at the latest price and show the action bar. */
|
|
46
|
+
startBracket(side: 'buy' | 'sell'): void;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=WidgetTrading.d.ts.map
|