gps-global-types 1.0.15 → 1.0.17

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.
Files changed (2) hide show
  1. package/mst.types.tsx +13 -8
  2. package/package.json +1 -1
package/mst.types.tsx CHANGED
@@ -3,9 +3,7 @@ import type { armordAccessionNumber, Color, mrsnId, ObjectId, RegexMatchedString
3
3
  import type { IsolateFields } from "./isolate.types.js";
4
4
  import type { EdgeType } from "./link.types.js";
5
5
  import type { NodeType } from "./pie.types.js";
6
-
7
- export interface mstGlobalTypes {
8
- //form values
6
+ export interface mstGlobalForm {
9
7
  charge: number, //= -100, // repulsion
10
8
  radius: number, //= 15, // user adjustment of node radius
11
9
  cluster: number, //= 0, // less than highlight threshold for links
@@ -15,12 +13,17 @@ export interface mstGlobalTypes {
15
13
  fuzzyThreshold: number, //= 0, // nodes outside of requested list that are x alleles away from the original mst
16
14
  neighbor: number, //= 1, // how many isolate neighbors to return (minimum)
17
15
  slim?: boolean, //false //are the node labels collapsed or expanded?
18
-
16
+ }
17
+ export interface mstGlobalTypes extends mstGlobalForm {
18
+ //form values
19
+
20
+ graph?:MSTGraph,
19
21
  //interactive nodes
20
- // checkedNodes:mrsnId[], ????
21
- // highlightedNodes:mrsnId[] ????
22
+ checkedNodes:ObjectId[], //
23
+ highlightedNodes:ObjectId[]
22
24
  }
23
25
 
26
+
24
27
  export const colorFields = ['armordPatientId', 'mlst', 'sampleType', 'armordFacility', 'country', 'custom color'] as const; //no :string[] ! removes 'const'
25
28
  export const dateFields = ['armordCultureDate', 'month', 'quarter', 'year'] as const;
26
29
  export const labelFields = ['armordMrsnIdLBL', 'mrsnIdLBL', 'armordAccessionNumberLBL', 'armordPatientIdLBL', 'custom label'] as const;
@@ -152,12 +155,14 @@ export interface SnapshotType {
152
155
  // module.exports = { MSTGraph, MSTLegend, NodeType,EdgeType,Hex, ColorField,LabelField}
153
156
  // exports.unused = {};
154
157
 
158
+ export type QueryFields = keyof typeof IsolateFields | 'cluster' | `cluster.${keyof typeof ClusterFields}` | keyof typeof ClusterFields
159
+
155
160
 
156
161
  export interface getAClusterBody {
157
162
  //theres 4 ways of calling this function
158
163
  //1. through a BAQ involving iso and/or cluster fields
159
- isolatesQuery?:Partial<Record<keyof typeof IsolateFields, Object>>,
160
- clusterQuery?:Partial<Record<keyof typeof ClusterFields, Object>>, //2. selecting a cluster on /clusters (sending cluster _id)
164
+ query?:Partial<Record< QueryFields, Object>>,
165
+ // clusterQuery?:Partial<Record<keyof typeof ClusterFields, Object>>, //2. selecting a cluster on /clusters (sending cluster _id)
161
166
  fuzzy?:number, //3. by recalculating a previous query
162
167
  neighbors?:number, // (fuzzy and neighbors are only available on recalc)
163
168
  snapshotData?:SnapshotType //4. uploading a snapshot. (should i extrapolate ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gps-global-types",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "types shared between front-end and back-end",
5
5
  "main": "index.js",
6
6
  "scripts": {