@phenyxhealth/data-analytics 0.1.4 → 0.1.5
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/components/ChartBoxPlotMulti.d.ts +9 -0
- package/dist/components/ChartCdf.d.ts +8 -0
- package/dist/components/ChartDensity.d.ts +8 -0
- package/dist/components/ChartHistogram.d.ts +3 -1
- package/dist/components/ChartIndicator.d.ts +8 -0
- package/dist/components/ChartKpiPercentile.d.ts +8 -0
- package/dist/components/ChartKpiRatio.d.ts +8 -0
- package/dist/components/ChartTypePicker.d.ts +12 -0
- package/dist/components/CheckboxDropdown.d.ts +14 -0
- package/dist/components/DataExplorer.d.ts +1 -1
- package/dist/components/FilterPicker.d.ts +10 -0
- package/dist/components/GaugeSvg.d.ts +23 -0
- package/dist/components/TabBar.d.ts +13 -0
- package/dist/data-analytics.css +1 -1
- package/dist/index-BBJrssIB.js +1 -0
- package/dist/index-BRrPw3B8.cjs +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.es.js +1 -1
- package/dist/{plotly.min-CVXkfdkk.cjs → plotly.min-CA4KOnSX.cjs} +1 -1
- package/dist/{plotly.min-BShBGCmk.js → plotly.min-f8mVfez4.js} +1 -1
- package/dist/types/index.d.ts +23 -2
- package/dist/utils/formula.d.ts +8 -0
- package/package.json +3 -2
- package/dist/index-DqV9nrrT.cjs +0 -1
- package/dist/index-zwVceLnx.js +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -6,8 +6,18 @@ export interface DimensionDefinition {
|
|
|
6
6
|
analyticType: AnalyticType;
|
|
7
7
|
label?: string;
|
|
8
8
|
}
|
|
9
|
-
export type ChartType = 'bar' | 'pie' | 'line' | 'table' | 'multibar' | 'sunburst' | 'boxplot' | 'heatmap' | 'scatter' | 'scatter2' | 'histogram' | 'violin' | 'scatter3d' | 'surface3d' | 'subplot3d' | 'subplot2d' | 'parallelcoords';
|
|
9
|
+
export type ChartType = 'bar' | 'pie' | 'line' | 'table' | 'multibar' | 'sunburst' | 'boxplot' | 'heatmap' | 'scatter' | 'scatter2' | 'histogram' | 'violin' | 'density' | 'cdf' | 'scatter3d' | 'surface3d' | 'subplot3d' | 'subplot2d' | 'parallelcoords' | 'indicator' | 'kpiratio' | 'kpicdf' | 'kpipct' | 'boxplotmulti';
|
|
10
|
+
export interface IndicatorThreshold {
|
|
11
|
+
comparison: 'above' | 'below';
|
|
12
|
+
value: number;
|
|
13
|
+
color: string;
|
|
14
|
+
}
|
|
10
15
|
export type ViewSize = 'small' | 'standard' | 'full';
|
|
16
|
+
export interface IndicatorValue {
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
filters: FilterConfig[];
|
|
20
|
+
}
|
|
11
21
|
export interface ViewConfig {
|
|
12
22
|
id: string;
|
|
13
23
|
name: string;
|
|
@@ -22,10 +32,22 @@ export interface ViewConfig {
|
|
|
22
32
|
subplotGroupBy?: string;
|
|
23
33
|
filters: FilterConfig[];
|
|
24
34
|
size?: ViewSize;
|
|
35
|
+
histogramNormalize?: 'none' | 'percent' | 'density';
|
|
36
|
+
kpiField?: string;
|
|
37
|
+
kpiCutoff?: number;
|
|
38
|
+
kpiComparison?: 'above' | 'above_eq' | 'below' | 'below_eq';
|
|
39
|
+
kpiPercentile?: number;
|
|
40
|
+
indicatorValues?: IndicatorValue[];
|
|
41
|
+
indicatorFormula?: string;
|
|
42
|
+
indicatorFormat?: 'percent' | 'perunit';
|
|
43
|
+
indicatorUnit?: number;
|
|
44
|
+
indicatorThresholds?: IndicatorThreshold[];
|
|
25
45
|
}
|
|
26
46
|
export interface FilterConfig {
|
|
27
47
|
field: string;
|
|
28
48
|
values: string[];
|
|
49
|
+
numericComparison?: 'above' | 'above_eq' | 'below' | 'below_eq';
|
|
50
|
+
numericValue?: number;
|
|
29
51
|
}
|
|
30
52
|
export type DataRecord = Record<string, string | number | boolean | null | undefined>;
|
|
31
53
|
export type Theme = 'light' | 'dark';
|
|
@@ -51,7 +73,6 @@ export interface DataExplorerConfig {
|
|
|
51
73
|
export interface DataExplorerProps {
|
|
52
74
|
data: DataRecord[];
|
|
53
75
|
dimensions: DimensionDefinition[];
|
|
54
|
-
title?: string;
|
|
55
76
|
theme?: Theme;
|
|
56
77
|
config?: DataExplorerConfig;
|
|
57
78
|
onChange?: (config: DataExplorerConfig) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safely evaluates a basic arithmetic formula with named variable substitution.
|
|
3
|
+
* Supports: + - * / ( ) and named variables (single uppercase letters A-Z).
|
|
4
|
+
* Returns null on syntax error, division by zero, or invalid result.
|
|
5
|
+
*/
|
|
6
|
+
export declare function evaluateFormula(formula: string, vars: Record<string, number>): number | null;
|
|
7
|
+
/** Letters used as variable IDs, in order */
|
|
8
|
+
export declare const VALUE_IDS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phenyxhealth/data-analytics",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"build": "tsc -b && vite build",
|
|
26
26
|
"build:lib": "tsc -b && vite build --mode lib && node scripts/obfuscate.mjs",
|
|
27
27
|
"lint": "eslint .",
|
|
28
|
-
"preview": "vite preview"
|
|
28
|
+
"preview": "vite preview",
|
|
29
|
+
"publish:lib": "npm run build:lib && npm login && npm publish"
|
|
29
30
|
},
|
|
30
31
|
"peerDependencies": {
|
|
31
32
|
"react": "^18.0.0 || ^19.0.0",
|