Coder Social home page Coder Social logo

poetwolf / x6 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from antvis/x6

0.0 0.0 0.0 517.06 MB

🚀 JavaScript diagramming library that uses SVG and HTML for rendering.

Home Page: https://x6.antv.vision

License: MIT License

JavaScript 0.74% TypeScript 92.07% Shell 0.32% Less 2.36% HTML 1.59% CSS 2.91%

x6's Introduction

基于 SVG 和 HTML 渲染的 JavaScript 图表库

MIT License Language PRs Welcome website build coverage Language grade: JavaScript

NPM Package NPM Downloads NPM Dependencies Dependency Status devDependencies Status

简体中文 | English

特性

  • 🌱 极易定制:提供基于低学习成本的 SVG/HTML/React/Vue 的节点定制能力;
  • 🚀 开箱即用:内置 10+ 图编辑场景的配套扩展,如框选、对齐线、小地图等;
  • 🧲 数据驱动:基于 MVC 架构模式,用户更加专注于数据逻辑和业务逻辑;
  • 💯 事件驱动:您可以监听图表内发生的任何事件;

安装

NPM/Yarn

# npm
$ npm install @antv/x6 --save

# yarn
$ yarn add @antv/x6

CDNs

为了学习的目的,您可以使用下面任意一个最新版本的 CDN:

<script src="https://unpkg.com/@antv/x6/dist/x6.js"></script>

在生产环境中,我们建议使用特定版本号的链接,以避免版本更新带来的意外破坏:

<script src="https://unpkg.com/@antv/[email protected]/dist/x6.js"></script>

用法

Step 1: 指定渲染图表的容器。

<div id="container" style="width: 600px; height: 400px"></div>

Step 2: 渲染节点和边。

// import from node_modules
import { Graph } from '@antv/x6'
// or use the global variable `X6` exported from CDN links
// const { Graph } = X6

// Create an instance of Graph.
const graph = new Graph({
  container: document.getElementById('container'),
  grid: true
})

// Render source node.
const source = graph.addNode({
  x: 300,
  y: 40,
  width: 80,
  height: 40,
  label: 'Hello',
})

// Render target node.
const target = graph.addNode({
  x: 420,
  y: 180,
  width: 80,
  height: 40,
  label: 'World',
})

// Render edge from source to target.
graph.addEdge({
  source,
  target,
})

HelloWorld

文档

基于 X6 的应用

流程图

流程图是表示算法、工作流或流程的一种框图表示。

draw

DAG 图

DAG是有向无环图的缩写,它是一个有向,没有的图形。它最初是计算机领域中一种常见的数据结构。由于其独特的拓扑结构所带来的优良特性,常被用于处理动态规划、导航中寻找最短路径、数据压缩等算法。

dag

ERD 图

实体关系图 (ERD) 显示了存储在数据库中的实体集之间的关系。实体集是类似实体的集合,这些实体可以定义其属性,通过定义实体、它们的属性并显示它们之间的关系。ER 图经常用来说明了数据库的逻辑结构。

er

社区

欢迎加入X6交流小组(扫描二维码加入),欢迎给我们提 github issues

X6 图可视化交流群

开发

# install yarn and lerna
$ npm install yarn -g
$ npm install lerna -g

# install deps and build
$ yarn bootstrap

# run tests
$ yarn test

# build
$ yarn build

贡献

在获得帮助之前,务必首先查看相关 issues

要成为贡献者,请遵循我们的贡献指南

Contributors

开源协议

该项目下的代码和文档是在 MIT License 下发布。

x6's People

Contributors

afc163 avatar alamhubb avatar bubkoo avatar chunwei avatar daigang666 avatar dependabot-preview[bot] avatar imgbot[bot] avatar imgbotapp avatar jtsang4 avatar lyn-boyu avatar newbyvector avatar qianjujie avatar semantic-release-bot avatar sskyy avatar x6-bot[bot] avatar xrkffgg avatar zdc1111 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.