Gathering detailed insights and metrics for dagre-d3-react
Gathering detailed insights and metrics for dagre-d3-react
Gathering detailed insights and metrics for dagre-d3-react
Gathering detailed insights and metrics for dagre-d3-react
dagre-d3-es
<p align="center"> <a href="https://www.npmjs.com/dagre-d3-es"><img src="https://img.shields.io/npm/v/dagre-d3-es.svg?logo=npm&logoColor=fff&label=NPM+package&color=limegreen" alt="dagre-d3-es on npm" /></a> <a href="https://www.npmjs.com/dagre-
dagre-d3
A D3-based renderer for Dagre
@types/dagre-d3
TypeScript definitions for dagre-d3
dagre
Graph layout for JavaScript
npm install dagre-d3-react
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
46 Stars
39 Commits
22 Forks
3 Watching
20 Branches
4 Contributors
Updated on 02 Nov 2024
Minified
Minified + Gzipped
TypeScript (50.09%)
JavaScript (49.91%)
Cumulative downloads
Total Downloads
Last day
42.9%
466
Compared to previous day
Last week
5.3%
1,943
Compared to previous week
Last month
34.7%
7,946
Compared to previous month
Last year
-64.4%
94,661
Compared to previous year
Dagre D3 Graph Renderer built on DagreD3
Update
rankdir prop has been updated in version 0.2.0
It has now been replaced with config
and the new options can be found here
1import DagreGraph from 'dagre-d3-react' 2 3ReactDOM.render( 4 <div> 5 <DagreGraph 6 nodes={nodes} 7 links={links} 8 config={{ 9 rankdir: 'LR', 10 align: 'UL', 11 ranker: 'tight-tree' 12 }} 13 width='500' 14 height='500' 15 animate={1000} 16 shape='circle' 17 fitBoundaries 18 zoomable 19 onNodeClick={e => console.log(e)} 20 onRelationshipClick={e => console.log(e)} 21 /> 22 </div>, 23 container 24)
1.nodes { 2 fill: darkgray; 3} 4.nodes text { 5 fill: white; 6} 7 8path { 9 stroke: black; 10 fill: black; 11 stroke-width: 1.5px; 12}
name | type | default | description |
---|---|---|---|
nodes | array | undefined | List of node objects {label:'', id:'', class: ''} |
links | array | undefined | List of link objects {source: '', target: '', class: '', label: ''} |
zoomable | boolean | false | Allows scroll to zoom on graph |
fitBoundaries | boolean | false | Autosizes graph to fit container |
height | string | 500 | Default height of svg |
width | string | 500 | Default width of svg |
config | object | See configuration options here | |
animate | number | 1000 | Enables animation with duration in milliseconds |
shape | string | circle | SVG node shape: 'rect' | 'circle' | 'ellipse' |
className | string | Assign custom class to svg element | |
onNodeClick | Function | Callback on node click | |
onRelationshipClick | Function | Callback relationship click (specifically the label) |
1 { 2 id: string, 3 label: string, 4 class?: string, 5 labelType?: 'html' | 'svg' | 'string', 6 config?: object 7 }
1 { 2 source: any, 3 target: any, 4 class?: string, 5 label?: string, 6 config?: object 7 }
1let data = await axios.post('/commit', {statements: [ 2 {statement: "match (a)-[r1]->(b) return a, r1, b", resultDataContents: ['graph']} 3 ] 4}) 5 6let dagreData = { 7 nodes: [], 8 links: [] 9} 10 11data.data.results[0].data.forEach(row => { 12 row.graph.nodes.forEach(node => dagreData.nodes.push(row)) 13 row.graph.relationships.forEach(node => dagreData.links.push(row)) 14}) 15 16return ( 17 <DagreGraph nodes={dagreData.nodes} links={dagreData.links}> 18)
1let data = { 2 nodes: [ 3 { 4 id: "1", 5 label: "<h3>Node 1</h3>", 6 labelType: "html" 7 }, 8 { 9 id: "2", 10 label: "<h3>Node 2</h3>", 11 labelType: "html", 12 config: { 13 style: 'fill: #afa' 14 } 15 } 16 ], 17 links: [ 18 { 19 source: '1', 20 target: '2', 21 label: 'TO', 22 config: { 23 arrowheadStyle: 'display: none', 24 curve: d3.curveBasis, 25 style: 'fill:none' 26 } 27 }, 28 ] 29} 30 31<DagreGraph nodes={dagreData.nodes} links={dagreData.links}>
dagre-d3-react is released under the MIT license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/22 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
120 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More