magjac / d3-graphviz

Graphviz DOT rendering and animated transitions using D3
BSD 3-Clause "New" or "Revised" License
1.69k stars 103 forks source link

Can u produce a v5 sample? #271

Closed cong1223 closed 1 year ago

cong1223 commented 1 year ago

I'm going to write the following code as usual,but get the error: Uncaught (in promise) TypeError: (0 , d3_selection__WEBPACK_IMPORTED_MODULE_18__.select)(...).graphviz is not a function at initGraphviz

how can fix it? thx so much

const graphviz = await Graphviz.load()
graphvizRef.current = (select(`#${GRAPH_ID}`) as any)
        .graphviz()
        .width('100%')
        .height('100%')
        .options({
          zoom: true,
          fit: true,
          useWorker: false
        })
magjac commented 1 year ago

I can't say if you don't provide a complete example that I can run myself.