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

@neo4j-nvl/layout-workers

Package Overview
Dependencies
Maintainers
3
Versions
168
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neo4j-nvl/layout-workers - npm Package Compare versions

Comparing version 0.2.48 to 0.2.49

lib/cosebilkent-layout/workerFactory.d.mts

18

lib/__mocks__/index.d.ts
export function createCoseBilkentLayoutWorker(): {
onmessage: jest.Mock<any, any, any>;
postMessage: jest.Mock<any, any, any>;
terminate: jest.Mock<any, any, any>;
port: {
start: jest.Mock<any, any, any>;
onmessage: jest.Mock<any, any, any>;
postMessage: jest.Mock<any, any, any>;
close: jest.Mock<any, any, any>;
};
};
export function createHierarchicalLayoutWorker(): {
onmessage: jest.Mock<any, any, any>;
postMessage: jest.Mock<any, any, any>;
terminate: jest.Mock<any, any, any>;
port: {
start: jest.Mock<any, any, any>;
onmessage: jest.Mock<any, any, any>;
postMessage: jest.Mock<any, any, any>;
close: jest.Mock<any, any, any>;
};
};

@@ -1,7 +0,10 @@

const workerMock = {
onmessage: jest.fn(),
postMessage: jest.fn(),
terminate: jest.fn()
const sharedWorkerMock = {
port: {
start: jest.fn(),
onmessage: jest.fn(),
postMessage: jest.fn(),
close: jest.fn()
}
};
export const createCoseBilkentLayoutWorker = () => workerMock;
export const createHierarchicalLayoutWorker = () => workerMock;
export const createCoseBilkentLayoutWorker = () => sharedWorkerMock;
export const createHierarchicalLayoutWorker = () => sharedWorkerMock;
import { layout } from './cose-bilkent-layout-impl.js';
const onMessage = ({ data, target }) => {
if (target.name === 'CoseBilkentLayout') {
onconnect = ({ ports }) => {
const port = ports[0];
port.onmessage = ({ data }) => {
const { elements, spacingFactor } = data;
const layoutData = layout(elements, spacingFactor);
postMessage(layoutData);
}
port.postMessage(layoutData);
};
};
self.addEventListener('message', onMessage);
import { layout } from './dagre-layout-impl.js';
const onMessage = ({ data, target }) => {
if (target.name === 'HierarchicalLayout') {
onconnect = ({ ports }) => {
const port = ports[0];
port.onmessage = ({ data }) => {
const { nodes, nodeIds, idToPosition, rels, direction, packing, pixelRatio, forcedDelay = 0 } = data;

@@ -8,10 +9,9 @@ const layoutData = layout(nodes, nodeIds, idToPosition, rels, direction, packing, pixelRatio);

setTimeout(() => {
postMessage(layoutData);
port.postMessage(layoutData);
}, forcedDelay);
}
else {
postMessage(layoutData);
port.postMessage(layoutData);
}
}
};
};
self.addEventListener('message', onMessage);

@@ -1,3 +0,3 @@

import { createCoseBilkentLayoutWorker } from './cosebilkent-layout/workerFactory.js';
import { createHierarchicalLayoutWorker } from './hierarchical-layout/workerFactory.js';
import { createCoseBilkentLayoutWorker } from './cosebilkent-layout/workerFactory.mjs';
import { createHierarchicalLayoutWorker } from './hierarchical-layout/workerFactory.mjs';
export { createCoseBilkentLayoutWorker, createHierarchicalLayoutWorker };

@@ -1,3 +0,3 @@

import { createCoseBilkentLayoutWorker } from './cosebilkent-layout/workerFactory.js';
import { createHierarchicalLayoutWorker } from './hierarchical-layout/workerFactory.js';
import { createCoseBilkentLayoutWorker } from './cosebilkent-layout/workerFactory.mjs';
import { createHierarchicalLayoutWorker } from './hierarchical-layout/workerFactory.mjs';
export { createCoseBilkentLayoutWorker, createHierarchicalLayoutWorker };
{
"name": "@neo4j-nvl/layout-workers",
"version": "0.2.48",
"version": "0.2.49",
"license": "SEE LICENSE IN 'Neo4j Early Access Agreement - Visualization Library.pdf'",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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