Coder Social home page Coder Social logo

antvis / x6 Goto Github PK

View Code? Open in Web Editor NEW
5.4K 60.0 1.6K 2.18 GB

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

Home Page: https://x6.antv.antgroup.com

License: MIT License

JavaScript 1.19% TypeScript 95.05% Shell 0.04% Less 3.32% HTML 0.22% Vue 0.16%
diagramming graph svg antv graph-editor dag flowchart uml-diagram erdiagram diagram

x6's Introduction

简体中文 | English

flow

X6 是 AntV 旗下的图编辑引擎

提供简单易用的节点定制能力和开箱即用的交互组件,方便我们快速搭建流程图、DAG 图、ER 图等图应用

build NPM Package NPM Downloads

MIT License Language PRs Welcome website

特性

  • 🌱  极易定制:支持使用 SVG/HTML/React/Vue/Angular 定制节点样式和交互
  • 🚀  开箱即用:内置 10+ 图编辑配套扩展,如框选、对齐线、小地图等
  • 🧲  数据驱动:基于 MVC 架构,用户更加专注于数据逻辑和业务逻辑
  • 💯  事件驱动:完备的事件系统,可以监听图表内发生的任何事件

兼容环境

  • 现代浏览器
  • 支持服务端渲染。
Firefox
Firefox
Chrome
Chrome
Safari
Safari
last 2 versions last 2 versions last 2 versions

安装

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

# yarn
$ yarn add @antv/x6

示例

<div id="container" style="width: 600px; height: 400px"></div>
import { Graph } from '@antv/x6'

const graph = new Graph({
  container: document.getElementById('container'),
  grid: true,
})

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

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

graph.addEdge({
  source,
  target,
})

链接

本地开发

# 安装项目依赖和初始化构建
$ pnpm install

# 进入到指定项目开发和调试
cd packages/x6
pnpm run build:watch

# 启动 example 查看效果
cd examples/x6-example-features
pnpm run start

参与共建

如果希望参与到 X6 的开发中,请遵从我们的贡献指南。如果你贡献度足够活跃,你可以申请成为社区协作者。

Contributors

开源协议

该项目的代码和文档基于 MIT License 开源协议。

x6's People

Contributors

afc163 avatar bubkoo avatar cnyballk avatar cyrilluce avatar daigang666 avatar damnright avatar danielleefu avatar dependabot-preview[bot] avatar dependabot[bot] avatar drl990114 avatar eve-sama avatar hqidea avatar jtsang4 avatar lloydzhou avatar lyn-boyu avatar newbyvector avatar niexq avatar njshuisheng avatar opportunityliu avatar orientmoon avatar qianjujie avatar quadrantiv avatar semantic-release-bot avatar struggleroue avatar wseven7677 avatar x6-bot[bot] avatar xiawenqi avatar xrkffgg avatar zdc1111 avatar zzyyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

x6's Issues

minimap

Expected Behavior

目前功能缺失。

Possible Solution

可能需要注意的几个点:

  1. 支持配置 minimap 的细节程度,如只渲染节点、节点不渲染 label 等
  2. 支持配置 minimap 的节点/边的样式,如节点背景颜色等

Additional Context

minimap 通常用于一些重编辑场景,是图编辑框架的基础设施之一。

collapse-mamager 中名词统一

Expected Behavior

Current Behavior

Possible Solution

统一使用 collapse、collapsable 这类名词。

Steps To Reproduce

  1. ...
  2. ...
  3. ...
Error Message & Stack Trace

<!-- Provide a log message if relevant -->

Additional Context

Your Environment

  • x6: [e.g. 1.0.0]
  • OS: [e.g. macOS Sierra 10.12.3]
  • Browser: [e.g. chrome 78.0.3904.108]

无限大画布

Expected Behavior

提供一种无限大的画布方案,与现在的固定画布大小方案一起,构成两种画布大小方案。通过选项指定使用哪种画布方案。

Possible Solution

暂时没有思考实现细节。

Additional Context

所谓“无限大画布”,其实不是真正的无限大,只是当添加节点到画布边缘时,根据视口大小自动扩大画布,相反情况时自动缩小画布。

Weekly Digest (29 December, 2019 - 5 January, 2020)

Here's the Weekly Digest for antvis/x6:


ISSUES

Last week 2 issues were created.
Of these, 0 issues have been closed and 2 issues are still open.

OPEN ISSUES

💚 #63 split main x6 module, by bubkoo
💚 #62 x6-example-drawio中的连线无法绘制, by loongmxbt

NOISY ISSUE

🔈 #63 split main x6 module, by bubkoo
It received 1 comments.


PULL REQUESTS

Last week, 2 pull requests were created, updated or merged.

UPDATED PULL REQUEST

Last week, 1 pull request was updated.
💛 #63 split main x6 module, by bubkoo

MERGED PULL REQUEST

Last week, 1 pull request was merged.
💜 #60 feat: react label, by bubkoo


COMMITS

Last week there were 4 commits.
🛠️ fix: update demo for minimap by bubkoo
🛠️ feat(minimap): custom cell style by cell itself by bubkoo
🛠️ docs: update usage by bubkoo
🛠️ feat(x6): add some convenient methods on namespace "x6" by bubkoo


CONTRIBUTORS

Last week there was 1 contributor.
👤 bubkoo


STARGAZERS

Last week there was 1 stargazer.
budlion
You are the star! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository antvis/x6 to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

feat: change the util export

Expected Behavior

import { util } from './util'

Possible Solution

Additional Context

可以大幅简化内部代码的编写冗余度。

简化 getAnchors 的返回值

  new Graph(container, { 
      getAnchors(cell) {
        if (cell != null && this.model.isNode(cell)) {
          return [
            new Anchor({ point: new Point(0.5, 0) }),
            new Anchor({ point: new Point(0, 0.5) }),
            new Anchor({ point: new Point(1, 0.5) }),
            new Anchor({ point: new Point(0.5, 1) }),
          ]
        }
        return null
      },
  })

每次都需要 new Point 和 new Anchor,有点繁琐。

Expected Behavior

  new Graph(container, { 
      getAnchors(cell) {
        if (cell != null && this.model.isNode(cell)) {
          return [
            [0.5, 0],
            [0, 0.5],
            [1, 0.5],
            [0.5, 1],
          ]
        }
        return null
      },
  })

Possible Solution

Additional Context

支持 Graph 方法链式调用

Expected Behavior

Possible Solution

Additional Context

Graph 类作为用户交互的核心类,其中包含大量方法,提供链式调用语法糖。

支持 toolbar 右对齐

Expected Behavior

Possible Solution

  • flex 默认支持右侧对齐
  • 增加 align 选项

Additional Context

某些放在画布右上角的 toolbar 需要右侧对齐样式。

增强从侧边栏拖入画布的交互

Expected Behavior

拖动进入画布时,触发画布上的一系列交互响应,就像在拖动画布内的节点一样。应该触发以下一些交互:

  • guide-line
  • 在节点上放置拖拽结果时的响应
  • 在边上放置拖拽结果时的响应

Possible Solution

根源上解决:拖拽进入画布后就创建真实的节点并跟着鼠标移动。

Additional Context

x6-example-drawio中的连线无法绘制

Expected Behavior

Current Behavior

General中的第6行3、4、5元素,第7行连线元素,拖动到画布后均为 透明方框 或 方框,移动后有时会直接报错。
image

image

Possible Solution

Steps To Reproduce

  1. 运行drawio example
  2. 拖动 General中的第6行3、4、5元素,第7行连线元素
  3. 显示为白框或方框
  4. 再次拖动元素
  5. 报错
  6. 其余元素均正常
Error Message & Stack Trace
FlexArrowShape.drawEdgeShape
../../packages/x6/es/shape/arrow-connector.js:66
  63 |     pts[i0].y === pts[0].y) {
  64 |     i0 += 1;
  65 | }
> 66 | const dx = pts[i0].x - pts[0].x;
     | ^  67 | const dy = pts[i0].y - pts[0].y;
  68 | const dist = Math.sqrt(dx * dx + dy * dy);
  69 | if (dist === 0) {
View compiled
FlexArrowShape.draw
http://localhost:8000/umi.js:251327:22
  251324 |             pts.push(new _struct__WEBPACK_IMPORTED_MODULE_5__["Point"](p.x / s, p.y / s));
  251325 |         }
  251326 |     });
> 251327 |     this.drawEdgeShape(c, pts);
         |          ^  251328 | }
  251329 | else {
  251330 |     this.drawNodeShape(c, x, y, w, h);
View source
FlexArrowShape.redrawSvgShape
../../packages/x6/es/shape/shape-base.js:273
  270 | redrawSvgShape() {
  271 |     const canvas = this.createCanvas();
  272 |     if (canvas != null) {
> 273 |         this.draw(canvas);
      | ^  274 |         if (this.elem != null && this.elem !== canvas.root) {
  275 |             this.elem.insertAdjacentHTML('beforeend', canvas.root.outerHTML);
  276 |         }

Additional Context

Your Environment

  • yarn
  • x6: latest
  • OS: macOS Sierra
  • Browser: chrome and safari

Weekly Digest (8 December, 2019 - 15 December, 2019)

Here's the Weekly Digest for antvis/x6:


ISSUES

Last week 24 issues were created.
Of these, 12 issues have been closed and 12 issues are still open.

OPEN ISSUES

💚 #41 梳理 handler 中的 className, by bubkoo
💚 #40 提供 anchor 可连接性接口, by bubkoo
💚 #38 examples 无法启动, by BinWu1989
💚 #36 label spacing is inoperative, by bubkoo
💚 #33 add stylesheet for named shapes, by bubkoo
💚 #31 取消从data中取label, by bubkoo
💚 #30 支持通过选项禁用node热点连线功能, by bubkoo
💚 #29 支持通过选项禁用edge控制点渲染和交互, by bubkoo
💚 #27 增强从侧边栏拖入画布的交互, by bubkoo
💚 #26 连线过程中提示可连接的 anchor 或 port, by bubkoo
💚 #23 提供河流图DEMO, by bubkoo
💚 #21 refactor: panning-accessor and panning-manager, by bubkoo

CLOSED ISSUES

❤️ #39 支持用 Shape 创建 Anchor, by bubkoo
❤️ #37 Win下无法用delete键删除元素,只能使用Backspace键删除元素, by loongmxbt
❤️ #35 node and edge handler knob can be image shapes, by bubkoo
❤️ #34 add static method Image.fromSVG , by bubkoo
❤️ #32 feat: flowchart connection, by bubkoo
❤️ #28 简化 getAnchors 的返回值, by bubkoo
❤️ #25 支持 toolbar 右对齐, by bubkoo
❤️ #24 feat: flowchart editor, by bubkoo
❤️ #22 对无限大画布提供重新计算滚动区域特性, by bubkoo
❤️ #20 collapse-mamager 中名词统一, by bubkoo
❤️ #19 feat: change the util export, by bubkoo
❤️ #18 feat: infinity canvas, by bubkoo

NOISY ISSUE

🔈 #18 feat: infinity canvas, by bubkoo
It received 8 comments.


PULL REQUESTS

Last week, 3 pull requests were created, updated or merged.

MERGED PULL REQUEST

Last week, 3 pull requests were merged.
💜 #32 feat: flowchart connection, by bubkoo
💜 #24 feat: flowchart editor, by bubkoo
💜 #18 feat: infinity canvas, by bubkoo


COMMITS

Last week there were 107 commits.
🛠️ fix: handle warnings from lgtm.com by bubkoo
🛠️ fix: fix warnings from lgtm.com by bubkoo
🛠️ refactor: update anchor style by bubkoo
🛠️ style: update preset for anchor by bubkoo
🛠️ fix: shoule handle Delete key in Windows support both Delete and Backspace to delete a cell by bubkoo
🛠️ fix: shoule handle Delete key in Windows support both Delete and Backspace to delete an cell fix #37 by bubkoo
🛠️ fix: should convert delete to del for mousetrap by bubkoo
🛠️ fix: migrating from Legacy Lifecycles by bubkoo
🛠️ refactor: update flowchart example by bubkoo
🛠️ refactor: update splitbox example by bubkoo
🛠️ refactor(splitbox): do not use flex anymore, use absolute position by bubkoo
🛠️ fix: fix edge preview arrow style should not draw edge preview as outline, otherwise the arrow will not filled by bubkoo
🛠️ style: remove commented code by bubkoo
🛠️ feat: render preview edge on decorator pane by bubkoo
🛠️ fix: anchors not align with the center of html border by bubkoo
🛠️ feat: create anchor with native shapes default use ellipse as an anchor shape fix #39 by bubkoo
🛠️ feat(anchor): auto adsorb auto adsorb nearest anchor when find an edge's target anchor by bubkoo
🛠️ feat: add induction area option for Anchor by bubkoo
🛠️ style: remove log by bubkoo
🛠️ fix: fix can not connect to node in(child) an html-connectable-node by bubkoo
🛠️ style: remove log by bubkoo
🛠️ fix: remove unused labelPadding style update source code and examples #36 by bubkoo
🛠️ feat(anchor): simplify the creation of Anchor fix #28 by bubkoo
🛠️ feat: add static method Image.fromSvg parsing svg string to image with test case close #34 by bubkoo
🛠️ feat: auto focus the container on creating a graph instance by bubkoo
🛠️ feat: support dropping cell into a group by bubkoo
🛠️ feat: can specify null-able geometry when create cells by bubkoo
🛠️ fix: return the right drop target by bubkoo
🛠️ feat: growing along different width and height by bubkoo
🛠️ feat: add default key formator for shortcut by bubkoo
🛠️ fix: update dropdown style by bubkoo
🛠️ fix: remove scrollToCenter by bubkoo
🛠️ fix: center, fit the viewport by bubkoo
🛠️ fix: live preview connection by bubkoo
🛠️ feat(connection): can disable hotspot connectting on source node by bubkoo
🛠️ feat: add ensureValue by bubkoo
🛠️ chore: publish by bubkoo
🛠️ chore(publish): using yarn's publish command by bubkoo
🛠️ chore: copy less files by bubkoo
🛠️ chore: no-git-tag-version by bubkoo
🛠️ chore(release): publish %s - @antv/[email protected] - @antv/[email protected] - @antv/[email protected] - @antv/[email protected] - @antv/[email protected] by bubkoo
🛠️ chore: publish by bubkoo
🛠️ chore: update publish message by bubkoo
🛠️ chore(release): publish %v - @antv/[email protected] - @antv/[email protected] - @antv/[email protected] - @antv/[email protected] - @antv/[email protected] by bubkoo
🛠️ chore: publish by bubkoo
🛠️ Merge branch 'feature/flowchart' by bubkoo
🛠️ Merge branch 'master' into feature/flowchart by bubkoo
🛠️ chore: build core packages after bootstrap by bubkoo
🛠️ docs: update dev by bubkoo
🛠️ style: update dep by bubkoo
🛠️ refactor: update dep by bubkoo
🛠️ feat: flowchart render, dnd, settings by bubkoo
🛠️ feat: add get set method of cell data by bubkoo
🛠️ feat: add option for force redraw on data changed shouldRedrawOnDataChange(change: DataChange): boolean by bubkoo
🛠️ feat: export command by bubkoo
🛠️ fix: import menu style in context-menu by bubkoo
🛠️ fix: fix dropdown style in toolbar by bubkoo
🛠️ feat: support toolbar align right by bubkoo
🛠️ refactor: auto reset scrollbar after init by bubkoo
🛠️ fix: fix z-index of container when infinite by bubkoo
🛠️ feat: wheel => mouseWheel, for readable by bubkoo
🛠️ docs: update contribute guide by bubkoo
🛠️ Merge branch 'feature/flowchart' of https://github.com/antvis/x6 into feature/flowchart by bubkoo
🛠️ refactor: use native graph by bubkoo
🛠️ fix: fix z-index bug when use size-sensor by bubkoo
🛠️ fix: remove base init method by bubkoo
🛠️ feat: export SVGCanvas2D by bubkoo
🛠️ refactor: remove shape from addon by bubkoo
🛠️ chore: specify parser for files without extension by bubkoo
🛠️ chore: cache yarn by bubkoo
🛠️ chore: no package lock on bootstrap by bubkoo
🛠️ chore: 🔥 automatically closing issues fixed in pull request This action will automatically close issues fixed in pull requests that doesn't target the default branch. by bubkoo
🛠️ chore: 🔥 automatically closing issue in pr by bubkoo
🛠️ refactor: use native graph by bubkoo
🛠️ fix: fix z-index bug when use size-sensor by bubkoo
🛠️ fix: remove base init method by bubkoo
🛠️ feat: export SVGCanvas2D by bubkoo
🛠️ refactor: remove shape from addon by bubkoo
🛠️ feat: detect container's rezie event and auto adjust viewport fixed #22 by bubkoo
🛠️ feat: add wheel accessor by bubkoo
🛠️ chore: bootstrap by bubkoo
🛠️ feat: infinite canvas example by bubkoo
🛠️ feat: infinite canvas example by bubkoo
🛠️ feat: add wheel handler for zoom graph by bubkoo
🛠️ feat: add init method by bubkoo
🛠️ refactor: remove unnecessary type convert by bubkoo
🛠️ feat: specified passive: false when add wheel listener for zoom graph by bubkoo
🛠️ feat: detect whether passive is supported by bubkoo
🛠️ fix: properties from applyMixins should be inited in constructor by bubkoo
🛠️ chore: skip all confirmation prompts when lerna clean by bubkoo
🛠️ refactor: uniform collapse name fixed #20 by bubkoo
🛠️ test: fix applyMixins test case by bubkoo
🛠️ refactor(graph): split huge graph class to small modules finish #12 #12 by bubkoo
🛠️ refactor: remove unused constants of event-name by bubkoo
🛠️ refactor: use more semantic export by bubkoo
🛠️ refactor: split registry module by bubkoo
🛠️ test: fix test case by bubkoo
🛠️ feat: support remove mouseWheel listener refactor dom-event file structure by bubkoo
🛠️ refactor: mouseWheelEvent is deprecated, use WheelEvent by bubkoo
🛠️ chore: change file path by bubkoo
🛠️ chore: 🥦 automatically labelling issue base on keyworks by bubkoo
🛠️ chore: 🧲 automatically labelling pr base on file paths by bubkoo
🛠️ chore: 🎊 automatically labelling pr base on branch name by bubkoo
🛠️ chore: 🌡 automatically labelling pr base on patches size by bubkoo
🛠️ chore: 🦊 automatically deleting merged branch by bubkoo
🛠️ fix: handle warnings of lgtm.com by bubkoo
🛠️ style: remove no-needed backslash by bubkoo


CONTRIBUTORS

Last week there was 1 contributor.
👤 bubkoo


STARGAZERS

Last week there were 9 stagazers.
loongmxbt
tizzybec
dengfuping
zhanba
zxc0328
tkitesy
DorothyGuan
gigi1121
BinWu1989
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository antvis/x6 to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

feat: data driven

Expected Behavior

类似 D3 的数据驱动(x6 节点属性配置支持,如 x: (data: T) => number),完整的数据进 => 完整的数据出。

Possible Solution

graph.addNode({
    x: () => 240,
    y: () => 240,
    width: (data) => data.width,
    height: (data) => data.height,
    label: (data) => data.label,
})

Additional Context

Command 扩展

interface Command {
  name: string,
  shortcut?: string,
  handler: (graph: Graph, ...args[]) => any,
  enable: () => void,
  disable: () => void,
}
  • 根据不同的业务提供语义性更强的 Command 系统
  • UI 组件监听 Command 状态变化并更新 UI 的可用性

提供 anchor 可连接性接口

Expected Behavior

Possible Solution

不可连接时就不渲染,进而保证改 anchor 不可交互。

Additional Context

列举几个可能的应用场景:

  • 一个 anchor 只能连接一条边
  • anchor 有业务含义,只能连接某些类型的边

与 react 集成方案

Expected Behavior

支持使用 react 组件方式定义画布。

Possible Solution

暂时没有方案细节,可作为长远计划。当项目文档和接口稳定的时候,考虑对应的方案。

Additional Context

对无限大画布提供重新计算滚动区域特性

Expected Behavior

当窗口 resize 等操作导致 container resize 时,需要重新计算可滚动范围。

Possible Solution

在选项中提供开关,监听 window 或 container 的 resize 事件,调用 sizeDidChange 实现重新计算。

Additional Context

梳理 handler options,与 graph 的接口联动

Expected Behavior

Possible Solution

Additional Context

对 handler 的设置选项,除了初始化 Graph 时提供选项之外,还需要在 Graph 中提供相应的行为控制和样式控制接口,并保证 graph.options 中数据的一致性。

examples 无法启动

根据项目中的源代码,运行examples-drawio项目时,无法编译项目,启动时也无法启动
(1)npm install时出错,提示可能是权限问题,yarn install无该错误
(2)启动项目时出错,无法正常启动

基于新版 events 类,梳理自定义事件

Expected Behavior

xxx.on 进行事件监听时自动提示支持的事件名和可用的回调参数。

Possible Solution

Additional Context

  • 梳理支持的自定义事件。
  • 借助 TS 的能力给用户更好的开发体验。

Weekly Digest (22 December, 2019 - 29 December, 2019)

Here's the Weekly Digest for antvis/x6:


ISSUES

Last week 8 issues were created.
Of these, 6 issues have been closed and 2 issues are still open.

OPEN ISSUES

💚 #60 feat: react label, by bubkoo
💚 #57 请问如何导出或加载Graph的JSON数据?, by loongmxbt

CLOSED ISSUES

❤️ #59 label 交互问题, by bubkoo
❤️ #58 feat/react shape, by bubkoo
❤️ #56 feat(events): more readable event names, by bubkoo
❤️ #55 dispose => destroy, by bubkoo
❤️ #54 model, view 中的事件暴露在 graph 中,屏蔽内部概念, by bubkoo
❤️ #53 自动监测 container size 变化导致死循环,chrome 内存暴增, by bubkoo

NOISY ISSUE

🔈 #57 请问如何导出或加载Graph的JSON数据?, by loongmxbt
It received 1 comments.


PULL REQUESTS

Last week, 5 pull requests were created, updated or merged.

UPDATED PULL REQUEST

Last week, 1 pull request was updated.
💛 #60 feat: react label, by bubkoo

MERGED PULL REQUEST

Last week, 4 pull requests were merged.
💜 #59 label 交互问题, by bubkoo
💜 #58 feat/react shape, by bubkoo
💜 #56 feat(events): more readable event names, by bubkoo
💜 #51 feat: minimap, by bubkoo


COMMITS

Last week there were 42 commits.
🛠️ chore(publish): x6 v0.2.4 & x6-react-shape v0.1.1 by bubkoo
🛠️ feat: render 400 shapes with react component by bubkoo
🛠️ fix: the size of padding when page invisible by bubkoo
🛠️ perf: do not re-render react component when shape redrawing by bubkoo
🛠️ fix(anchor): position of anchor and connection point by bubkoo
🛠️ fix(minimap): only render facade for minimap by bubkoo
🛠️ feat: generate random color by bubkoo
🛠️ feat: export some api from model by bubkoo
🛠️ feat: layer api by bubkoo
🛠️ refactor: typos by bubkoo
🛠️ feat: return value of batch update by bubkoo
🛠️ chore(publish): x6-react-shape v0.1.0 by bubkoo
🛠️ docs: ts highlight by bubkoo
🛠️ v0.0.0 by bubkoo
🛠️ chore: reboot by bubkoo
🛠️ chore: fix build script by bubkoo
🛠️ fix: update example for react-shape by bubkoo
🛠️ docs: update usage by bubkoo
🛠️ feat: only export the shape by bubkoo
🛠️ docs: update usage by bubkoo
🛠️ refactor: file rename by bubkoo
🛠️ feat: examples for rendering react component with a shape by bubkoo
🛠️ feat: config shape before be rendered by bubkoo
🛠️ feat: init by bubkoo
🛠️ refactor: iHooks => IHook by bubkoo
🛠️ chore: init by bubkoo
🛠️ chore(publish): x6 v0.2.2 by bubkoo
🛠️ feat: custom render for react components by bubkoo
🛠️ feat: export some model and view events to graph fix #54 by bubkoo
🛠️ fix: can disable track by bubkoo
🛠️ fix(events): update event names by bubkoo
🛠️ feat(events): use more readable event names re #54 by bubkoo
🛠️ feat(events): more readable event names 1. protect some api 2. fireMouseEvent => mouseEvent 3. addMouseListener => addHandler 4. removeMouseListener => removeHandler ref #54 by bubkoo
🛠️ chore(publish): x6 v0.2.1 by bubkoo
🛠️ feat: example for minimap by bubkoo
🛠️ feat(minimap): the rendering fineness of minimap update minimap with fineness options fix #7 by bubkoo
🛠️ fix: the size of html shape without border by bubkoo
🛠️ fix: afterCreate hook can return nullable values by bubkoo
🛠️ fix: container size should be specified when infinite fix #53 by bubkoo
🛠️ feat(minimap): examples for minimap by bubkoo
🛠️ feat: minimap addon by bubkoo
🛠️ fix: refresh with no arg means refreshing the whole graph by bubkoo


CONTRIBUTORS

Last week there was 1 contributor.
👤 bubkoo


STARGAZERS

Last week there were 3 stagazers.
scaletimes
Z-torres
tarobjtu
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository antvis/x6 to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

label spacing is inoperative

Expected Behavior

Current Behavior

Possible Solution

Steps To Reproduce

  1. ...
  2. ...
  3. ...
Error Message & Stack Trace

<!-- Provide a log message if relevant -->

Additional Context

Your Environment

  • x6: [e.g. 1.0.0]
  • OS: [e.g. macOS Sierra 10.12.3]
  • Browser: [e.g. chrome 78.0.3904.108]

基于数据直接渲染出整个图

Expected Behavior

Possible Solution

graph.render({
  node: [
    {id:1, x:10, y:10, width:100, height: 32}
    {id:2, x:80, y:80, width:100, height: 32}
  ],
  edges: [{ source: 1, target: 1 }]
})

Additional Context

"cell:connected" event triggered twice

Expected Behavior

Current Behavior

用一条边链接两个节点,触发两次 cell:connected 事件,分别对应边的起点和终点。

{edge: Cell, isSource: true, terminal: Cell, previous: undefined, anchor: undefined}
{edge: Cell, isSource: false, terminal: Cell, previous: undefined, anchor: undefined}

Possible Solution

Steps To Reproduce

  1. ...
  2. ...
  3. ...
Error Message & Stack Trace

<!-- Provide a log message if relevant -->

Additional Context

Your Environment

  • x6: [e.g. 1.0.0]
  • OS: [e.g. macOS Sierra 10.12.3]
  • Browser: [e.g. chrome 78.0.3904.108]

打平 addNode 和 addEdge 选项

Expected Behavior

重构前

      const n1 = graph.addNode({
        data: 'Triangle',
        x: 20,
        y: 20,
        width: 80,
        height: 60,
        style: {
          shape: 'triangle',
          perimeter: 'triangle',
        },
      })

      const n2 = graph.addNode({
        data: 'Rectangle',
        x: 200,
        y: 20,
        width: 80,
        height: 30,
      })

      const n3 = graph.addNode({
        data: 'Ellipse',
        x: 200,
        y: 150,
        width: 80,
        height: 60,
        style: {
          shape: 'ellipse',
          perimeter: 'ellipse',
        },
      })

      graph.addEdge({
        source: n1,
        target: n3,
        data: 'label',
        style: {
          edge: 'elbow',
          elbow: 'horizontal',
          exitX: 0.5,
          exitY: 1,
          entryX: 0,
          entryY: 0,
          exitPerimeter: true,
          entryPerimeter: true,
        },
      })

重构之后

      const n1 = graph.addNode({
        data: 'Triangle',
        x: 20,
        y: 20,
        width: 80,
        height: 60,
        shape: 'triangle',
        perimeter: 'triangle',
      })

      const n2 = graph.addNode({
        data: 'Rectangle',
        x: 200,
        y: 20,
        width: 80,
        height: 30,
      })

      const n3 = graph.addNode({
        data: 'Ellipse',
        x: 200,
        y: 150,
        width: 80,
        height: 60,
        shape: 'ellipse',
        perimeter: 'ellipse',
      })

      graph.addEdge({
        source: n1,
        target: n3,
        data: 'label',
        edge: 'elbow',
        elbow: 'horizontal',
        exitX: 0.5,
        exitY: 1,
        entryX: 0,
        entryY: 0,
        exitPerimeter: true,
        entryPerimeter: true,
      })

Possible Solution

Additional Context

简化用户对内部概念的理解。

请问如何导出或加载Graph的JSON数据?

Expected Behavior

原先gg-editor或G6项目中通过data定义nodes和edges的json数据,可以方便找到Data或导出json。

import GGEditor, { Flow } from 'gg-editor';

const data = {
  nodes: [{
    type: 'node',
    size: '70*70',
    shape: 'flow-circle',
    color: '#FA8C16',
    label: '起止节点',
    x: 55,
    y: 55,
    id: 'ea1184e8',
    index: 0,
  }, {
    type: 'node',
    size: '70*70',
    shape: 'flow-circle',
    color: '#FA8C16',
    label: '结束节点',
    x: 55,
    y: 255,
    id: '481fbb1a',
    index: 2,
  }],
  edges: [{
    source: 'ea1184e8',
    sourceAnchor: 2,
    target: '481fbb1a',
    targetAnchor: 0,
    id: '7989ac70',
    index: 1,
  }],
};

<GGEditor>
  <Flow style={{ width: 500, height: 500 }} data={data} />
</GGEditor>

Current Behavior

目前通过 addNode 或 addEdge 添加元素后渲染,或是通过 graph.render(data)进行渲染。
如果绘图后这个data数据需要导出,请问在graph的哪个属性或函数里可以获取?

listeners: {selectionChanged: Array(2), root: Array(2), escape: Array(4), startEditing: Array(2), pan: Array(4), …}
isDisposed: false
disabled: false
options: {trackable: true, trackInfo: {…}, defaultShadowColor: "#808080", defaultShadowOffsetX: 2, defaultShadowOffsetY: 3, …}
container: div.graph
model: Model {listeners: {…}, maintainEdgeParent: true, cellIdPrefix: "cell-", cellIdPostfix: "", autoCreateCellId: true, …}
view: View {listeners: {…}, isDisposed: false, captureDocumentGesture: true, updateStyle: false, rendering: true, …}
renderer: Renderer {antialiased: true, minSvgStrokeWidth: 1, defaultTextShape: ƒ, defaultNodeShape: ƒ, defaultEdgeShape: ƒ, …}
selection: Selection {isDisposed: false, graph: ContextMenuAccessor, cells: Array(0)}
panX: 0
panY: 0
changeManager: ChangeManager {isDisposed: false, graph: ContextMenuAccessor}
eventloopManager: EventLoopManager {isDisposed: false, graph: ContextMenuAccessor, mouseListeners: Array(11), lastTouchX: 0, lastTouchY: 0, …}
viewportManager: ViewportManager {isDisposed: false, graph: ContextMenuAccessor}
pageBreakManager: PageBreakManager {isDisposed: false, graph: ContextMenuAccessor, horizontalPageBreaks: Array(0), verticalPageBreaks: Array(0)}
zoomManager: ZoomManager {isDisposed: false, graph: ContextMenuAccessor}
selectionManager: SelectionManager {isDisposed: false, graph: ContextMenuAccessor}
creationManager: CreationManager {isDisposed: false, graph: ContextMenuAccessor}
connectionManager: ConnectionManager {isDisposed: false, graph: ContextMenuAccessor}
retrievalManager: RetrievalManager {isDisposed: false, graph: ContextMenuAccessor}
styleManager: StyleManager {isDisposed: false, graph: ContextMenuAccessor}
validationManager: ValidationManager {isDisposed: false, graph: ContextMenuAccessor}
collapseManager: CollapseManager {isDisposed: false, graph: ContextMenuAccessor, collapseToPreferredSize: true}
overlayManager: OverlayManager {isDisposed: false, graph: ContextMenuAccessor}
groupManager: GroupManager {isDisposed: false, graph: ContextMenuAccessor}
sizeManager: SizeManager {isDisposed: false, graph: ContextMenuAccessor}
editingManager: EditingManager {isDisposed: false, graph: ContextMenuAccessor}
movingManager: MovingManager {isDisposed: false, graph: ContextMenuAccessor}
panningManager: PanningManager {isDisposed: false, graph: ContextMenuAccessor, damper: 0.16666666666666666, delay: 10, handleMouseOut: true, …}
cellEditor: CellEditor {isDisposed: false, textarea: null, editingCell: null, modified: false, autoSize: true, …}
tooltipHandler: TooltipHandler {listeners: {…}, isDisposed: false, disabled: true, graph: ContextMenuAccessor, ignoreTouchEvents: true, …}
cursorHandler: CursorHandler {listeners: {…}, isDisposed: false, disabled: false, graph: ContextMenuAccessor}
selectionHandler: SelectionHandler {listeners: {…}, isDisposed: false, disabled: false, graph: ContextMenuAccessor, handlers: Dictionary, …}
connectionHandler: ConnectionHandler {listeners: {…}, isDisposed: false, disabled: true, graph: ContextMenuAccessor, autoSelect: true, …}
guideHandler: GuideHandler {listeners: {…}, isDisposed: false, disabled: false, graph: ContextMenuAccessor, guide: null, …}
selectHandler: SelectCellHandler {listeners: {…}, isDisposed: false, disabled: false, graph: ContextMenuAccessor}
movingHandler: MovingHandler {listeners: {…}, isDisposed: false, disabled: false, graph: ContextMenuAccessor, preview: Preview, …}
panningHandler: PanningHandler {listeners: {…}, isDisposed: false, disabled: true, graph: ContextMenuAccessor, useLeftButtonForPanning: false, …}
contextMenuHandler: ContextMenuHandler {listeners: {…}, isDisposed: false, disabled: true, graph: ContextMenuAccessor, showing: false, …}
rubberbandHandler: RubberbandHandler {listeners: {…}, isDisposed: false, disabled: true, graph: ContextMenuAccessor, fadeOut: false, …}
keyboardHandler: KeyboardHandler {listeners: {…}, isDisposed: false, disabled: true, graph: ContextMenuAccessor, target: div.graph, …}
mouseWheelHandler: MouseWheelHandler {listeners: {…}, isDisposed: false, disabled: true, graph: ContextMenuAccessor, wheelZoomDelay: 10, …}

Possible Solution

Steps To Reproduce

  1. ...
  2. ...
  3. ...
Error Message & Stack Trace

<!-- Provide a log message if relevant -->

Additional Context

Your Environment

  • x6: [e.g. 1.0.0]
  • OS: [e.g. macOS Sierra 10.12.3]
  • Browser: [e.g. chrome 78.0.3904.108]

Weekly Digest (15 December, 2019 - 22 December, 2019)

Here's the Weekly Digest for antvis/x6:


ISSUES

Last week 9 issues were created.
Of these, 8 issues have been closed and 1 issues are still open.

OPEN ISSUES

💚 #51 feat: minimap, by bubkoo

CLOSED ISSUES

❤️ #50 feat: data driven, by bubkoo
❤️ #49 基于数据直接渲染出整个图, by bubkoo
❤️ #48 feat: data driven, by bubkoo
❤️ #47 基于新版 events 类,梳理自定义事件, by bubkoo
❤️ #46 feat: tip connectable anchor when connecting, by bubkoo
❤️ #45 Feature/flowchart conn, by bubkoo
❤️ #44 feat: should trigger guide and highlight when dragging from side to graph, by bubkoo
❤️ #43 feat: tip connectable anchor when connecting, by bubkoo

NOISY ISSUE

🔈 #46 feat: tip connectable anchor when connecting, by bubkoo
It received 15 comments.


PULL REQUESTS

Last week, 6 pull requests were created, updated or merged.

UPDATED PULL REQUEST

Last week, 1 pull request was updated.
💛 #51 feat: minimap, by bubkoo

MERGED PULL REQUEST

Last week, 5 pull requests were merged.
💜 #50 feat: data driven, by bubkoo
💜 #46 feat: tip connectable anchor when connecting, by bubkoo
💜 #45 Feature/flowchart conn, by bubkoo
💜 #44 feat: should trigger guide and highlight when dragging from side to graph, by bubkoo
💜 #43 feat: tip connectable anchor when connecting, by bubkoo


COMMITS

Last week there were 68 commits.
🛠️ chore(publish): x6 0.2.0 by bubkoo
🛠️ feat: methods for getting cells from graph by bubkoo
🛠️ docs(usage): usage of render by bubkoo
🛠️ fix: usage of graph.render by bubkoo
🛠️ feat: render nodes and edges by data graph.render(data: Data) fix #49 by bubkoo
🛠️ feat: cell id can be numbers by bubkoo
🛠️ fix: update example after refactor by bubkoo
🛠️ feat: more readable style names exitX => sourceAnchorX, exitY => sourceAnchorY, entryX=> targetAnchorX ... by bubkoo
🛠️ refactor: fix typos by bubkoo
🛠️ feat: remove noEdgeStyle by bubkoo
🛠️ chore(publish): x6 v0.1.7 by bubkoo
🛠️ feat: update anchor examples by bubkoo
🛠️ feat: is anchor connectable by bubkoo
🛠️ feat: classNames in connection handler by bubkoo
🛠️ feat: add example for group by bubkoo
🛠️ feat: remove unnecessary type convertions #16 #41 by bubkoo
🛠️ feat: className of edgeHandler by bubkoo
🛠️ feat: className and options for node handler #16 #41 by bubkoo
🛠️ test: add test for window.unload by bubkoo
🛠️ feat: detect vendor prefix by bubkoo
🛠️ refactor: remove unused detections by bubkoo
🛠️ refactor: move parseCssNumber by bubkoo
🛠️ refactor(detector): remove unused detections by bubkoo
🛠️ refactor(moving): ensure className used in movingHandler #16 #41 by bubkoo
🛠️ feat: accessor for mousewheel should check status before update enable status, avoid bind event again and again re #16 #41 by bubkoo
🛠️ feat(guide): ensure className and accessor for guide #41 by bubkoo
🛠️ refactor(keyboard): review by bubkoo
🛠️ refactor(selection): review handler and accessor for selection more readable method name re #16 #41 by bubkoo
🛠️ refactor: rename class by bubkoo
🛠️ refactor: isContextMenuShowing by bubkoo
🛠️ feat: isTooltipShowing by bubkoo
🛠️ feat(contextmenu): accessor for contextmenu review className and accessor for contextMenu #16 #41 by bubkoo
🛠️ feat: accessor for rubberband review className and accessor for rubberband #16 #41 by bubkoo
🛠️ refactor: update eventName arg in fireMouseEvent by bubkoo
🛠️ feat: accessor for tooltip review className and accessor for tooltip #16 #41 by bubkoo
🛠️ refactor: overlay => mask by bubkoo
🛠️ feat: accessor for speed up use methdos on model, view, render, etc by bubkoo
🛠️ fix: handle alert on lgtm.com by bubkoo
🛠️ refactor(events): add EventArgs definition for custom events fix #47 by bubkoo
🛠️ chore: forbidden push to master branch by bubkoo
🛠️ chore: fix typos by bubkoo
🛠️ feat: use EventArgs ref #47 by bubkoo
🛠️ refactor: panning-accessor and panning-manager fix #21 by bubkoo
🛠️ refactor(events): readable genericity name by bubkoo
🛠️ feat(label): update examples that have labels do not extra label from data, keep data used by biz #31 by bubkoo
🛠️ feat(label): define label in style and do not extra label from data keep data used by biz fix#31 by bubkoo
🛠️ docs: explicit define label in style #31 by bubkoo
🛠️ feat: get html content from style.html or graph.getHtml() by bubkoo
🛠️ fix: update pagebreak by methods on graph fix #13 by bubkoo
🛠️ chore: publish by bubkoo
🛠️ Merge branch 'master' of https://github.com/antvis/x6 # Conflicts: # examples/x6-example-features/src/pages/flowchart/sidebar.tsx # packages/x6/src/addon/dnd/index.ts by bubkoo
🛠️ Merge branch 'feature/dnd' by bubkoo
🛠️ Merge branch 'master' into feature/dnd by bubkoo
🛠️ feat(dnd): update example for dnd by bubkoo
🛠️ feat(dnd): move data into options by bubkoo
🛠️ refactor(dnd): guide and hightlight when drag cell from sidebar to graph update dnd fix #27 by bubkoo
🛠️ refactor(dnd): common dnd by bubkoo
🛠️ refactor: add utility-types Collection of utility types, complementing TypeScript built-in mapped types and aliases by bubkoo
🛠️ chore: add tslint-eslint-rules by bubkoo
🛠️ style: multi-line by bubkoo
🛠️ feat(events): type infer for custom events by bubkoo
🛠️ Merge branch 'feature/flowchart-conn' by bubkoo
🛠️ style: merge from master by bubkoo
🛠️ refactor(dnd): guide and hightlight when drag cell from sidebar to graph update dnd fix #27 by bubkoo
🛠️ refactor(dnd): common dnd by bubkoo
🛠️ refactor: add utility-types Collection of utility types, complementing TypeScript built-in mapped types and aliases by bubkoo
🛠️ chore: add tslint-eslint-rules by bubkoo
🛠️ style: multi-line by bubkoo


CONTRIBUTORS

Last week there was 1 contributor.
👤 bubkoo


STARGAZERS

Last week there were 2 stagazers.
12301079-Qianwenshu
caolinjian
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository antvis/x6 to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

pageBreak 相关的 set 方法应该触发 UI 自动更新

Expected Behavior

Current Behavior

Possible Solution

Steps To Reproduce

  1. ...
  2. ...
  3. ...
Error Message & Stack Trace

<!-- Provide a log message if relevant -->

Additional Context

Your Environment

  • x6: [e.g. 1.0.0]
  • OS: [e.g. macOS Sierra 10.12.3]
  • Browser: [e.g. chrome 78.0.3904.108]

连线过程中提示可连接的 anchor 或 port

Expected Behavior

鼠标按下开始连线时 和 连线过程中,高亮提示可以连接的锚点或连接桩。

  • 增加 graph 开关选项来启用该特性
  • 内置几种高亮效果,并支持用户自定义

Additional Context

泳道图 DEMO

Expected Behavior

提供河流图demo和交互。

Possible Solution

Additional Context

取消从data中取label

Expected Behavior

增加显式的 label 选项,使 data 更加纯粹,同时可以通过指定 label=false 来不渲染label,这样可以删掉 noLabel 选项。

Possible Solution

Additional Context

内置 grid 背景

Expected Behavior

支持两种 grid 背景

  • 线网格式
    image
  • 点网格式
    image

通过选项开启

Possible Solution

  1. 提供对应的 grid 选项
interface GridOptions {
  enabled: boolean
  size: number
  scaled: boolean
  // 以下为新增选项
  /**
   * 网格类型
   * `line`: 线网
   * `dot`: 点网
   * `null`: 不绘制网格背景
   * 默认为 `line`
   */
  type: 'line' | 'dot' | null
  /**
   * 网格颜色
   */
  color: string
  /**
   * 最小网格大小,动态调整网格大小时的最小网格大小
   */ 
  minSize: number
  /**
   * 只对 type 为 `line` 类型的网格有效,表示网格明暗间距
   */
  step: number
}
  1. ViewvalidateBackgroundPage 生命周期中完成网格绘制

Additional Context

在图编辑场景,网格系统是基础设施之一,但不是高配配置需求,所以默认提供一种常用的配置即可,但用户可以根据自身业务场景,通过 GridOptions 实现定制。

add stylesheet for named shapes

Expected Behavior

通过 shape 名指定 stylesheet,以便支持复杂的个性样式定制。

业务场景比较局限,低优先级。

Possible Solution

Additional Context

自动监测 container size 变化导致死循环,chrome 内存暴增

Expected Behavior

Current Behavior

Possible Solution

默认给 container 设置 width="100%"height="100%",大小控制交给其父节点。

Steps To Reproduce

  1. ...
  2. ...
  3. ...
Error Message & Stack Trace

<!-- Provide a log message if relevant -->

Additional Context

Your Environment

  • x6: [e.g. 1.0.0]
  • OS: [e.g. macOS Sierra 10.12.3]
  • Browser: [e.g. chrome 78.0.3904.108]

Win下无法用delete键删除元素,只能使用Backspace键删除元素

Win下无法用delete键删除元素,只能使用Backspace键删除元素

Expected Behavior

Win下可以使用Delete按键删除元素

Current Behavior

Win下无法用delete键删除元素

Possible Solution

删除元素也绑定Delete键

Steps To Reproduce

  1. ...
  2. ...
  3. ...
Error Message & Stack Trace

<!-- Provide a log message if relevant -->

Additional Context

Your Environment

  • x6: 0.1.5
  • OS: Win10
  • Browser: chrome

remove backgroundImage

Expected Behavior

Possible Solution

Additional Context

背景图不常用,而且可以通过 css 样式来实现。

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.