gps-global-types 1.0.2 → 1.0.3
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 +3 -24
- package/package.json +2 -1
- package/pie.types.tsx +3 -3
package/mst.types.tsx
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { armordAccessionNumber, Color, mrsnId, ObjectId, RegexMatchedString } from "./global.types";
|
|
1
|
+
import type { armordAccessionNumber, Color, mrsnId, ObjectId, RegexMatchedString } from "./global.types.js";
|
|
2
|
+
import type { EdgeType } from "./link.types.js";
|
|
3
|
+
import type { NodeType } from "./pie.types.js";
|
|
2
4
|
|
|
3
5
|
export interface mstGlobalTypes {
|
|
4
6
|
//form values
|
|
@@ -29,29 +31,6 @@ export type labelKey = typeof labelFields[number];
|
|
|
29
31
|
|
|
30
32
|
|
|
31
33
|
|
|
32
|
-
interface ColorType {
|
|
33
|
-
color:Color, //unique hex of parameter
|
|
34
|
-
value:number //count of how many times value will be represented in the pie
|
|
35
|
-
}
|
|
36
|
-
type LabelType = RegexMatchedString<'(\w&)*'> // if many, seperated by '&' qhich are interpreted as newlines in front-end. var names ends with 'LBL'.
|
|
37
|
-
type DateType = string | Date // must be able to be interpreted as date type by Date js object
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
interface ExtraNodeTypeFields {
|
|
41
|
-
id:ObjectId,//unique identifier referenced by Graph.links and d3 Force. String but it's a string of a mongo id
|
|
42
|
-
beforeAndAfter?:ColorType[] //[=[{color:'#fff',value:1}]] so it doesnt break on recalculation
|
|
43
|
-
dateArr:DateType[], // array of armordCultureDates used for beforeAndAfter coloring
|
|
44
|
-
hover?:String, // [=""] //unique fieldfields \/ \/ list seperated by ', ' (only tier1 alleles for now)
|
|
45
|
-
mrsnIds: String[] // for selection logic between table and node=
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
type NodeType = ExtraNodeTypeFields | Record<colorKey|dateKey, ColorType[]> | Record<labelKey, LabelType[]>;
|
|
49
|
-
|
|
50
|
-
interface EdgeType {
|
|
51
|
-
source:string, //node _id edge to
|
|
52
|
-
target:string, //node _id edge from
|
|
53
|
-
value:number //distance between source and target
|
|
54
|
-
}
|
|
55
34
|
|
|
56
35
|
type CustomDictEntry = Record<colorKey|dateKey,Color> | Record<labelKey,string>;
|
|
57
36
|
type CustomDict = Record<ObjectId,CustomDictEntry>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gps-global-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "types shared between front-end and back-end",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"react": "^19.1.1"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
+
"@types/d3": "^7.4.3",
|
|
17
18
|
"typescript": "^5.9.2"
|
|
18
19
|
}
|
|
19
20
|
}
|
package/pie.types.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseType, Selection, SimulationNodeDatum } from "d3"
|
|
2
|
-
import { ObjectId, Color, RegexMatchedString } from "./global.types"
|
|
3
|
-
import { colorKey, dateKey, labelKey } from "./mst.types"
|
|
1
|
+
import type { BaseType, Selection, SimulationNodeDatum } from "d3";
|
|
2
|
+
import type { ObjectId, Color, RegexMatchedString } from "./global.types.tsx"
|
|
3
|
+
import type { colorKey, dateKey, labelKey } from "./mst.types.tsx"
|
|
4
4
|
|
|
5
5
|
export interface ColorField {//TYPES OF GRAPH FIELDS ColorField datefields become colorFields but require additional processing
|
|
6
6
|
color: string, // unique hex or rgb of parameter
|