@praxisui/charts 10.0.0-rc.41 → 10.0.0-rc.42
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-
|
|
3
|
+
"generatedAt": "2026-11-01T13:59:56.156Z",
|
|
4
4
|
"packageName": "@praxisui/charts",
|
|
5
|
-
"packageVersion": "10.0.0-rc.
|
|
5
|
+
"packageVersion": "10.0.0-rc.42",
|
|
6
6
|
"sourceRegistry": "praxis-component-registry-ingestion",
|
|
7
7
|
"sourceRegistryVersion": "1.0.0",
|
|
8
8
|
"componentCount": 4,
|
|
@@ -749,11 +749,31 @@ class PraxisChartDataTransformerService {
|
|
|
749
749
|
return Math.min(...values);
|
|
750
750
|
case 'max':
|
|
751
751
|
return Math.max(...values);
|
|
752
|
+
case 'median':
|
|
753
|
+
return this.computeLinearPercentile(values, 0.5);
|
|
754
|
+
case 'percentile-90':
|
|
755
|
+
return this.computeLinearPercentile(values, 0.9);
|
|
756
|
+
case 'percentile-95':
|
|
757
|
+
return this.computeLinearPercentile(values, 0.95);
|
|
752
758
|
case 'sum':
|
|
753
759
|
default:
|
|
754
760
|
return values.reduce((sum, value) => sum + value, 0);
|
|
755
761
|
}
|
|
756
762
|
}
|
|
763
|
+
computeLinearPercentile(values, quantile) {
|
|
764
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
765
|
+
if (sorted.length === 1) {
|
|
766
|
+
return sorted[0];
|
|
767
|
+
}
|
|
768
|
+
const position = quantile * (sorted.length - 1);
|
|
769
|
+
const lowerIndex = Math.floor(position);
|
|
770
|
+
const upperIndex = Math.ceil(position);
|
|
771
|
+
if (lowerIndex === upperIndex) {
|
|
772
|
+
return sorted[lowerIndex];
|
|
773
|
+
}
|
|
774
|
+
const weight = position - lowerIndex;
|
|
775
|
+
return sorted[lowerIndex] + (sorted[upperIndex] - sorted[lowerIndex]) * weight;
|
|
776
|
+
}
|
|
757
777
|
extractMetricValue(row, seriesConfig) {
|
|
758
778
|
const field = seriesConfig.metric?.field;
|
|
759
779
|
if (!field) {
|
|
@@ -1983,6 +2003,9 @@ class PraxisChartCanonicalContractMapperService {
|
|
|
1983
2003
|
case 'avg':
|
|
1984
2004
|
case 'min':
|
|
1985
2005
|
case 'max':
|
|
2006
|
+
case 'median':
|
|
2007
|
+
case 'percentile-90':
|
|
2008
|
+
case 'percentile-95':
|
|
1986
2009
|
case 'count':
|
|
1987
2010
|
case 'distinct-count':
|
|
1988
2011
|
case 'sum':
|
|
@@ -2219,6 +2242,12 @@ class PraxisChartCanonicalContractMapperService {
|
|
|
2219
2242
|
return 'MIN';
|
|
2220
2243
|
case 'max':
|
|
2221
2244
|
return 'MAX';
|
|
2245
|
+
case 'median':
|
|
2246
|
+
return 'MEDIAN';
|
|
2247
|
+
case 'percentile-90':
|
|
2248
|
+
return 'PERCENTILE_90';
|
|
2249
|
+
case 'percentile-95':
|
|
2250
|
+
return 'PERCENTILE_95';
|
|
2222
2251
|
case 'avg-per-cycle-occurrence':
|
|
2223
2252
|
return 'AVG_PER_CYCLE_OCCURRENCE';
|
|
2224
2253
|
default:
|
|
@@ -2260,9 +2289,16 @@ class PraxisChartCanonicalContractMapperService {
|
|
|
2260
2289
|
case 'avg':
|
|
2261
2290
|
case 'min':
|
|
2262
2291
|
case 'max':
|
|
2292
|
+
case 'median':
|
|
2293
|
+
case 'percentile-90':
|
|
2294
|
+
case 'percentile-95':
|
|
2263
2295
|
case 'distinct-count':
|
|
2264
2296
|
case 'avg-per-cycle-occurrence':
|
|
2265
2297
|
return lower;
|
|
2298
|
+
case 'percentile_90':
|
|
2299
|
+
return 'percentile-90';
|
|
2300
|
+
case 'percentile_95':
|
|
2301
|
+
return 'percentile-95';
|
|
2266
2302
|
case 'distinct_count':
|
|
2267
2303
|
return 'distinct-count';
|
|
2268
2304
|
case 'avg_per_cycle_occurrence':
|
|
@@ -2723,7 +2759,11 @@ class PraxisChartStatsApiService {
|
|
|
2723
2759
|
? 'DISTINCT_COUNT'
|
|
2724
2760
|
: normalized === 'avg-per-cycle-occurrence'
|
|
2725
2761
|
? 'AVG_PER_CYCLE_OCCURRENCE'
|
|
2726
|
-
:
|
|
2762
|
+
: normalized === 'percentile-90'
|
|
2763
|
+
? 'PERCENTILE_90'
|
|
2764
|
+
: normalized === 'percentile-95'
|
|
2765
|
+
? 'PERCENTILE_95'
|
|
2766
|
+
: metric.toUpperCase()),
|
|
2727
2767
|
};
|
|
2728
2768
|
}
|
|
2729
2769
|
if ('operation' in metric && metric.operation) {
|
|
@@ -2742,7 +2782,11 @@ class PraxisChartStatsApiService {
|
|
|
2742
2782
|
? 'DISTINCT_COUNT'
|
|
2743
2783
|
: metric.aggregation === 'avg-per-cycle-occurrence'
|
|
2744
2784
|
? 'AVG_PER_CYCLE_OCCURRENCE'
|
|
2745
|
-
: metric.aggregation
|
|
2785
|
+
: metric.aggregation === 'percentile-90'
|
|
2786
|
+
? 'PERCENTILE_90'
|
|
2787
|
+
: metric.aggregation === 'percentile-95'
|
|
2788
|
+
? 'PERCENTILE_95'
|
|
2789
|
+
: metric.aggregation.toUpperCase());
|
|
2746
2790
|
const result = {
|
|
2747
2791
|
operation: op,
|
|
2748
2792
|
};
|
|
@@ -7025,11 +7069,18 @@ class AnalyticsChartConfigAdapterService {
|
|
|
7025
7069
|
case 'avg':
|
|
7026
7070
|
case 'min':
|
|
7027
7071
|
case 'max':
|
|
7072
|
+
case 'median':
|
|
7073
|
+
case 'percentile-90':
|
|
7074
|
+
case 'percentile-95':
|
|
7028
7075
|
case 'count':
|
|
7029
7076
|
case 'distinct-count':
|
|
7030
7077
|
case 'sum':
|
|
7031
7078
|
case 'avg-per-cycle-occurrence':
|
|
7032
7079
|
return normalizedAggregation;
|
|
7080
|
+
case 'percentile_90':
|
|
7081
|
+
return 'percentile-90';
|
|
7082
|
+
case 'percentile_95':
|
|
7083
|
+
return 'percentile-95';
|
|
7033
7084
|
case 'avg_per_cycle_occurrence':
|
|
7034
7085
|
return 'avg-per-cycle-occurrence';
|
|
7035
7086
|
case '':
|
|
@@ -8818,6 +8869,9 @@ class EChartsEngineAdapter {
|
|
|
8818
8869
|
const chart = this.chart;
|
|
8819
8870
|
const nextStructuralSignature = this.resolveStructuralSignature(appearance.config);
|
|
8820
8871
|
if (!this.lastStructuralSignature || this.lastStructuralSignature !== nextStructuralSignature) {
|
|
8872
|
+
if (this.lastStructuralSignature) {
|
|
8873
|
+
chart.clear?.();
|
|
8874
|
+
}
|
|
8821
8875
|
chart.setOption(option, true);
|
|
8822
8876
|
}
|
|
8823
8877
|
else {
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/charts",
|
|
3
|
-
"version": "10.0.0-rc.
|
|
3
|
+
"version": "10.0.0-rc.42",
|
|
4
4
|
"description": "Metadata-driven charts library for Praxis UI Angular with engine adapters and Apache ECharts as the initial renderer.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0",
|
|
7
7
|
"@angular/core": "^21.0.0",
|
|
8
|
-
"@praxisui/core": "^10.0.0-rc.
|
|
8
|
+
"@praxisui/core": "^10.0.0-rc.42",
|
|
9
9
|
"@angular/forms": "^21.0.0",
|
|
10
10
|
"@angular/material": "^21.0.0",
|
|
11
|
-
"@praxisui/table": "^10.0.0-rc.
|
|
11
|
+
"@praxisui/table": "^10.0.0-rc.42",
|
|
12
12
|
"rxjs": "~7.8.0"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
@@ -28,14 +28,14 @@ type PraxisChartPrimitive = string | number | boolean | Date | null | undefined;
|
|
|
28
28
|
type PraxisChartDataRow = Record<string, PraxisChartPrimitive>;
|
|
29
29
|
interface PraxisChartQueryMetricConfig {
|
|
30
30
|
field?: string;
|
|
31
|
-
aggregation?: 'sum' | 'count' | 'distinct-count' | 'avg' | 'min' | 'max' | 'avg-per-cycle-occurrence';
|
|
31
|
+
aggregation?: 'sum' | 'count' | 'distinct-count' | 'avg' | 'min' | 'max' | 'median' | 'percentile-90' | 'percentile-95' | 'avg-per-cycle-occurrence';
|
|
32
32
|
alias?: string;
|
|
33
33
|
}
|
|
34
34
|
type PraxisChartStatsOperation = 'group-by' | 'timeseries' | 'distribution' | 'comparison';
|
|
35
35
|
type PraxisChartStatsDistributionMode = 'terms' | 'histogram';
|
|
36
36
|
type PraxisChartStatsOrderBy = 'key-asc' | 'key-desc' | 'value-asc' | 'value-desc';
|
|
37
37
|
type PraxisChartStatsGranularity = 'day' | 'week' | 'month';
|
|
38
|
-
type PraxisChartStatsMetricOperation = 'COUNT' | 'DISTINCT_COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'AVG_PER_CYCLE_OCCURRENCE';
|
|
38
|
+
type PraxisChartStatsMetricOperation = 'COUNT' | 'DISTINCT_COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'PERCENTILE_90' | 'PERCENTILE_95' | 'AVG_PER_CYCLE_OCCURRENCE';
|
|
39
39
|
interface PraxisChartStatsMetricRequest {
|
|
40
40
|
operation: PraxisChartStatsMetricOperation;
|
|
41
41
|
field?: string;
|
|
@@ -183,7 +183,7 @@ type PraxisChartRemoteDataResolverResult = PraxisChartDataRow[] | Promise<Praxis
|
|
|
183
183
|
type PraxisChartRemoteDataResolver = (event: PraxisChartQueryRequestEvent, config: PraxisChartConfig) => PraxisChartRemoteDataResolverResult;
|
|
184
184
|
|
|
185
185
|
type PraxisChartType = 'bar' | 'combo' | 'horizontal-bar' | 'line' | 'pie' | 'donut' | 'area' | 'stacked-bar' | 'stacked-area' | 'scatter' | 'funnel' | 'pyramid' | 'treemap' | 'gauge' | 'heatmap';
|
|
186
|
-
type PraxisChartAggregation = 'sum' | 'count' | 'distinct-count' | 'avg' | 'min' | 'max' | 'avg-per-cycle-occurrence';
|
|
186
|
+
type PraxisChartAggregation = 'sum' | 'count' | 'distinct-count' | 'avg' | 'min' | 'max' | 'median' | 'percentile-90' | 'percentile-95' | 'avg-per-cycle-occurrence';
|
|
187
187
|
interface PraxisChartMetricConfig {
|
|
188
188
|
field?: string;
|
|
189
189
|
aggregation?: PraxisChartAggregation;
|
|
@@ -371,7 +371,7 @@ type PraxisXUiChartStatsOrderBy = 'key-asc' | 'key-desc' | 'value-asc' | 'value-
|
|
|
371
371
|
type PraxisXUiChartComparisonPeriodPreset = 'TODAY' | 'YESTERDAY' | 'LAST_7_DAYS' | 'LAST_30_DAYS' | 'THIS_MONTH' | 'LAST_MONTH' | 'THIS_QUARTER' | 'THIS_YEAR';
|
|
372
372
|
type PraxisXUiChartComparisonPeriodMode = 'PREVIOUS_ALIGNED' | 'PREVIOUS_CALENDAR_PERIOD';
|
|
373
373
|
type PraxisXUiChartDimensionExtraction = 'NONE' | 'HOUR_OF_DAY' | 'DAY_OF_WEEK' | 'DAY_OF_MONTH' | 'MONTH_OF_YEAR' | 'QUARTER_OF_YEAR' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR';
|
|
374
|
-
type PraxisXUiChartAggregation = 'sum' | 'avg' | 'min' | 'max' | 'count' | 'distinct-count' | 'avg-per-cycle-occurrence';
|
|
374
|
+
type PraxisXUiChartAggregation = 'sum' | 'avg' | 'min' | 'max' | 'median' | 'percentile-90' | 'percentile-95' | 'count' | 'distinct-count' | 'avg-per-cycle-occurrence';
|
|
375
375
|
interface PraxisXUiChartFilter {
|
|
376
376
|
field: string;
|
|
377
377
|
operator: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'between' | 'in' | 'contains';
|
|
@@ -637,6 +637,7 @@ declare class PraxisChartDataTransformerService {
|
|
|
637
637
|
private isAreaLikeSeries;
|
|
638
638
|
private transformScatter;
|
|
639
639
|
private aggregate;
|
|
640
|
+
private computeLinearPercentile;
|
|
640
641
|
private extractMetricValue;
|
|
641
642
|
private extractStrictMetricValue;
|
|
642
643
|
private normalizeCategory;
|