Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodelayout

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodelayout - npm Package Compare versions

Comparing version 1.3.0 to 1.3.2

2

package.json
{
"name": "nodelayout",
"version": "1.3.0",
"version": "1.3.2",
"description": "For node Layout.",

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

@@ -24,3 +24,4 @@ # nodeLayout

```js
nodeLayout.init({
import * as nodelayout from "nodelayout";
nodelayout.init({
id: "node-wrap",

@@ -72,3 +73,3 @@ connectType: "line", // path or line

```js
nodeLayout.add({
nodelayout.add({
title: 'step',

@@ -75,0 +76,0 @@ id: Math.random() + ''

@@ -46,5 +46,14 @@ import * as d3 from "d3";

d3.selectAll(".unit-dis").attr("class", "unit-dis");
d3.selectAll('.connect-fixed-line').attr('data-selected', '')
d3.select(this).attr("class", "unit-dis selected");
}
// on path click
function handlePathClick (event, d) {
d3.selectAll(".unit-dis").attr("class", "unit-dis");
d3.selectAll('.connect-fixed-line').attr('data-selected', '')
d3.select(this).attr("data-selected", true);
if (onPathClick) onPathClick(d);
}
// drag start

@@ -113,5 +122,3 @@ function dragstart (event, d) {

.attr("data-id", d => d.id)
.on("click", (event, d) => {
if (onPathClick) onPathClick(d);
});
.on("click", handlePathClick);
if (isInit) {

@@ -323,4 +330,4 @@ allPath.transition()

text: item.title,
x: 100 * index + 200,
y: svgHeight/5
x: item.x || 100 * index + 200,
y: item.y || svgHeight/5
};

@@ -342,6 +349,6 @@ });

endIndex: endIndex,
x1: nodeData[0].x + Math.cos(Math.PI / 180 * startIndex * 90) * mainCirceRadius,
y1: nodeData[0].y + Math.sin(Math.PI / 180 * startIndex * 90) * mainCirceRadius,
x2: nodeData[index + 1].x + Math.cos(Math.PI / 180 * endIndex * 90) * mainCirceRadius,
y2: nodeData[index + 1].y + Math.sin(Math.PI / 180 * endIndex * 90) * mainCirceRadius
x1: item.x1 || nodeData[0].x + Math.cos(Math.PI / 180 * startIndex * 90) * mainCirceRadius,
y1: item.y1 || nodeData[0].y + Math.sin(Math.PI / 180 * startIndex * 90) * mainCirceRadius,
x2: item.x2 || nodeData[index + 1].x + Math.cos(Math.PI / 180 * endIndex * 90) * mainCirceRadius,
y2: item.y2 || nodeData[index + 1].y + Math.sin(Math.PI / 180 * endIndex * 90) * mainCirceRadius
});

@@ -348,0 +355,0 @@ });

Sorry, the diff of this file is too big to display

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