@funnest/charts-ui 0.11.54 → 0.11.56

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/i18n.d.ts CHANGED
@@ -67,6 +67,12 @@ export declare const STRINGS: {
67
67
  settingHighLow: string;
68
68
  settingLastPrice: string;
69
69
  settingVolume: string;
70
+ settingOhlcValues: string;
71
+ hintOhlcValues: string;
72
+ ohlcAuto: string;
73
+ ohlcAlways: string;
74
+ ohlcCrosshair: string;
75
+ ohlcOff: string;
70
76
  settingNavButtons: string;
71
77
  settingCountdown: string;
72
78
  settingExtendedPrice: string;
@@ -466,6 +472,12 @@ export declare const STRINGS: {
466
472
  settingHighLow: string;
467
473
  settingLastPrice: string;
468
474
  settingVolume: string;
475
+ settingOhlcValues: string;
476
+ hintOhlcValues: string;
477
+ ohlcAuto: string;
478
+ ohlcAlways: string;
479
+ ohlcCrosshair: string;
480
+ ohlcOff: string;
469
481
  settingNavButtons: string;
470
482
  settingCountdown: string;
471
483
  settingExtendedPrice: string;
package/dist/index.js CHANGED
@@ -502,6 +502,12 @@ var STRINGS = {
502
502
  settingHighLow: "\uCD5C\uACE0\xB7\uCD5C\uC800 \uD45C\uC2DC",
503
503
  settingLastPrice: "\uD604\uC7AC\uAC00 \uC120",
504
504
  settingVolume: "\uAC70\uB798\uB7C9",
505
+ settingOhlcValues: "\uC2DC\xB7\uACE0\xB7\uC800\xB7\uC885 \uAC12",
506
+ hintOhlcValues: "\uCC28\uD2B8 \uC67C\uCABD \uC704, \uC885\uBAA9 \uC774\uB984 \uC544\uB798\uC5D0 \uB098\uC624\uB294 \uBD09\uC758 \uC2DC\uAC00\xB7\uACE0\uAC00\xB7\uC800\uAC00\xB7\uC885\uAC00\uC640 \uAC70\uB798\uB7C9\uC774\uC5D0\uC694.",
507
+ ohlcAuto: "\uC790\uB3D9 (\uAE30\uAE30\uC5D0 \uB9DE\uAC8C)",
508
+ ohlcAlways: "\uD56D\uC0C1 \uBCF4\uAE30",
509
+ ohlcCrosshair: "\uC2ED\uC790\uC120\uC744 \uB308 \uB54C\uB9CC",
510
+ ohlcOff: "\uC228\uAE30\uAE30",
505
511
  settingNavButtons: "\uD655\uB300\xB7\uC774\uB3D9 \uBC84\uD2BC",
506
512
  settingCountdown: "\uBD09 \uB9C8\uAC10\uAE4C\uC9C0 \uB0A8\uC740 \uC2DC\uAC04",
507
513
  settingExtendedPrice: "\uC7A5\uC678 \uAC00\uACA9\uC120 (\uD504\uB9AC\xB7\uC560\uD504\uD130\uB9C8\uCF13)",
@@ -903,6 +909,12 @@ var STRINGS = {
903
909
  settingHighLow: "High/low markers",
904
910
  settingLastPrice: "Last price line",
905
911
  settingVolume: "Volume",
912
+ settingOhlcValues: "OHLC values",
913
+ hintOhlcValues: "The bar's open, high, low, close and volume, at the top left under the symbol's name.",
914
+ ohlcAuto: "Auto (by device)",
915
+ ohlcAlways: "Always",
916
+ ohlcCrosshair: "With the crosshair only",
917
+ ohlcOff: "Hidden",
906
918
  settingNavButtons: "Zoom & scroll buttons",
907
919
  settingCountdown: "Time to bar close",
908
920
  settingExtendedPrice: "Pre / after-market price line",
@@ -6139,6 +6151,12 @@ var PRICE_MARK_ROWS = [
6139
6151
  { key: "extendedPriceLine", label: "settingExtendedPrice" },
6140
6152
  { key: "highLowMarkers", label: "settingHighLow" }
6141
6153
  ];
6154
+ var OHLC_CHOICES = [
6155
+ ["auto", "ohlcAuto"],
6156
+ ["always", "ohlcAlways"],
6157
+ ["crosshair", "ohlcCrosshair"],
6158
+ ["off", "ohlcOff"]
6159
+ ];
6142
6160
  var VIEW_ROWS = [{ key: "volume", label: "settingVolume" }];
6143
6161
  var CONTROL_ROWS = [
6144
6162
  { key: "navigationButtons", label: "settingNavButtons" },
@@ -6356,6 +6374,20 @@ function SettingsDialog({ ctx }) {
6356
6374
  shown === "view" && /* @__PURE__ */ a3($, { children: [
6357
6375
  /* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.settingsShown }),
6358
6376
  toggles(VIEW_ROWS),
6377
+ /* @__PURE__ */ a3("label", { class: "fnc-row fnc-toggle-row", children: [
6378
+ /* @__PURE__ */ a3("span", { class: "fnc-toggle-label", children: t3.settingOhlcValues }),
6379
+ /* @__PURE__ */ a3(Info, { text: t3.hintOhlcValues }),
6380
+ /* @__PURE__ */ a3(
6381
+ "select",
6382
+ {
6383
+ class: "fnc-settings-select fnc-app-select",
6384
+ "aria-label": t3.settingOhlcValues,
6385
+ value: settings.ohlcValues,
6386
+ onChange: (e3) => set({ ohlcValues: e3.currentTarget.value }),
6387
+ children: OHLC_CHOICES.map(([v3, label]) => /* @__PURE__ */ a3("option", { value: v3, children: t3[label] }))
6388
+ }
6389
+ )
6390
+ ] }),
6359
6391
  /* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.settingsControl }),
6360
6392
  toggles(CONTROL_ROWS),
6361
6393
  /* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.settingsWatermark }),
@@ -8055,14 +8087,20 @@ function Legend({ ctx }) {
8055
8087
  (info) => setHover(info ? { bar: info.bar, prev: ctx.chart.bars[info.index - 1], index: info.index } : null)
8056
8088
  ),
8057
8089
  ctx.chart.on("dataChange", () => refresh(void 0)),
8090
+ // 차트 설정 › 시·고·저·종 값.
8091
+ ctx.chart.on("settingsChange", () => refresh(void 0)),
8058
8092
  // Compare values are % from the first visible bar, so they change while scrolling.
8059
8093
  ctx.chart.on("visibleRangeChange", () => ctx.store.get().compares.length > 0 && refresh(void 0))
8060
8094
  ];
8061
8095
  return () => offs.forEach((off) => off());
8062
8096
  }, [ctx.chart]);
8063
8097
  const ref = T2(null);
8098
+ const chosen = ctx.chart.settings.ohlcValues;
8099
+ const mode = chosen === "auto" || !chosen ? ctx.legendValues : chosen;
8100
+ const modeRef = T2(mode);
8101
+ modeRef.current = mode;
8064
8102
  const tracking = T2(false);
8065
- tracking.current = ctx.legendValues === "crosshair" && !!hover;
8103
+ tracking.current = mode === "crosshair" && !!hover;
8066
8104
  const hovering = T2(false);
8067
8105
  hovering.current = !!hover;
8068
8106
  const measure = T2(() => {
@@ -8073,7 +8111,7 @@ function Legend({ ctx }) {
8073
8111
  if (!el) return;
8074
8112
  const update = () => {
8075
8113
  if (tracking.current || hovering.current) return;
8076
- const floating = ctx.legendValues === "crosshair" ? el.querySelector(".fnc-legend-values") : null;
8114
+ const floating = modeRef.current === "crosshair" ? el.querySelector(".fnc-legend-values") : null;
8077
8115
  const px = el.offsetTop + el.offsetHeight - (floating ? floating.offsetHeight + 2 : 0) + 4;
8078
8116
  const { symbol, resolution } = ctx.store.get();
8079
8117
  const key = `${symbol?.symbol ?? ""}|${resolution}|${el.offsetWidth}|${el.getElementsByTagName("*").length}`;
@@ -8094,12 +8132,12 @@ function Legend({ ctx }) {
8094
8132
  const prev = hover ? hover.prev : bars[bars.length - 2];
8095
8133
  const fmt = (p3) => formatPrice3(p3, s3.symbol.pricePrecision);
8096
8134
  let values = null;
8097
- if (bar && (ctx.legendValues === "always" || hover)) {
8135
+ if (bar && mode !== "off" && (mode === "always" || hover)) {
8098
8136
  const cls = dirClass(bar.close - bar.open);
8099
8137
  const change = prev ? bar.close - prev.close : 0;
8100
8138
  const pct = prev && prev.close ? change / Math.abs(prev.close) * 100 : 0;
8101
8139
  const sign = change > 0 ? "+" : "";
8102
- values = /* @__PURE__ */ a3("div", { class: ctx.legendValues === "crosshair" ? "fnc-legend-values fnc-legend-values-float" : "fnc-legend-values", children: [
8140
+ values = /* @__PURE__ */ a3("div", { class: mode === "crosshair" ? "fnc-legend-values fnc-legend-values-float" : "fnc-legend-values", children: [
8103
8141
  /* @__PURE__ */ a3("span", { children: [
8104
8142
  t3.open,
8105
8143
  " ",
@@ -8136,7 +8174,7 @@ function Legend({ ctx }) {
8136
8174
  ] });
8137
8175
  }
8138
8176
  const items = s3.indicators.length ? ctx.chart.indicatorLegend(hover?.index) : [];
8139
- const showValues = ctx.legendValues === "always" || !!hover;
8177
+ const showValues = mode !== "crosshair" || !!hover;
8140
8178
  const overlayItems = items.filter((i3) => i3.overlay);
8141
8179
  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) }));
8142
8180
  const volumePane = s3.layout.panes.find((p3) => p3.kind === "volume");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnest/charts-ui",
3
- "version": "0.11.54",
3
+ "version": "0.11.56",
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.54"
45
+ "@funnest/charts": "0.11.56"
46
46
  },
47
47
  "devDependencies": {
48
48
  "preact": "^11.2.0"