@datagrok/eda 1.1.12 → 1.1.13
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 +4 -0
- package/dist/package.js +2 -2
- package/package.json +1 -1
- package/src/eda-ui.ts +1 -1
- package/src/package.ts +12 -4
package/package.json
CHANGED
package/src/eda-ui.ts
CHANGED
|
@@ -117,7 +117,7 @@ export function loadingScatterPlot(features: DG.ColumnList, xLoadings: Array<DG.
|
|
|
117
117
|
export function addPLSvisualization(
|
|
118
118
|
table: DG.DataFrame, samplesNames: DG.Column, features: DG.ColumnList, predict: DG.Column, plsOutput: any,
|
|
119
119
|
): void {
|
|
120
|
-
const view = grok.shell.getTableView(table.name);
|
|
120
|
+
const view = (table.id !== null) ? grok.shell.getTableView(table.name) : grok.shell.addTableView(table);
|
|
121
121
|
|
|
122
122
|
// 1. Predicted vs Reference scatter plot
|
|
123
123
|
view.addViewer(predictedVersusReferenceScatterPlot(samplesNames, predict, plsOutput[0]));
|
package/src/package.ts
CHANGED
|
@@ -67,12 +67,20 @@ export async function dbScan(df: DG.DataFrame, xCol: DG.Column, yCol: DG.Column,
|
|
|
67
67
|
//input: int components = 2 {caption: Components} [Number of components.]
|
|
68
68
|
//input: bool center = false [Indicating whether the variables should be shifted to be zero centered.]
|
|
69
69
|
//input: bool scale = false [Indicating whether the variables should be scaled to have unit variance.]
|
|
70
|
-
|
|
71
|
-
export async function PCA(table: DG.DataFrame, features: DG.ColumnList, components: number,
|
|
72
|
-
center: boolean, scale: boolean): Promise<DG.DataFrame> {
|
|
70
|
+
export async function PCA(table: DG.DataFrame, features: DG.ColumnList, components: number, center: boolean, scale: boolean): Promise<void> {
|
|
73
71
|
const pcaTable = await computePCA(table, features, components, center, scale);
|
|
74
72
|
addPrefixToEachColumnName('PCA', pcaTable.columns);
|
|
75
|
-
|
|
73
|
+
|
|
74
|
+
if (table.id === null) // table is loaded from a local file
|
|
75
|
+
grok.shell.addTableView(pcaTable);
|
|
76
|
+
else {
|
|
77
|
+
const cols = table.columns;
|
|
78
|
+
|
|
79
|
+
for (const col of pcaTable.columns) {
|
|
80
|
+
col.name = cols.getUnusedName(col.name);
|
|
81
|
+
cols.add(col);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
76
84
|
}
|
|
77
85
|
|
|
78
86
|
|