Skip to content

Instantly share code, notes, and snippets.

View magjac's full-sized avatar

Magnus Jacobsson magjac

  • Stockholm, Sweden
View GitHub Profile
@magjac
magjac / index.html
Last active April 17, 2024 07:18
d3-graphviz Shape Tweening Demo
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="//d3js.org/d3.v4.min.js"></script>
<script src="https://unpkg.com/@hpcc-js/wasm@0.3.11/dist/index.min.js"></script>
<script src="https://unpkg.com/d3-graphviz@3.0.5/build/d3-graphviz.js"></script>
<div id="graph" style="text-align: center;"></div>
<script>
var dotIndex = 0;
@magjac
magjac / index.html
Last active February 27, 2024 17:51
d3-graphviz Basic Example
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="//d3js.org/d3.v5.min.js"></script>
<script src="https://unpkg.com/@hpcc-js/wasm@0.3.11/dist/index.min.js"></script>
<script src="https://unpkg.com/d3-graphviz@3.0.5/build/d3-graphviz.js"></script>
<div id="graph" style="text-align: center;"></div>
<script>
d3.select("#graph").graphviz()
@magjac
magjac / index.html
Last active February 12, 2024 19:56
Render loaded .dot file (!useWorker)
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="https://d3js.org/d3.v5.js"></script>
<script src="https://unpkg.com/viz.js@1.8.1/viz.js" type="application/javascript"></script>
<script src="https://unpkg.com/d3-graphviz@2.1.0/build/d3-graphviz.js"></script>
<div id="graph" style="text-align: center;"></div>
<script>
<!-- This is a (failed) attempt to inhibit stack overflow. -->
Error.stackTraceLimit = Infinity
@magjac
magjac / index.html
Last active January 16, 2024 07:13
d3-graphviz Demo
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="//d3js.org/d3.v5.min.js"></script>
<script src="https://unpkg.com/@hpcc-js/wasm@0.3.11/dist/index.min.js"></script>
<script src="https://unpkg.com/d3-graphviz@3.0.5/build/d3-graphviz.js"></script>
<div id="graph" style="text-align: center;"></div>
<script>
var dotIndex = 0;
@magjac
magjac / README.md
Last active November 13, 2023 14:45
d3-graphviz demo application showing association of SVG elements with DOT source elements

Open the console to see detalied info about what's going on

<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="https://d3js.org/d3.v5.js"></script>
<script src="https://unpkg.com/viz.js@1.8.1/viz.js" type="application/javascript"></script>
<script src="https://unpkg.com/d3-graphviz@2.1.0/build/d3-graphviz.js"></script>
<div id="graph" style="text-align: center;"></div>
<script>
d3.select("#graph").graphviz(false)
@magjac
magjac / README.md
Last active July 29, 2021 00:55
d3-graphviz demo application showing association of SVG elements with DOT source HTML-like node label table cell elements

Open the console to see what's going on

@magjac
magjac / README.md
Last active July 9, 2021 20:48
D3 Graphviz GUI editor proof-of-concept

This is a proof-of-concept of a graphical editor that allows you to to edit a Graphviz graph graphically, by drawing edges between nodes and inserting new nodes by using the mouse only. It also allows you to edit the textual DOT language description and directly see the graph transform itself into a new layout in an animated transition.

The GUI editor is perfectly usable as it is, but it has some simplifications that needs to be addressed in a production quality application in order not to hamper productivity:

  • Draws only the standard type edge with alternating colors, although you can edit all aspects of it with the text editor afterwards and see the changes directly.
  • Draws only two kinds of node shapes, alternating between ellipse and polygon and different colors and using predefined names. Also this can of course be changed with the text editor.

Help is available by clicking the question mark in the top right corner.

This sma

@magjac
magjac / Untitled Document
Created July 15, 2018 16:48
Gist from yEd-Live
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--Created by yFiles for HTML 2.1.0.3-RC3-->
<graphml xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml.html/2.0/ygraphml.xsd " xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:demostyle="http://www.yworks.com/yFilesHTML/demos/FlatDemoStyle/1.0" xmlns:bpmn="http://www.yworks.com/xml/yfiles-for-html/bpmn/2.0" xmlns:demotablestyle="http://www.yworks.com/yFilesHTML/demos/FlatDemoTableStyle/1.0" xmlns:uml="http://www.yworks.com/yFilesHTML/demos/UMLDemoStyle/1.0" xmlns:compat="http://www.yworks.com/xml/yfiles-compat-arrows/1.0" xmlns:VuejsNodeStyle="http://www.yworks.com/demos/yfiles-vuejs-node-style/1.0" xmlns:y="http://www.yworks.com/xml/yfiles-common/3.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/3.0" xmlns:yjs="http://www.yworks.com/xml/yfiles-for-html/2.0/xaml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<key id="d0" for="node" attr.type="boolean" attr.name="Expanded" y:attr.ur
@magjac
magjac / .block
Last active February 5, 2021 12:32
Growing Graphviz Edges
height: 800