yarn add react-d3-interactomeimportReact,{Component}from'react'importInteractomefrom'react-d3-interactome'classExampleextendsComponent{componentDidMount(){constinteractomeColorRange=scaleLinear().domain([0,1]).range([rgb('#eed841'),rgb('#551a8b')])constnewColorScale=scaleLinear().domain([0,1]).range(interactomeColorRange.range())letoptions={data: __options__,el: document.getElementById('containerEl'),colorScale: newColorScale}if(options){InteractomePlot.create(options)}}render(){return(<div><divid='containerEl'/></div>)}}Check the /example for more details.
Local development is broken into two parts (ideally using two tabs). First, run rollup to watch your src/ module and automatically recompile it into dist/ whenever you make changes.
yarn start # runs rollup with watch flagThe second part will be running the example/ create-react-app that's linked to the local version of your module.
# (in another tab)cd example yarn start # runs create-react-app dev serverGPL-3.0-or-later © thehyve