@tidal-ts/chart 0.6.0 → 0.7.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.
@@ -636,6 +636,11 @@ function TimeSeriesChartInner({ rows, sources, ohlcSources = [], calendarDays =
636
636
  continue;
637
637
  if (c.style === 'bar') {
638
638
  const col = c.column;
639
+ // A column the data does not carry (a study the engine skipped, a
640
+ // volume study on a series with no volume) draws nothing, as it would
641
+ // as a line: aggregating it throws and takes the whole chart down.
642
+ if (!src.schema.some((sc) => sc.name === col))
643
+ continue;
639
644
  const window = windowFor(c, src);
640
645
  const grid = sessionsFor(src);
641
646
  let agg = aggregateColumn(src, col, window, reducerFor(c), grid);
@@ -643,7 +648,9 @@ function TimeSeriesChartInner({ rows, sources, ohlcSources = [], calendarDays =
643
648
  // (one fill per series; F-charts-12) — split the column into `__up`/`__dn`
644
649
  // halves and draw them as two layers. Same grid, or the halves misalign.
645
650
  if (effectiveSplit(c, settings).mode === 'split')
646
- agg = splitBarColumns(agg, col, src, ohlc.has(c.source), window, grid);
651
+ // A study's bars rise and fall with the STUDY, never with the price
652
+ // candle under them: only a raw column reads the source's open/close.
653
+ agg = splitBarColumns(agg, col, src, ohlc.has(c.source) && !c.derive, window, grid);
647
654
  bar.set(c.id, agg);
648
655
  }
649
656
  // A candle at the data's NATIVE interval feeds the raw point-keyed series
package/dist/series.js CHANGED
@@ -358,9 +358,14 @@ export function effectiveSplit(s, settings = DEFAULT_CHART_SETTINGS) {
358
358
  // because green/red is reserved for market data and an indicator is not
359
359
  // that. The toggle is the asking.
360
360
  (s.colorMode ?? 'single')
361
- : s.style === 'bar' || s.style === 'candle'
362
- ? (s.colorMode ?? legacy ?? (def.split ? 'split' : 'single'))
363
- : 'single';
361
+ : s.style === 'bar' && s.derive && outputMark(s.derive.op, '') === 'bar'
362
+ ? // The same rule for a histogram study (an Awesome Oscillator): an
363
+ // indicator, so its own colour until asked. Only those: a derived
364
+ // metric drawn as bars (realized vol) keeps the app's bar default.
365
+ (s.colorMode ?? 'single')
366
+ : s.style === 'bar' || s.style === 'candle'
367
+ ? (s.colorMode ?? legacy ?? (def.split ? 'split' : 'single'))
368
+ : 'single';
364
369
  return { mode, rise: s.riseColor ?? def.rise, fall: s.fallColor ?? def.fall };
365
370
  }
366
371
  const COMPACT = new Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 2 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidal-ts/chart",
3
- "version": "0.6.0",
3
+ "version": "0.7.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.6.0"
41
+ "@tidal-ts/core": "0.7.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@pond-ts/charts": "^0.70.0",