@tidal-ts/chart 0.16.0 → 0.17.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/TimeSeriesChart.d.ts +10 -2
- package/dist/TimeSeriesChart.js +2 -2
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { ChartSeries } from './types.js';
|
|
3
|
-
import type { ChartTheme, LiveValue, TrackerInfo } from '@pond-ts/charts';
|
|
3
|
+
import type { ChartContainerProps, ChartTheme, LiveValue, TrackerInfo } from '@pond-ts/charts';
|
|
4
4
|
import { aggregateColumn, type Segment } from '@tidal-ts/core';
|
|
5
5
|
import { type ChartSettings } from './chartSettings.js';
|
|
6
6
|
import { type SeriesAxis, type SeriesConfig } from './series.js';
|
|
@@ -208,6 +208,14 @@ export interface TimeSeriesChartProps {
|
|
|
208
208
|
* with {@link onViewRangeChange} (pan + wheel-zoom round-trip through the
|
|
209
209
|
* host, so pill state / persistence can react). */
|
|
210
210
|
viewRange?: readonly [number, number] | null;
|
|
211
|
+
/**
|
|
212
|
+
* The plot's own pan/zoom gesture, passed to charts' `ChartContainer`. Default
|
|
213
|
+
* `true`: drag pans the window and the wheel zooms it. A chart inside a
|
|
214
|
+
* scrolling container wants `'none'` (or `'pan'`), since a wheel the plot
|
|
215
|
+
* takes for zoom can never scroll the page under it. The y gutters' gesture is
|
|
216
|
+
* {@link onAxisBounds}'s, not this.
|
|
217
|
+
*/
|
|
218
|
+
panZoom?: ChartContainerProps['panZoom'];
|
|
211
219
|
/** Fires on every pan/zoom step with the new window. Wiring it makes the
|
|
212
220
|
* view CONTROLLED (the library keys controlled-ness on this callback);
|
|
213
221
|
* omitting it falls back to the library's uncontrolled internal view, which
|
|
@@ -350,7 +358,7 @@ export declare function splitBarColumns(agg: ChartSeries, col: string, src: Char
|
|
|
350
358
|
* chips can track the hovered point. Memoized — the caller's hover state re-renders
|
|
351
359
|
* chips, not the canvas (keep prop identities stable).
|
|
352
360
|
*/
|
|
353
|
-
declare function TimeSeriesChartInner({ rows, sources, ohlcSources, calendarDays, annotations, coarseSources, dimmed, splitters, onTracker, onStats, pricePill, collapseWeekends, settings, timeZone, theme: base, resolveColor, colorScheme, viewRange, onViewRangeChange, axisOptions, onAxisClick, onAxisBounds, onBarSeries, }: TimeSeriesChartProps): import("react").JSX.Element;
|
|
361
|
+
declare function TimeSeriesChartInner({ rows, sources, ohlcSources, calendarDays, annotations, coarseSources, dimmed, splitters, onTracker, onStats, pricePill, collapseWeekends, settings, timeZone, theme: base, resolveColor, colorScheme, viewRange, onViewRangeChange, panZoom, axisOptions, onAxisClick, onAxisBounds, onBarSeries, }: TimeSeriesChartProps): import("react").JSX.Element;
|
|
354
362
|
/** Memoized export — hover state in the terminal re-renders the chips, not the
|
|
355
363
|
* canvas. */
|
|
356
364
|
export declare const TimeSeriesChart: import("react").MemoExoticComponent<typeof TimeSeriesChartInner>;
|
package/dist/TimeSeriesChart.js
CHANGED
|
@@ -310,7 +310,7 @@ export function splitBarColumns(agg, col, src, hasOhlc, window, sessions) {
|
|
|
310
310
|
* chips can track the hovered point. Memoized — the caller's hover state re-renders
|
|
311
311
|
* chips, not the canvas (keep prop identities stable).
|
|
312
312
|
*/
|
|
313
|
-
function TimeSeriesChartInner({ rows, sources, ohlcSources = EMPTY_SOURCES, calendarDays = EMPTY_DAYS, annotations = EMPTY_ANNOTATIONS, coarseSources = EMPTY_SOURCES, dimmed = [], splitters, onTracker, onStats, pricePill, collapseWeekends, settings = DEFAULT_CHART_SETTINGS, timeZone, theme: base, resolveColor = sameColor, colorScheme = 'dark', viewRange, onViewRangeChange, axisOptions, onAxisClick, onAxisBounds, onBarSeries, }) {
|
|
313
|
+
function TimeSeriesChartInner({ rows, sources, ohlcSources = EMPTY_SOURCES, calendarDays = EMPTY_DAYS, annotations = EMPTY_ANNOTATIONS, coarseSources = EMPTY_SOURCES, dimmed = [], splitters, onTracker, onStats, pricePill, collapseWeekends, settings = DEFAULT_CHART_SETTINGS, timeZone, theme: base, resolveColor = sameColor, colorScheme = 'dark', viewRange, onViewRangeChange, panZoom = true, axisOptions, onAxisClick, onAxisBounds, onBarSeries, }) {
|
|
314
314
|
const [ref, width] = useMeasuredWidth();
|
|
315
315
|
// Which y-axis gutter the pointer is over (the hover affordance). Axis
|
|
316
316
|
// chrome is DOM, so this repaints the gutter only — never the canvas.
|
|
@@ -1075,7 +1075,7 @@ function TimeSeriesChartInner({ rows, sources, ohlcSources = EMPTY_SOURCES, cale
|
|
|
1075
1075
|
// onTimeRangeChange), so pill state and persistence stay in sync and a
|
|
1076
1076
|
// pill click can reset the viewport (uncontrolled mode ignores later
|
|
1077
1077
|
// `range` changes once the user pans). No view ⇒ auto-fit the data.
|
|
1078
|
-
panZoom:
|
|
1078
|
+
panZoom: panZoom,
|
|
1079
1079
|
// …and the y GUTTERS take their own gesture: drag one to PAN that axis
|
|
1080
1080
|
// alone, wheel to zoom it (0.64 aligned the drag with the x strip —
|
|
1081
1081
|
// before that a drag scaled). Deliberately `'y'` — the x strip would
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tidal-ts/chart",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "TimeSeriesChart — a multi-row time-series chart on @pond-ts/charts, plus the series and settings vocabulary and the prepare step. Theme, colours and settings arrive as props.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react": "^18.2.0 || ^19.0.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@tidal-ts/core": "0.
|
|
41
|
+
"@tidal-ts/core": "0.17.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@pond-ts/charts": "^0.75.0",
|