mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 15:44:45 -04:00
Set wasmfolder (#619)
This commit is contained in:
parent
5381f8ed90
commit
2b6ba82b4b
1 changed files with 18 additions and 10 deletions
|
@ -25,10 +25,18 @@ export const GraphvizFrame: React.FC<GraphvizFrameProps> = ({ code }) => {
|
||||||
}
|
}
|
||||||
const actualContainer = container.current
|
const actualContainer = container.current
|
||||||
|
|
||||||
Promise.all([import(/* webpackChunkName: "d3-graphviz" */ 'd3-graphviz'), import('@hpcc-js/wasm')]).then(([imp]) => {
|
import('@hpcc-js/wasm')
|
||||||
|
.then((wasmPlugin) => {
|
||||||
|
wasmPlugin.wasmFolder('/static/js')
|
||||||
|
})
|
||||||
|
.then(() => import(/* webpackChunkName: "d3-graphviz" */ 'd3-graphviz'))
|
||||||
|
.then((graphvizImport) => {
|
||||||
try {
|
try {
|
||||||
setError(undefined)
|
setError(undefined)
|
||||||
imp.graphviz(actualContainer, { useWorker: false, zoom: false })
|
graphvizImport.graphviz(actualContainer, {
|
||||||
|
useWorker: false,
|
||||||
|
zoom: false
|
||||||
|
})
|
||||||
.onerror(showError)
|
.onerror(showError)
|
||||||
.renderDot(code)
|
.renderDot(code)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue