diff --git a/packages/core/replace_comment_params.py b/packages/core/replace_comment_params.py deleted file mode 100644 index 174ff2420..000000000 --- a/packages/core/replace_comment_params.py +++ /dev/null @@ -1,32 +0,0 @@ -import re -from pathlib import Path - -MODE_BETWEEN_COMMENTS = 0 -MODE_COMMENT_START = 1 -MODE_PARAMS_START = 2 - -for path in Path('.').rglob('*.js'): - out_lines = [] - cur_mode = MODE_BETWEEN_COMMENTS - - with open(path, 'r', encoding='utf-8') as f: - for line in f: - if line.strip() == '/**' and cur_mode == MODE_BETWEEN_COMMENTS: - cur_mode = MODE_COMMENT_START - out_lines.append(line) - elif line.strip() == '* Parameters:' and cur_mode == MODE_COMMENT_START: - cur_mode = MODE_PARAMS_START - elif cur_mode == MODE_PARAMS_START: - if line.strip() == '*/': - cur_mode = MODE_BETWEEN_COMMENTS - out_lines.append(line) - elif line.strip() != '*': - # e.g. * node - DOM node whose siblings should be removed. - line = re.sub(r'(\s*?)\* ([A-z0-9_]+) - ', '\\1* @param \\2 ', line) - #print(line) - out_lines.append(line) - else: - out_lines.append(line) - - with open(path, 'w', encoding='utf-8', newline='\n') as f: - f.write(''.join(out_lines)) diff --git a/packages/core/replace_defs.py b/packages/core/replace_defs.py deleted file mode 100644 index 635486e70..000000000 --- a/packages/core/replace_defs.py +++ /dev/null @@ -1,48 +0,0 @@ -import re -import json -from pathlib import Path - - -with open('typed_mxgraph_defs.json', 'r', encoding='utf-8') as f: - defs = json.loads(f.read()) - - -for path in list(Path('.').rglob('./*/*.js')) + list(Path('.').rglob('./*/*.ts')): - print(path) - with open(path, 'r', encoding='utf-8') as f: - text = f.read() - - clsname = path.name.split('.')[0] - if clsname in defs: - #print(defs[clsname]) - assert not '\r\n' in text - - if defs[clsname][0]: - pattern = r'(/\*(?:(?!\*/).)*\*/)\s*\nclass %s\b' % clsname - replace_with = '\n'.join(defs[clsname][0]) - replace_with += '\nclass %s' % clsname - replace_with = replace_with.replace('\\u', '').replace('\\x', '') - text = re.sub(pattern, replace_with, text, flags=re.DOTALL) - - for k, v in defs[clsname][1].items(): - if not v[1]: continue - elif not k.strip().strip('();'): continue - k = k.strip('\\;') - - pattern = r' (/\*(?:(?!\*/).)*\*/)\n %s\b' % k - replace_with = '\n'.join(' '+i for i in v[1]) - replace_with += '\n // '+v[0]+'\n' - replace_with += ' %s' % k - replace_with = replace_with.replace('\\u', '').replace('\\x', '') - - #print(pattern, re.findall(pattern, text, re.DOTALL)) - text = re.sub(pattern, replace_with, text, flags=re.DOTALL) - - print(text) - - with open(path, 'w', encoding='utf-8') as f: - f.write(text) - - - - diff --git a/packages/core/typed_mxgraph_defs.json b/packages/core/typed_mxgraph_defs.json deleted file mode 100644 index 16b6cacad..000000000 --- a/packages/core/typed_mxgraph_defs.json +++ /dev/null @@ -1,38505 +0,0 @@ -{ - "mxCellState": [ - null, - { - "constructor": [ - "constructor(view: mxGraphView, cell: mxCell, style: { [key: string]: any });", - null - ], - "control": [ - "control: mxShape;", - null - ], - "view": [ - "view: mxGraphView;", - [ - "/**", - " * Variable: view", - " *", - " * Reference to the enclosing .", - " */" - ] - ], - "cell": [ - "cell: mxCell;", - [ - "/**", - " * Variable: cell", - " *", - " * Reference to the that is represented by this state.", - " */" - ] - ], - "style": [ - "style: { [key: string]: any };", - [ - "/**", - " * Variable: style", - " *", - " * Contains an array of key, value pairs that represent the style of the", - " * cell.", - " */" - ] - ], - "invalid": [ - "invalid: boolean;", - [ - "/**", - " * Variable: invalid", - " *", - " * Specifies if the state is invalid. Default is true.", - " */" - ] - ], - "origin": [ - "origin: mxPoint;", - [ - "/**", - " * Variable: origin", - " *", - " * that holds the origin for all child cells. Default is a new", - " * empty .", - " */" - ] - ], - "absolutePoints": [ - "absolutePoints: mxPoint[];", - [ - "/**", - " * Variable: absolutePoints", - " *", - " * Holds an array of that represent the absolute points of an", - " * edge.", - " */" - ] - ], - "absoluteOffset": [ - "absoluteOffset: mxPoint;", - [ - "/**", - " * Variable: absoluteOffset", - " *", - " * that holds the absolute offset. For edges, this is the", - " * absolute coordinates of the label position. For vertices, this is the", - " * offset of the label relative to the top, left corner of the vertex.", - " */" - ] - ], - "visibleSourceState": [ - "visibleSourceState: mxCellState;", - [ - "/**", - " * Variable: visibleSourceState", - " *", - " * Caches the visible source terminal state.", - " */" - ] - ], - "visibleTargetState": [ - "visibleTargetState: mxCellState;", - [ - "/**", - " * Variable: visibleTargetState", - " *", - " * Caches the visible target terminal state.", - " */" - ] - ], - "terminalDistance": [ - "terminalDistance: number;", - [ - "/**", - " * Variable: terminalDistance", - " *", - " * Caches the distance between the end points for an edge.", - " */" - ] - ], - "length": [ - "length: number;", - [ - "/**", - " * Variable: length", - " *", - " * Caches the length of an edge.", - " */" - ] - ], - "segments": [ - "segments: number[];", - [ - "/**", - " * Variable: segments", - " *", - " * Array of numbers that represent the cached length of each segment of the", - " * edge.", - " */" - ] - ], - "shape": [ - "shape: mxShape;", - [ - "/**", - " * Variable: shape", - " *", - " * Holds the that represents the cell graphically.", - " */" - ] - ], - "text": [ - "text: mxText;", - [ - "/**", - " * Variable: text", - " *", - " * Holds the that represents the label of the cell. Thi smay be", - " * null if the cell has no label.", - " */" - ] - ], - "unscaledWidth": [ - "unscaledWidth: number;", - [ - "/**", - " * Variable: unscaledWidth", - " *", - " * Holds the unscaled width of the state.", - " */" - ] - ], - "getPerimeterBounds": [ - "getPerimeterBounds(border?: number, bounds?: mxRectangle): mxRectangle;", - [ - "/**", - " * Function: getPerimeterBounds", - " *", - " * Returns the that should be used as the perimeter of the", - " * cell.", - " *", - " * Parameters:", - " *", - " * border - Optional border to be added around the perimeter bounds.", - " * bounds - Optional to be used as the initial bounds.", - " */" - ] - ], - "setAbsoluteTerminalPoint": [ - "setAbsoluteTerminalPoint(point: mxPoint, isSource: boolean): void;", - [ - "/**", - " * Function: setAbsoluteTerminalPoint", - " *", - " * Sets the first or last point in depending on isSource.", - " *", - " * Parameters:", - " *", - " * point - that represents the terminal point.", - " * isSource - Boolean that specifies if the first or last point should", - " * be assigned.", - " */" - ] - ], - "setCursor": [ - "setCursor(cursor: string): void;", - [ - "/**", - " * Function: setCursor", - " *", - " * Sets the given cursor on the shape and text shape.", - " */" - ] - ], - "getVisibleTerminal": [ - "getVisibleTerminal(source: boolean): mxCell;", - [ - "/**", - " * Function: getVisibleTerminal", - " *", - " * Returns the visible source or target terminal cell.", - " *", - " * Parameters:", - " *", - " * source - Boolean that specifies if the source or target cell should be", - " * returned.", - " */" - ] - ], - "getVisibleTerminalState": [ - "getVisibleTerminalState(source?: boolean): mxCellState;", - [ - "/**", - " * Function: getVisibleTerminalState", - " *", - " * Returns the visible source or target terminal state.", - " *", - " * Parameters:", - " *", - " * source - Boolean that specifies if the source or target state should be", - " * returned.", - " */" - ] - ], - "setVisibleTerminalState": [ - "setVisibleTerminalState(terminalState: mxCellState, source: boolean): void;", - [ - "/**", - " * Function: setVisibleTerminalState", - " *", - " * Sets the visible source or target terminal state.", - " *", - " * Parameters:", - " *", - " * terminalState - that represents the terminal.", - " * source - Boolean that specifies if the source or target state should be set.", - " */" - ] - ], - "getCellBounds": [ - "getCellBounds(): mxRectangle;", - [ - "/**", - " * Function: getCellBounds", - " *", - " * Returns the unscaled, untranslated bounds.", - " */" - ] - ], - "getPaintBounds": [ - "getPaintBounds(): mxRectangle;", - [ - "/**", - " * Function: getPaintBounds", - " *", - " * Returns the unscaled, untranslated paint bounds. This is the same as", - " * but with a 90 degree rotation if the shape's", - " * isPaintBoundsInverted returns true.", - " */" - ] - ], - "updateCachedBounds": [ - "updateCachedBounds(): void;", - [ - "/**", - " * Function: updateCachedBounds", - " *", - " * Updates the cellBounds and paintBounds.", - " */" - ] - ], - "setState": [ - "setState(state: mxCellState): void;", - [ - "/**", - " * Destructor: setState", - " *", - " * Copies all fields from the given state to this state.", - " */" - ] - ], - "clone": [ - "clone(): mxCellState;", - [ - "/**", - " * Function: clone", - " *", - " * Returns a clone of this .", - " */" - ] - ], - "destroy": [ - "destroy(): void;", - [ - "/**", - " * Destructor: destroy", - " *", - " * Destroys the state and all associated resources.", - " */" - ] - ] - } - ], - "mxSwimlaneManager": [ - [ - "/**", - " * @class mxSwimlaneManager", - " * @extends mxEventSource", - " *", - " * Manager for swimlanes and nested swimlanes that sets the size of newly added", - " * swimlanes to that of their siblings, and propagates changes to the size of a", - " * swimlane to its siblings, if {@link siblings} is true, and its ancestors, if", - " * {@link bubbling} is true.", - " */" - ], - { - "constructor": [ - "constructor(graph: mxGraph, horizontal?: boolean, addEnabled?: boolean, resizeEnabled?: boolean);", - [ - "/**", - " * Constructs a new swimlane manager for the given graph.", - " *", - " * @param {mxGraph} graph Reference to the enclosing graph.", - " * @param {boolean} [horizontal]", - " * @param {boolean} [addEnabled]", - " * @param {boolean} [resizeEnabled]", - " */" - ] - ], - "graph": [ - "graph: mxGraph;", - [ - "/**", - " * Reference to the enclosing {@link mxGraph}.", - " */" - ] - ], - "enabled": [ - "enabled: boolean;", - [ - "/**", - " * Specifies if event handling is enabled.", - " * @default true", - " */" - ] - ], - "horizontal": [ - "horizontal: boolean;", - [ - "/**", - " * Specifies the orientation of the swimlanes.", - " * @default true", - " */" - ] - ], - "addEnabled": [ - "addEnabled: boolean;", - [ - "/**", - " * Specifies if newly added cells should be resized to match the size of their", - " * existing siblings.", - " * @default true", - " */" - ] - ], - "resizeEnabled": [ - "resizeEnabled: boolean;", - [ - "/**", - " * Specifies if resizing of swimlanes should be handled.", - " * @default true", - " */" - ] - ], - "addHandler": [ - "addHandler: Function;", - [ - "/**", - " * Holds the function that handles the move event.", - " */" - ] - ], - "resizeHandler": [ - "resizeHandler: Function;", - [ - "/**", - " * Holds the function that handles the move event.", - " */" - ] - ], - "isEnabled": [ - "isEnabled(): boolean;", - [ - "/**", - " * Returns true if events are handled. This implementation", - " * returns {@link enabled}.", - " */" - ] - ], - "setEnabled": [ - "setEnabled(value: boolean): void;", - [ - "/**", - " * Enables or disables event handling. This implementation", - " * updates {@link enabled}.", - " *", - " * @param enabled Boolean that specifies the new enabled state.", - " */" - ] - ], - "isHorizontal": [ - "isHorizontal(): boolean;", - [ - "/**", - " * Returns {@link horizontal}.", - " */" - ] - ], - "setHorizontal": [ - "setHorizontal(value: boolean): void;", - [ - "/**", - " * Sets {@link horizontal}.", - " */" - ] - ], - "isAddEnabled": [ - "isAddEnabled(): boolean;", - [ - "/**", - " * Returns {@link addEnabled}.", - " */" - ] - ], - "setAddEnabled": [ - "setAddEnabled(value: boolean): void;", - [ - "/**", - " * Sets {@link addEnabled}.", - " */" - ] - ], - "isResizeEnabled": [ - "isResizeEnabled(): boolean;", - [ - "/**", - " * Returns {@link resizeEnabled}.", - " */" - ] - ], - "setResizeEnabled": [ - "setResizeEnabled(value: boolean): void;", - [ - "/**", - " * Sets {@link resizeEnabled}.", - " */" - ] - ], - "getGraph": [ - "getGraph(): mxGraph;", - [ - "/**", - " * Returns the graph that this manager operates on.", - " */" - ] - ], - "setGraph": [ - "setGraph(graph: mxGraph): void;", - [ - "/**", - " * Sets the graph that the manager operates on.", - " */" - ] - ], - "isSwimlaneIgnored": [ - "isSwimlaneIgnored(swimlane: mxCell): boolean;", - [ - "/**", - " * Returns true if the given swimlane should be ignored.", - " */" - ] - ], - "isCellHorizontal": [ - "isCellHorizontal(cell: mxCell): boolean;", - [ - "/**", - " * Returns true if the given cell is horizontal. If the given cell is not a", - " * swimlane, then the global orientation is returned.", - " */" - ] - ], - "cellsAdded": [ - "cellsAdded(cells: Array): void;", - [ - "/**", - " * Called if any cells have been added.", - " *", - " * @param cell Array of {@link mxCell} that have been added.", - " */" - ] - ], - "swimlaneAdded": [ - "swimlaneAdded(swimlane: mxCell): void;", - [ - "/**", - " * Updates the size of the given swimlane to match that of any existing", - " * siblings swimlanes.", - " *", - " * @param swimlane {@link mxCell} that represents the new swimlane.", - " */" - ] - ], - "cellsResized": [ - "cellsResized(cells: Array): void;", - [ - "/**", - " * Called if any cells have been resizes. Calls {@link swimlaneResized} for all", - " * swimlanes where {@link isSwimlaneIgnored} returns false.", - " *", - " * @param cells Array of {@link mxCell} whose size was changed.", - " */" - ] - ], - "resizeSwimlane": [ - "resizeSwimlane(swimlane: mxCell, w: number, h: number, parentHorizontal: boolean): void;", - [ - "/**", - " * Called from {@link cellsResized} for all swimlanes that are not ignored to update", - " * the size of the siblings and the size of the parent swimlanes, recursively,", - " * if {@link bubbling} is true.", - " *", - " * @param swimlane {@link mxCell} whose size has changed.", - " */" - ] - ], - "destroy": [ - "destroy(): void;", - [ - "/**", - " * Removes all handlers from the {@link graph} and deletes the reference to it.", - " */" - ] - ] - } - ], - "mxGraphSelectionModel": [ - [ - "/**", - " * @class mxGraphSelectionModel", - " *", - " * Implements the selection model for a graph. Here is a listener that handles", - " * all removed selection cells.", - " *", - " * @example", - " * ```javascript", - " * graph.getSelectionModel().addListener(mxEvent.CHANGE, function(sender, evt)", - " * {", - " * var cells = evt.getProperty('added');", - " *", - " * for (var i = 0; i < cells.length; i++)", - " * {", - " * // Handle cells[i]...", - " * }", - " * });", - " * ```", - " *", - " * ### Event: mxEvent.UNDO", - " *", - " * Fires after the selection was changed in {@link changeSelection}. The", - " * `edit` property contains the {@link mxUndoableEdit} which contains the", - " * {@link mxSelectionChange}.", - " *", - " * ### Event: mxEvent.CHANGE", - " *", - " * Fires after the selection changes by executing an {@link mxSelectionChange}. The", - " * `added` and `removed` properties contain arrays of", - " * cells that have been added to or removed from the selection, respectively.", - " * The names are inverted due to historic reasons. This cannot be changed.", - " */" - ], - { - "constructor": [ - "constructor(graph: mxGraph);", - [ - "/**", - " * @constructor", - " * Constructs a new graph selection model for the given {@link mxGraph}.", - " *", - " * @param graph Reference to the enclosing {@link mxGraph}.", - " */" - ] - ], - "doneResource": [ - "doneResource: 'done' | '';", - [ - "/**", - " * Specifies the resource key for the status message after a long operation.", - " * If the resource for this key does not exist then the value is used as", - " * the status message. Default is 'done'.", - " */" - ] - ], - "updatingSelectionResource": [ - "updatingSelectionResource: 'updatingSelection' | '';", - [ - "/**", - " * Specifies the resource key for the status message while the selection is", - " * being updated. If the resource for this key does not exist then the", - " * value is used as the status message. Default is 'updatingSelection'.", - " */" - ] - ], - "graph": [ - "graph: mxGraph;", - [ - "/**", - " * Reference to the enclosing {@link mxGraph}.", - " */" - ] - ], - "singleSelection": [ - "singleSelection: boolean;", - [ - "/**", - " * Specifies if only one selected item at a time is allowed.", - " * Default is false.", - " */" - ] - ], - "isSingleSelection": [ - "isSingleSelection(): boolean;", - [ - "/**", - " * Returns {@link singleSelection} as a boolean.", - " */" - ] - ], - "setSingleSelection": [ - "setSingleSelection(singleSelection: boolean): void;", - [ - "/**", - " * Sets the {@link singleSelection} flag.", - " *", - " * @param {boolean} singleSelection Boolean that specifies the new value for", - " * {@link singleSelection}.", - " */" - ] - ], - "isSelected": [ - "isSelected(cell: mxCell): boolean;", - [ - "/**", - " * Returns true if the given {@link mxCell} is selected.", - " */" - ] - ], - "isEmpty": [ - "isEmpty(): boolean;", - [ - "/**", - " * Returns true if no cells are currently selected.", - " */" - ] - ], - "clear": [ - "clear(): void;", - [ - "/**", - " * Clears the selection and fires a {@link change} event if the selection was not", - " * empty.", - " */" - ] - ], - "setCell": [ - "setCell(cell: mxCell): void;", - [ - "/**", - " * Selects the specified {@link mxCell} using {@link setCells}.", - " *", - " * @param cell {@link mxCell} to be selected.", - " */" - ] - ], - "setCells": [ - "setCells(cells: Array): void;", - [ - "/**", - " * Selects the given array of {@link mxCell} and fires a {@link change} event.", - " *", - " * @param cells Array of {@link mxCell} to be selected.", - " */" - ] - ], - "getFirstSelectableCell": [ - "getFirstSelectableCell(cells: Array): mxCell;", - [ - "/**", - " * Returns the first selectable cell in the given array of cells.", - " */" - ] - ], - "addCell": [ - "addCell(cell: mxCell): void;", - [ - "/**", - " * Adds the given {@link mxCell} to the selection and fires a {@link select} event.", - " *", - " * @param cell {@link mxCell} to add to the selection.", - " */" - ] - ], - "addCells": [ - "addCells(cells: Array): void;", - [ - "/**", - " * Adds the given array of {@link mxCell} to the selection and fires a {@link select}", - " * event.", - " *", - " * @param cells Array of {@link mxCell} to add to the selection.", - " */" - ] - ], - "removeCell": [ - "removeCell(cell: mxCell): void;", - [ - "/**", - " * Removes the specified {@link mxCell} from the selection and fires a {@link select}", - " * event for the remaining cells.", - " *", - " * @param cell {@link mxCell} to remove from the selection.", - " */" - ] - ], - "removeCells": [ - "removeCells(cells: Array): void;", - [ - "/**", - " * Removes the specified {@link mxCell} from the selection and fires a {@link select}", - " * event for the remaining cells.", - " *", - " * @param cell {@link mxCell} to remove from the selection.", - " */" - ] - ], - "changeSelection": [ - "changeSelection(added: Array, removed: Array): void;", - [ - "/**", - " * Adds/removes the specified arrays of {@link mxCell} to/from the selection.", - " *", - " * @param added Array of {@link mxCell} to add to the selection.", - " * @param remove Array of {@link mxCell} to remove from the selection.", - " */" - ] - ], - "cellAdded": [ - "cellAdded(cell: mxCell): void;", - [ - "/**", - " * Inner callback to add the specified {@link mxCell} to the selection. No event", - " * is fired in this implementation.", - " *", - " * Paramters:", - " *", - " * @param cell {@link mxCell} to add to the selection.", - " */" - ] - ], - "cellRemoved": [ - "cellRemoved(cell: mxCell): void;", - [ - "/**", - " * Inner callback to remove the specified {@link mxCell} from the selection. No", - " * event is fired in this implementation.", - " *", - " * @param cell {@link mxCell} to remove from the selection.", - " */" - ] - ] - } - ], - "mxSelectionChange": [ - [ - "/**", - " * @class mxSelectionChange", - " * Action to change the current root in a view.", - " */" - ], - { - "constructor": [ - "constructor(selectionModel: mxGraphSelectionModel, added: Array, removed: Array);", - [ - "/**", - " * Creates an instance of mxSelectionChange.", - " *", - " * @param {mxGraphSelectionModel} selectionModel", - " * @param {Array} added", - " * @param {Array} removed", - " */" - ] - ], - "execute": [ - "execute(): void;", - [ - "/**", - " * Changes the current root of the view.", - " */" - ] - ], - "key": [ - "[key: string]: any;", - null - ] - } - ], - "mxStylesheet": [ - [ - "/**", - " * @class mxStylesheet", - " *", - " * Defines the appearance of the cells in a graph. See {@link putCellStyle} for an", - " * example of creating a new cell style. It is recommended to use objects, not", - " * arrays for holding cell styles. Existing styles can be cloned using", - " * {@link mxUtils.clone} and turned into a string for debugging using", - " * {@link mxUtils.toString}.", - " *", - " * ### Default Styles", - " *", - " * The stylesheet contains two built-in styles, which are used if no style is", - " * defined for a cell:", - " *", - " * - defaultVertex Default style for vertices", - " * - defaultEdge Default style for edges", - " *", - " * ### Example", - " *", - " * ```javascript", - " * var vertexStyle = stylesheet.getDefaultVertexStyle();", - " * vertexStyle.rounded = true;", - " * var edgeStyle = stylesheet.getDefaultEdgeStyle();", - " * edgeStyle.edge = mxEdgeStyle.EntityRelation;", - " * ```", - " *", - " * Modifies the built-in default styles.", - " *", - " * To avoid the default style for a cell, add a leading semicolon", - " * to the style definition, eg.", - " *", - " * ```javascript", - " * ;shadow=1", - " * ```", - " *", - " * ### Removing keys", - " *", - " * For removing a key in a cell style of the form [stylename;|key=value;] the", - " * special value none can be used, eg. highlight;fillColor=none", - " *", - " * See also the helper methods in mxUtils to modify strings of this format,", - " * namely {@link mxUtils.setStyle}, {@link mxUtils.indexOfStylename},", - " * {@link mxUtils.addStylename}, {@link mxUtils.removeStylename},", - " * {@link mxUtils.removeAllStylenames} and {@link mxUtils.setStyleFlag}.", - " *", - " * Constructor: mxStylesheet", - " *", - " * Constructs a new stylesheet and assigns default styles.", - " */" - ], - { - "constructor": [ - "constructor();", - null - ], - "styles": [ - "styles: StyleMap;", - [ - "/**", - " * Maps from names to cell styles. Each cell style is a map of key,", - " * value pairs.", - " */" - ] - ], - "createDefaultVertexStyle": [ - "createDefaultVertexStyle(): StyleMap;", - [ - "/**", - " * Creates and returns the default vertex style.", - " */" - ] - ], - "createDefaultEdgeStyle": [ - "createDefaultEdgeStyle(): StyleMap;", - [ - "/**", - " * Creates and returns the default edge style.", - " */" - ] - ], - "putDefaultVertexStyle": [ - "putDefaultVertexStyle(style: StyleMap): void;", - [ - "/**", - " * Sets the default style for vertices using defaultVertex as the", - " * stylename.", - " * @param style Key, value pairs that define the style.", - " */" - ] - ], - "putDefaultEdgeStyle": [ - "putDefaultEdgeStyle(style: StyleMap): void;", - [ - "/**", - " * Sets the default style for edges using defaultEdge as the stylename.", - " */" - ] - ], - "getDefaultVertexStyle": [ - "getDefaultVertexStyle(): StyleMap;", - [ - "/**", - " * Returns the default style for vertices.", - " */" - ] - ], - "getDefaultEdgeStyle": [ - "getDefaultEdgeStyle(): StyleMap;", - [ - "/**", - " * Sets the default style for edges.", - " */" - ] - ], - "putCellStyle": [ - "putCellStyle(name: string, style: StyleMap): void;", - [ - "/**", - " * Stores the given map of key, value pairs under the given name in", - " * {@link styles}.", - " *", - " * Example:", - " *", - " * The following example adds a new style called 'rounded' into an", - " * existing stylesheet:", - " *", - " * ```javascript", - " * var style = new Object();", - " * style.shape = mxConstants.SHAPE_RECTANGLE;", - " * style.perimiter = mxPerimeter.RectanglePerimeter;", - " * style.rounded = true;", - " * graph.getStylesheet().putCellStyle('rounded', style);", - " * ```", - " *", - " * In the above example, the new style is an object. The possible keys of", - " * the object are all the constants in {@link mxConstants} that start with STYLE", - " * and the values are either JavaScript objects, such as", - " * {@link mxPerimeter.RightAngleRectanglePerimeter} (which is in fact a function)", - " * or expressions, such as true. Note that not all keys will be", - " * interpreted by all shapes (eg. the line shape ignores the fill color).", - " * The final call to this method associates the style with a name in the", - " * stylesheet. The style is used in a cell with the following code:", - " *", - " * ```javascript", - " * model.setStyle(cell, 'rounded');", - " * ```", - " *", - " * @param name Name for the style to be stored.", - " * @param style Key, value pairs that define the style.", - " */" - ] - ], - "getCellStyle": [ - "getCellStyle(name: string, defaultStyle?: StyleMap): StyleMap;", - [ - "/**", - " * Returns the cell style for the specified stylename or the given", - " * defaultStyle if no style can be found for the given stylename.", - " *", - " * @param name String of the form [(stylename|key=value);] that represents the style.", - " * @param defaultStyle Default style to be returned if no style can be found.", - " */" - ] - ] - } - ], - "mxOutline": [ - [ - "/**", - " * @class mxOutline", - " *", - " * Implements an outline (aka overview) for a graph. Set {@link updateOnPan} to true", - " * to enable updates while the source graph is panning.", - " *", - " * ### Example", - " *", - " * @example", - " * ```javascript", - " * var outline = new mxOutline(graph, div);", - " * ```", - " *", - " * If an outline is used in an {@link mxWindow} in IE8 standards mode, the following", - " * code makes sure that the shadow filter is not inherited and that any", - " * transparent elements in the graph do not show the page background, but the", - " * background of the graph container.", - " *", - " * @example", - " * ```javascript", - " * if (document.documentMode == 8)", - " * {", - " * container.style.filter = 'progid:DXImageTransform.Microsoft.alpha(opacity=100)';", - " * }", - " * ```", - " *", - " * To move the graph to the top, left corner the following code can be used.", - " *", - " * @example", - " * ```javascript", - " * var scale = graph.view.scale;", - " * var bounds = graph.getGraphBounds();", - " * graph.view.setTranslate(-bounds.x / scale, -bounds.y / scale);", - " * ```", - " *", - " * To toggle the suspended mode, the following can be used.", - " *", - " * @example", - " * ```javascript", - " * outline.suspended = !outln.suspended;", - " * if (!outline.suspended)", - " * {", - " * outline.update(true);", - " * }", - " * ```", - " */" - ], - { - "constructor": [ - "constructor(source: mxGraph, container: HTMLElement);", - [ - "/**", - " * @constructor mxOutline", - " *", - " * Constructs a new outline for the specified graph inside the given", - " * container.", - " *", - " * @param source {@link mxGraph} to create the outline for.", - " * @param container DOM node that will contain the outline.", - " */" - ] - ], - "source": [ - "source: mxGraph;", - [ - "/**", - " * Reference to the source {@link mxGraph}.", - " */" - ] - ], - "outline": [ - "outline: mxGraph;", - [ - "/**", - " * Reference to the {@link mxGraph} that renders the outline.", - " */" - ] - ], - "graphRenderHint": [ - "graphRenderHint: string;", - [ - "/**", - " * Renderhint to be used for the outline graph.", - " * @default faster", - " */" - ] - ], - "enabled": [ - "enabled: boolean;", - [ - "/**", - " * Specifies if events are handled.", - " * @default true", - " */" - ] - ], - "showViewport": [ - "showViewport: boolean;", - [ - "/**", - " * Specifies a viewport rectangle should be shown.", - " * @default true", - " */" - ] - ], - "border": [ - "border: number;", - [ - "/**", - " * Border to be added at the bottom and right.", - " * @default 10", - " */" - ] - ], - "sizerSize": [ - "sizerSize: number;", - [ - "/**", - " * Specifies the size of the sizer handler.", - " * @default 8", - " */" - ] - ], - "labelsVisible": [ - "labelsVisible: boolean;", - [ - "/**", - " * Specifies if labels should be visible in the outline.", - " * @default false", - " */" - ] - ], - "updateOnPan": [ - "updateOnPan: boolean;", - [ - "/**", - " * Specifies if {@link update} should be called for {@link mxEvent.PAN} in the source", - " * graph.", - " * @default false", - " */" - ] - ], - "sizerImage": [ - "sizerImage: mxImage;", - [ - "/**", - " * Optional {@link mxImage} to be used for the sizer.", - " * @default null", - " */" - ] - ], - "minScale": [ - "minScale: number;", - [ - "/**", - " * Minimum scale to be used.", - " * @default 0.0001", - " */" - ] - ], - "suspended": [ - "suspended: boolean;", - [ - "/**", - " * Optional boolean flag to suspend updates. This flag will", - " * also suspend repaints of the outline. To toggle this switch, use the", - " * following code.", - " *", - " * @default false", - " *", - " * @example", - " * ```javascript", - " * nav.suspended = !nav.suspended;", - " *", - " * if (!nav.suspended)", - " * {", - " * nav.update(true);", - " * }", - " * ```", - " */" - ] - ], - "forceVmlHandles": [ - "forceVmlHandles: number;", - [ - "/**", - " * Specifies if VML should be used to render the handles in this control. This", - " * is true for IE8 standards mode and false for all other browsers and modes.", - " * This is a workaround for rendering issues of HTML elements over elements", - " * with filters in IE 8 standards mode.", - " */" - ] - ], - "createGraph": [ - "createGraph(container: HTMLElement): mxGraph;", - [ - "/**", - " * Creates the {@link mxGraph} used in the outline.", - " */" - ] - ], - "init": [ - "init(container: HTMLElement): void;", - [ - "/**", - " * Initializes the outline inside the given container.", - " */" - ] - ], - "isEnabled": [ - "isEnabled(): boolean;", - [ - "/**", - " * Returns true if events are handled. This implementation", - " * returns {@link enabled}.", - " */" - ] - ], - "setEnabled": [ - "setEnabled(value: boolean): void;", - [ - "/**", - " * Enables or disables event handling. This implementation", - " * updates {@link enabled}.", - " *", - " * @param value Boolean that specifies the new enabled state.", - " */" - ] - ], - "setZoomEnabled": [ - "setZoomEnabled(value: boolean): void;", - [ - "/**", - " * Enables or disables the zoom handling by showing or hiding the respective", - " * handle.", - " *", - " * @param value Boolean that specifies the new enabled state.", - " */" - ] - ], - "refresh": [ - "refresh(): void;", - [ - "/**", - " * Invokes {@link update} and revalidate the outline. This method is deprecated.", - " */" - ] - ], - "createSizer": [ - "createSizer(): mxShape;", - [ - "/**", - " * Creates the shape used as the sizer.", - " */" - ] - ], - "getSourceContainerSize": [ - "getSourceContainerSize(): mxRectangle;", - [ - "/**", - " * Returns the size of the source container.", - " */" - ] - ], - "getOutlineOffset": [ - "getOutlineOffset(scale?: number): mxPoint;", - [ - "/**", - " * Returns the offset for drawing the outline graph.", - " */" - ] - ], - "getSourceGraphBounds": [ - "getSourceGraphBounds(): mxRectangle;", - [ - "/**", - " * Returns the offset for drawing the outline graph.", - " */" - ] - ], - "update": [ - "update(revalidate: boolean): void;", - [ - "/**", - " * Updates the outline.", - " */" - ] - ], - "mouseDown": [ - "mouseDown(sender: mxEventSource, me: mxMouseEvent): void;", - [ - "/**", - " * Handles the event by starting a translation or zoom.", - " */" - ] - ], - "mouseMove": [ - "mouseMove(sender: mxEventSource, me: mxMouseEvent): void;", - [ - "/**", - " * Handles the event by previewing the viewrect in {@link graph} and updating the", - " * rectangle that represents the viewrect in the outline.", - " */" - ] - ], - "getTranslateForEvent": [ - "getTranslateForEvent(me: mxMouseEvent): mxPoint;", - [ - "/**", - " * Gets the translate for the given mouse event. Here is an example to limit", - " * the outline to stay within positive coordinates:", - " *", - " * @example", - " * ```javascript", - " * outline.getTranslateForEvent(me)", - " * {", - " * var pt = new mxPoint(me.getX() - this.startX, me.getY() - this.startY);", - " *", - " * if (!this.zoom)", - " * {", - " * var tr = this.source.view.translate;", - " * pt.x = Math.max(tr.x * this.outline.view.scale, pt.x);", - " * pt.y = Math.max(tr.y * this.outline.view.scale, pt.y);", - " * }", - " *", - " * return pt;", - " * };", - " * ```", - " */" - ] - ], - "mouseUp": [ - "mouseUp(sender: mxEventSource, me: mxMouseEvent): void;", - [ - "/**", - " * Handles the event by applying the translation or zoom to {@link graph}.", - " */" - ] - ], - "destroy": [ - "destroy(): void;", - [ - "/**", - " * Destroy this outline and removes all listeners from {@link source}.", - " */" - ] - ] - } - ], - "mxTemporaryCellStates": [ - [ - "/**", - " * @class mxTemporaryCellStates", - " *", - " * Creates a temporary set of cell states.", - " */" - ], - { - ");": [ - ");", - null - ], - "view": [ - "view: number;", - [ - "/**", - " * Holds the width of the rectangle.", - " * @default 0", - " */" - ] - ], - "oldStates": [ - "oldStates: number;", - [ - "/**", - " * Holds the height of the rectangle.", - " * @default 0", - " */" - ] - ], - "oldBounds": [ - "oldBounds: number;", - [ - "/**", - " * Holds the height of the rectangle.", - " * @default 0", - " */" - ] - ], - "oldScale": [ - "oldScale: number;", - [ - "/**", - " * Holds the height of the rectangle.", - " * @default 0", - " */" - ] - ], - "destroy": [ - "destroy(): void;", - [ - "/**", - " * Holds the height of the rectangle.", - " * @default 0", - " */" - ] - ] - } - ], - "mxLayoutManager": [ - [ - "/**", - " * @class mxLayoutManager", - " * @extends {mxEventSource}", - " *", - " * Implements a layout manager that runs a given layout after any changes to the graph:", - " *", - " * ### Example", - " *", - " * @example", - " * ```javascript", - " * var layoutMgr = new mxLayoutManager(graph);", - " * layoutMgr.getLayout(cell, eventName)", - " * {", - " * return layout;", - " * };", - " * ```", - " *", - " * See {@link getLayout} for a description of the possible eventNames.", - " *", - " * #### Event: mxEvent.LAYOUT_CELLS", - " *", - " * Fires between begin- and endUpdate after all cells have been layouted in", - " * {@link layoutCells}. The `cells` property contains all cells that have", - " * been passed to {@link layoutCells}.", - " */" - ], - { - "constructor": [ - "constructor(graph: mxGraph);", - [ - "/**", - " * Constructor: mxLayoutManager", - " *", - " * Constructs a new automatic layout for the given graph.", - " *", - " * Arguments:", - " *", - " * @param graph Reference to the enclosing graph.", - " */" - ] - ], - "graph": [ - "graph: mxGraph;", - [ - "/**", - " * Reference to the enclosing {@link mxGraph}.", - " */" - ] - ], - "bubbling": [ - "bubbling: boolean;", - [ - "/**", - " * Specifies if the layout should bubble along", - " * the cell hierarchy.", - " * @default true", - " */" - ] - ], - "enabled": [ - "enabled: boolean;", - [ - "/**", - " * Specifies if event handling is enabled.", - " * @default true", - " */" - ] - ], - "undoHandler": [ - "undoHandler: Function;", - [ - "/**", - " * Holds the function that handles the endUpdate event.", - " */" - ] - ], - "moveHandler": [ - "moveHandler: Function;", - [ - "/**", - " * Holds the function that handles the move event.", - " */" - ] - ], - "resizeHandler": [ - "resizeHandler: Function;", - [ - "/**", - " * Holds the function that handles the resize event.", - " */" - ] - ], - "isEnabled": [ - "isEnabled(): boolean;", - [ - "/**", - " * Returns true if events are handled. This implementation", - " * returns {@link enabled}.", - " */" - ] - ], - "setEnabled": [ - "setEnabled(enabled: boolean): void;", - [ - "/**", - " * Enables or disables event handling. This implementation", - " * updates {@link enabled}.", - " *", - " * @param enabled Boolean that specifies the new enabled state.", - " */" - ] - ], - "isBubbling": [ - "isBubbling(): boolean;", - [ - "/**", - " * Returns true if a layout should bubble, that is, if the parent layout", - " * should be executed whenever a cell layout (layout of the children of", - " * a cell) has been executed. This implementation returns {@link bubbling}.", - " */" - ] - ], - "setBubbling": [ - "setBubbling(value: boolean): void;", - [ - "/**", - " * Sets {@link bubbling}.", - " */" - ] - ], - "getGraph": [ - "getGraph(): mxGraph;", - [ - "/**", - " * Returns the graph that this layout operates on.", - " */" - ] - ], - "setGraph": [ - "setGraph(graph: mxGraph): void;", - [ - "/**", - " * Sets the graph that the layouts operate on.", - " */" - ] - ], - "getLayout": [ - "getLayout(cell: mxCell, eventName?: string): mxGraphLayout | null;", - [ - "/**", - " * Returns the layout for the given cell and eventName. Possible", - " * event names are {@link mxEvent.MOVE_CELLS} and {@link mxEvent.RESIZE_CELLS}", - " * for callbacks on when cells are moved or resized and", - " * {@link mxEvent.BEGIN_UPDATE} and {@link mxEvent.END_UPDATE} for the capture", - " * and bubble phase of the layout after any changes of the model.", - " */" - ] - ], - "beforeUndo": [ - "beforeUndo(undoableEdit: any): void;", - [ - "/**", - " * Called from {@link undoHandler}.", - " *", - " * @param cell Array of {@link mxCell} that have been moved.", - " * @param evt Mouse event that represents the mousedown.", - " *", - " * TODO: what is undoableEdit type?", - " */" - ] - ], - "cellsMoved": [ - "cellsMoved(cells: Array, evt: MouseEvent): void;", - [ - "/**", - " * Called from {@link moveHandler}.", - " *", - " * @param cell Array of {@link mxCell} that have been moved.", - " * @param evt Mouse event that represents the mousedown.", - " */" - ] - ], - "cellsResized": [ - "cellsResized(cells: Array, bounds: Array, prev: Array): void;", - [ - "/**", - " * Called from {@link resizeHandler}.", - " *", - " * @param cell Array of {@link mxCell} that have been resized.", - " * @param bounds {@link mxRectangle} taht represents the new bounds.", - " */" - ] - ], - "getAncestorLayout": [ - "getAncestorLayout(cell: mxCell, eventName: string): mxGraphLayout;", - [ - "/**", - " * Returns the cells to be layouted for the given sequence of changes.", - " */" - ] - ], - "getCellsForChanges": [ - "getCellsForChanges(changes: Array): Array;", - [ - "/**", - " * Returns the cells for which a layout should be executed.", - " */" - ] - ], - "getCellsForChange": [ - "getCellsForChange(change: any): Array;", - [ - "/**", - " * Executes all layouts which have been scheduled during the", - " * changes.", - " * @param change mxChildChange|mxTerminalChange|mxVisibleChange|...", - " */" - ] - ], - "addCellsWithLayout": [ - "addCellsWithLayout(cell: mxCell, result: Array): Array;", - [ - "/**", - " * Adds all ancestors of the given cell that have a layout.", - " */" - ] - ], - "addAncestorsWithLayout": [ - "addAncestorsWithLayout(cell: mxCell, result: Array): Array;", - [ - "/**", - " * Adds all ancestors of the given cell that have a layout.", - " */" - ] - ], - "addDescendantsWithLayout": [ - "addDescendantsWithLayout(cell: mxCell, result: Array): Array;", - [ - "/**", - " * Adds all descendants of the given cell that have a layout.", - " */" - ] - ], - "executeLayoutForCells": [ - "executeLayoutForCells(cells: Array): void;", - [ - "/**", - " * Executes the given layout on the given parent.", - " */" - ] - ], - "layoutCells": [ - "layoutCells(cells: Array, bubble: string): void;", - [ - "/**", - " * Executes all layouts which have been scheduled during the changes.", - " */" - ] - ], - "executeLayout": [ - "executeLayout(cell: mxCell, bubble: string): void;", - [ - "/**", - " * Executes the given layout on the given parent.", - " */" - ] - ], - "destroy": [ - "destroy(): void;", - [ - "/**", - " * Removes all handlers from the {@link graph} and deletes the reference to it.", - " */" - ] - ] - } - ], - "mxCellStatePreview": [ - [ - "/**", - " *", - " * @class mxCellStatePreview", - " *", - " * Implements a live preview for moving cells.", - " */" - ], - { - "constructor": [ - "constructor(graph: mxGraph);", - [ - "/**", - " * Constructs a move preview for the given graph.", - " *", - " * @param {mxGraph} graph Reference to the enclosing .", - " * @constructor", - " * @memberof mxCellStatePreview", - " */" - ] - ], - "graph": [ - "graph: mxGraph;", - [ - "/**", - " * Reference to the enclosing .", - " */" - ] - ], - "deltas": [ - "deltas: mxDictionary;", - [ - "/**", - " * Reference to the enclosing .", - " */" - ] - ], - "count": [ - "count: number;", - [ - "/**", - " * Contains the number of entries in the map.", - " */" - ] - ], - "isEmpty": [ - "isEmpty(): boolean;", - [ - "/**", - " * Returns true if this contains no entries.", - " */" - ] - ], - "moveState": [ - "moveState(state: mxCellState, dx: number, dy: number, add: boolean, includeEdges: boolean): mxPoint;", - [ - "/**", - " *", - " *", - " * @param {mxCellState} state", - " * @param {number} dx", - " * @param {number} dy", - " * @param {boolean} add", - " * @param {boolean} includeEdges", - " * @return {*} {mxPoint}", - " * @memberof mxCellStatePreview", - " */" - ] - ], - "show": [ - "show(visitor: Function): void;", - [ - "/**", - " *", - " *", - " * @param {Function} visitor", - " * @memberof mxCellStatePreview", - " */" - ] - ], - "translateState": [ - "translateState(state: mxCellState, dx: number, dy: number): void;", - [ - "/**", - " *", - " *", - " * @param {mxCellState} state", - " * @param {number} dx", - " * @param {number} dy", - " * @memberof mxCellStatePreview", - " */" - ] - ], - "revalidateState": [ - "revalidateState(state: mxCellState, dx: number, dy: number, visitor: Function): void;", - [ - "/**", - " *", - " *", - " * @param {mxCellState} state", - " * @param {number} dx", - " * @param {number} dy", - " * @param {Function} visitor", - " * @memberof mxCellStatePreview", - " */" - ] - ], - "addEdges": [ - "addEdges(state: mxCellState): void;", - [ - "/**", - " *", - " *", - " * @param {mxCellState} state", - " * @memberof mxCellStatePreview", - " */" - ] - ] - } - ], - "mxCellEditor": [ - null, - { - "graph": [ - "graph: mxGraph;", - [ - "/**", - " * Variable: graph", - " *", - " * Reference to the enclosing .", - " */" - ] - ], - "textarea": [ - "textarea: Element;", - [ - "/**", - " * Variable: textarea", - " *", - " * Holds the DIV that is used for text editing. Note that this may be null before the first", - " * edit. Instantiated in .", - " */" - ] - ], - "editingCell": [ - "editingCell: mxCell;", - [ - "/**", - " * Variable: editingCell", - " *", - " * Reference to the that is currently being edited.", - " */" - ] - ], - "trigger": [ - "trigger: MouseEvent;", - [ - "/**", - " * Variable: trigger", - " *", - " * Reference to the event that was used to start editing.", - " */" - ] - ], - "modified": [ - "modified: boolean;", - [ - "/**", - " * Variable: modified", - " *", - " * Specifies if the label has been modified.", - " */" - ] - ], - "autoSize": [ - "autoSize: boolean;", - [ - "/**", - " * Variable: autoSize", - " *", - " * Specifies if the textarea should be resized while the text is being edited.", - " * Default is true.", - " */" - ] - ], - "selectText": [ - "selectText: boolean;", - [ - "/**", - " * Variable: selectText", - " *", - " * Specifies if the text should be selected when editing starts. Default is", - " * true.", - " */" - ] - ], - "emptyLabelText": [ - "emptyLabelText: '
' | '';", - [ - "/**", - " * Variable: emptyLabelText", - " *", - " * Text to be displayed for empty labels. Default is '' or '
' in Firefox as", - " * a workaround for the missing cursor bug for empty content editable. This can", - " * be set to eg. \"[Type Here]\" to easier visualize editing of empty labels. The", - " * value is only displayed before the first keystroke and is never used as the", - " * actual editing value.", - " */" - ] - ], - "escapeCancelsEditing": [ - "escapeCancelsEditing: boolean;", - [ - "/**", - " * Variable: escapeCancelsEditing", - " *", - " * If true, pressing the escape key will stop editing and not accept the new", - " * value. Change this to false to accept the new value on escape, and cancel", - " * editing on Shift+Escape instead. Default is true.", - " */" - ] - ], - "textNode": [ - "textNode: string;", - [ - "/**", - " * Variable: textNode", - " *", - " * Reference to the label DOM node that has been hidden.", - " */" - ] - ], - "zIndex": [ - "zIndex: number;", - [ - "/**", - " * Variable: zIndex", - " *", - " * Specifies the zIndex for the textarea. Default is 5.", - " */" - ] - ], - "minResize": [ - "minResize: mxRectangle;", - [ - "/**", - " * Variable: minResize", - " *", - " * Defines the minimum width and height to be used in . Default is 0x20px.", - " */" - ] - ], - "wordWrapPadding": [ - "wordWrapPadding: 2 | 1 | 0;", - [ - "/**", - " * Variable: wordWrapPadding", - " *", - " * Correction factor for word wrapping width. Default is 2 in quirks, 0 in IE", - " * 11 and 1 in all other browsers and modes.", - " */" - ] - ], - "blurEnabled": [ - "blurEnabled: boolean;", - [ - "/**", - " * Variable: blurEnabled", - " *", - " * If should be called if