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

antv-x6-html2

v1.0.9

Published

another `@antv/x6` html shape, using `single-spa` life cycle hook.

Downloads

37

Readme

antv-x6-html2

another @antv/x6 html shape, using single-spa life cycle hook.

扩展@antv/x6内置html节点,使用类似single-spa的生命周期钩子

  1. 这里参照single-spa的接口,只使用了其中的mount+unmount,这样抽象带来的好处不仅限于react/vue,也可以使用其他框架实现自定义节点
  2. 不管用户使用什么框架实现自定义节点,都可以在传递进来的mount函数里面拿到node监听change:data事件更新自己的UI,实现一些自定义的交互逻辑
  3. 这里注册的HTML2.View(html2-view)针对一些可点击的html组件屏蔽了onMouseUp+onMouseDown避免这两个事件触发x6内部的选择和拖拽逻辑

第三方集成

antv-x6-react

  1. 将x6的各种shape注册成原生的vue组件使用(核心思想是把x6退化成一个view开发者自己处理数据扭转)
  2. 同时支持使用react自定义节点(内部有使用一个DataWatcher自动监听change:data
  3. 初始版本是使用@antv/x6-react-shape来自定义节点,但是后来换成使用antv-x6-html2
  4. 内置一个默认的Portal,会在Portal.getProvider()返回的这个组件挂载的时候,自动使用portal渲染所有的自定义组件
  5. 有实现一些常用的组件Background, Clipboard, Grid, Mousewheel, Selection, Snapline, MiniMap, ContextMenu等widgets

online demos

  1. 基础示例使用了antdInputNumber(一个带按钮的输入框)展示了自定义组件如何做到和x6做数据交互
  2. swimlane 泳道图参照x6官方示例实现
  3. DAG画布参照x6官方的DAG示例实现AlgoNode的节点逻辑与官方示例相比较处理起来更简单
  4. ER图参照x6官方的ER图示例
  5. 展开收起树形图参照x6官方的示例

antv-x6-vue

  1. 这个库实现的功能和antv-x6-react基本一致
  2. ~~当前还是使用@antv/x6-vue-shape实现的,后续也会切换到antv-x6-html2这边~~
  3. 已经切换使用antv-x6-html2

online demos

  1. DAG画布参照x6官方的DAG示例实现AlgoNode的节点逻辑与官方示例相比较处理起来更简单