0.0.2 • Published 4 years ago

canvas-diagram v0.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

diagram-canvas

螺旋状关系图

Installation

$ npm i canvas-diagram --save

Basic usage

// 依赖jq,里面有用到ajax请求数据
import canvasDiagram from 'canvas-diagram'
let canvas = new canvasDiagram({
        elId: 'canvas', // 默认canvas id
        // rectWidth: 80, // 默认文本框宽度
        // rectHeight: 24,  // 默认文本框高度
        // textColor: '#fff', // 默认文字颜色
        // activeTextColor: '#fff',  // 默认选中颜色
        // bgColor: '#acb0bd',
        // activeBgColor: '#f39800',
        // number: 35, // 一圈多少个,决定角度
        // ajaxUrl: 'http://xx.xx.cn/Knowledge/Search?keywords=', // 数据请求地址 
        clickCallback:function(res) {
          //  双击回调
          console.log(res.text);
        }
      });
      canvas.updateData('李健军'); // keywords:值请求数据