@datagrok/curves 1.2.0 → 1.2.2

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/CHANGELOG.md CHANGED
@@ -1,25 +1,61 @@
1
1
  # Curves changelog
2
2
 
3
- ## 1.1.0 (2023-07-21)
3
+ ## 1.2.2 (2023-08-04)
4
4
 
5
- This release focuses on improving analysis stability and usability.
5
+ ### Features
6
+
7
+ * [#2101](https://github.com/datagrok-ai/public/issues/2101): Changed minBound and maxBound to min and max in parameterBounds
8
+ * [#2106](https://github.com/datagrok-ai/public/issues/2106): Updated the documentation about parameterBounds
6
9
 
7
- *Dependency: datagarok-api >= 1.16.0*
10
+ ## 1.2.1 (2023-08-02)
8
11
 
9
12
  ### Features
10
13
 
11
- * Improved curve fitting and confidence intervals:
12
- * Added a semantic type detector for "fit" to render fitted curves.
13
- * Fixed performance issues during fitting.
14
- * Automated data sorting during fitting.
15
- * Implemented interactive parameter recalculating.
14
+ * [#2101](https://github.com/datagrok-ai/public/issues/2101): Improved curves properties and rendering:
15
+ * Added dropline rendering for IC50
16
+ * Added empty cell value handling
17
+ * [#2106](https://github.com/datagrok-ai/public/issues/2106): Wrote TS docs and extended the documentation
18
+ * Added error handling in the JnJ parser
19
+
20
+ ## 1.2.0 (2023-07-21)
21
+
22
+ This release focuses on adding new functionality and improving the existing one.
23
+
24
+ ### Features
25
+
26
+ * Added outliers switching in grid cells.
27
+ * Added different modes of rendering: candlesticks (with box plot statistics) and both (with candlesticks outliers).
28
+ * Improved fit detector.
29
+ * Improved curves and confidence intervals rendering for better smooth.
30
+ * Added the capability to run curves by user-defined Javascript function with caching.
31
+ * Improved rendering in the small cells.
16
32
  * Added different marker types.
17
33
  * Improved axes cell rendering.
18
- * Added the possibility to run curves by user-defined Javascript function.
19
- * [#2100](https://github.com/datagrok-ai/public/issues/2100): Made cell renderer edit mode a resizeable window.
20
- * [#2101](https://github.com/datagrok-ai/public/issues/2101): Improved curves properties and rendering:
21
- * Don't render curves before the axes start.
22
- * Changed margins in grid cell for axes
34
+ * Implemented interactive parameter recalculation.
35
+ * [#2105](https://github.com/datagrok-ai/public/issues/2105): Outliers are now shown in red color and with a much bigger size.
36
+ * [#2101](https://github.com/datagrok-ai/public/issues/2101): Improved curves properties and rendering:
37
+ * Curves now don't render before the axes start.
38
+ * Changed margins in grid cell for axes.
23
39
  * Added the capability to control parameter bounds.
40
+ * [#2100](https://github.com/datagrok-ai/public/issues/2100): Made cell renderer edit mode a resizeable window.
41
+
42
+ ### Bug Fixes
43
+
44
+ * [#2101](https://github.com/datagrok-ai/public/issues/2101): Improved curves properties and rendering:
45
+ * Fixed points rendering in logarithmic data.
24
46
  * Fixed curves rendering by inverting the y while converting the coordinates.
25
- * [#2105](https://github.com/datagrok-ai/public/issues/2105): Outliers are now shown in red color and with a much bigger size.
47
+
48
+ ## 1.1.0 (2023-05-19)
49
+
50
+ This release focuses on improving the analysis stability and usability.
51
+
52
+ ### Features
53
+
54
+ * Added support for log transform and axis inverse.
55
+ * Improved curve fitting and confidence intervals:
56
+ * Added a semantic type detector for "fit" to render fitted curves.
57
+ * Automated data sorting during fitting.
58
+
59
+ ### Bug Fixes
60
+
61
+ * Fixed performance issues during fitting.
package/README.md CHANGED
@@ -13,7 +13,7 @@ including in-grid rendering, storing charts in cells, interactivity, and automat
13
13
  - Deep integration with the Datagrok grid
14
14
  - Either fitting on the fly or using the supplied function + parameters
15
15
  - Multiple series in one cell
16
- - Confidence intervals drawing
16
+ - Candlesticks, confidence intervals, and droplines drawing
17
17
  - Ability to define chart, marker, or fitting options (such as fit function or marker color)
18
18
  on the column level, with the ability to override it on a grid cell or point level
19
19
  - Clicking a point in a chart within a grid makes it an outlier -> curve is re-fitted on the fly
@@ -29,47 +29,75 @@ To render a fitted curve based on series points, you need to write it in the fol
29
29
  {
30
30
  "series": [
31
31
  {
32
- "fitLineColor": "#2ca02c",
32
+ "name": "Test series",
33
33
  "pointColor": "#2ca02c",
34
+ "fitLineColor": "#2ca02c",
35
+ "confidenceIntervalColor": "#fbec5d",
36
+ "markerType": "circle",
37
+ "showFitLine": true,
34
38
  "showCurveConfidenceInterval": true,
35
39
  "fitFunction": "sigmoid",
36
40
  "parameters": [1.7391934768969721, -0.9451759934029763, 4.846020678949615, 0.15841886339211816],
41
+ "parameterBounds": [
42
+ {"min": 1.739193476892, "max": 1.739193476898},
43
+ {"max": -0.9451759934029},
44
+ {},
45
+ {"min": 0.158418863392114}
46
+ ],
47
+ "showPoints": "points",
48
+ "clickToToggle": true,
49
+ "droplines": ["IC50"],
37
50
  "points": [
38
51
  { "x": 0.10000000149011612, "y": 0.04152340441942215 },
39
- { "x": 0.6000000238418579, "y": 0.11901605129241943 },
40
- { "x": 1.100000023841858, "y": 0.11143334954977036 },
41
- { "x": 1.600000023841858, "y": 0.0444009006023407 },
42
- { "x": 2.0999999046325684, "y": 0.22933608293533325 },
43
- { "x": 2.5999999046325684, "y": 0.3057132065296173 },
44
- { "x": 3.0999999046325684, "y": 0.28693410754203796 },
45
- { "x": 3.5999999046325684, "y": 0.3156140148639679 },
46
- { "x": 4.099999904632568, "y": 0.4246906042098999 },
47
- { "x": 4.599999904632568, "y": 0.6663704514503479 },
48
- { "x": 5.099999904632568, "y": 1.2085251808166504 },
49
- { "x": 5.599999904632568, "y": 1.4426130056381226 },
50
- { "x": 6.099999904632568, "y": 1.7591952085494995 },
51
- { "x": 6.599999904632568, "y": 1.702673077583313 },
52
- { "x": 7.099999904632568, "y": 1.6438066959381104 }
52
+ { "x": 0.6000000238418579, "y": 0.11901605129241943, "outlier": true },
53
+ { "x": 1.100000023841858, "y": 0.11143334954977036, "outlier": false },
54
+ // ...
53
55
  ]
54
56
  }
55
57
  ],
56
- "chartOptions": { "showStatistics": ["auc"] }
58
+ "chartOptions": {
59
+ "showStatistics": ["auc", "rSquared"],
60
+ "minX": 0.10000000149011612,
61
+ "minY": 0.04152340441942215,
62
+ "maxX": 7.099999904632568,
63
+ "maxY": 1.7591952085494995,
64
+ "xAxisName": "Concentration",
65
+ "yAxisName": "Activity",
66
+ "logX": true,
67
+ "logY": false,
68
+ }
57
69
  }
58
70
  ```
59
71
 
60
- Each series has its own `fit line color` and `point color` assigned. Additionally, each series has a boolean field
61
- indicating whether or not to display the curve confidence intervals. The `fit function` for each series can be
62
- either a sigmoid function or a [custom-defined function](/README.md#creating-custom-fit-function). Furthermore,
63
- the `parameters` for the fit function can be explicitly set or left unset. If the parameters are set explicitly,
64
- the fitting process won't be executed, and vice versa. The `data points` for each series are represented as
65
- arrays of objects, with each object containing x and y coordinates.
66
-
67
- Moreover, the user has the option to obtain various statistics, such as the area under the curve (`auc`) or the
68
- coefficient of determination (`rSquared`).
72
+ Each series has its own parameters, such as:
73
+
74
+ - `name` - controls the series name
75
+ - `pointColor` - overrides the standardized series point color
76
+ - `fitLineColor` - overrides the standardized series fit line color
77
+ - `confidenceIntervalColor` - overrides the standardized series confidence interval color
78
+ - `markerType` - defines the series marker type, which could be `circle`, `asterisk`, `square`, etc.
79
+ - `showFitLine` - defines whether to show the fit line or not
80
+ - `showCurveConfidenceInterval` - defines whether to show the confidence intervals or not
81
+ - `fitFunction` - controls the series fit function, which could be either a sigmoid function or a
82
+ [custom-defined function](/README.md#creating-custom-fit-function).
83
+ - `parameters` - controls the series parameters, if set explicitly - the fitting process won't be executed
84
+ - `parameterBounds` - defines the acceptable range of each parameter, which is taken into account during the fitting. See also `parameters`
85
+ - `showPoints` - defines the data display mode, which could be either `points`, `candlesticks`, `both`, or none
86
+ - `clickToToggle` - defines whether clicking on the point toggles its outlier status and causes curve refitting or not
87
+ - `droplines` - defines the droplines that would be shown on the plot (for instance, IC50)
88
+ - `points` - an array of objects with each object containing x and y coordinates and a boolean outlier value
89
+
90
+ Each chart has its own parameters as well, such as:
91
+
92
+ - `minX`, `minY`, `maxX`, `maxY` - controls the minimum x and y values of the plot
93
+ - `xAxisName`, `yAxisName` - defines the x and y axis names. If the plot size is enough, will render it
94
+ - `logX`, `logY` - defines whether the x and y data should be logarithmic or not
95
+ - `showStatistics` - defines the statistics that would be shown on the plot (such as the area under the curve
96
+ (`auc`) or the coefficient of determination (`rSquared`))
69
97
 
70
98
  ![curves](./img/curves.gif)
71
99
 
72
- ## Creating custom fit function
100
+ ## Creating a custom fit function
73
101
 
74
102
  To render a custom fit function, you need to write in the following JSON format:
75
103
 
@@ -82,12 +110,11 @@ To render a custom fit function, you need to write in the following JSON format:
82
110
  }
83
111
  ```
84
112
 
85
- Each fitting function has its own `name`. This name is used to cache the created custom function, enabling
86
- efficient retrieval and reuse. Additionally, the fit function has `parameter names`, which are stored as
87
- an array of strings.
113
+ Each fitting function has its own `name`, which is used to cache the created custom function, enabling
114
+ efficient retrieval and reuse, and `parameterNames`, which are stored as an array of strings.
88
115
 
89
116
  Also, there are two functions: `getInitialParameters`, which takes arrays of x and y and returns determined
90
- initial parameters values, and `function`, which takes the array of parameters and given x coordinate and
117
+ initial parameter values, and `function`, which takes the array of parameters and the given x coordinate and
91
118
  returns the result of the fit function. These functions are written as JavaScript arrow function expressions.
92
119
 
93
120
  ![custom-fit-function](./img/custom-fit-function.gif)