日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪(fǎng)問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 前端技术 > HTML >内容正文

HTML

html5流程图制作,基于HTML5小巧精悍流程图绘制工具jsPlumb

發(fā)布時(shí)間:2024/1/1 HTML 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 html5流程图制作,基于HTML5小巧精悍流程图绘制工具jsPlumb 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

jsPlumb是一套開(kāi)源的流程圖創(chuàng)建工具?,小巧精悍,使用簡(jiǎn)單.它可以將html中的元素用箭頭、曲線(xiàn)、直線(xiàn)等連接起來(lái),適用于開(kāi)發(fā)Web上的圖表、建模工具等。

jsPlumbToolkit.ready(function () {

// ------------------------ 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) {

return n.type;

};

// 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 = jsPlumbToolkit.newInstance({

idFunction: idFunction,

typeFunction: typeFunction,

nodeFactory: function (type, data, callback) {

jsPlumbToolkit.Dialogs.show({

id: "dlgText",

title: "Enter " + type + " name:",

onOK: function (d) {

data.text = d.text;

// if the user entered a name...

if (data.text) {

// and it was at least 2 chars

if (data.text.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!");

}

// else...do not proceed.

}

});

},

beforeStartConnect:function(node, edgeType) {

// limit edges from start node to 1. if any other type of node, return

return (node.data.type === "start" && node.getEdges().length > 0) ? false : { label:"..." };

}

});

....

});

相關(guān)鏈接

總結(jié)

以上是生活随笔為你收集整理的html5流程图制作,基于HTML5小巧精悍流程图绘制工具jsPlumb的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。