liveline 0.0.4 → 0.0.6
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 +60 -2
- package/dist/index.cjs +2267 -339
- package/dist/index.d.cts +52 -3
- package/dist/index.d.ts +52 -3
- package/dist/index.js +2266 -339
- package/package.json +16 -11
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { CSSProperties } from 'react';
|
|
2
|
+
import { CSSProperties, ReactElement } from 'react';
|
|
3
3
|
|
|
4
4
|
interface LivelinePoint {
|
|
5
5
|
time: number;
|
|
@@ -39,9 +39,17 @@ interface DegenOptions {
|
|
|
39
39
|
/** Show particles on down-momentum swings (default false) */
|
|
40
40
|
downMomentum?: boolean;
|
|
41
41
|
}
|
|
42
|
+
interface LivelineSeries {
|
|
43
|
+
id: string;
|
|
44
|
+
data: LivelinePoint[];
|
|
45
|
+
value: number;
|
|
46
|
+
color: string;
|
|
47
|
+
label?: string;
|
|
48
|
+
}
|
|
42
49
|
interface LivelineProps {
|
|
43
50
|
data: LivelinePoint[];
|
|
44
51
|
value: number;
|
|
52
|
+
series?: LivelineSeries[];
|
|
45
53
|
theme?: ThemeMode;
|
|
46
54
|
color?: string;
|
|
47
55
|
window?: number;
|
|
@@ -73,10 +81,51 @@ interface LivelineProps {
|
|
|
73
81
|
onHover?: (point: HoverPoint | null) => void;
|
|
74
82
|
cursor?: string;
|
|
75
83
|
pulse?: boolean;
|
|
84
|
+
mode?: 'line' | 'candle';
|
|
85
|
+
candles?: CandlePoint[];
|
|
86
|
+
candleWidth?: number;
|
|
87
|
+
liveCandle?: CandlePoint;
|
|
88
|
+
lineMode?: boolean;
|
|
89
|
+
lineData?: LivelinePoint[];
|
|
90
|
+
lineValue?: number;
|
|
91
|
+
onModeChange?: (mode: 'line' | 'candle') => void;
|
|
92
|
+
onSeriesToggle?: (id: string, visible: boolean) => void;
|
|
93
|
+
seriesToggleCompact?: boolean;
|
|
76
94
|
className?: string;
|
|
77
95
|
style?: CSSProperties;
|
|
78
96
|
}
|
|
97
|
+
interface CandlePoint {
|
|
98
|
+
time: number;
|
|
99
|
+
open: number;
|
|
100
|
+
high: number;
|
|
101
|
+
low: number;
|
|
102
|
+
close: number;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare function Liveline({ data, value, series: seriesProp, theme, color, window: windowSecs, grid, badge, momentum, fill, scrub, loading, paused, emptyText, exaggerate, degen: degenProp, badgeTail, badgeVariant, showValue, valueMomentumColor, windows, onWindowChange, windowStyle, tooltipY, tooltipOutline, orderbook, referenceLine, formatValue, formatTime, lerpSpeed, padding: paddingOverride, onHover, cursor, pulse, mode, candles, candleWidth, liveCandle, lineMode, lineData, lineValue, onModeChange, onSeriesToggle, seriesToggleCompact, className, style, }: LivelineProps): react_jsx_runtime.JSX.Element;
|
|
79
106
|
|
|
80
|
-
|
|
107
|
+
interface LivelineTransitionProps {
|
|
108
|
+
/** Key of the active child to display. Must match a child's `key` prop. */
|
|
109
|
+
active: string;
|
|
110
|
+
/** Chart elements with unique `key` props */
|
|
111
|
+
children: ReactElement | ReactElement[];
|
|
112
|
+
/** Cross-fade duration in ms (default 300) */
|
|
113
|
+
duration?: number;
|
|
114
|
+
className?: string;
|
|
115
|
+
style?: CSSProperties;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Cross-fade between chart components (e.g. line ↔ candlestick).
|
|
119
|
+
* Children must have unique `key` props matching possible `active` values.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```tsx
|
|
123
|
+
* <LivelineTransition active={chartType}>
|
|
124
|
+
* <Liveline key="line" data={data} value={value} />
|
|
125
|
+
* <Liveline key="candle" mode="candle" candles={candles} candleWidth={5} data={data} value={value} />
|
|
126
|
+
* </LivelineTransition>
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
declare function LivelineTransition({ active, children, duration, className, style, }: LivelineTransitionProps): react_jsx_runtime.JSX.Element;
|
|
81
130
|
|
|
82
|
-
export { type BadgeVariant, type DegenOptions, type HoverPoint, Liveline, type LivelinePoint, type LivelineProps, type Momentum, type OrderbookData, type Padding, type ReferenceLine, type ThemeMode, type WindowOption, type WindowStyle };
|
|
131
|
+
export { type BadgeVariant, type CandlePoint, type DegenOptions, type HoverPoint, Liveline, type LivelinePoint, type LivelineProps, type LivelineSeries, LivelineTransition, type LivelineTransitionProps, type Momentum, type OrderbookData, type Padding, type ReferenceLine, type ThemeMode, type WindowOption, type WindowStyle };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { CSSProperties } from 'react';
|
|
2
|
+
import { CSSProperties, ReactElement } from 'react';
|
|
3
3
|
|
|
4
4
|
interface LivelinePoint {
|
|
5
5
|
time: number;
|
|
@@ -39,9 +39,17 @@ interface DegenOptions {
|
|
|
39
39
|
/** Show particles on down-momentum swings (default false) */
|
|
40
40
|
downMomentum?: boolean;
|
|
41
41
|
}
|
|
42
|
+
interface LivelineSeries {
|
|
43
|
+
id: string;
|
|
44
|
+
data: LivelinePoint[];
|
|
45
|
+
value: number;
|
|
46
|
+
color: string;
|
|
47
|
+
label?: string;
|
|
48
|
+
}
|
|
42
49
|
interface LivelineProps {
|
|
43
50
|
data: LivelinePoint[];
|
|
44
51
|
value: number;
|
|
52
|
+
series?: LivelineSeries[];
|
|
45
53
|
theme?: ThemeMode;
|
|
46
54
|
color?: string;
|
|
47
55
|
window?: number;
|
|
@@ -73,10 +81,51 @@ interface LivelineProps {
|
|
|
73
81
|
onHover?: (point: HoverPoint | null) => void;
|
|
74
82
|
cursor?: string;
|
|
75
83
|
pulse?: boolean;
|
|
84
|
+
mode?: 'line' | 'candle';
|
|
85
|
+
candles?: CandlePoint[];
|
|
86
|
+
candleWidth?: number;
|
|
87
|
+
liveCandle?: CandlePoint;
|
|
88
|
+
lineMode?: boolean;
|
|
89
|
+
lineData?: LivelinePoint[];
|
|
90
|
+
lineValue?: number;
|
|
91
|
+
onModeChange?: (mode: 'line' | 'candle') => void;
|
|
92
|
+
onSeriesToggle?: (id: string, visible: boolean) => void;
|
|
93
|
+
seriesToggleCompact?: boolean;
|
|
76
94
|
className?: string;
|
|
77
95
|
style?: CSSProperties;
|
|
78
96
|
}
|
|
97
|
+
interface CandlePoint {
|
|
98
|
+
time: number;
|
|
99
|
+
open: number;
|
|
100
|
+
high: number;
|
|
101
|
+
low: number;
|
|
102
|
+
close: number;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare function Liveline({ data, value, series: seriesProp, theme, color, window: windowSecs, grid, badge, momentum, fill, scrub, loading, paused, emptyText, exaggerate, degen: degenProp, badgeTail, badgeVariant, showValue, valueMomentumColor, windows, onWindowChange, windowStyle, tooltipY, tooltipOutline, orderbook, referenceLine, formatValue, formatTime, lerpSpeed, padding: paddingOverride, onHover, cursor, pulse, mode, candles, candleWidth, liveCandle, lineMode, lineData, lineValue, onModeChange, onSeriesToggle, seriesToggleCompact, className, style, }: LivelineProps): react_jsx_runtime.JSX.Element;
|
|
79
106
|
|
|
80
|
-
|
|
107
|
+
interface LivelineTransitionProps {
|
|
108
|
+
/** Key of the active child to display. Must match a child's `key` prop. */
|
|
109
|
+
active: string;
|
|
110
|
+
/** Chart elements with unique `key` props */
|
|
111
|
+
children: ReactElement | ReactElement[];
|
|
112
|
+
/** Cross-fade duration in ms (default 300) */
|
|
113
|
+
duration?: number;
|
|
114
|
+
className?: string;
|
|
115
|
+
style?: CSSProperties;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Cross-fade between chart components (e.g. line ↔ candlestick).
|
|
119
|
+
* Children must have unique `key` props matching possible `active` values.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```tsx
|
|
123
|
+
* <LivelineTransition active={chartType}>
|
|
124
|
+
* <Liveline key="line" data={data} value={value} />
|
|
125
|
+
* <Liveline key="candle" mode="candle" candles={candles} candleWidth={5} data={data} value={value} />
|
|
126
|
+
* </LivelineTransition>
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
declare function LivelineTransition({ active, children, duration, className, style, }: LivelineTransitionProps): react_jsx_runtime.JSX.Element;
|
|
81
130
|
|
|
82
|
-
export { type BadgeVariant, type DegenOptions, type HoverPoint, Liveline, type LivelinePoint, type LivelineProps, type Momentum, type OrderbookData, type Padding, type ReferenceLine, type ThemeMode, type WindowOption, type WindowStyle };
|
|
131
|
+
export { type BadgeVariant, type CandlePoint, type DegenOptions, type HoverPoint, Liveline, type LivelinePoint, type LivelineProps, type LivelineSeries, LivelineTransition, type LivelineTransitionProps, type Momentum, type OrderbookData, type Padding, type ReferenceLine, type ThemeMode, type WindowOption, type WindowStyle };
|