mxgraph

How i can use mxGraph instance in node.js

蹲街弑〆低调 提交于 2021-02-10 07:26:59
问题 I'm trying use mxGraph instance in node.js to prepare XML export with my custom logic (works with front-end, i'm just moving logic to back-end). Is it possible to use full API of mxGraph instance in nodej.js, i'm wondering about methods like graph.getDefaultParent() etc. I'm trying load new instance using correct, generated by plugin XML, but code below won't affect on model (no other errors) const dom = new JSDOM(); global.window = dom.window; global.document = dom.window.document; global

mxGraph: Which event is fired when I move a handle point of an edge?

时光毁灭记忆、已成空白 提交于 2021-02-08 06:57:21
问题 I move the point and I want to save the position after the movement. How can I catch this event? I know, the edge gets the points after moving, I can find control points in the geometry. But I need the moment of the end of movement. 回答1: I'm not sure if it helps, but I usually have a listener to mxEvent.CHANGE, and process each change... Something like this: model.addListener(mxEvent.CHANGE, function(sender, evt) { var changes = evt.getProperty('edit').changes; for (var i = 0; i < changes

Set mxgraph cell only draggable within the canvas width

你说的曾经没有我的故事 提交于 2021-01-29 06:01:01
问题 I have multiple vertex cells in the graph. I am using JavaScript library mxGraph . When i drag the cell from the boundary of canvas, the canvas extends. I want to disallow the cell drag. Is there some function available to limit the drag within the canvas boundaries? There is function called: graph.setCellsMovable(false); but this one lock overall, i need to set cell movement false only if user drag it outside the boundary. 回答1: You should give a try to the mxgraph.autoExtend property which

How do I use the curved edge style in mxGraph

天涯浪子 提交于 2021-01-27 05:45:54
问题 A recent release of mxGraph has added curves as a style for edges. I expected this to be an edge routing style, but it seems not. Could anyone show me a small example of a graph with curved edges? 回答1: It's actually the shape style of the edge: style = graph.getStylesheet().getDefaultEdgeStyle(); style[mxConstants.STYLE_CURVED] = '1'; Sets it for as the default for all edges. Edge styles are really the positioning of the control points of the edge between the source and target. The curve isn

How do I use the curved edge style in mxGraph

守給你的承諾、 提交于 2021-01-27 05:43:56
问题 A recent release of mxGraph has added curves as a style for edges. I expected this to be an edge routing style, but it seems not. Could anyone show me a small example of a graph with curved edges? 回答1: It's actually the shape style of the edge: style = graph.getStylesheet().getDefaultEdgeStyle(); style[mxConstants.STYLE_CURVED] = '1'; Sets it for as the default for all edges. Edge styles are really the positioning of the control points of the edge between the source and target. The curve isn

is it possible to use access keys to select objects/elements on the drawing area and able to read the content through screen reader? [closed]

不打扰是莪最后的温柔 提交于 2020-09-02 01:01:41
来源: https://stackoverflow.com/questions/63506990/is-it-possible-to-use-access-keys-to-select-objects-elements-on-the-drawing-area

Add anchors to mxGraph

坚强是说给别人听的谎言 提交于 2020-04-18 07:16:41
问题 I run an Angular7 project in typescript and I'm trying to use mxGraph through typing. I found this typing project from github which is the most up to date I found Now I'm trying to add anchors to the vertices but unsuccessfully. From this example I should do this : mxShape.prototype.constraints = [new mxConnectionConstraint(new mxPoint(0.25, 0), true), ...]); But Visual Studio is telling me that constraints does not exist on type mxShape . I know for a fact the the typing is not fully updated

mxGraph 初级使用 & 层级布局

半城伤御伤魂 提交于 2020-03-12 13:24:30
mxGraph 简介 • 简介 http://jgraph.github.io/mxgraph/ • 上手指南 https://jgraph.github.io/mxgraph/docs/manual.html#1.7.1 • 丰富的使用示例 http://jgraph.github.io/mxgraph/javascript/index.html • API 文档 https://jgraph.github.io/mxgraph/docs/js-api/files/index-txt.html • 完整代码: https://github.com/wewoor/mxgraph-demo/tree/master/src/hierarchicalLayout npm 安装和使用 $ npm i mxgraph var Mx = require("mxgraph")({ mxImageBasePath: "./src/images", mxBasePath: "./src" }); 几个概念 • mxGraph 设计用来提供主要的公共 API • mxGraphModel mxGraphModel 是描述一个 graph 的核心模型对象,对 graph 结构的增删改查都是通过 model 对象提供的 API。但是, 所以当我们添加一个 cell 时,则是将 cell 是添加到了某个

mxGraph - Displaying a diagram by loading a XML

有些话、适合烂在心里 提交于 2020-01-30 11:43:07
问题 With the help of How to get the XML from mxGrpah diagram? able to get the dynamic XML from the graph editor. Now, I need to display the diagram by loading a XML (reverse algorithm) 回答1: Ok, similarly to How to get the XML from mxGrpah diagram? answer, it is not again clear to me how to get the graph object in which the whole graph is saved so I propose the following workaround: 1) Get the reference of the original graph object into your index.html code i . Add a global variable into index