@tensor_1/react 2.40.0 → 2.40.2

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.
@@ -95,7 +95,9 @@ declare function eventMarks(events: readonly ChartEvent[], options: {
95
95
  /**
96
96
  * A forecast as three series: a hidden lower bound, the band stacked on it (upper − lower) in
97
97
  * `--uix-chart-forecast-band`, and the dashed centre line in the series colour, starting at `from`.
98
- * The centre carries a light "Projection" wash from `from` to the last point.
98
+ * The centre carries a "Projection" label over the projected stretch, unless `regionLabel` is
99
+ * false — ChartPanels turns it off, because its legend already names the dashed line and, in a
100
+ * narrow panel, the label collides with a threshold's gutter label.
99
101
  */
100
102
  declare function forecastSeries(forecast: ChartForecast, options: {
101
103
  name: string;
@@ -107,6 +109,8 @@ declare function forecastSeries(forecast: ChartForecast, options: {
107
109
  xAxisIndex?: number;
108
110
  yAxisIndex?: number;
109
111
  idPrefix?: string;
112
+ /** Label the projected stretch "Projection" inside the plot (default true). */
113
+ regionLabel?: boolean;
110
114
  }): LineSeriesOption[];
111
115
  /** The previous period as a thin SOLID ghost line (dashes are reserved for projections). */
112
116
  declare function comparisonSeries(comparison: ChartComparison, options: {
@@ -161,7 +161,7 @@ function forecastSeries(forecast, options) {
161
161
  symbol: "none",
162
162
  animation: false,
163
163
  z: 3,
164
- ...last ? {
164
+ ...last && options.regionLabel !== false ? {
165
165
  markArea: markAreaBase([[
166
166
  {
167
167
  xAxis: forecast.from,
@@ -539,7 +539,7 @@ function forecastSeries(forecast, options) {
539
539
  symbol: "none",
540
540
  animation: false,
541
541
  z: 3,
542
- ...last ? {
542
+ ...last && options.regionLabel !== false ? {
543
543
  markArea: markAreaBase([[
544
544
  {
545
545
  xAxis: forecast.from,
@@ -809,7 +809,7 @@ function chartPanelsModel(spec, tokens, labelOverrides) {
809
809
  const fromIndex = spec.x.values.findIndex((x) => sameX(x, panel.forecast.from));
810
810
  const fromValue = fromIndex >= 0 ? primary.values[fromIndex] ?? null : null;
811
811
  const colorIndex = primary.colorIndex ?? 0;
812
- const fc = forecastSeries(panel.forecast, { name: primary.label, colorIndex, tokens, labels, fromValue, ...axes, idPrefix: `${panel.id}:forecast` });
812
+ const fc = forecastSeries(panel.forecast, { name: primary.label, colorIndex, tokens, labels, fromValue, ...axes, idPrefix: `${panel.id}:forecast`, regionLabel: false });
813
813
  for (const s of fc) seriesPanel[String(s.id)] = panel.id;
814
814
  series.push(...fc);
815
815
  if (!legend.some((item) => item.swatch === "dash")) {
@@ -100,7 +100,9 @@ declare function eventMarks(events: readonly ChartEvent[], options: {
100
100
  /**
101
101
  * A forecast as three series: a hidden lower bound, the band stacked on it (upper − lower) in
102
102
  * `--uix-chart-forecast-band`, and the dashed centre line in the series colour, starting at `from`.
103
- * The centre carries a light "Projection" wash from `from` to the last point.
103
+ * The centre carries a "Projection" label over the projected stretch, unless `regionLabel` is
104
+ * false — ChartPanels turns it off, because its legend already names the dashed line and, in a
105
+ * narrow panel, the label collides with a threshold's gutter label.
104
106
  */
105
107
  declare function forecastSeries(forecast: ChartForecast, options: {
106
108
  name: string;
@@ -112,6 +114,8 @@ declare function forecastSeries(forecast: ChartForecast, options: {
112
114
  xAxisIndex?: number;
113
115
  yAxisIndex?: number;
114
116
  idPrefix?: string;
117
+ /** Label the projected stretch "Projection" inside the plot (default true). */
118
+ regionLabel?: boolean;
115
119
  }): LineSeriesOption[];
116
120
  /** The previous period as a thin SOLID ghost line (dashes are reserved for projections). */
117
121
  declare function comparisonSeries(comparison: ChartComparison, options: {
@@ -192,7 +192,7 @@ function chartPanelsModel(spec, tokens, labelOverrides) {
192
192
  const fromIndex = spec.x.values.findIndex((x) => sameX(x, panel.forecast.from));
193
193
  const fromValue = fromIndex >= 0 ? primary.values[fromIndex] ?? null : null;
194
194
  const colorIndex = primary.colorIndex ?? 0;
195
- const fc = forecastSeries(panel.forecast, { name: primary.label, colorIndex, tokens, labels, fromValue, ...axes, idPrefix: `${panel.id}:forecast` });
195
+ const fc = forecastSeries(panel.forecast, { name: primary.label, colorIndex, tokens, labels, fromValue, ...axes, idPrefix: `${panel.id}:forecast`, regionLabel: false });
196
196
  for (const s of fc) seriesPanel[String(s.id)] = panel.id;
197
197
  series.push(...fc);
198
198
  if (!legend.some((item) => item.swatch === "dash")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tensor_1/react",
3
- "version": "2.40.0",
3
+ "version": "2.40.2",
4
4
  "description": "Thin React wrappers over the UIx v2 CSS component library.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",