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

x6tool

v1.1.0

Published

基于AntV-X6封装的拓扑图编辑器

Downloads

14

Readme

x6tool

基于AntX6封装的拓扑图编辑器

使用方式

  • 安装
npm install x6tool --save
  • 引用
import x6tool from 'x6tool'

初始化

    const containder = document.getElementById('container') as HTMLElement
    graph = new x6tool(containder,options)
  • options参数说明
    options为可选参数
{
    minimap: boolean, //是启用小地图
    edit:boolean    //是否为编辑模式,编辑模式可以对画布上的元素进行编辑
}
  • 获取grpah实例
const instance = graph.getInstance()

instance为Graph的实例对象,关于Graph的方法请参考AntX6

关于左侧元素面板(Stencil)

type groupData= {
    id: string;
    name: string; //分组名称
    datas: {
        id: string;
        label: string; //元素名称
        file: string; //元素的图片地址
    }[];
}[]

graph.initStencil(groupData)

关于导出

目前新增空白区域右键菜单选择导出或者顶部工具条导出(svg,png,jpeg),均使用官方导出插件,但是svg导出transform设置异常,已在代码中进行处理,待测试

新增功能

2023-07-12

  • 增加工具条
  • 连线增加路径点拖动工具及删除工具

2023-07-14

  • 增加数据导出(导出数据分为简易数据和完成数据。简易数据会取消attrs等与业务无关数据;)

   graph.getSimpleData()

   graph.getFullData()
  • 增加数据导入,将json数据直接在画布中呈现做回显
   graph.importData()

2023-07-18

修复平移画布元素显示不全的问题

2023-07-21

  • 增加功能:修改连线颜色
  • 增加事件:选中元素/连线

2023-07-25

  • 修复修改连线颜色会重置之前已修改的连线颜色
window.addEventListener('selected',({detail:Cell})=>{
       console.log(e)
   })