reorganize directory structure and converting to typescript

development
mcyph 2021-04-03 15:32:02 +11:00
parent e84c441c53
commit 1d29e57258
31 changed files with 126 additions and 90 deletions

View File

@ -1,6 +1,8 @@
{ {
"extends": "@ijsto", "extends": "@ijsto",
"rules": { "rules": {
"newIsCap": false "newIsCap": 0,
"indent": ["error", 2, {"FunctionDeclaration": {"parameters": "first"},
"FunctionExpression": {"parameters": "first"}}]
} }
} }

View File

@ -14,17 +14,17 @@ import mxText from '../../shape/mxText';
class mxCellState extends mxRectangle { class mxCellState extends mxRectangle {
// TODO: Document me!! // TODO: Document me!!
cellBounds: mxRectangle; cellBounds: mxRectangle | undefined;
paintBounds: mxRectangle; paintBounds: mxRectangle | undefined;
boundingBox: mxRectangle; boundingBox: mxRectangle | undefined;
// Used by mxCellRenderer's createControl() // Used by mxCellRenderer's createControl()
control: mxShape; control: mxShape | undefined;
// Used by mxCellRenderer's createCellOverlays() // Used by mxCellRenderer's createCellOverlays()
overlays: any[]; overlays: any[] | null | undefined;
/** /**
* Variable: view * Variable: view
@ -76,7 +76,7 @@ class mxCellState extends mxRectangle {
* Holds an array of <mxPoints> that represent the absolute points of an * Holds an array of <mxPoints> that represent the absolute points of an
* edge. * edge.
*/ */
absolutePoints: mxPoint[] | null = null; absolutePoints: (mxPoint | null)[] | null = null;
/** /**
* Variable: absoluteOffset * Variable: absoluteOffset
@ -336,7 +336,7 @@ class mxCellState extends mxRectangle {
* Returns the unscaled, untranslated bounds. * Returns the unscaled, untranslated bounds.
*/ */
getCellBounds(): mxRectangle { getCellBounds(): mxRectangle {
return this.cellBounds; return <mxRectangle>this.cellBounds;
} }
/** /**
@ -347,7 +347,7 @@ class mxCellState extends mxRectangle {
* isPaintBoundsInverted returns true. * isPaintBoundsInverted returns true.
*/ */
getPaintBounds(): mxRectangle { getPaintBounds(): mxRectangle {
return this.paintBounds; return <mxRectangle>this.paintBounds;
} }
/** /**
@ -356,8 +356,10 @@ class mxCellState extends mxRectangle {
* Updates the cellBounds and paintBounds. * Updates the cellBounds and paintBounds.
*/ */
updateCachedBounds(): void { updateCachedBounds(): void {
const tr = this.view.translate; const view = <mxGraphView>this.view;
const s = this.view.scale;
const tr = view.translate;
const s = view.scale;
this.cellBounds = new mxRectangle( this.cellBounds = new mxRectangle(
this.x / s - tr.x, this.x / s - tr.x,
this.y / s - tr.y, this.y / s - tr.y,
@ -401,14 +403,14 @@ class mxCellState extends mxRectangle {
* Returns a clone of this <mxPoint>. * Returns a clone of this <mxPoint>.
*/ */
clone(): mxCellState { clone(): mxCellState {
const clone = new mxCellState(this.view, this.cell, this.style); const clone = new mxCellState(<mxGraphView>this.view, <mxCell>this.cell, this.style);
// Clones the absolute points // Clones the absolute points
if (this.absolutePoints != null) { if (this.absolutePoints != null) {
clone.absolutePoints = []; clone.absolutePoints = [];
for (let i = 0; i < this.absolutePoints.length; i += 1) { for (let i = 0; i < this.absolutePoints.length; i += 1) {
clone.absolutePoints[i] = this.absolutePoints[i].clone(); clone.absolutePoints[i] = (<mxPoint[]>this.absolutePoints)[i].clone();
} }
} }
@ -443,7 +445,7 @@ class mxCellState extends mxRectangle {
* Destroys the state and all associated resources. * Destroys the state and all associated resources.
*/ */
destroy(): void { destroy(): void {
this.view.graph.cellRenderer.destroy(this); (<mxGraphView>this.view).graph.cellRenderer.destroy(this);
} }
} }

View File

@ -218,7 +218,7 @@ class mxCell {
* *
* Returns the Id of the cell as a string. * Returns the Id of the cell as a string.
*/ */
getId(): number { getId(): number | null {
return this.id; return this.id;
} }
@ -279,7 +279,7 @@ class mxCell {
* *
* Sets the <mxGeometry> to be used as the <geometry>. * Sets the <mxGeometry> to be used as the <geometry>.
*/ */
setGeometry(geometry: mxGeometry): void { setGeometry(geometry: mxGeometry | null): void {
this.geometry = geometry; this.geometry = geometry;
} }
@ -297,7 +297,7 @@ class mxCell {
* *
* Sets the string to be used as the <style>. * Sets the string to be used as the <style>.
*/ */
setStyle(style: string): void { setStyle(style: string | null): void {
this.style = style; this.style = style;
} }

View File

@ -92,11 +92,11 @@ class mxCellPath {
* path - String that defines the path. * path - String that defines the path.
*/ */
static resolve(root: mxCell, path: string): mxCell | null { static resolve(root: mxCell, path: string): mxCell | null {
let parent = root; let parent: mxCell | null | undefined = root;
if (path != null) { if (path != null) {
const tokens = path.split(mxCellPath.PATH_SEPARATOR); const tokens = path.split(mxCellPath.PATH_SEPARATOR);
for (let i = 0; i < tokens.length; i += 1) { for (let i = 0; i < tokens.length; i += 1) {
parent = parent.getChildAt(parseInt(tokens[i])); parent = parent?.getChildAt(parseInt(tokens[i])) || null;
} }
} }
return parent; return parent;

View File

@ -63,7 +63,7 @@ class mxCellRenderer {
* *
* Defines the default shape for labels. Default is <mxText>. * Defines the default shape for labels. Default is <mxText>.
*/ */
defaultTextShape: typeof mxShape = mxText; defaultTextShape: typeof mxText = mxText;
/** /**
* Variable: legacyControlPosition * Variable: legacyControlPosition
@ -1642,7 +1642,7 @@ class mxCellRenderer {
* Invokes redraw on the shape of the given state. * Invokes redraw on the shape of the given state.
*/ */
doRedrawShape(state: mxCellState) { doRedrawShape(state: mxCellState) {
state.shape.redraw(); state.shape?.redraw();
} }
/** /**
@ -1650,7 +1650,8 @@ class mxCellRenderer {
* *
* Returns true if the given shape must be repainted. * Returns true if the given shape must be repainted.
*/ */
isShapeInvalid(state, shape) { isShapeInvalid(state: mxCellState,
shape: mxShape): boolean {
return ( return (
shape.bounds == null || shape.bounds == null ||
shape.scale !== state.view.scale || shape.scale !== state.view.scale ||

View File

@ -13,6 +13,7 @@ import mxDictionary from '../../util/datatypes/mxDictionary';
import mxGraphView from '../graph/mxGraphView'; import mxGraphView from '../graph/mxGraphView';
import mxCell from './mxCell'; import mxCell from './mxCell';
import mxCellState from '../../util/datatypes/mxCellState'; import mxCellState from '../../util/datatypes/mxCellState';
import mxShape from "../../shape/mxShape";
class mxTemporaryCellStates { class mxTemporaryCellStates {
oldValidateCellState: Function | null; oldValidateCellState: Function | null;
@ -27,7 +28,7 @@ class mxTemporaryCellStates {
/** /**
* Variable: oldStates * Variable: oldStates
*/ */
oldStates: mxCellState | null = null; oldStates: mxDictionary | null = null;
/** /**
* Variable: oldBounds * Variable: oldBounds
@ -59,10 +60,11 @@ class mxTemporaryCellStates {
// Overrides doRedrawShape and paint shape to add links on shapes // Overrides doRedrawShape and paint shape to add links on shapes
if (getLinkForCellState != null) { if (getLinkForCellState != null) {
view.graph.cellRenderer.doRedrawShape = state => { view.graph.cellRenderer.doRedrawShape = (state: mxCellState) => {
const oldPaint = state.shape.paint; const shape = <mxShape>state?.shape;
const oldPaint = shape.paint;
state.shape.paint = c => { shape.paint = c => {
const link = getLinkForCellState(state); const link = getLinkForCellState(state);
if (link != null) { if (link != null) {
c.setLink(link); c.setLink(link);
@ -73,15 +75,15 @@ class mxTemporaryCellStates {
} }
}; };
self.oldDoRedrawShape.apply(view.graph.cellRenderer, [state]); (<Function>self.oldDoRedrawShape).apply(view.graph.cellRenderer, [state]);
state.shape.paint = oldPaint; shape.paint = oldPaint;
}; };
} }
// Overrides validateCellState to ignore invisible cells // Overrides validateCellState to ignore invisible cells
view.validateCellState = (cell, recurse) => { view.validateCellState = (cell, recurse) => {
if (cell == null || isCellVisibleFn == null || isCellVisibleFn(cell)) { if (cell == null || isCellVisibleFn == null || isCellVisibleFn(cell)) {
return self.oldValidateCellState.apply(view, [cell, recurse]); return (<Function>self.oldDoRedrawShape).apply(view, [cell, recurse]);
} }
return null; return null;
}; };
@ -116,11 +118,14 @@ class mxTemporaryCellStates {
* Returns the top, left corner as a new <mxPoint>. * Returns the top, left corner as a new <mxPoint>.
*/ */
destroy(): void { destroy(): void {
this.view.setScale(this.oldScale); const view = <mxGraphView>this.view;
this.view.setStates(this.oldStates); view.setScale(this.oldScale);
this.view.setGraphBounds(this.oldBounds); view.setStates(this.oldStates);
this.view.validateCellState = this.oldValidateCellState; view.setGraphBounds(<mxRectangle>this.oldBounds);
this.view.graph.cellRenderer.doRedrawShape = this.oldDoRedrawShape; // @ts-ignore
view.validateCellState = <Function>this.oldValidateCellState;
// @ts-ignore
view.graph.cellRenderer.doRedrawShape = <Function>this.oldDoRedrawShape;
} }
} }

View File

@ -17,6 +17,7 @@ import mxEventObject from '../../util/event/mxEventObject';
import mxCell from '../cell/mxCell'; import mxCell from '../cell/mxCell';
import mxGraph from './mxGraph'; import mxGraph from './mxGraph';
import mxRectangle from '../../util/datatypes/mxRectangle'; import mxRectangle from '../../util/datatypes/mxRectangle';
import mxMouseEvent from "../../util/event/mxMouseEvent";
class mxLayoutManager extends mxEventSource { class mxLayoutManager extends mxEventSource {
/** /**
@ -97,21 +98,21 @@ class mxLayoutManager extends mxEventSource {
super(); super();
// Executes the layout before the changes are dispatched // Executes the layout before the changes are dispatched
this.undoHandler = (sender, evt) => { this.undoHandler = (sender: any, evt: mxEventObject) => {
if (this.isEnabled()) { if (this.isEnabled()) {
this.beforeUndo(evt.getProperty('edit')); this.beforeUndo(evt.getProperty('edit'));
} }
}; };
// Notifies the layout of a move operation inside a parent // Notifies the layout of a move operation inside a parent
this.moveHandler = (sender, evt) => { this.moveHandler = (sender: any, evt: mxEventObject) => {
if (this.isEnabled()) { if (this.isEnabled()) {
this.cellsMoved(evt.getProperty('cells'), evt.getProperty('event')); this.cellsMoved(evt.getProperty('cells'), evt.getProperty('event'));
} }
}; };
// Notifies the layout of a move operation inside a parent // Notifies the layout of a move operation inside a parent
this.resizeHandler = (sender, evt) => { this.resizeHandler = (sender: any, evt: mxEventObject) => {
if (this.isEnabled()) { if (this.isEnabled()) {
this.cellsResized( this.cellsResized(
evt.getProperty('cells'), evt.getProperty('cells'),
@ -144,7 +145,7 @@ class mxLayoutManager extends mxEventSource {
* *
* enabled - Boolean that specifies the new enabled state. * enabled - Boolean that specifies the new enabled state.
*/ */
setEnabled(enabled) { setEnabled(enabled: boolean) {
this.enabled = enabled; this.enabled = enabled;
} }
@ -155,7 +156,7 @@ class mxLayoutManager extends mxEventSource {
* should be executed whenever a cell layout (layout of the children of * should be executed whenever a cell layout (layout of the children of
* a cell) has been executed. This implementation returns <bubbling>. * a cell) has been executed. This implementation returns <bubbling>.
*/ */
isBubbling() { isBubbling(): boolean {
return this.bubbling; return this.bubbling;
} }
@ -164,7 +165,7 @@ class mxLayoutManager extends mxEventSource {
* *
* Sets <bubbling>. * Sets <bubbling>.
*/ */
setBubbling(value) { setBubbling(value: boolean): void {
this.bubbling = value; this.bubbling = value;
} }
@ -173,7 +174,7 @@ class mxLayoutManager extends mxEventSource {
* *
* Returns the graph that this layout operates on. * Returns the graph that this layout operates on.
*/ */
getGraph() { getGraph(): mxGraph | null {
return this.graph; return this.graph;
} }
@ -182,7 +183,7 @@ class mxLayoutManager extends mxEventSource {
* *
* Sets the graph that the layouts operate on. * Sets the graph that the layouts operate on.
*/ */
setGraph(graph: mxGraph): void { setGraph(graph: mxGraph | null): void {
if (this.graph != null) { if (this.graph != null) {
const model = this.graph.getModel(); const model = this.graph.getModel();
model.removeListener(this.undoHandler); model.removeListener(this.undoHandler);
@ -238,7 +239,7 @@ class mxLayoutManager extends mxEventSource {
* cell - Array of <mxCells> that have been moved. * cell - Array of <mxCells> that have been moved.
* evt - Mouse event that represents the mousedown. * evt - Mouse event that represents the mousedown.
*/ */
beforeUndo(undoableEdit) { beforeUndo(undoableEdit: any): void {
this.executeLayoutForCells(this.getCellsForChanges(undoableEdit.changes)); this.executeLayoutForCells(this.getCellsForChanges(undoableEdit.changes));
} }
@ -252,14 +253,16 @@ class mxLayoutManager extends mxEventSource {
* cell - Array of <mxCells> that have been moved. * cell - Array of <mxCells> that have been moved.
* evt - Mouse event that represents the mousedown. * evt - Mouse event that represents the mousedown.
*/ */
cellsMoved(cells, evt) { cellsMoved(cells: mxCell[],
evt: mxMouseEvent): void {
if (cells != null && evt != null) { if (cells != null && evt != null) {
const point = mxUtils.convertPoint( const point = mxUtils.convertPoint(
this.getGraph().container, (<mxGraph>this.getGraph()).container,
mxEvent.getClientX(evt), mxEvent.getClientX(evt),
mxEvent.getClientY(evt) mxEvent.getClientY(evt)
); );
const model = this.getGraph().getModel(); const model = (<mxGraph>this.getGraph()).getModel();
for (let i = 0; i < cells.length; i += 1) { for (let i = 0; i < cells.length; i += 1) {
const layout = this.getLayout( const layout = this.getLayout(
@ -282,24 +285,23 @@ class mxLayoutManager extends mxEventSource {
* Parameters: * Parameters:
* *
* cell - Array of <mxCells> that have been resized. * cell - Array of <mxCells> that have been resized.
* bounds - <mxRectangle> taht represents the new bounds. * bounds - <mxRectangle> that represents the new bounds.
*/ */
cellsResized( cellsResized(
cells: mxCell[] | null = null, cells: mxCell[] | null = null,
bounds: mxRectangle | null = null, bounds: mxRectangle[] | null = null,
prev prev: mxCell[] | null = null
) { ): void {
if (cells != null && bounds != null) { if (cells != null && bounds != null) {
const model = this.getGraph().getModel(); const model = (<mxGraph>this.getGraph()).getModel();
for (let i = 0; i < cells.length; i += 1) { for (let i = 0; i < cells.length; i += 1) {
const layout = this.getLayout( const layout = this.getLayout(
model.getParent(cells[i]), model.getParent(cells[i]),
mxEvent.RESIZE_CELLS mxEvent.RESIZE_CELLS
); );
if (layout != null) { if (layout != null) {
layout.resizeCell(cells[i], bounds[i], prev[i]); layout.resizeCell(cells[i], bounds[i], prev?.[i]);
} }
} }
} }
@ -311,7 +313,7 @@ class mxLayoutManager extends mxEventSource {
* Returns the cells for which a layout should be executed. * Returns the cells for which a layout should be executed.
*/ */
getCellsForChanges(changes: any[]): mxCell[] { getCellsForChanges(changes: any[]): mxCell[] {
let result = []; let result: mxCell[] = [];
for (const change of changes) { for (const change of changes) {
if (change instanceof mxRootChange) { if (change instanceof mxRootChange) {
return []; return [];
@ -375,7 +377,7 @@ class mxLayoutManager extends mxEventSource {
} }
if (this.isBubbling()) { if (this.isBubbling()) {
const model = this.getGraph().getModel(); const model = (<mxGraph>this.getGraph()).getModel();
this.addAncestorsWithLayout(model.getParent(cell), result); this.addAncestorsWithLayout(model.getParent(cell), result);
} }
} }
@ -389,7 +391,7 @@ class mxLayoutManager extends mxEventSource {
*/ */
addDescendantsWithLayout(cell: mxCell, result: mxCell[] = []): mxCell[] { addDescendantsWithLayout(cell: mxCell, result: mxCell[] = []): mxCell[] {
if (cell != null && this.hasLayout(cell)) { if (cell != null && this.hasLayout(cell)) {
const model = this.getGraph().getModel(); const model = (<mxGraph>this.getGraph()).getModel();
for (let i = 0; i < model.getChildCount(cell); i += 1) { for (let i = 0; i < model.getChildCount(cell); i += 1) {
const child = model.getChildAt(cell, i); const child = model.getChildAt(cell, i);
@ -425,7 +427,7 @@ class mxLayoutManager extends mxEventSource {
layoutCells(cells: mxCell[], bubble: boolean = false): void { layoutCells(cells: mxCell[], bubble: boolean = false): void {
if (cells.length > 0) { if (cells.length > 0) {
// Invokes the layouts while removing duplicates // Invokes the layouts while removing duplicates
const model = this.getGraph().getModel(); const model = (<mxGraph>this.getGraph()).getModel();
model.beginUpdate(); model.beginUpdate();
try { try {
@ -450,7 +452,8 @@ class mxLayoutManager extends mxEventSource {
* *
* Executes the given layout on the given parent. * Executes the given layout on the given parent.
*/ */
executeLayout(cell: mxCell, bubble: boolean = false): void { executeLayout(cell: mxCell,
bubble: boolean=false): void {
const layout = this.getLayout( const layout = this.getLayout(
cell, cell,
bubble ? mxEvent.BEGIN_UPDATE : mxEvent.END_UPDATE bubble ? mxEvent.BEGIN_UPDATE : mxEvent.END_UPDATE

View File

@ -12,7 +12,7 @@ import React from 'react';
import mxGraph from '../../mxgraph/view/graph/mxGraph'; import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxRubberband from '../../mxgraph/handler/mxRubberband'; import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxUtils from '../../mxgraph/util/mxUtils'; import mxUtils from '../../mxgraph/util/mxUtils';
import mxCodec from '../../mxgraph/io/mxCodec'; import mxCodec from '../../mxgraph/serialization/mxCodec';
class Template extends React.Component { class Template extends React.Component {
constructor(props) { constructor(props) {

View File

@ -11,7 +11,7 @@ import mxShape from '../../mxgraph/shape/mxShape';
import mxConnectionConstraint from '../../mxgraph/view/connection/mxConnectionConstraint'; import mxConnectionConstraint from '../../mxgraph/view/connection/mxConnectionConstraint';
import mxPoint from '../../mxgraph/util/datatypes/mxPoint'; import mxPoint from '../../mxgraph/util/datatypes/mxPoint';
import mxPolyline from '../../mxgraph/shape/edge/mxPolyline'; import mxPolyline from '../../mxgraph/shape/edge/mxPolyline';
import mxCellState from '../../mxgraph/view/cell/mxCellState'; import mxCellState from '../../mxgraph/util/datatypes/mxCellState';
import mxGeometry from "../../mxgraph/util/datatypes/mxGeometry"; import mxGeometry from "../../mxgraph/util/datatypes/mxGeometry";
import mxConnectionHandler from "../../mxgraph/handler/mxConnectionHandler"; import mxConnectionHandler from "../../mxgraph/handler/mxConnectionHandler";

View File

@ -12,7 +12,7 @@ import mxConnectionHandler from '../../mxgraph/handler/mxConnectionHandler';
import mxEdgeHandler from '../../mxgraph/handler/mxEdgeHandler'; import mxEdgeHandler from '../../mxgraph/handler/mxEdgeHandler';
import mxConnectionConstraint from '../../mxgraph/view/connection/mxConnectionConstraint'; import mxConnectionConstraint from '../../mxgraph/view/connection/mxConnectionConstraint';
import mxPoint from '../../mxgraph/util/datatypes/mxPoint'; import mxPoint from '../../mxgraph/util/datatypes/mxPoint';
import mxCellState from '../../mxgraph/view/cell/mxCellState'; import mxCellState from '../../mxgraph/util/datatypes/mxCellState';
class FixedPoints extends React.Component { class FixedPoints extends React.Component {
constructor(props) { constructor(props) {

View File

@ -8,9 +8,9 @@ import mxEvent from '../../mxgraph/util/event/mxEvent';
import mxGraph from '../../mxgraph/view/graph/mxGraph'; import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxRubberband from '../../mxgraph/handler/mxRubberband'; import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxConstants from '../../mxgraph/util/mxConstants'; import mxConstants from '../../mxgraph/util/mxConstants';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle'; import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxPoint from '../../mxgraph/util/datatypes/mxPoint'; import mxPoint from '../../mxgraph/util/datatypes/mxPoint';
import mxCodec from '../../mxgraph/io/mxCodec'; import mxCodec from '../../mxgraph/serialization/mxCodec';
import mxUtils from '../../mxgraph/util/mxUtils'; import mxUtils from '../../mxgraph/util/mxUtils';
class HelloPort extends React.Component { class HelloPort extends React.Component {

View File

@ -13,7 +13,7 @@ import mxEdgeHandler from '../../mxgraph/handler/mxEdgeHandler';
import mxConnectionHandler from '../../mxgraph/handler/mxConnectionHandler'; import mxConnectionHandler from '../../mxgraph/handler/mxConnectionHandler';
import mxGraphView from '../../mxgraph/view/graph/mxGraphView'; import mxGraphView from '../../mxgraph/view/graph/mxGraphView';
import mxPoint from '../../mxgraph/util/datatypes/mxPoint'; import mxPoint from '../../mxgraph/util/datatypes/mxPoint';
import mxCellState from '../../mxgraph/view/cell/mxCellState'; import mxCellState from '../../mxgraph/util/datatypes/mxCellState';
class Orthogonal extends React.Component { class Orthogonal extends React.Component {
constructor(props) { constructor(props) {

View File

@ -10,7 +10,7 @@ import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxUtils from '../../mxgraph/util/mxUtils'; import mxUtils from '../../mxgraph/util/mxUtils';
import mxClipboard from '../../mxgraph/util/storage/mxClipboard'; import mxClipboard from '../../mxgraph/util/storage/mxClipboard';
import mxClient from '../../mxgraph/mxClient'; import mxClient from '../../mxgraph/mxClient';
import mxCodec from '../../mxgraph/io/mxCodec'; import mxCodec from '../../mxgraph/serialization/mxCodec';
import mxGraphModel from '../../mxgraph/view/graph/mxGraphModel'; import mxGraphModel from '../../mxgraph/view/graph/mxGraphModel';
class Clipboard extends React.Component { class Clipboard extends React.Component {

View File

@ -9,7 +9,7 @@ import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxRubberband from '../../mxgraph/handler/mxRubberband'; import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxUtils from '../../mxgraph/util/mxUtils'; import mxUtils from '../../mxgraph/util/mxUtils';
import mxConstants from '../../mxgraph/util/mxConstants'; import mxConstants from '../../mxgraph/util/mxConstants';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle'; import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler'; import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler';
import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager'; import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager';
import mxParallelEdgeLayout from '../../mxgraph/layout/mxParallelEdgeLayout'; import mxParallelEdgeLayout from '../../mxgraph/layout/mxParallelEdgeLayout';

View File

@ -11,7 +11,7 @@ import mxConstants from '../../mxgraph/util/mxConstants';
import mxUtils from '../../mxgraph/util/mxUtils'; import mxUtils from '../../mxgraph/util/mxUtils';
import mxRectangle from '../../mxgraph/util/datatypes/mxRectangle'; import mxRectangle from '../../mxgraph/util/datatypes/mxRectangle';
import mxImage from '../../mxgraph/util/image/mxImage'; import mxImage from '../../mxgraph/util/image/mxImage';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter'; import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
class Images extends React.Component { class Images extends React.Component {
constructor(props) { constructor(props) {

View File

@ -6,7 +6,7 @@
import React from 'react'; import React from 'react';
import mxGraph from '../../mxgraph/view/graph/mxGraph'; import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxConstants from '../../mxgraph/util/mxConstants'; import mxConstants from '../../mxgraph/util/mxConstants';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle'; import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler'; import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler';
class Indicators extends React.Component { class Indicators extends React.Component {

View File

@ -6,7 +6,7 @@
import React from 'react'; import React from 'react';
import mxGraph from '../../mxgraph/view/graph/mxGraph'; import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxConstants from '../../mxgraph/util/mxConstants'; import mxConstants from '../../mxgraph/util/mxConstants';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle'; import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager'; import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager';
import mxStackLayout from '../../mxgraph/layout/mxStackLayout'; import mxStackLayout from '../../mxgraph/layout/mxStackLayout';

View File

@ -10,7 +10,7 @@ import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxHierarchicalLayout from '../../mxgraph/layout/hierarchical/mxHierarchicalLayout'; import mxHierarchicalLayout from '../../mxgraph/layout/hierarchical/mxHierarchicalLayout';
import mxFastOrganicLayout from '../../mxgraph/layout/mxFastOrganicLayout'; import mxFastOrganicLayout from '../../mxgraph/layout/mxFastOrganicLayout';
import mxConstants from '../../mxgraph/util/mxConstants'; import mxConstants from '../../mxgraph/util/mxConstants';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter'; import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
import mxUtils from '../../mxgraph/util/mxUtils'; import mxUtils from '../../mxgraph/util/mxUtils';
class HierarchicalLayout extends React.Component { class HierarchicalLayout extends React.Component {

View File

@ -19,7 +19,7 @@ import mxConstants from '../../mxgraph/util/mxConstants';
import mxWindow from '../../mxgraph/util/gui/mxWindow'; import mxWindow from '../../mxgraph/util/gui/mxWindow';
import mxToolbar from '../../mxgraph/util/gui/mxToolbar'; import mxToolbar from '../../mxgraph/util/gui/mxToolbar';
import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager'; import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle'; import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxCompactTreeLayout from '../../mxgraph/layout/mxCompactTreeLayout'; import mxCompactTreeLayout from '../../mxgraph/layout/mxCompactTreeLayout';
import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler'; import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler';
import mxClient from '../../mxgraph/mxClient'; import mxClient from '../../mxgraph/mxClient';

View File

@ -6,7 +6,7 @@
import React from 'react'; import React from 'react';
import mxGraph from '../../mxgraph/view/graph/mxGraph'; import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxRubberband from '../../mxgraph/handler/mxRubberband'; import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter'; import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
import mxConstants from '../../mxgraph/util/mxConstants'; import mxConstants from '../../mxgraph/util/mxConstants';
import mxRadialTreeLayout from '../../mxgraph/layout/mxRadialTreeLayout'; import mxRadialTreeLayout from '../../mxgraph/layout/mxRadialTreeLayout';

View File

@ -12,13 +12,13 @@ import mxStackLayout from '../../mxgraph/layout/mxStackLayout';
import mxSwimlaneManager from '../../mxgraph/view/graph/mxSwimlaneManager'; import mxSwimlaneManager from '../../mxgraph/view/graph/mxSwimlaneManager';
import mxGraphModel from '../../mxgraph/view/graph/mxGraphModel'; import mxGraphModel from '../../mxgraph/view/graph/mxGraphModel';
import mxConstants from '../../mxgraph/util/mxConstants'; import mxConstants from '../../mxgraph/util/mxConstants';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter'; import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
import mxUtils from '../../mxgraph/util/mxUtils'; import mxUtils from '../../mxgraph/util/mxUtils';
import mxEditor from '../../mxgraph/editor/mxEditor'; import mxEditor from '../../mxgraph/editor/mxEditor';
import mxConnectionHandler from '../../mxgraph/handler/mxConnectionHandler'; import mxConnectionHandler from '../../mxgraph/handler/mxConnectionHandler';
import mxImage from '../../mxgraph/util/image/mxImage'; import mxImage from '../../mxgraph/util/image/mxImage';
import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager'; import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle'; import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
class SwimLanes extends React.Component { class SwimLanes extends React.Component {
constructor(props) { constructor(props) {

View File

@ -17,7 +17,7 @@ import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager';
import mxRectangle from '../../mxgraph/util/datatypes/mxRectangle'; import mxRectangle from '../../mxgraph/util/datatypes/mxRectangle';
import mxUtils from '../../mxgraph/util/mxUtils'; import mxUtils from '../../mxgraph/util/mxUtils';
import mxClient from '../../mxgraph/mxClient'; import mxClient from '../../mxgraph/mxClient';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle'; import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
class Tree extends React.Component { class Tree extends React.Component {
constructor(props) { constructor(props) {

View File

@ -9,9 +9,9 @@ import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxText from '../../mxgraph/shape/mxText'; import mxText from '../../mxgraph/shape/mxText';
import mxUtils from '../../mxgraph/util/mxUtils'; import mxUtils from '../../mxgraph/util/mxUtils';
import mxConstants from '../../mxgraph/util/mxConstants'; import mxConstants from '../../mxgraph/util/mxConstants';
import mxCodec from '../../mxgraph/io/mxCodec'; import mxCodec from '../../mxgraph/serialization/mxCodec';
import mxEffects from '../../mxgraph/util/animate/mxEffects'; import mxEffects from '../../mxgraph/util/animate/mxEffects';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter'; import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
class DynamicLoading extends React.Component { class DynamicLoading extends React.Component {
constructor(props) { constructor(props) {

View File

@ -10,7 +10,7 @@ import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxGraphHandler from '../../mxgraph/handler/mxGraphHandler'; import mxGraphHandler from '../../mxgraph/handler/mxGraphHandler';
import mxEdgeHandler from '../../mxgraph/handler/mxEdgeHandler'; import mxEdgeHandler from '../../mxgraph/handler/mxEdgeHandler';
import mxConstants from '../../mxgraph/util/mxConstants'; import mxConstants from '../../mxgraph/util/mxConstants';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle'; import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler'; import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler';
class Guides extends React.Component { class Guides extends React.Component {

View File

@ -7,7 +7,7 @@ import React from 'react';
import mxGraph from '../../mxgraph/view/graph/mxGraph'; import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxRubberband from '../../mxgraph/handler/mxRubberband'; import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxConstants from '../../mxgraph/util/mxConstants'; import mxConstants from '../../mxgraph/util/mxConstants';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter'; import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
class Merge extends React.Component { class Merge extends React.Component {
constructor(props) { constructor(props) {

View File

@ -9,9 +9,9 @@ import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxConstants from '../../mxgraph/util/mxConstants'; import mxConstants from '../../mxgraph/util/mxConstants';
import mxCellOverlay from '../../mxgraph/view/cell/mxCellOverlay'; import mxCellOverlay from '../../mxgraph/view/cell/mxCellOverlay';
import mxUtils from '../../mxgraph/util/mxUtils'; import mxUtils from '../../mxgraph/util/mxUtils';
import mxCodec from '../../mxgraph/io/mxCodec'; import mxCodec from '../../mxgraph/serialization/mxCodec';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter'; import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle'; import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
class Monitor extends React.Component { class Monitor extends React.Component {
constructor(props) { constructor(props) {

View File

@ -6,8 +6,8 @@
import React from 'react'; import React from 'react';
import mxGraph from '../../mxgraph/view/graph/mxGraph'; import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxConstants from '../../mxgraph/util/mxConstants'; import mxConstants from '../../mxgraph/util/mxConstants';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle'; import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter'; import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
class Stylesheet extends React.Component { class Stylesheet extends React.Component {
constructor(props) { constructor(props) {

View File

@ -11,8 +11,8 @@ import mxConstants from '../../mxgraph/util/mxConstants';
import mxUtils from '../../mxgraph/util/mxUtils'; import mxUtils from '../../mxgraph/util/mxUtils';
import mxFastOrganicLayout from '../../mxgraph/layout/mxFastOrganicLayout'; import mxFastOrganicLayout from '../../mxgraph/layout/mxFastOrganicLayout';
import mxEventObject from '../../mxgraph/util/event/mxEventObject'; import mxEventObject from '../../mxgraph/util/event/mxEventObject';
import mxCodec from '../../mxgraph/io/mxCodec'; import mxCodec from '../../mxgraph/serialization/mxCodec';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter'; import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
import mxClient from '../../mxgraph/mxClient'; import mxClient from '../../mxgraph/mxClient';
class FileIO extends React.Component { class FileIO extends React.Component {

View File

@ -7,10 +7,10 @@ import React from 'react';
import mxEvent from '../../mxgraph/util/event/mxEvent'; import mxEvent from '../../mxgraph/util/event/mxEvent';
import mxGraph from '../../mxgraph/view/graph/mxGraph'; import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxRubberband from '../../mxgraph/handler/mxRubberband'; import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxCodecRegistry from '../../mxgraph/io/mxCodecRegistry'; import mxCodecRegistry from '../../mxgraph/serialization/mxCodecRegistry';
import mxObjectCodec from '../../mxgraph/io/mxObjectCodec'; import mxObjectCodec from '../../mxgraph/serialization/mxObjectCodec';
import mxUtils from '../../mxgraph/util/mxUtils'; import mxUtils from '../../mxgraph/util/mxUtils';
import mxCodec from '../../mxgraph/io/mxCodec'; import mxCodec from '../../mxgraph/serialization/mxCodec';
class JsonData extends React.Component { class JsonData extends React.Component {
// Adds an option to view the XML of the graph // Adds an option to view the XML of the graph

View File

@ -13,7 +13,7 @@ import mxForm from '../../mxgraph/util/gui/mxForm';
import mxCellAttributeChange from '../../mxgraph/atomic_changes/mxCellAttributeChange'; import mxCellAttributeChange from '../../mxgraph/atomic_changes/mxCellAttributeChange';
import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler'; import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler';
import mxRectangle from '../../mxgraph/util/datatypes/mxRectangle'; import mxRectangle from '../../mxgraph/util/datatypes/mxRectangle';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle'; import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
class UserObject extends React.Component { class UserObject extends React.Component {
constructor(props) { constructor(props) {

23
src/tsconfig.json Normal file
View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"baseUrl": ".",
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react-native",
"lib": ["es2020", "dom"],
"moduleResolution": "node",
"noEmit": true,
"strict": true,
"target": "es2020",
"resolveJsonModule": true, // Required for JSON files
"skipLibCheck": true
},
"exclude": [
"node_modules",
"e2e",
"**/*.json", // Don't try and check JSON files
"**/*.spec.ts",
]
}