@datagrok/curves 1.8.0 → 1.10.0
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/.eslintrc.json +39 -0
- package/.vscode/launch.json +10 -9
- package/.vscode/tasks.json +14 -0
- package/CHANGELOG.md +39 -0
- package/databases/plates/0000_init.sql +167 -0
- package/detectors.js +18 -2
- package/dist/package-test.js +16647 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +14467 -1
- package/dist/package.js.map +1 -1
- package/package.json +13 -9
- package/queries/plates-crud.sql +148 -0
- package/src/fit/const.ts +60 -60
- package/src/fit/data-to-curves.ts +592 -0
- package/src/fit/fit-demo.ts +6 -6
- package/src/fit/fit-grid-cell-handler.ts +49 -45
- package/src/fit/fit-renderer.ts +58 -57
- package/src/fit/multi-curve-viewer.ts +43 -21
- package/src/fit/render-utils.ts +315 -315
- package/src/package-api.ts +179 -0
- package/src/package-test.ts +1 -1
- package/src/package.g.ts +171 -3
- package/src/package.ts +227 -298
- package/src/plate/excel-plates.ts +1 -1
- package/src/plate/plate-cell-renderer.ts +20 -12
- package/src/plate/plate-drc-analysis.ts +262 -0
- package/src/plate/plate-reader.ts +5 -5
- package/src/plate/plate-well-validators.ts +41 -0
- package/src/plate/plate-widget.ts +132 -368
- package/src/plate/plate.ts +168 -57
- package/src/plate/plates-folder-preview.ts +63 -0
- package/src/plate/readers/bmg-pherastar-96.ts +7 -7
- package/src/plate/readers/delfia-envision-96-max-rlu.ts +4 -3
- package/src/plate/readers/delfia-envision-by-row.ts +3 -3
- package/src/plate/readers/spectramax.ts +7 -8
- package/src/plate/utils.ts +22 -10
- package/src/plates/numeric_matcher.ts +191 -0
- package/src/plates/objects/plate-template-handler.ts +48 -0
- package/src/plates/plates-app.ts +64 -0
- package/src/plates/plates-crud.ts +502 -0
- package/src/plates/plates-demo.ts +107 -0
- package/src/plates/plates.sql +169 -0
- package/src/plates/views/plates-create-view.ts +123 -0
- package/src/plates/views/plates-schema-view.ts +58 -0
- package/src/plates/views/plates-search-view.ts +137 -0
- package/src/plates/views/plates-templates-view.ts +37 -0
- package/src/pngRenderer.ts +98 -0
- package/src/tests/curves-cell-renderer-tests.ts +93 -92
- package/src/tests/detector-tests.ts +3 -2
- package/src/tests/fit-tests.ts +199 -198
- package/src/tests/plate-tests.ts +6 -7
- package/src/tests/transform-tests.ts +4 -4
- package/test-console-output-1.log +436 -0
- package/test-record-1.mp4 +0 -0
- package/tsconfig.json +1 -1
package/package.json
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagrok/curves",
|
|
3
3
|
"friendlyName": "Curves",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.10.0",
|
|
5
5
|
"description": "Curves provides support for fitted curves (such as dose-response curves), including in-grid rendering, storing charts in cells, interactivity, and automatic fitting.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Dmytro Kovalyov",
|
|
8
8
|
"email": "dkovalyov@datagrok.ai"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@datagrok-libraries/statistics": "^1.
|
|
12
|
-
"@datagrok-libraries/utils": "^4.
|
|
11
|
+
"@datagrok-libraries/statistics": "^1.9.0",
|
|
12
|
+
"@datagrok-libraries/utils": "^4.6.0",
|
|
13
13
|
"@types/wu": "^2.1.42",
|
|
14
|
+
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
15
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
14
16
|
"cash-dom": "^8.0.0",
|
|
15
|
-
"datagrok-api": "^1.
|
|
17
|
+
"datagrok-api": "^1.26.0",
|
|
16
18
|
"dayjs": "^1.11.7",
|
|
17
|
-
"
|
|
19
|
+
"eslint": "^8.1.0",
|
|
20
|
+
"eslint-config-google": "^0.14.0",
|
|
21
|
+
"exceljs": "^4.3.0",
|
|
18
22
|
"jstat": "^1.9.6",
|
|
19
|
-
"
|
|
23
|
+
"rxjs": "^6.5.5"
|
|
20
24
|
},
|
|
21
25
|
"devDependencies": {
|
|
22
|
-
"datagrok-tools": "latest",
|
|
23
26
|
"css-loader": "^5.0.0",
|
|
27
|
+
"datagrok-tools": "^4.14.20",
|
|
24
28
|
"source-map-loader": "^4.0.1",
|
|
25
29
|
"style-loader": "^2.0.0",
|
|
26
30
|
"ts-loader": "^9.5.1",
|
|
@@ -33,7 +37,7 @@
|
|
|
33
37
|
"debug-curves": "webpack && grok publish",
|
|
34
38
|
"release-curves": "webpack && grok publish --release",
|
|
35
39
|
"build-curves": "webpack",
|
|
36
|
-
"build": "webpack",
|
|
40
|
+
"build": "grok api && grok check --soft && webpack",
|
|
37
41
|
"debug-curves-dev": "webpack && grok publish dev",
|
|
38
42
|
"release-curves-dev": "webpack && grok publish dev --release",
|
|
39
43
|
"debug-curves-public": "webpack && grok publish public",
|
|
@@ -54,4 +58,4 @@
|
|
|
54
58
|
"directory": "packages/Curves"
|
|
55
59
|
},
|
|
56
60
|
"category": "Visualizations"
|
|
57
|
-
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
-- name: getPlates
|
|
2
|
+
-- connection: Plates
|
|
3
|
+
SELECT * FROM plates.plates;
|
|
4
|
+
-- end
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
-- name: getWellLevelProperties
|
|
8
|
+
-- description: Get all well level properties (either used in a well or specified in a template)
|
|
9
|
+
-- connection: Plates
|
|
10
|
+
SELECT DISTINCT p.*
|
|
11
|
+
FROM plates.properties p
|
|
12
|
+
JOIN plates.plate_well_values pd ON p.id = pd.property_id
|
|
13
|
+
|
|
14
|
+
UNION
|
|
15
|
+
|
|
16
|
+
SELECT DISTINCT p.*
|
|
17
|
+
FROM plates.properties p
|
|
18
|
+
JOIN plates.template_well_properties twp ON p.id = twp.property_id
|
|
19
|
+
|
|
20
|
+
ORDER BY name;
|
|
21
|
+
-- end
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
-- name: getPlateLevelProperties
|
|
25
|
+
-- description: Get all plate level properties (either used in a plate or specified in a template)
|
|
26
|
+
-- connection: Plates
|
|
27
|
+
SELECT DISTINCT p.*
|
|
28
|
+
FROM plates.properties p
|
|
29
|
+
JOIN plates.plate_details pd ON p.id = pd.property_id
|
|
30
|
+
|
|
31
|
+
UNION
|
|
32
|
+
|
|
33
|
+
SELECT DISTINCT p.*
|
|
34
|
+
FROM plates.properties p
|
|
35
|
+
JOIN plates.template_plate_properties twp ON p.id = twp.property_id
|
|
36
|
+
|
|
37
|
+
ORDER BY name;
|
|
38
|
+
-- end
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
-- name: getPropertyNames
|
|
42
|
+
-- connection: Plates
|
|
43
|
+
SELECT name FROM plates.properties;
|
|
44
|
+
-- end
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
-- name: getPlateTypes
|
|
48
|
+
-- connection: Plates
|
|
49
|
+
SELECT * FROM plates.plate_types;
|
|
50
|
+
-- end
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
-- name: getPlateTemplates
|
|
54
|
+
-- connection: Plates
|
|
55
|
+
SELECT * FROM plates.templates;
|
|
56
|
+
-- end
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
-- name: getWellRoles
|
|
60
|
+
-- connection: Plates
|
|
61
|
+
SELECT pav.id, pav.value_string AS name
|
|
62
|
+
FROM plates.property_allowed_values pav
|
|
63
|
+
JOIN plates.properties p ON pav.property_id = p.id
|
|
64
|
+
WHERE p.name = 'Well Role';
|
|
65
|
+
-- end
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
-- name: getWellValuesByBarcode
|
|
69
|
+
-- connection: Plates
|
|
70
|
+
-- input: string barcode
|
|
71
|
+
select v.row, v.col, v.value_num, v.value_string, v.value_bool, v.property_id from plates.plate_well_values v
|
|
72
|
+
join plates.plates p on v.plate_id = p.id
|
|
73
|
+
where p.barcode = @barcode
|
|
74
|
+
order by property_id, row, col
|
|
75
|
+
-- end
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
-- name: getWellValuesById
|
|
79
|
+
-- connection: Plates
|
|
80
|
+
-- input: int id
|
|
81
|
+
select v.row, v.col, v.value_num, v.value_string, v.value_bool, v.property_id from plates.plate_well_values v
|
|
82
|
+
join plates.plates p on v.plate_id = p.id
|
|
83
|
+
where p.id = @id
|
|
84
|
+
order by property_id, row, col
|
|
85
|
+
-- end
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
-- name: getAllowedValues
|
|
89
|
+
-- connection: Plates
|
|
90
|
+
-- input: string propertyName { choices: getPropertyNames() }
|
|
91
|
+
SELECT pav.id, pav.value_string AS name
|
|
92
|
+
FROM plates.property_allowed_values pav
|
|
93
|
+
JOIN plates.properties p ON pav.property_id = p.id
|
|
94
|
+
WHERE p.name = @propertyName;
|
|
95
|
+
-- end
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
-- name: getUniquePlatePropertyValues
|
|
99
|
+
-- connection: Plates
|
|
100
|
+
SELECT DISTINCT p.name, pd.value_string
|
|
101
|
+
FROM plates.plate_details pd
|
|
102
|
+
JOIN plates.properties p ON pd.property_id = p.id
|
|
103
|
+
WHERE p.type = 'string';
|
|
104
|
+
-- end
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
-- name: getUniqueWellPropertyValues
|
|
108
|
+
-- connection: Plates
|
|
109
|
+
SELECT DISTINCT p.name, pwv.value_string
|
|
110
|
+
FROM plates.plate_well_values pwv
|
|
111
|
+
JOIN plates.properties p ON pwv.property_id = p.id
|
|
112
|
+
WHERE p.type = 'string';
|
|
113
|
+
-- end
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
-- name: createProperty
|
|
117
|
+
-- connection: Plates
|
|
118
|
+
-- input: string propertyName
|
|
119
|
+
-- input: string valueType
|
|
120
|
+
-- output: int propertyId
|
|
121
|
+
INSERT INTO plates.properties(name, type)
|
|
122
|
+
VALUES(@propertyName, @valueType)
|
|
123
|
+
RETURNING id;
|
|
124
|
+
-- end
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
-- name: createTemplate
|
|
128
|
+
-- connection: Plates
|
|
129
|
+
-- input: string name
|
|
130
|
+
-- input: string description
|
|
131
|
+
-- output: int templateId
|
|
132
|
+
INSERT INTO plates.templates(name, description)
|
|
133
|
+
VALUES(@name, @description)
|
|
134
|
+
RETURNING id;
|
|
135
|
+
-- end
|
|
136
|
+
|
|
137
|
+
-- name: getTemplateWellProperties
|
|
138
|
+
-- connection: Plates
|
|
139
|
+
SELECT template_id, property_id
|
|
140
|
+
FROM plates.template_well_properties
|
|
141
|
+
-- end
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
-- name: getTemplatePlateProperties
|
|
145
|
+
-- connection: Plates
|
|
146
|
+
SELECT template_id, property_id
|
|
147
|
+
FROM plates.template_plate_properties
|
|
148
|
+
-- end
|
package/src/fit/const.ts
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
import {IFitSeries} from '@datagrok-libraries/statistics/src/fit/fit-curve';
|
|
2
2
|
|
|
3
3
|
export class FitConstants {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
static TAG_FIT_CHART_FORMAT = '.fitChartFormat';
|
|
5
|
+
static TAG_FIT_CHART_FORMAT_3DX = '3dx';
|
|
6
|
+
static FIT_SEM_TYPE = 'fit';
|
|
7
|
+
static FIT_CELL_TYPE = 'fit';
|
|
8
|
+
static TAG_FIT = '.fit';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
static CELL_DEFAULT_WIDTH = 230;
|
|
11
|
+
static CELL_DEFAULT_HEIGHT = 160;
|
|
12
|
+
static MIN_CELL_RENDERER_PX_WIDTH = 10;
|
|
13
|
+
static MIN_CELL_RENDERER_PX_HEIGHT = 5;
|
|
14
|
+
static MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH = 70;
|
|
15
|
+
static MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT = 45;
|
|
16
|
+
static MIN_AXES_CELL_PX_WIDTH = 100;
|
|
17
|
+
static MIN_AXES_CELL_PX_HEIGHT = 55;
|
|
18
|
+
static MIN_TITLE_PX_WIDTH = 275;
|
|
19
|
+
static MIN_TITLE_PX_HEIGHT = 225;
|
|
20
|
+
static MIN_X_AXIS_NAME_VISIBILITY_PX_WIDTH = 180;
|
|
21
|
+
static MIN_Y_AXIS_NAME_VISIBILITY_PX_HEIGHT = 140;
|
|
22
|
+
static MIN_LEGEND_PX_WIDTH = 325;
|
|
23
|
+
static MIN_LEGEND_PX_HEIGHT = 275;
|
|
24
|
+
static MIN_DROPLINES_VISIBILITY_PX_WIDTH = 120;
|
|
25
|
+
static MIN_DROPLINES_VISIBILITY_PX_HEIGHT = 110;
|
|
26
|
+
static AXES_LEFT_PX_MARGIN = 38;
|
|
27
|
+
static AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS = 45;
|
|
28
|
+
static AXES_TOP_PX_MARGIN = 5;
|
|
29
|
+
static AXES_TOP_PX_MARGIN_WITH_TITLE = 25;
|
|
30
|
+
static AXES_RIGHT_PX_MARGIN = 18;
|
|
31
|
+
static AXES_BOTTOM_PX_MARGIN = 15;
|
|
32
|
+
static AXES_BOTTOM_PX_MARGIN_WITH_AXES_LABELS = 30;
|
|
33
|
+
static X_AXIS_LABEL_BOTTOM_PX_MARGIN = 4;
|
|
34
|
+
static LEGEND_TOP_PX_MARGIN = 10;
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
static OUTLIER_PX_SIZE = 12;
|
|
37
|
+
static POINT_PX_SIZE = 4;
|
|
38
|
+
static OUTLIER_HITBOX_RADIUS = 2;
|
|
39
|
+
static CANDLESTICK_BORDER_PX_SIZE = 4;
|
|
40
|
+
static CANDLESTICK_MEDIAN_PX_SIZE = 3.5;
|
|
41
|
+
static CANDLESTICK_OUTLIER_PX_SIZE = 6;
|
|
42
|
+
static INFLATE_SIZE = -12 / 2;
|
|
43
|
+
static MIN_INFLATE_SIZE = -4 / 2;
|
|
44
|
+
static LEGEND_RECORD_PX_HEIGHT = 18;
|
|
45
|
+
static LEGEND_RECORD_LINE_PX_WIDTH = 20;
|
|
46
|
+
static LEGEND_RECORD_LINE_RIGHT_PX_MARGIN = 5;
|
|
47
|
+
static LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN = 4;
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
static LINE_STYLES: {[key: string]: number[]} = {
|
|
50
|
+
'solid': [],
|
|
51
|
+
'dotted': [1, 1],
|
|
52
|
+
'dashed': [5, 5],
|
|
53
|
+
'dashdotted': [5, 5, 2, 5],
|
|
54
|
+
};
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
static CURVE_CONFIDENCE_INTERVAL_BOUNDS = {
|
|
57
|
+
TOP: 'top',
|
|
58
|
+
BOTTOM: 'bottom',
|
|
59
|
+
};
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
static CONFIDENCE_INTERVAL_STROKE_COLOR = 'rgba(255,191,63,0.4)';
|
|
62
|
+
static CONFIDENCE_INTERVAL_FILL_COLOR = 'rgba(255,238,204,0.3)';
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
static CONDITION_MAP: {[key: string]: ((series?: IFitSeries[]) => boolean)} = {
|
|
65
|
+
'No series to show': (series) => series === undefined || series?.length === 0,
|
|
66
|
+
'There were series with no points': (series) =>
|
|
67
67
|
series!.some((series) => series.points?.length === 0),
|
|
68
|
-
|
|
68
|
+
'There were series with all x zeroes': (series) =>
|
|
69
69
|
series!.some((series) => series.points?.every((point) => point.x === 0)),
|
|
70
|
-
|
|
70
|
+
'There were series with all y zeroes': (series) =>
|
|
71
71
|
series!.some((series) => series.points?.every((point) => point.y === 0)),
|
|
72
|
-
|
|
72
|
+
};
|
|
73
73
|
}
|