const Viz = require ( 'viz.js' ) ; let vizOptions ; param graph param options export function renderGraph ( graph , options = { } ) { options = { engine : 'fdp' , format : 'svg' , ... options , } ; if ( vizOptions == null ) { const { Module , render } = require ( 'viz.js/full.render.js' ) ; vizOptions = { Module , render } ; } const viz = new Viz ( vizOptions ) ; return viz . renderString ( graph , options ) ; }