File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ export function getHtmlForWebview(
163163 /*
164164 * Content security policy:
165165 * default-src: allow nothing by default.
166- * script-src: allow only the given script, using the nonce.
166+ * script-src: allow the given script, using the nonce. also allow loading WebAssembly modules .
167167 * style-src: allow only the given stylesheet, using the nonce.
168168 * connect-src: only allow fetch calls to webview resource URIs
169169 * (this is used to load BQRS result files).
@@ -172,7 +172,7 @@ export function getHtmlForWebview(
172172<html>
173173 <head>
174174 <meta http-equiv="Content-Security-Policy"
175- content="default-src 'none'; script-src 'nonce-${ nonce } '; font-src ${ fontSrc } ; style-src ${ styleSrc } ; connect-src ${
175+ content="default-src 'none'; script-src 'nonce-${ nonce } ' 'wasm-unsafe-eval' ; font-src ${ fontSrc } ; style-src ${ styleSrc } ; connect-src ${
176176 webview . cspSource
177177 } ;">
178178 ${ stylesheetsHtmlLines . join ( ` ${ EOL } ` ) }
Original file line number Diff line number Diff line change 55 InterpretedResultSet ,
66 GraphInterpretationData ,
77} from "../../pure/interface-types" ;
8- import { graphviz } from "d3-graphviz" ;
8+ import { graphviz , GraphvizOptions } from "d3-graphviz" ;
99import { tryGetLocationFromString } from "../../pure/bqrs-utils" ;
1010export type GraphProps = ResultTableProps & {
1111 resultSet : InterpretedResultSet < GraphInterpretationData > ;
@@ -59,11 +59,12 @@ export class Graph extends React.Component<GraphProps> {
5959 return ;
6060 }
6161
62- const options = {
62+ const options : GraphvizOptions = {
6363 fit : true ,
6464 fade : false ,
6565 growEnteringEdges : false ,
6666 zoom : true ,
67+ useWorker : false ,
6768 } ;
6869
6970 const element = document . querySelector ( `#${ graphId } ` ) ;
@@ -77,8 +78,7 @@ export class Graph extends React.Component<GraphProps> {
7778 const borderColor = getComputedStyle ( element ) . borderColor ;
7879 let firstPolygon = true ;
7980
80- graphviz ( `#${ graphId } ` )
81- . options ( options )
81+ graphviz ( `#${ graphId } ` , options )
8282 . attributer ( function ( d ) {
8383 if ( d . tag === "a" ) {
8484 const url = d . attributes [ "xlink:href" ] || d . attributes [ "href" ] ;
You can’t perform that action at this time.
0 commit comments