diff --git a/src/pages/xml_json/Resources.js b/src/pages/xml_json/Resources.js deleted file mode 100644 index 1b3f04b2c..000000000 --- a/src/pages/xml_json/Resources.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (c) 2006-2018, JGraph Ltd - - - */ - -import React from 'react'; -import mxEvent from '../../mxgraph/util/event/mxEvent'; -import mxGraph from '../../mxgraph/view/graph/mxGraph'; -import mxRubberband from '../../mxgraph/handler/mxRubberband'; -import mxClient from '../../mxgraph/mxClient'; - -class Resources extends React.Component { - constructor(props) { - super(props); - } - - render() { - // A container for the graph - return ( - <> -

Resources

- This example demonstrates disabling the Synchronous XMLHttpRequest on - main thread warning. -
{ - this.el = el; - }} - style={{ - position: 'relative', - overflow: 'hidden', - height: '241px', - background: "url('editors/images/grid.gif')", - cursor: 'default', - }} - /> - - ); - } - - componentDidMount() { - // Async indirection to load resources asynchronously (see above) - // Alternatively you can remove the line that sets mxLoadResources - // anove and change the code to not use this callback. - - mxClient.loadResources(() => { - // Disables the built-in context menu - mxEvent.disableContextMenu(this.el); - - // Creates the graph inside the given container - const graph = new mxGraph(this.el); - - // Enables rubberband selection - new mxRubberband(graph); - - // Gets the default parent for inserting new cells. This - // is normally the first child of the root (ie. layer 0). - const parent = graph.getDefaultParent(); - - // Adds cells to the model in a single step - graph.getModel().beginUpdate(); - try { - const v1 = graph.insertVertex(parent, null, 'Hello,', 20, 20, 80, 30); - const v2 = graph.insertVertex(parent, null, 'World!', 200, 150, 80, 30); - const e1 = graph.insertEdge(parent, null, '', v1, v2); - } finally { - // Updates the display - graph.getModel().endUpdate(); - } - }); - } -} - -export default Resources; diff --git a/src/pages/xml_json/index.js b/src/pages/xml_json/index.js index 374e3dbc2..10989af2b 100644 --- a/src/pages/xml_json/index.js +++ b/src/pages/xml_json/index.js @@ -1,7 +1,6 @@ import React from 'react'; import Preview from '../Previews'; import JsonData from './JsonData'; -import Resources from './Resources'; import UserObject from './UserObject'; import PageTabs from '../PageTabs'; @@ -9,7 +8,6 @@ export default function _XMLJSON() { return ( } /> - } /> } /> );