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

@toystory/jessie

v1.3.3

Published

A plugin of shareholding, base on G6.

Downloads

8

Readme

Jessie股权结构组件

基于G6框架二次封装

安装

yarn add @toystory/jessie -S

npm i @toystory/jessie -S

使用

注册

在main.js中引入

import Jessie, {
  registerExpModelRect,
  registerFundCubicVertical,
  registerGroupCombo,
  generateToolTip
} from '@toystory/jessie'

const tooltip = generateToolTip({
  locationX: 20,
  locationY: 0,
  triggerMode: [],
  contentName: 'company',
  showName: 'company-shape'
})


const expModelRect = registerExpModelRect() // 注册公司节点组件
const fundEdge = registerFundCubicVertical() // 注册连接线组件
const groupCombo = registerGroupCombo() // 注册分组组件

const defaultConfig = {
  modes: {
    default: ['drag-canvas', 'drag-node', 'zoom-canvas', 'drag-combo', {
      type: 'lasso-select',
      delegateStyle: {
        fill: '#f00',
        fillOpacity: 0.05,
        stroke: '#f00',
        lineWidth: 1
      },
      includeEdges: false
    }]
  },
  defaultNode: {
    type: `${expModelRect.type}`,
    labelCfg: {
      style: {
        fill: '#000000A6',
        fontSize: 10
      }
    },
    style: {
      stroke: '#72CC4A',
      width: 150
    }
  },
  defaultEdge: {
    type: `${fundEdge.type}`
  },
  defaultCombo: {
    type: groupCombo.type,
    fixCollapseSize: [220, 60],
    style: {
      radius: 8
    },
    labelCfg: {
      position: 'center',
      style: {
        fill: '#666',
        fontWeight: 'bold',
        lineHeight: 30,
        fontSize: 14
      }
    }
  }
}

const jessieGraph = new Jessie({
  container, // 绘图容器,传入id或者dom对象
  data, // 源数据
  graphOptions: defaultConfig, // graph配置,参考G6
  plugins: [tooltip] // graph插件,参考G6
})

方法

| 方法名 | 描述 | 参数 | 返回 | | :----: | ---- | ---- | ---- | | on | 绑定事件 | (eventName: String,callback: (nodeModel, item) => {}) || | collapseAllCombos | 折叠所有分组 | | | | refreshLayout | 刷新布局 | | | | getZoom | 获取当前缩放比例 | | 缩放比例0-1 | | setZoom | 设置缩放比例| 缩放比例0-1 | | | exportPicture | 导出图片 | | | | exportData | 导出数据 | | data数据 | | saveNode | 更新保存节点 | (item, nodeModel) | |