react-native-livechart 3.2.0 โ 3.3.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/README.md +3 -1
- package/dist/components/LiveChart.d.ts.map +1 -1
- package/dist/components/SegmentDividerOverlay.d.ts +19 -0
- package/dist/components/SegmentDividerOverlay.d.ts.map +1 -0
- package/dist/core/resolveSegment.d.ts +42 -0
- package/dist/core/resolveSegment.d.ts.map +1 -0
- package/dist/hooks/useSegmentDivider.d.ts +28 -0
- package/dist/hooks/useSegmentDivider.d.ts.map +1 -0
- package/dist/hooks/useSegmentLineGradient.d.ts +20 -0
- package/dist/hooks/useSegmentLineGradient.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/math/segments.d.ts +46 -0
- package/dist/math/segments.d.ts.map +1 -0
- package/dist/types.d.ts +53 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/LiveChart.tsx +77 -5
- package/src/components/SegmentDividerOverlay.tsx +84 -0
- package/src/core/resolveSegment.ts +62 -0
- package/src/hooks/useSegmentDivider.ts +84 -0
- package/src/hooks/useSegmentLineGradient.ts +57 -0
- package/src/index.ts +1 -0
- package/src/math/segments.ts +173 -0
- package/src/types.ts +58 -0
package/README.md
CHANGED
|
@@ -30,6 +30,7 @@ High-performance **live** line and candlestick charts for React Native, built on
|
|
|
30
30
|
- ๐ **Scrubbing** with a crosshair and worklet-friendly `onScrub` payloads
|
|
31
31
|
- โก **Momentum** detection and **degen** effects (particle bursts + shake on big swings)
|
|
32
32
|
- ๐ท๏ธ **Trade markers** driven by a `SharedValue` trade stream
|
|
33
|
+
- ๐ **Segments** โ label time ranges (after-hours, overnight, sessions) with scrub-focus: one color at rest, and scrubbing a segment keeps it full while the others de-emphasize
|
|
33
34
|
- ๐จ **Theming** with light/dark modes, an accent-driven `palette`, and `metrics` sizing/motion tokens
|
|
34
35
|
- โณ **Loading** (breathing-line shell) and **paused** states out of the box
|
|
35
36
|
- ๐งต **SharedValue-driven** rendering โ history and live values stay on the UI thread
|
|
@@ -144,6 +145,7 @@ The tables below are a **highlight** โ the **canonical, full reference is the
|
|
|
144
145
|
| `mode` | `"line"` (default) or `"candle"` |
|
|
145
146
|
| `candles` / `liveCandle` / `candleWidth` | Candlestick mode |
|
|
146
147
|
| `tradeStream` | `SharedValue<TradeEvent[]>` for trade markers |
|
|
148
|
+
| `segments` | `ChartSegment[]` โ labeled time ranges (sessions, after-hours) with scrub-focus dimming |
|
|
147
149
|
| `degen` | Particle burst + shake on momentum swings |
|
|
148
150
|
| `scrub` | Crosshair scrubbing |
|
|
149
151
|
| `momentum` | `true` / `false` / `"up"`, `"down"`, or `"flat"` / `MomentumConfig` |
|
|
@@ -162,7 +164,7 @@ The tables below are a **highlight** โ the **canonical, full reference is the
|
|
|
162
164
|
| `onSeriesToggle` | Chip tap |
|
|
163
165
|
| `onScrub` | Worklet-friendly multi-series scrub payload |
|
|
164
166
|
|
|
165
|
-
These tables are a **highlight, not the full surface** (`LiveChart` alone has ~48 props). Other shared props include `font`, `insets`, `smoothing`, `xAxis`, `yAxis`, `referenceLines`, `gridStyle`, `palette`, `metrics`, `markers`, `leftEdgeFade`, `line`, `formatValue`, `formatTime`, and `emptyText`; single-series adds `gradient`, `badge`, `pulse`, `valueLine`, and `showValue`. Every overlay toggle follows the same **`boolean | Config`** convention (`badge`, `gradient`, `pulse`, `valueLine`, `scrub`, `yAxis`, `xAxis`, `leftEdgeFade`, `legend`, and `dot`) โ pass `true`/omit for defaults, `false` to disable, or an object to customize. Both charts share the same `dot` styling (a `DotConfig` base โ `radius`, `ring`, `color`); multi-series extends it with `pulse`, `valueLine`, and `valueLabel`. Beyond `palette` (color), `metrics` exposes sizing & motion tokens (badge/candle geometry, grid/motion speeds) with the same per-key override model. See the TypeScript types and JSDoc for the complete, canonical reference.
|
|
167
|
+
These tables are a **highlight, not the full surface** (`LiveChart` alone has ~48 props). Other shared props include `font`, `insets`, `smoothing`, `xAxis`, `yAxis`, `referenceLines`, `gridStyle`, `palette`, `metrics`, `markers`, `leftEdgeFade`, `line`, `formatValue`, `formatTime`, and `emptyText`; single-series adds `gradient`, `badge`, `pulse`, `valueLine`, `segments`, and `showValue`. Every overlay toggle follows the same **`boolean | Config`** convention (`badge`, `gradient`, `pulse`, `valueLine`, `scrub`, `yAxis`, `xAxis`, `leftEdgeFade`, `legend`, and `dot`) โ pass `true`/omit for defaults, `false` to disable, or an object to customize. Both charts share the same `dot` styling (a `DotConfig` base โ `radius`, `ring`, `color`); multi-series extends it with `pulse`, `valueLine`, and `valueLabel`. Beyond `palette` (color), `metrics` exposes sizing & motion tokens (badge/candle geometry, grid/motion speeds) with the same per-key override model. See the TypeScript types and JSDoc for the complete, canonical reference.
|
|
166
168
|
|
|
167
169
|
## Migrating to v2
|
|
168
170
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveChart.d.ts","sourceRoot":"","sources":["../../src/components/LiveChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LiveChart.d.ts","sourceRoot":"","sources":["../../src/components/LiveChart.tsx"],"names":[],"mappings":"AAuEA,OAAO,KAAK,EAAE,cAAc,EAAsB,MAAM,UAAU,CAAC;AA42BnE,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CA+D9C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type SkFont } from "@shopify/react-native-skia";
|
|
2
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
3
|
+
import type { ResolvedSegment } from "../core/resolveSegment";
|
|
4
|
+
import type { ChartPadding } from "../draw/line";
|
|
5
|
+
/**
|
|
6
|
+
* Renders one segment's edge markers: an optional dashed vertical divider at its
|
|
7
|
+
* leading (`from`) edge and an optional label captioning that divider (so the
|
|
8
|
+
* label shows only when the divider does). The scrub-focus emphasis is carried by
|
|
9
|
+
* the line stroke itself (see `useSegmentLineGradient`), so this overlay draws no
|
|
10
|
+
* fill. Self-contained so callers can `.map()` over a variable-length `segments`
|
|
11
|
+
* array, mirroring `ReferenceLineOverlay`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function SegmentDividerOverlay({ engine, padding, segment, font, }: {
|
|
14
|
+
engine: ChartEngineLayout;
|
|
15
|
+
padding: ChartPadding;
|
|
16
|
+
segment: ResolvedSegment;
|
|
17
|
+
font: SkFont;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=SegmentDividerOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentDividerOverlay.d.ts","sourceRoot":"","sources":["../../src/components/SegmentDividerOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,OAAO,EACP,OAAO,EACP,IAAI,GACL,EAAE;IACD,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,eAAe,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACd,2CAkDA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ChartSegment } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link ChartSegment} with every styling field resolved to a concrete value.
|
|
4
|
+
* `from`/`to` stay optional โ `undefined` means "extend to the plot edge" and is
|
|
5
|
+
* handled by the band projection (see `segmentBandX`).
|
|
6
|
+
*/
|
|
7
|
+
export interface ResolvedSegment {
|
|
8
|
+
from?: number;
|
|
9
|
+
to?: number;
|
|
10
|
+
recolorLine: boolean;
|
|
11
|
+
/** De-emphasis line color (already defaulted to the chart's muted palette color). */
|
|
12
|
+
mutedColor: string;
|
|
13
|
+
/** Optional โฅ2-color gradient for the de-emphasized line; takes precedence over `mutedColor`. */
|
|
14
|
+
mutedColors?: string[];
|
|
15
|
+
active: boolean;
|
|
16
|
+
divider: boolean;
|
|
17
|
+
/** Divider stroke color (already defaulted to the chart's reference-line color). */
|
|
18
|
+
dividerColor: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
/** Label text color (the chart's reference-label palette color). */
|
|
21
|
+
labelColor: string;
|
|
22
|
+
labelPosition: "left" | "right";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Palette-derived color defaults for a segment, supplied by the chart so segments
|
|
26
|
+
* inherit the chart's color system instead of carrying their own base color.
|
|
27
|
+
*/
|
|
28
|
+
export interface SegmentColorDefaults {
|
|
29
|
+
/** De-emphasis line color when `mutedColor`/`mutedColors` are unset. */
|
|
30
|
+
muted: string;
|
|
31
|
+
/** Divider stroke color when `dividerColor` is unset. */
|
|
32
|
+
divider: string;
|
|
33
|
+
/** Label text color. */
|
|
34
|
+
label: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Normalize a user-facing {@link ChartSegment} into a fully-resolved segment.
|
|
38
|
+
* Colors fall back to the chart's palette (`defaults`) โ a segment never needs its
|
|
39
|
+
* own base color. Pure โ called once per segment at render time, not per frame.
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveSegment(seg: ChartSegment, defaults: SegmentColorDefaults): ResolvedSegment;
|
|
42
|
+
//# sourceMappingURL=resolveSegment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveSegment.d.ts","sourceRoot":"","sources":["../../src/core/resolveSegment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAC;IACnB,iGAAiG;IACjG,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,oFAAoF;IACpF,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,oBAAoB,GAC7B,eAAe,CAejB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { SkFont } from "@shopify/react-native-skia";
|
|
3
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
4
|
+
import type { ResolvedSegment } from "../core/resolveSegment";
|
|
5
|
+
import type { ChartPadding } from "../draw/line";
|
|
6
|
+
/** Screen-space geometry for one segment's divider + label, per frame. */
|
|
7
|
+
export interface SegmentDividerLayout {
|
|
8
|
+
visible: boolean;
|
|
9
|
+
/** Segment left edge (px) โ the divider sits here. */
|
|
10
|
+
x1: number;
|
|
11
|
+
/** Segment right edge (px). */
|
|
12
|
+
x2: number;
|
|
13
|
+
/** Segment top edge (plot top). */
|
|
14
|
+
yTop: number;
|
|
15
|
+
/** Segment bottom edge (plot bottom). */
|
|
16
|
+
yBottom: number;
|
|
17
|
+
label: string;
|
|
18
|
+
labelX: number;
|
|
19
|
+
labelY: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Derives the screen-space geometry for a single segment's dashed divider and
|
|
23
|
+
* caption label each frame: the x-extent projected from its `[from, to]` time
|
|
24
|
+
* range, the plot's top/bottom edges, and the label anchor. The projection math
|
|
25
|
+
* lives in pure `segmentBandX` so it is unit-testable without Reanimated.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useSegmentDivider(engine: ChartEngineLayout, padding: ChartPadding, segment: ResolvedSegment, font: SkFont): SharedValue<SegmentDividerLayout>;
|
|
28
|
+
//# sourceMappingURL=useSegmentDivider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSegmentDivider.d.ts","sourceRoot":"","sources":["../../src/hooks/useSegmentDivider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,0EAA0E;AAC1E,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAaD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,MAAM,GACX,WAAW,CAAC,oBAAoB,CAAC,CAoCnC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
3
|
+
import type { ResolvedSegment } from "../core/resolveSegment";
|
|
4
|
+
import type { ChartPadding } from "../draw/line";
|
|
5
|
+
/**
|
|
6
|
+
* Derives the horizontal gradient applied to the line stroke for "scrub focus":
|
|
7
|
+
* the line is a flat `baseColor` at rest, and while scrubbing (or when a segment
|
|
8
|
+
* is `active`) the focused segment stays `baseColor` while the others are
|
|
9
|
+
* de-emphasized with their `lineColor`/`lineColors`. `colors`/`positions` come
|
|
10
|
+
* from the pure `segmentLineGradient`; `gradientEnd` spans the full canvas width
|
|
11
|
+
* so stop fractions and the gradient vector share one coordinate space. Apply it
|
|
12
|
+
* to the same `linePath` as the base line โ one stroke, no seam, and the line
|
|
13
|
+
* itself carries the opacity (not a layer painted on top).
|
|
14
|
+
*/
|
|
15
|
+
export declare function useSegmentLineGradient(engine: ChartEngineLayout, segments: ResolvedSegment[], padding: ChartPadding, baseColor: string, scrubX: SharedValue<number>, scrubActive: SharedValue<boolean>): {
|
|
16
|
+
colors: import("react-native-reanimated").DerivedValue<string[]>;
|
|
17
|
+
positions: import("react-native-reanimated").DerivedValue<number[]>;
|
|
18
|
+
gradientEnd: import("react-native-reanimated").DerivedValue<import("@shopify/react-native-skia").SkPoint>;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=useSegmentLineGradient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSegmentLineGradient.d.ts","sourceRoot":"","sources":["../../src/hooks/useSegmentLineGradient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAKjD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,eAAe,EAAE,EAC3B,OAAO,EAAE,YAAY,EACrB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAC3B,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC;;;;EA8BlC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,5 +14,5 @@ export { formatTime, formatValue } from "./lib/format";
|
|
|
14
14
|
export { MONO_FONT_FAMILY } from "./lib/monoFontFamily";
|
|
15
15
|
export { useDegen } from "./hooks/useDegen";
|
|
16
16
|
export { useTradeStream } from "./hooks/useTradeStream";
|
|
17
|
-
export type { AxisLabelConfig, BadgeConfig, BadgeMetrics, BadgeVariant, CandleMetrics, CandlePoint, ChartInsets, DegenOptions, DegenShakePayload, EmptyStateMetrics, FontConfig, FontWeight, GradientConfig, GridMetrics, GridStyleConfig, LeftEdgeFadeConfig, LegendConfig, LegendStyle, LineConfig, LiveChartCoreProps, LiveChartMetrics, LiveChartMetricsOverride, LiveChartPalette, LiveChartPoint, LiveChartProps, LiveChartSeriesProps, Marker, MarkerHoverEvent, MarkerKind, Momentum, MomentumConfig, MotionMetrics, MultiSeriesDotConfig, PulseConfig, ReferenceLine, ScrubConfig, ScrubPoint, ScrubPointCore, ScrubPointMulti, ScrubSeriesValue, SelectionDotConfig, SelectionDotProps, SelectionDotRingConfig, SeriesConfig, ThemeMode, TradeEvent, ValueLineConfig, XAxisConfig, YAxisConfig, } from "./types";
|
|
17
|
+
export type { AxisLabelConfig, BadgeConfig, BadgeMetrics, BadgeVariant, CandleMetrics, CandlePoint, ChartInsets, ChartSegment, DegenOptions, DegenShakePayload, EmptyStateMetrics, FontConfig, FontWeight, GradientConfig, GridMetrics, GridStyleConfig, LeftEdgeFadeConfig, LegendConfig, LegendStyle, LineConfig, LiveChartCoreProps, LiveChartMetrics, LiveChartMetricsOverride, LiveChartPalette, LiveChartPoint, LiveChartProps, LiveChartSeriesProps, Marker, MarkerHoverEvent, MarkerKind, Momentum, MomentumConfig, MotionMetrics, MultiSeriesDotConfig, PulseConfig, ReferenceLine, ScrubConfig, ScrubPoint, ScrubPointCore, ScrubPointMulti, ScrubSeriesValue, SelectionDotConfig, SelectionDotProps, SelectionDotRingConfig, SeriesConfig, ThemeMode, TradeEvent, ValueLineConfig, XAxisConfig, YAxisConfig, } from "./types";
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAC;AAC3D,YAAY,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAIjF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIxD,YAAY,EACV,eAAe,EACf,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,W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YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,MAAM,EACN,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,EACX,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ResolvedSegment } from "../core/resolveSegment";
|
|
2
|
+
/** Screen-space x-extent of a segment band, recomputed each frame. */
|
|
3
|
+
export interface SegmentBandX {
|
|
4
|
+
visible: boolean;
|
|
5
|
+
/** Band left edge (px), clamped into the plot. */
|
|
6
|
+
bx1: number;
|
|
7
|
+
/** Band right edge (px), clamped into the plot. */
|
|
8
|
+
bx2: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Project a segment's `[from, to]` time range (unix seconds) to a clamped x-pixel
|
|
12
|
+
* band within the plot `[x1, x2]`. Mirrors the time-band logic in
|
|
13
|
+
* `useReferenceLine`: an omitted `from` extends to the left edge (window start),
|
|
14
|
+
* an omitted `to` extends to the live edge (`now = winStart + win`). Swaps a
|
|
15
|
+
* reversed range, culls a fully off-screen one, and clamps a partial one.
|
|
16
|
+
*/
|
|
17
|
+
export declare function segmentBandX(from: number | undefined, to: number | undefined, winStart: number, win: number, x1: number, x2: number): SegmentBandX;
|
|
18
|
+
/** Horizontal stroke gradient for the recolored line segments. */
|
|
19
|
+
export interface SegmentGradient {
|
|
20
|
+
colors: string[];
|
|
21
|
+
positions: number[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Build the horizontal gradient applied to the line stroke itself, implementing
|
|
25
|
+
* "scrub focus" (the Robinhood model): the whole line is its plain `baseColor`
|
|
26
|
+
* until the user scrubs (or a segment is forced `active`). While focused, the
|
|
27
|
+
* segment under the scrub โ or the `active` one โ stays `baseColor` (full), and
|
|
28
|
+
* every OTHER `recolorLine` segment is de-emphasized with its own `mutedColor` /
|
|
29
|
+
* `mutedColors` (a different hue and/or a reduced alpha that fades it). Because it
|
|
30
|
+
* paints the line directly (not a layer on top), an alpha-reduced color genuinely
|
|
31
|
+
* lowers the line's opacity there.
|
|
32
|
+
*
|
|
33
|
+
* Stop positions are fractions of the full canvas width โ the same coordinate
|
|
34
|
+
* space as the gradient's `start`/`end` vectors. Each de-emphasized segment
|
|
35
|
+
* contributes `base@f1 โ color(s) across [f1,f2] โ base@f2`, with duplicate
|
|
36
|
+
* positions at the boundaries producing hard edges. The Skia gradient requires
|
|
37
|
+
* non-decreasing positions, so stops are emitted in ascending x order and never
|
|
38
|
+
* allowed to step backwards โ overlapping/reversed/clamped segments can therefore
|
|
39
|
+
* never feed a non-monotonic array.
|
|
40
|
+
*
|
|
41
|
+
* Returns `null` when the line should be uniform: not scrubbing and nothing
|
|
42
|
+
* `active`, or when every segment is the focused one (nothing to de-emphasize).
|
|
43
|
+
* The caller then strokes the line with its plain solid color.
|
|
44
|
+
*/
|
|
45
|
+
export declare function segmentLineGradient(segments: ResolvedSegment[], winStart: number, win: number, canvasWidth: number, plotLeft: number, plotRight: number, baseColor: string, scrubActive: boolean, scrubX: number): SegmentGradient | null;
|
|
46
|
+
//# sourceMappingURL=segments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../src/math/segments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,sEAAsE;AACtE,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;CACb;AAID;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,GACT,YAAY,CAkBd;AAED,kEAAkE;AAClE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,EAAE,EAC3B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,MAAM,GACb,eAAe,GAAG,IAAI,CAuFxB"}
|
package/dist/types.d.ts
CHANGED
|
@@ -91,6 +91,52 @@ export interface ReferenceLine {
|
|
|
91
91
|
/** Off-axis badge pill corner radius in pixels. Default `5`. */
|
|
92
92
|
badgeRadius?: number;
|
|
93
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* A time-range segment of the chart โ e.g. a pre-market / regular / after-hours
|
|
96
|
+
* session โ distinguished with a **scrub-focus** interaction (Robinhood-style
|
|
97
|
+
* extended-hours segmentation). At rest the whole line is one uniform color;
|
|
98
|
+
* while the user scrubs (or when a segment is `active`) the focused segment keeps
|
|
99
|
+
* the base color and every other segment is de-emphasized by recoloring the line
|
|
100
|
+
* stroke itself (no overlay). An optional dashed `divider` + `label` mark a
|
|
101
|
+
* segment's leading edge.
|
|
102
|
+
*/
|
|
103
|
+
export interface ChartSegment {
|
|
104
|
+
/** Segment start, unix seconds. Omit to extend to the chart's left edge. */
|
|
105
|
+
from?: number;
|
|
106
|
+
/** Segment end, unix seconds. Omit to extend to the live edge (now). */
|
|
107
|
+
to?: number;
|
|
108
|
+
/**
|
|
109
|
+
* Participate in scrub-focus line styling. At rest the line is one uniform
|
|
110
|
+
* color; while scrubbing (or when a segment is `active`), the focused segment
|
|
111
|
+
* keeps the base line color and every OTHER `recolorLine` segment is
|
|
112
|
+
* de-emphasized with `mutedColor` / `mutedColors`. Default `true`.
|
|
113
|
+
*/
|
|
114
|
+
recolorLine?: boolean;
|
|
115
|
+
/** De-emphasis line color, used when this segment is NOT the focused one. An
|
|
116
|
+
* alpha-reduced color (e.g. `"rgba(154,160,166,0.4)"`) fades the line โ it
|
|
117
|
+
* paints the stroke directly, not a layer on top. Defaults to the chart's muted
|
|
118
|
+
* palette color (`palette.gridLabel`). */
|
|
119
|
+
mutedColor?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Two or more CSS colors โ horizontal gradient across the segment's sub-range
|
|
122
|
+
* (left โ right) for the de-emphasized state, mirroring `LineConfig.colors`.
|
|
123
|
+
* Takes precedence over `mutedColor` when set.
|
|
124
|
+
*/
|
|
125
|
+
mutedColors?: string[];
|
|
126
|
+
/** Force this segment to be the focused one without scrubbing โ it stays full
|
|
127
|
+
* while the others are de-emphasized (e.g. the session is currently after-hours). */
|
|
128
|
+
active?: boolean;
|
|
129
|
+
/** Draw a vertical dashed divider at the `from` edge (market-close marker). Default `false`. */
|
|
130
|
+
divider?: boolean;
|
|
131
|
+
/** Divider color. Defaults to the chart's reference-line color (`palette.refLine`). */
|
|
132
|
+
dividerColor?: string;
|
|
133
|
+
/** Optional label captioning the divider at the top of the segment. Shown only
|
|
134
|
+
* when `divider` is set; drawn in the chart's reference-label color
|
|
135
|
+
* (`palette.refLabel`). */
|
|
136
|
+
label?: string;
|
|
137
|
+
/** Label horizontal anchor within the segment. Default `"left"`. */
|
|
138
|
+
labelPosition?: "left" | "right";
|
|
139
|
+
}
|
|
94
140
|
/** Per-instance grid-line styling for the horizontal value-axis grid. */
|
|
95
141
|
export interface GridStyleConfig {
|
|
96
142
|
/** Stroke color. Defaults to palette `gridLine`. */
|
|
@@ -805,6 +851,13 @@ export interface LiveChartProps extends LiveChartCoreProps {
|
|
|
805
851
|
dot?: boolean | DotConfig;
|
|
806
852
|
/** Horizontal dashed line at the current live value. `true` = defaults, or pass `ValueLineConfig`. */
|
|
807
853
|
valueLine?: boolean | ValueLineConfig;
|
|
854
|
+
/**
|
|
855
|
+
* Time-range segments (sessions, after-hours, overnight, etc.). At rest the
|
|
856
|
+
* line is one uniform color; scrubbing a {@link ChartSegment} โ or marking one
|
|
857
|
+
* `active` โ keeps it full while the others de-emphasize (`mutedColor` /
|
|
858
|
+
* `mutedColors`). Optional dashed `divider` + `label` mark a segment's edge.
|
|
859
|
+
*/
|
|
860
|
+
segments?: ChartSegment[];
|
|
808
861
|
/** Render the live value as a large text overlay in the top-left. Default `false`. */
|
|
809
862
|
showValue?: boolean;
|
|
810
863
|
/** Tint the `showValue` text by momentum (green up / red down). Default `false`. */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,KAAK,EACV,eAAe,EACf,SAAS,EACT,OAAO,EACR,MAAM,4BAA4B,CAAC;AAEpC,iDAAiD;AACjD,MAAM,WAAW,cAAc;IAC7B,iCAAi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AAoC;IACpC,aAAa,EAAE,MAAM,CAAC;IAEtB,yDAAyD;IACzD,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC,iCAAiC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useLayoutEffect, useState } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
4
|
-
import { useSharedValue } from "react-native-reanimated";
|
|
4
|
+
import { useDerivedValue, useSharedValue } from "react-native-reanimated";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Single-series live chart. UX and prop vocabulary parallel Benji Taylorโs
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
resolveXAxis,
|
|
36
36
|
resolveYAxis,
|
|
37
37
|
} from "../core/resolveConfig";
|
|
38
|
+
import { resolveSegment } from "../core/resolveSegment";
|
|
38
39
|
import { useLiveChartEngine } from "../core/useLiveChartEngine";
|
|
39
40
|
import { pulseRadialOutset } from "../draw/line";
|
|
40
41
|
import { resolveChartLayout } from "../hooks/resolveChartLayout";
|
|
@@ -52,6 +53,7 @@ import { useLiveDot } from "../hooks/useLiveDot";
|
|
|
52
53
|
import { useMarkers } from "../hooks/useMarkers";
|
|
53
54
|
import { useModeBlend } from "../hooks/useModeBlend";
|
|
54
55
|
import { useMomentum } from "../hooks/useMomentum";
|
|
56
|
+
import { useSegmentLineGradient } from "../hooks/useSegmentLineGradient";
|
|
55
57
|
import { useSingleChartReverseMorphInputs } from "../hooks/useReverseMorphEngineInputs";
|
|
56
58
|
import { useTradeStream } from "../hooks/useTradeStream";
|
|
57
59
|
import { useXAxis } from "../hooks/useXAxis";
|
|
@@ -79,6 +81,7 @@ import { MarkerOverlay } from "./MarkerOverlay";
|
|
|
79
81
|
import { MultiSeriesTooltipStack } from "./MultiSeriesTooltipStack";
|
|
80
82
|
import { ValueTextOverlay } from "./ValueTextOverlay";
|
|
81
83
|
import { ReferenceLineOverlay } from "./ReferenceLineOverlay";
|
|
84
|
+
import { SegmentDividerOverlay } from "./SegmentDividerOverlay";
|
|
82
85
|
import { TradeStreamOverlay } from "./TradeStreamOverlay";
|
|
83
86
|
import { ValueLineOverlay } from "./ValueLineOverlay";
|
|
84
87
|
import { XAxisOverlay } from "./XAxisOverlay";
|
|
@@ -141,6 +144,7 @@ function useLiveChartController({
|
|
|
141
144
|
showValue = false,
|
|
142
145
|
valueMomentumColor = false,
|
|
143
146
|
referenceLines,
|
|
147
|
+
segments,
|
|
144
148
|
gridStyle,
|
|
145
149
|
palette: paletteOverride,
|
|
146
150
|
metrics,
|
|
@@ -200,6 +204,20 @@ function useLiveChartController({
|
|
|
200
204
|
paletteOverride,
|
|
201
205
|
);
|
|
202
206
|
|
|
207
|
+
// Time-range segments (sessions, after-hours, โฆ). Resolved once per render like
|
|
208
|
+
// reference lines; the divider/label/muted colors default to the chart palette
|
|
209
|
+
// (no per-segment base color needed). `hasRecolorSegments` is a render-time gate
|
|
210
|
+
// for the line-recolor gradient pass (per-frame visibility is handled by the
|
|
211
|
+
// gradient's transparent stops, not by mounting/unmounting the Path).
|
|
212
|
+
const resolvedSegments = (segments ?? []).map((s) =>
|
|
213
|
+
resolveSegment(s, {
|
|
214
|
+
muted: palette.gridLabel,
|
|
215
|
+
divider: palette.refLine,
|
|
216
|
+
label: palette.refLabel,
|
|
217
|
+
}),
|
|
218
|
+
);
|
|
219
|
+
const hasRecolorSegments = resolvedSegments.some((s) => s.recolorLine);
|
|
220
|
+
|
|
203
221
|
const leftEdgeFadeCfg = resolveLeftEdgeFade(
|
|
204
222
|
leftEdgeFade,
|
|
205
223
|
leftEdgeFadeColorsFromBgRgb(palette.bgRgb),
|
|
@@ -437,6 +455,29 @@ function useLiveChartController({
|
|
|
437
455
|
effectivePadding,
|
|
438
456
|
);
|
|
439
457
|
|
|
458
|
+
// Scrub-focus gradient painted onto the line stroke: uniform at rest, and while
|
|
459
|
+
// scrubbing (or with an `active` segment) the focused segment stays full while
|
|
460
|
+
// the others are de-emphasized. Declared after `crosshair` so it can read the
|
|
461
|
+
// live scrub state.
|
|
462
|
+
const segmentGradient = useSegmentLineGradient(
|
|
463
|
+
engine,
|
|
464
|
+
resolvedSegments,
|
|
465
|
+
effectivePadding,
|
|
466
|
+
lineProp?.color ?? palette.line,
|
|
467
|
+
crosshair.scrubX,
|
|
468
|
+
crosshair.scrubActive,
|
|
469
|
+
);
|
|
470
|
+
|
|
471
|
+
// Hide the live dot while scrubbing when a selection dot is marking the scrub
|
|
472
|
+
// point instead โ otherwise both dots show at once.
|
|
473
|
+
const selectionDotDuringScrub =
|
|
474
|
+
!isStatic && scrubCfg !== null && selectionDotCfg !== null;
|
|
475
|
+
const liveDotOpacity = useDerivedValue(
|
|
476
|
+
() =>
|
|
477
|
+
reveal.dotOpacity.value *
|
|
478
|
+
(selectionDotDuringScrub && crosshair.scrubActive.value ? 0 : 1),
|
|
479
|
+
);
|
|
480
|
+
|
|
440
481
|
return {
|
|
441
482
|
// passthrough props the render needs
|
|
442
483
|
style,
|
|
@@ -464,6 +505,9 @@ function useLiveChartController({
|
|
|
464
505
|
leftEdgeFadeCfg,
|
|
465
506
|
metricsCfg,
|
|
466
507
|
allRefLines,
|
|
508
|
+
resolvedSegments,
|
|
509
|
+
hasRecolorSegments,
|
|
510
|
+
segmentGradient,
|
|
467
511
|
badgeUsesRightGutter,
|
|
468
512
|
// theme / layout / fonts
|
|
469
513
|
palette,
|
|
@@ -493,6 +537,7 @@ function useLiveChartController({
|
|
|
493
537
|
downWicksPath,
|
|
494
538
|
dotX,
|
|
495
539
|
dotY,
|
|
540
|
+
liveDotOpacity,
|
|
496
541
|
momentumSV,
|
|
497
542
|
tradeMarkers,
|
|
498
543
|
degenPack,
|
|
@@ -540,6 +585,9 @@ function ChartStack({ model }: { model: LiveChartModel }) {
|
|
|
540
585
|
valueLineCfg,
|
|
541
586
|
dotY,
|
|
542
587
|
allRefLines,
|
|
588
|
+
resolvedSegments,
|
|
589
|
+
hasRecolorSegments,
|
|
590
|
+
segmentGradient,
|
|
543
591
|
formatValue,
|
|
544
592
|
lineGroupOpacity,
|
|
545
593
|
linePath,
|
|
@@ -553,6 +601,7 @@ function ChartStack({ model }: { model: LiveChartModel }) {
|
|
|
553
601
|
xAxisCfg,
|
|
554
602
|
xAxisEntries,
|
|
555
603
|
dotX,
|
|
604
|
+
liveDotOpacity,
|
|
556
605
|
pulseCfg,
|
|
557
606
|
dotCfg,
|
|
558
607
|
degenCfg,
|
|
@@ -598,6 +647,18 @@ function ChartStack({ model }: { model: LiveChartModel }) {
|
|
|
598
647
|
</Group>
|
|
599
648
|
)}
|
|
600
649
|
|
|
650
|
+
{/* Segment dividers + labels (behind the line). The scrub-focus emphasis is
|
|
651
|
+
painted on the line stroke itself, below โ this overlay draws no fill. */}
|
|
652
|
+
{resolvedSegments.map((seg, i) => (
|
|
653
|
+
<SegmentDividerOverlay
|
|
654
|
+
key={`seg-${seg.from ?? "start"}-${seg.to ?? "end"}-${i}`}
|
|
655
|
+
engine={engine}
|
|
656
|
+
padding={effectivePadding}
|
|
657
|
+
segment={seg}
|
|
658
|
+
font={skiaFont}
|
|
659
|
+
/>
|
|
660
|
+
))}
|
|
661
|
+
|
|
601
662
|
{/* Value line + reference line (behind chart line) */}
|
|
602
663
|
{valueLineCfg && (
|
|
603
664
|
<Group opacity={reveal.lineOpacity}>
|
|
@@ -624,7 +685,10 @@ function ChartStack({ model }: { model: LiveChartModel }) {
|
|
|
624
685
|
/>
|
|
625
686
|
))}
|
|
626
687
|
|
|
627
|
-
{/* Chart line (fades out in candle mode)
|
|
688
|
+
{/* Chart line (fades out in candle mode). When segments recolor the line, a
|
|
689
|
+
full-width gradient paints the base color outside segments and each
|
|
690
|
+
segment's color within โ so the line itself is recolored/faded (alpha in
|
|
691
|
+
the segment color reduces the line's opacity), not covered by an overlay. */}
|
|
628
692
|
<Group opacity={lineGroupOpacity}>
|
|
629
693
|
<Path
|
|
630
694
|
path={linePath}
|
|
@@ -634,7 +698,14 @@ function ChartStack({ model }: { model: LiveChartModel }) {
|
|
|
634
698
|
strokeJoin="round"
|
|
635
699
|
color={lineProp?.color ?? palette.line}
|
|
636
700
|
>
|
|
637
|
-
{
|
|
701
|
+
{hasRecolorSegments ? (
|
|
702
|
+
<LinearGradient
|
|
703
|
+
start={vec(0, 0)}
|
|
704
|
+
end={segmentGradient.gradientEnd}
|
|
705
|
+
colors={segmentGradient.colors}
|
|
706
|
+
positions={segmentGradient.positions}
|
|
707
|
+
/>
|
|
708
|
+
) : lineProp?.colors?.length ? (
|
|
638
709
|
<LinearGradient
|
|
639
710
|
start={vec(0, 0)}
|
|
640
711
|
end={vec(layoutWidth, 0)}
|
|
@@ -678,9 +749,10 @@ function ChartStack({ model }: { model: LiveChartModel }) {
|
|
|
678
749
|
)}
|
|
679
750
|
|
|
680
751
|
{/* Live dot โ the badge is drawn later (after the scrub layer) so the
|
|
681
|
-
scrub dim never clips the live-price badge's left edge.
|
|
752
|
+
scrub dim never clips the live-price badge's left edge. Hidden while
|
|
753
|
+
scrubbing when a selection dot marks the scrub point instead. */}
|
|
682
754
|
{dotCfg.show && (
|
|
683
|
-
<Group opacity={
|
|
755
|
+
<Group opacity={liveDotOpacity}>
|
|
684
756
|
<DotOverlay
|
|
685
757
|
dotX={dotX}
|
|
686
758
|
dotY={dotY}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DashPathEffect,
|
|
3
|
+
Group,
|
|
4
|
+
Path,
|
|
5
|
+
Text as SkiaText,
|
|
6
|
+
type SkFont,
|
|
7
|
+
} from "@shopify/react-native-skia";
|
|
8
|
+
import { useDerivedValue } from "react-native-reanimated";
|
|
9
|
+
|
|
10
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
11
|
+
import type { ResolvedSegment } from "../core/resolveSegment";
|
|
12
|
+
import type { ChartPadding } from "../draw/line";
|
|
13
|
+
import { usePathBuilder } from "../hooks/usePathBuilder";
|
|
14
|
+
import { useSegmentDivider } from "../hooks/useSegmentDivider";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Renders one segment's edge markers: an optional dashed vertical divider at its
|
|
18
|
+
* leading (`from`) edge and an optional label captioning that divider (so the
|
|
19
|
+
* label shows only when the divider does). The scrub-focus emphasis is carried by
|
|
20
|
+
* the line stroke itself (see `useSegmentLineGradient`), so this overlay draws no
|
|
21
|
+
* fill. Self-contained so callers can `.map()` over a variable-length `segments`
|
|
22
|
+
* array, mirroring `ReferenceLineOverlay`.
|
|
23
|
+
*/
|
|
24
|
+
export function SegmentDividerOverlay({
|
|
25
|
+
engine,
|
|
26
|
+
padding,
|
|
27
|
+
segment,
|
|
28
|
+
font,
|
|
29
|
+
}: {
|
|
30
|
+
engine: ChartEngineLayout;
|
|
31
|
+
padding: ChartPadding;
|
|
32
|
+
segment: ResolvedSegment;
|
|
33
|
+
font: SkFont;
|
|
34
|
+
}) {
|
|
35
|
+
const layout = useSegmentDivider(engine, padding, segment, font);
|
|
36
|
+
|
|
37
|
+
const dividerBuilder = usePathBuilder();
|
|
38
|
+
|
|
39
|
+
const dividerPath = useDerivedValue(() => {
|
|
40
|
+
const b = dividerBuilder.value;
|
|
41
|
+
const l = layout.value;
|
|
42
|
+
if (l.visible && segment.divider) {
|
|
43
|
+
b.moveTo(l.x1, l.yTop);
|
|
44
|
+
b.lineTo(l.x1, l.yBottom);
|
|
45
|
+
}
|
|
46
|
+
return b.detach();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const dividerOpacity = useDerivedValue(() => (layout.value.visible ? 1 : 0));
|
|
50
|
+
const labelOpacity = useDerivedValue(() => (layout.value.visible ? 1 : 0));
|
|
51
|
+
const labelX = useDerivedValue(() => layout.value.labelX);
|
|
52
|
+
const labelY = useDerivedValue(() => layout.value.labelY);
|
|
53
|
+
const labelText = useDerivedValue(() => layout.value.label);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Group>
|
|
57
|
+
{segment.divider && (
|
|
58
|
+
<Group opacity={dividerOpacity}>
|
|
59
|
+
<Path
|
|
60
|
+
path={dividerPath}
|
|
61
|
+
style="stroke"
|
|
62
|
+
strokeWidth={1}
|
|
63
|
+
color={segment.dividerColor}
|
|
64
|
+
>
|
|
65
|
+
<DashPathEffect intervals={[4, 4]} />
|
|
66
|
+
</Path>
|
|
67
|
+
</Group>
|
|
68
|
+
)}
|
|
69
|
+
|
|
70
|
+
{/* The label captions the divider, so it only shows when the divider does. */}
|
|
71
|
+
{segment.label && segment.divider ? (
|
|
72
|
+
<Group opacity={labelOpacity}>
|
|
73
|
+
<SkiaText
|
|
74
|
+
x={labelX}
|
|
75
|
+
y={labelY}
|
|
76
|
+
text={labelText}
|
|
77
|
+
font={font}
|
|
78
|
+
color={segment.labelColor}
|
|
79
|
+
/>
|
|
80
|
+
</Group>
|
|
81
|
+
) : null}
|
|
82
|
+
</Group>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ChartSegment } from "../types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A {@link ChartSegment} with every styling field resolved to a concrete value.
|
|
5
|
+
* `from`/`to` stay optional โ `undefined` means "extend to the plot edge" and is
|
|
6
|
+
* handled by the band projection (see `segmentBandX`).
|
|
7
|
+
*/
|
|
8
|
+
export interface ResolvedSegment {
|
|
9
|
+
from?: number;
|
|
10
|
+
to?: number;
|
|
11
|
+
recolorLine: boolean;
|
|
12
|
+
/** De-emphasis line color (already defaulted to the chart's muted palette color). */
|
|
13
|
+
mutedColor: string;
|
|
14
|
+
/** Optional โฅ2-color gradient for the de-emphasized line; takes precedence over `mutedColor`. */
|
|
15
|
+
mutedColors?: string[];
|
|
16
|
+
active: boolean;
|
|
17
|
+
divider: boolean;
|
|
18
|
+
/** Divider stroke color (already defaulted to the chart's reference-line color). */
|
|
19
|
+
dividerColor: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Label text color (the chart's reference-label palette color). */
|
|
22
|
+
labelColor: string;
|
|
23
|
+
labelPosition: "left" | "right";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Palette-derived color defaults for a segment, supplied by the chart so segments
|
|
28
|
+
* inherit the chart's color system instead of carrying their own base color.
|
|
29
|
+
*/
|
|
30
|
+
export interface SegmentColorDefaults {
|
|
31
|
+
/** De-emphasis line color when `mutedColor`/`mutedColors` are unset. */
|
|
32
|
+
muted: string;
|
|
33
|
+
/** Divider stroke color when `dividerColor` is unset. */
|
|
34
|
+
divider: string;
|
|
35
|
+
/** Label text color. */
|
|
36
|
+
label: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Normalize a user-facing {@link ChartSegment} into a fully-resolved segment.
|
|
41
|
+
* Colors fall back to the chart's palette (`defaults`) โ a segment never needs its
|
|
42
|
+
* own base color. Pure โ called once per segment at render time, not per frame.
|
|
43
|
+
*/
|
|
44
|
+
export function resolveSegment(
|
|
45
|
+
seg: ChartSegment,
|
|
46
|
+
defaults: SegmentColorDefaults,
|
|
47
|
+
): ResolvedSegment {
|
|
48
|
+
return {
|
|
49
|
+
from: seg.from,
|
|
50
|
+
to: seg.to,
|
|
51
|
+
recolorLine: seg.recolorLine ?? true,
|
|
52
|
+
mutedColor: seg.mutedColor ?? defaults.muted,
|
|
53
|
+
mutedColors:
|
|
54
|
+
seg.mutedColors && seg.mutedColors.length >= 2 ? seg.mutedColors : undefined,
|
|
55
|
+
active: seg.active ?? false,
|
|
56
|
+
divider: seg.divider ?? false,
|
|
57
|
+
dividerColor: seg.dividerColor ?? defaults.divider,
|
|
58
|
+
label: seg.label,
|
|
59
|
+
labelColor: defaults.label,
|
|
60
|
+
labelPosition: seg.labelPosition ?? "left",
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useDerivedValue, type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { SkFont } from "@shopify/react-native-skia";
|
|
3
|
+
|
|
4
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
5
|
+
import type { ResolvedSegment } from "../core/resolveSegment";
|
|
6
|
+
import type { ChartPadding } from "../draw/line";
|
|
7
|
+
import { measureFontTextWidth } from "../lib/measureFontTextWidth";
|
|
8
|
+
import { segmentBandX } from "../math/segments";
|
|
9
|
+
|
|
10
|
+
/** Screen-space geometry for one segment's divider + label, per frame. */
|
|
11
|
+
export interface SegmentDividerLayout {
|
|
12
|
+
visible: boolean;
|
|
13
|
+
/** Segment left edge (px) โ the divider sits here. */
|
|
14
|
+
x1: number;
|
|
15
|
+
/** Segment right edge (px). */
|
|
16
|
+
x2: number;
|
|
17
|
+
/** Segment top edge (plot top). */
|
|
18
|
+
yTop: number;
|
|
19
|
+
/** Segment bottom edge (plot bottom). */
|
|
20
|
+
yBottom: number;
|
|
21
|
+
label: string;
|
|
22
|
+
labelX: number;
|
|
23
|
+
labelY: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const INVISIBLE: SegmentDividerLayout = {
|
|
27
|
+
visible: false,
|
|
28
|
+
x1: 0,
|
|
29
|
+
x2: 0,
|
|
30
|
+
yTop: 0,
|
|
31
|
+
yBottom: 0,
|
|
32
|
+
label: "",
|
|
33
|
+
labelX: 0,
|
|
34
|
+
labelY: -1,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Derives the screen-space geometry for a single segment's dashed divider and
|
|
39
|
+
* caption label each frame: the x-extent projected from its `[from, to]` time
|
|
40
|
+
* range, the plot's top/bottom edges, and the label anchor. The projection math
|
|
41
|
+
* lives in pure `segmentBandX` so it is unit-testable without Reanimated.
|
|
42
|
+
*/
|
|
43
|
+
export function useSegmentDivider(
|
|
44
|
+
engine: ChartEngineLayout,
|
|
45
|
+
padding: ChartPadding,
|
|
46
|
+
segment: ResolvedSegment,
|
|
47
|
+
font: SkFont,
|
|
48
|
+
): SharedValue<SegmentDividerLayout> {
|
|
49
|
+
return useDerivedValue<SegmentDividerLayout>(() => {
|
|
50
|
+
const w = engine.canvasWidth.value;
|
|
51
|
+
const h = engine.canvasHeight.value;
|
|
52
|
+
if (w === 0 || h === 0) return INVISIBLE;
|
|
53
|
+
|
|
54
|
+
const win = engine.displayWindow.value;
|
|
55
|
+
const winStart = engine.timestamp.value - win;
|
|
56
|
+
const x1 = padding.left;
|
|
57
|
+
const x2 = w - padding.right;
|
|
58
|
+
|
|
59
|
+
const band = segmentBandX(segment.from, segment.to, winStart, win, x1, x2);
|
|
60
|
+
if (!band.visible) return INVISIBLE;
|
|
61
|
+
|
|
62
|
+
const yTop = padding.top;
|
|
63
|
+
const yBottom = h - padding.bottom;
|
|
64
|
+
|
|
65
|
+
const label = segment.label ?? "";
|
|
66
|
+
const fm = font.getMetrics();
|
|
67
|
+
const labelX =
|
|
68
|
+
segment.labelPosition === "right"
|
|
69
|
+
? band.bx2 - 4 - measureFontTextWidth(font, label)
|
|
70
|
+
: band.bx1 + 4;
|
|
71
|
+
const labelY = yTop - fm.ascent + 2;
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
visible: true,
|
|
75
|
+
x1: band.bx1,
|
|
76
|
+
x2: band.bx2,
|
|
77
|
+
yTop,
|
|
78
|
+
yBottom,
|
|
79
|
+
label,
|
|
80
|
+
labelX,
|
|
81
|
+
labelY,
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useDerivedValue, type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import { vec } from "@shopify/react-native-skia";
|
|
3
|
+
|
|
4
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
5
|
+
import type { ResolvedSegment } from "../core/resolveSegment";
|
|
6
|
+
import type { ChartPadding } from "../draw/line";
|
|
7
|
+
import { segmentLineGradient } from "../math/segments";
|
|
8
|
+
|
|
9
|
+
const FALLBACK_POSITIONS = [0, 1];
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Derives the horizontal gradient applied to the line stroke for "scrub focus":
|
|
13
|
+
* the line is a flat `baseColor` at rest, and while scrubbing (or when a segment
|
|
14
|
+
* is `active`) the focused segment stays `baseColor` while the others are
|
|
15
|
+
* de-emphasized with their `lineColor`/`lineColors`. `colors`/`positions` come
|
|
16
|
+
* from the pure `segmentLineGradient`; `gradientEnd` spans the full canvas width
|
|
17
|
+
* so stop fractions and the gradient vector share one coordinate space. Apply it
|
|
18
|
+
* to the same `linePath` as the base line โ one stroke, no seam, and the line
|
|
19
|
+
* itself carries the opacity (not a layer painted on top).
|
|
20
|
+
*/
|
|
21
|
+
export function useSegmentLineGradient(
|
|
22
|
+
engine: ChartEngineLayout,
|
|
23
|
+
segments: ResolvedSegment[],
|
|
24
|
+
padding: ChartPadding,
|
|
25
|
+
baseColor: string,
|
|
26
|
+
scrubX: SharedValue<number>,
|
|
27
|
+
scrubActive: SharedValue<boolean>,
|
|
28
|
+
) {
|
|
29
|
+
const data = useDerivedValue(() => {
|
|
30
|
+
const cw = engine.canvasWidth.value;
|
|
31
|
+
const win = engine.displayWindow.value;
|
|
32
|
+
const winStart = engine.timestamp.value - win;
|
|
33
|
+
return segmentLineGradient(
|
|
34
|
+
segments,
|
|
35
|
+
winStart,
|
|
36
|
+
win,
|
|
37
|
+
cw,
|
|
38
|
+
padding.left,
|
|
39
|
+
cw - padding.right,
|
|
40
|
+
baseColor,
|
|
41
|
+
scrubActive.value,
|
|
42
|
+
scrubX.value,
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const colors = useDerivedValue(
|
|
47
|
+
() => data.value?.colors ?? [baseColor, baseColor],
|
|
48
|
+
);
|
|
49
|
+
const positions = useDerivedValue(
|
|
50
|
+
() => data.value?.positions ?? FALLBACK_POSITIONS,
|
|
51
|
+
);
|
|
52
|
+
const gradientEnd = useDerivedValue(() =>
|
|
53
|
+
vec(Math.max(1, engine.canvasWidth.value), 0),
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
return { colors, positions, gradientEnd };
|
|
57
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import type { ResolvedSegment } from "../core/resolveSegment";
|
|
2
|
+
|
|
3
|
+
/** Screen-space x-extent of a segment band, recomputed each frame. */
|
|
4
|
+
export interface SegmentBandX {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
/** Band left edge (px), clamped into the plot. */
|
|
7
|
+
bx1: number;
|
|
8
|
+
/** Band right edge (px), clamped into the plot. */
|
|
9
|
+
bx2: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const INVISIBLE_BAND: SegmentBandX = { visible: false, bx1: 0, bx2: 0 };
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Project a segment's `[from, to]` time range (unix seconds) to a clamped x-pixel
|
|
16
|
+
* band within the plot `[x1, x2]`. Mirrors the time-band logic in
|
|
17
|
+
* `useReferenceLine`: an omitted `from` extends to the left edge (window start),
|
|
18
|
+
* an omitted `to` extends to the live edge (`now = winStart + win`). Swaps a
|
|
19
|
+
* reversed range, culls a fully off-screen one, and clamps a partial one.
|
|
20
|
+
*/
|
|
21
|
+
export function segmentBandX(
|
|
22
|
+
from: number | undefined,
|
|
23
|
+
to: number | undefined,
|
|
24
|
+
winStart: number,
|
|
25
|
+
win: number,
|
|
26
|
+
x1: number,
|
|
27
|
+
x2: number,
|
|
28
|
+
): SegmentBandX {
|
|
29
|
+
"worklet";
|
|
30
|
+
if (win <= 0 || x2 <= x1) return INVISIBLE_BAND;
|
|
31
|
+
const chartW = x2 - x1;
|
|
32
|
+
const f = from ?? winStart;
|
|
33
|
+
const t = to ?? winStart + win;
|
|
34
|
+
|
|
35
|
+
let bx1 = x1 + ((f - winStart) / win) * chartW;
|
|
36
|
+
let bx2 = x1 + ((t - winStart) / win) * chartW;
|
|
37
|
+
if (bx2 < bx1) {
|
|
38
|
+
const tmp = bx1;
|
|
39
|
+
bx1 = bx2;
|
|
40
|
+
bx2 = tmp;
|
|
41
|
+
}
|
|
42
|
+
if (bx2 < x1 || bx1 > x2) return INVISIBLE_BAND;
|
|
43
|
+
if (bx1 < x1) bx1 = x1;
|
|
44
|
+
if (bx2 > x2) bx2 = x2;
|
|
45
|
+
return { visible: true, bx1, bx2 };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Horizontal stroke gradient for the recolored line segments. */
|
|
49
|
+
export interface SegmentGradient {
|
|
50
|
+
colors: string[];
|
|
51
|
+
positions: number[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Build the horizontal gradient applied to the line stroke itself, implementing
|
|
56
|
+
* "scrub focus" (the Robinhood model): the whole line is its plain `baseColor`
|
|
57
|
+
* until the user scrubs (or a segment is forced `active`). While focused, the
|
|
58
|
+
* segment under the scrub โ or the `active` one โ stays `baseColor` (full), and
|
|
59
|
+
* every OTHER `recolorLine` segment is de-emphasized with its own `mutedColor` /
|
|
60
|
+
* `mutedColors` (a different hue and/or a reduced alpha that fades it). Because it
|
|
61
|
+
* paints the line directly (not a layer on top), an alpha-reduced color genuinely
|
|
62
|
+
* lowers the line's opacity there.
|
|
63
|
+
*
|
|
64
|
+
* Stop positions are fractions of the full canvas width โ the same coordinate
|
|
65
|
+
* space as the gradient's `start`/`end` vectors. Each de-emphasized segment
|
|
66
|
+
* contributes `base@f1 โ color(s) across [f1,f2] โ base@f2`, with duplicate
|
|
67
|
+
* positions at the boundaries producing hard edges. The Skia gradient requires
|
|
68
|
+
* non-decreasing positions, so stops are emitted in ascending x order and never
|
|
69
|
+
* allowed to step backwards โ overlapping/reversed/clamped segments can therefore
|
|
70
|
+
* never feed a non-monotonic array.
|
|
71
|
+
*
|
|
72
|
+
* Returns `null` when the line should be uniform: not scrubbing and nothing
|
|
73
|
+
* `active`, or when every segment is the focused one (nothing to de-emphasize).
|
|
74
|
+
* The caller then strokes the line with its plain solid color.
|
|
75
|
+
*/
|
|
76
|
+
export function segmentLineGradient(
|
|
77
|
+
segments: ResolvedSegment[],
|
|
78
|
+
winStart: number,
|
|
79
|
+
win: number,
|
|
80
|
+
canvasWidth: number,
|
|
81
|
+
plotLeft: number,
|
|
82
|
+
plotRight: number,
|
|
83
|
+
baseColor: string,
|
|
84
|
+
scrubActive: boolean,
|
|
85
|
+
scrubX: number,
|
|
86
|
+
): SegmentGradient | null {
|
|
87
|
+
"worklet";
|
|
88
|
+
if (win <= 0 || canvasWidth <= 0 || plotRight <= plotLeft) return null;
|
|
89
|
+
|
|
90
|
+
// Focus mode is on only while scrubbing or when a segment is forced `active`.
|
|
91
|
+
// Off โ the whole line is its plain base color (segments are indistinguishable).
|
|
92
|
+
let focusMode = scrubActive;
|
|
93
|
+
if (!focusMode) {
|
|
94
|
+
for (let i = 0; i < segments.length; i++) {
|
|
95
|
+
if (segments[i].recolorLine && segments[i].active) {
|
|
96
|
+
focusMode = true;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (!focusMode) return null;
|
|
102
|
+
|
|
103
|
+
const chartW = plotRight - plotLeft;
|
|
104
|
+
|
|
105
|
+
// Collect the NON-focused segments โ they get de-emphasized (their mutedColor);
|
|
106
|
+
// the focused segment (under the scrub, or `active`) stays the base color.
|
|
107
|
+
const spans: { f1: number; f2: number; cols: string[] }[] = [];
|
|
108
|
+
for (let i = 0; i < segments.length; i++) {
|
|
109
|
+
const seg = segments[i];
|
|
110
|
+
if (!seg.recolorLine) continue;
|
|
111
|
+
|
|
112
|
+
const from = seg.from ?? winStart;
|
|
113
|
+
const to = seg.to ?? winStart + win;
|
|
114
|
+
let px1 = plotLeft + ((from - winStart) / win) * chartW;
|
|
115
|
+
let px2 = plotLeft + ((to - winStart) / win) * chartW;
|
|
116
|
+
if (px2 < px1) {
|
|
117
|
+
const tmp = px1;
|
|
118
|
+
px1 = px2;
|
|
119
|
+
px2 = tmp;
|
|
120
|
+
}
|
|
121
|
+
if (px2 < plotLeft || px1 > plotRight) continue;
|
|
122
|
+
if (px1 < plotLeft) px1 = plotLeft;
|
|
123
|
+
if (px2 > plotRight) px2 = plotRight;
|
|
124
|
+
|
|
125
|
+
const focused =
|
|
126
|
+
(scrubActive && scrubX >= px1 && scrubX <= px2) || seg.active;
|
|
127
|
+
if (focused) continue; // the focused segment keeps the full base color
|
|
128
|
+
|
|
129
|
+
const f1 = px1 / canvasWidth;
|
|
130
|
+
const f2 = px2 / canvasWidth;
|
|
131
|
+
if (f2 <= f1) continue;
|
|
132
|
+
const cols =
|
|
133
|
+
seg.mutedColors && seg.mutedColors.length >= 2
|
|
134
|
+
? seg.mutedColors
|
|
135
|
+
: [seg.mutedColor];
|
|
136
|
+
spans.push({ f1, f2, cols });
|
|
137
|
+
}
|
|
138
|
+
if (spans.length === 0) return null; // nothing to de-emphasize โ uniform line
|
|
139
|
+
|
|
140
|
+
spans.sort((a, b) => a.f1 - b.f1);
|
|
141
|
+
|
|
142
|
+
const colors: string[] = [];
|
|
143
|
+
const positions: number[] = [];
|
|
144
|
+
let last = 0;
|
|
145
|
+
const push = (color: string, pos: number) => {
|
|
146
|
+
// Stops must be non-decreasing for Skia. `px` is already clamped to the plot
|
|
147
|
+
// (โ [0, canvasWidth]) so `pos` is within [0,1]; only the monotonic guard is
|
|
148
|
+
// needed โ it keeps overlapping/reversed spans from stepping backwards.
|
|
149
|
+
const p = pos < last ? last : pos;
|
|
150
|
+
colors.push(color);
|
|
151
|
+
positions.push(p);
|
|
152
|
+
last = p;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
push(baseColor, 0);
|
|
156
|
+
for (let i = 0; i < spans.length; i++) {
|
|
157
|
+
const span = spans[i];
|
|
158
|
+
push(baseColor, span.f1); // hard edge: base line up to the segment start
|
|
159
|
+
const n = span.cols.length;
|
|
160
|
+
if (n === 1) {
|
|
161
|
+
push(span.cols[0], span.f1);
|
|
162
|
+
push(span.cols[0], span.f2);
|
|
163
|
+
} else {
|
|
164
|
+
for (let k = 0; k < n; k++) {
|
|
165
|
+
push(span.cols[k], span.f1 + (k / (n - 1)) * (span.f2 - span.f1));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
push(baseColor, span.f2); // hard edge: back to the base line after the segment
|
|
169
|
+
}
|
|
170
|
+
push(baseColor, 1);
|
|
171
|
+
|
|
172
|
+
return { colors, positions };
|
|
173
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -115,6 +115,57 @@ export interface ReferenceLine {
|
|
|
115
115
|
badgeRadius?: number;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
/**
|
|
119
|
+
* A time-range segment of the chart โ e.g. a pre-market / regular / after-hours
|
|
120
|
+
* session โ distinguished with a **scrub-focus** interaction (Robinhood-style
|
|
121
|
+
* extended-hours segmentation). At rest the whole line is one uniform color;
|
|
122
|
+
* while the user scrubs (or when a segment is `active`) the focused segment keeps
|
|
123
|
+
* the base color and every other segment is de-emphasized by recoloring the line
|
|
124
|
+
* stroke itself (no overlay). An optional dashed `divider` + `label` mark a
|
|
125
|
+
* segment's leading edge.
|
|
126
|
+
*/
|
|
127
|
+
export interface ChartSegment {
|
|
128
|
+
/** Segment start, unix seconds. Omit to extend to the chart's left edge. */
|
|
129
|
+
from?: number;
|
|
130
|
+
/** Segment end, unix seconds. Omit to extend to the live edge (now). */
|
|
131
|
+
to?: number;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Participate in scrub-focus line styling. At rest the line is one uniform
|
|
135
|
+
* color; while scrubbing (or when a segment is `active`), the focused segment
|
|
136
|
+
* keeps the base line color and every OTHER `recolorLine` segment is
|
|
137
|
+
* de-emphasized with `mutedColor` / `mutedColors`. Default `true`.
|
|
138
|
+
*/
|
|
139
|
+
recolorLine?: boolean;
|
|
140
|
+
/** De-emphasis line color, used when this segment is NOT the focused one. An
|
|
141
|
+
* alpha-reduced color (e.g. `"rgba(154,160,166,0.4)"`) fades the line โ it
|
|
142
|
+
* paints the stroke directly, not a layer on top. Defaults to the chart's muted
|
|
143
|
+
* palette color (`palette.gridLabel`). */
|
|
144
|
+
mutedColor?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Two or more CSS colors โ horizontal gradient across the segment's sub-range
|
|
147
|
+
* (left โ right) for the de-emphasized state, mirroring `LineConfig.colors`.
|
|
148
|
+
* Takes precedence over `mutedColor` when set.
|
|
149
|
+
*/
|
|
150
|
+
mutedColors?: string[];
|
|
151
|
+
|
|
152
|
+
/** Force this segment to be the focused one without scrubbing โ it stays full
|
|
153
|
+
* while the others are de-emphasized (e.g. the session is currently after-hours). */
|
|
154
|
+
active?: boolean;
|
|
155
|
+
|
|
156
|
+
/** Draw a vertical dashed divider at the `from` edge (market-close marker). Default `false`. */
|
|
157
|
+
divider?: boolean;
|
|
158
|
+
/** Divider color. Defaults to the chart's reference-line color (`palette.refLine`). */
|
|
159
|
+
dividerColor?: string;
|
|
160
|
+
|
|
161
|
+
/** Optional label captioning the divider at the top of the segment. Shown only
|
|
162
|
+
* when `divider` is set; drawn in the chart's reference-label color
|
|
163
|
+
* (`palette.refLabel`). */
|
|
164
|
+
label?: string;
|
|
165
|
+
/** Label horizontal anchor within the segment. Default `"left"`. */
|
|
166
|
+
labelPosition?: "left" | "right";
|
|
167
|
+
}
|
|
168
|
+
|
|
118
169
|
/** Per-instance grid-line styling for the horizontal value-axis grid. */
|
|
119
170
|
export interface GridStyleConfig {
|
|
120
171
|
/** Stroke color. Defaults to palette `gridLine`. */
|
|
@@ -871,6 +922,13 @@ export interface LiveChartProps extends LiveChartCoreProps {
|
|
|
871
922
|
dot?: boolean | DotConfig;
|
|
872
923
|
/** Horizontal dashed line at the current live value. `true` = defaults, or pass `ValueLineConfig`. */
|
|
873
924
|
valueLine?: boolean | ValueLineConfig;
|
|
925
|
+
/**
|
|
926
|
+
* Time-range segments (sessions, after-hours, overnight, etc.). At rest the
|
|
927
|
+
* line is one uniform color; scrubbing a {@link ChartSegment} โ or marking one
|
|
928
|
+
* `active` โ keeps it full while the others de-emphasize (`mutedColor` /
|
|
929
|
+
* `mutedColors`). Optional dashed `divider` + `label` mark a segment's edge.
|
|
930
|
+
*/
|
|
931
|
+
segments?: ChartSegment[];
|
|
874
932
|
/** Render the live value as a large text overlay in the top-left. Default `false`. */
|
|
875
933
|
showValue?: boolean;
|
|
876
934
|
/** Tint the `showValue` text by momentum (green up / red down). Default `false`. */
|