New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@datagrok-libraries/ml

Package Overview
Dependencies
Maintainers
0
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datagrok-libraries/ml - npm Package Compare versions

Comparing version 6.7.6 to 6.8.0

src/MCL/mcl-viewer.d.ts

4

CHANGELOG.md
# ml changelog
## 6.8.0 (2025-01-06)
Refork MCL Viewer
## 6.7.4 (2024-10-08)

@@ -4,0 +8,0 @@

4

package.json

@@ -11,3 +11,3 @@ {

"friendlyName": "Datagrok ML library",
"version": "6.7.6",
"version": "6.8.0",
"description": "Machine learning supporting utilities",

@@ -21,3 +21,3 @@ "dependencies": {

"cash-dom": "^8.1.5",
"datagrok-api": "^1.21.1",
"datagrok-api": "^1.22.0",
"dayjs": "^1.11.13",

@@ -24,0 +24,0 @@ "fastest-levenshtein": "^1.0.12",

import * as DG from 'datagrok-api/dg';
import { KnownMetrics } from '../typed-metrics';
import { DistanceAggregationMethod } from '../distance-matrix/types';
import * as rxjs from 'rxjs';
export type MCLClusterViewerResult = {

@@ -11,4 +12,19 @@ sc: DG.ScatterPlotViewer;

connectivityCol: DG.Column;
i: ArrayLike<number>;
j: ArrayLike<number>;
};
export declare function markovCluster(df: DG.DataFrame, cols: DG.Column[], metrics: KnownMetrics[], weights: number[], aggregationMethod: DistanceAggregationMethod, preprocessingFuncs: (DG.Func | null | undefined)[], preprocessingFuncArgs: any[], threshold?: number, maxIterations?: number, useWebGPU?: boolean, inflate?: number, minClusterSize?: number, scp?: DG.ScatterPlotViewer): Promise<undefined | MCLClusterViewerResult>;
export declare class SCLinesRenderer {
sc: DG.ScatterPlotViewer;
from: ArrayLike<number>;
to: ArrayLike<number>;
shortLineThreshold: number;
width: number;
color: string;
private renderFlag;
renderSub: rxjs.Subscription;
constructor(sc: DG.ScatterPlotViewer, from: ArrayLike<number>, to: ArrayLike<number>, shortLineThreshold: number, width: number, color: string);
render(): void;
destroy(): void;
}
//# sourceMappingURL=clustering-view.d.ts.map

@@ -5,3 +5,2 @@ import * as grok from 'datagrok-api/grok';

import { createMCLWorker } from './index';
import { ScatterPlotCurrentLineStyle, ScatterPlotLinesRenderer } from '@datagrok-libraries/utils/src/render-lines-on-sp';
export async function markovCluster(df, cols, metrics, weights, aggregationMethod, preprocessingFuncs, preprocessingFuncArgs, threshold = 80, maxIterations = 10, useWebGPU = false, inflate = 2, minClusterSize = 5, scp) {

@@ -14,4 +13,8 @@ const scatterPlotProps = {

};
const tv = grok.shell.tableView(df.name) ?? grok.shell.addTableView(df);
const sc = scp ?? tv.scatterPlot({ ...scatterPlotProps, title: 'MCL' });
let tv = null;
let sc = scp;
if (!sc) {
tv = grok.shell.tableView(df.name) ?? grok.shell.addTableView(df);
sc = tv.scatterPlot({ ...scatterPlotProps, title: 'MCL' });
}
ui.setUpdateIndicator(sc.root, true);

@@ -120,15 +123,8 @@ const distanceFnArgs = [];

}
const _scLines = new ScatterPlotLinesRenderer(sc, emberdXColName, emberdYColName, { from: new Uint32Array(filteredIs), to: new Uint32Array(filteredJs),
drawArrows: false, opacity: 0.3, skipMultiLineCalculation: true,
skipShortLines: true, skipMouseOverDetection: true, shortLineThreshold: 6, width: 0.75, color: '128,128,128' }, ScatterPlotCurrentLineStyle.none);
// _scLines.lineClicked.subscribe((args) => {
// const id = args.id;
// args.event.preventDefault();
// args.event.stopImmediatePropagation();
// if ((id ?? -1) === -1)
// return;
// const i = _scLines.lines.from[id];
// const j = _scLines.lines.to[id];
// df.selection.init((index) => index === i || index === j);
// });
// const _scLines = new ScatterPlotLinesRenderer(sc, emberdXColName, emberdYColName,
// {from: new Uint32Array(filteredIs) as any, to: new Uint32Array(filteredJs) as any,
// drawArrows: false, opacity: 0.3, skipMultiLineCalculation: true,
// skipShortLines: true, skipMouseOverDetection: true, shortLineThreshold: 6, width: 0.75, color: '128,128,128'},
// ScatterPlotCurrentLineStyle.none);
//const _scLines = new SCLinesRenderer(sc, filteredIs, filteredJs, 6, 0.75, '128,128,128');
ui.setUpdateIndicator(sc.root, false);

@@ -138,4 +134,67 @@ // sc.close();

// tv.addViewer(scLinesViewer);
return { sc, embedXCol, embedYCol, clusterCol, clusterCounterCol, connectivityCol };
return { sc, embedXCol, embedYCol, clusterCol, clusterCounterCol, connectivityCol, i: filteredIs, j: filteredJs };
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3RlcmluZy12aWV3LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY2x1c3RlcmluZy12aWV3LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxJQUFJLE1BQU0sbUJBQW1CLENBQUM7QUFDMUMsT0FBTyxLQUFLLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUN0QyxPQUFPLEtBQUssRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRXRDLE9BQU8sRUFBQyxlQUFlLEVBQUMsTUFBTSxTQUFTLENBQUM7QUFDeEMsT0FBTyxFQUFDLDJCQUEyQixFQUFFLHdCQUF3QixFQUFDLE1BQU0sa0RBQWtELENBQUM7QUFnQnZILE1BQU0sQ0FBQyxLQUFLLFVBQVUsYUFBYSxDQUNqQyxFQUFnQixFQUFFLElBQWlCLEVBQUUsT0FBdUIsRUFDNUQsT0FBaUIsRUFBRSxpQkFBNEMsRUFBRSxrQkFBa0QsRUFDbkgscUJBQTRCLEVBQUUsWUFBb0IsRUFBRSxFQUFFLGdCQUF3QixFQUFFLEVBQ2hGLFlBQXFCLEtBQUssRUFBRSxVQUFrQixDQUFDLEVBQUUsaUJBQXlCLENBQUMsRUFBRSxHQUEwQjtJQUV2RyxNQUFNLGdCQUFnQixHQUFHO1FBQ3ZCLFNBQVMsRUFBRSxLQUFLO1FBQ2hCLFNBQVMsRUFBRSxLQUFLO1FBQ2hCLGFBQWEsRUFBRSxLQUFLO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yZXNob2xkOiA2LCB3aWR0aDogMC43NSwgY29sb3I6ICcxMjgsMTI4LDEyOCd9LFxuICAgIFNjYXR0ZXJQbG90Q3VycmVudExpbmVTdHlsZS5ub25lKTtcblxuICAvLyBfc2NMaW5lcy5saW5lQ2xpY2tlZC5zdWJzY3JpYmUoKGFyZ3MpID0+IHtcbiAgLy8gICBjb25zdCBpZCA9IGFyZ3MuaWQ7XG4gIC8vICAgYXJncy5ldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAvLyAgIGFyZ3MuZXZlbnQuc3RvcEltbWVkaWF0ZVByb3BhZ2F0aW9uKCk7XG4gIC8vICAgaWYgKChpZCA/PyAtMSkgPT09IC0xKVxuICAvLyAgICAgcmV0dXJuO1xuICAvLyAgIGNvbnN0IGkgPSBfc2NMaW5lcy5saW5lcy5mcm9tW2lkXTtcbiAgLy8gICBjb25zdCBqID0gX3NjTGluZXMubGluZXMudG9baWRdO1xuICAvLyAgIGRmLnNlbGVjdGlvbi5pbml0KChpbmRleCkgPT4gaW5kZXggPT09IGkgfHwgaW5kZXggPT09IGopO1xuICAvLyB9KTtcblxuICB1aS5zZXRVcGRhdGVJbmRpY2F0b3Ioc2Mucm9vdCwgZmFsc2UpO1xuICAvLyBzYy5jbG9zZSgpO1xuICAvLyBjb25zdCBzY0xpbmVzVmlld2VyID0gbmV3IFNjYXR0ZXJQbG90V2l0aExpbmVzKHNjLCByZXMuaXMsIHJlcy5qcywgZW1iZXJkWENvbE5hbWUsIGVtYmVyZFlDb2xOYW1lKTtcbiAgLy8gdHYuYWRkVmlld2VyKHNjTGluZXNWaWV3ZXIpO1xuICByZXR1cm4ge3NjLCBlbWJlZFhDb2wsIGVtYmVkWUNvbCwgY2x1c3RlckNvbCwgY2x1c3RlckNvdW50ZXJDb2wsIGNvbm5lY3Rpdml0eUNvbH07XG59XG5cbiJdfQ==
export class SCLinesRenderer {
constructor(sc, from, to, shortLineThreshold, width, color) {
this.sc = sc;
this.from = from;
this.to = to;
this.shortLineThreshold = shortLineThreshold;
this.width = width;
this.color = color;
this.renderFlag = false;
this.renderSub = DG.debounce(sc.onAfterDrawScene, 200).subscribe(() => {
if (this.renderFlag) {
this.renderFlag = false;
return;
}
this.renderFlag = true;
const tempSub = sc.onBeforeDrawScene.subscribe((_) => {
this.render();
tempSub.unsubscribe();
});
setTimeout(() => {
this.sc.invalidateCanvas();
// this.renderFlag = false;
});
});
sc.subs.push(this.renderSub);
}
render() {
const xCol = this.sc.dataFrame.getCol(this.sc.props.xColumnName);
const yCol = this.sc.dataFrame.getCol(this.sc.props.yColumnName);
const filter = this.sc.filter;
const positions = new Array(this.sc.dataFrame.rowCount).fill(null)
.map((_, i) => !xCol.isNone(i) && !yCol.isNone(i) && filter.get(i) ? this.sc.pointToScreen(i) : null);
const canvas = this.sc.canvas;
const ctx = canvas.getContext('2d');
if (!ctx)
return;
ctx.strokeStyle = `rgba(${this.color}, 0.3)`;
ctx.lineWidth = this.width;
const shortLineSquared = this.shortLineThreshold * this.shortLineThreshold;
for (let i = 0; i < this.from.length; i++) {
ctx.beginPath();
const from = this.from[i];
const to = this.to[i];
if (positions[from] && positions[to]) {
const fromPos = positions[from];
const toPos = positions[to];
const dx = toPos.x - fromPos.x;
const dy = toPos.y - fromPos.y;
const dist = dx * dx + dy * dy;
if (dist < shortLineSquared)
continue;
ctx.moveTo(fromPos.x, fromPos.y);
ctx.lineTo(toPos.x, toPos.y);
ctx.stroke();
ctx.closePath();
// interestingly, doing stroke for each line turns to be 20 times faster than doing stroke for all lines at once
}
}
}
destroy() {
this.renderSub.unsubscribe();
}
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3RlcmluZy12aWV3LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY2x1c3RlcmluZy12aWV3LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxJQUFJLE1BQU0sbUJBQW1CLENB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IGJlIDIwIHRpbWVzIGZhc3RlciB0aGFuIGRvaW5nIHN0cm9rZSBmb3IgYWxsIGxpbmVzIGF0IG9uY2VcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBkZXN0cm95KCkge1xuICAgIHRoaXMucmVuZGVyU3ViLnVuc3Vic2NyaWJlKCk7XG4gIH1cbn1cbiJdfQ==

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc