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 / sidebar.js
Created July 10, 2013 19:45
draw.io sidebar.js
(function()
{
/**
* Overrides gear image URL.
*/
Sidebar.prototype.gearImage = GRAPH_IMAGE_PATH + '/clipart/Gear_128x128.png';
/**
* Specifies the names of items for the signs category.
*/
@davidjgraph
davidjgraph / daigramly.js
Created July 10, 2013 20:36
Code containing setup for TinyMCE editor
/*
* $Id: Diagramly.js,v 1.80 2013/05/31 13:17:27 david Exp $
* Copyright (c) 2006-2010, JGraph Ltd
*/
// For compatibility with open servlet on GAE
function setCurrentXml(data, filename)
{
if (window.parent != null && window.parent.openFile != null)
{
window.parent.openFile.setData(data, filename);
@davidjgraph
davidjgraph / mxgraphPatchBoundingBox.js
Created July 23, 2013 21:30
Patch for edge bounds calculation in mxGraph.getBoundingBoxFromGeometry
mxGraph.prototype.getBoundingBoxFromGeometry = function(cells, includeEdges)
{
includeEdges = (includeEdges != null) ? includeEdges : false;
var result = null;
if (cells != null)
{
for (var i = 0; i < cells.length; i++)
{
if (includeEdges || this.model.isVertex(cells[i]))
@davidjgraph
davidjgraph / EditorUi.js
Created August 6, 2013 09:03
EditorUi.js
/**
* $Id: EditorUi.js,v 1.32 2013/07/19 06:13:37 gaudenz Exp $
* Copyright (c) 2006-2012, JGraph Ltd
*/
/**
* Constructs a new graph editor
*/
EditorUi = function(editor, container) {
this.editor = editor || new Editor();
this.container = container || document.body;
@davidjgraph
davidjgraph / Actions.js
Created August 6, 2013 09:06
Actions.js
/**
* $Id: Actions.js,v 1.12 2013/07/15 13:54:44 gaudenz Exp $
* Copyright (c) 2006-2012, JGraph Ltd
*/
/**
* Constructs the actions object for the given UI.
*/
function Actions(editorUi)
{
this.editorUi = editorUi;
@davidjgraph
davidjgraph / index.html
Created August 20, 2013 14:37
GraphEditor index.html
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]-->
<!DOCTYPE html>
<html>
<head>
<title>Graph Editor</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="styles/grapheditor.css">
<script type="text/javascript">
// Public global variables
var MAX_REQUEST_SIZE = 10485760;
@davidjgraph
davidjgraph / menustyle.js
Created September 12, 2013 20:09
mxGraph menu example
<!--
$Id: menustyle.html,v 1.5 2013/06/07 14:30:51 gaudenz Exp $
Copyright (c) 2006-2010, JGraph Ltd
Menustyle example for mxGraph. This example demonstrates using
CSS to style the mxPopupMenu.
-->
<html>
<head>
<title>Menustyle example for mxGraph</title>
@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>
@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 / 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