moves selected node to center of network graph background
@@ -88,6 +88,7 @@ export class NetworkGraph extends React.Component<IAllProps, {}> {
return true
}
const height = +svg.style('height').replace('px', '')
+ const width = +svg.style('width').replace('px', '')
const isDataset = (node: any) => {
const name = node.name || node.data.name
@@ -169,7 +170,7 @@ export class NetworkGraph extends React.Component<IAllProps, {}> {
const g = svg.append('g')
.attr('font-family', 'sans-serif')
.attr('font-size', 10)
- .attr('transform', `translate(${200}, ${height/2})`)
+ .attr('transform', `translate(${width/2}, ${height/2})`)
g.append('g')
.attr('fill', 'none')
