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 🙏

© 2026 – Pkg Stats / Ryan Hefner

cyf-flow

v2.1.1

Published

访问网站:http://115.190.106.125:8555/#/

Readme

联系作者:qq1476466395(MEISNULL)

访问网站:http://115.190.106.125:8555/#/

图片描述

使用cyf-flow

1.安装

npm i cyf-flow

2.在vue中引入


import cyfFlow from 'cyf-flow'
import 'cyf-flow/dist/index.css'
const app = createApp(App)
app.use(cyfFlow)

3.api介绍

//node里面的x y width height 一定要是数字 number类型
type Props = {
  isPview: boolean//预览模式
  isPanning: boolean //是否正在拖动
  isZoom: boolean//是否缩放
  bg: string //背景图片
  isConnectionType: boolean //是否开启连线
  nodeTypes: NodeType[] //节点类型
  canvasSize: {
    width: number
    height: number
  }//画布的宽高
  connections: any[] //连接线数据
  isShowConfig:boolean //是否显示配置面板
  isCzsm: boolean//是否显示操作说明
  isRightConfig: boolean//是否显示右侧配置面板(自定义--选择单独节点后显示自定义配置面板)
  nodesValue: {//节点数据
    type: Array
    default: () => []
  }
}
type Emit = {
    delNodes:()=>void//删除节点触发
    editNode:()=>void// 双击节点
    handleDragMove:()=>void//节点移动的时候触发
    getcanvasSize:()=>void//获取画布大小
    getConnectionsValue:()=>void//获取连线数据
    getNodesValue:()=>void//获取nodes节点数据
    copyNode:()=>void//复制节点触发
}
//通过ref调用比如 CflowEditorLoaderRef.value.setNodesConfig(id,key,value)
type DefineExpose = {
    startDrag:(event,node)=>void, //将节点放置在画布上
    setNodesConfig:(id,key,value)=>void//设置节点的里面的值
    getNodesConfig:(id)=>void //根据id获取节点
    canvasInit:()=>void //画布初始化
}

4.api使用示例

const nodeTypes =[
     {
        type: "start",
        label: "节点",
        width: 50,
        height: 50,
        color: "green"
    },
    {
        type: "slot",
        label: "自定义",
        width: 50,
        height: 50,
        color: "#000",
        slotName: "slotName",
    },
    {
        type: "html",
        label: "html",
        width: 50,
        height: 50,
        color: "",
        target: `<h1>HTML</h1>`,
    },
]
//这里主要是通过回显节点
const nodesValue = [
    {
      id: "node-1755669869169",
      type: "slot",
      label: "自定义",
      width: 50,
      height: 50,
      color: "#000",
      slotName: "slotName",
      x: 221.828125,
      y: 172.796875,
      obj: {},
    },
  ];
  
//这里主要是通过回显连线
const connections = [
    {
      id: "conn-1755670065311",
      source: "node-1755670062977",
      target: "node-1755670063769",
    },
  ];
  1. FlowPview预览组件--迁移到了编辑组件加了个isPview属性-弃用
type Props = {
  bg: string //背景图片
  connections: Array<any> //连接线数据
  canvasSize: any //画布的宽高
  nodesValue: {// 节点数据
    type: Array
    default: () => []
  }
}
defineExpose({
  setNodesConfig, //设置节点的里面的值
  canvasInit //画布初始化
  setZindex//设置节点的层级setZindex(id,zindex)
  setCanvasOffset // 设置画布的偏移量setCanvasOffset({ x: 0, y: 0 })
})