@datagrok/curves 1.8.0 → 1.9.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.
Files changed (54) hide show
  1. package/.eslintrc.json +39 -0
  2. package/.vscode/launch.json +10 -9
  3. package/.vscode/tasks.json +14 -0
  4. package/CHANGELOG.md +33 -0
  5. package/databases/plates/0000_init.sql +167 -0
  6. package/detectors.js +2 -2
  7. package/dist/package-test.js +15930 -1
  8. package/dist/package-test.js.map +1 -1
  9. package/dist/package.js +13750 -1
  10. package/dist/package.js.map +1 -1
  11. package/package.json +12 -8
  12. package/queries/plates-crud.sql +148 -0
  13. package/src/fit/const.ts +60 -60
  14. package/src/fit/data-to-curves.ts +220 -0
  15. package/src/fit/fit-demo.ts +6 -6
  16. package/src/fit/fit-grid-cell-handler.ts +48 -44
  17. package/src/fit/fit-renderer.ts +56 -55
  18. package/src/fit/multi-curve-viewer.ts +38 -18
  19. package/src/fit/render-utils.ts +315 -315
  20. package/src/package-api.ts +167 -0
  21. package/src/package-test.ts +1 -1
  22. package/src/package.g.ts +133 -3
  23. package/src/package.ts +198 -299
  24. package/src/plate/excel-plates.ts +1 -1
  25. package/src/plate/plate-cell-renderer.ts +20 -12
  26. package/src/plate/plate-drc-analysis.ts +262 -0
  27. package/src/plate/plate-reader.ts +5 -5
  28. package/src/plate/plate-well-validators.ts +41 -0
  29. package/src/plate/plate-widget.ts +132 -368
  30. package/src/plate/plate.ts +168 -57
  31. package/src/plate/plates-folder-preview.ts +63 -0
  32. package/src/plate/readers/bmg-pherastar-96.ts +7 -7
  33. package/src/plate/readers/delfia-envision-96-max-rlu.ts +4 -3
  34. package/src/plate/readers/delfia-envision-by-row.ts +3 -3
  35. package/src/plate/readers/spectramax.ts +7 -8
  36. package/src/plate/utils.ts +22 -10
  37. package/src/plates/numeric_matcher.ts +191 -0
  38. package/src/plates/objects/plate-template-handler.ts +48 -0
  39. package/src/plates/plates-app.ts +64 -0
  40. package/src/plates/plates-crud.ts +502 -0
  41. package/src/plates/plates-demo.ts +107 -0
  42. package/src/plates/plates.sql +169 -0
  43. package/src/plates/views/plates-create-view.ts +123 -0
  44. package/src/plates/views/plates-schema-view.ts +58 -0
  45. package/src/plates/views/plates-search-view.ts +137 -0
  46. package/src/plates/views/plates-templates-view.ts +38 -0
  47. package/src/tests/curves-cell-renderer-tests.ts +93 -92
  48. package/src/tests/detector-tests.ts +3 -2
  49. package/src/tests/fit-tests.ts +199 -198
  50. package/src/tests/plate-tests.ts +6 -7
  51. package/src/tests/transform-tests.ts +4 -4
  52. package/test-console-output-1.log +435 -0
  53. package/test-record-1.mp4 +0 -0
  54. package/tsconfig.json +1 -1
package/.eslintrc.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "es6": true
5
+ },
6
+ "extends": ["google"],
7
+ "parser": "@typescript-eslint/parser",
8
+ "parserOptions": {
9
+ "ecmaVersion": 12,
10
+ "sourceType": "module"
11
+ },
12
+ "plugins": ["@typescript-eslint"],
13
+ "rules": {
14
+ "indent": ["error", 2, { "SwitchCase": 1 }],
15
+ "max-len": ["error", 120],
16
+ "no-unused-vars": "off",
17
+ "@typescript-eslint/no-unused-vars": [
18
+ "warn",
19
+ { "varsIgnorePattern": "^(_|ui$|grok$|DG$)", "argsIgnorePattern": "^_" }
20
+ ],
21
+ "require-jsdoc": "off",
22
+ "valid-jsdoc": "off",
23
+ "spaced-comment": "off",
24
+ "linebreak-style": "off",
25
+ "curly": ["error", "multi-or-nest", "consistent"],
26
+ "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
27
+ "block-spacing": [2, "always"],
28
+ "comma-dangle": [
29
+ "error",
30
+ {
31
+ "arrays": "only-multiline",
32
+ "functions": "never",
33
+ "objects": "only-multiline",
34
+ "imports": "only-multiline"
35
+ }
36
+ ],
37
+ "guard-for-in": "off"
38
+ }
39
+ }
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "version": "0.2.0",
3
3
  "configurations": [
4
- {
5
- "preLaunchTask": "rebuild",
6
- "type": "chrome",
7
- "request": "launch",
8
- "name": "Launch Chrome against Dev",
9
- "url": "https://dev.datagrok.ai/",
10
- "webRoot": "${workspaceFolder}"
11
- }
4
+ {
5
+ "name": "Launch Curves",
6
+ "type": "chrome",
7
+ "request": "launch",
8
+ "url": "http://localhost:8888",
9
+ "preLaunchTask": "debug-curves",
10
+ "webRoot": "${workspaceFolder}",
11
+ "restart": true
12
+ }
12
13
  ]
13
- }
14
+ }
@@ -5,6 +5,20 @@
5
5
  "type": "shell",
6
6
  "command": "(cmd.exe /c \"npm run build) -and (grok publish dev\")",
7
7
  "label": "rebuild"
8
+ },
9
+ {
10
+ "label": "debug-curves",
11
+ "type": "shell",
12
+ "command": "npm run debug-curves",
13
+ "group": {
14
+ "kind": "build",
15
+ "isDefault": true
16
+ },
17
+ "presentation": {
18
+ "reveal": "always",
19
+ "panel": "new"
20
+ },
21
+ "problemMatcher": []
8
22
  }
9
23
  ]
10
24
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # Curves changelog
2
2
 
3
+
4
+ ## 1.6.0 - 1.8.0 (2025-03-31)
5
+
6
+ ### Features
7
+
8
+ * GROK-17295: Fitting caching:
9
+ * Performance improvements
10
+ * Cached fitting and wrote tests
11
+ * Fixed margins
12
+ * Fit: Disabled caching for non valid row indexes
13
+ * Outliers: Made outlier toggling not to invalidate the whole grid
14
+ * Added custom event for outlier toggling
15
+ * Added 4pl-regression fit function
16
+ * #3195: Plate Viewer:
17
+ * Supported plate handling
18
+ * Implemented automatic plate import from Excel
19
+ * Added new fluent API
20
+ * Enabled DRC with grouping
21
+ * Supported multi-plate file folders
22
+ * Added details, stats column, IC50, curve preview, statistics recalculation, outlier marking, configuration options
23
+ * Implemented content-dependent file import
24
+ * Added rendering for 1536-well plates
25
+ * Enabled inspection of single series in plate
26
+ * Added demo
27
+ * Plate readers: Added Delfia Envision and Spectramax parsers
28
+ * Added docs on plate DRC
29
+
30
+ ### Bug fixes
31
+
32
+ * Fixed MultiCurveViewer issues
33
+ * Fit panel: Fixed namings and inputs
34
+ * GROK-17492: Fixed error when adding statistics column if the series has no name
35
+
3
36
  ## 1.5.0 (2024-08-23)
4
37
 
5
38
  ### Features
@@ -0,0 +1,167 @@
1
+ -- Explains the meaning of a scalar property.
2
+ CREATE TABLE plates.semantic_types (
3
+ id SERIAL PRIMARY KEY,
4
+ name TEXT NOT NULL, -- e.g., "Molecule", "Cell", "Tissue", "Organism", "Treatment", "Drug", "Image"
5
+ description TEXT
6
+ );
7
+
8
+ -- Similar to core.properties or MolTrack.properties
9
+ -- Consider merging
10
+ CREATE TABLE plates.properties (
11
+ id SERIAL PRIMARY KEY,
12
+ name TEXT NOT NULL,
13
+ nullable BOOLEAN NOT NULL DEFAULT TRUE, -- used for validation of the submitted data
14
+ type TEXT CHECK (type IN ('int', 'double', 'bool', 'datetime', 'string')),
15
+ semType TEXT, -- Semantic type
16
+ userEditable BOOLEAN, -- Whether the property should be editable via the UI
17
+ units TEXT, -- Units of measurement
18
+ min REAL, -- Minimum value. Applicable to numerical properties only
19
+ max REAL, -- Maximum value. Applicable to numerical properties only
20
+ step REAL, -- Step to be used in a slider. Only applies to numerical properties
21
+ showSlider REAL, -- Whether a slider appears next to the number input. Applies to numerical columns only
22
+ showPlusMinus REAL, -- Whether a plus/minus clicker appears next to the number input. Applies to numerical columns only
23
+ inputType TEXT, -- Property input type (see DG.InputType)
24
+ category TEXT, -- Corresponding category on the context panel
25
+ format TEXT, -- Value format, such as '0.000'
26
+ choices TEXT, -- JSON-encoded list of choices. Applicable to string properties only
27
+ validators TEXT, -- JSON-encoded list of validators, such as '[">42"]'
28
+ friendlyName TEXT, -- Custom field friendly name shown in [PropertyGrid]
29
+ options JSONB, -- Additional options
30
+
31
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
32
+ );
33
+
34
+ -- Allowed values for properties that are strings, floats, or integers.
35
+ -- When allowed values are present, the property value must be one of the allowed values.
36
+ CREATE TABLE plates.property_allowed_values (
37
+ id SERIAL PRIMARY KEY,
38
+ property_id INTEGER NOT NULL REFERENCES plates.properties(id),
39
+ value_string TEXT,
40
+ value_float REAL,
41
+ value_int INTEGER
42
+ );
43
+
44
+ -- maximum volume per well, material, shape (round bottom, conical).
45
+ CREATE TABLE plates.plate_types (
46
+ id SERIAL PRIMARY KEY,
47
+ name TEXT,
48
+ rows SMALLINT,
49
+ cols SMALLINT,
50
+ max_volume REAL -- microliters
51
+ );
52
+
53
+ -- layouts are reused across assay runs
54
+ CREATE TABLE plates.layouts (
55
+ id SERIAL PRIMARY KEY,
56
+ rows SMALLINT,
57
+ cols SMALLINT,
58
+ description TEXT,
59
+ details JSONB,
60
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
61
+ created_by UUID
62
+ );
63
+
64
+ -- represents an assay plate
65
+ CREATE TABLE plates.plates (
66
+ id SERIAL PRIMARY KEY,
67
+ layout_id INTEGER references plates.layouts(id),
68
+ plate_type_id INTEGER references plates.plate_types(id),
69
+ barcode TEXT,
70
+ description TEXT,
71
+ details JSONB,
72
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
73
+ created_by UUID
74
+ );
75
+
76
+ -- User-defined plate details
77
+ -- Stored in the Plate.meta in TypeScript
78
+ CREATE TABLE plates.plate_details (
79
+ plate_id INTEGER NOT NULL REFERENCES plates.plates(id),
80
+ property_id INTEGER NOT NULL REFERENCES plates.properties(id),
81
+
82
+ value_datetime TIMESTAMP WITH TIME ZONE,
83
+ value_uuid uuid,
84
+ value_num REAL,
85
+ value_string TEXT,
86
+ value_bool BOOLEAN,
87
+
88
+ PRIMARY KEY (plate_id, property_id)
89
+ );
90
+
91
+ -- A template specifies a set of properties applicable on plate and well levels.
92
+ -- See also template_plate_properties and template_well_properties.
93
+ CREATE TABLE plates.templates (
94
+ id SERIAL PRIMARY KEY,
95
+ plate_layout_id INTEGER REFERENCES plates.plates(id),
96
+ name TEXT,
97
+ description TEXT,
98
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
99
+ created_by UUID
100
+ );
101
+
102
+ CREATE TABLE plates.template_plate_properties (
103
+ template_id INTEGER NOT NULL references plates.templates(id),
104
+ property_id INTEGER NOT NULL references plates.properties(id),
105
+ PRIMARY KEY (template_id, property_id)
106
+ );
107
+
108
+ CREATE TABLE plates.template_well_properties (
109
+ template_id INTEGER NOT NULL references plates.templates(id),
110
+ property_id INTEGER NOT NULL references plates.properties(id),
111
+ PRIMARY KEY (template_id, property_id)
112
+ );
113
+
114
+
115
+ CREATE TABLE plates.plate_layout_wells (
116
+ layout_id INTEGER NOT NULL references plates.plates(id),
117
+ row SMALLINT,
118
+ col SMALLINT,
119
+ PRIMARY KEY (layout_id, row, col)
120
+ );
121
+
122
+ CREATE TABLE plates.plate_wells (
123
+ plate_id INTEGER NOT NULL references plates.plates(id),
124
+ row SMALLINT,
125
+ col SMALLINT,
126
+ details JSONB,
127
+ PRIMARY KEY (plate_id, row, col)
128
+ );
129
+
130
+ CREATE TABLE plates.plate_well_values (
131
+ plate_id INTEGER NOT NULL references plates.plates(id),
132
+ row SMALLINT,
133
+ col SMALLINT,
134
+ property_id INTEGER references plates.properties(id),
135
+
136
+ value_num REAL,
137
+ value_string TEXT,
138
+ value_bool BOOLEAN
139
+ );
140
+
141
+
142
+ INSERT INTO plates.semantic_types (name) values ('Molecule');
143
+ INSERT INTO plates.semantic_types (name) values ('Solvent');
144
+ INSERT INTO plates.semantic_types (name) values ('URL');
145
+ INSERT INTO plates.semantic_types (name) values ('Image');
146
+
147
+ INSERT INTO plates.properties (id, name, type, units) values (1000, 'Volume', 'double', 'uL');
148
+ INSERT INTO plates.properties (id, name, type, units) values (1001, 'Concentration', 'double', 'uM');
149
+ INSERT INTO plates.properties (id, name, type) values (1002, 'Sample', 'string');
150
+ INSERT INTO plates.properties (id, name, type) values (1003, 'Well Role', 'string');
151
+
152
+ INSERT INTO plates.plate_types (id, name, rows, cols) values (1, 'Generic 96 wells', 8, 12);
153
+ INSERT INTO plates.plate_types (id, name, rows, cols) values (2, 'Generic 384 wells', 16, 24);
154
+ INSERT INTO plates.plate_types (id, name, rows, cols) values (3, 'Generic 1536 wells', 32, 48);
155
+
156
+ INSERT INTO plates.property_allowed_values (property_id, value_string)
157
+ VALUES
158
+ (1003, 'Empty'),
159
+ (1003, 'Sample'),
160
+ (1003, 'DMSO'),
161
+ (1003, 'Low Control'),
162
+ (1003, 'High Control');
163
+
164
+
165
+ GRANT ALL PRIVILEGES ON SCHEMA plates TO CURRENT_USER;
166
+ GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA plates TO :LOGIN;
167
+ GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA plates TO :LOGIN;
package/detectors.js CHANGED
@@ -26,11 +26,11 @@ class CurvesPackageDetectors extends DG.Package {
26
26
  //output: string semType
27
27
  detectFit(col) {
28
28
  if (DG.Detector.sampleCategories(col, (s) => {
29
- return s.includes('series') && s.includes('points') && s.includes('fitFunction');
29
+ return s.includes('series') && s.includes('points');
30
30
  }, 1)) {
31
31
  col.semType = FIT_SEM_TYPE;
32
32
  return col.semType;
33
33
  }
34
34
  return null;
35
- }
35
+ }
36
36
  }