mxGraph:Drawio 使用参数
mxGraph,是一个工具库,提供交互式图表、图形绘制应用。
源代码:
mxGraph : https://github.com/jgraph/mxgraph/tree/v4.0.3
Drawio : https://github.com/jgraph/drawio
应用语言
javascript
属性 参数说明
一、 基本图形
图形 | shape |
---|---|
square | 矩形 |
squareCircle | 圆角矩形 |
round | 圆形 |
ellipse | 椭圆形 |
line | 直线 |
二、复合图形
this.addEntry('price', function()
{
var cell = new mxCell('', new mxGeometry(1, 0, 60, 30), 'shape=price;type=int;html=1;strokeColor=none;fillColor=#000000;fontColor=#ffffff;fontSize=30;align=center;verticalAlign=middle;whiteSpace=nowrap;rounded=0;fontFamily=dzzt');
cell.vertex = true;
cell.value = "99."
var symbol = new mxCell('', new mxGeometry(1, 0, 30, 30), 'shape=price;type=dec;html=1;strokeColor=none;fillColor=#000000;fontColor=#ffffff;fontSize=12;align=center;verticalAlign=middle;whiteSpace=nowrap;rounded=0;fontFamily=dzzt');
symbol.vertex = true;
symbol.geometry.relative = true;
symbol.geometry.offset = new mxPoint(5, 0);
symbol.value = "50"
cell.insert(symbol);
return sidebar.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'price');
}),
];
三、图形属性
属性名 | 归属模块 | 参数说明 |
---|---|---|
editable | graph[STYLE_EDITABLE] | 图形内编辑文本[true/false] |
hide label | format[STYLE_NOLABEL] | 不显示图形文本[true/false] |
deletable | format[STYLE_DELETABLE] | 删除图形属性[true/false] |
rotatable | format[STYLE_ROTATABLE] | 图形旋转属性[true/false] |
resizable | format[STYLE_RESIZABLE] | 变更图形大小[true/false] |
connectable | graph[graph.setConnectable] | 自动连接line[true/false] |
bendable | mxGraph.prototype.cellsBendable | line中点拖动[true/false] |
locked | mxGraph.prototype.cellsLocked | 图形锁定[true/false] |
四、网页CSS参数
参数名 | 归属模块 | 变量类型 | 说明 |
---|---|---|---|
headerHeight | EditorUi.prototype.headerHeight | int | header 的高度 |
toolbarHeigh | EditorUi.prototype.toolbarHeight | int | 工具栏高度 |
formatWidth | EditorUi.prototype.formatWidth | int | format/样式栏宽度 |
footerHeight | EditorUi.prototype.footerHeight | int | footer的高度 |
hsplitPosition | EditorUi.prototype.hsplitPosition | int | sidebar的宽度 |