
The layout stage is performed by a web worker (unless the use of a web worker was disabled when the renderer instance was created). renderDot returns "immediately", while the rendering is performed in the background. Starts rendering of an SVG graph from the specified dotSrc string and appends it to the selection the Graphviz renderer instance was generated on. If options is not specified, a copy of the currently set options are returned as an object. Most options can also be changed by individual methods which are described separately. graphviz for a list of supported options. If options is specified it is taken to be an object whose properties are used to set options to the graphviz renderer. graphviz for a description of the options argument. If a graphviz renderer instance already exists on that element, instead returns the existing graphviz renderer instance.

If the selector is not a string, instead creates a new graphviz renderer instance on the specified node. Creating a Graphviz Renderer Using a Selector String or a NodeĬreates a new graphviz renderer instance on the first element matching the given selector string. If both are falsey, no web worker will be used. Otherwise, if useWorker is truthy, a dedicated web worker will be used. If the useSharedWorker option is truthy, a shared web worker will be used for the layout stage. The useWorker and useSharedWorker options If options is a boolean it is taken to be the useWorker option (for backwards compatibility).

The others will keep their current values. Only the specified options will be changed. ¹ Only has effect when the graphviz renderer instance is created.Īll options are described below.

All options except the useWorker and useSharedWorker options can also be changed later, using individual methods or the graphviz. If options is specified and is an object, its properties are taken to be options to the graphviz renderer. Returns a new graphviz renderer instance on the first element in the given selection. The following table summarizes the recommended script type:Ĭreating a Graphviz Renderer Creating a Graphviz Renderer on an Existing Selection This will work if a web worker is used and the drawNode and drawEdge functions are not used and will give shorter page load time. This will always work, but will not be optimal if the script is used in a web worker only. However, there are two d3-graphviz functions, drawNode and drawEdge that calls the layout functions directly and if they are going to be used, the script type must be "application/javascript" or "text/javascript". This is accomplished by using the script tag "javascript/worker" which the browser does not identify to be Javascript and therefore does not compile. In this case, it's unnecessary to let the browser also load and compile the script. If a web worker is used, these functions are called from the web worker which then loads and compiles the script explicitly. The script provides functions to do Graphviz layouts.

Then D3 is used to join this data with a selected DOM element, render the SVG graph on that element and to animate transitioning of one graph into another. Uses to do a layout of a graph specified in the DOT language and generates an SVG text representation, which is analyzed and converted into a data representation. The built library will then be in build/d3-graphviz.js Principles of Operation
