@phenyxhealth/data-analytics 0.1.8 → 0.1.10

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,4 +1,4 @@
1
- import { g as Dz } from "./index-DMeWJjxj.js";
1
+ import { g as Dz } from "./index-BMoAxTy3.js";
2
2
  function Fz(n0, md) {
3
3
  for (var Op = 0; Op < md.length; Op++) {
4
4
  const Ff = md[Op];
@@ -17,6 +17,7 @@ export interface IndicatorValue {
17
17
  id: string;
18
18
  label: string;
19
19
  filters: FilterConfig[];
20
+ countField?: string;
20
21
  }
21
22
  export interface ViewConfig {
22
23
  id: string;
@@ -24,6 +25,7 @@ export interface ViewConfig {
24
25
  chartType: ChartType;
25
26
  groupBy: string;
26
27
  metric: 'count' | string;
28
+ countField?: string;
27
29
  colorBy?: string;
28
30
  groupByMulti?: string[];
29
31
  numericField?: string;
@@ -1,11 +1,25 @@
1
- import { DataRecord, FilterConfig, DerivedDimension, DimensionDefinition } from '../types/index.ts';
1
+ import { DataRecord, FilterConfig, DerivedDimension, DimensionDefinition, IndicatorValue } from '../types/index.ts';
2
2
  export declare function getUniqueValues(data: DataRecord[], field: string): string[];
3
3
  export declare function applyFilters(data: DataRecord[], filters: FilterConfig[]): DataRecord[];
4
+ export declare function groupAndAggregate(data: DataRecord[], groupBy: string, numericField: string, metric: 'sum' | 'mean', colorBy?: string): {
5
+ name: string;
6
+ value: number;
7
+ [key: string]: string | number;
8
+ }[];
4
9
  export declare function groupAndCount(data: DataRecord[], groupBy: string, colorBy?: string): {
5
10
  name: string;
6
11
  count: number;
7
12
  [key: string]: string | number;
8
13
  }[];
14
+ export declare function countDistinctFiltered(data: DataRecord[], filters: FilterConfig[], countField: string): number;
15
+ export declare function groupAndCountDistinct(data: DataRecord[], groupBy: string, countField: string): {
16
+ name: string;
17
+ count: number;
18
+ }[];
19
+ export declare function groupAndFormula(data: DataRecord[], groupBy: string, indicatorValues: IndicatorValue[], formula: string): {
20
+ name: string;
21
+ value: number;
22
+ }[];
9
23
  export declare function getColorKeys(data: DataRecord[], colorBy: string): string[];
10
24
  export declare function groupAndCountMulti(data: DataRecord[], fields: string[], fieldLabels?: Record<string, string>): {
11
25
  name: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@phenyxhealth/data-analytics",
3
3
  "private": false,
4
- "version": "0.1.8",
4
+ "version": "0.1.10",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -23,7 +23,7 @@
23
23
  "scripts": {
24
24
  "dev": "vite",
25
25
  "build": "tsc -b && vite build",
26
- "build:lib": "tsc -b && vite build --mode lib && node scripts/obfuscate.mjs",
26
+ "build:lib": "tsc -b && vite build --mode lib",
27
27
  "lint": "eslint .",
28
28
  "preview": "vite preview",
29
29
  "publish:lib": "npm run build:lib && npm login && npm publish"