@datagrok/curves 1.0.1

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 (45) hide show
  1. package/.vscode/launch.json +13 -0
  2. package/.vscode/tasks.json +10 -0
  3. package/README.md +19 -0
  4. package/detectors.js +35 -0
  5. package/dist/package-test.js +591 -0
  6. package/dist/package-test.js.map +1 -0
  7. package/dist/package.js +15899 -0
  8. package/dist/package.js.map +1 -0
  9. package/package.json +53 -0
  10. package/package.png +0 -0
  11. package/src/fit/cell-render-viewer.js +33 -0
  12. package/src/fit/cell-render-viewer.js.map +1 -0
  13. package/src/fit/cell-render-viewer.ts +45 -0
  14. package/src/fit/fit-data.js +221 -0
  15. package/src/fit/fit-data.js.map +1 -0
  16. package/src/fit/fit-data.ts +335 -0
  17. package/src/fit/fit-demo.js +91 -0
  18. package/src/fit/fit-demo.js.map +1 -0
  19. package/src/fit/fit-demo.ts +98 -0
  20. package/src/fit/fit-grid-cell-handler.js +54 -0
  21. package/src/fit/fit-grid-cell-handler.js.map +1 -0
  22. package/src/fit/fit-grid-cell-handler.ts +70 -0
  23. package/src/fit/fit-parser.js +115 -0
  24. package/src/fit/fit-parser.js.map +1 -0
  25. package/src/fit/fit-parser.ts +144 -0
  26. package/src/fit/fit-renderer.js +167 -0
  27. package/src/fit/fit-renderer.js.map +1 -0
  28. package/src/fit/fit-renderer.ts +202 -0
  29. package/src/fit/multi-curve-viewer.js +67 -0
  30. package/src/fit/multi-curve-viewer.js.map +1 -0
  31. package/src/fit/multi-curve-viewer.ts +87 -0
  32. package/src/fit/transform.js +73 -0
  33. package/src/fit/transform.js.map +1 -0
  34. package/src/fit/transform.ts +101 -0
  35. package/src/package-test.js +26 -0
  36. package/src/package-test.js.map +1 -0
  37. package/src/package-test.ts +18 -0
  38. package/src/package.js +50 -0
  39. package/src/package.js.map +1 -0
  40. package/src/package.ts +48 -0
  41. package/src/tests/fit-viewer-test.js +16 -0
  42. package/src/tests/fit-viewer-test.js.map +1 -0
  43. package/src/tests/fit-viewer-test.ts +11 -0
  44. package/tsconfig.json +71 -0
  45. package/webpack.config.js +54 -0
@@ -0,0 +1,67 @@
1
+ import { CellRenderViewer } from "./cell-render-viewer";
2
+ import { FitChartCellRenderer } from "./fit-renderer";
3
+ import { FIT_SEM_TYPE, FitChartData, fitChartDataProperties, getChartData, mergeProperties } from "./fit-data";
4
+ import { debounce } from 'rxjs/operators';
5
+ import { interval, merge } from 'rxjs';
6
+ export class MultiCurveViewer extends CellRenderViewer {
7
+ constructor() {
8
+ super(new FitChartCellRenderer());
9
+ this.showSelectedRowsCurves = false;
10
+ this.showCurrentRowCurve = true;
11
+ this.showMouseOverRowCurve = true;
12
+ this.rows = [];
13
+ this.data = new FitChartData();
14
+ this.curvesColumnName = this.column('curves');
15
+ this.showSelectedRowsCurves = this.bool('showSelectedRowsCurves', false, { description: 'Adds curves from the selected rows' });
16
+ this.showCurrentRowCurve = this.bool('showCurrentRowCurve', true);
17
+ this.showMouseOverRowCurve = this.bool('showMouseOverRowCurve', true);
18
+ for (const p of fitChartDataProperties)
19
+ this.addProperty(p.name, p.propertyType, p.defaultValue, p.options);
20
+ }
21
+ static fromChartData(chartData) {
22
+ let viewer = new MultiCurveViewer();
23
+ viewer.data = chartData;
24
+ viewer.render();
25
+ return viewer;
26
+ }
27
+ applyViewerProperties() {
28
+ mergeProperties(fitChartDataProperties, this, this.data.chartOptions);
29
+ }
30
+ createChartData() {
31
+ var _a, _b;
32
+ this.rows.length = 0;
33
+ if (this.showCurrentRowCurve && this.dataFrame.currentRowIdx != -1)
34
+ this.rows.push(this.dataFrame.currentRowIdx);
35
+ if (this.showMouseOverRowCurve && this.dataFrame.mouseOverRowIdx != -1)
36
+ this.rows.push(this.dataFrame.mouseOverRowIdx);
37
+ if (this.showSelectedRowsCurves && this.dataFrame.mouseOverRowIdx != -1)
38
+ this.rows.push(...this.dataFrame.selection.getSelectedIndexes());
39
+ this.data = new FitChartData();
40
+ const grid = (_a = this.tableView) === null || _a === void 0 ? void 0 : _a.grid;
41
+ for (let i of this.rows) {
42
+ const cellCurves = getChartData(grid.cell(this.curvesColumnName, grid.tableRowToGrid(i)));
43
+ (_b = this.data.series) === null || _b === void 0 ? void 0 : _b.push(...cellCurves.series);
44
+ }
45
+ }
46
+ onPropertyChanged(property) {
47
+ this.applyViewerProperties();
48
+ this.render();
49
+ }
50
+ onTableAttached() {
51
+ var _a, _b, _c;
52
+ const grid = (_a = this.tableView) === null || _a === void 0 ? void 0 : _a.grid;
53
+ (_b = this.curvesColumnName) !== null && _b !== void 0 ? _b : (this.curvesColumnName = (_c = this.dataFrame.columns.bySemType(FIT_SEM_TYPE)) === null || _c === void 0 ? void 0 : _c.name);
54
+ merge(this.dataFrame.onCurrentCellChanged, grid.onCellMouseEnter, this.dataFrame.onSelectionChanged)
55
+ .pipe(debounce(_ => interval(50)))
56
+ .subscribe(_ => {
57
+ this.createChartData();
58
+ this.render();
59
+ });
60
+ }
61
+ render() {
62
+ const g = this.canvas.getContext('2d');
63
+ g.clearRect(0, 0, this.canvas.width, this.canvas.height);
64
+ this.renderer.renderCurves(g, 0, 0, this.canvas.width, this.canvas.height, this.data);
65
+ }
66
+ }
67
+ //# sourceMappingURL=multi-curve-viewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-curve-viewer.js","sourceRoot":"","sources":["multi-curve-viewer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,YAAY,EAEZ,eAAe,EAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAC,QAAQ,EAAS,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,MAAM,CAAC;AAGrC,MAAM,OAAO,gBAAiB,SAAQ,gB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AS,CAAC,YAAY,CAAC,0CAAE,IAAI,EAAC;QAE/E,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC;aACjG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;aACjC,SAAS,CAAC,CAAC,CAAC,EAAE;YACb,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,MAAM;QACJ,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAE,CAAA;QACvC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACzD,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACxF,CAAC;CACF"}
@@ -0,0 +1,87 @@
1
+ import * as DG from 'datagrok-api/dg';
2
+ import {CellRenderViewer} from "./cell-render-viewer";
3
+ import {FitChartCellRenderer} from "./fit-renderer";
4
+ import {
5
+ FIT_SEM_TYPE,
6
+ FitChartData,
7
+ fitChartDataProperties,
8
+ getChartData,
9
+ IFitChartData,
10
+ mergeProperties
11
+ } from "./fit-data";
12
+ import {debounce, filter} from 'rxjs/operators';
13
+ import {interval, merge} from 'rxjs';
14
+
15
+
16
+ export class MultiCurveViewer extends CellRenderViewer<FitChartCellRenderer> {
17
+ curvesColumnName?: string;
18
+ showSelectedRowsCurves: boolean = false;
19
+ showCurrentRowCurve: boolean = true;
20
+ showMouseOverRowCurve: boolean = true;
21
+ rows: number[] = [];
22
+ data: IFitChartData = new FitChartData();
23
+
24
+ constructor() {
25
+ super(new FitChartCellRenderer());
26
+
27
+ this.curvesColumnName = this.column('curves');
28
+
29
+ this.showSelectedRowsCurves = this.bool('showSelectedRowsCurves', false, { description: 'Adds curves from the selected rows'});
30
+ this.showCurrentRowCurve = this.bool('showCurrentRowCurve', true);
31
+ this.showMouseOverRowCurve = this.bool('showMouseOverRowCurve', true);
32
+
33
+ for (const p of fitChartDataProperties)
34
+ this.addProperty(p.name, p.propertyType, p.defaultValue, p.options);
35
+ }
36
+
37
+ static fromChartData(chartData: IFitChartData): MultiCurveViewer {
38
+ let viewer = new MultiCurveViewer();
39
+ viewer.data = chartData;
40
+ viewer.render();
41
+ return viewer;
42
+ }
43
+
44
+ applyViewerProperties() {
45
+ mergeProperties(fitChartDataProperties, this, this.data.chartOptions);
46
+ }
47
+
48
+ createChartData() {
49
+ this.rows.length = 0;
50
+ if (this.showCurrentRowCurve && this.dataFrame.currentRowIdx != -1)
51
+ this.rows.push(this.dataFrame.currentRowIdx);
52
+ if (this.showMouseOverRowCurve && this.dataFrame.mouseOverRowIdx != -1)
53
+ this.rows.push(this.dataFrame.mouseOverRowIdx);
54
+ if (this.showSelectedRowsCurves && this.dataFrame.mouseOverRowIdx != -1)
55
+ this.rows.push(...this.dataFrame.selection.getSelectedIndexes());
56
+
57
+ this.data = new FitChartData();
58
+ const grid = this.tableView?.grid!;
59
+ for (let i of this.rows) {
60
+ const cellCurves = getChartData(grid.cell(this.curvesColumnName!, grid.tableRowToGrid(i)));
61
+ this.data.series?.push(...cellCurves.series!);
62
+ }
63
+ }
64
+
65
+ onPropertyChanged(property: DG.Property | null) {
66
+ this.applyViewerProperties();
67
+ this.render();
68
+ }
69
+
70
+ onTableAttached() {
71
+ const grid = this.tableView?.grid!;
72
+ this.curvesColumnName ??= this.dataFrame.columns.bySemType(FIT_SEM_TYPE)?.name;
73
+
74
+ merge(this.dataFrame.onCurrentCellChanged, grid.onCellMouseEnter, this.dataFrame.onSelectionChanged)
75
+ .pipe(debounce(_ => interval(50)))
76
+ .subscribe(_ => {
77
+ this.createChartData();
78
+ this.render();
79
+ });
80
+ }
81
+
82
+ render() {
83
+ const g = this.canvas.getContext('2d')!
84
+ g.clearRect(0, 0, this.canvas.width, this.canvas.height);
85
+ this.renderer.renderCurves(g, 0, 0, this.canvas.width, this.canvas.height, this.data);
86
+ }
87
+ }
@@ -0,0 +1,73 @@
1
+ import * as DG from 'datagrok-api/dg';
2
+ /** Linear transformation */
3
+ class _LinearTransform {
4
+ screenToWorld(screen, length, min, max, inverse) {
5
+ const d = inverse ? 1 - screen / length : screen / length;
6
+ return min + d * (max - min);
7
+ }
8
+ worldToScreen(world, length, min, max, inverse) {
9
+ return inverse
10
+ ? ((1 - ((world - min)) / (max - min)) * length)
11
+ : ((world - min) / (max - min) * length);
12
+ }
13
+ }
14
+ /** Log transformation */
15
+ class _LogTransform {
16
+ screenToWorld(screen, length, min, max, inverse) {
17
+ min = (min < 0.00000001 ? 0.00000001 : min);
18
+ const maxLog = Math.log(max);
19
+ const minLog = Math.log(min);
20
+ return Math.exp(minLog + (maxLog - minLog) * (inverse ? length - screen : screen) / length);
21
+ }
22
+ worldToScreen(world, length, min, max, inverse) {
23
+ if (world <= 0)
24
+ return NaN;
25
+ //eliminates problems with rounding
26
+ if (world == min)
27
+ return inverse ? length : 0.0;
28
+ if (world == max)
29
+ return inverse ? 0.0 : length;
30
+ min = (min < 0.00000001 ? 0.00000001 : min);
31
+ world = (world < 0.00000001 ? 0.00000001 : world);
32
+ const res = (length * Math.log(world / min) / Math.log(max / min));
33
+ return inverse ? length - res : res;
34
+ }
35
+ }
36
+ const linearTransform = new _LinearTransform();
37
+ const logTransform = new _LogTransform();
38
+ /** Provides convenient methods for mapping between screen and world coordinates */
39
+ export class Viewport {
40
+ get xt() { return this.logX ? logTransform : linearTransform; }
41
+ get yt() { return this.logY ? logTransform : linearTransform; }
42
+ constructor(world, screen, logX = false, logY = false) {
43
+ this.logX = false;
44
+ this.logY = false;
45
+ this.inverseX = false;
46
+ this.inverseY = true;
47
+ this.world = world;
48
+ this.screen = screen;
49
+ this.logX = logX;
50
+ this.logY = logY;
51
+ }
52
+ xToScreen(world) {
53
+ return this.screen.left + this.xt.worldToScreen(world, this.screen.width, this.world.minX, this.world.maxX, this.inverseX);
54
+ }
55
+ yToScreen(world) {
56
+ return this.screen.top + this.yt.worldToScreen(world, this.screen.height, this.world.minY, this.world.maxY, this.inverseY);
57
+ }
58
+ xToWorld(screen) {
59
+ return this.xt.worldToScreen(screen, this.screen.width, this.world.minX, this.world.maxX, this.inverseX);
60
+ }
61
+ yToWorld(screen) {
62
+ return this.yt.worldToScreen(screen, this.screen.height, this.world.minY, this.world.maxY, this.inverseY);
63
+ }
64
+ toScreen(world) { return new DG.Point(this.xToScreen(world.x), this.yToScreen(world.y)); }
65
+ toWorld(screen) { return new DG.Point(this.xToWorld(screen.x), this.yToWorld(screen.y)); }
66
+ drawCoordinateGrid(g, xAxis, yAxis) {
67
+ if (xAxis)
68
+ DG.Paint.horzAxis(g, this.world.minX, this.world.maxX, xAxis.x, xAxis.y, xAxis.width, xAxis.height, this.logX, this.inverseX);
69
+ if (yAxis)
70
+ DG.Paint.vertAxis(g, this.world.minY, this.world.maxY, yAxis.x, yAxis.y, yAxis.width, yAxis.height, this.logY, this.inverseY);
71
+ }
72
+ }
73
+ //# sourceMappingURL=transform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.js","sourceRoot":"","sources":["transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAWtC,4BAA4B;AAC5B,MAAM,gBAAgB;IACpB,aAAa,CAAC,MAAc,EAAE,MAAc,EAAE,GAAW,EAAE,GAAW,EAAE,OAAiB;QACvF,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAE,CAAC,GAAG,MAAM,GAAG,MAAM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AAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9G,OAAO,CAAC,MAAgB,IAAc,OAAO,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9G,kBAAkB,CAAC,CAA2B,EAAE,KAA0B,EAAE,KAA0B;QACpG,IAAI,KAAK;YACP,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChI,IAAI,KAAK;YACP,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClI,CAAC;CACF"}
@@ -0,0 +1,101 @@
1
+ import * as DG from 'datagrok-api/dg';
2
+ import {Paint} from "datagrok-api/dg";
3
+
4
+
5
+ /** Represents 1D transformation between screen and world coordinates */
6
+ interface ITransform {
7
+ screenToWorld(screen: number, length: number, min: number, max: number, inverse?: boolean): number;
8
+ worldToScreen(world: number, length: number, min: number, max: number, inverse?: boolean): number;
9
+ }
10
+
11
+
12
+ /** Linear transformation */
13
+ class _LinearTransform implements ITransform {
14
+ screenToWorld(screen: number, length: number, min: number, max: number, inverse?: boolean) {
15
+ const d = inverse ? 1 - screen / length: screen / length;
16
+ return min + d * (max - min);
17
+ }
18
+
19
+ worldToScreen(world: number, length: number, min: number, max: number, inverse?: boolean) {
20
+ return inverse
21
+ ? ((1 - ((world - min)) / (max - min)) * length)
22
+ : ((world - min) / (max - min) * length);
23
+ }
24
+ }
25
+
26
+
27
+ /** Log transformation */
28
+ class _LogTransform implements ITransform {
29
+ screenToWorld(screen: number, length: number, min: number, max: number, inverse?: boolean) {
30
+ min = (min < 0.00000001 ? 0.00000001 : min);
31
+
32
+ const maxLog = Math.log(max);
33
+ const minLog = Math.log(min);
34
+ return Math.exp(minLog + (maxLog - minLog) * (inverse ? length - screen : screen) / length);
35
+ }
36
+
37
+ worldToScreen(world: number, length: number, min: number, max: number, inverse?: boolean) {
38
+ if (world <= 0) return NaN;
39
+
40
+ //eliminates problems with rounding
41
+ if (world == min) return inverse ? length : 0.0;
42
+ if (world == max) return inverse ? 0.0 : length;
43
+
44
+ min = (min < 0.00000001 ? 0.00000001 : min);
45
+ world = (world < 0.00000001 ? 0.00000001 : world);
46
+
47
+ const res = (length * Math.log(world / min) / Math.log(max / min));
48
+ return inverse ? length - res : res;
49
+ }
50
+ }
51
+
52
+
53
+ const linearTransform = new _LinearTransform();
54
+ const logTransform = new _LogTransform();
55
+
56
+
57
+ /** Provides convenient methods for mapping between screen and world coordinates */
58
+ export class Viewport {
59
+ world: DG.Rect;
60
+ screen: DG.Rect;
61
+ logX: boolean = false;
62
+ logY: boolean = false;
63
+ inverseX: boolean = false;
64
+ inverseY: boolean = true;
65
+
66
+ get xt(): ITransform { return this.logX ? logTransform : linearTransform; }
67
+ get yt(): ITransform { return this.logY ? logTransform : linearTransform; }
68
+
69
+ constructor(world: DG.Rect, screen: DG.Rect, logX = false, logY = false) {
70
+ this.world = world;
71
+ this.screen = screen;
72
+ this.logX = logX;
73
+ this.logY = logY;
74
+ }
75
+
76
+ xToScreen(world: number): number {
77
+ return this.screen.left + this.xt.worldToScreen(world, this.screen.width, this.world.minX, this.world.maxX, this.inverseX);
78
+ }
79
+
80
+ yToScreen(world: number): number {
81
+ return this.screen.top + this.yt.worldToScreen(world, this.screen.height, this.world.minY, this.world.maxY, this.inverseY);
82
+ }
83
+
84
+ xToWorld(screen: number): number {
85
+ return this.xt.worldToScreen(screen, this.screen.width, this.world.minX, this.world.maxX, this.inverseX);
86
+ }
87
+
88
+ yToWorld(screen: number): number {
89
+ return this.yt.worldToScreen(screen, this.screen.height, this.world.minY, this.world.maxY, this.inverseY);
90
+ }
91
+
92
+ toScreen(world: DG.Point): DG.Point { return new DG.Point(this.xToScreen(world.x), this.yToScreen(world.y)); }
93
+ toWorld(screen: DG.Point): DG.Point { return new DG.Point(this.xToWorld(screen.x), this.yToWorld(screen.y)); }
94
+
95
+ drawCoordinateGrid(g: CanvasRenderingContext2D, xAxis: DG.Rect | undefined, yAxis: DG.Rect | undefined) {
96
+ if (xAxis)
97
+ DG.Paint.horzAxis(g, this.world.minX, this.world.maxX, xAxis.x, xAxis.y, xAxis.width, xAxis.height, this.logX, this.inverseX);
98
+ if (yAxis)
99
+ DG.Paint.vertAxis(g, this.world.minY, this.world.maxY, yAxis.x, yAxis.y, yAxis.width, yAxis.height, this.logY, this.inverseY);
100
+ }
101
+ }
@@ -0,0 +1,26 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import * as DG from "datagrok-api/dg";
11
+ import { runTests, tests } from '@datagrok-libraries/utils/src/test';
12
+ import './tests/fit-viewer-test';
13
+ export const _package = new DG.Package();
14
+ export { tests };
15
+ //name: test
16
+ //input: string category {optional: true}
17
+ //input: string test {optional: true}
18
+ //input: object testContext {optional: true}
19
+ //output: dataframe result
20
+ export function test(category, test, testContext) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ const data = yield runTests({ category, test, testContext });
23
+ return DG.DataFrame.fromObjects(data);
24
+ });
25
+ }
26
+ //# sourceMappingURL=package-test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-test.js","sourceRoot":"","sources":["package-test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAc,MAAM,oCAAoC,CAAC;AAEhF,OAAO,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AACzC,OAAO,EAAC,KAAK,EAAC,CAAC;AAEf,YAAY;AACZ,yCAAyC;AACzC,qCAAqC;AACrC,4CAA4C;AAC5C,0BAA0B;AAC1B,MAAM,UAAgB,IAAI,CAAC,QAAgB,EAAE,IAAY,EAAE,WAAwB;;QACjF,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAC,CAAC,CAAC;QAC3D,OAAO,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAE,CAAC;IACzC,CAAC;CAAA"}
@@ -0,0 +1,18 @@
1
+ import * as DG from "datagrok-api/dg";
2
+
3
+ import {runTests, tests, TestContext} from '@datagrok-libraries/utils/src/test';
4
+
5
+ import './tests/fit-viewer-test';
6
+
7
+ export const _package = new DG.Package();
8
+ export {tests};
9
+
10
+ //name: test
11
+ //input: string category {optional: true}
12
+ //input: string test {optional: true}
13
+ //input: object testContext {optional: true}
14
+ //output: dataframe result
15
+ export async function test(category: string, test: string, testContext: TestContext): Promise<DG.DataFrame> {
16
+ const data = await runTests({category, test, testContext});
17
+ return DG.DataFrame.fromObjects(data)!;
18
+ }
package/src/package.js ADDED
@@ -0,0 +1,50 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ /* Do not change these import lines to match external modules in webpack configuration */
11
+ import * as grok from 'datagrok-api/grok';
12
+ import * as DG from 'datagrok-api/dg';
13
+ import { FitGridCellHandler } from './fit/fit-grid-cell-handler';
14
+ import { FitChartCellRenderer } from './fit/fit-renderer';
15
+ import { MultiCurveViewer } from './fit/multi-curve-viewer';
16
+ import { createDemoDataFrame, curveDemo } from './fit/fit-demo';
17
+ export const _package = new DG.Package();
18
+ //name: Fit
19
+ //tags: cellRenderer
20
+ //meta.cellType: fit
21
+ //meta.virtual: true
22
+ //output: grid_cell_renderer result
23
+ export function fitCellRenderer() {
24
+ return new FitChartCellRenderer();
25
+ }
26
+ //name: MultiCurveViewer
27
+ //description: A viewer that superimposes multiple in-cell curves on one chart
28
+ //tags: viewer
29
+ //output: viewer result
30
+ export function _FitViewer() {
31
+ return new MultiCurveViewer();
32
+ }
33
+ //tags: app
34
+ //name: Curves Demo
35
+ export function curveFitDemoApp() {
36
+ grok.shell.addTableView(createDemoDataFrame(30, 5, 2));
37
+ }
38
+ //name: Curve fitting
39
+ //description: Curve fitting is the process of constructing a curve, or mathematical function, that has the best fit to a series of data points
40
+ //meta.demoPath: Curves | Curve fitting
41
+ export function curveFitDemo() {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ yield curveDemo();
44
+ });
45
+ }
46
+ //tags: autostart
47
+ export function _autoCurves() {
48
+ DG.ObjectHandler.register(new FitGridCellHandler());
49
+ }
50
+ //# sourceMappingURL=package.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.js","sourceRoot":"","sources":["package.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yFAAyF;AACzF,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAE1C,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAC,mBAAmB,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9D,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AAGzC,WAAW;AACX,oBAAoB;AACpB,oBAAoB;AACpB,oBAAoB;AACpB,mCAAmC;AACnC,MAAM,UAAU,eAAe;IAC7B,OAAO,IAAI,oBAAoB,EAAE,CAAC;AACpC,CAAC;AAED,wBAAwB;AACxB,8EAA8E;AAC9E,cAAc;AACd,uBAAuB;AACvB,MAAM,UAAU,UAAU;IACxB,OAAO,IAAI,gBAAgB,EAAE,CAAC;AAChC,CAAC;AAED,WAAW;AACX,mBAAmB;AACnB,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,qBAAqB;AACrB,+IAA+I;AAC/I,uCAAuC;AACvC,MAAM,UAAgB,YAAY;;QAChC,MAAM,SAAS,EAAE,CAAC;IACpB,CAAC;CAAA;AAED,iBAAiB;AACjB,MAAM,UAAU,WAAW;IACzB,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,kBAAkB,EAAE,CAAC,CAAC;AACtD,CAAC"}
package/src/package.ts ADDED
@@ -0,0 +1,48 @@
1
+ /* Do not change these import lines to match external modules in webpack configuration */
2
+ import * as grok from 'datagrok-api/grok';
3
+ import * as ui from 'datagrok-api/ui';
4
+ import * as DG from 'datagrok-api/dg';
5
+
6
+ import {FitGridCellHandler} from './fit/fit-grid-cell-handler';
7
+ import {FitChartCellRenderer} from './fit/fit-renderer';
8
+ import {MultiCurveViewer} from './fit/multi-curve-viewer';
9
+ import {createDemoDataFrame, curveDemo} from './fit/fit-demo';
10
+
11
+
12
+ export const _package = new DG.Package();
13
+
14
+
15
+ //name: Fit
16
+ //tags: cellRenderer
17
+ //meta.cellType: fit
18
+ //meta.virtual: true
19
+ //output: grid_cell_renderer result
20
+ export function fitCellRenderer() {
21
+ return new FitChartCellRenderer();
22
+ }
23
+
24
+ //name: MultiCurveViewer
25
+ //description: A viewer that superimposes multiple in-cell curves on one chart
26
+ //tags: viewer
27
+ //output: viewer result
28
+ export function _FitViewer() {
29
+ return new MultiCurveViewer();
30
+ }
31
+
32
+ //tags: app
33
+ //name: Curves Demo
34
+ export function curveFitDemoApp() {
35
+ grok.shell.addTableView(createDemoDataFrame(30, 5, 2));
36
+ }
37
+
38
+ //name: Curve fitting
39
+ //description: Curve fitting is the process of constructing a curve, or mathematical function, that has the best fit to a series of data points
40
+ //meta.demoPath: Curves | Curve fitting
41
+ export async function curveFitDemo() {
42
+ await curveDemo();
43
+ }
44
+
45
+ //tags: autostart
46
+ export function _autoCurves(): void {
47
+ DG.ObjectHandler.register(new FitGridCellHandler());
48
+ }
@@ -0,0 +1,16 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { category, expect, test } from '@datagrok-libraries/utils/src/test';
11
+ category('Fit', () => {
12
+ test('test', () => __awaiter(void 0, void 0, void 0, function* () {
13
+ expect('test', 'test');
14
+ }));
15
+ });
16
+ //# sourceMappingURL=fit-viewer-test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fit-viewer-test.js","sourceRoot":"","sources":["fit-viewer-test.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,oCAAoC,CAAC;AAG1E,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;IACnB,IAAI,CAAC,MAAM,EAAE,GAAS,EAAE;QACtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import * as grok from 'datagrok-api/grok';
2
+ import * as DG from 'datagrok-api/dg';
3
+
4
+ import {category, expect, test} from '@datagrok-libraries/utils/src/test';
5
+
6
+
7
+ category('Fit', () => {
8
+ test('test', async () => {
9
+ expect('test', 'test');
10
+ });
11
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
+
5
+ /* Basic Options */
6
+ // "incremental": true, /* Enable incremental compilation */
7
+ "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
8
+ "module": "es2020", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
9
+ "lib": ["es2022", "dom"], /* Specify library files to be included in the compilation. */
10
+ // "allowJs": true, /* Allow javascript files to be compiled. */
11
+ // "checkJs": true, /* Report errors in .js files. */
12
+ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
13
+ // "declaration": true, /* Generates corresponding '.d.ts' file. */
14
+ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
15
+ "sourceMap": true, /* Generates corresponding '.map' file. */
16
+ // "outFile": "./", /* Concatenate and emit output to single file. */
17
+ // "outDir": "./", /* Redirect output structure to the directory. */
18
+ // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
19
+ // "composite": true, /* Enable project compilation */
20
+ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
21
+ // "removeComments": true, /* Do not emit comments to output. */
22
+ // "noEmit": true, /* Do not emit outputs. */
23
+ // "importHelpers": true, /* Import emit helpers from 'tslib'. */
24
+ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
25
+ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
26
+
27
+ /* Strict Type-Checking Options */
28
+ "strict": true, /* Enable all strict type-checking options. */
29
+ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
30
+ // "strictNullChecks": true, /* Enable strict null checks. */
31
+ // "strictFunctionTypes": true, /* Enable strict checking of function types. */
32
+ // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
33
+ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
34
+ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
35
+ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
36
+
37
+ /* Additional Checks */
38
+ // "noUnusedLocals": true, /* Report errors on unused locals. */
39
+ // "noUnusedParameters": true, /* Report errors on unused parameters. */
40
+ // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
41
+ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
42
+ // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
43
+ // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
44
+
45
+ /* Module Resolution Options */
46
+ "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
47
+ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
48
+ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
49
+ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
50
+ // "typeRoots": [], /* List of folders to include type definitions from. */
51
+ // "types": [], /* Type declaration files to be included in compilation. */
52
+ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
53
+ "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
54
+ // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
55
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
56
+
57
+ /* Source Map Options */
58
+ // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
59
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
60
+ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
61
+ // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
62
+
63
+ /* Experimental Options */
64
+ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
65
+ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
66
+
67
+ /* Advanced Options */
68
+ "skipLibCheck": false, /* Skip type checking of declaration files. */
69
+ "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
70
+ }
71
+ }