|
@ -1,11 +1,13 @@ |
|
|
import React, { Component } from 'react' |
|
|
import React, { Component } from 'react' |
|
|
import PropTypes from 'prop-types' |
|
|
import PropTypes from 'prop-types' |
|
|
import * as d3Force from 'd3-force'; |
|
|
import * as d3Force from 'd3-force' |
|
|
import * as d3Selection from 'd3-selection'; |
|
|
import * as d3Selection from 'd3-selection' |
|
|
import * as d3Zoom from 'd3-zoom'; |
|
|
import * as d3Zoom from 'd3-zoom' |
|
|
const d3 = Object.assign({}, d3Force, d3Selection, d3Zoom) |
|
|
|
|
|
import styles from './CanvasNetworkGraph.scss' |
|
|
import styles from './CanvasNetworkGraph.scss' |
|
|
|
|
|
|
|
|
|
|
|
const d3 = Object.assign({}, d3Force, d3Selection, d3Zoom) |
|
|
|
|
|
|
|
|
function generateSimulationData(nodes, edges) { |
|
|
function generateSimulationData(nodes, edges) { |
|
|
const resNodes = nodes.map(node => Object.assign(node, { id: node.pub_key })) |
|
|
const resNodes = nodes.map(node => Object.assign(node, { id: node.pub_key })) |
|
|
const resEdges = edges.map(node => Object.assign(node, { source: node.node1_pub, target: node.node2_pub })) |
|
|
const resEdges = edges.map(node => Object.assign(node, { source: node.node1_pub, target: node.node2_pub })) |
|
|