@funnest/charts-ui 0.8.6 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/context.d.ts +12 -0
- package/dist/i18n.d.ts +16 -0
- package/dist/icons.d.ts +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +135 -9
- package/dist/pane.d.ts +2 -1
- package/dist/trading-chart.d.ts +3 -1
- package/package.json +2 -2
package/dist/context.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export interface UiState {
|
|
|
29
29
|
/** Open dialog: indicator picker, or settings for one indicator id. */
|
|
30
30
|
dialog: {
|
|
31
31
|
kind: 'indicators';
|
|
32
|
+
on?: string;
|
|
32
33
|
} | {
|
|
33
34
|
kind: 'indicatorSettings';
|
|
34
35
|
id: string;
|
|
@@ -101,6 +102,16 @@ export interface ToolsMenuItem {
|
|
|
101
102
|
disabled?: boolean;
|
|
102
103
|
onSelect(chart: Chart): void;
|
|
103
104
|
}
|
|
105
|
+
/** A switch an app adds to 차트 설정 (e.g. extended hours for a stock), under its own heading. */
|
|
106
|
+
export interface SettingsToggle {
|
|
107
|
+
label: string;
|
|
108
|
+
/** A line under the label. */
|
|
109
|
+
hint?: string;
|
|
110
|
+
checked: boolean;
|
|
111
|
+
onChange(checked: boolean): void;
|
|
112
|
+
}
|
|
113
|
+
/** The app's switches for 차트 설정, asked when it opens (for the pane's chart); none: no section. */
|
|
114
|
+
export type SettingsToggles = (chart: Chart) => SettingsToggle[];
|
|
104
115
|
/** The app's rows for the 도구 menu, asked each time it opens (for the pane's chart). */
|
|
105
116
|
export type ToolsMenuItems = (chart: Chart) => ToolsMenuItem[];
|
|
106
117
|
/**
|
|
@@ -152,6 +163,7 @@ export interface WidgetContext {
|
|
|
152
163
|
priceAxisActions: PriceAxisActions | undefined;
|
|
153
164
|
drawingActions: DrawingActions | undefined;
|
|
154
165
|
toolsMenuItems: ToolsMenuItems | undefined;
|
|
166
|
+
settingsToggles: SettingsToggles | undefined;
|
|
155
167
|
legendValues: LegendValues;
|
|
156
168
|
/** The app's own indicator browser for the 지표 button (instead of the built-in picker). */
|
|
157
169
|
onIndicatorsClick: ((chart: Chart) => void) | undefined;
|
package/dist/i18n.d.ts
CHANGED
|
@@ -28,6 +28,11 @@ export declare const STRINGS: {
|
|
|
28
28
|
stepLine: string;
|
|
29
29
|
baseline: string;
|
|
30
30
|
area: string;
|
|
31
|
+
volumeCandles: string;
|
|
32
|
+
renko: string;
|
|
33
|
+
kagi: string;
|
|
34
|
+
lineBreak: string;
|
|
35
|
+
pointFigure: string;
|
|
31
36
|
drawingTools: string;
|
|
32
37
|
cursor: string;
|
|
33
38
|
trendline: string;
|
|
@@ -53,6 +58,7 @@ export declare const STRINGS: {
|
|
|
53
58
|
settingsTheme: string;
|
|
54
59
|
settingsCandles: string;
|
|
55
60
|
settingsDisplay: string;
|
|
61
|
+
settingsSymbol: string;
|
|
56
62
|
settingsGrid: string;
|
|
57
63
|
settingUpColor: string;
|
|
58
64
|
settingDownColor: string;
|
|
@@ -114,6 +120,8 @@ export declare const STRINGS: {
|
|
|
114
120
|
addIndicator: string;
|
|
115
121
|
indicatorSettings: string;
|
|
116
122
|
removeIndicator: string;
|
|
123
|
+
addIndicatorOn: string;
|
|
124
|
+
onIndicatorSection: string;
|
|
117
125
|
moveIndicatorUp: string;
|
|
118
126
|
moveIndicatorDown: string;
|
|
119
127
|
textEditHint: string;
|
|
@@ -227,6 +235,11 @@ export declare const STRINGS: {
|
|
|
227
235
|
stepLine: string;
|
|
228
236
|
baseline: string;
|
|
229
237
|
area: string;
|
|
238
|
+
volumeCandles: string;
|
|
239
|
+
renko: string;
|
|
240
|
+
kagi: string;
|
|
241
|
+
lineBreak: string;
|
|
242
|
+
pointFigure: string;
|
|
230
243
|
drawingTools: string;
|
|
231
244
|
cursor: string;
|
|
232
245
|
trendline: string;
|
|
@@ -252,6 +265,7 @@ export declare const STRINGS: {
|
|
|
252
265
|
settingsTheme: string;
|
|
253
266
|
settingsCandles: string;
|
|
254
267
|
settingsDisplay: string;
|
|
268
|
+
settingsSymbol: string;
|
|
255
269
|
settingsGrid: string;
|
|
256
270
|
settingUpColor: string;
|
|
257
271
|
settingDownColor: string;
|
|
@@ -313,6 +327,8 @@ export declare const STRINGS: {
|
|
|
313
327
|
addIndicator: string;
|
|
314
328
|
indicatorSettings: string;
|
|
315
329
|
removeIndicator: string;
|
|
330
|
+
addIndicatorOn: string;
|
|
331
|
+
onIndicatorSection: string;
|
|
316
332
|
moveIndicatorUp: string;
|
|
317
333
|
moveIndicatorDown: string;
|
|
318
334
|
textEditHint: string;
|
package/dist/icons.d.ts
CHANGED
|
@@ -27,8 +27,14 @@ export declare const OhlcBarsIcon: () => import("preact").JSX.Element;
|
|
|
27
27
|
export declare const StepLineIcon: () => import("preact").JSX.Element;
|
|
28
28
|
export declare const BaselineIcon: () => import("preact").JSX.Element;
|
|
29
29
|
export declare const AreaChartIcon: () => import("preact").JSX.Element;
|
|
30
|
+
export declare const VolumeCandlesIcon: () => import("preact").JSX.Element;
|
|
31
|
+
export declare const RenkoIcon: () => import("preact").JSX.Element;
|
|
32
|
+
export declare const KagiIcon: () => import("preact").JSX.Element;
|
|
33
|
+
export declare const LineBreakIcon: () => import("preact").JSX.Element;
|
|
34
|
+
export declare const PointFigureIcon: () => import("preact").JSX.Element;
|
|
30
35
|
export declare const IndicatorIcon: () => import("preact").JSX.Element;
|
|
31
36
|
export declare const GearIcon: () => import("preact").JSX.Element;
|
|
37
|
+
export declare const SmallPlusIcon: () => import("preact").JSX.Element;
|
|
32
38
|
export declare const SmallCloseIcon: () => import("preact").JSX.Element;
|
|
33
39
|
export declare const EyeIcon: () => import("preact").JSX.Element;
|
|
34
40
|
export declare const EyeOffIcon: () => import("preact").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ export { createMultiChart } from './multi-chart.js';
|
|
|
8
8
|
export type { MultiChart, MultiChartEvents, MultiChartOptions, MultiChartState, PaneSpec } from './multi-chart.js';
|
|
9
9
|
export { LAYOUT_GROUPS, LAYOUTS, MAX_PANES, paneCount } from './layouts.js';
|
|
10
10
|
export type { LayoutId, SplitNode, SplitSizes } from './layouts.js';
|
|
11
|
-
export type { ContextMenuItem, ContextMenuItems, DrawingAction, DrawingActions, IntervalGroup, PriceAxisActions, LayoutSync, LegendValues, SearchCategory, SearchExchange, ToolsMenuItem, ToolsMenuItems } from './context.js';
|
|
11
|
+
export type { ContextMenuItem, ContextMenuItems, DrawingAction, DrawingActions, IntervalGroup, PriceAxisActions, SettingsToggle, SettingsToggles, LayoutSync, LegendValues, SearchCategory, SearchExchange, ToolsMenuItem, ToolsMenuItems } from './context.js';
|
|
12
12
|
export type { ColorScheme, TradingChart, TradingChartOptions, TradingChartSlots } from './trading-chart.js';
|
|
13
13
|
export { resolutionLabel, STRINGS, stringsOf, type Strings } from './i18n.js';
|
package/dist/index.js
CHANGED
|
@@ -454,6 +454,11 @@ var STRINGS = {
|
|
|
454
454
|
stepLine: "\uACC4\uB2E8\uC120",
|
|
455
455
|
baseline: "\uBCA0\uC774\uC2A4\uB77C\uC778",
|
|
456
456
|
area: "\uC601\uC5ED",
|
|
457
|
+
volumeCandles: "\uAC70\uB798\uB7C9 \uCE94\uB4E4",
|
|
458
|
+
renko: "\uB80C\uCF54",
|
|
459
|
+
kagi: "\uCE74\uAE30",
|
|
460
|
+
lineBreak: "\uB77C\uC778 \uBE0C\uB808\uC774\uD06C",
|
|
461
|
+
pointFigure: "P&F",
|
|
457
462
|
drawingTools: "\uADF8\uB9AC\uAE30 \uB3C4\uAD6C",
|
|
458
463
|
cursor: "\uCEE4\uC11C",
|
|
459
464
|
trendline: "\uCD94\uC138\uC120",
|
|
@@ -479,6 +484,7 @@ var STRINGS = {
|
|
|
479
484
|
settingsTheme: "\uD14C\uB9C8",
|
|
480
485
|
settingsCandles: "\uCE94\uB4E4",
|
|
481
486
|
settingsDisplay: "\uD45C\uC2DC",
|
|
487
|
+
settingsSymbol: "\uC774 \uC885\uBAA9",
|
|
482
488
|
settingsGrid: "\uACA9\uC790",
|
|
483
489
|
settingUpColor: "\uC0C1\uC2B9 \uC0C9",
|
|
484
490
|
settingDownColor: "\uD558\uB77D \uC0C9",
|
|
@@ -540,6 +546,8 @@ var STRINGS = {
|
|
|
540
546
|
addIndicator: "\uC9C0\uD45C \uCD94\uAC00",
|
|
541
547
|
indicatorSettings: "\uC9C0\uD45C \uC124\uC815",
|
|
542
548
|
removeIndicator: "\uC9C0\uD45C \uC0AD\uC81C",
|
|
549
|
+
addIndicatorOn: "\uC774 \uC9C0\uD45C \uC704\uC5D0 \uC9C0\uD45C \uCD94\uAC00",
|
|
550
|
+
onIndicatorSection: "{name} \uC704\uC5D0 \uD45C\uC2DC",
|
|
543
551
|
moveIndicatorUp: "\uC704\uB85C \uC62E\uAE30\uAE30",
|
|
544
552
|
moveIndicatorDown: "\uC544\uB798\uB85C \uC62E\uAE30\uAE30",
|
|
545
553
|
textEditHint: "Enter\uB85C \uC800\uC7A5 \xB7 Shift+Enter \uC904\uBC14\uAFC8 \xB7 Esc \uCDE8\uC18C",
|
|
@@ -655,6 +663,11 @@ var STRINGS = {
|
|
|
655
663
|
stepLine: "Step line",
|
|
656
664
|
baseline: "Baseline",
|
|
657
665
|
area: "Area",
|
|
666
|
+
volumeCandles: "Volume candles",
|
|
667
|
+
renko: "Renko",
|
|
668
|
+
kagi: "Kagi",
|
|
669
|
+
lineBreak: "Line break",
|
|
670
|
+
pointFigure: "Point & figure",
|
|
658
671
|
drawingTools: "Drawing tools",
|
|
659
672
|
cursor: "Cursor",
|
|
660
673
|
trendline: "Trend line",
|
|
@@ -680,6 +693,7 @@ var STRINGS = {
|
|
|
680
693
|
settingsTheme: "Theme",
|
|
681
694
|
settingsCandles: "Candles",
|
|
682
695
|
settingsDisplay: "Display",
|
|
696
|
+
settingsSymbol: "This symbol",
|
|
683
697
|
settingsGrid: "Grid",
|
|
684
698
|
settingUpColor: "Up color",
|
|
685
699
|
settingDownColor: "Down color",
|
|
@@ -741,6 +755,8 @@ var STRINGS = {
|
|
|
741
755
|
addIndicator: "Add indicator",
|
|
742
756
|
indicatorSettings: "Indicator settings",
|
|
743
757
|
removeIndicator: "Remove indicator",
|
|
758
|
+
addIndicatorOn: "Add indicator on this",
|
|
759
|
+
onIndicatorSection: "Drawn on {name}",
|
|
744
760
|
moveIndicatorUp: "Move up",
|
|
745
761
|
moveIndicatorDown: "Move down",
|
|
746
762
|
textEditHint: "Enter to save \xB7 Shift+Enter for a new line \xB7 Esc to cancel",
|
|
@@ -933,6 +949,34 @@ var AreaChartIcon = () => /* @__PURE__ */ a3(Icon, { children: [
|
|
|
933
949
|
/* @__PURE__ */ a3("path", { d: "M3 14l4.5-5 3.5 3 6-7" }),
|
|
934
950
|
/* @__PURE__ */ a3("path", { d: "M3 14l4.5-5 3.5 3 6-7V17H3z", fill: "currentColor", "fill-opacity": "0.25", stroke: "none" })
|
|
935
951
|
] });
|
|
952
|
+
var VolumeCandlesIcon = () => /* @__PURE__ */ a3(Icon, { children: [
|
|
953
|
+
/* @__PURE__ */ a3("path", { d: "M4.5 4v12M10 3v14M15.5 6v9" }),
|
|
954
|
+
/* @__PURE__ */ a3("rect", { x: "3.6", y: "7", width: "1.8", height: "5", rx: "0.5", fill: "currentColor" }),
|
|
955
|
+
/* @__PURE__ */ a3("rect", { x: "7", y: "6", width: "6", height: "7", rx: "0.8", fill: "currentColor" }),
|
|
956
|
+
/* @__PURE__ */ a3("rect", { x: "14", y: "8", width: "3", height: "4", rx: "0.6" })
|
|
957
|
+
] });
|
|
958
|
+
var RenkoIcon = () => /* @__PURE__ */ a3(Icon, { children: [
|
|
959
|
+
/* @__PURE__ */ a3("rect", { x: "2.5", y: "11", width: "4", height: "4", rx: "0.5", fill: "currentColor" }),
|
|
960
|
+
/* @__PURE__ */ a3("rect", { x: "7.5", y: "7", width: "4", height: "4", rx: "0.5", fill: "currentColor" }),
|
|
961
|
+
/* @__PURE__ */ a3("rect", { x: "12.5", y: "3", width: "4", height: "4", rx: "0.5", fill: "currentColor" }),
|
|
962
|
+
/* @__PURE__ */ a3("rect", { x: "12.5", y: "7.5", width: "4", height: "4", rx: "0.5" })
|
|
963
|
+
] });
|
|
964
|
+
var KagiIcon = () => /* @__PURE__ */ a3(Icon, { children: [
|
|
965
|
+
/* @__PURE__ */ a3("path", { d: "M3 15V8h4v5h4V4h5v8" }),
|
|
966
|
+
/* @__PURE__ */ a3("path", { d: "M11 4v5", "stroke-width": "2.8" })
|
|
967
|
+
] });
|
|
968
|
+
var LineBreakIcon = () => /* @__PURE__ */ a3(Icon, { children: [
|
|
969
|
+
/* @__PURE__ */ a3("rect", { x: "2.5", y: "11", width: "3.5", height: "5", rx: "0.5", fill: "currentColor" }),
|
|
970
|
+
/* @__PURE__ */ a3("rect", { x: "6.5", y: "6", width: "3.5", height: "5", rx: "0.5", fill: "currentColor" }),
|
|
971
|
+
/* @__PURE__ */ a3("rect", { x: "10.5", y: "3", width: "3.5", height: "3", rx: "0.5", fill: "currentColor" }),
|
|
972
|
+
/* @__PURE__ */ a3("rect", { x: "14.5", y: "3", width: "3.5", height: "9", rx: "0.5" })
|
|
973
|
+
] });
|
|
974
|
+
var PointFigureIcon = () => /* @__PURE__ */ a3(Icon, { children: [
|
|
975
|
+
/* @__PURE__ */ a3("path", { d: "M3 12l3 3M6 12l-3 3M3 8l3 3M6 8l-3 3M3 4l3 3M6 4l-3 3", "stroke-width": "1.3" }),
|
|
976
|
+
/* @__PURE__ */ a3("circle", { cx: "11", cy: "7.5", r: "1.6" }),
|
|
977
|
+
/* @__PURE__ */ a3("circle", { cx: "11", cy: "11.5", r: "1.6" }),
|
|
978
|
+
/* @__PURE__ */ a3("path", { d: "M14 10l3 3M17 10l-3 3M14 6l3 3M17 6l-3 3", "stroke-width": "1.3" })
|
|
979
|
+
] });
|
|
936
980
|
var IndicatorIcon = () => /* @__PURE__ */ a3(Icon, { children: [
|
|
937
981
|
/* @__PURE__ */ a3("path", { d: "M3 15.5l4-5 3 2.5 3.5-5L17 11" }),
|
|
938
982
|
/* @__PURE__ */ a3("path", { d: "M3 4.5v11.5h14" })
|
|
@@ -941,6 +985,7 @@ var GearIcon = () => /* @__PURE__ */ a3(Icon, { size: 14, children: [
|
|
|
941
985
|
/* @__PURE__ */ a3("circle", { cx: "10", cy: "10", r: "2.4" }),
|
|
942
986
|
/* @__PURE__ */ a3("path", { d: "M10 3v2M10 15v2M3 10h2M15 10h2M5 5l1.4 1.4M13.6 13.6L15 15M5 15l1.4-1.4M13.6 6.4L15 5" })
|
|
943
987
|
] });
|
|
988
|
+
var SmallPlusIcon = () => /* @__PURE__ */ a3(Icon, { size: 14, children: /* @__PURE__ */ a3("path", { d: "M5 10h10M10 5v10" }) });
|
|
944
989
|
var SmallCloseIcon = () => /* @__PURE__ */ a3(Icon, { size: 14, children: /* @__PURE__ */ a3("path", { d: "M6 6l8 8M14 6l-8 8" }) });
|
|
945
990
|
var EyeIcon = () => /* @__PURE__ */ a3(Icon, { size: 14, children: [
|
|
946
991
|
/* @__PURE__ */ a3("path", { d: "M2 10s3-5.5 8-5.5S18 10 18 10s-3 5.5-8 5.5S2 10 2 10z" }),
|
|
@@ -1848,6 +1893,8 @@ function SettingsDialog({ ctx }) {
|
|
|
1848
1893
|
const { locale } = useStore(ctx.store);
|
|
1849
1894
|
const t3 = stringsOf(ctx.store.get());
|
|
1850
1895
|
const [settings, setSettings] = d2(ctx.chart.settings);
|
|
1896
|
+
const [, bump] = d2(0);
|
|
1897
|
+
const appToggles = ctx.settingsToggles?.(ctx.chart) ?? [];
|
|
1851
1898
|
A2(() => ctx.chart.on("settingsChange", setSettings), [ctx.chart]);
|
|
1852
1899
|
const close = () => ctx.store.set({ dialog: null });
|
|
1853
1900
|
const set = (patch) => ctx.chart.setSettings(patch);
|
|
@@ -1929,6 +1976,26 @@ function SettingsDialog({ ctx }) {
|
|
|
1929
1976
|
)
|
|
1930
1977
|
] }))
|
|
1931
1978
|
] })),
|
|
1979
|
+
appToggles.length > 0 && /* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.settingsSymbol }),
|
|
1980
|
+
appToggles.map((item) => /* @__PURE__ */ a3("label", { class: "fnc-row fnc-toggle-row", children: [
|
|
1981
|
+
/* @__PURE__ */ a3("span", { children: [
|
|
1982
|
+
item.label,
|
|
1983
|
+
item.hint && /* @__PURE__ */ a3("small", { class: "fnc-toggle-hint", children: item.hint })
|
|
1984
|
+
] }),
|
|
1985
|
+
/* @__PURE__ */ a3(
|
|
1986
|
+
"input",
|
|
1987
|
+
{
|
|
1988
|
+
type: "checkbox",
|
|
1989
|
+
role: "switch",
|
|
1990
|
+
class: "fnc-switch",
|
|
1991
|
+
checked: item.checked,
|
|
1992
|
+
onChange: (e3) => {
|
|
1993
|
+
item.onChange(e3.currentTarget.checked);
|
|
1994
|
+
bump((n2) => n2 + 1);
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
)
|
|
1998
|
+
] })),
|
|
1932
1999
|
/* @__PURE__ */ a3("div", { class: "fnc-form-actions", children: [
|
|
1933
2000
|
/* @__PURE__ */ a3("button", { type: "button", class: "fnc-action fnc-action-danger", onClick: () => ctx.chart.setSettings(DEFAULT_CHART_SETTINGS), children: t3.resetDefaults }),
|
|
1934
2001
|
/* @__PURE__ */ a3("button", { type: "submit", class: "fnc-action fnc-action-primary", children: t3.done })
|
|
@@ -1963,6 +2030,35 @@ function Dialog({ title, onClose, children, wide }) {
|
|
|
1963
2030
|
) });
|
|
1964
2031
|
}
|
|
1965
2032
|
var SEARCH_THRESHOLD = 8;
|
|
2033
|
+
function paramsOnIndicator(def) {
|
|
2034
|
+
if (!Array.isArray(def.defaults.lines)) return void 0;
|
|
2035
|
+
return { lines: [{ period: def.type === "ema" ? 9 : 14, source: "close" }] };
|
|
2036
|
+
}
|
|
2037
|
+
function IndicatorOnPicker({ ctx, on }) {
|
|
2038
|
+
const { locale } = useStore(ctx.store);
|
|
2039
|
+
const t3 = stringsOf(ctx.store.get());
|
|
2040
|
+
const close = () => ctx.store.set({ dialog: null });
|
|
2041
|
+
const host = ctx.chart.indicatorLegend().find((i3) => i3.id === on);
|
|
2042
|
+
if (!host) return null;
|
|
2043
|
+
const defs = ctx.chart.indicatorsOnIndicator();
|
|
2044
|
+
return /* @__PURE__ */ a3(Dialog, { title: t3.addIndicatorOn, onClose: close, children: /* @__PURE__ */ a3("div", { class: "fnc-sr-list fnc-scroll", children: [
|
|
2045
|
+
/* @__PURE__ */ a3("div", { class: "fnc-sr-section", children: t3.onIndicatorSection.replace("{name}", host.title) }),
|
|
2046
|
+
defs.map((def) => /* @__PURE__ */ a3(
|
|
2047
|
+
"button",
|
|
2048
|
+
{
|
|
2049
|
+
class: "fnc-sr-row",
|
|
2050
|
+
onClick: () => {
|
|
2051
|
+
ctx.chart.addIndicatorOn(on, def.type, paramsOnIndicator(def));
|
|
2052
|
+
close();
|
|
2053
|
+
},
|
|
2054
|
+
children: /* @__PURE__ */ a3("span", { class: "fnc-sr-main", children: [
|
|
2055
|
+
/* @__PURE__ */ a3("span", { class: "fnc-sr-name", children: def.name[locale] }),
|
|
2056
|
+
/* @__PURE__ */ a3("span", { class: "fnc-sr-meta", children: def.description[locale] })
|
|
2057
|
+
] })
|
|
2058
|
+
}
|
|
2059
|
+
))
|
|
2060
|
+
] }) });
|
|
2061
|
+
}
|
|
1966
2062
|
function IndicatorPicker({ ctx }) {
|
|
1967
2063
|
const { locale } = useStore(ctx.store);
|
|
1968
2064
|
const t3 = stringsOf(ctx.store.get());
|
|
@@ -2061,6 +2157,7 @@ function IndicatorSettings({ ctx, id }) {
|
|
|
2061
2157
|
const config = indicators.find((c3) => c3.id === id);
|
|
2062
2158
|
const def = config ? ctx.chart.indicatorDefinition(config.type) ?? null : null;
|
|
2063
2159
|
const hasLines = !!def?.params.some((p3) => p3.kind === "lines");
|
|
2160
|
+
const onIndicator = !!config?.on;
|
|
2064
2161
|
const [lines, setLines] = d2(() => {
|
|
2065
2162
|
if (!config || !def || !hasLines) return [];
|
|
2066
2163
|
const defaults = defaultSeries(def, config.params);
|
|
@@ -2131,7 +2228,7 @@ function IndicatorSettings({ ctx, id }) {
|
|
|
2131
2228
|
i3 + 1
|
|
2132
2229
|
] }),
|
|
2133
2230
|
/* @__PURE__ */ a3(StyleControls, { t: t3, row: l3, onChange: (p3) => updateLine(i3, p3) }),
|
|
2134
|
-
/* @__PURE__ */ a3(SourceSelect, { value: l3.source, locale, label: t3.source, onChange: (source) => updateLine(i3, { source }) }),
|
|
2231
|
+
!onIndicator && /* @__PURE__ */ a3(SourceSelect, { value: l3.source, locale, label: t3.source, onChange: (source) => updateLine(i3, { source }) }),
|
|
2135
2232
|
/* @__PURE__ */ a3(
|
|
2136
2233
|
"input",
|
|
2137
2234
|
{
|
|
@@ -2150,7 +2247,7 @@ function IndicatorSettings({ ctx, id }) {
|
|
|
2150
2247
|
] })
|
|
2151
2248
|
] }) : /* @__PURE__ */ a3($, { children: [
|
|
2152
2249
|
/* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.inputs }),
|
|
2153
|
-
def.params.map((spec) => /* @__PURE__ */ a3("div", { class: "fnc-row", children: [
|
|
2250
|
+
def.params.filter((spec) => !(onIndicator && spec.kind === "source")).map((spec) => /* @__PURE__ */ a3("div", { class: "fnc-row", children: [
|
|
2154
2251
|
/* @__PURE__ */ a3("span", { class: "fnc-row-label fnc-row-label-wide", children: spec.label[locale] }),
|
|
2155
2252
|
spec.kind === "source" ? /* @__PURE__ */ a3(
|
|
2156
2253
|
SourceSelect,
|
|
@@ -2197,7 +2294,7 @@ function IndicatorSettings({ ctx, id }) {
|
|
|
2197
2294
|
}
|
|
2198
2295
|
function Dialogs({ ctx }) {
|
|
2199
2296
|
const { dialog } = useStore(ctx.store);
|
|
2200
|
-
if (dialog?.kind === "indicators") return /* @__PURE__ */ a3(IndicatorPicker, { ctx });
|
|
2297
|
+
if (dialog?.kind === "indicators") return dialog.on ? /* @__PURE__ */ a3(IndicatorOnPicker, { ctx, on: dialog.on }) : /* @__PURE__ */ a3(IndicatorPicker, { ctx });
|
|
2201
2298
|
if (dialog?.kind === "indicatorSettings") return /* @__PURE__ */ a3(IndicatorSettings, { ctx, id: dialog.id });
|
|
2202
2299
|
if (dialog?.kind === "chartSettings") return /* @__PURE__ */ a3(SettingsDialog, { ctx });
|
|
2203
2300
|
if (dialog?.kind === "goToDate") return /* @__PURE__ */ a3(GoToDateDialog, { ctx });
|
|
@@ -2860,7 +2957,12 @@ var TYPES = [
|
|
|
2860
2957
|
{ type: "line", label: "line", icon: LineChartIcon },
|
|
2861
2958
|
{ type: "step", label: "stepLine", icon: StepLineIcon },
|
|
2862
2959
|
{ type: "baseline", label: "baseline", icon: BaselineIcon },
|
|
2863
|
-
{ type: "area", label: "area", icon: AreaChartIcon }
|
|
2960
|
+
{ type: "area", label: "area", icon: AreaChartIcon },
|
|
2961
|
+
{ type: "volumeCandles", label: "volumeCandles", icon: VolumeCandlesIcon },
|
|
2962
|
+
{ type: "renko", label: "renko", icon: RenkoIcon },
|
|
2963
|
+
{ type: "kagi", label: "kagi", icon: KagiIcon },
|
|
2964
|
+
{ type: "lineBreak", label: "lineBreak", icon: LineBreakIcon },
|
|
2965
|
+
{ type: "pnf", label: "pointFigure", icon: PointFigureIcon }
|
|
2864
2966
|
];
|
|
2865
2967
|
var SCALES2 = [
|
|
2866
2968
|
{ mode: "normal", label: "scaleNormal" },
|
|
@@ -3306,6 +3408,19 @@ function IndicatorItem({ ctx, item }) {
|
|
|
3306
3408
|
e3.stopPropagation();
|
|
3307
3409
|
ctx.chart.moveIndicator(item.id, 1);
|
|
3308
3410
|
}, children: /* @__PURE__ */ a3(ChevronDownIcon, {}) }),
|
|
3411
|
+
item.hostable && ctx.chart.indicatorsOnIndicator().length > 0 && /* @__PURE__ */ a3(
|
|
3412
|
+
"button",
|
|
3413
|
+
{
|
|
3414
|
+
class: "fnc-ind-btn",
|
|
3415
|
+
"data-tip": t3.addIndicatorOn,
|
|
3416
|
+
"aria-label": `${item.title} ${t3.addIndicatorOn}`,
|
|
3417
|
+
onClick: (e3) => {
|
|
3418
|
+
e3.stopPropagation();
|
|
3419
|
+
ctx.store.set({ dialog: { kind: "indicators", on: item.id } });
|
|
3420
|
+
},
|
|
3421
|
+
children: /* @__PURE__ */ a3(SmallPlusIcon, {})
|
|
3422
|
+
}
|
|
3423
|
+
),
|
|
3309
3424
|
/* @__PURE__ */ a3(
|
|
3310
3425
|
"button",
|
|
3311
3426
|
{
|
|
@@ -3453,7 +3568,7 @@ function Legend({ ctx }) {
|
|
|
3453
3568
|
}
|
|
3454
3569
|
const items = s3.indicators.length ? ctx.chart.indicatorLegend(hover?.index) : [];
|
|
3455
3570
|
const overlayItems = items.filter((i3) => i3.overlay);
|
|
3456
|
-
const paneLegends = s3.layout.panes.filter((p3) => p3.kind === "indicator").map((pane) => ({ pane, item: items.find((i3) => i3.id === pane.id) }));
|
|
3571
|
+
const paneLegends = s3.layout.panes.filter((p3) => p3.kind === "indicator").map((pane) => ({ pane, item: items.find((i3) => i3.id === pane.id), kids: items.filter((i3) => i3.parent === pane.id) }));
|
|
3457
3572
|
const volumePane = s3.layout.panes.find((p3) => p3.kind === "volume");
|
|
3458
3573
|
return /* @__PURE__ */ a3($, { children: [
|
|
3459
3574
|
/* @__PURE__ */ a3("div", { class: "fnc-legend", ref, children: [
|
|
@@ -3488,7 +3603,10 @@ function Legend({ ctx }) {
|
|
|
3488
3603
|
] }),
|
|
3489
3604
|
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 }) }),
|
|
3490
3605
|
paneLegends.map(
|
|
3491
|
-
({ pane, item }) => item && /* @__PURE__ */ a3("div", { class: "fnc-legend fnc-pane-legend", style: { top: `${pane.top + 4}px` }, children:
|
|
3606
|
+
({ pane, item, kids }) => item && /* @__PURE__ */ a3("div", { class: "fnc-legend fnc-pane-legend", style: { top: `${pane.top + 4}px` }, children: [
|
|
3607
|
+
/* @__PURE__ */ a3(IndicatorItem, { ctx, item }),
|
|
3608
|
+
kids.map((kid) => /* @__PURE__ */ a3(IndicatorItem, { ctx, item: kid }))
|
|
3609
|
+
] })
|
|
3492
3610
|
)
|
|
3493
3611
|
] });
|
|
3494
3612
|
}
|
|
@@ -4394,6 +4512,9 @@ var CSS = (
|
|
|
4394
4512
|
@media (hover: none) {
|
|
4395
4513
|
.fnc-nav { display: none; }
|
|
4396
4514
|
}
|
|
4515
|
+
/* \uCC28\uD2B8 \uC124\uC815: an app switch's line under its label. */
|
|
4516
|
+
.fnc-toggle-hint { display: block; margin-top: 2px; font-size: 12px; color: var(--fnc-text-2); }
|
|
4517
|
+
|
|
4397
4518
|
/* A setting in a menu (\uBD80\uB4DC\uB7EC\uC6B4 \uC2A4\uD06C\uB864\xB7\uD655\uB300): the check at the end. */
|
|
4398
4519
|
.fnc-menu-check svg { margin-left: auto; color: var(--fnc-accent); }
|
|
4399
4520
|
|
|
@@ -4753,9 +4874,9 @@ var CSS = (
|
|
|
4753
4874
|
.fnc-tools-menu { width: 300px; padding: 8px; gap: 2px; max-height: 72vh; overflow-y: auto; }
|
|
4754
4875
|
.fnc-tools-section { padding: 8px 6px 6px; font-size: 12px; font-weight: 700; color: var(--fnc-text-2); }
|
|
4755
4876
|
.fnc-tools-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 0 2px 4px; }
|
|
4756
|
-
.fnc-tools-seg[data-count="5"], .fnc-tools-seg[data-count="8"] { display: grid; grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); gap: 2px; }
|
|
4757
|
-
.fnc-tools-seg[data-count="8"] { grid-template-columns: repeat(4, 1fr); }
|
|
4758
|
-
.fnc-tools-seg[data-count="5"] button, .fnc-tools-seg[data-count="8"] button { flex-direction: column; gap: 2px; height: auto; min-height: 40px; padding: 5px 4px; font-size: 12px; white-space: normal; word-break: keep-all; text-align: center; line-height: 1.25; }
|
|
4877
|
+
.fnc-tools-seg[data-count="5"], .fnc-tools-seg[data-count="8"], .fnc-tools-seg[data-count="13"] { display: grid; grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); gap: 2px; }
|
|
4878
|
+
.fnc-tools-seg[data-count="8"], .fnc-tools-seg[data-count="13"] { grid-template-columns: repeat(4, 1fr); }
|
|
4879
|
+
.fnc-tools-seg[data-count="5"] button, .fnc-tools-seg[data-count="8"] button, .fnc-tools-seg[data-count="13"] button { flex-direction: column; gap: 2px; height: auto; min-height: 40px; padding: 5px 4px; font-size: 12px; white-space: normal; word-break: keep-all; text-align: center; line-height: 1.25; }
|
|
4759
4880
|
.fnc-tools-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 0 6px; }
|
|
4760
4881
|
.fnc-tools-seg svg { width: 16px; height: 16px; flex: none; }
|
|
4761
4882
|
.fnc-tools-layouts { display: flex; flex-direction: column; gap: 2px; padding: 0 2px 4px; }
|
|
@@ -5346,6 +5467,7 @@ function createPane(shell, config) {
|
|
|
5346
5467
|
priceAxisActions: config.priceAxisActions,
|
|
5347
5468
|
drawingActions: config.drawingActions,
|
|
5348
5469
|
toolsMenuItems: config.toolsMenuItems,
|
|
5470
|
+
settingsToggles: config.settingsToggles,
|
|
5349
5471
|
legendValues: config.legendValues ?? "always",
|
|
5350
5472
|
onIndicatorsClick: config.onIndicatorsClick,
|
|
5351
5473
|
slots: shell.slots,
|
|
@@ -5433,6 +5555,7 @@ function createTradingChart(container, options) {
|
|
|
5433
5555
|
contextMenuItems,
|
|
5434
5556
|
priceAxisActions,
|
|
5435
5557
|
drawingActions,
|
|
5558
|
+
settingsToggles,
|
|
5436
5559
|
toolsMenuItems,
|
|
5437
5560
|
legendValues,
|
|
5438
5561
|
onIndicatorsClick,
|
|
@@ -5469,6 +5592,7 @@ function createTradingChart(container, options) {
|
|
|
5469
5592
|
contextMenuItems,
|
|
5470
5593
|
priceAxisActions,
|
|
5471
5594
|
drawingActions,
|
|
5595
|
+
settingsToggles,
|
|
5472
5596
|
toolsMenuItems,
|
|
5473
5597
|
legendValues,
|
|
5474
5598
|
onIndicatorsClick,
|
|
@@ -5549,6 +5673,7 @@ function createMultiChart(container, options) {
|
|
|
5549
5673
|
contextMenuItems,
|
|
5550
5674
|
priceAxisActions,
|
|
5551
5675
|
drawingActions,
|
|
5676
|
+
settingsToggles,
|
|
5552
5677
|
toolsMenuItems,
|
|
5553
5678
|
legendValues,
|
|
5554
5679
|
onIndicatorsClick,
|
|
@@ -5627,6 +5752,7 @@ function createMultiChart(container, options) {
|
|
|
5627
5752
|
contextMenuItems,
|
|
5628
5753
|
priceAxisActions,
|
|
5629
5754
|
drawingActions,
|
|
5755
|
+
settingsToggles,
|
|
5630
5756
|
toolsMenuItems,
|
|
5631
5757
|
legendValues,
|
|
5632
5758
|
onIndicatorsClick,
|
package/dist/pane.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsxImportSource preact */
|
|
2
2
|
import { type Chart, type ChartOptions, type ChartType, type Datafeed, type Resolution } from '@funnest/charts';
|
|
3
|
-
import type { ContextMenuItems, DrawingActions, IntervalGroup, LegendValues, MultiControls, PriceAxisActions, SearchCategory, SearchExchange, ToolsMenuItems, UiState, WidgetContext } from './context.js';
|
|
3
|
+
import type { ContextMenuItems, DrawingActions, IntervalGroup, LegendValues, MultiControls, PriceAxisActions, SearchCategory, SearchExchange, SettingsToggles, ToolsMenuItems, UiState, WidgetContext } from './context.js';
|
|
4
4
|
import { type Shell } from './shell.js';
|
|
5
5
|
import type { Strings } from './i18n.js';
|
|
6
6
|
import { Store } from './store.js';
|
|
@@ -23,6 +23,7 @@ export interface PaneConfig {
|
|
|
23
23
|
priceAxisActions?: PriceAxisActions | undefined;
|
|
24
24
|
drawingActions?: DrawingActions | undefined;
|
|
25
25
|
toolsMenuItems?: ToolsMenuItems | undefined;
|
|
26
|
+
settingsToggles?: SettingsToggles | undefined;
|
|
26
27
|
legendValues?: LegendValues | undefined;
|
|
27
28
|
onIndicatorsClick?: ((chart: Chart) => void) | undefined;
|
|
28
29
|
multi?: MultiControls | undefined;
|
package/dist/trading-chart.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsxImportSource preact */
|
|
2
2
|
import { type Chart, type ChartOptions, type ChartType, type Datafeed, type DirectionPreset, type Locale, type ChartState, type Resolution, type ThemeTokens } from '@funnest/charts';
|
|
3
|
-
import type { ContextMenuItems, DrawingActions, IntervalGroup, LegendValues, PriceAxisActions, SearchCategory, SearchExchange, ToolsMenuItems } from './context.js';
|
|
3
|
+
import type { ContextMenuItems, DrawingActions, IntervalGroup, LegendValues, PriceAxisActions, SearchCategory, SearchExchange, SettingsToggles, ToolsMenuItems } from './context.js';
|
|
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';
|
|
@@ -62,6 +62,8 @@ export interface TradingChartOptions extends Omit<ChartOptions, 'datafeed'> {
|
|
|
62
62
|
priceAxisActions?: PriceAxisActions;
|
|
63
63
|
/** Buttons on the bar of a selected drawing (e.g. 알림 on a trend line) — how phones reach drawing actions. */
|
|
64
64
|
drawingActions?: DrawingActions;
|
|
65
|
+
/** The app's own switches in 차트 설정 (e.g. extended hours for US stocks), asked when it opens. */
|
|
66
|
+
settingsToggles?: SettingsToggles;
|
|
65
67
|
/**
|
|
66
68
|
* Extra rows for the 도구 (tools) menu, above 차트 설정 — e.g. the app's own display settings.
|
|
67
69
|
* Called each time the menu opens, with the pane's chart.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funnest/charts-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
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.
|
|
45
|
+
"@funnest/charts": "0.9.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"preact": "^11.2.0"
|