From 5ccac7f32dd98895cc2cc401ba1079ddbd672ceb Mon Sep 17 00:00:00 2001 From: mcyph <20507948+mcyph@users.noreply.github.com> Date: Thu, 25 Mar 2021 14:59:23 +1100 Subject: [PATCH] adjusted width, titles and positioning of examples --- src/pages/Anchors.js | 5 ++--- src/pages/Animation.js | 5 ++--- src/pages/AutoLayout.js | 5 ++--- src/pages/Boundary.js | 5 ++--- src/pages/Clipboard.js | 5 ++--- src/pages/Codec.js | 4 ++-- src/pages/Collapse.js | 5 ++--- src/pages/Constituent.js | 5 ++--- src/pages/ContextIcons.js | 5 ++--- src/pages/Control.js | 5 ++--- src/pages/DragSource.js | 4 ++-- src/pages/Drop.js | 5 ++--- src/pages/DynamicLoading.js | 5 ++--- src/pages/DynamicStyle.js | 5 ++--- src/pages/DynamicToolbar.js | 5 ++--- src/pages/EdgeTolerance.js | 5 ++--- src/pages/Editing.js | 5 ++--- src/pages/Events.js | 4 ++-- src/pages/ExtendCanvas.js | 5 ++--- src/pages/FileIO.js | 18 ++++++++++-------- src/pages/FixedIcon.js | 5 ++--- src/pages/FixedPoints.js | 5 ++--- src/pages/Folding.js | 5 ++--- src/pages/GraphLayout.js | 8 +++++--- src/pages/Grid.js | 7 +++---- src/pages/Groups.js | 5 ++--- src/pages/Guides.js | 5 ++--- src/pages/Handles.js | 14 +++++++++----- src/pages/HelloPort.js | 5 ++--- src/pages/HelloWorld.js | 5 ++--- src/pages/HierarchicalLayout.js | 13 +++++++++---- src/pages/HoverIcons.js | 5 ++--- src/pages/HoverStyle.js | 5 ++--- src/pages/HtmlLabel.js | 4 ++-- src/pages/Images.js | 5 ++--- src/pages/Indicators.js | 4 ++-- src/pages/JQuery.js | 2 +- src/pages/JsonData.js | 5 ++--- src/pages/LOD.js | 5 ++--- src/pages/LabelPosition.js | 4 ++-- src/pages/Labels.js | 11 ++++------- src/pages/Layers.js | 14 +++++++++----- src/pages/Map.js | 4 ++-- src/pages/Markers.js | 5 ++--- src/pages/MenuStyle.js | 4 ++-- src/pages/Merge.js | 4 ++-- src/pages/Monitor.js | 10 +++++++--- src/pages/Morph.js | 12 ++++++++---- src/pages/OffPage.js | 4 ++-- src/pages/OrgChart.js | 4 ++-- src/pages/Orthogonal.js | 5 ++--- src/pages/Overlays.js | 5 ++--- src/pages/PageBreaks.js | 20 ++++++++++++-------- src/pages/Perimeter.js | 5 ++--- src/pages/Permissions.js | 11 ++++++++--- src/pages/PortRefs.js | 3 +-- src/pages/Ports.js | 6 +++--- src/pages/RadialTreeLayout.js | 5 ++--- src/pages/Resources.js | 5 ++--- src/pages/Schema.js | 2 +- src/pages/Scrollbars.js | 4 ++-- src/pages/SecondLabel.js | 20 +++++++++++--------- src/pages/ServerView.js | 2 +- src/pages/Shape.js | 5 ++--- src/pages/ShowRegion.js | 10 +++++++--- src/pages/Stencils.js | 5 ++--- src/pages/Stylesheet.js | 5 ++--- src/pages/SwimLanes.js | 6 ++---- src/pages/Template.js | 3 +-- src/pages/Thread.js | 5 ++--- src/pages/Toolbar.js | 16 ++++++++-------- src/pages/Touch.js | 4 ++-- src/pages/Tree.js | 5 ++--- src/pages/UIConfig.js | 2 +- src/pages/UserObject.js | 11 +++++++---- src/pages/Validation.js | 5 ++--- src/pages/Visibility.js | 20 ++++++++++++-------- src/pages/Windows.js | 5 ++--- src/pages/Wrapping.js | 5 ++--- 79 files changed, 250 insertions(+), 253 deletions(-) diff --git a/src/pages/Anchors.js b/src/pages/Anchors.js index a9ead1891..374069a51 100644 --- a/src/pages/Anchors.js +++ b/src/pages/Anchors.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Anchors example for mxGraph. This example demonstrates defining + * Anchors. This example demonstrates defining * fixed connection points for all shapes. */ @@ -98,7 +98,7 @@ class Anchors extends React.Component { // A container for the graph return ( <> -

Anchors example for mxGraph

+

Anchors

{ this.el = el; @@ -106,7 +106,6 @@ class Anchors extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: 'url("editors/images/grid.gif")', cursor: 'default', diff --git a/src/pages/Animation.js b/src/pages/Animation.js index d7f58ede1..4606aba1a 100644 --- a/src/pages/Animation.js +++ b/src/pages/Animation.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2017, JGraph Ltd * - * Animation example for mxGraph. This example demonstrates using + * Animation. This example demonstrates using * SVG animations on edges to visualize the flow in a pipe. */ @@ -18,7 +18,7 @@ class Animation extends React.Component { // A container for the graph return ( <> -

Animation example for mxGraph

+

Animation

{ @@ -27,7 +27,6 @@ class Animation extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: 'url("editors/images/grid.gif")', cursor: 'default', diff --git a/src/pages/AutoLayout.js b/src/pages/AutoLayout.js index b9467d0b4..ac57e4c88 100644 --- a/src/pages/AutoLayout.js +++ b/src/pages/AutoLayout.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Autolayout example for mxGraph. This example demonstrates running + * Autolayout. This example demonstrates running * and animating a layout algorithm after every change to a graph. */ @@ -29,7 +29,7 @@ class AutoLayout extends React.Component { // A this.el for the graph return ( <> -

Auto layout example for mxGraph

+

Auto layout

{ this.el = el; @@ -37,7 +37,6 @@ class AutoLayout extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '821px', height: '641px', background: 'url("editors/images/grid.gif")', cursor: 'default', diff --git a/src/pages/Boundary.js b/src/pages/Boundary.js index cd943bf77..0b9b3322a 100644 --- a/src/pages/Boundary.js +++ b/src/pages/Boundary.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Boundary example for mxGraph. This example demonstrates + * Boundary. This example demonstrates * implementing boundary events in BPMN diagrams. */ @@ -23,7 +23,7 @@ class Boundary extends React.Component { // A this.el for the graph return ( <> -

Boundary example for mxGraph

+

Boundary

{ @@ -32,7 +32,6 @@ class Boundary extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: 'url("editors/images/grid.gif")', cursor: 'default' diff --git a/src/pages/Clipboard.js b/src/pages/Clipboard.js index a318444be..942d91e8f 100644 --- a/src/pages/Clipboard.js +++ b/src/pages/Clipboard.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Clipboard example for mxGraph. This example demonstrates using the + * Clipboard. This example demonstrates using the * clipboard for providing cross-tab and cross-browser copy and paste. */ @@ -24,7 +24,7 @@ class Clipboard extends React.Component { // A this.el for the graph return ( <> -

Clipboard example for mxGraph

+

Clipboard

{ @@ -33,7 +33,6 @@ class Clipboard extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/Codec.js b/src/pages/Codec.js index d72c844d0..55ceb132c 100644 --- a/src/pages/Codec.js +++ b/src/pages/Codec.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Codec example for mxGraph. This example demonstrates dynamically + * Codec. This example demonstrates dynamically * creating a graph from XML and encoding the model into XML, as well * as changing the default style for edges in-place. */ @@ -23,7 +23,7 @@ class MYNAMEHERE extends React.Component { // Contains a graph description which will be converted return ( <> -

Codec example for mxGraph

+

Codec

This graph is embedded in the page.
<mxGraphModel><root><mxCell diff --git a/src/pages/Collapse.js b/src/pages/Collapse.js index 4a4e9cefc..b834f5bb1 100644 --- a/src/pages/Collapse.js +++ b/src/pages/Collapse.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Collapse example for mxGraph. This example demonstrates changing + * Collapse. This example demonstrates changing * the style of a cell based on its collapsed state. */ @@ -18,7 +18,7 @@ class Collapse extends React.Component { // A container for the graph return ( <> -

Collapse example for mxGraph

+

Collapse

{ @@ -27,7 +27,6 @@ class Collapse extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/Constituent.js b/src/pages/Constituent.js index 9d2d333c1..83a7b5813 100644 --- a/src/pages/Constituent.js +++ b/src/pages/Constituent.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Consistuent example for mxGraph. This example demonstrates using + * Consistuent. This example demonstrates using * cells as parts of other cells. */ @@ -21,7 +21,7 @@ class Constituent extends React.Component { // A container for the graph return ( <> -

Consistuent example for mxGraph

+

Consistuent

{ @@ -30,7 +30,6 @@ class Constituent extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: 'url("editors/images/grid.gif")', cursor: 'default', diff --git a/src/pages/ContextIcons.js b/src/pages/ContextIcons.js index 3ade25331..57faab890 100644 --- a/src/pages/ContextIcons.js +++ b/src/pages/ContextIcons.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Context icons example for mxGraph. This example demonstrates adding + * Context icons. This example demonstrates adding * icons to selected vertices to carry out special operations. */ @@ -22,14 +22,13 @@ class ContextIcons extends React.Component { // A container for the graph return ( <> -

Context icons example for mxGraph

+

Context icons

{ this.el = el; }} style={{ overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/Control.js b/src/pages/Control.js index 9ea90c65a..4a2848b43 100644 --- a/src/pages/Control.js +++ b/src/pages/Control.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Control example for mxGraph. This example demonstrates adding + * Control. This example demonstrates adding * controls to specific cells in a graph. */ @@ -24,14 +24,13 @@ class Control extends React.Component { // A container for the graph return ( <> -

Control example for mxGraph

+

Control

{ this.el = el; }} style={{ overflow: 'hidden', - width: '621px', height: '441px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/DragSource.js b/src/pages/DragSource.js index 6bcfb36cb..19b4a6ca7 100644 --- a/src/pages/DragSource.js +++ b/src/pages/DragSource.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Dragsource example for mxGraph. This example demonstrates using + * Dragsource. This example demonstrates using * one drag source for multiple graphs and changing the drag icon. */ @@ -26,7 +26,7 @@ class DragSource extends React.Component { // A container for the graph return ( <> -

Dragsource example for mxGraph

+

Dragsource

{ diff --git a/src/pages/Drop.js b/src/pages/Drop.js index 18747a261..44c967c24 100644 --- a/src/pages/Drop.js +++ b/src/pages/Drop.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Drop example for mxGraph. This example demonstrates handling + * Drop. This example demonstrates handling * native drag and drop of images (requires modern browser). */ @@ -21,7 +21,7 @@ class Drop extends React.Component { // A this.el for the graph return ( <> -

Drop example for mxGraph

+

Drop

{ @@ -30,7 +30,6 @@ class Drop extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '621px', height: '441px', background: `url('editors/images/grid.gif')`, cursor: 'default', diff --git a/src/pages/DynamicLoading.js b/src/pages/DynamicLoading.js index 2f2f50ea8..82332c6c3 100644 --- a/src/pages/DynamicLoading.js +++ b/src/pages/DynamicLoading.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Dynamic loading example for mxGraph. This example demonstrates loading + * Dynamic loading. This example demonstrates loading * graph model data dynamically to limit the number of cells in the model. */ @@ -24,7 +24,7 @@ class DynamicLoading extends React.Component { // A container for the graph return ( <> -

Dynamic loading example for mxGraph

+

Dynamic loading

{ @@ -33,7 +33,6 @@ class DynamicLoading extends React.Component { style={{ overflow: 'visible', position: 'absolute', - width: '100%', height: '100%', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/DynamicStyle.js b/src/pages/DynamicStyle.js index 01bc654fb..d434a9c5a 100644 --- a/src/pages/DynamicStyle.js +++ b/src/pages/DynamicStyle.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Dynamic Style example for mxGraph. This example demonstrates changing + * Dynamic Style. This example demonstrates changing * the style of a cell dynamically by overriding mxGraphModel.getStyle. */ @@ -20,7 +20,7 @@ class DynamicStyle extends React.Component { // A container for the graph return ( <> -

Dynamic Style example for mxGraph

+

Dynamic Style

{ @@ -28,7 +28,6 @@ class DynamicStyle extends React.Component { }} style={{ overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", }} diff --git a/src/pages/DynamicToolbar.js b/src/pages/DynamicToolbar.js index 99f51836d..d0f5d1795 100644 --- a/src/pages/DynamicToolbar.js +++ b/src/pages/DynamicToolbar.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Dynamic toolbar example for mxGraph. This example demonstrates changing the + * Dynamic toolbar. This example demonstrates changing the * state of the toolbar at runtime. */ @@ -27,7 +27,7 @@ class DynamicToolbar extends React.Component { // A container for the graph return ( <> -

Toolbar example for mxGraph

+

Toolbar

{ @@ -35,7 +35,6 @@ class DynamicToolbar extends React.Component { }} style={{ overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", position: "relative" diff --git a/src/pages/EdgeTolerance.js b/src/pages/EdgeTolerance.js index e4f07bc86..ab6c797ea 100644 --- a/src/pages/EdgeTolerance.js +++ b/src/pages/EdgeTolerance.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Edge tolerance example for mxGraph. This example demonstrates increasing + * Edge tolerance. This example demonstrates increasing * the tolerance for hit detection on edges. */ @@ -19,14 +19,13 @@ class EdgeTolerance extends React.Component { // A container for the graph return ( <> -

Edge tolerance example for mxGraph

+

Edge tolerance

{ this.el = el; }} style={{ overflow: 'hidden', - width: '641px', height: '481px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/Editing.js b/src/pages/Editing.js index e805065a0..c42d5942b 100644 --- a/src/pages/Editing.js +++ b/src/pages/Editing.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Editing example for mxGraph. This example demonstrates using the in-place + * Editing. This example demonstrates using the in-place * editor trigger to specify the editing value and write the new value into * a specific field of the user object. Wrapping and DOM nodes as labels are * also demonstrated here. @@ -22,7 +22,7 @@ class Editing extends React.Component { // A container for the graph return ( <> -

Editing example for mxGraph

+

Editing

Double-click the upper/lower half of the cell to edit different fields of the user object.
-

Events example for mxGraph

+

Events

{ diff --git a/src/pages/ExtendCanvas.js b/src/pages/ExtendCanvas.js index 843f4b587..e0a60f7a7 100644 --- a/src/pages/ExtendCanvas.js +++ b/src/pages/ExtendCanvas.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Extend canvas example for mxGraph. This example demonstrates implementing + * Extend canvas. This example demonstrates implementing * an infinite canvas with scrollbars. */ @@ -22,7 +22,7 @@ class ExtendCanvas extends React.Component { // A container for the graph return ( <> -

Extend canvas example for mxGraph

+

Extend canvas

{ @@ -31,7 +31,6 @@ class ExtendCanvas extends React.Component { style={{ position: 'relative', overflow: 'auto', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/FileIO.js b/src/pages/FileIO.js index 96ddf51c5..132eb1b9d 100644 --- a/src/pages/FileIO.js +++ b/src/pages/FileIO.js @@ -1,7 +1,7 @@ /** *Copyright (c) 2006-2013, JGraph Ltd * - * File I/O example for mxGraph. This example demonstrates reading an + * File I/O. This example demonstrates reading an * XML file, writing a custom parser, applying an automatic layout and * defining a 2-way edge. */ @@ -27,21 +27,23 @@ class FileIO extends React.Component { // A container for the graph return ( <> -

File I/O example for mxGraph

+

File I/O

{ this.el = el; }} style={{ - position: 'absolute', + position: 'relative', overflow: 'auto', - top: '36px', - bottom: '0px', - left: '0px', - right: '0px', + height: '80vh', borderTop: 'gray 1px solid', }} /> +
{ + this.el2 = el; + }} + /> ); }; @@ -98,7 +100,7 @@ class FileIO extends React.Component { layout.forceConstant = 140; // Adds a button to execute the layout - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Arrange', function(evt) { const parent = graph.getDefaultParent(); layout.execute(parent); diff --git a/src/pages/FixedIcon.js b/src/pages/FixedIcon.js index defea836c..0d868d286 100644 --- a/src/pages/FixedIcon.js +++ b/src/pages/FixedIcon.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - FixedIcon example for mxGraph. This example demonstrates + FixedIcon. This example demonstrates customizing the icon position in the mxLabel shape. */ @@ -23,7 +23,7 @@ class FixedIcon extends React.Component { // A container for the graph return ( <> -

Fixed icon example for mxGraph

+

Fixed icon

{ this.el = el; @@ -31,7 +31,6 @@ class FixedIcon extends React.Component { style={{ overflow: 'hidden', position: 'relative', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/FixedPoints.js b/src/pages/FixedPoints.js index 1698b4580..3a039a795 100644 --- a/src/pages/FixedPoints.js +++ b/src/pages/FixedPoints.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Fixed points example for mxGraph. This example demonstrates using + Fixed points. This example demonstrates using fixed connection points for connecting edges to vertices. */ @@ -25,7 +25,7 @@ class FixedPoints extends React.Component { // A container for the graph return ( <> -

Fixed points example for mxGraph

+

Fixed points

{ @@ -34,7 +34,6 @@ class FixedPoints extends React.Component { style={{ overflow: 'hidden', position: 'relative', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/Folding.js b/src/pages/Folding.js index 3be0a5470..74a8367bf 100644 --- a/src/pages/Folding.js +++ b/src/pages/Folding.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Folding example for mxGraph. This example demonstrates + * Folding. This example demonstrates * using a layout to implement a nested group structure. */ @@ -21,7 +21,7 @@ class Folding extends React.Component { // A container for the graph return ( <> -

Folding example for mxGraph

+

Folding

{ this.el = el; @@ -29,7 +29,6 @@ class Folding extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/GraphLayout.js b/src/pages/GraphLayout.js index e7ea06fae..9466fab99 100644 --- a/src/pages/GraphLayout.js +++ b/src/pages/GraphLayout.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Graphlayout example for mxGraph. This example demonstrates using + Graphlayout. This example demonstrates using automatic graph layouts and listening to changes of the graph size to keep the container size in sync. */ @@ -10,6 +10,8 @@ import React from 'react'; import mxEvent from '../mxgraph/util/mxEvent'; import mxGraph from '../mxgraph/view/mxGraph'; import mxRubberband from '../mxgraph/handler/mxRubberband'; +import mxUtils from "../mxgraph/util/mxUtils"; +import mxCircleLayout from "../mxgraph/layout/mxCircleLayout"; class MYNAMEHERE extends React.Component { constructor(props) { @@ -20,7 +22,7 @@ class MYNAMEHERE extends React.Component { // A container for the graph return ( <> -

Graphlayout example for mxGraph

+

Graphlayout

{ @@ -94,7 +96,7 @@ export default MYNAMEHERE; let animate = document.getElementById('animate'); // Adds a button to execute the layout - document.body.insertBefore(mxUtils.button('Circle Layout', + this.el2.insertBefore(mxUtils.button('Circle Layout', function(evt) { graph.getModel().beginUpdate(); diff --git a/src/pages/Grid.js b/src/pages/Grid.js index b92756cbf..5ec60e9e1 100644 --- a/src/pages/Grid.js +++ b/src/pages/Grid.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Grid example for mxGraph. This example demonstrates drawing + Grid. This example demonstrates drawing a grid dynamically using HTML 5 canvas. */ @@ -23,14 +23,13 @@ class Grid extends React.Component { // A container for the graph return ( <> -

Grid example for mxGraph

+

Grid

{ this.el = el; }} style={{ overflow: 'hidden', - width: '641px', height: '481px', cursor: 'default', }} @@ -45,7 +44,7 @@ class Grid extends React.Component { } componentDidMount() { - mxEvent.disableContextMenu(document.body); + mxEvent.disableContextMenu(this.el); // Creates the graph inside the given container const graph = new mxGraph(this.el); diff --git a/src/pages/Groups.js b/src/pages/Groups.js index 1bb58a314..af8b03f0a 100644 --- a/src/pages/Groups.js +++ b/src/pages/Groups.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Groups example for mxGraph. This example demonstrates using + Groups. This example demonstrates using cells as parts of other cells. */ @@ -20,14 +20,13 @@ class Groups extends React.Component { // A container for the graph return ( <> -

Hello, World! example for mxGraph

+

Hello, World!

{ this.el = el; }} style={{ overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/Guides.js b/src/pages/Guides.js index 2cb9eab7e..eb3a12a2c 100644 --- a/src/pages/Guides.js +++ b/src/pages/Guides.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Guides example for mxGraph. This example demonstrates the guides + Guides. This example demonstrates the guides feature which aligns the current selection to the existing vertices in the graph. This feature is in RFC state. Creating a grid using a canvas and installing a key handler for cursor keys is also @@ -27,14 +27,13 @@ class Guides extends React.Component { // A container for the graph return ( <> -

Guides example for mxGraph

+

Guides

{ this.el = el; }} style={{ overflow: 'hidden', - width: '801px', height: '601px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/Handles.js b/src/pages/Handles.js index 9eaa67182..fc9e1c3d9 100644 --- a/src/pages/Handles.js +++ b/src/pages/Handles.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2014, JGraph Ltd - Handles example for mxGraph. This example demonstrates using mxHandle to change custom styles interactively. + Handles. This example demonstrates using mxHandle to change custom styles interactively. */ import React from 'react'; @@ -25,7 +25,7 @@ class Handles extends React.Component { // A container for the graph return ( <> -

Handles example for mxGraph

+

Handles

{ this.el = el; @@ -33,12 +33,16 @@ class Handles extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '621px', height: '441px', background: "url('editors/images/grid.gif')", cursor: 'default', }} /> +
{ + this.el2 = el; + }} + /> ); } @@ -258,12 +262,12 @@ class Handles extends React.Component { graph.getModel().endUpdate(); } - document.body.appendChild( + this.el2.appendChild( mxUtils.button('+', function() { graph.zoomIn(); }) ); - document.body.appendChild( + this.el2.appendChild( mxUtils.button('-', function() { graph.zoomOut(); }) diff --git a/src/pages/HelloPort.js b/src/pages/HelloPort.js index 0854a37f4..0d4fd9c60 100644 --- a/src/pages/HelloPort.js +++ b/src/pages/HelloPort.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Hello, World! example for mxGraph. This example demonstrates using + Hello, World!. This example demonstrates using the isPort hook for visually connecting to another cell. */ @@ -24,14 +24,13 @@ class HelloPort extends React.Component { // A container for the graph return ( <> -

Hello, World! example for mxGraph

+

Hello, World!

{ this.el = el; }} style={{ overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/HelloWorld.js b/src/pages/HelloWorld.js index fccb7e7ec..50dc20aef 100644 --- a/src/pages/HelloWorld.js +++ b/src/pages/HelloWorld.js @@ -2,7 +2,7 @@ * Copyright (c) 2006-2018, JGraph Ltd * Converted to ES9 syntax/React by David Morrissey 2021 * - * Hello, World! example for mxGraph. This example demonstrates using + * Hello, World!. This example demonstrates using * a DOM node to create a graph and adding vertices and edges. */ @@ -20,7 +20,7 @@ class HelloWorld extends React.Component { // A container for the graph with a grid wallpaper return ( <> -

Hello, World! example for mxGraph

+

Hello, World!

{ @@ -29,7 +29,6 @@ class HelloWorld extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/HierarchicalLayout.js b/src/pages/HierarchicalLayout.js index 7f771f9c7..a92e2a58b 100644 --- a/src/pages/HierarchicalLayout.js +++ b/src/pages/HierarchicalLayout.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Hierarchical Layout example for mxGraph. This example demonstrates the + Hierarchical Layout. This example demonstrates the use of the hierarchical and organic layouts. Note that the hierarchical layout requires another script tag in the head of the page. */ @@ -25,7 +25,7 @@ class HierarchicalLayout extends React.Component { // A container for the graph return ( <> -

Hierarchical Layout example for mxGraph

+

Hierarchical Layout

{ this.el = el; @@ -40,6 +40,11 @@ class HierarchicalLayout extends React.Component { borderTop: 'gray 1px solid', }} /> +
{ + this.el2 = el; + }} + /> ); } @@ -76,7 +81,7 @@ class HierarchicalLayout extends React.Component { mxEvent.addListener(button, 'click', function(evt) { layout.execute(parent); }); - document.body.appendChild(button); + this.el2.appendChild(button); // Adds a button to execute the layout button = document.createElement('button'); @@ -86,7 +91,7 @@ class HierarchicalLayout extends React.Component { organic.execute(parent); }); - document.body.appendChild(button); + this.el2.appendChild(button); // Load cells and layouts the graph graph.getModel().beginUpdate(); diff --git a/src/pages/HoverIcons.js b/src/pages/HoverIcons.js index 7b046e1f9..4e5de5dcb 100644 --- a/src/pages/HoverIcons.js +++ b/src/pages/HoverIcons.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Hover icons example for mxGraph. This example demonstrates showing + Hover icons. This example demonstrates showing icons on vertices as mouse hovers over them. */ @@ -23,7 +23,7 @@ class HoverIcons extends React.Component { // A container for the graph return ( <> -

Hover icons example for mxGraph

+

Hover icons

{ @@ -31,7 +31,6 @@ class HoverIcons extends React.Component { }} style={{ overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/HoverStyle.js b/src/pages/HoverStyle.js index c02687eb7..4748b09ea 100644 --- a/src/pages/HoverStyle.js +++ b/src/pages/HoverStyle.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Hoverstyle example for mxGraph. This example shows hot to change + Hoverstyle. This example shows hot to change the style of a vertex on mouseover. */ @@ -20,7 +20,7 @@ class HoverStyle extends React.Component { // A container for the graph return ( <> -

Hoverstyle example for mxGraph

+

Hoverstyle

{ this.el = el; @@ -28,7 +28,6 @@ class HoverStyle extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/HtmlLabel.js b/src/pages/HtmlLabel.js index 89a635760..85febc51a 100644 --- a/src/pages/HtmlLabel.js +++ b/src/pages/HtmlLabel.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - HTML label example for mxGraph. This example demonstrates using + HTML label. This example demonstrates using HTML labels that are connected to the state of the user object. */ @@ -19,7 +19,7 @@ class MYNAMEHERE extends React.Component { // A container for the graph return ( <> -

HTML label example for mxGraph

+

HTML label

{ diff --git a/src/pages/Images.js b/src/pages/Images.js index 0d5e3acd0..40bc341f4 100644 --- a/src/pages/Images.js +++ b/src/pages/Images.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Images example for mxGraph. This example demonstrates using + Images. This example demonstrates using background images and images for for the label- and image-shape. */ @@ -24,7 +24,7 @@ class Images extends React.Component { // A container for the graph return ( <> -

Images example for mxGraph

+

Images

{ this.el = el; @@ -32,7 +32,6 @@ class Images extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '360px', height: '200px', cursor: 'default', }} diff --git a/src/pages/Indicators.js b/src/pages/Indicators.js index 6d75d61cb..ab5f08666 100644 --- a/src/pages/Indicators.js +++ b/src/pages/Indicators.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Indicators example for mxGraph. This example demonstrates the use of + Indicators. This example demonstrates the use of indicators, which are small subshapes inside a parent shape, typically an mxLabel. */ @@ -21,7 +21,7 @@ class Indicators extends React.Component { // A container for the graph return ( <> -

Indicators example for mxGraph

+

Indicators

{ this.el = el; diff --git a/src/pages/JQuery.js b/src/pages/JQuery.js index c25db91cd..0fa06130c 100644 --- a/src/pages/JQuery.js +++ b/src/pages/JQuery.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - JQuery example for mxGraph. This example demonstrates using + JQuery. This example demonstrates using a JQuery plugin to generate labels for vertices on the fly. */ diff --git a/src/pages/JsonData.js b/src/pages/JsonData.js index 38d7fd290..a1302ecb8 100644 --- a/src/pages/JsonData.js +++ b/src/pages/JsonData.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - JSON data example for mxGraph. This example demonstrates using + JSON data. This example demonstrates using JSON to encode/decode parts of the graph model in mxCodec. */ @@ -30,7 +30,7 @@ class JsonData extends React.Component { // A container for the graph return ( <> -

JSON data example for mxGraph

+

JSON data

{ this.el = el; @@ -38,7 +38,6 @@ class JsonData extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/LOD.js b/src/pages/LOD.js index 4a61625e4..849966ac6 100644 --- a/src/pages/LOD.js +++ b/src/pages/LOD.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Level of detail example for mxGraph. This example demonstrates + Level of detail. This example demonstrates implementing a level of detail per cell. */ @@ -18,7 +18,7 @@ class LOD extends React.Component { // A container for the graph return ( <> -

Level of detail example for mxGraph

+

Level of detail

{ this.el = el; @@ -26,7 +26,6 @@ class LOD extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '621px', height: '441px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/LabelPosition.js b/src/pages/LabelPosition.js index a4def364f..4fc8a7b49 100644 --- a/src/pages/LabelPosition.js +++ b/src/pages/LabelPosition.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Label Position example for mxGraph. This example demonstrates the use of the + Label Position. This example demonstrates the use of the label position styles to set the position of vertex labels. */ @@ -17,7 +17,7 @@ class LabelPosition extends React.Component { // A container for the graph return ( <> -

Label Position example for mxGraph

+

Label Position

{ this.el = el; diff --git a/src/pages/Labels.js b/src/pages/Labels.js index 68c2d06cf..a3bc89e47 100644 --- a/src/pages/Labels.js +++ b/src/pages/Labels.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Labels example for mxGraph. This example demonstrates the use of wrapping + Labels. This example demonstrates the use of wrapping and clipping for HTML labels of vertices, truncating labels to fit the size of a vertex, and manually placing vertex labels and relative children that act as "sublabels". @@ -23,18 +23,15 @@ class Labels extends React.Component { // A container for the graph return ( <> -

Hello, World! example for mxGraph

+

Hello, World!

{ this.el = el; }} style={{ - position: 'absolute', - top: '0px', - left: '0px', + position: 'relative', overflow: 'hidden', - width: '100%', - height: '100%', + height: '300px', background: "url('editors/images/grid.gif')", }} /> diff --git a/src/pages/Layers.js b/src/pages/Layers.js index f6e3bf426..3adaedaff 100644 --- a/src/pages/Layers.js +++ b/src/pages/Layers.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Layers example for mxGraph. This example demonstrates using + Layers. This example demonstrates using multiple layers to contain cells. */ @@ -21,7 +21,7 @@ class Layers extends React.Component { // A container for the graph return ( <> -

Layers example for mxGraph

+

Layers

{ this.el = el; @@ -29,11 +29,15 @@ class Layers extends React.Component { style={{ overflow: 'hidden', position: 'relative', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", }} /> +
{ + this.el2 = el; + }} + /> ); } @@ -114,13 +118,13 @@ class Layers extends React.Component { model.endUpdate(); } - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Layer 0', function() { model.setVisible(layer0, !model.isVisible(layer0)); }) ); - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Layer 1', function() { model.setVisible(layer1, !model.isVisible(layer1)); }) diff --git a/src/pages/Map.js b/src/pages/Map.js index 685789cd6..dcc378f4a 100644 --- a/src/pages/Map.js +++ b/src/pages/Map.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Map example for mxGraph. This example demonstrates using + Map. This example demonstrates using a graph container as a Google Maps overlay. */ @@ -19,7 +19,7 @@ class MYNAMEHERE extends React.Component { // A container for the graph return ( <> -

Google maps example for mxGraph

+

Google maps

{ diff --git a/src/pages/Markers.js b/src/pages/Markers.js index f0cd1272e..4a1d15882 100644 --- a/src/pages/Markers.js +++ b/src/pages/Markers.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Markers example for mxGraph. This example demonstrates creating + Markers. This example demonstrates creating custom markers and customizing the built-in markers. */ @@ -24,7 +24,7 @@ class Markers extends React.Component { // A container for the graph return ( <> -

Markers example for mxGraph

+

Markers

{ this.el = el; @@ -32,7 +32,6 @@ class Markers extends React.Component { style={{ overflow: 'hidden', position: 'relative', - width: '641px', height: '381px', border: '1px solid gray', cursor: 'default', diff --git a/src/pages/MenuStyle.js b/src/pages/MenuStyle.js index ad648f2db..2a3d8514b 100644 --- a/src/pages/MenuStyle.js +++ b/src/pages/MenuStyle.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Menustyle example for mxGraph. This example demonstrates using + Menustyle. This example demonstrates using CSS to style the mxPopupMenu. */ @@ -19,7 +19,7 @@ class MYNAMEHERE extends React.Component { // A container for the graph return ( <> -

Menustyle example for mxGraph

+

Menustyle

{ diff --git a/src/pages/Merge.js b/src/pages/Merge.js index fa3e37cb5..938943056 100644 --- a/src/pages/Merge.js +++ b/src/pages/Merge.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Merge example for mxGraph. This example demonstrates using + Merge. This example demonstrates using the mergeChildren function to merge two graphs. */ @@ -20,7 +20,7 @@ class Merge extends React.Component { // A container for the graph return ( <> -

Merge example for mxGraph

+

Merge

{ this.el = el; diff --git a/src/pages/Monitor.js b/src/pages/Monitor.js index c09b01653..6c623a5f2 100644 --- a/src/pages/Monitor.js +++ b/src/pages/Monitor.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Monitor example for mxGraph. This eample demonstrates using a + Monitor. This eample demonstrates using a graph to display the current state of a workflow. */ @@ -32,11 +32,15 @@ class Monitor extends React.Component { style={{ overflow: 'hidden', position: 'relative', - width: '861px', height: '406px', cursor: 'default', }} /> +
{ + this.el2 = el; + }} + /> ); } @@ -92,7 +96,7 @@ class Monitor extends React.Component { codec.decode(doc.documentElement, graph.getModel()); // Creates a button to invoke the refresh function - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Update', function(evt) { // XML is normally fetched from URL at server using mxUtils.get - this is a client-side // string with randomized states to demonstrate the idea of the workflow monitor diff --git a/src/pages/Morph.js b/src/pages/Morph.js index ec8ef1a53..e82553120 100644 --- a/src/pages/Morph.js +++ b/src/pages/Morph.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Morph example for mxGraph. This example demonstrates using + Morph. This example demonstrates using mxMorphing for simple cell animations. */ @@ -21,7 +21,7 @@ class Morph extends React.Component { // A container for the graph return ( <> -

Hello, World! example for mxGraph

+

Hello, World!

{ this.el = el; @@ -29,12 +29,16 @@ class Morph extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', }} /> +
{ + this.el2 = el; + }} + /> ); } @@ -68,7 +72,7 @@ class Morph extends React.Component { let mult = 1; - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Morph', function() { graph.clearSelection(); diff --git a/src/pages/OffPage.js b/src/pages/OffPage.js index 4b0228507..4b794778c 100644 --- a/src/pages/OffPage.js +++ b/src/pages/OffPage.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Offpage example for mxGraph. This example demonstrates creating + Offpage. This example demonstrates creating offpage connectors in a graph and loading a new diagram on a single click. */ @@ -22,7 +22,7 @@ class OffPage extends React.Component { // A container for the graph return ( <> -

Offpage connector example for mxGraph

+

Offpage connector

{ diff --git a/src/pages/OrgChart.js b/src/pages/OrgChart.js index 24872f058..b242437a6 100644 --- a/src/pages/OrgChart.js +++ b/src/pages/OrgChart.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Orgchart example for mxGraph. This example demonstrates using + Orgchart. This example demonstrates using automatic layouts, fit to page zoom and poster print (across multiple pages). */ @@ -34,7 +34,7 @@ class OrgChart extends React.Component { // A container for the graph return ( <> -

Orgchart example for mxGraph

+

Orgchart

{ this.el = el; diff --git a/src/pages/Orthogonal.js b/src/pages/Orthogonal.js index 4aa19ca72..fd73c1280 100644 --- a/src/pages/Orthogonal.js +++ b/src/pages/Orthogonal.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Orthogonal example for mxGraph. This example demonstrates the use + Orthogonal. This example demonstrates the use of port constraints and orthogonal edge styles and handlers. */ @@ -26,7 +26,7 @@ class Orthogonal extends React.Component { // A container for the graph return ( <> -

Orthogonal example for mxGraph

+

Orthogonal

{ this.el = el; @@ -34,7 +34,6 @@ class Orthogonal extends React.Component { style={{ overflow: 'hidden', position: 'relative', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/Overlays.js b/src/pages/Overlays.js index a2ca0738b..6af1db609 100644 --- a/src/pages/Overlays.js +++ b/src/pages/Overlays.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Overlays example for mxGraph. This example demonstrates cell + Overlays. This example demonstrates cell highlighting, overlays and handling click and double click events. See also: events.html for more event handling. */ @@ -23,7 +23,7 @@ class Overlays extends React.Component { // A container for the graph return ( <> -

Overlays example for mxGraph

+

Overlays

{ this.el = el; @@ -31,7 +31,6 @@ class Overlays extends React.Component { style={{ overflow: 'hidden', position: 'relative', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", }} diff --git a/src/pages/PageBreaks.js b/src/pages/PageBreaks.js index 9787f3c67..34be06d7c 100644 --- a/src/pages/PageBreaks.js +++ b/src/pages/PageBreaks.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Pagebreaks example for mxGraph. This example demonstrates using the + Pagebreaks. This example demonstrates using the pageBreaksVisible and preferPageSize switches and adding headers and footers to print output. */ @@ -23,7 +23,7 @@ class PageBreaks extends React.Component { // A container for the graph return ( <> -

Pagebreaks example for mxGraph

+

Pagebreaks

{ @@ -32,12 +32,16 @@ class PageBreaks extends React.Component { style={{ overflow: 'hidden', position: 'relative', - width: '641px', height: '481px', background: "url('editors/images/grid.gif')", cursor: 'default', }} /> +
{ + this.el2 = el; + }} + /> ); } @@ -90,26 +94,26 @@ class PageBreaks extends React.Component { graph.getModel().endUpdate(); } - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Toggle Page Breaks', function(evt) { graph.pageBreaksVisible = !graph.pageBreaksVisible; graph.sizeDidChange(); }) ); - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Zoom In', function(evt) { graph.zoomIn(); }) ); - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Zoom Out', function(evt) { graph.zoomOut(); }) ); - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Print', function(evt) { // Matches actual printer paper size and avoids blank pages const scale = 0.5; @@ -172,7 +176,7 @@ class PageBreaks extends React.Component { }) ); - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Reset View', function(evt) { graph.view.scaleAndTranslate(0.15, 0, 0); }) diff --git a/src/pages/Perimeter.js b/src/pages/Perimeter.js index 06c5bc185..4fa319980 100644 --- a/src/pages/Perimeter.js +++ b/src/pages/Perimeter.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Perimeter example for mxGraph. This example demonstrates how to + Perimeter. This example demonstrates how to avoid edge and label intersections. */ @@ -21,7 +21,7 @@ class Perimeter extends React.Component { // A container for the graph return ( <> -

Perimeter example for mxGraph

+

Perimeter

{ this.el = el; @@ -29,7 +29,6 @@ class Perimeter extends React.Component { style={{ overflow: 'hidden', position: 'relative', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/Permissions.js b/src/pages/Permissions.js index 94a49876a..b75fbe543 100644 --- a/src/pages/Permissions.js +++ b/src/pages/Permissions.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Hello, World! example for mxGraph. This example demonstrates creating + Hello, World!. This example demonstrates creating permissions to define the available operations a the graph. */ @@ -35,13 +35,18 @@ class Permissions extends React.Component { // A container for the graph return ( <> -

Permissions example for mxGraph

+

Permissions

{ this.el = el; }} - style={{}} + style={{ + position: 'relative', + overflow: 'hidden', + height: '300px', + //background: "url('editors/images/grid.gif')", + }} /> ); diff --git a/src/pages/PortRefs.js b/src/pages/PortRefs.js index 7f2043cda..7e25f6165 100644 --- a/src/pages/PortRefs.js +++ b/src/pages/PortRefs.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Portsrefs example for mxGraph. This example demonstrates referencing + Portsrefs. This example demonstrates referencing connection points by ID. The main difference to the implementation where the connection point is stored in the connecting edge is that changes to the original port will be reflected in all existing @@ -39,7 +39,6 @@ class PortRefs extends React.Component { style={{ overflow: 'hidden', position: 'relative', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/Ports.js b/src/pages/Ports.js index 3186e41bd..856eb54bd 100644 --- a/src/pages/Ports.js +++ b/src/pages/Ports.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Ports example for mxGraph. This example demonstrates implementing + Ports. This example demonstrates implementing ports as child vertices with relative positions and drag and drop as well as the use of images and HTML in cells. */ @@ -11,7 +11,7 @@ import mxEvent from '../mxgraph/util/mxEvent'; import mxGraph from '../mxgraph/view/mxGraph'; import mxRubberband from '../mxgraph/handler/mxRubberband'; -class MYNAMEHERE extends React.Component { +class Ports extends React.Component { constructor(props) { super(props); } @@ -39,7 +39,7 @@ class MYNAMEHERE extends React.Component { }; } -export default MYNAMEHERE; +export default Ports; diff --git a/src/pages/RadialTreeLayout.js b/src/pages/RadialTreeLayout.js index 305052109..766e083cc 100644 --- a/src/pages/RadialTreeLayout.js +++ b/src/pages/RadialTreeLayout.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2014, JGraph Ltd - Hierarchical Layout example for mxGraph. This example demonstrates the + Hierarchical Layout. This example demonstrates the use of the hierarchical and organic layouts. Note that the hierarchical layout requires another script tag in the head of the page. */ @@ -22,7 +22,7 @@ class RadialTreeLayout extends React.Component { // A container for the graph return ( <> -

Hierarchical Layout example for mxGraph

+

Hierarchical Layout

{ this.el = el; @@ -31,7 +31,6 @@ class RadialTreeLayout extends React.Component { position: 'relative', overflow: 'auto', height: '800px', - width: '1000px', borderTop: 'gray 1px solid', }} /> diff --git a/src/pages/Resources.js b/src/pages/Resources.js index edd23d8a3..2991df0cc 100644 --- a/src/pages/Resources.js +++ b/src/pages/Resources.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2018, JGraph Ltd - Resources example for mxGraph. This example demonstrates disabling the Synchronous + Resources. This example demonstrates disabling the Synchronous XMLHttpRequest on main thread warning. */ @@ -20,7 +20,7 @@ class Resources extends React.Component { // A container for the graph return ( <> -

Resources example for mxGraph

+

Resources

{ @@ -29,7 +29,6 @@ class Resources extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/Schema.js b/src/pages/Schema.js index 0ea3be700..b1c59b344 100644 --- a/src/pages/Schema.js +++ b/src/pages/Schema.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Schema example for mxGraph. This example demonstrates implementing + Schema. This example demonstrates implementing a SQL schema editor. */ diff --git a/src/pages/Scrollbars.js b/src/pages/Scrollbars.js index 835a93921..c525e2be8 100644 --- a/src/pages/Scrollbars.js +++ b/src/pages/Scrollbars.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2015, JGraph Ltd - Scrollbars example for mxGraph. This example demonstrates using + Scrollbars. This example demonstrates using a scrollable table with different sections in a cell label. */ @@ -19,7 +19,7 @@ class MYNAMEHERE extends React.Component { // A container for the graph return ( <> -

Scrollbars example for mxGraph

+

Scrollbars

{ diff --git a/src/pages/SecondLabel.js b/src/pages/SecondLabel.js index 111d62baa..dcbab5832 100644 --- a/src/pages/SecondLabel.js +++ b/src/pages/SecondLabel.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Second label example for mxGraph. This example demonstrates how to + Second label. This example demonstrates how to add another string label to vertices. */ @@ -23,7 +23,7 @@ class SecondLabel extends React.Component { // A container for the graph return ( <> -

Second label example for mxGraph

+

Second label

{ @@ -32,11 +32,15 @@ class SecondLabel extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", }} /> +
{ + this.el2 = el; + }} + /> ); } @@ -221,21 +225,19 @@ class SecondLabel extends React.Component { } // Adds a button to execute the layout - document.body.insertBefore( + this.el2.appendChild( mxUtils.button('Toggle Child Vertices', function(evt) { relativeChildVerticesVisible = !relativeChildVerticesVisible; graph.refresh(); - }), - document.body.firstChild + }) ); // Adds a button to execute the layout - document.body.insertBefore( + this.el2.appendChild( mxUtils.button('Toggle IDs', function(evt) { secondLabelVisible = !secondLabelVisible; graph.refresh(); - }), - document.body.firstChild + }) ); } } diff --git a/src/pages/ServerView.js b/src/pages/ServerView.js index e8d9cddce..74e300351 100644 --- a/src/pages/ServerView.js +++ b/src/pages/ServerView.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Server-View example for mxGraph. This example demonstrates using + Server-View. This example demonstrates using a server-side image of the graph as the diagram in the client. This may be used to improve drawing-speed in older browser and on devices with slower processors. diff --git a/src/pages/Shape.js b/src/pages/Shape.js index bea4f83c4..f54a8478f 100644 --- a/src/pages/Shape.js +++ b/src/pages/Shape.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Shape example for mxGraph. This example demonstrates how to + Shape. This example demonstrates how to implement and use a custom shape. */ @@ -20,7 +20,7 @@ class Shape extends React.Component { // A container for the graph return ( <> -

Shape example for mxGraph

+

Shape

{ @@ -28,7 +28,6 @@ class Shape extends React.Component { }} style={{ overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", }} diff --git a/src/pages/ShowRegion.js b/src/pages/ShowRegion.js index 71acb87af..d84eb1879 100644 --- a/src/pages/ShowRegion.js +++ b/src/pages/ShowRegion.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Showregion example for mxGraph. This example demonstrates using a custom + Showregion. This example demonstrates using a custom rubberband handler to show the selected region in a new window. */ @@ -9,6 +9,10 @@ import React from 'react'; import mxEvent from '../mxgraph/util/mxEvent'; import mxGraph from '../mxgraph/view/mxGraph'; import mxRubberband from '../mxgraph/handler/mxRubberband'; +import mxConstants from "../mxgraph/util/mxConstants"; +import mxPopupMenu from "../mxgraph/util/mxPopupMenu"; +import mxRectangle from "../mxgraph/util/mxRectangle"; +import mxUtils from "../mxgraph/util/mxUtils"; class MYNAMEHERE extends React.Component { constructor(props) { @@ -19,7 +23,7 @@ class MYNAMEHERE extends React.Component { // A container for the graph return ( <> -

Showregion example for mxGraph

+

Showregion

{ @@ -90,7 +94,7 @@ export default MYNAMEHERE; else { // Disables built-in context menu - mxEvent.disableContextMenu(document.body); + mxEvent.disableContextMenu(this.el); // Changes some default colors mxConstants.HANDLE_FILLCOLOR = '#99ccff'; diff --git a/src/pages/Stencils.js b/src/pages/Stencils.js index c22ae8779..d107c57fd 100644 --- a/src/pages/Stencils.js +++ b/src/pages/Stencils.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Stencils example for mxGraph. This example demonstrates using + Stencils. This example demonstrates using an XML file to define new stencils to be used as shapes. See docs/stencils.xsd for the XML schema file. */ @@ -31,7 +31,7 @@ class Stencils extends React.Component { // A container for the graph return ( <> -

Stencils example for mxGraph

+

Stencils

{ this.el = el; @@ -39,7 +39,6 @@ class Stencils extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '601px', height: '401px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/Stylesheet.js b/src/pages/Stylesheet.js index 68bd3456c..f0d9715c3 100644 --- a/src/pages/Stylesheet.js +++ b/src/pages/Stylesheet.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Stylesheet example for mxGraph. This example demonstrates using + Stylesheet. This example demonstrates using a custom stylesheet and control points in edges, as well as overriding the getLabel and getTooltip function to return dynamic information, and making a supercall in JavaScript. @@ -22,7 +22,7 @@ class Stylesheet extends React.Component { // A container for the graph return ( <> -

Stylesheet example for mxGraph

+

Stylesheet

{ this.el = el; @@ -30,7 +30,6 @@ class Stylesheet extends React.Component { style={{ overflow: 'hidden', position: 'relative', - width: '621px', height: '311px', cursor: 'default', }} diff --git a/src/pages/SwimLanes.js b/src/pages/SwimLanes.js index b43ea992c..9d247d425 100644 --- a/src/pages/SwimLanes.js +++ b/src/pages/SwimLanes.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Swimlanes example for mxGraph. This example demonstrates using + Swimlanes. This example demonstrates using swimlanes for pools and lanes and adding cells and edges between them. This also demonstrates using the stack layout as an automatic layout. @@ -33,8 +33,7 @@ class SwimLanes extends React.Component { // A container for the graph return ( <> -

Swimlanes example for mxGraph

- +

Swimlanes

{ this.el = el; @@ -42,7 +41,6 @@ class SwimLanes extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '600px', height: '400px', border: 'gray dotted 1px', cursor: 'default', diff --git a/src/pages/Template.js b/src/pages/Template.js index d96bcdbe5..2f4b11e6c 100644 --- a/src/pages/Template.js +++ b/src/pages/Template.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Template example for mxGraph. This is used as a template HTML file by the + Template. This is used as a template HTML file by the backends to demonstrate the deployment of the client with a graph embedded in the page as XML data (see graph variable in the onload-handler). @@ -31,7 +31,6 @@ class Template extends React.Component { style={{ overflow: 'hidden', position: 'relative', - width: '321px', height: '241px', background: "url('/mxgraph/javascript/examples/editors/images/grid.gif')", cursor: 'default' diff --git a/src/pages/Thread.js b/src/pages/Thread.js index 916cafd2c..cb0dcd75a 100644 --- a/src/pages/Thread.js +++ b/src/pages/Thread.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Thread example for mxGraph. This example demonstrates setting + Thread. This example demonstrates setting overlays in mxGraph from within a timed function. */ @@ -17,14 +17,13 @@ class Thread extends React.Component { // A container for the graph return ( <> -

Thread example for mxGraph

+

Thread

{ this.el = el; }} style={{ overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", }} diff --git a/src/pages/Toolbar.js b/src/pages/Toolbar.js index dc6614f6f..534dd4b51 100644 --- a/src/pages/Toolbar.js +++ b/src/pages/Toolbar.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Toolbar example for mxGraph. This example demonstrates using + Toolbar. This example demonstrates using existing cells as templates for creating new cells. */ @@ -27,7 +27,7 @@ class Toolbar extends React.Component { // A container for the graph return ( <> -

Toolbar example for mxGraph

+

Toolbar

{ @@ -36,12 +36,16 @@ class Toolbar extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '600px', height: '400px', border: 'gray dotted 1px', cursor: 'default', }} /> +
{ + this.el2 = el; + }} + /> ); } @@ -160,11 +164,7 @@ class Toolbar extends React.Component { } ); - button.style.position = 'absolute'; - button.style.left = '2px'; - button.style.top = '2px'; - - document.body.appendChild(button); + this.el2.appendChild(button); } addToolbarItem(graph, toolbar, prototype, image) { diff --git a/src/pages/Touch.js b/src/pages/Touch.js index 871d81eea..8a4ce36f2 100644 --- a/src/pages/Touch.js +++ b/src/pages/Touch.js @@ -2,7 +2,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - Touch example for mxGraph. This example demonstrates handling of touch, + Touch. This example demonstrates handling of touch, mouse and pointer events. */ @@ -20,7 +20,7 @@ class MYNAMEHERE extends React.Component { // A container for the graph return ( <> -

Touch example for mxGraph

+

Touch

{ diff --git a/src/pages/Tree.js b/src/pages/Tree.js index 3e2d64521..ed1273216 100644 --- a/src/pages/Tree.js +++ b/src/pages/Tree.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Tree example for mxGraph. This example demonstrates folding + * Tree. This example demonstrates folding * of subtrees in a acyclic graph (tree). */ @@ -30,7 +30,7 @@ class Tree extends React.Component { // A container for the graph return ( <> -

Tree example for mxGraph

+

Tree

{ @@ -39,7 +39,6 @@ class Tree extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '500px', height: '400px', background: "url('editors/images/grid.gif')", cursor: 'default' diff --git a/src/pages/UIConfig.js b/src/pages/UIConfig.js index 53b6bb1c0..3187b8fe4 100644 --- a/src/pages/UIConfig.js +++ b/src/pages/UIConfig.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - UIConfig example for mxGraph. This example demonstrates using a config + UIConfig. This example demonstrates using a config file to configure the toolbar and popup menu in mxEditor. */ diff --git a/src/pages/UserObject.js b/src/pages/UserObject.js index 6206551f3..3d3c31950 100644 --- a/src/pages/UserObject.js +++ b/src/pages/UserObject.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd - User object example for mxGraph. This example demonstrates using + User object. This example demonstrates using XML objects as values for cells. */ @@ -26,7 +26,7 @@ class UserObject extends React.Component { // A container for the graph return ( <> -

User object example for mxGraph

+

User object

+ +
{this.el2 = el;}} + /> ); } @@ -179,7 +182,7 @@ class UserObject extends React.Component { new mxRubberband(graph); // Adds an option to view the XML of the graph - document.body.appendChild( + this.el2.appendChild( mxUtils.button('View XML', function() { const encoder = new mxCodec(); const node = encoder.encode(graph.getModel()); diff --git a/src/pages/Validation.js b/src/pages/Validation.js index 88bb7fae6..a03143b9e 100644 --- a/src/pages/Validation.js +++ b/src/pages/Validation.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Validation example for mxGraph. This example demonstrates using + * Validation. This example demonstrates using * multiplicities for automatically validating a graph. */ @@ -23,7 +23,7 @@ class Validation extends React.Component { // A container for the graph return ( <> -

Validation example for mxGraph

+

Validation

{ @@ -32,7 +32,6 @@ class Validation extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '281px', background: "url('editors/images/grid.gif')", cursor: 'default', diff --git a/src/pages/Visibility.js b/src/pages/Visibility.js index 886ccf349..bd677409c 100644 --- a/src/pages/Visibility.js +++ b/src/pages/Visibility.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Visible example for mxGraph. This example demonstrates using + * Visible. This example demonstrates using * various solutions for hiding and showing cells. */ @@ -19,7 +19,7 @@ class Visibility extends React.Component { // A container for the graph return ( <> -

Visibility example for mxGraph

+

Visibility

{ this.el = el; @@ -27,12 +27,16 @@ class Visibility extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '321px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default', }} /> +
{ + this.el2 = el; + }} + /> ); } @@ -79,19 +83,19 @@ class Visibility extends React.Component { } // Dynamic conditions (requires refresh) - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Cond 1', function() { showOne = !showOne; graph.refresh(); }) ); - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Cond 2', function() { showTwo = !showTwo; graph.refresh(); }) ); - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Cond 3', function() { showThree = !showThree; graph.refresh(); @@ -99,7 +103,7 @@ class Visibility extends React.Component { ); // Explicit show/hide - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Toggle cell', function() { graph.toggleCells(!graph.getModel().isVisible(v1), [v1], true); }) @@ -108,7 +112,7 @@ class Visibility extends React.Component { // Explicit remove/add let removed = null; - document.body.appendChild( + this.el2.appendChild( mxUtils.button('Add/remove cell', function() { if (removed != null) { graph.addCells(removed); diff --git a/src/pages/Windows.js b/src/pages/Windows.js index 3835d6664..d5cc1d685 100644 --- a/src/pages/Windows.js +++ b/src/pages/Windows.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Windows example for mxGraph. This example demonstrates using + * Windows. This example demonstrates using * the mxWindow class for displaying windows. */ @@ -23,7 +23,7 @@ class Windows extends React.Component { // A container for the graph return ( <> -

Windows example for mxGraph

+

Windows

{ this.el = el; @@ -31,7 +31,6 @@ class Windows extends React.Component { style={{ overflow: 'auto', position: 'relative', - width: '500px', height: '500px', background: 'lightyellow', cursor: 'default', diff --git a/src/pages/Wrapping.js b/src/pages/Wrapping.js index c5611ab6f..1bc3d251e 100644 --- a/src/pages/Wrapping.js +++ b/src/pages/Wrapping.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2006-2013, JGraph Ltd * - * Wrapping example for mxGraph. This example demonstrates using HTML markup and + * Wrapping. This example demonstrates using HTML markup and * word-wrapping in vertex and edge labels. */ @@ -17,7 +17,7 @@ class Wrapping extends React.Component { // A container for the graph return ( <> -

Wrapping example for mxGraph

+

Wrapping

{ @@ -26,7 +26,6 @@ class Wrapping extends React.Component { style={{ position: 'relative', overflow: 'hidden', - width: '341px', height: '241px', background: "url('editors/images/grid.gif')", cursor: 'default',