nodelayout
Advanced tools
Comparing version 1.1.0 to 1.1.5
{ | ||
"name": "nodelayout", | ||
"version": "1.1.0", | ||
"version": "1.1.5", | ||
"description": "For node Layout.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -17,2 +17,7 @@ # nodeLayout | ||
## Demo | ||
```bash | ||
yarn start | ||
``` | ||
### Init | ||
@@ -19,0 +24,0 @@ ```js |
import * as d3 from "d3"; | ||
import uuid from "./utils/uuid"; | ||
import deepProxy from "./utils/deepProxy"; | ||
import renderOptionList from "./optionList"; | ||
import { defaultIcon, deletIcon } from "./utils/icon"; | ||
@@ -135,10 +136,10 @@ import "./less/index.less"; | ||
function smallCircleDragstart (event, d) { | ||
d.dx = event.sourceEvent.x; | ||
d.dy = event.sourceEvent.y; | ||
d.dx = event.sourceEvent.layerX; | ||
d.dy = event.sourceEvent.layerY; | ||
} | ||
function smallCircleDraging (event, d) { | ||
d.x1 = d.dx - smallCirceRadius * 2 - zoomX; | ||
d.y1 = d.dy - smallCirceRadius * 2 - zoomY; | ||
d.x2 = event.sourceEvent.x - smallCirceRadius * 2 - zoomX; | ||
d.y2 = event.sourceEvent.y - smallCirceRadius * 2 - zoomY; | ||
d.x1 = d.dx - zoomX; | ||
d.y1 = d.dy - zoomY; | ||
d.x2 = event.sourceEvent.layerX - zoomX; | ||
d.y2 = event.sourceEvent.layerY - zoomY; | ||
d3.select(".connect-line") | ||
@@ -217,2 +218,7 @@ .attr("class", "connect-line show") | ||
const wrap = d3.select(`#${params.id}`).attr("height", svgHeight); | ||
renderOptionList({ | ||
wrap, | ||
add, | ||
option: params.option | ||
}); | ||
const svg = wrap.append("svg"); | ||
@@ -324,7 +330,7 @@ // fill pattern | ||
id: uuid(16, 62), | ||
text: params + (nodeData.data.length + 1), | ||
x: svgWidth/10 + nodeData.data.length * 200, | ||
y: svgHeight/2 | ||
text: params.text || params + (nodeData.data.length + 1), | ||
x: params.x || svgWidth/10 + nodeData.data.length * 200, | ||
y: params.y || svgHeight/2 | ||
}); | ||
} | ||
export { init, add }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1584502
12
8730
32