html5流程图制作,基于HTML5⼩巧精悍流程图绘制⼯具
jsPlumb
jsPlumb是⼀套开源的流程图创建⼯具 ,⼩巧精悍,使⽤简单.它可以将html中的元素⽤箭头、曲线、直线等连接起来,适⽤于开发Web上的图表、建模⼯具等。
nodeselector
// ------------------------ toolkit setup ------------------------------------
// This function is what the toolkit will use to get an ID from a node.
var idFunction = function (n) {
return n.id;
};
// This function is what the toolkit will use to get the associated type from a node.
var typeFunction = function (n) {
pe;
};
// get the various dom elements
var mainElement = document.querySelector("#jtk-demo-flowchart"),
canvasElement = mainElement.querySelector(".jtk-demo-canvas"),
miniviewElement = mainElement.querySelector(".miniview"),
nodePalette = mainElement.querySelector(".node-palette"),
controls = mainElement.querySelector(".controls");
// Declare an instance of the Toolkit, and supply the functions we will use to get ids and types from nodes.
var toolkit = wInstance({
idFunction: idFunction,
typeFunction: typeFunction,
nodeFactory: function (type, data, callback) {
jsPlumbToolkit.Dialogs.show({
id: "dlgText",
title: "Enter " + type + " name:",
onOK: function (d) {
< = d.text;
// if the user entered
if () {
// and it was at least 2 chars
if (length >= 2) {
// set an id and continue.
data.id = jsPlumbToolkitUtil.uuid();
callback(data);
}
else
// else advise the user.
alert(type + " names must be at least 2 characters!");
}
// do not proceed.
}
});
},
beforeStartConnect:function(node, edgeType) {
// limit edges from start node to 1. if any other type of node, return
return (pe === "start" && Edges().length > 0) ? false : { label:"..." }; }
});
....
});
相关链接

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。