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 / 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 / README.md
Created June 11, 2018 05:57
Answer to '“Maximum call stack size exceeded” rendering large dot file with d3-graphviz' (using web worker)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@magjac
magjac / README.md
Last active May 24, 2018 09:06
Answer to '“Maximum call stack size exceeded” rendering large dot file with d3-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
<!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)
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="//d3js.org/d3.v5.min.js"></script>
<script src="https://unpkg.com/viz.js@1.8.1/viz.js" type="javascript/worker"></script>
<script src="https://unpkg.com/d3-graphviz@1.6.1/build/d3-graphviz.min.js"></script>
<div id="graph" style="text-align: center;"></div>
<script>
dotSrc = `
@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 / .block
Last active January 7, 2018 15:16
Growing Graphviz Edges
height: 800
@magjac
magjac / README.md
Last active November 19, 2017 15:13

Example showing bug in d3-graphviz version 1.0.1

Growing edges start growing from the wrong position when start node shape is a polygon

Edge a -> b has the problem, while edge c -> d does not.