@praxisui/core 10.0.0-rc.52 → 10.0.0-rc.55
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/ai/component-registry.json +6 -6
- package/fesm2022/praxisui-core-schema.mjs +248 -5
- package/fesm2022/praxisui-core.mjs +588 -41
- package/package.json +1 -1
- package/types/praxisui-core-schema.d.ts +15 -2
- package/types/praxisui-core.d.ts +583 -355
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-11-
|
|
3
|
+
"generatedAt": "2026-11-19T04:18:21.275Z",
|
|
4
4
|
"packageName": "@praxisui/core",
|
|
5
|
-
"packageVersion": "10.0.0-rc.
|
|
5
|
+
"packageVersion": "10.0.0-rc.55",
|
|
6
6
|
"sourceRegistry": "praxis-component-registry-ingestion",
|
|
7
7
|
"sourceRegistryVersion": "1.0.0",
|
|
8
8
|
"componentCount": 4,
|
|
@@ -3334,9 +3334,9 @@
|
|
|
3334
3334
|
{
|
|
3335
3335
|
"chunkIndex": 24,
|
|
3336
3336
|
"chunkKind": "recipe",
|
|
3337
|
-
"content": "{\"componentId\":\"praxis-dynamic-page\",\"chunkSection\":\"page\",\"page\":{\"themePreset\":\"executive-command-center\",\"layout\":{\"orientation\":\"columns\",\"columns\":4,\"gap\":\"16px\"},\"deviceLayouts\":{\"desktop\":{\"layout\":{\"orientation\":\"columns\",\"columns\":4,\"gap\":\"16px\"},\"widgetOverrides\":{\"procurementFilter\":{\"order\":10,\"span\":4},\"procurementPresentation\":{\"order\":20,\"span\":2},\"procurementFunnel\":{\"order\":30,\"span\":1},\"procurementPyramid\":{\"order\":40,\"span\":1},\"procurementGauge\":{\"order\":45,\"span\":2},\"missionStatusChart\":{\"order\":50,\"span\":2},\"missionStatusTable\":{\"order\":60,\"span\":2},\"payrollTrend\":{\"order\":70,\"span\":2},\"payrollStackedArea\":{\"order\":80,\"span\":2},\"payrollProfile\":{\"order\":90,\"span\":1},\"payrollProfileTreemap\":{\"order\":95,\"span\":1},\"payrollCombo\":{\"order\":100,\"span\":2},\"payrollSalaryHistogram\":{\"order\":105,\"span\":2},\"absenceCorrelation\":{\"order\":110,\"span\":
|
|
3337
|
+
"content": "{\"componentId\":\"praxis-dynamic-page\",\"chunkSection\":\"page\",\"page\":{\"themePreset\":\"executive-command-center\",\"layout\":{\"orientation\":\"columns\",\"columns\":4,\"gap\":\"16px\"},\"deviceLayouts\":{\"desktop\":{\"layout\":{\"orientation\":\"columns\",\"columns\":4,\"gap\":\"16px\"},\"widgetOverrides\":{\"procurementFilter\":{\"order\":10,\"span\":4},\"procurementPresentation\":{\"order\":20,\"span\":2},\"procurementFunnel\":{\"order\":30,\"span\":1},\"procurementPyramid\":{\"order\":40,\"span\":1},\"procurementGauge\":{\"order\":45,\"span\":2},\"missionStatusChart\":{\"order\":50,\"span\":2},\"missionStatusTable\":{\"order\":60,\"span\":2},\"payrollTrend\":{\"order\":70,\"span\":2},\"payrollStackedArea\":{\"order\":80,\"span\":2},\"payrollProfile\":{\"order\":90,\"span\":1},\"payrollProfileTreemap\":{\"order\":95,\"span\":1},\"payrollCombo\":{\"order\":100,\"span\":2},\"payrollSalaryHistogram\":{\"order\":105,\"span\":2},\"absenceCorrelation\":{\"order\":110,\"span\":2},\"absenceBoxplot\":{\"order\":115,\"span\":2},\"absenceCalendar\":{\"order\":120,\"span\":2},\"payrollWaterfall\":{\"order\":125,\"span\":2}}},\"tablet\":{\"layout\":{\"orientation\":\"columns\",\"columns\":2,\"gap\":\"14px\"}},\"mobile\":{\"layout\":{\"orientation\":\"columns\",\"columns\":1,\"gap\":\"12px\"}}},\"state\":{\"values\":{\"analytics\":{\"procurementQueryContext\":{\"filters\":{}},\"missionQueryContext\":{\"filters\":{}}}}}}}",
|
|
3338
3338
|
"sourcePointer": "examples/ai-recipes/praxis-dynamic-page.analytics-dashboard-showcase.json",
|
|
3339
|
-
"contentHash": "
|
|
3339
|
+
"contentHash": "6f9d92c798832e064e8431fd6e334fc11c1e1b91eba99ca2433c8f6aad304434",
|
|
3340
3340
|
"sourceKind": "component_definition",
|
|
3341
3341
|
"sourceId": "praxis-dynamic-page",
|
|
3342
3342
|
"corpusVersion": "1.0.0"
|
|
@@ -3364,9 +3364,9 @@
|
|
|
3364
3364
|
{
|
|
3365
3365
|
"chunkIndex": 27,
|
|
3366
3366
|
"chunkKind": "recipe",
|
|
3367
|
-
"content": "{\"componentId\":\"praxis-dynamic-page\",\"chunkSection\":\"page.widgets\",\"page\":{\"widgets\":[{\"key\":\"payrollCombo\",\"shell\":{\"kind\":\"dashboard-card\",\"icon\":\"multiline_chart\",\"title\":\"Bruto × descontos\",\"subtitle\":\"Combo remoto com descontos no eixo secundário\"},\"definition\":{\"id\":\"praxis-chart\",\"bindingOrder\":[\"chartDocument\",\"enableCustomization\"],\"inputs\":{\"chartDocument\":{\"version\":\"0.1.0\",\"chartId\":\"analytics-dashboard-payroll-combo\",\"kind\":\"combo\",\"source\":{\"kind\":\"praxis.stats\",\"resource\":\"/api/human-resources/vw-analytics-folha-pagamento\",\"operation\":\"timeseries\",\"options\":{\"granularity\":\"month\",\"orderBy\":\"key-asc\"}},\"dimensions\":[{\"field\":\"competencia\",\"label\":\"Competência\",\"role\":\"time\"}],\"metrics\":[{\"field\":\"salarioBruto\",\"label\":\"Massa bruta\",\"aggregation\":\"sum\",\"seriesKind\":\"bar\",\"axis\":\"primary\"},{\"field\":\"totalDescontos\",\"label\":\"Descontos\",\"aggregation\":\"sum\",\"seriesKind\":\"line\",\"axis\":\"secondary\"}],\"legend\":{\"enabled\":true},\"tooltip\":{\"enabled\":true}},\"enableCustomization\":true},\"outputs\":{\"pointClick\":\"emit\",\"selectionChange\":\"emit\",\"loadStateChange\":\"emit\"}}},{\"key\":\"payrollSalaryHistogram\",\"shell\":{\"kind\":\"dashboard-card\",\"icon\":\"bar_chart\",\"title\":\"Distribuição salarial\",\"subtitle\":\"Histograma remoto por faixas de R$ 5 mil materializadas pelo stats\"},\"definition\":{\"id\":\"praxis-chart\",\"bindingOrder\":[\"chartDocument\",\"enableCustomization\"],\"inputs\":{\"chartDocument\":{\"version\":\"0.1.0\",\"chartId\":\"analytics-dashboard-payroll-salary-histogram\",\"kind\":\"bar\",\"source\":{\"kind\":\"praxis.stats\",\"resource\":\"/api/human-resources/vw-analytics-folha-pagamento\",\"operation\":\"distribution\",\"options\":{\"mode\":\"histogram\",\"bucketSize\":5000,\"orderBy\":\"key-asc\"}},\"dimensions\":[{\"field\":\"salarioLiquido\",\"label\":\"Faixa salarial\",\"role\":\"category\"}],\"metrics\":[{\"field\":\"count\",\"label\":\"Registros\",\"aggregation\":\"count\"}],\"legend\":{\"enabled\":false},\"tooltip\":{\"enabled\":true}},\"enableCustomization\":true},\"outputs\":{\"pointClick\":\"emit\",\"selectionChange\":\"emit\",\"loadStateChange\":\"emit\"}}},{\"key\":\"absenceCorrelation\",\"shell\":{\"kind\":\"dashboard-card\",\"icon\":\"scatter_plot\",\"title\":\"Pessoas × dias afastados\",\"subtitle\":\"Dispersão remota por departamento\"},\"definition\":{\"id\":\"praxis-chart\",\"bindingOrder\":[\"chartDocument\",\"enableCustomization\"],\"inputs\":{\"chartDocument\":{\"version\":\"0.1.0\",\"chartId\":\"analytics-dashboard-absence-correlation\",\"kind\":\"scatter\",\"source\":{\"kind\":\"praxis.stats\",\"resource\":\"/api/human-resources/vw-analytics-afastamentos\",\"operation\":\"group-by\",\"options\":{\"limit\":20,\"orderBy\":\"value-desc\"}},\"dimensions\":[{\"field\":\"departamento\",\"label\":\"Departamento\",\"role\":\"category\"}],\"metrics\":[{\"field\":\"funcionarioId\",\"label\":\"Colaboradores\",\"aggregation\":\"distinct-count\"},{\"field\":\"diasAfastado\",\"label\":\"Dias afastados\",\"aggregation\":\"sum\"}],\"events\":{\"pointClick\":{\"action\":\"emit\"},\"selectionChange\":{\"action\":\"emit\"}},\"legend\":{\"enabled\":false},\"tooltip\":{\"enabled\":true}},\"enableCustomization\":true},\"outputs\":{\"pointClick\":\"emit\",\"selectionChange\":\"emit\",\"loadStateChange\":\"emit\"}}}]}}",
|
|
3367
|
+
"content": "{\"componentId\":\"praxis-dynamic-page\",\"chunkSection\":\"page.widgets\",\"page\":{\"widgets\":[{\"key\":\"payrollCombo\",\"shell\":{\"kind\":\"dashboard-card\",\"icon\":\"multiline_chart\",\"title\":\"Bruto × descontos\",\"subtitle\":\"Combo remoto com descontos no eixo secundário\"},\"definition\":{\"id\":\"praxis-chart\",\"bindingOrder\":[\"chartDocument\",\"enableCustomization\"],\"inputs\":{\"chartDocument\":{\"version\":\"0.1.0\",\"chartId\":\"analytics-dashboard-payroll-combo\",\"kind\":\"combo\",\"source\":{\"kind\":\"praxis.stats\",\"resource\":\"/api/human-resources/vw-analytics-folha-pagamento\",\"operation\":\"timeseries\",\"options\":{\"granularity\":\"month\",\"orderBy\":\"key-asc\"}},\"dimensions\":[{\"field\":\"competencia\",\"label\":\"Competência\",\"role\":\"time\"}],\"metrics\":[{\"field\":\"salarioBruto\",\"label\":\"Massa bruta\",\"aggregation\":\"sum\",\"seriesKind\":\"bar\",\"axis\":\"primary\"},{\"field\":\"totalDescontos\",\"label\":\"Descontos\",\"aggregation\":\"sum\",\"seriesKind\":\"line\",\"axis\":\"secondary\"}],\"legend\":{\"enabled\":true},\"tooltip\":{\"enabled\":true}},\"enableCustomization\":true},\"outputs\":{\"pointClick\":\"emit\",\"selectionChange\":\"emit\",\"loadStateChange\":\"emit\"}}},{\"key\":\"payrollSalaryHistogram\",\"shell\":{\"kind\":\"dashboard-card\",\"icon\":\"bar_chart\",\"title\":\"Distribuição salarial\",\"subtitle\":\"Histograma remoto por faixas de R$ 5 mil materializadas pelo stats\"},\"definition\":{\"id\":\"praxis-chart\",\"bindingOrder\":[\"chartDocument\",\"enableCustomization\"],\"inputs\":{\"chartDocument\":{\"version\":\"0.1.0\",\"chartId\":\"analytics-dashboard-payroll-salary-histogram\",\"kind\":\"bar\",\"source\":{\"kind\":\"praxis.stats\",\"resource\":\"/api/human-resources/vw-analytics-folha-pagamento\",\"operation\":\"distribution\",\"options\":{\"mode\":\"histogram\",\"bucketSize\":5000,\"orderBy\":\"key-asc\"}},\"dimensions\":[{\"field\":\"salarioLiquido\",\"label\":\"Faixa salarial\",\"role\":\"category\"}],\"metrics\":[{\"field\":\"count\",\"label\":\"Registros\",\"aggregation\":\"count\"}],\"legend\":{\"enabled\":false},\"tooltip\":{\"enabled\":true}},\"enableCustomization\":true},\"outputs\":{\"pointClick\":\"emit\",\"selectionChange\":\"emit\",\"loadStateChange\":\"emit\"}}},{\"key\":\"absenceCorrelation\",\"shell\":{\"kind\":\"dashboard-card\",\"icon\":\"scatter_plot\",\"title\":\"Pessoas × dias afastados\",\"subtitle\":\"Dispersão remota por departamento\"},\"definition\":{\"id\":\"praxis-chart\",\"bindingOrder\":[\"chartDocument\",\"enableCustomization\"],\"inputs\":{\"chartDocument\":{\"version\":\"0.1.0\",\"chartId\":\"analytics-dashboard-absence-correlation\",\"kind\":\"scatter\",\"source\":{\"kind\":\"praxis.stats\",\"resource\":\"/api/human-resources/vw-analytics-afastamentos\",\"operation\":\"group-by\",\"options\":{\"limit\":20,\"orderBy\":\"value-desc\"}},\"dimensions\":[{\"field\":\"departamento\",\"label\":\"Departamento\",\"role\":\"category\"}],\"metrics\":[{\"field\":\"funcionarioId\",\"label\":\"Colaboradores\",\"aggregation\":\"distinct-count\"},{\"field\":\"diasAfastado\",\"label\":\"Dias afastados\",\"aggregation\":\"sum\"}],\"events\":{\"pointClick\":{\"action\":\"emit\"},\"selectionChange\":{\"action\":\"emit\"}},\"legend\":{\"enabled\":false},\"tooltip\":{\"enabled\":true}},\"enableCustomization\":true},\"outputs\":{\"pointClick\":\"emit\",\"selectionChange\":\"emit\",\"loadStateChange\":\"emit\"}}},{\"key\":\"absenceBoxplot\",\"shell\":{\"kind\":\"dashboard-card\",\"icon\":\"candlestick_chart\",\"title\":\"Distribuição de dias afastados (Boxplot)\",\"subtitle\":\"Quartis Mín/Q1/Mediana/Q3/Máx e tamanho amostral n\"},\"definition\":{\"id\":\"praxis-chart\",\"bindingOrder\":[\"chartDocument\",\"enableCustomization\"],\"inputs\":{\"chartDocument\":{\"version\":\"0.1.0\",\"chartId\":\"analytics-dashboard-absence-boxplot\",\"kind\":\"boxplot\",\"source\":{\"kind\":\"praxis.stats\",\"resource\":\"/api/human-resources/vw-analytics-afastamentos\",\"operation\":\"group-by\"},\"dimensions\":[{\"field\":\"departamento\",\"label\":\"Departamento\",\"role\":\"category\"}],\"metrics\":[{\"field\":\"diasAfastado\",\"label\":\"Mínimo\",\"aggregation\":\"min\"},{\"field\":\"diasAfastado\",\"label\":\"Q1\",\"aggregation\":\"percentile-25\"},{\"field\":\"diasAfastado\",\"label\":\"Mediana\",\"aggregation\":\"median\"},{\"field\":\"diasAfastado\",\"label\":\"Q3\",\"aggregation\":\"percentile-75\"},{\"field\":\"diasAfastado\",\"label\":\"Máximo\",\"aggregation\":\"max\"},{\"field\":\"diasAfastado\",\"label\":\"Amostra (n)\",\"aggregation\":\"count\"}],\"boxplot\":{\"showOutliers\":true,\"showSampleSize\":true,\"iqrMultiplier\":1.5},\"legend\":{\"enabled\":false},\"tooltip\":{\"enabled\":true}},\"enableCustomization\":true},\"outputs\":{\"pointClick\":\"emit\",\"loadStateChange\":\"emit\"}}},{\"key\":\"absenceCalendar\",\"shell\":{\"kind\":\"dashboard-card\",\"icon\":\"calendar_month\",\"title\":\"Calendário diário de ocorrências\",\"subtitle\":\"Granularidade DAY distinguindo zero real de dia omitido/suprimido\"},\"definition\":{\"id\":\"praxis-chart\",\"bindingOrder\":[\"chartDocument\",\"enableCustomization\"],\"inputs\":{\"chartDocument\":{\"version\":\"0.1.0\",\"chartId\":\"analytics-dashboard-absence-calendar\",\"kind\":\"calendar\",\"source\":{\"kind\":\"praxis.stats\",\"resource\":\"/api/human-resources/vw-analytics-afastamentos\",\"operation\":\"timeseries\",\"options\":{\"granularity\":\"day\",\"fillGaps\":false}},\"dimensions\":[{\"field\":\"dataInicio\",\"label\":\"Data\",\"role\":\"time\",\"extraction\":\"DAY\"}],\"metrics\":[{\"field\":\"diasAfastado\",\"label\":\"Dias\",\"aggregation\":\"sum\"}],\"calendar\":{\"range\":\"2026-03\",\"showDayLabels\":true,\"showMonthLabels\":true},\"legend\":{\"enabled\":true},\"tooltip\":{\"enabled\":true}},\"enableCustomization\":true},\"outputs\":{\"crossFilter\":\"emit\",\"loadStateChange\":\"emit\"}}},{\"key\":\"payrollWaterfall\",\"shell\":{\"kind\":\"dashboard-card\",\"icon\":\"waterfall_chart\",\"title\":\"Ponte de variação da folha (Waterfall)\",\"subtitle\":\"Ordem preservada com início, acréscimo, dedução e total\"},\"definition\":{\"id\":\"praxis-chart\",\"bindingOrder\":[\"chartDocument\",\"enableCustomization\"],\"inputs\":{\"chartDocument\":{\"version\":\"0.1.0\",\"chartId\":\"analytics-dashboard-payroll-waterfall\",\"kind\":\"waterfall\",\"source\":{\"kind\":\"praxis.stats\",\"resource\":\"/api/human-resources/vw-analytics-folha-pagamento\",\"operation\":\"group-by\",\"options\":{\"limit\":8,\"orderBy\":\"value-desc\"}},\"dimensions\":[{\"field\":\"payrollProfile\",\"label\":\"Perfil\",\"role\":\"category\"}],\"metrics\":[{\"field\":\"salarioLiquido\",\"label\":\"Impacto líquido\",\"aggregation\":\"sum\",\"format\":\"currency\"}],\"waterfall\":{\"roles\":{\"CLT\":\"start\",\"Estatutário\":\"increase\",\"Comissionado\":\"increase\",\"Estagiário\":\"decrease\"},\"showConnectors\":true,\"appendTotal\":true,\"totalLabel\":\"Total Líquido\"},\"legend\":{\"enabled\":false},\"tooltip\":{\"enabled\":true}},\"enableCustomization\":true},\"outputs\":{\"pointClick\":\"emit\",\"loadStateChange\":\"emit\"}}}]}}",
|
|
3368
3368
|
"sourcePointer": "examples/ai-recipes/praxis-dynamic-page.analytics-dashboard-showcase.json",
|
|
3369
|
-
"contentHash": "
|
|
3369
|
+
"contentHash": "9ba048cf3c297c1d4a286c91b439bb4f32d647af22870cd19b79c16c01d0dcd9",
|
|
3370
3370
|
"sourceKind": "component_definition",
|
|
3371
3371
|
"sourceId": "praxis-dynamic-page",
|
|
3372
3372
|
"corpusVersion": "1.0.0"
|
|
@@ -90,6 +90,14 @@ const VISUALIZATION_KINDS = new Set([
|
|
|
90
90
|
'bullet',
|
|
91
91
|
'delta',
|
|
92
92
|
'processFlow',
|
|
93
|
+
'waterfall',
|
|
94
|
+
]);
|
|
95
|
+
const WATERFALL_ROLES = new Set([
|
|
96
|
+
'start',
|
|
97
|
+
'increase',
|
|
98
|
+
'decrease',
|
|
99
|
+
'subtotal',
|
|
100
|
+
'total',
|
|
93
101
|
]);
|
|
94
102
|
const VISUALIZATION_SURFACES = new Set([
|
|
95
103
|
'table-cell',
|
|
@@ -128,6 +136,7 @@ const TABLE_SAFE_KINDS = new Set([
|
|
|
128
136
|
'bullet',
|
|
129
137
|
'delta',
|
|
130
138
|
'processFlow',
|
|
139
|
+
'waterfall',
|
|
131
140
|
]);
|
|
132
141
|
const TABLE_CELL_RECOMMENDED_KINDS = new Set([
|
|
133
142
|
'delta',
|
|
@@ -149,7 +158,7 @@ function getPraxisTableCellVisualizationConstraint(kind) {
|
|
|
149
158
|
return 'row-density';
|
|
150
159
|
if (kind === 'processFlow')
|
|
151
160
|
return 'step-labels';
|
|
152
|
-
if (kind === 'line' || kind === 'area' || kind === 'column') {
|
|
161
|
+
if (kind === 'line' || kind === 'area' || kind === 'column' || kind === 'waterfall') {
|
|
153
162
|
return 'horizontal-space';
|
|
154
163
|
}
|
|
155
164
|
return null;
|
|
@@ -253,7 +262,7 @@ function resolvePraxisStackedBarSegments(visualization) {
|
|
|
253
262
|
return [];
|
|
254
263
|
}
|
|
255
264
|
if (Array.isArray(visualization.segments) && visualization.segments.length > 0) {
|
|
256
|
-
return visualization.segments;
|
|
265
|
+
return visualization.segments.filter((seg) => !seg?.suppressed);
|
|
257
266
|
}
|
|
258
267
|
if (Array.isArray(visualization.items) && visualization.items.length > 0) {
|
|
259
268
|
const mapped = [];
|
|
@@ -262,7 +271,13 @@ function resolvePraxisStackedBarSegments(visualization) {
|
|
|
262
271
|
return [];
|
|
263
272
|
}
|
|
264
273
|
const item = visualization.items[i];
|
|
265
|
-
if (!item
|
|
274
|
+
if (!item) {
|
|
275
|
+
return [];
|
|
276
|
+
}
|
|
277
|
+
if (item.suppressed === true || (item.value === null && item.state === 'suppressed')) {
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
if (typeof item.value !== 'number' || !Number.isFinite(item.value) || item.value < 0) {
|
|
266
281
|
return [];
|
|
267
282
|
}
|
|
268
283
|
const hex = normalizePraxisHexColor(item.color);
|
|
@@ -367,6 +382,12 @@ function normalizeStackedBarDistribution(value, surface) {
|
|
|
367
382
|
}
|
|
368
383
|
const parsedSegments = [];
|
|
369
384
|
const parsedItems = [];
|
|
385
|
+
const preservedSuppressedCount = typeof value.suppressedCount === 'number'
|
|
386
|
+
&& Number.isFinite(value.suppressedCount)
|
|
387
|
+
&& value.suppressedCount > 0
|
|
388
|
+
? Math.trunc(value.suppressedCount)
|
|
389
|
+
: 0;
|
|
390
|
+
let suppressedCount = 0;
|
|
370
391
|
for (let i = 0; i < rawEntries.length; i++) {
|
|
371
392
|
if (!Object.prototype.hasOwnProperty.call(rawEntries, i)) {
|
|
372
393
|
return {
|
|
@@ -394,6 +415,11 @@ function normalizeStackedBarDistribution(value, surface) {
|
|
|
394
415
|
};
|
|
395
416
|
}
|
|
396
417
|
const entryObj = rawEntry;
|
|
418
|
+
if (entryObj.suppressed === true
|
|
419
|
+
|| (entryObj.value === null && entryObj.state === 'suppressed')) {
|
|
420
|
+
suppressedCount += 1;
|
|
421
|
+
continue;
|
|
422
|
+
}
|
|
397
423
|
const num = toFiniteNumber(entryObj.value);
|
|
398
424
|
if (num === undefined || num < 0) {
|
|
399
425
|
return {
|
|
@@ -423,6 +449,14 @@ function normalizeStackedBarDistribution(value, surface) {
|
|
|
423
449
|
...(entryColor ? { color: entryColor } : {}),
|
|
424
450
|
});
|
|
425
451
|
}
|
|
452
|
+
const effectiveSuppressedCount = Math.max(preservedSuppressedCount, suppressedCount);
|
|
453
|
+
if (parsedSegments.length === 0) {
|
|
454
|
+
return {
|
|
455
|
+
valid: false,
|
|
456
|
+
...(effectiveSuppressedCount > 0 ? { suppressedCount: effectiveSuppressedCount } : {}),
|
|
457
|
+
...(typeof value.legend === 'boolean' ? { legend: false } : {}),
|
|
458
|
+
};
|
|
459
|
+
}
|
|
426
460
|
const sum = compensatedSum(parsedSegments.map((entry) => entry.value));
|
|
427
461
|
if (!Number.isFinite(sum) || sum < 0) {
|
|
428
462
|
return {
|
|
@@ -470,6 +504,7 @@ function normalizeStackedBarDistribution(value, surface) {
|
|
|
470
504
|
valid: true,
|
|
471
505
|
...(hasSegmentsProp ? { segments: parsedSegments } : { items: parsedItems }),
|
|
472
506
|
...(validatedTotal !== undefined ? { total: validatedTotal } : {}),
|
|
507
|
+
...(effectiveSuppressedCount > 0 ? { suppressedCount: effectiveSuppressedCount } : {}),
|
|
473
508
|
...(rawTitle ? { title: rawTitle } : {}),
|
|
474
509
|
...(normalizedLegend !== undefined ? { legend: normalizedLegend } : {}),
|
|
475
510
|
};
|
|
@@ -556,6 +591,7 @@ function normalizePraxisPresentationVisualization(value) {
|
|
|
556
591
|
...(normalizeThresholds(value.thresholds) ?? {}),
|
|
557
592
|
...(normalizeExpression(value.thresholdsExpr, 'thresholdsExpr') ?? {}),
|
|
558
593
|
...(stacked.items ? { items: stacked.items } : {}),
|
|
594
|
+
...(stacked.suppressedCount ? { suppressedCount: stacked.suppressedCount } : {}),
|
|
559
595
|
...(normalizeExpression(value.itemsExpr, 'itemsExpr') ?? {}),
|
|
560
596
|
...(normalizeExpression(value.toneExpr, 'toneExpr') ?? {}),
|
|
561
597
|
...(value.stepLabelWidth !== undefined && (typeof value.stepLabelWidth === 'number' || typeof value.stepLabelWidth === 'string')
|
|
@@ -696,6 +732,8 @@ function renderPraxisPresentationVisualizationHtml(value, options = {}) {
|
|
|
696
732
|
return renderColumnVisualizationHtml(visualization, options);
|
|
697
733
|
case 'processFlow':
|
|
698
734
|
return renderProcessFlowVisualizationHtml(visualization, options);
|
|
735
|
+
case 'waterfall':
|
|
736
|
+
return renderWaterfallVisualizationHtml(visualization, options);
|
|
699
737
|
default:
|
|
700
738
|
return `<span class="pfx-micro-viz__fallback">${escapeHtml(visualization.fallbackText)}</span>`;
|
|
701
739
|
}
|
|
@@ -789,8 +827,11 @@ function renderStackedBarVisualizationHtml(visualization, options) {
|
|
|
789
827
|
})
|
|
790
828
|
.join('')}</span>`
|
|
791
829
|
: '';
|
|
830
|
+
const suppressedAttr = visualization.suppressedCount
|
|
831
|
+
? ` data-suppressed-count="${visualization.suppressedCount}"`
|
|
832
|
+
: '';
|
|
792
833
|
return `
|
|
793
|
-
<span class="pfx-micro-viz pfx-micro-viz__stacked" role="img" aria-label="${escapeHtml(aria)}">${titleHtml}
|
|
834
|
+
<span class="pfx-micro-viz pfx-micro-viz__stacked" role="img" aria-label="${escapeHtml(aria)}"${suppressedAttr}>${titleHtml}
|
|
794
835
|
<span class="pfx-micro-viz__segments">${bars}</span>${legendHtml}
|
|
795
836
|
</span>`;
|
|
796
837
|
}
|
|
@@ -1073,9 +1114,10 @@ function normalizeVisualizationItem(item) {
|
|
|
1073
1114
|
const icon = normalizeText$1(item.icon);
|
|
1074
1115
|
const state = normalizeText$1(item.state);
|
|
1075
1116
|
const tone = normalizeEnum$1(item.tone, VISUALIZATION_TONES);
|
|
1117
|
+
const role = normalizeEnum$1(item.role, WATERFALL_ROLES);
|
|
1076
1118
|
const color = normalizePraxisHexColor(item.color);
|
|
1077
1119
|
const normalizedValue = toFiniteNumber(item.value);
|
|
1078
|
-
if (!id && !label && normalizedValue === undefined && !icon && !state && !tone && !color) {
|
|
1120
|
+
if (!id && !label && normalizedValue === undefined && !icon && !state && !tone && !role && !color) {
|
|
1079
1121
|
return null;
|
|
1080
1122
|
}
|
|
1081
1123
|
return {
|
|
@@ -1085,6 +1127,7 @@ function normalizeVisualizationItem(item) {
|
|
|
1085
1127
|
...(icon ? { icon } : {}),
|
|
1086
1128
|
...(state ? { state } : {}),
|
|
1087
1129
|
...(tone ? { tone } : {}),
|
|
1130
|
+
...(role ? { role } : {}),
|
|
1088
1131
|
...(color ? { color } : {}),
|
|
1089
1132
|
};
|
|
1090
1133
|
}
|
|
@@ -1532,6 +1575,188 @@ function renderProcessFlowVisualizationHtml(visualization, options) {
|
|
|
1532
1575
|
${stepsHtml}
|
|
1533
1576
|
</span>`;
|
|
1534
1577
|
}
|
|
1578
|
+
function formatPraxisWaterfallSignedValue(value, role, options = {}, compactValue = false, suffix = '') {
|
|
1579
|
+
const absFormatted = formatVisualizationMetricValue(Math.abs(Number.isFinite(value) ? value : 0), options, compactValue, suffix);
|
|
1580
|
+
if (role === 'start' || role === 'subtotal' || role === 'total') {
|
|
1581
|
+
const negPrefix = value < 0 ? '-' : '';
|
|
1582
|
+
return `= ${negPrefix}${absFormatted}`;
|
|
1583
|
+
}
|
|
1584
|
+
if (value > 0) {
|
|
1585
|
+
return `+${absFormatted}`;
|
|
1586
|
+
}
|
|
1587
|
+
if (value < 0) {
|
|
1588
|
+
return `-${absFormatted}`;
|
|
1589
|
+
}
|
|
1590
|
+
return absFormatted;
|
|
1591
|
+
}
|
|
1592
|
+
function resolvePraxisMicroWaterfallSteps(visualization, options = {}) {
|
|
1593
|
+
const rawItems = Array.isArray(visualization.items) && visualization.items.length > 0
|
|
1594
|
+
? visualization.items
|
|
1595
|
+
: Array.isArray(visualization.points)
|
|
1596
|
+
? visualization.points.map((pt) => typeof pt === 'number' ? { value: pt } : { label: pt.label, value: pt.value, tone: pt.tone })
|
|
1597
|
+
: [];
|
|
1598
|
+
if (!rawItems.length) {
|
|
1599
|
+
return [];
|
|
1600
|
+
}
|
|
1601
|
+
const suffix = visualization.valueSuffix ?? '';
|
|
1602
|
+
const compactValue = visualization.compactValue === true;
|
|
1603
|
+
const fallbackAnchorTone = visualization.tone ?? 'info';
|
|
1604
|
+
const steps = [];
|
|
1605
|
+
let running = 0;
|
|
1606
|
+
let hasFiniteNumeric = false;
|
|
1607
|
+
for (let i = 0; i < rawItems.length; i++) {
|
|
1608
|
+
const raw = rawItems[i];
|
|
1609
|
+
if (!raw || typeof raw !== 'object') {
|
|
1610
|
+
continue;
|
|
1611
|
+
}
|
|
1612
|
+
const rawNumeric = toFiniteNumber(raw.value);
|
|
1613
|
+
if (rawNumeric !== undefined) {
|
|
1614
|
+
hasFiniteNumeric = true;
|
|
1615
|
+
}
|
|
1616
|
+
const explicitRole = normalizeEnum$1(raw.role, WATERFALL_ROLES);
|
|
1617
|
+
const role = explicitRole
|
|
1618
|
+
?? (steps.length === 0 ? 'start' : (rawNumeric ?? 0) < 0 ? 'decrease' : 'increase');
|
|
1619
|
+
if (rawNumeric === undefined && role !== 'subtotal' && role !== 'total') {
|
|
1620
|
+
continue;
|
|
1621
|
+
}
|
|
1622
|
+
let start = running;
|
|
1623
|
+
let end = running;
|
|
1624
|
+
let delta = 0;
|
|
1625
|
+
let resolvedValue = rawNumeric ?? running;
|
|
1626
|
+
if (role === 'start') {
|
|
1627
|
+
start = 0;
|
|
1628
|
+
end = rawNumeric ?? 0;
|
|
1629
|
+
delta = end;
|
|
1630
|
+
running = end;
|
|
1631
|
+
resolvedValue = end;
|
|
1632
|
+
}
|
|
1633
|
+
else if (role === 'subtotal' || role === 'total') {
|
|
1634
|
+
const targetEnd = rawNumeric ?? running;
|
|
1635
|
+
start = 0;
|
|
1636
|
+
end = targetEnd;
|
|
1637
|
+
delta = targetEnd;
|
|
1638
|
+
running = targetEnd;
|
|
1639
|
+
resolvedValue = targetEnd;
|
|
1640
|
+
}
|
|
1641
|
+
else if (role === 'decrease') {
|
|
1642
|
+
delta = -Math.abs(rawNumeric ?? 0);
|
|
1643
|
+
start = running;
|
|
1644
|
+
end = running + delta;
|
|
1645
|
+
running = end;
|
|
1646
|
+
resolvedValue = delta;
|
|
1647
|
+
}
|
|
1648
|
+
else {
|
|
1649
|
+
delta = Math.abs(rawNumeric ?? 0);
|
|
1650
|
+
start = running;
|
|
1651
|
+
end = running + delta;
|
|
1652
|
+
running = end;
|
|
1653
|
+
resolvedValue = delta;
|
|
1654
|
+
}
|
|
1655
|
+
const defaultTone = role === 'increase'
|
|
1656
|
+
? 'success'
|
|
1657
|
+
: role === 'decrease'
|
|
1658
|
+
? 'danger'
|
|
1659
|
+
: role === 'start'
|
|
1660
|
+
? 'neutral'
|
|
1661
|
+
: fallbackAnchorTone;
|
|
1662
|
+
const tone = normalizeEnum$1(raw.tone, VISUALIZATION_TONES) ?? defaultTone;
|
|
1663
|
+
const label = normalizeText$1(raw.label) ?? normalizeText$1(raw.id) ?? `#${steps.length + 1}`;
|
|
1664
|
+
const signedText = formatPraxisWaterfallSignedValue(role === 'start' || role === 'subtotal' || role === 'total' ? end : delta, role, options, compactValue, suffix);
|
|
1665
|
+
const endText = formatVisualizationMetricValue(Math.abs(end), options, compactValue, suffix);
|
|
1666
|
+
const signedEndText = `${end < 0 ? '-' : ''}${endText}`;
|
|
1667
|
+
const readout = role === 'start' || role === 'subtotal' || role === 'total'
|
|
1668
|
+
? `${label}: ${signedText}`
|
|
1669
|
+
: `${label}: ${signedText} (=> ${signedEndText})`;
|
|
1670
|
+
steps.push({
|
|
1671
|
+
...(raw.id ? { id: raw.id } : {}),
|
|
1672
|
+
label,
|
|
1673
|
+
value: resolvedValue,
|
|
1674
|
+
start,
|
|
1675
|
+
end,
|
|
1676
|
+
delta,
|
|
1677
|
+
role,
|
|
1678
|
+
tone,
|
|
1679
|
+
...(raw.color ? { color: raw.color } : {}),
|
|
1680
|
+
signedText,
|
|
1681
|
+
readout,
|
|
1682
|
+
});
|
|
1683
|
+
}
|
|
1684
|
+
if (!hasFiniteNumeric) {
|
|
1685
|
+
return [];
|
|
1686
|
+
}
|
|
1687
|
+
return steps;
|
|
1688
|
+
}
|
|
1689
|
+
function renderWaterfallVisualizationHtml(visualization, options) {
|
|
1690
|
+
const steps = resolvePraxisMicroWaterfallSteps(visualization, options);
|
|
1691
|
+
const fallbackTone = visualization.tone ?? 'info';
|
|
1692
|
+
if (steps.length === 0) {
|
|
1693
|
+
return renderFallbackVisualizationHtml(visualization, fallbackTone);
|
|
1694
|
+
}
|
|
1695
|
+
const width = 100;
|
|
1696
|
+
const height = 32;
|
|
1697
|
+
const xPad = 4;
|
|
1698
|
+
const yPad = 4;
|
|
1699
|
+
const plotHeight = height - 2 * yPad;
|
|
1700
|
+
const minVal = Math.min(0, ...steps.flatMap((s) => [s.start, s.end]));
|
|
1701
|
+
const maxVal = Math.max(0, ...steps.flatMap((s) => [s.start, s.end]));
|
|
1702
|
+
const span = Math.max(1e-6, maxVal - minVal);
|
|
1703
|
+
const yFor = (val) => yPad + (1 - (val - minVal) / span) * plotHeight;
|
|
1704
|
+
const slotW = (width - 2 * xPad) / steps.length;
|
|
1705
|
+
const barW = Math.max(3, Math.min(18, slotW * 0.64));
|
|
1706
|
+
const barOffset = (slotW - barW) / 2;
|
|
1707
|
+
const barsHtml = [];
|
|
1708
|
+
const connectorsHtml = [];
|
|
1709
|
+
const scrubSlicesHtml = [];
|
|
1710
|
+
for (let i = 0; i < steps.length; i++) {
|
|
1711
|
+
const step = steps[i];
|
|
1712
|
+
const x = xPad + i * slotW + barOffset;
|
|
1713
|
+
const yStart = yFor(step.start);
|
|
1714
|
+
const yEnd = yFor(step.end);
|
|
1715
|
+
const topY = Math.min(yStart, yEnd);
|
|
1716
|
+
const rectH = Math.max(2, Math.abs(yEnd - yStart));
|
|
1717
|
+
const clampedY = Math.min(height - yPad - 2, topY);
|
|
1718
|
+
const styleAttr = step.color ? ` style="color:${escapeHtml(step.color)}"` : '';
|
|
1719
|
+
barsHtml.push(`<rect class="pfx-micro-waterfall__bar" x="${x.toFixed(1)}" y="${clampedY.toFixed(1)}" width="${barW.toFixed(1)}" height="${rectH.toFixed(1)}" rx="1.5" fill="currentColor" data-role="${escapeHtml(step.role)}" data-tone="${escapeHtml(step.tone)}"${styleAttr} />`);
|
|
1720
|
+
if (i < steps.length - 1) {
|
|
1721
|
+
const nextX = xPad + (i + 1) * slotW + barOffset;
|
|
1722
|
+
const connY = yEnd;
|
|
1723
|
+
connectorsHtml.push(`<line class="pfx-micro-waterfall__connector" x1="${(x + barW).toFixed(1)}" y1="${connY.toFixed(1)}" x2="${nextX.toFixed(1)}" y2="${connY.toFixed(1)}" />`);
|
|
1724
|
+
}
|
|
1725
|
+
scrubSlicesHtml.push(`<span class="pfx-micro-waterfall__scrub-slice" data-tone="${escapeHtml(step.tone)}" data-role="${escapeHtml(step.role)}" data-micro-readout="${escapeHtml(step.readout)}" title="${escapeHtml(step.readout)}"></span>`);
|
|
1726
|
+
}
|
|
1727
|
+
const zeroY = yFor(0);
|
|
1728
|
+
const baselineHtml = `<line class="pfx-micro-waterfall__baseline" x1="2" y1="${zeroY.toFixed(1)}" x2="${(width - 2).toFixed(1)}" y2="${zeroY.toFixed(1)}" />`;
|
|
1729
|
+
const isTable = visualization.surface === 'table-cell';
|
|
1730
|
+
const firstStep = steps[0];
|
|
1731
|
+
const lastStep = steps[steps.length - 1];
|
|
1732
|
+
const aria = visualization.ariaLabel
|
|
1733
|
+
?? `${visualization.fallbackText}: ${steps.map((s) => s.readout).join('; ')}`;
|
|
1734
|
+
const startSummaryHtml = !isTable && firstStep
|
|
1735
|
+
? `<div class="pfx-micro-trend__label-col pfx-micro-trend__label-col--start">
|
|
1736
|
+
<span class="pfx-micro-trend__value">${escapeHtml(firstStep.signedText)}</span>
|
|
1737
|
+
<span class="pfx-micro-trend__label">${escapeHtml(firstStep.label)}</span>
|
|
1738
|
+
</div>`
|
|
1739
|
+
: '';
|
|
1740
|
+
const endSummaryHtml = !isTable && lastStep && steps.length > 1
|
|
1741
|
+
? `<div class="pfx-micro-trend__label-col pfx-micro-trend__label-col--end">
|
|
1742
|
+
<span class="pfx-micro-trend__value">${escapeHtml(lastStep.signedText)}</span>
|
|
1743
|
+
<span class="pfx-micro-trend__label">${escapeHtml(lastStep.label)}</span>
|
|
1744
|
+
</div>`
|
|
1745
|
+
: '';
|
|
1746
|
+
return `
|
|
1747
|
+
<span class="pfx-micro-viz-container">
|
|
1748
|
+
${startSummaryHtml}
|
|
1749
|
+
<span class="pfx-micro-viz pfx-micro-viz__waterfall" data-tone="${escapeHtml(fallbackTone)}" role="img" aria-label="${escapeHtml(aria)}">
|
|
1750
|
+
<svg class="pfx-micro-waterfall__svg" viewBox="0 0 ${width} ${height}">
|
|
1751
|
+
${baselineHtml}
|
|
1752
|
+
${connectorsHtml.join('')}
|
|
1753
|
+
${barsHtml.join('')}
|
|
1754
|
+
</svg>
|
|
1755
|
+
<span class="pfx-micro-waterfall__scrub-layer">${scrubSlicesHtml.join('')}</span>
|
|
1756
|
+
</span>
|
|
1757
|
+
${endSummaryHtml}
|
|
1758
|
+
</span>`;
|
|
1759
|
+
}
|
|
1535
1760
|
function renderFallbackVisualizationHtml(visualization, tone) {
|
|
1536
1761
|
return `
|
|
1537
1762
|
<span
|
|
@@ -3541,12 +3766,18 @@ class SchemaNormalizationKernel {
|
|
|
3541
3766
|
if (ui['timeline'] && typeof ui['timeline'] === 'object' && !Array.isArray(ui['timeline'])) {
|
|
3542
3767
|
out.timeline = this.clonePlain(ui['timeline']);
|
|
3543
3768
|
}
|
|
3769
|
+
if (ui['timelineLanes'] && typeof ui['timelineLanes'] === 'object' && !Array.isArray(ui['timelineLanes'])) {
|
|
3770
|
+
out.timelineLanes = this.clonePlain(ui['timelineLanes']);
|
|
3771
|
+
}
|
|
3544
3772
|
if (ui['schedule'] && typeof ui['schedule'] === 'object' && !Array.isArray(ui['schedule'])) {
|
|
3545
3773
|
out.schedule = this.clonePlain(ui['schedule']);
|
|
3546
3774
|
}
|
|
3547
3775
|
if (ui['hierarchy'] && typeof ui['hierarchy'] === 'object' && !Array.isArray(ui['hierarchy'])) {
|
|
3548
3776
|
out.hierarchy = this.clonePlain(ui['hierarchy']);
|
|
3549
3777
|
}
|
|
3778
|
+
if (ui['relationshipGraph'] && typeof ui['relationshipGraph'] === 'object' && !Array.isArray(ui['relationshipGraph'])) {
|
|
3779
|
+
out.relationshipGraph = this.clonePlain(ui['relationshipGraph']);
|
|
3780
|
+
}
|
|
3550
3781
|
if (ui['calculationMemory'] && typeof ui['calculationMemory'] === 'object' && !Array.isArray(ui['calculationMemory'])) {
|
|
3551
3782
|
out.calculationMemory = this.clonePlain(ui['calculationMemory']);
|
|
3552
3783
|
}
|
|
@@ -3908,6 +4139,18 @@ class SchemaNormalizationKernel {
|
|
|
3908
4139
|
field.primarySearch = primarySearch;
|
|
3909
4140
|
}
|
|
3910
4141
|
}
|
|
4142
|
+
if (ui.inlineFilter !== undefined) {
|
|
4143
|
+
const inlineFilter = this.parseOptionalBoolean(ui.inlineFilter);
|
|
4144
|
+
if (inlineFilter !== undefined) {
|
|
4145
|
+
field.inlineFilter = inlineFilter;
|
|
4146
|
+
}
|
|
4147
|
+
}
|
|
4148
|
+
if (ui.inline !== undefined) {
|
|
4149
|
+
const inline = this.parseOptionalBoolean(ui.inline);
|
|
4150
|
+
if (inline !== undefined) {
|
|
4151
|
+
field.inline = inline;
|
|
4152
|
+
}
|
|
4153
|
+
}
|
|
3911
4154
|
if (ui.microVisualization !== undefined) {
|
|
3912
4155
|
const microVisualization = this.parseMicroVisualization(ui.microVisualization);
|
|
3913
4156
|
if (microVisualization) {
|