Skip to content

Instantly share code, notes, and snippets.

View davidjgraph's full-sized avatar
🏠
Typing...

David Benson davidjgraph

🏠
Typing...
View GitHub Profile
@davidjgraph
davidjgraph / mxGraph.java
Created December 18, 2013 08:43
mxGraph GWT wrapper example
package com.mxgraph.gwt.client.view;
import java.util.List;
import java.util.Map;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
@davidjgraph
davidjgraph / customEdge.html
Created December 2, 2013 13:43
Custom edge example for mxGraph
<!--
$Id: markers.html,v 1.4 2013/10/28 08:44:55 gaudenz Exp $
Copyright (c) 2006-2014, JGraph Ltd
Demonstrates creating a custom edge in mxGraph
-->
<html>
<head>
<title>Custom edge example for mxGraph</title>
<mxGraphModel dx="800" dy="800" grid="1" guides="1" tooltips="1" connect="1" fold="1" page="1" pageScale="1" pageWidth="826" pageHeight="1169" style="default-style2">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="" style="whiteSpace=wrap" vertex="1" parent="1">
<mxGeometry x="150" y="230" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="3" value="" style="whiteSpace=wrap" vertex="1" parent="1">
<mxGeometry x="770" y="230" width="120" height="60" as="geometry"/>
</mxCell>
<mxGraphModel dx="800" dy="800" grid="1" guides="1" tooltips="1" connect="1" fold="1" page="1" pageScale="1" pageWidth="826" pageHeight="1169" style="default-style2">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="3" value="&lt;p style=&quot;margin: 0px; margin-top: 4px; text-align: center;&quot;&gt;Hello, Dolly!&amp;nbsp;&amp;plusmn;Test&lt;/p&gt;" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1" vertex="1" parent="1">
<mxGeometry x="80" y="340" width="140" height="60" as="geometry"/>
</mxCell>
<mxCell id="4" value="±" style="whiteSpace=wrap" vertex="1" parent="1">
<mxGeometry x="340" y="340" width="120" height="60" as="geometry"/>
</mxCell>
@davidjgraph
davidjgraph / Sidebar.js
Created October 24, 2013 13:47
The iconfinder widget in draw.io
Sidebar.prototype.addIconfinder = function()
{
// TODO: Fix delayed typing, occasional error in library creation in quirks mode
var elt = this.createTitle(mxResources.get('images'));
this.container.appendChild(elt);
var div = document.createElement('div');
div.className = 'geSidebar';
div.style.display = 'none';
div.style.overflow = 'hidden';
<ac:layout><ac:layout-section ac:type="single"><ac:layout-cell>
<h1 style="text-align: center;">Welcome to the EEO Project</h1>
<p>Here's a brief overview:</p>
<p><ac:structured-macro ac:name="viewppt"><ac:parameter ac:name="height">50%</ac:parameter><ac:parameter ac:name="name"><ri:attachment ri:filename="EEO Project - Project Team Briefing - 20130916.pptx" /></ac:parameter></ac:structured-macro></p></ac:layout-cell></ac:layout-section><ac:layout-section ac:type="single"><ac:layout-cell>
<p><ac:structured-macro ac:name="diagramly"><ac:parameter ac:name="docId">5701638</ac:parameter></ac:structured-macro>The EEO Project Structure:</p>
<p><ac:structured-macro ac:name="gallery" /></p>
<p>&nbsp;<ac:structured-macro ac:name="diagramly"><ac:parameter ac:name="width">700</ac:parameter><ac:parameter ac:name="height">500</ac:parameter><ac:parameter ac:name="border">true</ac:parameter><ac:parameter ac:name="grid">true</ac:parameter><ac:parameter ac:name="fitWindow">false</ac:parameter><ac:parameter ac:name="autoSize">
/**
* $Id: Dialogs.js,v 1.10 2013/08/20 12:10:41 gaudenz Exp $
* Copyright (c) 2006-2012, JGraph Ltd
*/
/**
* Constructs a new dialog.
*/
function Dialog(editorUi, elt, w, h, modal, closable, onClose)
{
var dx = 0;
@davidjgraph
davidjgraph / mxEdgeStyle.js
Last active December 24, 2015 14:09
mxEdgeStyle.js for mxGraph 2.2.0.3
/**
* $Id: mxEdgeStyle.js,v 1.3 2013/10/03 14:17:11 david Exp $
* Copyright (c) 2006-2010, JGraph Ltd
*/
var mxEdgeStyle =
{
/**
* Class: mxEdgeStyle
*
* Provides various edge styles to be used as the values for
@davidjgraph
davidjgraph / mxSwimlaneLayout.js
Created September 24, 2013 05:41
23.09.2013 Swimlane layout fix
/**
* $Id: mxSwimlaneLayout.js,v 1.3 2013/09/23 14:11:22 david Exp $
* Copyright (c) 2005-2012, JGraph Ltd
*/
/**
* Class: mxSwimlaneLayout
*
* A hierarchical layout algorithm.
*
* Constructor: mxSwimlaneLayout
@davidjgraph
davidjgraph / leaker
Created September 13, 2013 14:55
zh IE6 leak
<!--
$Id: images.html,v 1.25 2012/11/20 09:06:07 gaudenz Exp $
Copyright (c) 2006-2010, JGraph Ltd
Images example for mxGraph. This example demonstrates using
background images and images for for the label- and image-shape.
-->
<html>
<head>
<title></title>