Compare commits
40 Commits
@antv/x6-p
...
@antv/x6@2
Author | SHA1 | Date | |
---|---|---|---|
4a6a634a8a | |||
627368e0dd | |||
604c0244cd | |||
80898ada1c | |||
057d5209ff | |||
2070828425 | |||
502422fe24 | |||
8daf0fd62c | |||
a108b50a66 | |||
525bac1907 | |||
34ec3d29ab | |||
74fb7b86d7 | |||
1fb2d8308a | |||
b2b8ac578c | |||
1b03004ee5 | |||
53c9eaf626 | |||
05d1fe35d6 | |||
b05d1596dd | |||
8843212f53 | |||
f920d5a4ee | |||
6a81805075 | |||
94f90425f6 | |||
cd85c5bd26 | |||
16b6c89e6b | |||
76be8db8ca | |||
18c0edf483 | |||
4978110b45 | |||
8eb43874a5 | |||
83d0295596 | |||
2c40e3d129 | |||
d903e5a5b6 | |||
c350371d3c | |||
9f3ba0f3b4 | |||
b0555151e9 | |||
1d324df545 | |||
d6df2d5981 | |||
273102322b | |||
1dcab69b18 | |||
cb0cfdeb4d | |||
bdba8cef5c |
.github/workflows
.gitignore.lgtm.yml.releaserc.stylelintrcCONTRIBUTORSCONTRIBUTORS.svgREADME.en-us.mdREADME.mdexamples/x6-example-features/src
karma.conf.jspackage.jsonpackages
x6-common
x6-geometry
x6-plugin-clipboard
x6-plugin-dnd
x6-plugin-export
x6-plugin-history
x6-plugin-keyboard
x6-plugin-minimap
x6-plugin-scroller
x6-plugin-selection
x6-plugin-snapline
x6-plugin-stencil
x6-plugin-transform
x6-react-components
CHANGELOG.mdpackage.json
src
auto-scroll-box/style
color-picker/style
context-menu/style
dropdown/style
menu/style
menubar/style
scroll-box/style
scrollbar/style
split-box/style
style
toolbar/style
x6-react-shape
x6-vue-shape
x6
sites
x6-sites-demos-helper/src/wrap
x6-sites-demos/packages
performance/react-flow/src
tutorial/intermediate/vue
42
.github/workflows/codeql.yml
vendored
Normal file
42
.github/workflows/codeql.yml
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
name: ⛵️ CodeQL
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master", "bot", "gh-pages", "v1" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
schedule:
|
||||
- cron: "41 2 * * 1"
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ javascript ]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
config-file: ./.github/workflows/config/codeql.yml
|
||||
queries: +security-and-quality
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
with:
|
||||
category: "/language:${{ matrix.language }}"
|
7
.github/workflows/config/codeql.yml
vendored
Normal file
7
.github/workflows/config/codeql.yml
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
paths-ignore:
|
||||
- sites/x6-sites/static
|
||||
query-filters:
|
||||
- exclude:
|
||||
id: js/use-before-declaration
|
||||
- exclude:
|
||||
id: js/polynomial-redos
|
7
.github/workflows/release.yml
vendored
7
.github/workflows/release.yml
vendored
@ -44,8 +44,8 @@ jobs:
|
||||
- name: 🚧 Install dependencies
|
||||
run: pnpm install --no-frozen-lockfile --ignore-scripts
|
||||
|
||||
# - name: 📦 build
|
||||
# run: pnpm run build
|
||||
- name: 📦 build
|
||||
run: pnpm run build
|
||||
|
||||
# - name: ✅ Test
|
||||
# run: pnpm run test
|
||||
@ -57,8 +57,9 @@ jobs:
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
- name: 📦 Semantic Release
|
||||
run: pnpm srm --debug --combine-commits --comment-footer 'Thanks for being a part of the [AntV](https://github.com/antvis) community! 💪💯'
|
||||
run: pnpm srm --combine-commits --comment-footer 'Thanks for being a part of the [AntV](https://github.com/antvis) community! 💪💯'
|
||||
env:
|
||||
SRM_DEBUG: ${{ secrets.SRM_DEBUG }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -15,3 +15,5 @@ dist
|
||||
tmp
|
||||
test/coverage
|
||||
packages/**/src/style/raw.ts
|
||||
.eslintcache
|
||||
.stylelintcache
|
||||
|
12
.lgtm.yml
12
.lgtm.yml
@ -1,12 +0,0 @@
|
||||
# @see https://help.semmle.com/lgtm-enterprise/user/help/lgtm.yml-configuration-file.html
|
||||
# @template https://lgtm.com/static/downloads/lgtm.template.yml
|
||||
|
||||
queries:
|
||||
- exclude: js/use-before-declaration
|
||||
- exclude: js/polynomial-redos
|
||||
|
||||
extraction:
|
||||
javascript:
|
||||
index:
|
||||
filters:
|
||||
- exclude: "sites/x6-sites/static"
|
@ -31,7 +31,7 @@
|
||||
[
|
||||
"@semantic-release/npm",
|
||||
{
|
||||
"npmPublish": false
|
||||
"npmPublish": true
|
||||
}
|
||||
],
|
||||
[
|
||||
|
@ -15,6 +15,11 @@
|
||||
"no-invalid-double-slash-comments": null,
|
||||
"no-descending-specificity": null,
|
||||
"declaration-empty-line-before": null,
|
||||
"no-duplicate-selectors": null
|
||||
"no-duplicate-selectors": null,
|
||||
"value-no-vendor-prefix": null,
|
||||
"selector-pseudo-class-no-unknown": null,
|
||||
"selector-class-pattern": null,
|
||||
"keyframes-name-pattern": null,
|
||||
"number-max-precision": null
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ Opportunity <opportunity@live.in>
|
||||
Questions <chip@twostewards.com>
|
||||
RuiLin <on>
|
||||
SSC <273702440@qq.com>
|
||||
Simon <>
|
||||
Sindori <441933726@qq.com>
|
||||
Susan <527971893@qq.com>
|
||||
Thomas <eugne>
|
||||
@ -58,6 +59,7 @@ myzxlin <myzxlin@163.com>
|
||||
newbyvector <vectorse@126.com>
|
||||
niexq <1879633916@qq.com>
|
||||
niexq <niexq@firstgrid.cn>
|
||||
njshuisheng <34205271+njshuisheng@users.noreply.github.com>
|
||||
pengxingjian.pxj <pengxingjian.pxj@alibaba-inc.com>
|
||||
pfdgithub <pfdgithub@users.noreply.github.com>
|
||||
qingchi <qinky94@163.com>
|
||||
|
File diff suppressed because one or more lines are too long
Before (image error) Size: 11 MiB After (image error) Size: 12 MiB |
@ -17,7 +17,7 @@
|
||||
<a href="/LICENSE"><img src="https://img.shields.io/github/license/antvis/x6?style=flat-square" alt="MIT License"></a>
|
||||
<a href="https://www.typescriptlang.org"><img alt="Language" src="https://img.shields.io/badge/language-TypeScript-blue.svg?style=flat-square"></a>
|
||||
<a href="https://github.com/antvis/x6/pulls"><img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square"></a>
|
||||
<a href="https://x6.antv.vision"><img alt="website" src="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=0076D6&style=flat-square&logo=google-chrome&logoColor=0076D6"></a>
|
||||
<a href="https://x6.antv.antgroup.com/"><img alt="website" src="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=0076D6&style=flat-square&logo=google-chrome&logoColor=0076D6"></a>
|
||||
</p>
|
||||
|
||||
## Features
|
||||
@ -84,8 +84,8 @@ graph.addEdge({
|
||||
|
||||
## Links
|
||||
|
||||
- [Documents](https://x6.antv.vision/zh/docs/tutorial/about)
|
||||
- [Samples](https://x6.antv.vision/zh/examples/gallery)
|
||||
- [Documents](https://x6.antv.antgroup.com/tutorial/about)
|
||||
- [Samples](https://x6.antv.antgroup.com/examples)
|
||||
- [Blog](https://www.yuque.com/antv/x6/gcinvi)
|
||||
- [Versioning Release Note](https://www.yuque.com/antv/x6/bbfu6r)
|
||||
- [FAQ](https://www.yuque.com/antv/x6/be9pfx)
|
||||
|
22
README.md
22
README.md
@ -7,7 +7,7 @@
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/antvis/X6/actions/workflows/ci.yml"><img alt="build" src="https://img.shields.io/github/workflow/status/antvis/x6/%F0%9F%91%B7%E3%80%80CI/master?logo=github&style=flat-square"></a>
|
||||
<a href="https://app.codecov.io/gh/antvis/X6"><img alt="coverage" src="https://img.shields.io/codecov/c/gh/antvis/x6?logo=codecov&style=flat-square&token=15CO54WYUV"></a>
|
||||
<!-- <a href="https://app.codecov.io/gh/antvis/X6"><img alt="coverage" src="https://img.shields.io/codecov/c/gh/antvis/x6?logo=codecov&style=flat-square&token=15CO54WYUV"></a> -->
|
||||
<a href="https://lgtm.com/projects/g/antvis/x6/context:javascript"><img alt="Language grade: JavaScript" src="https://img.shields.io/lgtm/grade/javascript/g/antvis/x6.svg?logo=lgtm&style=flat-square"></a>
|
||||
<a href="https://www.npmjs.com/package/@antv/x6"><img alt="NPM Package" src="https://img.shields.io/npm/v/@antv/x6.svg?style=flat-square"></a>
|
||||
<a href="https://www.npmjs.com/package/@antv/x6"><img alt="NPM Downloads" src="https://img.shields.io/npm/dm/@antv/x6?logo=npm&style=flat-square"></a>
|
||||
@ -17,7 +17,7 @@
|
||||
<a href="/LICENSE"><img src="https://img.shields.io/github/license/antvis/x6?style=flat-square" alt="MIT License"></a>
|
||||
<a href="https://www.typescriptlang.org"><img alt="Language" src="https://img.shields.io/badge/language-TypeScript-blue.svg?style=flat-square"></a>
|
||||
<a href="https://github.com/antvis/x6/pulls"><img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square"></a>
|
||||
<a href="https://x6.antv.vision"><img alt="website" src="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=0076D6&style=flat-square&logo=google-chrome&logoColor=0076D6"></a>
|
||||
<a href="https://x6.antv.antgroup.com"><img alt="website" src="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=0076D6&style=flat-square&logo=google-chrome&logoColor=0076D6"></a>
|
||||
</p>
|
||||
|
||||
## 特性
|
||||
@ -29,12 +29,12 @@
|
||||
|
||||
## 兼容环境
|
||||
|
||||
- 现代浏览器和 IE11(需要 polyfills)
|
||||
- 现代浏览器
|
||||
- 支持服务端渲染。
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari |
|
||||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari |
|
||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| last 2 versions | last 2 versions | last 2 versions |
|
||||
|
||||
## 安装
|
||||
|
||||
@ -84,12 +84,12 @@ graph.addEdge({
|
||||
|
||||
## 链接
|
||||
|
||||
- [文档](https://x6.antv.vision/zh/docs/tutorial/about)
|
||||
- [示例](https://x6.antv.vision/zh/examples/gallery)
|
||||
- [博客](https://www.yuque.com/antv/x6/gcinvi)
|
||||
- [文档](http://x6.antv.antgroup.com/tutorial/about)
|
||||
- [示例](http://x6.antv.antgroup.com/examples)
|
||||
- [博客](https://www.yuque.com/antv/x6/huhla47wqalq5n7r)
|
||||
- [更新日志](https://www.yuque.com/antv/x6/bbfu6r)
|
||||
- [常见问题](https://www.yuque.com/antv/x6/be9pfx)
|
||||
- [CodeSanbox 模板](https://codesandbox.io/s/qosj0?file=/src/app.tsx)
|
||||
- [常见问题](https://www.yuque.com/antv/x6/tox1ukbz5cw57qfy)
|
||||
- [CodeSanbox 模板](https://codesandbox.io/s/mo-ban-wchooy?file=/src/App.tsx)
|
||||
|
||||
## 本地开发
|
||||
|
||||
|
@ -7,17 +7,17 @@
|
||||
|
||||
.nav {
|
||||
position: absolute;
|
||||
z-index: 101;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
font-size: 13px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
z-index: 101;
|
||||
box-sizing: border-box;
|
||||
width: 220px;
|
||||
padding: 0 16px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
font-size: 13px;
|
||||
border-right: 1px solid #e9e9e9;
|
||||
box-sizing: border-box;
|
||||
|
||||
ul {
|
||||
padding-left: 16px;
|
||||
@ -29,11 +29,11 @@
|
||||
}
|
||||
|
||||
.content {
|
||||
flex-grow: 1;
|
||||
box-sizing: border-box;
|
||||
margin-left: 220px;
|
||||
padding: 34px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
flex-grow: 1;
|
||||
margin-left: 220px;
|
||||
background: #ffffff;
|
||||
padding: 34px;
|
||||
background: #fff;
|
||||
}
|
||||
|
@ -8,13 +8,15 @@
|
||||
border: 1px solid #c2c8d5;
|
||||
border-left: 4px solid #1890ff;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 5px 1px rgba(0, 0, 0, 0.06);
|
||||
box-shadow: 0 2px 5px 1px rgb(0 0 0 / 6%);
|
||||
|
||||
img {
|
||||
flex-shrink: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
flex-shrink: 0;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.label {
|
||||
display: inline-block;
|
||||
flex-shrink: 0;
|
||||
@ -23,15 +25,19 @@
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.status {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&.success {
|
||||
border-left: 4px solid #52c41a;
|
||||
}
|
||||
|
||||
&.failed {
|
||||
border-left: 4px solid #ff4d4f;
|
||||
}
|
||||
|
||||
&.running .status img {
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
@ -43,11 +49,13 @@
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 0 0 4px #d4e8fe;
|
||||
}
|
||||
|
||||
.node.success {
|
||||
border-color: #52c41a;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 0 0 4px #ccecc0;
|
||||
}
|
||||
|
||||
.node.failed {
|
||||
border-color: #ff4d4f;
|
||||
border-radius: 2px;
|
||||
@ -80,6 +88,7 @@
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
visibility: hidden;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&:hover image {
|
||||
visibility: visible;
|
||||
}
|
||||
|
@ -2,24 +2,25 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.validating:after {
|
||||
.validating::after {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 4px;
|
||||
content: ' ';
|
||||
display: block;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
border: 6px solid #873bf4;
|
||||
border-color: #873bf4 transparent #873bf4 transparent;
|
||||
border-color: #873bf4 transparent;
|
||||
border-radius: 50%;
|
||||
animation: lds-dual-ring 1.2s linear infinite;
|
||||
content: ' ';
|
||||
}
|
||||
|
||||
@keyframes lds-dual-ring {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
|
@ -2,14 +2,14 @@
|
||||
.x6-example-wrap {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
background-color: #fff;
|
||||
|
||||
.left-side {
|
||||
position: fixed;
|
||||
width: 336px;
|
||||
left: 24px;
|
||||
top: 0px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 24px;
|
||||
width: 336px;
|
||||
padding: 0 8px;
|
||||
overflow-x: visible;
|
||||
overflow-y: auto;
|
||||
@ -17,18 +17,18 @@
|
||||
|
||||
.right-side {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 24px;
|
||||
bottom: 0;
|
||||
width: 336px;
|
||||
padding: 0 8px;
|
||||
top: 0px;
|
||||
bottom: 0;
|
||||
overflow-x: visible;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.ant-card {
|
||||
box-shadow: 0 0 10px 1px #e9e9e9;
|
||||
margin-top: 24px;
|
||||
box-shadow: 0 0 10px 1px #e9e9e9;
|
||||
}
|
||||
|
||||
.ant-row-flex {
|
||||
@ -36,14 +36,14 @@
|
||||
}
|
||||
|
||||
.slider-value {
|
||||
background: #eee;
|
||||
color: #333333;
|
||||
padding: 3px 7px;
|
||||
border-radius: 10px;
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
margin-left: 8px;
|
||||
padding: 3px 7px;
|
||||
color: #333;
|
||||
font-size: 12px;
|
||||
line-height: 1.25;
|
||||
background: #eee;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.x6-graph {
|
||||
@ -52,15 +52,15 @@
|
||||
|
||||
.x6-node {
|
||||
path {
|
||||
fill: #6a6c8a;
|
||||
stroke-width: 0px;
|
||||
transition: fill 0.1s;
|
||||
fill: #6a6c8a;
|
||||
stroke-width: 0;
|
||||
}
|
||||
|
||||
text {
|
||||
fill: #fff;
|
||||
font-size: 12px;
|
||||
font-weight: lighter;
|
||||
font-size: 12px;
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
&:hover path {
|
||||
@ -80,37 +80,37 @@
|
||||
}
|
||||
|
||||
.bbox {
|
||||
transition-duration: 0.5s;
|
||||
transition-property: stroke-opacity;
|
||||
pointer-events: none;
|
||||
fill: none;
|
||||
stroke: #16a085;
|
||||
stroke-width: 2;
|
||||
stroke-opacity: 0;
|
||||
fill: none;
|
||||
transition-property: stroke-opacity;
|
||||
transition-duration: 0.5s;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.axis {
|
||||
pointer-events: none;
|
||||
stroke: #95a5a6;
|
||||
stroke-dasharray: 2, 4;
|
||||
stroke-width: 1;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.padding {
|
||||
transition-duration: 1s;
|
||||
transition-property: stroke-opacity;
|
||||
pointer-events: none;
|
||||
stroke: #1abc9c;
|
||||
stroke-opacity: 0;
|
||||
transition-property: stroke-opacity;
|
||||
transition-duration: 1s;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.grid {
|
||||
transition-duration: 1s;
|
||||
transition-property: stroke-opacity;
|
||||
pointer-events: none;
|
||||
stroke: #16a085;
|
||||
stroke-width: 0.5;
|
||||
stroke-opacity: 0;
|
||||
transition-property: stroke-opacity;
|
||||
transition-duration: 1s;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.active {
|
||||
|
@ -1,9 +1,9 @@
|
||||
.custom-html {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: #000;
|
||||
font-size: 16px;
|
||||
border: 1px solid #000;
|
||||
|
@ -1,27 +1,27 @@
|
||||
.x6-graph-wrap {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
overflow: auto;
|
||||
padding: 32px 0;
|
||||
overflow: auto;
|
||||
background-color: #fff;
|
||||
|
||||
> h1 {
|
||||
display: block;
|
||||
width: 800px;
|
||||
margin: 0 auto 32px auto;
|
||||
margin: 0 auto 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.x6-graph-tools {
|
||||
width: 800px;
|
||||
margin: 0 auto 32px auto;
|
||||
margin: 0 auto 32px;
|
||||
}
|
||||
|
||||
.x6-graph {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-shadow: 0 0 10px 1px #e9e9e9;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 10px 1px #e9e9e9;
|
||||
}
|
||||
|
||||
.x6-node-selected {
|
||||
|
@ -1,10 +1,10 @@
|
||||
.react-algo-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #5f95ff;
|
||||
border-radius: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
width: 24px;
|
||||
@ -13,8 +13,8 @@
|
||||
|
||||
span {
|
||||
margin-left: 4px;
|
||||
font-size: 12px;
|
||||
color: #000000a6;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
&.dark {
|
||||
|
@ -2,20 +2,20 @@
|
||||
.my-port {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #eee;
|
||||
border: 1px solid #808080;
|
||||
border-radius: 100%;
|
||||
background: #eee;
|
||||
|
||||
&.connected {
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-top: 5px;
|
||||
margin-left: 1px;
|
||||
border-width: 5px 4px 0;
|
||||
border-style: solid;
|
||||
border-color: #808080 transparent transparent;
|
||||
border-radius: 0;
|
||||
background-color: transparent;
|
||||
border-color: #808080 transparent transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 4px 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,30 +30,30 @@
|
||||
}
|
||||
|
||||
body > div::before {
|
||||
content: ' ';
|
||||
float: left;
|
||||
box-sizing: border-box;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-top: -5px;
|
||||
margin-left: -5px;
|
||||
background-color: rgb(57 202 116 / 60%);
|
||||
border-radius: 50%;
|
||||
background-color: rgba(57, 202, 116, 0.6);
|
||||
box-sizing: border-box;
|
||||
content: ' ';
|
||||
}
|
||||
|
||||
body > div::after {
|
||||
content: ' ';
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
float: left;
|
||||
clear: both;
|
||||
box-sizing: border-box;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-top: -15px;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
border: 1px solid #39ca74;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
box-sizing: border-box;
|
||||
border-radius: 50%;
|
||||
content: ' ';
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,30 +65,30 @@
|
||||
}
|
||||
|
||||
body > div::before {
|
||||
content: ' ';
|
||||
float: left;
|
||||
box-sizing: border-box;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-top: -9px;
|
||||
margin-left: -9px;
|
||||
background-color: rgb(57 202 116 / 60%);
|
||||
border-radius: 50%;
|
||||
background-color: rgba(57, 202, 116, 0.6);
|
||||
box-sizing: border-box;
|
||||
content: ' ';
|
||||
}
|
||||
|
||||
body > div::after {
|
||||
content: ' ';
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
float: left;
|
||||
clear: both;
|
||||
box-sizing: border-box;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-top: -19px;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
border: 1px solid #39ca74;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
box-sizing: border-box;
|
||||
border-radius: 50%;
|
||||
content: ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
.x6-graph-scroller {
|
||||
box-shadow: 0 0 10px 1px #e9e9e9;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 10px 1px #e9e9e9;
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ export default class Example extends React.Component {
|
||||
strict: true,
|
||||
showNodeSelectionBox: true,
|
||||
selectCellOnMoved: false,
|
||||
useCellGeometry: true,
|
||||
filter(cell) {
|
||||
return cell !== a
|
||||
},
|
||||
|
@ -1,20 +1,20 @@
|
||||
.react-table {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #edf2f5;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
border: 1px solid #edf2f5;
|
||||
border-radius: 5px;
|
||||
|
||||
.inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 12px;
|
||||
border: 1px solid #fff;
|
||||
background: #edf2f5;
|
||||
border: 1px solid #fff;
|
||||
border-radius: 5px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.header {
|
||||
@ -36,21 +36,21 @@
|
||||
}
|
||||
|
||||
ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding-left: 16px;
|
||||
line-height: 40px;
|
||||
list-style: none;
|
||||
border: 1px solid transparent;
|
||||
|
||||
&:hover {
|
||||
border: 1px solid #1890ff;
|
||||
// background: rgba(230,247,255,.92);
|
||||
z-index: 0;
|
||||
border: 1px solid #1890ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -58,8 +58,8 @@
|
||||
.react-table-port {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: #eee;
|
||||
border: 1px solid #808080;
|
||||
border-radius: 100%;
|
||||
background: #eee;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
@ -1,41 +1,44 @@
|
||||
.tools {
|
||||
width: 800px;
|
||||
margin: 32px auto;
|
||||
|
||||
.ant-input {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.react-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #5f95ff;
|
||||
border-radius: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
span {
|
||||
margin-left: 4px;
|
||||
font-size: 12px;
|
||||
color: #000000a6;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.stutterer {
|
||||
transform: scale(1.5);
|
||||
height: 310px;
|
||||
width: 310px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 310px;
|
||||
height: 310px;
|
||||
margin: auto;
|
||||
box-shadow: 0 0 10px 10px rgba(0, 0, 0, 0.2);
|
||||
border-radius: 200px;
|
||||
box-shadow: 0 0 10px 10px rgb(0 0 0 / 20%);
|
||||
transform: scale(1.5);
|
||||
}
|
||||
|
||||
.clockHand {
|
||||
@ -50,12 +53,12 @@
|
||||
}
|
||||
|
||||
.innerLine {
|
||||
border-radius: 6px;
|
||||
position: absolute;
|
||||
height: 149px;
|
||||
left: 47.5%;
|
||||
top: 0%;
|
||||
left: 47.5%;
|
||||
width: 5%;
|
||||
height: 149px;
|
||||
background-color: red;
|
||||
border-radius: 6px;
|
||||
transform-origin: bottom center;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ module.exports = function (config, base, karmaTypescriptConfig) {
|
||||
},
|
||||
coverageOptions: {
|
||||
instrumentation: !isDebug,
|
||||
exclude: /\.test|spec\.ts$/,
|
||||
exclude: /\.(test|spec)\.ts$/,
|
||||
},
|
||||
reports: {
|
||||
html: reportsDir,
|
||||
|
27
package.json
27
package.json
@ -3,8 +3,8 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"preinstall": "node ./scripts/preinstall",
|
||||
"lint:ts": "eslint '**/src/**/*.{js,ts}?(x)' --fix",
|
||||
"lint:style": "stylelint '**/src/**/*.less' --syntax less --fix",
|
||||
"lint:ts": "eslint '**/src/**/*.{js,ts}?(x)' --cache --fix",
|
||||
"lint:style": "stylelint '**/src/**/*.less' --customSyntax postcss-less --cache --fix",
|
||||
"lint": "run-s lint:ts lint:style",
|
||||
"prettier": "prettier --write '**/*.{js,mjs,jsx,tsx,ts,less,md,json}'",
|
||||
"pretty-quick": "pretty-quick",
|
||||
@ -89,23 +89,23 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.20.2",
|
||||
"@babel/core": "^7.20.5",
|
||||
"@babel/plugin-syntax-flow": "^7.18.6",
|
||||
"@babel/plugin-transform-react-jsx": "^7.19.0",
|
||||
"@commitlint/config-conventional": "^17.3.0",
|
||||
"@rollup/plugin-commonjs": "^23.0.2",
|
||||
"@rollup/plugin-commonjs": "^23.0.3",
|
||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||
"@rollup/plugin-replace": "^5.0.1",
|
||||
"@rollup/plugin-typescript": "^8.2.5",
|
||||
"@semantic-release-monorepo/cli": "^2.1.0",
|
||||
"@semantic-release/changelog": "^6.0.1",
|
||||
"@semantic-release-monorepo/cli": "^2.1.2",
|
||||
"@semantic-release/changelog": "^6.0.2",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@types/jasmine": "^4.3.0",
|
||||
"@types/jest": "^29.2.3",
|
||||
"@types/node": "^18.11.9",
|
||||
"@types/node": "^18.11.10",
|
||||
"@types/sinon": "^10.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^5.44.0",
|
||||
"@typescript-eslint/parser": "^5.44.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||
"@typescript-eslint/parser": "^5.45.0",
|
||||
"boxen": "^7.0.0",
|
||||
"colors": "^1.4.0",
|
||||
"coveralls": "^3.1.1",
|
||||
@ -121,8 +121,8 @@
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"eslint-plugin-react": "^7.31.11",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"eslint-plugin-unicorn": "^45.0.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"eslint-plugin-unicorn": "^45.0.1",
|
||||
"fs-extra": "^11.1.0",
|
||||
"husky": "^8.0.1",
|
||||
"is-ci": "^3.0.0",
|
||||
"jasmine-core": "^4.5.0",
|
||||
@ -138,10 +138,11 @@
|
||||
"lodash": "^4.17.21",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"postcss": "^8.4.19",
|
||||
"postcss-less": "^6.0.0",
|
||||
"prettier": "^2.8.0",
|
||||
"pretty-quick": "^3.1.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"rollup": "^3.4.0",
|
||||
"rollup": "^3.5.0",
|
||||
"rollup-plugin-auto-external": "^2.0.0",
|
||||
"rollup-plugin-filesize": "^9.1.1",
|
||||
"rollup-plugin-postcss": "^4.0.1",
|
||||
@ -149,7 +150,7 @@
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"run-shared-scripts": "^1.1.4",
|
||||
"semantic-release": "^19.0.5",
|
||||
"sinon": "^14.0.1",
|
||||
"sinon": "^15.0.0",
|
||||
"stylelint": "^14.15.0",
|
||||
"stylelint-config-prettier": "^9.0.4",
|
||||
"stylelint-config-rational-order": "^0.1.2",
|
||||
|
@ -1 +1,8 @@
|
||||
## @antv/x6-common [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-common@2.0.0...@antv/x6-common@2.0.1) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-common [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-common@2.0.0...@antv/x6-common@2.0.1) (2022-11-24)
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-common",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.3",
|
||||
"description": "Basic toolkit for X6",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -54,7 +54,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-common"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -6,5 +6,5 @@ export {
|
||||
sortBy,
|
||||
groupBy,
|
||||
difference,
|
||||
max
|
||||
max,
|
||||
} from 'lodash-es'
|
||||
|
@ -1,3 +1,5 @@
|
||||
/* eslint-disable no-constructor-return */
|
||||
|
||||
import { NumberExt } from '../number'
|
||||
|
||||
export class Color {
|
||||
|
@ -1,26 +1,25 @@
|
||||
import { StringExt } from '../string'
|
||||
|
||||
export function getData(dataset: Record<string, any>, name: string) {
|
||||
const value = dataset[name] || dataset[StringExt.camelCase(name)]
|
||||
try {
|
||||
return JSON.parse(value)
|
||||
} catch {
|
||||
return value
|
||||
const dataset: WeakMap<Element, Record<string, any>> = new WeakMap()
|
||||
|
||||
export function getData(elem: Element, name: string) {
|
||||
const key = StringExt.camelCase(name)
|
||||
const cache = dataset.get(elem)
|
||||
if (cache) {
|
||||
return cache[key]
|
||||
}
|
||||
}
|
||||
|
||||
export function setData(
|
||||
dataset: Record<string, any>,
|
||||
name: string,
|
||||
value: any,
|
||||
) {
|
||||
let val = value
|
||||
try {
|
||||
val = JSON.stringify(val)
|
||||
} catch (e) {
|
||||
// paas
|
||||
export function setData(elem: Element, name: string, value: any) {
|
||||
const key = StringExt.camelCase(name)
|
||||
const cache = dataset.get(elem)
|
||||
if (cache) {
|
||||
cache[key] = value
|
||||
} else {
|
||||
dataset.set(elem, {
|
||||
[key]: value,
|
||||
})
|
||||
}
|
||||
dataset[StringExt.camelCase(name)] = val
|
||||
}
|
||||
|
||||
export function data(elem: Element): Record<string, any> | undefined
|
||||
@ -34,20 +33,17 @@ export function data(
|
||||
) {
|
||||
if (!name) {
|
||||
const datas: Record<string, any> = {}
|
||||
const dataset = (elem as any).dataset
|
||||
// eslint-disable-next-line
|
||||
for (const key in dataset) {
|
||||
datas[key] = getData(dataset, key)
|
||||
}
|
||||
Object.keys(dataset).forEach((key) => {
|
||||
datas[key] = getData(elem, key)
|
||||
})
|
||||
return datas
|
||||
}
|
||||
|
||||
if (typeof name === 'string') {
|
||||
const dataset = (elem as any).dataset
|
||||
if (value === undefined) {
|
||||
return getData(dataset, name)
|
||||
return getData(elem, name)
|
||||
}
|
||||
setData(dataset, name, value)
|
||||
setData(elem, name, value)
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -117,6 +117,7 @@ export function unsetByPath(
|
||||
return obj
|
||||
}
|
||||
|
||||
// eslint-disable-next-line default-param-last
|
||||
export function flatten(obj: any, delim = '/', stop?: (val: any) => boolean) {
|
||||
const ret: { [key: string]: any } = {}
|
||||
|
||||
|
@ -1 +1,12 @@
|
||||
## @antv/x6-geometry [2.0.4](https://github.com/antvis/x6/compare/@antv/x6-geometry@2.0.3...@antv/x6-geometry@2.0.4) (2022-11-29)
|
||||
|
||||
## @antv/x6-geometry [2.0.3](https://github.com/antvis/x6/compare/@antv/x6-geometry@2.0.2...@antv/x6-geometry@2.0.3) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-geometry [2.0.2](https://github.com/antvis/x6/compare/@antv/x6-geometry@2.0.1...@antv/x6-geometry@2.0.2) (2022-11-25)
|
||||
|
||||
## @antv/x6-geometry [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-geometry@2.0.0...@antv/x6-geometry@2.0.1) (2022-11-24)
|
||||
|
@ -5,7 +5,7 @@
|
||||
<a href="/LICENSE"><img src="https://img.shields.io/github/license/antvis/x6?style=flat-square" alt="MIT License"></a>
|
||||
<a href="https://www.typescriptlang.org"><img alt="Language" src="https://img.shields.io/badge/language-TypeScript-blue.svg?style=flat-square"></a>
|
||||
<a href="https://github.com/antvis/x6/pulls"><img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square"></a>
|
||||
<a href="https://x6.antv.vision"><img alt="website" src="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=0076D6&style=flat-square&logo=google-chrome&logoColor=0076D6"></a>
|
||||
<a href="https://x6.antv.antgroup.com"><img alt="website" src="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=0076D6&style=flat-square&logo=google-chrome&logoColor=0076D6"></a>
|
||||
<a href="https://github.com/antvis/X6/actions/workflows/ci.yml"><img alt="build" src="https://img.shields.io/github/workflow/status/antvis/x6/%F0%9F%91%B7%E3%80%80CI/master?logo=github&style=flat-square"></a>
|
||||
<a href="https://app.codecov.io/gh/antvis/x6"><img alt="coverage" src="https://img.shields.io/codecov/c/gh/antvis/x6?logo=codecov&flag=x6-geometry&style=flat-square&token=15CO54WYUV"></a>
|
||||
<a href="https://lgtm.com/projects/g/antvis/x6/context:javascript"><img alt="Language grade: JavaScript" src="https://img.shields.io/lgtm/grade/javascript/g/antvis/x6.svg?logo=lgtm&style=flat-square"></a>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.4",
|
||||
"name": "@antv/x6-geometry",
|
||||
"description": "Geometry operations for X6",
|
||||
"main": "lib/index.js",
|
||||
@ -47,7 +47,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-geometry"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* eslint-disable default-param-last */
|
||||
|
||||
import { Point } from '../point'
|
||||
|
||||
const regexSupportedData = new RegExp(`^[\\s\\dLMCZz,.]*$`)
|
||||
const regexSupportedData = new RegExp(`^[\\s\\dLMCZz,.]*$`) // eslint-disable-line prefer-regex-literals
|
||||
|
||||
export function isValid(data: any) {
|
||||
if (typeof data !== 'string') {
|
||||
|
@ -1,3 +1,5 @@
|
||||
/* eslint-disable no-constructor-return */
|
||||
|
||||
import { Line } from './line'
|
||||
import { Point } from './point'
|
||||
import { Rectangle } from './rectangle'
|
||||
|
@ -1,3 +1,19 @@
|
||||
## @antv/x6-plugin-clipboard [2.1.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-clipboard@2.1.2...@antv/x6-plugin-clipboard@2.1.3) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* broken file ([d6df2d5](https://github.com/antvis/x6/commit/d6df2d59811dc18791208af36b452e11e6391f3b))
|
||||
|
||||
## @antv/x6-plugin-clipboard [2.1.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-clipboard@2.1.1...@antv/x6-plugin-clipboard@2.1.2) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-plugin-clipboard [2.1.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-clipboard@2.1.0...@antv/x6-plugin-clipboard@2.1.1) (2022-11-25)
|
||||
|
||||
# @antv/x6-plugin-clipboard [2.1.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-clipboard@2.0.0...@antv/x6-plugin-clipboard@2.1.0) (2022-11-24)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-plugin-clipboard",
|
||||
"version": "2.1.0",
|
||||
"version": "2.1.3",
|
||||
"description": "clipboard plugin for X6",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -53,7 +53,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-clipboard"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -1,3 +1,12 @@
|
||||
## @antv/x6-plugin-dnd [2.0.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-dnd@2.0.2...@antv/x6-plugin-dnd@2.0.3) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-plugin-dnd [2.0.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-dnd@2.0.1...@antv/x6-plugin-dnd@2.0.2) (2022-11-25)
|
||||
|
||||
## @antv/x6-plugin-dnd [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-dnd@2.0.0...@antv/x6-plugin-dnd@2.0.1) (2022-11-24)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-plugin-dnd",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.3",
|
||||
"description": "dnd plugin for X6",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -54,7 +54,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-dnd"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -1,3 +1,12 @@
|
||||
## @antv/x6-plugin-export [2.1.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-export@2.1.1...@antv/x6-plugin-export@2.1.2) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-plugin-export [2.1.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-export@2.1.0...@antv/x6-plugin-export@2.1.1) (2022-11-25)
|
||||
|
||||
# @antv/x6-plugin-export [2.1.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-export@2.0.0...@antv/x6-plugin-export@2.1.0) (2022-11-24)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-plugin-export",
|
||||
"version": "2.1.0",
|
||||
"version": "2.1.4",
|
||||
"description": "export plugin for X6.",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -52,7 +52,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-export"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -3,12 +3,54 @@ import { Export } from './index'
|
||||
|
||||
declare module '@antv/x6/lib/graph/graph' {
|
||||
interface Graph {
|
||||
toSVG: (
|
||||
callback: Export.ToSVGCallback,
|
||||
options: Export.ToSVGOptions,
|
||||
) => void
|
||||
toPNG: (
|
||||
callback: Export.ToSVGCallback,
|
||||
options: Export.ToImageOptions,
|
||||
) => void
|
||||
toJPEG: (
|
||||
callback: Export.ToSVGCallback,
|
||||
options: Export.ToImageOptions,
|
||||
) => void
|
||||
exportPNG: (fileName?: string, options?: Export.ToImageOptions) => void
|
||||
exportJPEG: (fileName?: string, options?: Export.ToImageOptions) => void
|
||||
exportSVG: (fileName?: string, options?: Export.ToSVGOptions) => void
|
||||
}
|
||||
}
|
||||
|
||||
Graph.prototype.toSVG = function (
|
||||
callback: Export.ToSVGCallback,
|
||||
options: Export.ToSVGOptions,
|
||||
) {
|
||||
const instance = this.getPlugin('export') as Export
|
||||
if (instance) {
|
||||
instance.toSVG(callback, options)
|
||||
}
|
||||
}
|
||||
|
||||
Graph.prototype.toPNG = function (
|
||||
callback: Export.ToSVGCallback,
|
||||
options: Export.ToImageOptions,
|
||||
) {
|
||||
const instance = this.getPlugin('export') as Export
|
||||
if (instance) {
|
||||
instance.toPNG(callback, options)
|
||||
}
|
||||
}
|
||||
|
||||
Graph.prototype.toJPEG = function (
|
||||
callback: Export.ToSVGCallback,
|
||||
options: Export.ToImageOptions,
|
||||
) {
|
||||
const instance = this.getPlugin('export') as Export
|
||||
if (instance) {
|
||||
instance.toJPEG(callback, options)
|
||||
}
|
||||
}
|
||||
|
||||
Graph.prototype.exportPNG = function (
|
||||
fileName?: string,
|
||||
options?: Export.ToImageOptions,
|
||||
|
@ -1,3 +1,12 @@
|
||||
## @antv/x6-plugin-history [2.1.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@2.1.2...@antv/x6-plugin-history@2.1.3) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-plugin-history [2.1.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@2.1.1...@antv/x6-plugin-history@2.1.2) (2022-11-25)
|
||||
|
||||
## @antv/x6-plugin-history [2.1.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@2.1.0...@antv/x6-plugin-history@2.1.1) (2022-11-24)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-plugin-history",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.3",
|
||||
"description": "history plugin for X6",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -53,7 +53,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-history"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -1,3 +1,19 @@
|
||||
## @antv/x6-plugin-keyboard [2.1.4](https://github.com/antvis/x6/compare/@antv/x6-plugin-keyboard@2.1.3...@antv/x6-plugin-keyboard@2.1.4) (2022-11-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* not trigger keyboard event whith delete key in contenteditable elem ([#2965](https://github.com/antvis/x6/issues/2965)) ([4978110](https://github.com/antvis/x6/commit/4978110b4594aee801d39c74f5c190432846eba4))
|
||||
|
||||
## @antv/x6-plugin-keyboard [2.1.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-keyboard@2.1.2...@antv/x6-plugin-keyboard@2.1.3) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-plugin-keyboard [2.1.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-keyboard@2.1.1...@antv/x6-plugin-keyboard@2.1.2) (2022-11-25)
|
||||
|
||||
## @antv/x6-plugin-keyboard [2.1.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-keyboard@2.1.0...@antv/x6-plugin-keyboard@2.1.1) (2022-11-25)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-plugin-keyboard",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.4",
|
||||
"description": "keyboard plugin for X6",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -57,7 +57,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-keyboard"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -129,15 +129,18 @@ export class KeyboardImpl extends Disposable implements IDisablable {
|
||||
isInputEvent(e: KeyboardEvent | Dom.MouseUpEvent) {
|
||||
const target = e.target as Element
|
||||
const tagName = target?.tagName?.toLowerCase()
|
||||
return ['input', 'textarea'].includes(tagName)
|
||||
let isInput = ['input', 'textarea'].includes(tagName)
|
||||
if (Dom.attr(target, 'contenteditable') === 'true') {
|
||||
isInput = true
|
||||
}
|
||||
return isInput
|
||||
}
|
||||
|
||||
isEnabledForEvent(e: KeyboardEvent) {
|
||||
const allowed = !this.disabled && this.isGraphEvent(e)
|
||||
const isInputEvent = this.isInputEvent(e)
|
||||
if (allowed) {
|
||||
const code = e.keyCode || e.which
|
||||
if (isInputEvent && (code === 8 || code === 46)) {
|
||||
if (isInputEvent && (e.key === 'Backspace' || e.key === 'Delete')) {
|
||||
return false
|
||||
}
|
||||
if (this.options.guard) {
|
||||
|
@ -1,3 +1,12 @@
|
||||
## @antv/x6-plugin-minimap [2.0.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-minimap@2.0.2...@antv/x6-plugin-minimap@2.0.3) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-plugin-minimap [2.0.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-minimap@2.0.1...@antv/x6-plugin-minimap@2.0.2) (2022-11-25)
|
||||
|
||||
## @antv/x6-plugin-minimap [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-minimap@2.0.0...@antv/x6-plugin-minimap@2.0.1) (2022-11-24)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-plugin-minimap",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.3",
|
||||
"description": "minimap plugin for X6",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -54,7 +54,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-minimap"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
> svg {
|
||||
pointer-events: none;
|
||||
shape-rendering: optimizeSpeed;
|
||||
shape-rendering: optimizespeed;
|
||||
}
|
||||
|
||||
.x6-node * {
|
||||
|
@ -1,3 +1,12 @@
|
||||
## @antv/x6-plugin-scroller [2.0.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-scroller@2.0.2...@antv/x6-plugin-scroller@2.0.3) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-plugin-scroller [2.0.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-scroller@2.0.1...@antv/x6-plugin-scroller@2.0.2) (2022-11-25)
|
||||
|
||||
## @antv/x6-plugin-scroller [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-scroller@2.0.0...@antv/x6-plugin-scroller@2.0.1) (2022-11-24)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-plugin-scroller",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.3",
|
||||
"description": "scroller plugin for X6",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -54,7 +54,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-scroller"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -37,14 +37,10 @@
|
||||
|
||||
&&-pannable[data-panning='false'] {
|
||||
cursor: grab;
|
||||
cursor: -moz-grab;
|
||||
cursor: -webkit-grab;
|
||||
}
|
||||
|
||||
&&-pannable[data-panning='true'] {
|
||||
cursor: grabbing;
|
||||
cursor: -moz-grabbing;
|
||||
cursor: -webkit-grabbing;
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,12 @@
|
||||
## @antv/x6-plugin-selection [2.1.4](https://github.com/antvis/x6/compare/@antv/x6-plugin-selection@2.1.3...@antv/x6-plugin-selection@2.1.4) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-plugin-selection [2.1.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-selection@2.1.2...@antv/x6-plugin-selection@2.1.3) (2022-11-25)
|
||||
|
||||
## @antv/x6-plugin-selection [2.1.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-selection@2.1.1...@antv/x6-plugin-selection@2.1.2) (2022-11-24)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-plugin-selection",
|
||||
"version": "2.1.2",
|
||||
"version": "2.1.5",
|
||||
"description": "selection plugin for X6",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -54,7 +54,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-selection"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -464,7 +464,6 @@ export namespace Selection {
|
||||
multipleSelectionModifiers: ['ctrl', 'meta'],
|
||||
movable: true,
|
||||
strict: false,
|
||||
useCellGeometry: false,
|
||||
selectCellOnMoved: false,
|
||||
selectNodeOnMoved: false,
|
||||
selectEdgeOnMoved: false,
|
||||
|
@ -607,29 +607,21 @@ export class SelectionImpl extends View<SelectionImpl.EventArgs> {
|
||||
let views: CellView[] = []
|
||||
|
||||
if (this.options.rubberNode) {
|
||||
if (this.options.useCellGeometry) {
|
||||
views = views.concat(
|
||||
graph.model
|
||||
.getNodesInArea(rect, options)
|
||||
.map((node) => graph.renderer.findViewByCell(node))
|
||||
.filter((view) => view != null) as CellView[],
|
||||
)
|
||||
} else {
|
||||
views = views.concat(graph.renderer.findViewsInArea(rect, options))
|
||||
}
|
||||
views = views.concat(
|
||||
graph.model
|
||||
.getNodesInArea(rect, options)
|
||||
.map((node) => graph.renderer.findViewByCell(node))
|
||||
.filter((view) => view != null) as CellView[],
|
||||
)
|
||||
}
|
||||
|
||||
if (this.options.rubberEdge) {
|
||||
if (this.options.useCellGeometry) {
|
||||
views = views.concat(
|
||||
graph.model
|
||||
.getEdgesInArea(rect, options)
|
||||
.map((edge) => graph.renderer.findViewByCell(edge))
|
||||
.filter((view) => view != null) as CellView[],
|
||||
)
|
||||
} else {
|
||||
views = views.concat(graph.renderer.findEdgeViewsInArea(rect, options))
|
||||
}
|
||||
views = views.concat(
|
||||
graph.model
|
||||
.getEdgesInArea(rect, options)
|
||||
.map((edge) => graph.renderer.findViewByCell(edge))
|
||||
.filter((view) => view != null) as CellView[],
|
||||
)
|
||||
}
|
||||
|
||||
return views
|
||||
@ -761,7 +753,7 @@ export class SelectionImpl extends View<SelectionImpl.EventArgs> {
|
||||
const view = this.graph.renderer.findViewByCell(cell)
|
||||
if (view) {
|
||||
const bbox = view.getBBox({
|
||||
useCellGeometry: this.options.useCellGeometry,
|
||||
useCellGeometry: true,
|
||||
})
|
||||
origin.x = Math.min(origin.x, bbox.x)
|
||||
origin.y = Math.min(origin.y, bbox.y)
|
||||
@ -822,7 +814,7 @@ export class SelectionImpl extends View<SelectionImpl.EventArgs> {
|
||||
const view = this.graph.renderer.findViewByCell(cell)
|
||||
if (view) {
|
||||
const bbox = view.getBBox({
|
||||
useCellGeometry: this.options.useCellGeometry,
|
||||
useCellGeometry: true,
|
||||
})
|
||||
|
||||
const className = this.boxClassName
|
||||
@ -899,7 +891,7 @@ export class SelectionImpl extends View<SelectionImpl.EventArgs> {
|
||||
protected onCellAdded({ cell }: Collection.EventArgs['added']) {
|
||||
// The collection do not known the cell was removed when cell was
|
||||
// removed by interaction(such as, by "delete" shortcut), so we should
|
||||
// manually listen to cell's remove evnet.
|
||||
// manually listen to cell's remove event.
|
||||
this.listenCellRemoveEvent(cell)
|
||||
this.createSelectionBox(cell)
|
||||
this.updateContainer()
|
||||
@ -971,7 +963,6 @@ export namespace SelectionImpl {
|
||||
showNodeSelectionBox?: boolean
|
||||
movable?: boolean
|
||||
following?: boolean
|
||||
useCellGeometry?: boolean
|
||||
content?: Content
|
||||
|
||||
// Can select node or edge when rubberband
|
||||
|
@ -1,3 +1,12 @@
|
||||
## @antv/x6-plugin-snapline [2.1.4](https://github.com/antvis/x6/compare/@antv/x6-plugin-snapline@2.1.3...@antv/x6-plugin-snapline@2.1.4) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-plugin-snapline [2.1.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-snapline@2.1.2...@antv/x6-plugin-snapline@2.1.3) (2022-11-25)
|
||||
|
||||
## @antv/x6-plugin-snapline [2.1.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-snapline@2.1.1...@antv/x6-plugin-snapline@2.1.2) (2022-11-24)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-plugin-snapline",
|
||||
"version": "2.1.2",
|
||||
"version": "2.1.6",
|
||||
"description": "snapline plugin for X6",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -54,7 +54,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-snapline"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -5,10 +5,12 @@ import './api'
|
||||
|
||||
export class Snapline extends Disposable {
|
||||
private snaplineImpl: SnaplineImpl
|
||||
public options: Snapline.Options
|
||||
public name = 'snapline'
|
||||
|
||||
constructor(public readonly options: Snapline.Options) {
|
||||
constructor(options: Snapline.Options) {
|
||||
super()
|
||||
this.options = { tolerance: 10, ...options }
|
||||
CssLoader.ensure(this.name, content)
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ export class SnaplineImpl extends View implements IDisablable {
|
||||
|
||||
const { graph, ...others } = options
|
||||
this.graph = graph
|
||||
this.options = { tolerance: 10, ...others }
|
||||
this.options = { ...others }
|
||||
this.offset = { x: 0, y: 0 }
|
||||
this.render()
|
||||
if (!this.disabled) {
|
||||
|
@ -1,3 +1,12 @@
|
||||
## @antv/x6-plugin-stencil [2.0.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-stencil@2.0.2...@antv/x6-plugin-stencil@2.0.3) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-plugin-stencil [2.0.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-stencil@2.0.1...@antv/x6-plugin-stencil@2.0.2) (2022-11-25)
|
||||
|
||||
## @antv/x6-plugin-stencil [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-stencil@2.0.0...@antv/x6-plugin-stencil@2.0.1) (2022-11-24)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-plugin-stencil",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.2",
|
||||
"description": "stencil plugin for X6",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -56,7 +56,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-stencil"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -247,12 +247,12 @@
|
||||
}
|
||||
|
||||
input[type='search'] {
|
||||
-webkit-appearance: textfield;
|
||||
appearance: textfield;
|
||||
}
|
||||
|
||||
input[type='search']::-webkit-search-cancel-button,
|
||||
input[type='search']::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
&-search-text {
|
||||
|
@ -1,3 +1,19 @@
|
||||
## @antv/x6-plugin-transform [2.1.4](https://github.com/antvis/x6/compare/@antv/x6-plugin-transform@2.1.3...@antv/x6-plugin-transform@2.1.4) (2022-12-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* make resizing options take effect ([#3014](https://github.com/antvis/x6/issues/3014)) ([604c024](https://github.com/antvis/x6/commit/604c0244cd71ec8e911754dfe524f12c04e4e9ad))
|
||||
|
||||
## @antv/x6-plugin-transform [2.1.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-transform@2.1.1...@antv/x6-plugin-transform@2.1.2) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-plugin-transform [2.1.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-transform@2.1.0...@antv/x6-plugin-transform@2.1.1) (2022-11-25)
|
||||
|
||||
# @antv/x6-plugin-transform [2.1.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-transform@2.0.0...@antv/x6-plugin-transform@2.1.0) (2022-11-24)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-plugin-transform",
|
||||
"version": "2.1.0",
|
||||
"version": "2.1.4",
|
||||
"description": "transform plugin for X6",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -54,7 +54,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-transform"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -19,16 +19,16 @@ export class Transform extends Basecoat<Transform.EventArgs> {
|
||||
}
|
||||
|
||||
protected startListening() {
|
||||
this.graph.on('node:mouseup', this.onNodeMouseUp, this)
|
||||
this.graph.on('node:click', this.onNodeClick, this)
|
||||
this.graph.on('blank:mousedown', this.onBlankMouseDown, this)
|
||||
}
|
||||
|
||||
protected stopListening() {
|
||||
this.graph.off('node:mouseup', this.onNodeMouseUp, this)
|
||||
this.graph.off('node:click', this.onNodeClick, this)
|
||||
this.graph.off('blank:mousedown', this.onBlankMouseDown, this)
|
||||
}
|
||||
|
||||
protected onNodeMouseUp({ node }: EventArgs['node:mouseup']) {
|
||||
protected onNodeClick({ node }: EventArgs['node:click']) {
|
||||
this.clearWidgets()
|
||||
const widget = this.createTransform(node)
|
||||
if (widget) {
|
||||
@ -90,18 +90,23 @@ export class Transform extends Basecoat<Transform.EventArgs> {
|
||||
)
|
||||
|
||||
const options: TransformImpl.Options = {
|
||||
resizable: resizing.enabled,
|
||||
resizable: !!resizing.enabled,
|
||||
minWidth: resizing.minWidth || 0,
|
||||
maxWidth: resizing.maxWidth || Number.MAX_SAFE_INTEGER,
|
||||
minHeight: resizing.minHeight || 0,
|
||||
maxHeight: resizing.maxHeight || Number.MAX_SAFE_INTEGER,
|
||||
orthogonalResizing: resizing.orthogonal || true,
|
||||
restrictedResizing: resizing.restrict || false,
|
||||
autoScrollOnResizing: resizing.autoScroll || true,
|
||||
preserveAspectRatio: resizing.preserveAspectRatio || false,
|
||||
allowReverse: resizing.allowReverse || true,
|
||||
orthogonalResizing:
|
||||
typeof resizing.orthogonal === 'boolean' ? resizing.orthogonal : true,
|
||||
restrictedResizing: !!resizing.restrict,
|
||||
autoScrollOnResizing:
|
||||
typeof resizing.autoScroll === 'boolean' ? resizing.autoScroll : true,
|
||||
preserveAspectRatio: !!resizing.preserveAspectRatio,
|
||||
allowReverse:
|
||||
typeof resizing.allowReverse === 'boolean'
|
||||
? resizing.allowReverse
|
||||
: true,
|
||||
|
||||
rotatable: rotating.enabled || false,
|
||||
rotatable: !!rotating.enabled,
|
||||
rotateGrid: rotating.grid || 15,
|
||||
}
|
||||
|
||||
@ -109,7 +114,11 @@ export class Transform extends Basecoat<Transform.EventArgs> {
|
||||
}
|
||||
|
||||
protected clearWidgets() {
|
||||
this.widgets.forEach((widget) => widget.dispose())
|
||||
this.widgets.forEach((widget, node) => {
|
||||
if (this.graph.getCellById(node.id)) {
|
||||
widget.dispose()
|
||||
}
|
||||
})
|
||||
this.widgets.clear()
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,12 @@
|
||||
## @antv/x6-react-components [2.0.5](https://github.com/antvis/x6/compare/@antv/x6-react-components@2.0.4...@antv/x6-react-components@2.0.5) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-react-components [2.0.4](https://github.com/antvis/x6/compare/@antv/x6-react-components@2.0.3...@antv/x6-react-components@2.0.4) (2022-11-25)
|
||||
|
||||
## @antv/x6-react-components [2.0.3](https://github.com/antvis/x6/compare/@antv/x6-react-components@2.0.2...@antv/x6-react-components@2.0.3) (2022-11-25)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-react-components",
|
||||
"version": "2.0.3",
|
||||
"version": "2.0.5",
|
||||
"description": "React components for building x6 editors",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -57,17 +57,17 @@
|
||||
"classnames": "^2.2.6",
|
||||
"rc-dropdown": "^3.0.0-alpha.0",
|
||||
"rc-util": "^4.15.7",
|
||||
"react-color": "2.17.1",
|
||||
"react-color": "2.19.3",
|
||||
"react-resize-detector": "^7.0.0",
|
||||
"ua-parser-js": "^0.7.20"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.0.0",
|
||||
"@types/react-color": "^3.0.1",
|
||||
"@types/react-resize-detector": "^6.1.0",
|
||||
"@types/react-dom": "^18.0.9",
|
||||
"@types/react-resize-detector": "^6.1.0",
|
||||
"@types/ua-parser-js": "^0.7.33",
|
||||
"antd": "^5.0.0",
|
||||
"antd": "^5.0.3",
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
},
|
||||
@ -82,7 +82,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-react-components"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -1 +1 @@
|
||||
@import '../../style/themes/index';
|
||||
@import url('../../style/themes/index');
|
||||
|
@ -1,4 +1,4 @@
|
||||
@import '../../style/themes/index';
|
||||
@import url('../../style/themes/index');
|
||||
|
||||
@color-picker-prefix-cls: ~'@{x6-prefix}-color-picker';
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
background: transparent;
|
||||
|
||||
.sketch-picker {
|
||||
box-shadow: #e9e9e9 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 8px 16px !important;
|
||||
box-shadow: #e9e9e9 0 0 0 1px, rgb(0 0 0 / 10%) 0 8px 16px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../menu/style/index';
|
||||
@import url('../../style/themes/index');
|
||||
@import url('../../menu/style/index');
|
||||
|
@ -1,4 +1,4 @@
|
||||
@import '../../style/themes/index';
|
||||
@import url('../../style/themes/index');
|
||||
|
||||
@dropdown-prefix-cls: ~'@{x6-prefix}-dropdown';
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
max-height: 320px;
|
||||
overflow-y: scroll;
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 1px 6px rgb(0 0 0 / 20%);
|
||||
|
||||
// &::before {
|
||||
// position: absolute;
|
||||
|
@ -1,4 +1,4 @@
|
||||
@import '../../style/themes/index';
|
||||
@import url('../../style/themes/index');
|
||||
|
||||
@menu-prefix-cls: ~'@{x6-prefix}-menu';
|
||||
|
||||
@ -103,8 +103,8 @@
|
||||
right: 12px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 4px solid rgba(0, 0, 0, 0);
|
||||
border-bottom: 4px solid rgba(0, 0, 0, 0);
|
||||
border-top: 4px solid rgb(0 0 0 / 0%);
|
||||
border-bottom: 4px solid rgb(0 0 0 / 0%);
|
||||
border-left: 5px solid @menu-submenu-arrow-color;
|
||||
opacity: 0.4;
|
||||
pointer-events: none;
|
||||
|
@ -1,5 +1,5 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../menu/style/index';
|
||||
@import url('../../style/themes/index');
|
||||
@import url('../../menu/style/index');
|
||||
|
||||
@menubar-prefix-cls: ~'@{x6-prefix}-menubar';
|
||||
|
||||
@ -96,7 +96,7 @@
|
||||
}
|
||||
|
||||
& > .@{menu-prefix-cls} {
|
||||
border-radius: 0 4px 4px 4px;
|
||||
border-radius: 0 4px 4px;
|
||||
}
|
||||
|
||||
.@{menu-prefix-cls}-submenu-menu {
|
||||
|
@ -1,5 +1,5 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../scrollbar/style/index';
|
||||
@import url('../../style/themes/index');
|
||||
@import url('../../scrollbar/style/index');
|
||||
|
||||
@scrollBox-prefix-cls: ~'@{x6-prefix}-scroll-box';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
@import '../../style/themes/index';
|
||||
@import url('../../style/themes/index');
|
||||
|
||||
@scrollbar-prefix-cls: ~'@{x6-prefix}-scrollbar';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
@import '../../style/themes/index';
|
||||
@import url('../../style/themes/index');
|
||||
|
||||
@splitBox-prefix-cls: ~'@{x6-prefix}-split-box';
|
||||
|
||||
|
@ -1 +1 @@
|
||||
@import './themes/index';
|
||||
@import url('./themes/index');
|
||||
|
@ -1 +1 @@
|
||||
@import './default.less';
|
||||
@import url('./default.less');
|
||||
|
@ -1,5 +1,5 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../dropdown/style/index';
|
||||
@import url('../../style/themes/index');
|
||||
@import url('../../dropdown/style/index');
|
||||
|
||||
@toolbar-prefix-cls: ~'@{x6-prefix}-toolbar';
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
width: 1px;
|
||||
height: 40%;
|
||||
margin: 0 6px;
|
||||
background-color: rgba(0, 0, 0, 0.15);
|
||||
background-color: rgb(0 0 0 / 15%);
|
||||
content: ' ';
|
||||
pointer-events: none;
|
||||
}
|
||||
@ -111,9 +111,9 @@
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-left: 6px;
|
||||
border-color: #262626 transparent transparent transparent;
|
||||
border-color: #262626 transparent transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 4px 0 4px;
|
||||
border-width: 5px 4px 0;
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,12 @@
|
||||
## @antv/x6-react-shape [2.0.4](https://github.com/antvis/x6/compare/@antv/x6-react-shape@2.0.3...@antv/x6-react-shape@2.0.4) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-react-shape [2.0.3](https://github.com/antvis/x6/compare/@antv/x6-react-shape@2.0.2...@antv/x6-react-shape@2.0.3) (2022-11-25)
|
||||
|
||||
## @antv/x6-react-shape [2.0.2](https://github.com/antvis/x6/compare/@antv/x6-react-shape@2.0.1...@antv/x6-react-shape@2.0.2) (2022-11-25)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-react-shape",
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.7",
|
||||
"description": "X6 shape for rendering react components.",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -39,8 +39,8 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@antv/x6": "^2.x",
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
"react": ">=16.8.6 || >=17.0.0 || >=18.0.0",
|
||||
"react-dom": ">=16.8.6 || >=17.0.0 || >= 18.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antv/x6": "^2.x",
|
||||
@ -60,7 +60,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-react-shape"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -1,16 +1,19 @@
|
||||
import React, { ReactPortal } from 'react'
|
||||
import { createPortal } from 'react-dom'
|
||||
import { createRoot, Root } from 'react-dom/client'
|
||||
import React, { ReactPortal, version as reactVersion } from 'react'
|
||||
import ReactDOM, { createPortal } from 'react-dom'
|
||||
import type { Root, createRoot as CreateRoot } from 'react-dom/client'
|
||||
import { Dom, NodeView } from '@antv/x6'
|
||||
import { ReactShape } from './node'
|
||||
import { Portal } from './portal'
|
||||
import { Wrap } from './wrap'
|
||||
|
||||
const [, major] = /^(\d+)\.\d+\.\d+$/.exec(reactVersion)!
|
||||
const reactMajor = Number(major)
|
||||
const isPreEighteen = reactMajor < 18
|
||||
export class ReactShapeView extends NodeView<ReactShape> {
|
||||
root?: Root
|
||||
|
||||
getComponentContainer() {
|
||||
return this.selectors.foContent as HTMLDivElement
|
||||
return this.selectors && (this.selectors.foContent as HTMLDivElement)
|
||||
}
|
||||
|
||||
confirmUpdate(flag: number) {
|
||||
@ -26,21 +29,36 @@ export class ReactShapeView extends NodeView<ReactShape> {
|
||||
const node = this.cell
|
||||
|
||||
if (container) {
|
||||
const elem = React.createElement(Wrap, { node, graph: node.model!.graph })
|
||||
const graph = node.model ? node.model.graph : null
|
||||
// Actually in the dnd plugin, this graph is empty,
|
||||
// in order to make the external perception type of graph is a graph, rather than graph | null, so hack this.
|
||||
const elem = React.createElement(Wrap, { node, graph: graph! })
|
||||
if (Portal.isActive()) {
|
||||
const portal = createPortal(elem, container) as ReactPortal
|
||||
Portal.connect(this.cell.id, portal)
|
||||
} else {
|
||||
const root = createRoot(container)
|
||||
root.render(elem)
|
||||
if (isPreEighteen) {
|
||||
ReactDOM.render(elem, container)
|
||||
} else {
|
||||
// eslint-disable-next-line
|
||||
const createRoot = require('react-dom/client')
|
||||
.createRoot as typeof CreateRoot
|
||||
this.root = createRoot(container)
|
||||
this.root.render(elem)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected unmountReactComponent() {
|
||||
if (this.root) {
|
||||
this.root.unmount()
|
||||
this.root = undefined
|
||||
const container = this.getComponentContainer()
|
||||
if (container) {
|
||||
if (isPreEighteen) {
|
||||
ReactDOM.unmountComponentAtNode(container)
|
||||
} else if (this.root) {
|
||||
this.root.unmount()
|
||||
this.root = undefined
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,12 @@
|
||||
## @antv/x6-vue-shape [2.0.4](https://github.com/antvis/x6/compare/@antv/x6-vue-shape@2.0.3...@antv/x6-vue-shape@2.0.4) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6-vue-shape [2.0.3](https://github.com/antvis/x6/compare/@antv/x6-vue-shape@2.0.2...@antv/x6-vue-shape@2.0.3) (2022-11-25)
|
||||
|
||||
## @antv/x6-vue-shape [2.0.2](https://github.com/antvis/x6/compare/@antv/x6-vue-shape@2.0.1...@antv/x6-vue-shape@2.0.2) (2022-11-24)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-vue-shape",
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.4",
|
||||
"description": "X6 shape for rendering vue components.",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -65,7 +65,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-vue-shape"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -18,6 +18,10 @@ export class VueShapeView extends NodeView<VueShape> {
|
||||
})
|
||||
}
|
||||
|
||||
protected targetId() {
|
||||
return `${this.graph.view.cid}:${this.cell.id}`
|
||||
}
|
||||
|
||||
protected renderVueComponent() {
|
||||
this.unmountVueComponent()
|
||||
const root = this.getComponentContainer()
|
||||
@ -41,7 +45,7 @@ export class VueShapeView extends NodeView<VueShape> {
|
||||
})
|
||||
} else if (isVue3) {
|
||||
if (isActive()) {
|
||||
connect(node.id, component, root, node)
|
||||
connect(this.targetId(), component, root, node)
|
||||
} else {
|
||||
this.vm = createApp({
|
||||
render() {
|
||||
@ -97,7 +101,7 @@ export class VueShapeView extends NodeView<VueShape> {
|
||||
|
||||
unmount() {
|
||||
if (isActive()) {
|
||||
disconnect(this.cell.id)
|
||||
disconnect(this.targetId())
|
||||
}
|
||||
this.unmountVueComponent()
|
||||
super.unmount()
|
||||
|
@ -1,3 +1,19 @@
|
||||
## @antv/x6 [2.0.7](https://github.com/antvis/x6/compare/@antv/x6@2.0.6...@antv/x6@2.0.7) (2022-12-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* hide elems when visible is false ([#3007](https://github.com/antvis/x6/issues/3007)) ([057d520](https://github.com/antvis/x6/commit/057d5209ff827d0231ecc6562e768907f75aff2d))
|
||||
|
||||
## @antv/x6 [2.0.4](https://github.com/antvis/x6/compare/@antv/x6@2.0.3...@antv/x6@2.0.4) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @antv/x6 [2.0.3](https://github.com/antvis/x6/compare/@antv/x6@2.0.2...@antv/x6@2.0.3) (2022-11-25)
|
||||
|
||||
## @antv/x6 [2.0.2](https://github.com/antvis/x6/compare/@antv/x6@2.0.1...@antv/x6@2.0.2) (2022-11-24)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6",
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.7",
|
||||
"description": "JavaScript diagramming library that uses SVG and HTML for rendering",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -59,7 +59,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -58,8 +58,12 @@ export class Graph extends Basecoat<EventArgs> {
|
||||
this.grid = new Grid(this)
|
||||
this.background = new Background(this)
|
||||
|
||||
this.model = this.options.model ? this.options.model : new Model()
|
||||
this.model.graph = this
|
||||
if (this.options.model) {
|
||||
this.model = this.options.model
|
||||
} else {
|
||||
this.model = new Model()
|
||||
this.model.graph = this
|
||||
}
|
||||
|
||||
this.renderer = new ViewRenderer(this)
|
||||
this.panning = new Panning(this)
|
||||
|
@ -149,7 +149,7 @@ export class GraphView extends View {
|
||||
protected onContextMenu(evt: Dom.ContextMenuEvent) {
|
||||
const e = this.normalizeEvent(evt)
|
||||
const view = this.findView(e.target)
|
||||
|
||||
|
||||
if (this.isPreventDefaultContextMenu(view)) {
|
||||
evt.preventDefault()
|
||||
}
|
||||
@ -201,7 +201,7 @@ export class GraphView extends View {
|
||||
}
|
||||
|
||||
if (this.options.preventDefaultMouseDown) {
|
||||
e.preventDefault()
|
||||
evt.preventDefault()
|
||||
}
|
||||
|
||||
const localPoint = this.graph.snapToGrid(e.clientX, e.clientY)
|
||||
@ -213,7 +213,7 @@ export class GraphView extends View {
|
||||
this.options.preventDefaultBlankAction &&
|
||||
['touchstart'].includes(e.type)
|
||||
) {
|
||||
e.preventDefault()
|
||||
evt.preventDefault()
|
||||
}
|
||||
|
||||
this.graph.trigger('blank:mousedown', {
|
||||
|
@ -1,4 +1,4 @@
|
||||
@import './style/index';
|
||||
@import url('./style/index');
|
||||
|
||||
// tools
|
||||
@import './registry/tool/editor';
|
||||
@import url('./registry/tool/editor');
|
||||
|
@ -298,7 +298,7 @@ export class Edge<
|
||||
|
||||
const cell = this.getTerminalCell(type)
|
||||
if (cell) {
|
||||
return cell.getConnectionPoint(this, type)
|
||||
return cell.getConnectionPoint(this as any, type)
|
||||
}
|
||||
|
||||
return new Point()
|
||||
|
@ -358,14 +358,14 @@ export class Model extends Basecoat<Model.EventArgs> {
|
||||
disconnectConnectedEdges(cell: Cell | string, options: Edge.SetOptions = {}) {
|
||||
const cellId = typeof cell === 'string' ? cell : cell.id
|
||||
this.getConnectedEdges(cell).forEach((edge) => {
|
||||
const sourceCell = edge.getSourceCell()
|
||||
const targetCell = edge.getTargetCell()
|
||||
const sourceCellId = edge.getSourceCellId()
|
||||
const targetCellId = edge.getTargetCellId()
|
||||
|
||||
if (sourceCell && sourceCell.id === cellId) {
|
||||
if (sourceCellId === cellId) {
|
||||
edge.setSource({ x: 0, y: 0 }, options)
|
||||
}
|
||||
|
||||
if (targetCell && targetCell.id === cellId) {
|
||||
if (targetCellId === cellId) {
|
||||
edge.setTarget({ x: 0, y: 0 }, options)
|
||||
}
|
||||
})
|
||||
|
@ -54,7 +54,7 @@ export interface ResolvedOptions {
|
||||
/**
|
||||
* Should certain nodes not be considered as obstacles?
|
||||
*/
|
||||
excludeNodes: Node[]
|
||||
excludeNodes: Node[]
|
||||
|
||||
/**
|
||||
* Possible starting directions from a node.
|
||||
|
@ -328,7 +328,7 @@ export const router: Router.Definition<ManhattanRouterOptions> = function (
|
||||
if (partialRoute === null) {
|
||||
// eslint-next-line
|
||||
console.warn(`Unable to execute manhattan algorithm, use orth instead`)
|
||||
|
||||
|
||||
return FunctionExt.call(
|
||||
options.fallbackRouter,
|
||||
this,
|
||||
|
@ -1,4 +1,4 @@
|
||||
@import '../../style/index';
|
||||
@import url('../../style/index');
|
||||
|
||||
.@{x6-prefix}-cell-tool-editor {
|
||||
position: relative;
|
||||
|
@ -72,7 +72,8 @@ export class JobQueue {
|
||||
try {
|
||||
job.cb()
|
||||
} catch (error) {
|
||||
// pass
|
||||
// eslint-disable-next-line
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,7 +100,7 @@ export class JobQueue {
|
||||
if (this.scheduleId) {
|
||||
this.cancelScheduleJob()
|
||||
}
|
||||
this.scheduleId = window.setTimeout(this.flushJobs.bind(this))
|
||||
this.scheduleId = (window as Window).setTimeout(this.flushJobs.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user