gps-global-types 1.0.18 → 1.0.20

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/mst.types.tsx CHANGED
@@ -40,14 +40,15 @@ export type CustomDict = Record<ObjectId, CustomDictEntry>
40
40
 
41
41
  export interface LatestNodes { armordCultureDate: Date | string, isos: any[], _id: ObjectId[] }
42
42
  export interface MSTGraph {
43
- name?: string,
44
- snapshotData?: SnapshotType
43
+ name?:string,
44
+ colorCalendar:Partial<Record<dateKey, Record<string, Color>>> //correctly color nodes based on dates
45
+ snapshotData?:SnapshotType
45
46
  nodes: any //todo:temp//NodeType[] // core parameter of d3tree.js . keeps all isolates collection data
46
47
  links: EdgeType[] // core parameter of d3tree.js
47
48
  latest: LatestNodes // earliest node for easy toggling
48
49
  custom: CustomDict // . I KNOW THIS IS DUMB but from user's pov it results in seamless color transitions across pages
49
50
  legend: MSTLegend // saves legend configs across all color fields
50
- missing: Record<string, any>[] //todo: isolate.types. global
51
+ missing:Record<string,any>[] //todo: isolate.types. global
51
52
  }interface FlashTable {
52
53
  "_id": ObjectId,
53
54
  "MRSN ID¹": mrsnId,
@@ -97,7 +98,7 @@ export interface LegendBullet { //or custom upload data
97
98
  label: string
98
99
  }
99
100
 
100
- export type MSTLegend = Partial<Record<colorKey | 'beforeAndAfter' | 'custom color', LegendBullet[]>> & Partial<Record<dateKey, 'date'>>;
101
+ export type MSTLegend = Partial<Record<colorKey|'beforeAndAfter'|'custom color', LegendBullet[]>> & Partial<Record<dateKey, 'date'>>;
101
102
  // & { 'beforeAndAfter': [{ color: '#666666', label: 'Before ' }, { color: '#4a64aa', label: 'After ' }] }
102
103
 
103
104
 
@@ -158,12 +159,10 @@ export type QueryFields = keyof typeof IsolateFields | 'cluster' | `cluster.${ke
158
159
  export interface getAClusterBody {
159
160
  //theres 4 ways of calling this function
160
161
  //1. through a BAQ involving iso and/or cluster fields
161
- query?: Partial<Record<QueryFields, Object>>,
162
+ query?:Partial<Record< QueryFields, Object>>,
162
163
  // clusterQuery?:Partial<Record<keyof typeof ClusterFields, Object>>, //2. selecting a cluster on /clusters (sending cluster _id)
163
- fuzzy?: number, //3. by recalculating a previous query
164
- neighbors?: number, // (fuzzy and neighbors are only available on recalc)
165
- snapshotData?: SnapshotType //4. uploading a snapshot. (should i extrapolate ),
166
- type: 'clusterId' | 'recalc' | 'BAQ' | 'snapshot' //for backend readability
164
+ fuzzy?:number, //3. by recalculating a previous query
165
+ neighbors?:number, // (fuzzy and neighbors are only available on recalc)
166
+ snapshotData?:SnapshotType //4. uploading a snapshot. (should i extrapolate ),
167
167
 
168
-
169
- }
168
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gps-global-types",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "types shared between front-end and back-end",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/pie.types.tsx CHANGED
@@ -11,7 +11,8 @@ export interface ColorField {//TYPES OF GRAPH FIELDS ColorField datefields becom
11
11
  export type LabelField = string; //if n>1, seperated by '&' which are interpreted as newlines in front-end. var names ends with 'LBL'.
12
12
  export interface ColorType {
13
13
  color: Color, //unique hex of parameter
14
- value: number //count of how many times value will be represented in the pie
14
+ value: number //count of how many times value will be represented in the pie,
15
+ latest?:'latest' //represents if slice belongs to the latest node
15
16
  }
16
17
  export type LabelType = RegexMatchedString<'(\w&)*'> // if many, seperated by '&' qhich are interpreted as newlines in front-end. var names ends with 'LBL'.
17
18
  type DateType = string | Date; // must be able to be interpreted as date type by Date js object
@@ -64,4 +65,14 @@ export interface newLabelProps {
64
65
  labelField: keyof NodeType,
65
66
  svg: ParentSelection,
66
67
  slim: boolean
67
- }
68
+ }
69
+
70
+ type ColorCountTemp = Record<Color,number>; //| ColorType[]
71
+
72
+ type ExcludeB4A<T> = Omit<T, 'beforeAndAfter'>;
73
+ // type ExcludeB4A<T> = Omit<T, 'beforeAndAfter'>;
74
+ export type PreNodeInterface = ExcludeB4A<ExtraNodeTypeFields> & {
75
+ [K in colorKey | dateKey ]: ColorCountTemp;
76
+ } & {
77
+ [K in labelKey]: LabelType;
78
+ } & {populate :(field:colorKey|dateKey, value:Color)=> void} & {tier1: Set<string>,beforeAndAfter:any}