@tidal-ts/chart 0.14.0 → 0.15.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/index.d.ts CHANGED
@@ -16,7 +16,7 @@ export type { ChartSeries } from './types.js';
16
16
  export { configAxisId, effectiveSplit, formatSeriesValue, isStudySeries, LINE_WIDTHS, PAIR_JOINS, PAIR_LENSES, seriesAxisId, readsCompare, seriesDrawn, seriesCategoryStyle, seriesLineDashArray, seriesLineWidth, sharedAxisId, type AxisRange, effectiveAxisBounds, clampBoundsToLocks, barZeroLock, centerOnZero, axisRangeIsEmpty, axisFormat, fractionTicks, bandColumns, configBand, configColumns, configOutputs, configSpecs, dashPattern, fanIsBand, LINE_DASHES, OUTPUT_DASHES, outputKey, outputLook, publishedColumns, type ConfigOutput, type OutputLook, type OutputStyle, hasBarOutput, offersOutputBars, logAllowed, AXIS_PRECISIONS, type PairJoinOp, type PairLensOp, type SeriesGroup, type PairPartView, type PairView, type SeriesBinding, type SeriesConfig, type SeriesAxis, type SeriesStyle, type SeriesWindow, type CandleVariant, type ColorBy, readsFrom, sourcesOf, } from './series.js';
17
17
  export { DEFAULT_CHART_SETTINGS, mergeChartSettings, type AnnotationOverride, type ChartSettings, type CategoryLineStyle, type SessionDividers, type SplitColorDefault, type LineDash, } from './chartSettings.js';
18
18
  export { useMeasuredWidth, useMeasuredSize } from './useMeasuredWidth.js';
19
- export { assembleRows, carries, foldKey, foldSources, prepareChart, sourceFacts, type ConfigRow, type PreparedRow, type SourceFacts, type SourceHold, type SourceInput, type SourceInputs, } from './prepare.js';
19
+ export { assembleRows, carries, foldKey, foldSources, foldSourcesReport, type SourceFoldReport, prepareChart, sourceFacts, type ConfigRow, type PreparedRow, type SourceFacts, type SourceHold, type SourceInput, type SourceInputs, } from './prepare.js';
20
20
  export { finiteColumns, firstLast, lastRow } from './seriesFacts.js';
21
21
  export { createLiveValue } from '@pond-ts/charts';
22
22
  export type { TrackerInfo, TrackerSample, LiveValue } from '@pond-ts/charts';
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ export { TimeSeriesChart, annotationInView, } from './TimeSeriesChart.js';
15
15
  export { configAxisId, effectiveSplit, formatSeriesValue, isStudySeries, LINE_WIDTHS, PAIR_JOINS, PAIR_LENSES, seriesAxisId, readsCompare, seriesDrawn, seriesCategoryStyle, seriesLineDashArray, seriesLineWidth, sharedAxisId, effectiveAxisBounds, clampBoundsToLocks, barZeroLock, centerOnZero, axisRangeIsEmpty, axisFormat, fractionTicks, bandColumns, configBand, configColumns, configOutputs, configSpecs, dashPattern, fanIsBand, LINE_DASHES, OUTPUT_DASHES, outputKey, outputLook, publishedColumns, hasBarOutput, offersOutputBars, logAllowed, AXIS_PRECISIONS, readsFrom, sourcesOf, } from './series.js';
16
16
  export { DEFAULT_CHART_SETTINGS, mergeChartSettings, } from './chartSettings.js';
17
17
  export { useMeasuredWidth, useMeasuredSize } from './useMeasuredWidth.js';
18
- export { assembleRows, carries, foldKey, foldSources, prepareChart, sourceFacts, } from './prepare.js';
18
+ export { assembleRows, carries, foldKey, foldSources, foldSourcesReport, prepareChart, sourceFacts, } from './prepare.js';
19
19
  export { finiteColumns, firstLast, lastRow } from './seriesFacts.js';
20
20
  // Re-exported so a host wires the live pill / tracker without a second import
21
21
  // site for the library the chart is built on.
package/dist/prepare.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { DeriveNodeTiming, DeriveSkip } from '@tidal-ts/core';
1
2
  import { type SeriesConfig } from './series.js';
2
3
  import type { ChartSeries } from './types.js';
3
4
  /**
@@ -109,6 +110,27 @@ export declare function foldKey(configs: readonly SeriesConfig[]): string;
109
110
  * source is the caller's affair (it will not be carried).
110
111
  */
111
112
  export declare function foldSources(inputs: SourceInputs, configs: readonly SeriesConfig[]): Record<string, ChartSeries>;
113
+ /** What a fold did to one source — {@link foldSourcesReport}. */
114
+ export interface SourceFoldReport {
115
+ /** Rows in the series as the chart gets it: for a held source (`hold`),
116
+ * the grid's length, not the source's own. */
117
+ rows: number;
118
+ /** The specs the engine could not run, once each (`applyDerivedReport`). */
119
+ skipped: DeriveSkip[];
120
+ /** Each step as the engine ran it: cost, and whether it was served warm. */
121
+ nodes: DeriveNodeTiming[];
122
+ /** The whole fold of this source, join and hold included, in ms. */
123
+ ms: number;
124
+ }
125
+ /**
126
+ * {@link foldSources} with the report: per source, what the engine skipped and
127
+ * what each step cost — what a pipeline view shows on its nodes. The same fold;
128
+ * `foldSources` is this without the report.
129
+ */
130
+ export declare function foldSourcesReport(inputs: SourceInputs, configs: readonly SeriesConfig[]): {
131
+ sources: Record<string, ChartSeries>;
132
+ reports: Record<string, SourceFoldReport>;
133
+ };
112
134
  /** Per-source data facts, read columnar: which columns carry real (finite)
113
135
  * values ("show only what the data carries") and the latest bar (the chip /
114
136
  * controls value readout). One `toObjects()` pass per source here was the
package/dist/prepare.js CHANGED
@@ -1,4 +1,4 @@
1
- import { applyDerived, COMPARE_PREFIX, holdAcrossGrid, joinUnderPrefix, usesCompare, } from '@tidal-ts/core';
1
+ import { applyDerivedReport, COMPARE_PREFIX, holdAcrossGrid, joinUnderPrefix, usesCompare, } from '@tidal-ts/core';
2
2
  import { configColumns, configSpecs } from './series.js';
3
3
  import { finiteColumns, lastRow } from './seriesFacts.js';
4
4
  /** The series with one row per key, the last of each run: a restatement
@@ -58,10 +58,20 @@ export function foldKey(configs) {
58
58
  * source is the caller's affair (it will not be carried).
59
59
  */
60
60
  export function foldSources(inputs, configs) {
61
+ return foldSourcesReport(inputs, configs).sources;
62
+ }
63
+ /**
64
+ * {@link foldSources} with the report: per source, what the engine skipped and
65
+ * what each step cost — what a pipeline view shows on its nodes. The same fold;
66
+ * `foldSources` is this without the report.
67
+ */
68
+ export function foldSourcesReport(inputs, configs) {
61
69
  const specs = specsBySource(configs);
62
70
  const rawCompare = new Set(rawCompareSources(configs));
63
- const out = {};
71
+ const sources = {};
72
+ const reports = {};
64
73
  for (const [key, input] of Object.entries(inputs)) {
74
+ const t0 = performance.now();
65
75
  const mine = specs[key] ?? [];
66
76
  // A coarse source is folded before it is held, so a restated row has to go
67
77
  // first, or the join pairs it with nothing and a study counts it as a bar
@@ -76,10 +86,19 @@ export function foldSources(inputs, configs) {
76
86
  // not the library's `onConflict: 'prefix'`).
77
87
  if (compare && (rawCompare.has(key) || mine.some(usesCompare)))
78
88
  series = joinUnderPrefix(series, compare);
79
- const folded = applyDerived(series, mine);
80
- out[key] = input.hold ? holdAcrossGrid(folded, input.hold.grid, input.hold.grainMs) : folded;
89
+ const folded = applyDerivedReport(series, mine);
90
+ const out = input.hold
91
+ ? holdAcrossGrid(folded.series, input.hold.grid, input.hold.grainMs)
92
+ : folded.series;
93
+ sources[key] = out;
94
+ reports[key] = {
95
+ rows: out.length,
96
+ skipped: folded.skipped,
97
+ nodes: folded.nodes,
98
+ ms: Math.round((performance.now() - t0) * 1000) / 1000,
99
+ };
81
100
  }
82
- return out;
101
+ return { sources, reports };
83
102
  }
84
103
  /** Per-source data facts, read columnar: which columns carry real (finite)
85
104
  * values ("show only what the data carries") and the latest bar (the chip /
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidal-ts/chart",
3
- "version": "0.14.0",
3
+ "version": "0.15.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.14.0"
41
+ "@tidal-ts/core": "0.15.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@pond-ts/charts": "^0.73.0",