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

vue-sweet-flow

v1.0.2

Published

Vue-super-flow is a quick and convenient Vue plug-in to realize flow chart.

Downloads

18

Readme

vue-sweet-flow

  • A flowchart editor component base on Vue.
  • Vue flowchart.
  • Vue 流程图。
  • Demo
  • docs

Installation


npm install vue-sweet-flow

yarn add vue-sweet-flow

import SuperFlow from 'vue-sweet-flow'
import 'vue-sweet-flow/lib/index.css'

Vue.use(SuperFlow)

Attributes

|属性 |类型 |默认值 |描述 | |---- | ---- |---- |---- | |draggable |Boolean |true | 是否开启节点拖拽 | |linkAddable |Boolean |true | 是否开启快捷创建 link | |linkEditable |Boolean |true | link 是否可编辑 | |hasMarkLine |Boolean |true | 是否开启拖拽辅助线 | |markLineColor |String |#55abfc | 辅助线颜色 | |origin |Array |[0, 0] | graph 的二维坐标系原点 | |nodeList |Array |[] | 初始化节点列表 | |linkList |Array |[] | 初始化连线列表 | |graphMenu |Array |[] | graph 的右键菜单列表配置 | |nodeMenu |Array |[] | node 右键菜单列表配置 | |linkMenu |Array |[] | link 右键菜单配置 | |enterIntercept |Function |() => true | 创建连线进入节点限制 | |outputIntercept |Function |() => true | 节点生成连线限制函数 | |linkDesc |Function |null | 生成 link 定制描述文字 | |linkStyle |Function |null | 根据 link 定制样式 | |linkBaseStyle |Object |{} | 连线默认样式配置 |

linkDesc

function linkDesc(link) {
   /**
     根据 link 对象的属性判断定制连线描述
   */
   return link.meta ? link.meta.info : ''
}

linkBaseStyle

/*
// 内置默认样式配置
{
   hover: '#FF0000',        // 连线 hover 时颜色
   color: '#666666',        // 连线颜色
   textColor: '#666666',    // 连线描述文字颜色
   textHover: '#FF0000',    // 连线 hover 时描述文字颜色
   font: '14px Arial',      // 连线 描述文字 font 参考 https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/font
   dotted: false,           // 连线 是否是虚线
   lineDash: [4, 4],        // 为虚线时 虚线参数  参考:https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/setLineDash
   background: 'rgba(255,255,255,0.6)'  // 描述文字背景  
}
*/

{
  // ... 可选属性 参考内置默认样式 用来覆盖连线样式的默认值
}

linkStyle

function linkStyle(link) {
   /**
     根据 link 对象的属性判断定制连线样式
   */
   return {
      // ... 可选属性 参考:[linkBaseStyle](#linkBaseStyle)
   }
}

Methods

|方法名 |说明 |参数 | |---- | ---- |---- | |selectAll | 选中所有进行拖拽修改 origin |---- | |toJSON | 将 graph 对象转为普通 json 对象 |---- | |getMouseCoordinate | 获取当前鼠标在 graph 坐标系的坐标 |clientX, clientY | |addNode | 添加节点 |options |

Example

默认示例

进阶示例

发包

项目根目录下 packages:用于存放所有的组件 examples:用于进行测试组件,把src改为examples https://blog.csdn.net/qq_43322436/article/details/130805129 https://www.jianshu.com/p/38c4b1958016