antv-graphin-vue

the vue toolkit for graph analysis based on g6, based on @antv/graphin
1,439 27
Install
npm install antv-graphin-vue
Latest Version:2.6.13
Vue:3
License:MIT
Last Updated:Jan 22, 2024
Links: GitHub  ·  npm
Maintainer: lloydzhou

graphin-vue

NPM Package NPM Size NPM Downloads MIT License

核心思想

  1. 直接使用@antv/graphin内置的shape和layout逻辑代码

使用一个移除react依赖的@antv/grapin核心库(详情antvis/Graphin#370) 可以在不依赖react的情况下使用graphin内置的shape和layout代码

  1. 使用vue重写ui组件以及behaviors组件以及components组件

Install

yarn add antv-graphin-vue @antv/graphin

Example

online demo

这个是使用jsx实现的vue版本的示例

import { defineComponent, reactive } from 'vue'
import Graphin, { Utils, Behaviors, Components } from 'antv-graphin-vue'
const { DragCanvas, ZoomCanvas, DragNode, ResizeCanvas } = Behaviors
const { MiniMap } = Components

const App = defineComponent({
  components: { Graphin, DragCanvas, ZoomCanvas, DragNode, ResizeCanvas, MiniMap },
  setup(props) {
    const state = reactive({
      data: {},
      layout: {
        type: 'force'
      }
    })
    onMounted(() => {
      state.data = Utils.mock(10).circle().graphin()
    })
    return () => (
      <Graphin :data="data" :layout="layout">
        <DragCanvas />
        <ZoomCanvas />
        <DragNode />
        <ResizeCanvas />
        <MiniMap />
      </Graphin>
    )
  }
})

export default App

Version History

Version Released Vue License
2.6.13 ^3.2.31 MIT
2.6.12 ^3.2.31 MIT
2.6.11 ^3.2.31 MIT
2.6.10 ^3.2.31 MIT
2.6.9 ^3.2.31 MIT
Pre-releases (17)
Version Released Vue License
2.6.9-beta.1 ^3.2.31 MIT
2.6.9-beta.0 ^3.2.31 MIT
2.6.4-beta6 ^3.2.31 MIT
2.6.4-beta5 ^3.2.31 MIT
2.6.4-beta4 ^3.2.31 MIT