@datagrok/eda 1.1.35 → 1.2.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/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@datagrok/eda",
3
3
  "friendlyName": "EDA",
4
- "version": "1.1.35",
4
+ "version": "1.2.0",
5
5
  "description": "Exploratory Data Analysis Tools",
6
6
  "dependencies": {
7
- "@datagrok-libraries/math": "^1.1.11",
8
- "@datagrok-libraries/ml": "^6.6.23",
9
- "@datagrok-libraries/tutorials": "^1.3.13",
10
- "@datagrok-libraries/utils": "^4.2.29",
7
+ "@datagrok-libraries/math": "^1.2.0",
8
+ "@datagrok-libraries/ml": "^6.7.0",
9
+ "@datagrok-libraries/tutorials": "^1.4.0",
10
+ "@datagrok-libraries/utils": "^4.3.0",
11
11
  "@keckelt/tsne": "^1.0.2",
12
12
  "@webgpu/types": "^0.1.40",
13
13
  "cash-dom": "^8.1.1",
14
- "datagrok-api": "^1.20.1",
14
+ "datagrok-api": "^1.21.1",
15
15
  "dayjs": "^1.11.9",
16
16
  "jstat": "^1.9.6",
17
17
  "source-map-loader": "^4.0.1",
@@ -85,23 +85,22 @@ export async function runKNNImputer(df?: DG.DataFrame): Promise<void> {
85
85
  // In-place components
86
86
  let inPlace = DEFAULT.IN_PLACE > 0;
87
87
  const inPlaceInput = ui.input.bool(TITLE.IN_PLACE, {value: inPlace,
88
- onValueChanged: () => {inPlace = inPlaceInput.value ?? false;}});
88
+ onValueChanged: (value) => {inPlace = value ?? false;}});
89
89
  inPlaceInput.setTooltip(HINT.IN_PLACE);
90
90
 
91
91
  // Keep empty feature
92
92
  let keepEmpty = DEFAULT.KEEP_EMPTY > 0;
93
93
  const keepEmptyInput = ui.input.bool(TITLE.KEEP_EMPTY, {value: keepEmpty,
94
- onValueChanged: () => {keepEmpty = keepEmptyInput.value ?? false;}});
94
+ onValueChanged: (value) => {keepEmpty = value ?? false;}});
95
95
  keepEmptyInput.setTooltip(HINT.KEEP_EMPTY);
96
96
 
97
97
  // Neighbors components
98
98
  let neighbors = DEFAULT.NEIGHBORS;
99
- const neighborsInput = ui.input.int(TITLE.NEIGHBORS, {value: neighbors, onValueChanged: () => {
100
- const val = neighborsInput.value;
101
- if (val === null)
99
+ const neighborsInput = ui.input.int(TITLE.NEIGHBORS, {value: neighbors, onValueChanged: (value) => {
100
+ if (value === null)
102
101
  neighborsInput.value = neighbors;
103
- else if (val >= MIN_NEIGHBORS)
104
- neighbors = val;
102
+ else if (value >= MIN_NEIGHBORS)
103
+ neighbors = value;
105
104
  else
106
105
  neighborsInput.value = neighbors;
107
106
  }});
@@ -112,21 +111,21 @@ export async function runKNNImputer(df?: DG.DataFrame): Promise<void> {
112
111
  const distTypeInput: DG.ChoiceInput<DISTANCE_TYPE> = ui.input.choice(TITLE.DISTANCE, {
113
112
  value: distType,
114
113
  items: [DISTANCE_TYPE.EUCLIDEAN, DISTANCE_TYPE.MANHATTAN],
115
- onValueChanged: () => distType = distTypeInput.value ?? DISTANCE_TYPE.EUCLIDEAN}) as DG.ChoiceInput<DISTANCE_TYPE>;
114
+ onValueChanged: (value) => distType = value ?? DISTANCE_TYPE.EUCLIDEAN}) as DG.ChoiceInput<DISTANCE_TYPE>;
116
115
  distTypeInput.setTooltip(HINT.DISTANCE);
117
116
 
118
117
  // Target columns components (cols with missing values to be imputed)
119
118
  let targetColNames = colsWithMissingVals.map((col) => col.name);
120
- const targetColInput = ui.input.columns(TITLE.COLUMNS, {table: df, value: df.columns.byNames(availableTargetColsNames), onValueChanged: () => {
121
- targetColNames = targetColInput.value.map((col) => col.name);
119
+ const targetColInput = ui.input.columns(TITLE.COLUMNS, {table: df, value: df.columns.byNames(availableTargetColsNames), onValueChanged: (value) => {
120
+ targetColNames = value.map((col) => col.name);
122
121
  checkApplicability();
123
122
  }, available: availableTargetColsNames});
124
123
  targetColInput.setTooltip(HINT.TARGET);
125
124
 
126
125
  // Feature columns components
127
126
  let selectedFeatureColNames = availableFeatureColsNames as string[];
128
- const featuresInput = ui.input.columns(TITLE.FEATURES, {value: df.columns.byNames(availableFeatureColsNames), table: df, onValueChanged: () => {
129
- selectedFeatureColNames = featuresInput.value.map((col) => col.name);
127
+ const featuresInput = ui.input.columns(TITLE.FEATURES, {value: df.columns.byNames(availableFeatureColsNames), table: df, onValueChanged: (value) => {
128
+ selectedFeatureColNames = value.map((col) => col.name);
130
129
 
131
130
  if (selectedFeatureColNames.length > 0) {
132
131
  checkApplicability();
@@ -185,9 +184,9 @@ export async function runKNNImputer(df?: DG.DataFrame): Promise<void> {
185
184
 
186
185
  // distance input
187
186
  const distTypeInput = ui.input.choice(name, {value: settings.defaultMetric,
188
- items: settings.availableMetrics, onValueChanged: () => {
187
+ items: settings.availableMetrics, onValueChanged: (value) => {
189
188
  const distInfo = featuresMetrics.get(name) ?? {weight: settings.defaultWeight, type: settings.defaultMetric};
190
- distInfo.type = distTypeInput.value ?? settings.defaultMetric;
189
+ distInfo.type = value ?? settings.defaultMetric;
191
190
  featuresMetrics.set(name, distInfo);
192
191
  }});
193
192
  distTypeInput.root.style.width = '50%';
@@ -206,9 +205,9 @@ export async function runKNNImputer(df?: DG.DataFrame): Promise<void> {
206
205
  });
207
206
  const weightInput = ui.input.forProperty(prop);
208
207
  weightInput.value = settings.defaultWeight;
209
- weightInput.onChanged(() => {
208
+ weightInput.onChanged.subscribe((value) => {
210
209
  const distInfo = featuresMetrics.get(name) ?? {weight: settings.defaultWeight, type: settings.defaultMetric};
211
- distInfo.weight = weightInput.value ?? settings.defaultWeight;
210
+ distInfo.weight = value ?? settings.defaultWeight;
212
211
  featuresMetrics.set(name, distInfo);
213
212
  });
214
213
  weightInput.setTooltip(HINT.WEIGHT);
@@ -264,7 +263,7 @@ export async function runKNNImputer(df?: DG.DataFrame): Promise<void> {
264
263
  grok.shell.error(`${ERROR_MSG.KNN_FAILS}: ${ERROR_MSG.CORE_ISSUE}`);
265
264
  reject(err);
266
265
  }
267
- }).onClose.subscribe(() => !okClicked && reject());
266
+ }).onClose.subscribe(() => !okClicked && resolve());
268
267
 
269
268
  return promise;
270
269
  } // runKNNImputer
@@ -317,8 +317,8 @@ export async function runMVA(analysisType: PLS_ANALYSIS): Promise<void> {
317
317
 
318
318
  // responce (to predict)
319
319
  let predict = numCols[numCols.length - 1];
320
- const predictInput = ui.input.column(TITLE.PREDICT, {table: table, value: predict, onValueChanged: () => {
321
- predict = predictInput.value!;
320
+ const predictInput = ui.input.column(TITLE.PREDICT, {table: table, value: predict, onValueChanged: (value) => {
321
+ predict = value;
322
322
  updateIputs();
323
323
  }, filter: (col: DG.Column) => isValidNumeric(col)},
324
324
  );
@@ -327,7 +327,7 @@ export async function runMVA(analysisType: PLS_ANALYSIS): Promise<void> {
327
327
  // predictors (features)
328
328
  let features: DG.Column[];
329
329
  const featuresInput = ui.input.columns(TITLE.USING, {table: table, available: numColNames});
330
- featuresInput.onInput(() => updateIputs());
330
+ featuresInput.onInput.subscribe(() => updateIputs());
331
331
  featuresInput.setTooltip(HINT.FEATURES);
332
332
 
333
333
  // components count
@@ -340,7 +340,7 @@ export async function runMVA(analysisType: PLS_ANALYSIS): Promise<void> {
340
340
  showPlusMinus: true,
341
341
  min: COMPONENTS.MIN,
342
342
  }));
343
- componentsInput.onInput(() => updateIputs());
343
+ componentsInput.onInput.subscribe(() => updateIputs());
344
344
  componentsInput.setTooltip(HINT.COMPONENTS);
345
345
 
346
346
  let dlgTitle: string;