joint.js 第一章
来源:互联网 发布:软件开发简介 编辑:程序博客网 时间:2024/05/22 00:36
//初始化绘图板function Paper() { var graph = new joint.dia.Graph; //生成画板 var paper = new joint.dia.Paper({ //生成画布 el: $('#display_box'), width: 800, height: 500, model: graph, gridSize: 1 });
var cell1=getShape(1);//获取图形graph.addCells([cell1]);}
//构建形状,可以根据条件创建
function getShape(index,addnew){ var cell;cell=getRect(0,0,'rgb(238,244,247)','矩形',100,50);return cell;}/** * 生成矩形 * px x 坐标 * py y 坐标 * pbackground 背景色 * ptext 显示文本 * pwidth 宽带 * pheight 高度 */function getRect(px, py, pbackground, ptext,pwidth,pheight){ var cell = new joint.shapes.basic.Rect({ position: { x: px, y:py }, size: { width: pwidth, height: pheight }, attrs: { //attr SVG attr prop- custom data rect: { fill:pbackground, 'stroke': 'black', 'stroke-width': '1px' }, text: { text: ptext, fill: 'black' } } }); return cell;}
阅读全文
0 0
- joint.js 第一章
- 使用joint.js 绘制图
- JS第一章
- JS第一章
- motor joint
- Joint关节
- Joint Stacks
- Joint SVD
- JQuery第一章js 上机+课后
- JS高级程序第一章理解
- JS权威指南 读书笔记 第一章 JavaScript概述
- out joint query(原创)
- 联合竞标 joint bid
- Joint Bilateral Upsampling
- Joint Venture - JV
- LIBGDX BOX2D JOINT介绍
- Hinge Joint 铰链关节
- Character Joint 角色关节
- MVP框架设计详解
- shell 使用指定的分割符来分割字符串
- Sklearn工具包---train_test_split随机划分训练集和测试集
- opengles学习笔记
- 杂乱的知识点
- joint.js 第一章
- 平衡二叉树
- 7-20 删除字符串中的子串(20 分)
- 【转载】细说form表单
- 图像插值算法之双三次插值
- 激光雷达LIDAR的应用
- 分布式Session的几种实现方式
- 结构体
- Linux目录结构和常用命令