@funnest/charts-ui 0.11.38 → 0.11.40
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/components/settings-dialog.d.ts +2 -0
- package/dist/components/volume-settings.d.ts +14 -0
- package/dist/context.d.ts +2 -0
- package/dist/i18n.d.ts +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +145 -21
- package/dist/multi-chart.d.ts +3 -1
- package/dist/trading-chart.d.ts +15 -0
- package/package.json +2 -2
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { WidgetContext } from '../context.js';
|
|
2
|
+
/** Any CSS color (incl. var(--x) already resolved by the browser) → #rrggbb for <input type=color>. */
|
|
3
|
+
export declare function toHex(color: string): string;
|
|
2
4
|
/**
|
|
3
5
|
* Chart settings ("차트 설정"), in tabs, with a live demo chart beside them (above them on a
|
|
4
6
|
* phone) drawn with the settings as they are now. Changes apply to the chart immediately, like
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentChildren, JSX } from 'preact';
|
|
2
|
+
import type { WidgetContext } from '../context.js';
|
|
3
|
+
/**
|
|
4
|
+
* 거래량 설정, from the volume pane's ⚙: its moving averages (a period and a color each, up to
|
|
5
|
+
* VOLUME_MA_MAX) and the bars' colors. Changes show on the chart at once; 취소 puts back what was.
|
|
6
|
+
*/
|
|
7
|
+
export declare function VolumeSettings({ ctx, Dialog }: {
|
|
8
|
+
ctx: WidgetContext;
|
|
9
|
+
Dialog: (p: {
|
|
10
|
+
title: string;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
children: ComponentChildren;
|
|
13
|
+
}) => JSX.Element;
|
|
14
|
+
}): JSX.Element;
|
package/dist/context.d.ts
CHANGED
package/dist/i18n.d.ts
CHANGED
|
@@ -223,6 +223,10 @@ export declare const STRINGS: {
|
|
|
223
223
|
moveIndicatorDown: string;
|
|
224
224
|
textEditHint: string;
|
|
225
225
|
hideVolume: string;
|
|
226
|
+
volumeSettings: string;
|
|
227
|
+
volumeMa: string;
|
|
228
|
+
volumeMaNone: string;
|
|
229
|
+
addVolumeMa: string;
|
|
226
230
|
volumeDesc: string;
|
|
227
231
|
apply: string;
|
|
228
232
|
cancel: string;
|
|
@@ -594,6 +598,10 @@ export declare const STRINGS: {
|
|
|
594
598
|
moveIndicatorDown: string;
|
|
595
599
|
textEditHint: string;
|
|
596
600
|
hideVolume: string;
|
|
601
|
+
volumeSettings: string;
|
|
602
|
+
volumeMa: string;
|
|
603
|
+
volumeMaNone: string;
|
|
604
|
+
addVolumeMa: string;
|
|
597
605
|
volumeDesc: string;
|
|
598
606
|
apply: string;
|
|
599
607
|
cancel: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export type { MultiChart, MultiChartEvents, MultiChartOptions, MultiChartState,
|
|
|
9
9
|
export { LAYOUT_GROUPS, LAYOUTS, MAX_PANES, paneCount } from './layouts.js';
|
|
10
10
|
export type { LayoutId, SplitNode, SplitSizes } from './layouts.js';
|
|
11
11
|
export type { ContextMenuItem, ContextMenuItems, MenuIconName, DrawingAction, DrawingActions, IntervalGroup, PriceAxisActions, SettingsToggle, SettingsToggles, SettingsChoice, SettingsLink, SettingsSection, SettingsSections, LayoutSync, LegendValues, SearchCategory, SearchExchange, ToolsMenuItem, ToolsMenuItems } from './context.js';
|
|
12
|
-
export type { ColorScheme, TradingChart, TradingChartOptions, TradingChartSlots } from './trading-chart.js';
|
|
12
|
+
export type { ColorScheme, TradingChart, TradingChartOptions, TradingChartSlots, WidgetDialog } from './trading-chart.js';
|
|
13
13
|
export type { WidgetPreferences } from './shell.js';
|
|
14
14
|
export { resolutionLabel, STRINGS, stringsOf, type Strings } from './i18n.js';
|
package/dist/index.js
CHANGED
|
@@ -658,6 +658,10 @@ var STRINGS = {
|
|
|
658
658
|
moveIndicatorDown: "\uC544\uB798\uB85C \uC62E\uAE30\uAE30",
|
|
659
659
|
textEditHint: "Enter\uB85C \uC800\uC7A5 \xB7 Shift+Enter \uC904\uBC14\uAFC8 \xB7 Esc \uCDE8\uC18C",
|
|
660
660
|
hideVolume: "\uAC70\uB798\uB7C9 \uC228\uAE30\uAE30",
|
|
661
|
+
volumeSettings: "\uAC70\uB798\uB7C9 \uC124\uC815",
|
|
662
|
+
volumeMa: "\uC774\uB3D9\uD3C9\uADE0\uC120",
|
|
663
|
+
volumeMaNone: "\uAC70\uB798\uB7C9 \uB9C9\uB300 \uC704\uC5D0 \uD3C9\uADE0 \uAC70\uB798\uB7C9 \uC120\uC744 \uADF8\uB824\uC694.",
|
|
664
|
+
addVolumeMa: "\uC774\uB3D9\uD3C9\uADE0\uC120 \uCD94\uAC00",
|
|
661
665
|
volumeDesc: "\uBD09\uB9C8\uB2E4 \uAC70\uB798\uB41C \uC591 (\uAC00\uACA9 \uC544\uB798 \uC601\uC5ED)",
|
|
662
666
|
apply: "\uC801\uC6A9",
|
|
663
667
|
cancel: "\uCDE8\uC18C",
|
|
@@ -1031,6 +1035,10 @@ var STRINGS = {
|
|
|
1031
1035
|
moveIndicatorDown: "Move down",
|
|
1032
1036
|
textEditHint: "Enter to save \xB7 Shift+Enter for a new line \xB7 Esc to cancel",
|
|
1033
1037
|
hideVolume: "Hide volume",
|
|
1038
|
+
volumeSettings: "Volume settings",
|
|
1039
|
+
volumeMa: "Moving average",
|
|
1040
|
+
volumeMaNone: "Draws the average volume as a line over the volume bars.",
|
|
1041
|
+
addVolumeMa: "Add moving average",
|
|
1034
1042
|
volumeDesc: "How much traded in each bar (pane under the price)",
|
|
1035
1043
|
apply: "Apply",
|
|
1036
1044
|
cancel: "Cancel",
|
|
@@ -3729,6 +3737,8 @@ var CSS = (
|
|
|
3729
3737
|
border-radius: 6px;
|
|
3730
3738
|
}
|
|
3731
3739
|
.fnc-ind-title { color: var(--fnc-text-2); }
|
|
3740
|
+
.fnc-volume-ma { color: var(--fnc-text-2); white-space: nowrap; }
|
|
3741
|
+
.fnc-volume-ma b { font-weight: 600; }
|
|
3732
3742
|
.fnc-ind-hidden .fnc-ind-title { opacity: 0.5; text-decoration: line-through; }
|
|
3733
3743
|
.fnc-ind-eye { margin-left: -4px; }
|
|
3734
3744
|
.fnc-ind-hidden .fnc-ind-eye { color: var(--fnc-text-2); opacity: 0.7; }
|
|
@@ -5618,6 +5628,10 @@ function SettingsDialog({ ctx }) {
|
|
|
5618
5628
|
CANDLE_COLORS.map(colorRow),
|
|
5619
5629
|
/* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.settingVolume }),
|
|
5620
5630
|
VOLUME_COLORS.map(colorRow),
|
|
5631
|
+
/* @__PURE__ */ a3("div", { class: "fnc-row fnc-toggle-row", children: [
|
|
5632
|
+
/* @__PURE__ */ a3("span", { class: "fnc-toggle-label", children: t3.volumeMa }),
|
|
5633
|
+
/* @__PURE__ */ a3("button", { type: "button", class: "fnc-action fnc-app-link", onClick: () => ctx.store.set({ dialog: { kind: "volumeSettings" } }), children: settings.volumeMa.length ? settings.volumeMa.map((m3) => `MA${m3.period}`).join(" \xB7 ") : t3.addVolumeMa })
|
|
5634
|
+
] }),
|
|
5621
5635
|
/* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.settingsGrid }),
|
|
5622
5636
|
toggles(GRID)
|
|
5623
5637
|
] }),
|
|
@@ -5885,6 +5899,91 @@ function useSplitCount(ctx) {
|
|
|
5885
5899
|
return m3 ? paneCount(LAYOUTS[m3.layout]) : 0;
|
|
5886
5900
|
}
|
|
5887
5901
|
|
|
5902
|
+
// src/components/volume-settings.tsx
|
|
5903
|
+
import { VOLUME_MA_COLORS, VOLUME_MA_MAX, VOLUME_MA_PERIOD_MAX } from "@funnest/charts";
|
|
5904
|
+
var NEXT_PERIODS = [20, 5, 10, 60, 120];
|
|
5905
|
+
var hex62 = (c3) => /^#[0-9a-f]{6}/i.test(c3) ? c3.slice(0, 7) : toHex(c3);
|
|
5906
|
+
function VolumeSettings({ ctx, Dialog: Dialog2 }) {
|
|
5907
|
+
const t3 = stringsOf(ctx.store.get());
|
|
5908
|
+
const [before] = d2(() => {
|
|
5909
|
+
const s3 = ctx.chart.settings;
|
|
5910
|
+
return { volumeMa: s3.volumeMa, volumeUpColor: s3.volumeUpColor, volumeDownColor: s3.volumeDownColor };
|
|
5911
|
+
});
|
|
5912
|
+
const [settings, setSettings] = d2(ctx.chart.settings);
|
|
5913
|
+
A2(() => ctx.chart.on("settingsChange", setSettings), [ctx.chart]);
|
|
5914
|
+
const [typed, setTyped] = d2(() => settings.volumeMa.map((m3) => String(m3.period)));
|
|
5915
|
+
const lines = settings.volumeMa;
|
|
5916
|
+
const palette = ctx.chart.paletteInUse;
|
|
5917
|
+
const close = () => ctx.store.set({ dialog: null });
|
|
5918
|
+
const cancel = () => (ctx.chart.setSettings(before), close());
|
|
5919
|
+
const setLines = (next) => ctx.chart.setSettings({ volumeMa: next });
|
|
5920
|
+
const colorOf = (m3, i3) => m3.color ?? VOLUME_MA_COLORS[i3 % VOLUME_MA_COLORS.length];
|
|
5921
|
+
const add = () => {
|
|
5922
|
+
const used = new Set(lines.map((m3) => m3.period));
|
|
5923
|
+
const period = NEXT_PERIODS.find((p3) => !used.has(p3)) ?? Math.min(VOLUME_MA_PERIOD_MAX, (lines[lines.length - 1]?.period ?? 10) * 2);
|
|
5924
|
+
setLines([...lines, { period, color: null }]);
|
|
5925
|
+
setTyped([...typed.slice(0, lines.length), String(period)]);
|
|
5926
|
+
};
|
|
5927
|
+
const remove = (i3) => {
|
|
5928
|
+
setLines(lines.filter((_3, j2) => j2 !== i3));
|
|
5929
|
+
setTyped(typed.filter((_3, j2) => j2 !== i3));
|
|
5930
|
+
};
|
|
5931
|
+
const setPeriod = (i3, text) => {
|
|
5932
|
+
const digits = text.replace(/\D/g, "").slice(0, 3);
|
|
5933
|
+
setTyped(typed.map((x2, j2) => j2 === i3 ? digits : x2));
|
|
5934
|
+
const period = Number(digits);
|
|
5935
|
+
if (period >= 1) setLines(lines.map((m3, j2) => j2 === i3 ? { ...m3, period: Math.min(VOLUME_MA_PERIOD_MAX, period) } : m3));
|
|
5936
|
+
};
|
|
5937
|
+
return /* @__PURE__ */ a3(Dialog2, { title: t3.volumeSettings, onClose: cancel, children: /* @__PURE__ */ a3("form", { class: "fnc-form", onSubmit: (e3) => (e3.preventDefault(), close()), children: [
|
|
5938
|
+
/* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.volumeMa }),
|
|
5939
|
+
/* @__PURE__ */ a3("div", { class: "fnc-rows", children: [
|
|
5940
|
+
lines.length === 0 && /* @__PURE__ */ a3("p", { class: "fnc-hint", children: t3.volumeMaNone }),
|
|
5941
|
+
lines.map((m3, i3) => /* @__PURE__ */ a3("div", { class: "fnc-row", children: [
|
|
5942
|
+
/* @__PURE__ */ a3("span", { class: "fnc-row-label", children: t3.period }),
|
|
5943
|
+
/* @__PURE__ */ a3(
|
|
5944
|
+
"input",
|
|
5945
|
+
{
|
|
5946
|
+
class: "fnc-input fnc-input-period",
|
|
5947
|
+
inputMode: "numeric",
|
|
5948
|
+
value: typed[i3] ?? String(m3.period),
|
|
5949
|
+
"aria-label": `${t3.volumeMa} ${i3 + 1} ${t3.period}`,
|
|
5950
|
+
onInput: (e3) => setPeriod(i3, e3.currentTarget.value),
|
|
5951
|
+
onBlur: () => setTyped(typed.map((x2, j2) => j2 === i3 ? String(lines[i3].period) : x2))
|
|
5952
|
+
}
|
|
5953
|
+
),
|
|
5954
|
+
/* @__PURE__ */ a3(
|
|
5955
|
+
ColorPicker,
|
|
5956
|
+
{
|
|
5957
|
+
class: "fnc-color fnc-color-btn",
|
|
5958
|
+
style: { background: hex62(colorOf(m3, i3)) },
|
|
5959
|
+
value: hex62(colorOf(m3, i3)),
|
|
5960
|
+
label: `${t3.volumeMa} ${i3 + 1} ${t3.color}`,
|
|
5961
|
+
t: t3,
|
|
5962
|
+
onPick: (color) => setLines(lines.map((x2, j2) => j2 === i3 ? { ...x2, color } : x2))
|
|
5963
|
+
}
|
|
5964
|
+
),
|
|
5965
|
+
/* @__PURE__ */ a3("button", { type: "button", class: "fnc-ind-btn", "aria-label": `${t3.volumeMa} ${i3 + 1} ${t3.removePeriod}`, "data-tip": t3.removePeriod, onClick: () => remove(i3), children: /* @__PURE__ */ a3(SmallCloseIcon, {}) })
|
|
5966
|
+
] })),
|
|
5967
|
+
lines.length < VOLUME_MA_MAX && /* @__PURE__ */ a3("button", { type: "button", class: "fnc-add-row", onClick: add, children: [
|
|
5968
|
+
"+ ",
|
|
5969
|
+
t3.addVolumeMa
|
|
5970
|
+
] })
|
|
5971
|
+
] }),
|
|
5972
|
+
/* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.color }),
|
|
5973
|
+
[
|
|
5974
|
+
["volumeUpColor", t3.settingVolumeUp, palette.volumeUp],
|
|
5975
|
+
["volumeDownColor", t3.settingVolumeDown, palette.volumeDown]
|
|
5976
|
+
].map(([key, label, shown]) => /* @__PURE__ */ a3("div", { class: "fnc-row", children: [
|
|
5977
|
+
/* @__PURE__ */ a3("span", { class: "fnc-row-label fnc-row-label-wide", children: label }),
|
|
5978
|
+
/* @__PURE__ */ a3(ColorPicker, { class: "fnc-color fnc-color-btn", style: { background: hex62(shown) }, value: hex62(shown), label, t: t3, onPick: (c3) => ctx.chart.setSettings({ [key]: c3 }) })
|
|
5979
|
+
] })),
|
|
5980
|
+
/* @__PURE__ */ a3("div", { class: "fnc-form-actions", children: [
|
|
5981
|
+
/* @__PURE__ */ a3("button", { type: "button", class: "fnc-action", onClick: cancel, children: t3.cancel }),
|
|
5982
|
+
/* @__PURE__ */ a3("button", { type: "submit", class: "fnc-action fnc-action-primary", children: t3.ok })
|
|
5983
|
+
] })
|
|
5984
|
+
] }) });
|
|
5985
|
+
}
|
|
5986
|
+
|
|
5888
5987
|
// src/components/indicator-dialogs.tsx
|
|
5889
5988
|
function Dialog({ title, onClose, children, wide }) {
|
|
5890
5989
|
const ref = T2(null);
|
|
@@ -5998,6 +6097,7 @@ function Dialogs({ ctx }) {
|
|
|
5998
6097
|
if (dialog?.kind === "indicators") return dialog.on ? /* @__PURE__ */ a3(IndicatorOnPicker, { ctx, on: dialog.on }) : /* @__PURE__ */ a3(IndicatorPicker, { ctx });
|
|
5999
6098
|
if (dialog?.kind === "indicatorSettings") return /* @__PURE__ */ a3(IndicatorSettings, { ctx, id: dialog.id, Dialog }, dialog.id);
|
|
6000
6099
|
if (dialog?.kind === "chartSettings") return /* @__PURE__ */ a3(SettingsDialog, { ctx });
|
|
6100
|
+
if (dialog?.kind === "volumeSettings") return /* @__PURE__ */ a3(VolumeSettings, { ctx, Dialog });
|
|
6001
6101
|
if (dialog?.kind === "goToDate") return /* @__PURE__ */ a3(GoToDateDialog, { ctx });
|
|
6002
6102
|
return null;
|
|
6003
6103
|
}
|
|
@@ -7138,27 +7238,45 @@ function AppItem({ ctx, item }) {
|
|
|
7138
7238
|
] })
|
|
7139
7239
|
] });
|
|
7140
7240
|
}
|
|
7141
|
-
function VolumeItem({ ctx, value }) {
|
|
7241
|
+
function VolumeItem({ ctx, value, averages, locale }) {
|
|
7142
7242
|
const t3 = stringsOf(ctx.store.get());
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7243
|
+
const open = () => ctx.store.set({ dialog: { kind: "volumeSettings" } });
|
|
7244
|
+
return /* @__PURE__ */ a3(
|
|
7245
|
+
"div",
|
|
7246
|
+
{
|
|
7247
|
+
class: "fnc-ind fnc-volume-item",
|
|
7248
|
+
role: "button",
|
|
7249
|
+
tabIndex: 0,
|
|
7250
|
+
"aria-label": t3.volumeSettings,
|
|
7251
|
+
onClick: (e3) => !e3.target.closest(".fnc-ind-actions") && open(),
|
|
7252
|
+
onKeyDown: (e3) => e3.key === "Enter" && open(),
|
|
7253
|
+
children: [
|
|
7254
|
+
/* @__PURE__ */ a3("span", { class: "fnc-ind-title", children: t3.settingVolume }),
|
|
7255
|
+
value !== null && /* @__PURE__ */ a3("b", { class: "fnc-flat", children: value }),
|
|
7256
|
+
averages.map((a4) => /* @__PURE__ */ a3("span", { class: "fnc-volume-ma", children: [
|
|
7257
|
+
"MA",
|
|
7258
|
+
a4.period,
|
|
7259
|
+
" ",
|
|
7260
|
+
/* @__PURE__ */ a3("b", { style: { color: a4.color }, children: a4.value === null ? "\u2014" : formatCompact(a4.value, locale) })
|
|
7261
|
+
] })),
|
|
7262
|
+
/* @__PURE__ */ a3("span", { class: "fnc-ind-actions", children: [
|
|
7263
|
+
ctx.chart.canMoveIndicator("volume", -1) && /* @__PURE__ */ a3("button", { class: "fnc-ind-btn", "data-tip": t3.moveIndicatorUp, "aria-label": `${t3.settingVolume} ${t3.moveIndicatorUp}`, onClick: () => ctx.chart.moveIndicator("volume", -1), children: /* @__PURE__ */ a3(ChevronUpIcon, {}) }),
|
|
7264
|
+
ctx.chart.canMoveIndicator("volume", 1) && /* @__PURE__ */ a3("button", { class: "fnc-ind-btn", "data-tip": t3.moveIndicatorDown, "aria-label": `${t3.settingVolume} ${t3.moveIndicatorDown}`, onClick: () => ctx.chart.moveIndicator("volume", 1), children: /* @__PURE__ */ a3(ChevronDownIcon, {}) }),
|
|
7265
|
+
/* @__PURE__ */ a3(
|
|
7266
|
+
"button",
|
|
7267
|
+
{
|
|
7268
|
+
class: "fnc-ind-btn",
|
|
7269
|
+
"data-tip": t3.volumeSettings,
|
|
7270
|
+
"aria-label": t3.volumeSettings,
|
|
7271
|
+
onClick: () => ctx.store.set({ dialog: { kind: "volumeSettings" } }),
|
|
7272
|
+
children: /* @__PURE__ */ a3(GearIcon, {})
|
|
7273
|
+
}
|
|
7274
|
+
),
|
|
7275
|
+
/* @__PURE__ */ a3("button", { class: "fnc-ind-btn", "data-tip": t3.hideVolume, "aria-label": t3.hideVolume, onClick: () => ctx.chart.setVolumeVisible(false), children: /* @__PURE__ */ a3(SmallCloseIcon, {}) })
|
|
7276
|
+
] })
|
|
7277
|
+
]
|
|
7278
|
+
}
|
|
7279
|
+
);
|
|
7162
7280
|
}
|
|
7163
7281
|
function Legend({ ctx }) {
|
|
7164
7282
|
const s3 = useStore(ctx.store);
|
|
@@ -7289,7 +7407,7 @@ function Legend({ ctx }) {
|
|
|
7289
7407
|
!collapsed && s3.legendItems.map((item) => /* @__PURE__ */ a3(AppItem, { ctx, item })),
|
|
7290
7408
|
overlayItems.length + s3.legendItems.length > 0 && (collapsed ? /* @__PURE__ */ a3("button", { class: "fnc-ind-handle", "aria-expanded": "false", "aria-label": t3.expand, "data-tip": t3.expand, onClick: () => setCollapsed(false), children: /* @__PURE__ */ a3("span", {}) }) : /* @__PURE__ */ a3("button", { class: "fnc-ind-collapse", "aria-expanded": "true", "aria-label": t3.collapse, "data-tip": t3.collapse, onClick: () => setCollapsed(true), children: /* @__PURE__ */ a3(ChevronUpIcon, {}) }))
|
|
7291
7409
|
] }),
|
|
7292
|
-
volumePane && /* @__PURE__ */ a3("div", { class: "fnc-legend fnc-pane-legend", style: { top: `${volumePane.top + 4}px` }, children: /* @__PURE__ */ a3(VolumeItem, { ctx, value: bar?.volume !== void 0 ? formatCompact(bar.volume, s3.locale) : null }) }),
|
|
7410
|
+
volumePane && /* @__PURE__ */ a3("div", { class: "fnc-legend fnc-pane-legend", style: { top: `${volumePane.top + 4}px` }, children: /* @__PURE__ */ a3(VolumeItem, { ctx, value: bar?.volume !== void 0 ? formatCompact(bar.volume, s3.locale) : null, averages: ctx.chart.volumeAverages(hover?.index), locale: s3.locale }) }),
|
|
7293
7411
|
paneLegends.map(
|
|
7294
7412
|
({ pane, item, kids }) => item && /* @__PURE__ */ a3("div", { class: tracking.current ? "fnc-legend fnc-pane-legend is-tracking" : "fnc-legend fnc-pane-legend", style: { top: `${pane.top + 4}px` }, children: [
|
|
7295
7413
|
/* @__PURE__ */ a3(IndicatorItem, { ctx, item, values: showValues }),
|
|
@@ -7704,6 +7822,10 @@ function createPane(shell, config) {
|
|
|
7704
7822
|
}
|
|
7705
7823
|
|
|
7706
7824
|
// src/trading-chart.tsx
|
|
7825
|
+
function openWidgetDialog(pane, kind) {
|
|
7826
|
+
if (kind === "volumeSettings" && !pane.chart.settings.volume) pane.chart.setSettings({ volume: true });
|
|
7827
|
+
pane.store.set({ dialog: { kind } });
|
|
7828
|
+
}
|
|
7707
7829
|
var DEFAULT_INTERVAL_GROUPS = [
|
|
7708
7830
|
{ id: "ticks", intervals: ["10T", "100T", "1000T"] },
|
|
7709
7831
|
{ id: "minutes", intervals: ["1", "5", "15", "30"] },
|
|
@@ -7798,6 +7920,7 @@ function createTradingChart(container, options) {
|
|
|
7798
7920
|
return {
|
|
7799
7921
|
chart: pane.chart,
|
|
7800
7922
|
slots: shell.slots,
|
|
7923
|
+
openDialog: (kind) => openWidgetDialog(pane, kind),
|
|
7801
7924
|
setSymbol: (sym, res) => pane.load(sym, res ?? pane.store.get().resolution),
|
|
7802
7925
|
setResolution: (res) => {
|
|
7803
7926
|
const current = pane.store.get().symbol;
|
|
@@ -8246,6 +8369,7 @@ function createMultiChart(container, options) {
|
|
|
8246
8369
|
get sync() {
|
|
8247
8370
|
return { ...store.get().sync };
|
|
8248
8371
|
},
|
|
8372
|
+
openDialog: (kind) => openWidgetDialog(panes[store.get().active], kind),
|
|
8249
8373
|
setLayout,
|
|
8250
8374
|
setSync,
|
|
8251
8375
|
activate,
|
package/dist/multi-chart.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type Chart, type ChartState, type Locale, type Resolution, type ThemeTo
|
|
|
3
3
|
import type { LayoutSync } from './context.js';
|
|
4
4
|
import { type LayoutId, type SplitSizes } from './layouts.js';
|
|
5
5
|
import { type ColorScheme, type TradingChartSlots, type WidgetPreferences } from './shell.js';
|
|
6
|
-
import { type TradingChartOptions } from './trading-chart.js';
|
|
6
|
+
import { type WidgetDialog, type TradingChartOptions } from './trading-chart.js';
|
|
7
7
|
export interface PaneSpec {
|
|
8
8
|
symbol: string;
|
|
9
9
|
/** Default: the widget's `resolution`, else '1D'. */
|
|
@@ -56,6 +56,8 @@ export interface MultiChart {
|
|
|
56
56
|
readonly activeIndex: number;
|
|
57
57
|
readonly layout: LayoutId;
|
|
58
58
|
readonly sync: LayoutSync;
|
|
59
|
+
/** Opens 차트 설정, 거래량 설정, the indicator picker or 날짜로 이동 on the active pane. */
|
|
60
|
+
openDialog(kind: WidgetDialog): void;
|
|
59
61
|
setLayout(layout: LayoutId): void;
|
|
60
62
|
setSync(patch: Partial<LayoutSync>): void;
|
|
61
63
|
activate(index: number): void;
|
package/dist/trading-chart.d.ts
CHANGED
|
@@ -4,6 +4,19 @@ import type { ContextMenuItems, DrawingActions, IntervalGroup, LegendValues, Pri
|
|
|
4
4
|
import type { Strings } from './i18n.js';
|
|
5
5
|
import { type ColorScheme, type TradingChartSlots } from './shell.js';
|
|
6
6
|
export type { ColorScheme, TradingChartSlots } from './shell.js';
|
|
7
|
+
/** The widget's own windows an app can open (its search, a menu of its own): see `openDialog`. */
|
|
8
|
+
export type WidgetDialog = 'chartSettings' | 'volumeSettings' | 'indicators' | 'goToDate';
|
|
9
|
+
/** Opens one of the widget's windows on a pane; 거래량 설정 shows the volume pane first if it's hidden. */
|
|
10
|
+
export declare function openWidgetDialog(pane: {
|
|
11
|
+
chart: Chart;
|
|
12
|
+
store: {
|
|
13
|
+
set(patch: {
|
|
14
|
+
dialog: {
|
|
15
|
+
kind: WidgetDialog;
|
|
16
|
+
};
|
|
17
|
+
}): void;
|
|
18
|
+
};
|
|
19
|
+
}, kind: WidgetDialog): void;
|
|
7
20
|
/** Interval menu: 틱 | 분 | 시간 | 일. '12M' is shown as 1년. 틱 shows only on a feed that lists tick intervals. */
|
|
8
21
|
export declare const DEFAULT_INTERVAL_GROUPS: readonly IntervalGroup[];
|
|
9
22
|
/** Toolbar chips until the user stars their own. */
|
|
@@ -103,6 +116,8 @@ export interface TradingChart {
|
|
|
103
116
|
/** The underlying engine, for anything the widget doesn't wrap. */
|
|
104
117
|
readonly chart: Chart;
|
|
105
118
|
readonly slots: TradingChartSlots;
|
|
119
|
+
/** Opens 차트 설정, 거래량 설정, the indicator picker or 날짜로 이동 (e.g. from the app's own search). */
|
|
120
|
+
openDialog(kind: WidgetDialog): void;
|
|
106
121
|
setSymbol(symbol: string, resolution?: Resolution): Promise<void>;
|
|
107
122
|
setResolution(resolution: Resolution): Promise<void>;
|
|
108
123
|
setLocale(locale: Locale): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funnest/charts-ui",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.40",
|
|
4
4
|
"description": "Pro trading UI (toolbar, drawing tools, sheets) for Funnest Charts. Framework-agnostic.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chart",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"NOTICE"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@funnest/charts": "0.11.
|
|
45
|
+
"@funnest/charts": "0.11.40"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"preact": "^11.2.0"
|