// 获取线段初始化样式 getLeftLinkView() { let LinkView = joint.dia.LinkView.extend({ addVertex: function(evt, x, y) {}, removeVertex: function(endType) {}, pointerdown: function(evt, x, y) { this._click = true; joint.dia.ElementView.prototype.pointerdown.apply(this, arguments); }, pointerup: function(evt, x, y) { if (this._click) { // triggers an event on the paper and the element itself this.notify('cell:click', evt, x, y); } else { joint.dia.ElementView.prototype.pointerup.apply(this, arguments); } } }); return LinkView; }, // 构筑点 setState(x, y, s, label) { let cell = new joint.shapes.fsa.State({ position: { x: x, y: y }, size: { width: 5 || s, height: 5 || s }, // 点的大小 attrs: { text: { text: label }, circle: { 'stroke-width': 1, // 点的线条宽度 'fill': '#af9bff', // 点的填充色
JointJS绘制点和线段
最新推荐文章于 2024-06-27 06:50:43 发布
本文介绍如何利用JointJS库在网页上绘制点和线段,实现交互式的图形用户界面。
摘要由CSDN通过智能技术生成