@overdoser/react-toolkit 0.0.13 → 0.0.15
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/components/Chart/TradingChart.d.ts +33 -4
- package/components/Chart/trading/period.d.ts +3 -0
- package/components/Chart/trading/types.d.ts +5 -1
- package/index.js +2044 -1952
- package/llms.txt +5 -2
- package/manifest.json +4 -1
- package/package.json +1 -1
package/llms.txt
CHANGED
|
@@ -733,10 +733,13 @@ Props:
|
|
|
733
733
|
- `datafeed: Datafeed` — required. Plug-in adapter (see contract below).
|
|
734
734
|
- `symbol: string` — required.
|
|
735
735
|
- `resolution: Resolution` — bar size (the "tick interval"). TradingView-style: numeric strings are minutes (`'1'`, `'5'`, `'60'`); `'D'`, `'W'`, `'M'` for day/week/month; any other string passes through.
|
|
736
|
-
- `period?: Period` — visible time-range window (the "chart interval"): `'1D' | '5D' | '1M' | '3M' | '6M' | '1Y' | '5Y'` or any `<n><unit>` string (`'30d'`, `'48h'`, `'2y'`). When set, the chart fetches bars covering the period and the initial visible window spans all of them. Overrides `initialLookback`. Note: the chart does NOT auto-adjust `resolution` for you — pair with `suggestResolutionForPeriod()` / `suggestPeriodForResolution()` if you want them coupled.
|
|
736
|
+
- `period?: Period` — visible time-range window (the "chart interval"): `'1D' | '5D' | '1M' | '3M' | '6M' | '1Y' | '5Y' | '10Y' | '20Y' | 'MAX'` or any `<n><unit>` string (`'30d'`, `'48h'`, `'2y'`). When set, the chart fetches bars covering the period and the initial visible window spans all of them. Overrides `initialLookback`. `'MAX'` requests `from: 0` (epoch) and renders whatever the datafeed returns — pair with a coarse `resolution` (`'W'` / `'M'`). Note: the chart does NOT auto-adjust `resolution` for you — pair with `suggestResolutionForPeriod()` / `suggestPeriodForResolution()` if you want them coupled.
|
|
737
737
|
- `seriesType?: 'candle' | 'bar' | 'line' | 'area'` — main pane style. @default `'candle'`. `'bar'` = OHLC bars (vertical high-low line, left tick at open, right tick at close).
|
|
738
738
|
- `timezone?: Timezone` / `defaultTimezone?: Timezone` / `onTimezoneChange?: (tz) => void` — controlled / uncontrolled / notification trio for the crosshair time label. `Timezone = 'local' | 'utc' | IANA-name`. Default `'local'`. Local mode renders `YYYY-MM-DD HH:MM:SS +HH:MM`, UTC renders `… UTC`, IANA strings render `… EST` (short timezone via `Intl.DateTimeFormat`).
|
|
739
739
|
- `showConfigPanel?: boolean` — show the gear button in the chart header + a Popover with a Timezone selector. @default `true`. Hide it if you want to manage timezone purely externally.
|
|
740
|
+
- `priceBadgeColorByDirection?: boolean` — when true, the top cursor-value badge is tinted with `upColor` / `downColor` (white text) by the hovered bar's direction. When false, it uses the same neutral palette as the bottom datetime badge. @default `false`.
|
|
741
|
+
- `priceBadgeShowTime?: boolean` — when true, the top cursor-value badge appends a date (D/W/M) or weekday+date+time (intraday) AFTER the price, separated by ` · `. Honours `timezone`. Default formats: `'17 Sep 2025'` for D/W/M, `'Wed 17 Sep 14:30'` for intraday. @default `false`.
|
|
742
|
+
- `priceBadgeTimeFormat?: (unixSec: number, resolution: Resolution, timezone: Timezone) => string` — optional override for the time portion when `priceBadgeShowTime` is on. Return any string; an empty string suppresses the suffix for that hover.
|
|
740
743
|
- `indicators?: IndicatorConfig[]` — see "Indicators" below.
|
|
741
744
|
- `precision?: number` — decimal places for price labels and tooltips. @default `2`
|
|
742
745
|
- `initialLookback?: number` — historical bars fetched on mount when `period` is not set. @default `500`
|
|
@@ -781,7 +784,7 @@ Interactions:
|
|
|
781
784
|
- Drag = pan.
|
|
782
785
|
- Wheel = zoom (anchored on cursor).
|
|
783
786
|
- ←/→ keys = nudge pan.
|
|
784
|
-
- Hover = full crosshair (dashed horizontal + vertical lines) with a **price badge** on the right edge
|
|
787
|
+
- Hover = full crosshair (dashed horizontal + vertical lines) with a **Y-axis price badge** on the right edge, a **time badge** under the X axis showing `YYYY-MM-DD HH:MM:SS <tz>` at the cursor's snapped bar (timezone is configurable via the gear panel or props), and a **top cursor-value badge** at the X position showing the hovered bar's close. `onCrosshair` callback fires. The top badge is neutral by default; pass `priceBadgeColorByDirection` to color it by bar direction and/or `priceBadgeShowTime` to include a compact date / date+time prefix.
|
|
785
788
|
|
|
786
789
|
Out of scope (v1):
|
|
787
790
|
- Drawing tools (trend lines, fib, shapes).
|
package/manifest.json
CHANGED
|
@@ -558,12 +558,15 @@
|
|
|
558
558
|
"datafeed": { "type": "Datafeed", "required": true },
|
|
559
559
|
"symbol": { "type": "string", "required": true },
|
|
560
560
|
"resolution": { "type": "Resolution", "required": true, "notes": "Bar size (the 'tick interval'). TradingView-style: numeric minutes ('1', '5', '60') or 'D'/'W'/'M'. Any other string passes through to the datafeed." },
|
|
561
|
-
"period": { "type": "Period", "notes": "Visible time-range window (the 'chart interval'): '1D' | '5D' | '1M' | '3M' | '6M' | '1Y' | '5Y' or a `<n><unit>` string. Overrides initialLookback when set. The chart does not auto-adjust resolution; pair with suggestResolutionForPeriod() / suggestPeriodForResolution() to couple the two." },
|
|
561
|
+
"period": { "type": "Period", "notes": "Visible time-range window (the 'chart interval'): '1D' | '5D' | '1M' | '3M' | '6M' | '1Y' | '5Y' | '10Y' | '20Y' | 'MAX' or a `<n><unit>` string. Overrides initialLookback when set. 'MAX' fetches from epoch and renders whatever the datafeed returns — pair with a coarse resolution. The chart does not auto-adjust resolution; pair with suggestResolutionForPeriod() / suggestPeriodForResolution() to couple the two." },
|
|
562
562
|
"seriesType": { "type": "enum", "values": ["candle", "bar", "line", "area"], "default": "candle", "notes": "'bar' = OHLC bars (vertical high-low line, left tick at open, right tick at close)." },
|
|
563
563
|
"timezone": { "type": "Timezone", "notes": "Controlled timezone for the crosshair time label. 'local' | 'utc' | IANA name. Pair with onTimezoneChange." },
|
|
564
564
|
"defaultTimezone": { "type": "Timezone", "default": "local", "notes": "Initial timezone when uncontrolled." },
|
|
565
565
|
"onTimezoneChange": { "type": "(tz: Timezone) => void" },
|
|
566
566
|
"showConfigPanel": { "type": "boolean", "default": true, "notes": "Gear button in the header that opens a Popover with a Timezone dropdown (Local / UTC / common IANA zones)." },
|
|
567
|
+
"priceBadgeColorByDirection": { "type": "boolean", "default": false, "notes": "Tint the top cursor-value badge by bar direction (up/down) instead of the neutral palette." },
|
|
568
|
+
"priceBadgeShowTime": { "type": "boolean", "default": false, "notes": "Append a compact date (D/W/M: '17 Sep 2025') or weekday+date+time (intraday: 'Wed 17 Sep 14:30') AFTER the price in the top cursor-value badge. Honours `timezone`." },
|
|
569
|
+
"priceBadgeTimeFormat": { "type": "(unixSec: number, resolution: Resolution, timezone: Timezone) => string", "notes": "Optional override for the time portion when priceBadgeShowTime is on. Return any string; empty string suppresses the suffix." },
|
|
567
570
|
"indicators": { "type": "IndicatorConfig[]" },
|
|
568
571
|
"precision": { "type": "number", "default": 2 },
|
|
569
572
|
"initialLookback": { "type": "number", "default": 500, "notes": "Used only when `period` is not set." },
|