@sybilion/uilib 1.7.1 → 1.8.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/agent-glossary/content-prompt.generated.ts +2 -0
- package/dist/agent-glossary/content.generated.ts +2 -0
- package/dist/agent-glossary/content.md +2 -0
- package/dist/agent-glossary/content.prompt.md +2 -0
- package/dist/agent-glossary/workspace.generated.ts +1 -0
- package/dist/agent-glossary/workspace.index.md +1 -0
- package/dist/agent-glossary/workspace.md +1 -0
- package/dist/esm/src/components/ui/AnalysesSelector/AnalysesSelector.js +37 -20
- package/dist/esm/src/components/ui/Chart/Chart.styl.js +2 -2
- package/dist/esm/src/components/ui/Chart/components/BaseChartWrapper.js +46 -51
- package/dist/esm/src/components/ui/Chart/components/ChartContainer.js +2 -2
- package/dist/esm/src/components/ui/Chart/components/ChartGrid.js +2 -2
- package/dist/esm/src/components/ui/Chart/components/ChartLegendContent.js +2 -2
- package/dist/esm/src/components/ui/Chart/components/ChartLegendItem.js +2 -2
- package/dist/esm/src/components/ui/Chart/components/ChartTooltipContent.js +2 -2
- package/dist/esm/src/components/ui/Chart/components/ChartTooltipItem.js +3 -3
- package/dist/esm/src/components/ui/Chart/components/CustomChartLegend/CustomChartLegend.js +8 -3
- package/dist/esm/src/components/ui/Chart/components/LegendSvg/LegendSvg.js +1 -1
- package/dist/esm/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.js +17 -6
- package/dist/esm/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.js +40 -10
- package/dist/esm/src/components/ui/ChartAreaInteractive/ChartLines.js +43 -13
- package/dist/esm/src/components/ui/ChartAreaInteractive/chartHistories.js +44 -0
- package/dist/esm/src/components/ui/ChartAreaInteractive/overlays/useChartYRange.js +32 -7
- package/dist/esm/src/components/ui/Page/PageTabs/PageTabs.styl.js +2 -2
- package/dist/esm/src/components/ui/Page/PageXScroll/PageXScroll.js +50 -15
- package/dist/esm/src/components/ui/StackedAreaChart/StackedAreaChart.helpers.js +212 -0
- package/dist/esm/src/components/ui/StackedAreaChart/StackedAreaChart.js +123 -0
- package/dist/esm/src/components/ui/StackedAreaChart/StackedAreaChart.styl.js +7 -0
- package/dist/esm/src/components/ui/StackedAreaChart/StackedAreaChart.tooltip.js +29 -0
- package/dist/esm/src/index.js +3 -1
- package/dist/esm/src/utils/chartConnectionPoint.js +31 -16
- package/dist/esm/types/src/components/ui/AnalysesSelector/AnalysesSelector.d.ts +1 -1
- package/dist/esm/types/src/components/ui/AnalysesSelector/AnalysesSelector.types.d.ts +12 -0
- package/dist/esm/types/src/components/ui/AnalysesSelector/index.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Chart/components/BaseChartWrapper.d.ts +8 -0
- package/dist/esm/types/src/components/ui/Chart/components/CustomChartLegend/CustomChartLegend.d.ts +8 -1
- package/dist/esm/types/src/components/ui/Chart/components/LegendSvg/LegendSvg.d.ts +2 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.d.ts +1 -1
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.d.ts +5 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/ChartLines.d.ts +19 -1
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/chartHistories.d.ts +40 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/index.d.ts +1 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/overlays/useChartYRange.d.ts +6 -1
- package/dist/esm/types/src/components/ui/Page/PageXScroll/PageXScroll.d.ts +1 -1
- package/dist/esm/types/src/components/ui/StackedAreaChart/StackedAreaChart.d.ts +3 -0
- package/dist/esm/types/src/components/ui/StackedAreaChart/StackedAreaChart.helpers.d.ts +65 -0
- package/dist/esm/types/src/components/ui/StackedAreaChart/StackedAreaChart.tooltip.d.ts +20 -0
- package/dist/esm/types/src/components/ui/StackedAreaChart/StackedAreaChart.types.d.ts +85 -0
- package/dist/esm/types/src/components/ui/StackedAreaChart/index.d.ts +2 -0
- package/dist/esm/types/src/docs/pages/StackedAreaChartPage.d.ts +1 -0
- package/dist/esm/types/src/index.d.ts +1 -0
- package/dist/esm/types/src/utils/chartConnectionPoint.d.ts +11 -3
- package/dist/esm/types/tests/chartHistories.test.d.ts +1 -0
- package/dist/esm/types/tests/pageXScroll.test.d.ts +1 -0
- package/dist/esm/types/tests/stackedAreaChart.test.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/ui/AnalysesSelector/AnalysesSelector.tsx +50 -22
- package/src/components/ui/AnalysesSelector/AnalysesSelector.types.ts +13 -0
- package/src/components/ui/AnalysesSelector/index.ts +1 -0
- package/src/components/ui/Chart/components/BaseChartWrapper.tsx +71 -52
- package/src/components/ui/Chart/components/CustomChartLegend/CustomChartLegend.tsx +21 -1
- package/src/components/ui/Chart/components/LegendSvg/LegendSvg.tsx +3 -1
- package/src/components/ui/ChartAreaInteractive/AGENT.md +2 -0
- package/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.ts +27 -5
- package/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.tsx +64 -10
- package/src/components/ui/ChartAreaInteractive/ChartLines.tsx +86 -30
- package/src/components/ui/ChartAreaInteractive/chartHistories.ts +63 -0
- package/src/components/ui/ChartAreaInteractive/index.ts +1 -0
- package/src/components/ui/ChartAreaInteractive/overlays/useChartYRange.ts +52 -6
- package/src/components/ui/Page/AGENT.md +2 -0
- package/src/components/ui/Page/PageTabs/PageTabs.styl +8 -0
- package/src/components/ui/Page/PageXScroll/PageXScroll.tsx +57 -13
- package/src/components/ui/StackedAreaChart/AGENT.md +26 -0
- package/src/components/ui/StackedAreaChart/StackedAreaChart.helpers.ts +268 -0
- package/src/components/ui/StackedAreaChart/StackedAreaChart.styl +32 -0
- package/src/components/ui/StackedAreaChart/StackedAreaChart.styl.d.ts +13 -0
- package/src/components/ui/StackedAreaChart/StackedAreaChart.tooltip.tsx +82 -0
- package/src/components/ui/StackedAreaChart/StackedAreaChart.tsx +416 -0
- package/src/components/ui/StackedAreaChart/StackedAreaChart.types.ts +97 -0
- package/src/components/ui/StackedAreaChart/index.ts +2 -0
- package/src/docs/pages/ChartAreaInteractivePage.tsx +67 -0
- package/src/docs/pages/StackedAreaChartPage.tsx +141 -0
- package/src/docs/registry.ts +6 -0
- package/src/index.ts +1 -0
- package/src/utils/chartConnectionPoint.ts +41 -18
- package/src/components/ui/Chart/chart-types.csv +0 -33
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { NumberControl } from '#uilib/components/ui/NumberControl';
|
|
4
|
+
import { PageContentSection, SectionHeader } from '#uilib/components/ui/Page';
|
|
5
|
+
import type {
|
|
6
|
+
StackedAreaChartDatum,
|
|
7
|
+
StackedAreaChartLayer,
|
|
8
|
+
StackedAreaChartOverlay,
|
|
9
|
+
} from '#uilib/components/ui/StackedAreaChart';
|
|
10
|
+
import { StackedAreaChart } from '#uilib/components/ui/StackedAreaChart';
|
|
11
|
+
import StackedAreaChartGuidance from '#uilib/components/ui/StackedAreaChart/AGENT.md';
|
|
12
|
+
|
|
13
|
+
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
14
|
+
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
15
|
+
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
16
|
+
|
|
17
|
+
/** Invented monthly cost layers per kg, three years from Jan 2023. */
|
|
18
|
+
const COST_ROWS: StackedAreaChartDatum[] = Array.from(
|
|
19
|
+
{ length: 36 },
|
|
20
|
+
(_, i) => {
|
|
21
|
+
const year = 2023 + Math.floor(i / 12);
|
|
22
|
+
const month = String((i % 12) + 1).padStart(2, '0');
|
|
23
|
+
const wave = Math.sin(i / 4);
|
|
24
|
+
return {
|
|
25
|
+
date: `${year}-${month}-01`,
|
|
26
|
+
raw: Number((1.8 + 0.25 * wave + i * 0.01).toFixed(2)),
|
|
27
|
+
energy: Number((0.6 + 0.15 * Math.cos(i / 3)).toFixed(2)),
|
|
28
|
+
labour: Number((0.45 + i * 0.004).toFixed(2)),
|
|
29
|
+
freight: Number((0.2 + 0.05 * wave).toFixed(2)),
|
|
30
|
+
// A price every third month and in the last one, so the line and its
|
|
31
|
+
// shading run the full width.
|
|
32
|
+
paid:
|
|
33
|
+
i % 3 === 0 || i === 35
|
|
34
|
+
? Number((3.3 + 0.35 * Math.sin(i / 5)).toFixed(2))
|
|
35
|
+
: null,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const COST_LAYERS: StackedAreaChartLayer[] = [
|
|
41
|
+
{ key: 'raw', label: 'Raw material' },
|
|
42
|
+
{ key: 'energy', label: 'Energy' },
|
|
43
|
+
{ key: 'labour', label: 'Labour' },
|
|
44
|
+
{ key: 'freight', label: 'Freight' },
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
const PAID: StackedAreaChartOverlay[] = [
|
|
48
|
+
{ key: 'paid', label: 'Prices paid', compare: true },
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
const QUARTER_ROWS: StackedAreaChartDatum[] = [
|
|
52
|
+
{
|
|
53
|
+
quarter: 'Q1',
|
|
54
|
+
raw: 1.9,
|
|
55
|
+
energy: 0.7,
|
|
56
|
+
labour: 0.5,
|
|
57
|
+
freight: 0.2,
|
|
58
|
+
paid: 3.6,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
quarter: 'Q2',
|
|
62
|
+
raw: 2.1,
|
|
63
|
+
energy: 0.6,
|
|
64
|
+
labour: 0.5,
|
|
65
|
+
freight: 0.25,
|
|
66
|
+
paid: 3.2,
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
const formatPrice = (value: number) => `€${value.toFixed(2)}`;
|
|
71
|
+
const formatMonth = (value: string | number) =>
|
|
72
|
+
new Date(String(value)).toLocaleDateString('en-GB', {
|
|
73
|
+
month: 'short',
|
|
74
|
+
year: 'numeric',
|
|
75
|
+
timeZone: 'UTC',
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export default function StackedAreaChartPage() {
|
|
79
|
+
const [marginPct, setMarginPct] = useState(8);
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<>
|
|
83
|
+
<AppPageHeader
|
|
84
|
+
breadcrumbs={[{ label: 'StackedAreaChart' }]}
|
|
85
|
+
title="StackedAreaChart"
|
|
86
|
+
subheader="Cost layers stacked over time, with a margin and lines over the stack."
|
|
87
|
+
actions={<DocsHeaderActions />}
|
|
88
|
+
/>
|
|
89
|
+
<DocsGuidance source={StackedAreaChartGuidance} />
|
|
90
|
+
<PageContentSection>
|
|
91
|
+
<SectionHeader
|
|
92
|
+
title="Should cost"
|
|
93
|
+
description="Four cost layers, a margin on top and the prices paid. Green where the price is above the cost, red where it is below. Click a legend entry to hide it."
|
|
94
|
+
withMargin
|
|
95
|
+
/>
|
|
96
|
+
<div
|
|
97
|
+
style={{
|
|
98
|
+
display: 'flex',
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
gap: 8,
|
|
101
|
+
marginBottom: 12,
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<span>Margin %</span>
|
|
105
|
+
<NumberControl
|
|
106
|
+
value={marginPct}
|
|
107
|
+
onChange={setMarginPct}
|
|
108
|
+
min={0}
|
|
109
|
+
max={50}
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
<StackedAreaChart
|
|
113
|
+
data={COST_ROWS}
|
|
114
|
+
xKey="date"
|
|
115
|
+
layers={COST_LAYERS}
|
|
116
|
+
overlays={PAID}
|
|
117
|
+
margin={{ pct: marginPct }}
|
|
118
|
+
yearTicks
|
|
119
|
+
valueFormatter={formatPrice}
|
|
120
|
+
tooltipLabelFormatter={formatMonth}
|
|
121
|
+
height={320}
|
|
122
|
+
/>
|
|
123
|
+
</PageContentSection>
|
|
124
|
+
<PageContentSection>
|
|
125
|
+
<SectionHeader
|
|
126
|
+
title="Few points"
|
|
127
|
+
description="With fewer than three rows the stack draws as bars."
|
|
128
|
+
withMargin
|
|
129
|
+
/>
|
|
130
|
+
<StackedAreaChart
|
|
131
|
+
data={QUARTER_ROWS}
|
|
132
|
+
xKey="quarter"
|
|
133
|
+
layers={COST_LAYERS}
|
|
134
|
+
overlays={PAID}
|
|
135
|
+
valueFormatter={formatPrice}
|
|
136
|
+
height={260}
|
|
137
|
+
/>
|
|
138
|
+
</PageContentSection>
|
|
139
|
+
</>
|
|
140
|
+
);
|
|
141
|
+
}
|
package/src/docs/registry.ts
CHANGED
|
@@ -224,6 +224,12 @@ export const DOC_REGISTRY: DocEntry[] = [
|
|
|
224
224
|
section: 'Charts',
|
|
225
225
|
load: () => import('./pages/BarChartPage'),
|
|
226
226
|
},
|
|
227
|
+
{
|
|
228
|
+
slug: 'stacked-area-chart',
|
|
229
|
+
title: 'StackedAreaChart',
|
|
230
|
+
section: 'Charts',
|
|
231
|
+
load: () => import('./pages/StackedAreaChartPage'),
|
|
232
|
+
},
|
|
227
233
|
{
|
|
228
234
|
slug: 'chat',
|
|
229
235
|
title: 'Chat',
|
package/src/index.ts
CHANGED
|
@@ -27,6 +27,7 @@ export * from './components/ui/Chart';
|
|
|
27
27
|
export * from './components/ui/ChartAreaInteractive';
|
|
28
28
|
export * from './components/ui/DonutChart';
|
|
29
29
|
export * from './components/ui/BarChart';
|
|
30
|
+
export * from './components/ui/StackedAreaChart';
|
|
30
31
|
export * from './components/ui/Checkbox';
|
|
31
32
|
export * from './components/ui/Confirm';
|
|
32
33
|
export * from './components/ui/DatePicker';
|
|
@@ -7,13 +7,26 @@ import type {
|
|
|
7
7
|
TimeSeriesPoint,
|
|
8
8
|
} from '#uilib/components/ui/Chart/chartForecastVisualization.types';
|
|
9
9
|
import type { ChartDataPoint } from '#uilib/components/ui/ChartAreaInteractive/ChartAreaInteractive.types';
|
|
10
|
+
import { HISTORY_SERIES_KEY } from '#uilib/components/ui/ChartAreaInteractive/chartHistories';
|
|
10
11
|
|
|
11
12
|
export type EnsureChartForecastBridgeOptions = {
|
|
12
13
|
forecastSeriesIds?: number[];
|
|
13
14
|
/** When true, returns `chartData` unchanged */
|
|
14
15
|
disabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The history line each forecast joins, by forecast id: a data key such as
|
|
18
|
+
* `historical` or `historical_<id>`, or null to leave that forecast unjoined.
|
|
19
|
+
* Defaults to the single `historical` line for every forecast.
|
|
20
|
+
*/
|
|
21
|
+
historyKeyFor?: (forecastId: number) => string | null;
|
|
15
22
|
};
|
|
16
23
|
|
|
24
|
+
/** A history line's value on a row, or null when it has none. */
|
|
25
|
+
function historyValueAt(row: ChartDataPoint, key: string): number | null {
|
|
26
|
+
const v = row[key];
|
|
27
|
+
return v == null || Array.isArray(v) ? null : (v as number);
|
|
28
|
+
}
|
|
29
|
+
|
|
17
30
|
const FORECAST_KEY_RE = /^forecast_(\d+)$/;
|
|
18
31
|
|
|
19
32
|
function collectForecastSeriesIds(chartData: ChartDataPoint[]): number[] {
|
|
@@ -43,6 +56,7 @@ function hasForecastValue(point: ChartDataPoint, id: number): boolean {
|
|
|
43
56
|
function findFirstForecastDateForBridge(
|
|
44
57
|
rows: ChartDataPoint[],
|
|
45
58
|
id: number,
|
|
59
|
+
historyKey: string,
|
|
46
60
|
): string | null {
|
|
47
61
|
const dataKey = forecastSeriesKey(id);
|
|
48
62
|
const withForecast = rows
|
|
@@ -60,11 +74,12 @@ function findFirstForecastDateForBridge(
|
|
|
60
74
|
getPreviousMonth(next.date),
|
|
61
75
|
);
|
|
62
76
|
const forecastVal = row[dataKey];
|
|
77
|
+
const historyVal = historyValueAt(row, historyKey);
|
|
63
78
|
const isSyntheticBridge =
|
|
64
79
|
normalizeToMonthStart(row.date) === expectedBridgeDate &&
|
|
65
|
-
|
|
80
|
+
historyVal != null &&
|
|
66
81
|
typeof forecastVal === 'number' &&
|
|
67
|
-
forecastVal ===
|
|
82
|
+
forecastVal === historyVal;
|
|
68
83
|
|
|
69
84
|
if (!isSyntheticBridge) {
|
|
70
85
|
return row.date;
|
|
@@ -79,7 +94,8 @@ function findFirstForecastDateForBridge(
|
|
|
79
94
|
/**
|
|
80
95
|
* Injects `forecast_{id}` on the row before each series’ first forecast month (historical value)
|
|
81
96
|
* so dashed forecast lines meet the historical line. Matches sybilion-client bridge behavior.
|
|
82
|
-
* Never overwrites an existing forecast value on that row.
|
|
97
|
+
* Never overwrites an existing forecast value on that row. With several history lines,
|
|
98
|
+
* `historyKeyFor` says which one each forecast joins (null: none).
|
|
83
99
|
*/
|
|
84
100
|
export function ensureChartForecastBridge(
|
|
85
101
|
chartData: ChartDataPoint[],
|
|
@@ -103,9 +119,18 @@ export function ensureChartForecastBridge(
|
|
|
103
119
|
|
|
104
120
|
const rows = sorted.map(p => ({ ...p }));
|
|
105
121
|
|
|
122
|
+
const historyKeyFor = options?.historyKeyFor ?? (() => HISTORY_SERIES_KEY);
|
|
123
|
+
|
|
106
124
|
for (const id of seriesIds) {
|
|
125
|
+
const historyKey = historyKeyFor(id);
|
|
126
|
+
if (historyKey == null) continue;
|
|
127
|
+
|
|
107
128
|
const dataKey = forecastSeriesKey(id);
|
|
108
|
-
const firstForecastDate = findFirstForecastDateForBridge(
|
|
129
|
+
const firstForecastDate = findFirstForecastDateForBridge(
|
|
130
|
+
rows,
|
|
131
|
+
id,
|
|
132
|
+
historyKey,
|
|
133
|
+
);
|
|
109
134
|
if (!firstForecastDate) continue;
|
|
110
135
|
|
|
111
136
|
const prevMonthRaw = getPreviousMonth(firstForecastDate);
|
|
@@ -117,12 +142,8 @@ export function ensureChartForecastBridge(
|
|
|
117
142
|
|
|
118
143
|
if (prevMonthIdx >= 0) {
|
|
119
144
|
const existing = rows[prevMonthIdx][dataKey];
|
|
120
|
-
const hPrev = rows[prevMonthIdx]
|
|
121
|
-
if (
|
|
122
|
-
(existing === undefined || existing === null) &&
|
|
123
|
-
hPrev !== undefined &&
|
|
124
|
-
hPrev !== null
|
|
125
|
-
) {
|
|
145
|
+
const hPrev = historyValueAt(rows[prevMonthIdx], historyKey);
|
|
146
|
+
if ((existing === undefined || existing === null) && hPrev !== null) {
|
|
126
147
|
rows[prevMonthIdx] = {
|
|
127
148
|
...rows[prevMonthIdx],
|
|
128
149
|
[dataKey]: hPrev,
|
|
@@ -130,7 +151,7 @@ export function ensureChartForecastBridge(
|
|
|
130
151
|
}
|
|
131
152
|
}
|
|
132
153
|
|
|
133
|
-
const lastHist = findLastValidHistoricalChartPoint(rows);
|
|
154
|
+
const lastHist = findLastValidHistoricalChartPoint(rows, historyKey);
|
|
134
155
|
if (!lastHist) continue;
|
|
135
156
|
|
|
136
157
|
const normLast = normalizeToMonthStart(lastHist.date);
|
|
@@ -143,8 +164,8 @@ export function ensureChartForecastBridge(
|
|
|
143
164
|
const existingAtLast = rows[idxLast][dataKey];
|
|
144
165
|
if (existingAtLast !== undefined && existingAtLast !== null) continue;
|
|
145
166
|
|
|
146
|
-
const hLast = rows[idxLast]
|
|
147
|
-
if (hLast !==
|
|
167
|
+
const hLast = historyValueAt(rows[idxLast], historyKey);
|
|
168
|
+
if (hLast !== null) {
|
|
148
169
|
rows[idxLast] = { ...rows[idxLast], [dataKey]: hLast };
|
|
149
170
|
}
|
|
150
171
|
}
|
|
@@ -165,15 +186,17 @@ export function findLastValidHistoricalPoint(
|
|
|
165
186
|
}
|
|
166
187
|
|
|
167
188
|
/**
|
|
168
|
-
* Find the last valid historical data point from ChartDataPoint array
|
|
189
|
+
* Find the last valid historical data point from ChartDataPoint array, on the
|
|
190
|
+
* single `historical` line or on the history line under `key`.
|
|
169
191
|
*/
|
|
170
192
|
export function findLastValidHistoricalChartPoint(
|
|
171
193
|
historical: ChartDataPoint[],
|
|
194
|
+
key: string = HISTORY_SERIES_KEY,
|
|
172
195
|
): ChartDataPoint | null {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return
|
|
196
|
+
for (let i = historical.length - 1; i >= 0; i--) {
|
|
197
|
+
if (historyValueAt(historical[i], key) !== null) return historical[i];
|
|
198
|
+
}
|
|
199
|
+
return null;
|
|
177
200
|
}
|
|
178
201
|
|
|
179
202
|
/**
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
Image,widget (element on frontend),type of analysis,Components,Component version,Example payload,Raw file / Dependencies,Versions Raw files,Example File,description
|
|
2
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/8921e6eb-749d-437c-9e45-4216e64e5883/image.png | https://t9015967896.p.clickup-attachments.com/t9015967896/8e4c1bf4-3d01-48a1-94b5-76ed14ab3e24/image.png,forecast,probabilistic,forecast_probabilistic | ~~historical~~,v1 + v2,{} | {},forecast.json,v1 + v1.1,,only use the forecast_series key on the object
|
|
3
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/5499aaba-c5e5-45f6-86d8-087dd1b7a4b2/image.png | https://t9015967896.p.clickup-attachments.com/t9015967896/38963a67-1a2c-4474-8aa3-644a80de0165/image.png,forecast,deterministic,forecast_deterministic | ~~historical~~,v1,,forecast.json /backtest.json,v1 + v2,,the bondaries need to be generated based in the backtests mape per horizon based in a evaluation period
|
|
4
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/0132ad1d-7352-4d76-a1bf-f73e77c5d39e/image.png | https://t9015967896.p.clickup-attachments.com/t9015967896/d9d3e163-cd37-4609-b75f-296a53f0bd42/image.png,forecast (mean trend detection),trend,forecast_trend_mean | ~~historical~~,v1,,change_points.json,v1,,"full mess, required loock into js code and documentate"
|
|
5
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/d9ff9215-f4a5-4292-bb26-abcbc37319b5/image.png,forecast ???? (multi forecast),????,~~historical~~ | ????,,,,,,
|
|
6
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/c19698ff-0401-476e-939c-9eea6da65162/image.png,backtest,deterministic,backtest_deterministic | ~~historical~~,v1,,backetest.json,v1 + v2,,is only the forecast_series inside of each period
|
|
7
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/a7b79c68-58ae-4ae9-b10c-23bf9649dd68/image.png,backtest,probabilistic,backtest_probabilistic | ~~historical~~,v1,,backtests.json,v1,,backtest chart with the full forecast type
|
|
8
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/40cbd6f9-8c83-4cc5-86c9-bf506233145a/image.png,Backtest Per quantile,probabilistic,backtest_probabilistic | ~~historical~~,v1,,backtests.json,v1,,similar to the rainbow backtest but also have per quantile
|
|
9
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/e27313d6-18c5-483c-b786-6b5409cab444/image.png,Backtest Metrics per evaluation period (former Summary),probabilistic,backtest_probabilistic_metrics_per_evaluation_period,v1,,backtest_summary.json,v1,,basically a table displaying all the backtests_summary data
|
|
10
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/543ee043-f1de-415d-bf1e-2fc19249b2a1/image.png,Backtest Metrics per evaluation period (former Summary),deterministic,backtest_deterministic_metrics_per_evaluation_period,v1,,backtest_summary.json,v1 + v2,,basicly a table displaying all the backtests_summary data
|
|
11
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/00d07e8e-68dc-4ca5-89c5-0108c46b8b59/image.png,model improvement,deterministic,backtest_deterministic_model_improvment,v1,,backtest_summary.json,v1 + v2,,a widget that display a bar with the error of our model compare with a baseline
|
|
12
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/42c54a0d-75b0-4e61-8f1d-08e4b77639e0/image.png,general widths of mape comparison,deterministic,backtest_deterministic_model_comparison,v1,,backtest_summary.json,v1 + v2,,do exactly what is in the title aside of the last one that is the base_lines aside with the mir_model
|
|
13
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/fb83d9f5-4675-4f27-a00f-3d854b2b8070/image.png,Drivers Details,universal,drivers_details,v1,,drivers_report.json,v2,,table with all the drivers data overall/per horizon
|
|
14
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/24ac9bd8-f2df-44d0-a3f5-8579d1c6aa5e/image.png,Drivers (former Related drivers),universal,drivers_report,v1,,drivers_report.json,v1 + v2,,Legacy table displaying all the drivers existing
|
|
15
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/04d3994a-ee04-4a76-bc87-13324704becb/image.png,comparison drivers,universal,drivers_comparison,v1,,drivers_report.json,v1 + v2,,lecay table with a chart displaying all the drivers data normalized
|
|
16
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/8c760054-f0ba-4499-a9ca-7f0cd720a8e4/image.png,forecast vs base line forecasts,deterministic,forecast_deterministic_model_comparison | ~~/historical~~,v1,,forecast.json /bl_forecast.json,v1 + v2 | v1,,plots together with the forecast of mir_model the baselines forecast
|
|
17
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/30d6f286-81fc-4319-943b-8b1de707ca99/image.png,forecast vs base line forecasts,probabilistic,forecast_probabilistic_model_comparison | ~~/historical~~,v1,,forecast.json /bl_forecast.json,v1 + v2 | v1,,plots together with the forecast of mir_model the baselines forecast
|
|
18
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/c97e27da-2d3f-4d4a-9aa9-29bf9bc706f4/image.png,yearly overlap graph ( to spot seasonality agains the historical data),deterministic / probabilistic,forecast_pointwise | ~~/historical~~,v1,,forecast.json,v1 + v2,,this agregates the historical and the forecast in groups of years to overlap in a way to try to catch seasonality
|
|
19
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/2060d209-fc8c-4a68-a8d1-1b9f4bf4e166/image.png,forecast with trend indicators (adjusted),deterministic,forecast_deterministic | ~~historical~~ | liner_regression_historical_and_forecast,v1 | v1 | v1,,forecast.json | backtests.json,v1 + v2 | v1 + v2,,basicly is a forecast chart but have two lines thath follow the f(x)= mx+b trying to indicate what is the trend movement of the historical and the forecast
|
|
20
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/d51771cc-03f6-442f-b1af-71b22449c655/image.png,forecast with trend indicators (not adjusted),deterministic,forecast_deterministic | ~~historical~~ | liner_regression_forecast,v1 | v1,,forecast.json,v1 + v2,,basicly is a forecast chart but have two lines thath follow the f(x)= mx+b trying to indicate what is the trend movement of the historical and the forecast
|
|
21
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/19e68d01-08dd-4472-8475-75c359826c08/image.png,forecast with trend boundaries,trend,forecast_deterministic | ~~historical~~ | forecast_trend_boundaries,v1 | v1,,forecast.json change_points.json,v1 + v2 | v1,,pick the main trend and plot as a universal boundarie
|
|
22
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/a8e73acf-c486-4449-ae8c-af8d89075bb0/image.png | https://t9015967896.p.clickup-attachments.com/t9015967896/07889acb-78a2-48c8-8273-71d0f5720daa/image.png,Backtests Trend Mean signal detection with indicators (mean backtests with and without noise),trend,~~historical~~ | backtest_trend_mean_with_indicators | backtest_trend_mean_with_indicators_noise,v1 | v1,,change_points_backtest.json,v1,,plot all the detect change points without noise detections
|
|
23
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/949e85df-ec6e-4667-9085-5a445d83ceaa/image.png,Trend signal detection,trend,backtest_trend_mean_without_indicators | ~~historical~~,v1,,change_points_backtest.json,v1,,plot all the detect change and color if they are right or wrong
|
|
24
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/21c50771-da61-4a80-a39c-c0173b72047a/image.png,Forecast Trend mean details,trend,forecast_trend_mean_details,v1,,change_points.json,v1,,display a table with all info
|
|
25
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/d9f1a68e-8749-4a00-b3d1-02b445c1920b/image.png,Slope Trend,trend,forecast_trend_slope | ~~historical~~,v1,,change_points.json,v1,,pick the main trend and plot as a universal boundarie
|
|
26
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/5310d4bf-d540-4ac4-8ed8-39e045f61117/image.png | https://t9015967896.p.clickup-attachments.com/t9015967896/fde0d61c-76e7-4beb-92d1-834abe5ece0b/image.png,Backtests Trend Slope signal detection with indicators (slope backtests with and without noise),trend,~~historical~~ | backtest_trend_slope_with_indicators | backtest_trend_slope_with_indicators_noise,v1 | v1,,change_points.json / historical,v1,,"plot all the detect change points without noise detections , plot all the detect change points with noise detections"
|
|
27
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/48f7c2d0-f9e6-48b6-a9ca-49cc437150fb/image.png,Forecast Trend Slope details,trend,forecast_trend_slope_details,v1,,change_points.json,v1,,display a table with all info
|
|
28
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/7d838220-0993-4095-914d-ca7578934ff5/image.png,confidence interval,deterministic,backtest_deterministic_confidence_interval | ~~historical~~,v1,,backtest.json,v1 + v2,,get a external area of backtests and a standard deviation area in the midle
|
|
29
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/48d2107a-9f05-43b6-8f7-bb9030fd3e84/image.png,shame,deterministic,backtest_deterministic_confidence_interval_normalized | ~~historical~~,v1,,backtest.json,v1 + v2,,get a external area of backtests and a standard deviation area in the midle normalized into -100 and 100
|
|
30
|
-
https://t9015967896.p.clickup-attachments.com/t9015967896/4358fd17-8cab-4a9d-af17-5c32a1213526/image.png,model performance,deterministic,backtest_deterministic_model_performance_relative | backtest_deterministic_model_performance_abs,v1,,backtest.json,v1 + v2,,get fadded bars from all the error of the forecast after the seconda horizon and purple opache bars in the front of the first 2 moths
|
|
31
|
-
,,News,Universal,,,,Microservice,,,,
|
|
32
|
-
,,Insights,deterministic / trend / probabilistic,,,,Microservice,,,,
|
|
33
|
-
,,Drivers by category of impact,Universal,,,,Microservice,,,,
|