npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

canvas-flows

v1.0.7

Published

A Vue component to canvas-flows

Downloads

3

Readme

canvas-flows

A canvas flows project

项目演示

演示地址

安装

npm install canvas-flows -S

使用

//ES6
import canvasFlows from 'canvas-flows'
Vue.use(canvasFlows)

// require
var canvasFlows = require('canvasFlows')


// 或者直接使用script导入
<script src="https://unpkg.com/canvas-flows/dist/canvas-flows.js"></script>
<flows v-model="config"></flows>
<script>
export default {
  data () {
    return {
      config: {
        nodes: [
          { id: -1, name: "NEW 1" },
          { id: -2, name: "NEW 2" },
          { id: -3, name: "NEW 3" },
          { id: -4, name: "NEW 4" },
          { id: -5, name: "NEW 5" },
          { id: -6, name: "NEW 6" },
          { id: -7, name: "NEW 7" }
        ],
        sequenceFlows: [
          { sourceRef: 3, targetRef: -1 },
          { sourceRef: -1, targetRef: -2 },
          { sourceRef: -1, targetRef: -3 },
          { sourceRef: -1, targetRef: -4 },
          { sourceRef: -1, targetRef: -6 },
          { sourceRef: -2, targetRef: -5 },
          { sourceRef: -3, targetRef: -5 },
          { sourceRef: -4, targetRef: -5 },
          { sourceRef: -6, targetRef: -5 }
        ]
      }
    }
  }
}
</script>

Props

| name | Description | type |default| | ----------------- | ---------------- | :--------: | :----------: | | value | 数据 |Object| {} | nodeWidth | 节点默认宽度 |Number | 100 | nodeHeight | 节点默高度 |Number | 30 | offsetX | 节点间横向间隔 |Number | 12 | offsetY | 节点间纵向间隔 |Number | 80 | useInputaEdit | 是否启用编辑框 |Boolean | true | fristNodeOnly | 首节点唯一,即首节点不可被连接或删除 |Boolean | true | readonly | 展示模式(不可编辑) |Boolean | false | finishNodes | 已完成节点(展示模式可用) |Array | []

Methods

| 事件名 | 说明 | 参数 | |--------|------ |------ | |add |不传参数默认添加到顶级节点,传入id则从此id处向下添加节点 | id | |next |从id处向下添加子节点 |id | |deleteDot|删除点 |id | |deleteLine|删除线 |id |

Events

| 事件名 | 说明 | 回调参数 | |--------|------ |------ | |check |单击节点时触发 |-- 节点ID | |link |连接节点时触发 |-- {form: name, to: name} | |edit |双击节点时触发 | 节点对象 | |delete|删除节点时触发 | 节点ID |