Compare commits
350 Commits
@antv/x6-a
...
@antv/x6-v
Author | SHA1 | Date | |
---|---|---|---|
|
2460f20a42 | ||
|
c8f8b9b4e0 | ||
|
0d0d973d3e | ||
|
eed25260af | ||
|
9f1130f260 | ||
|
cd9df4d609 | ||
|
eb195abe3c | ||
|
fa8f71a3e1 | ||
|
4171975d62 | ||
|
f0bbb828a3 | ||
|
d52ddfad87 | ||
|
5c39bcf2c8 | ||
|
8cac05deaf | ||
|
96a387822e | ||
|
2f3a565843 | ||
|
64de4c7753 | ||
|
502ceb1abb | ||
|
0509fd4897 | ||
|
1f6196e663 | ||
|
e9de0ba4c0 | ||
|
8ab3810c5e | ||
|
7405eba4e4 | ||
|
b1add84978 | ||
|
d51c0db472 | ||
|
59919533ce | ||
|
43fee42084 | ||
|
7066d63a35 | ||
|
0ebf120be3 | ||
|
710c249c15 | ||
|
e4d3c2b253 | ||
|
e83b1ed507 | ||
|
cc2cd5fdb8 | ||
|
17dcde8426 | ||
|
a9dcc84994 | ||
|
725372fa96 | ||
|
46af7cd55a | ||
|
e7f3257640 | ||
|
9791dbb09f | ||
|
ff2d29889d | ||
|
74b8256ce1 | ||
|
2248b27258 | ||
|
f7bf8219c3 | ||
|
4ffb61912b | ||
|
59fb1d2e3a | ||
|
6b85512a25 | ||
|
c7269af2ef | ||
|
e3d6d5e694 | ||
|
8dde11951f | ||
|
c90ede231e | ||
|
ae51381992 | ||
|
b10ef693e8 | ||
|
f5c5537650 | ||
|
ccf44c1732 | ||
|
5a865db99e | ||
|
c472648ae1 | ||
|
6351a5064d | ||
|
e02aefdc4f | ||
|
922c98632c | ||
|
dc59ce1d85 | ||
|
8db399f6fc | ||
|
edd1b36abc | ||
|
794df7f497 | ||
|
35774995b7 | ||
|
d67bcc104d | ||
|
de80eb588b | ||
|
b9906c9fa5 | ||
|
c4b10e38a5 | ||
|
4b104eb73e | ||
|
aee252f5d7 | ||
|
b3c2adb4b8 | ||
|
7eac6c4645 | ||
|
67df6722ae | ||
|
438e394b99 | ||
|
4422d2099a | ||
|
df4bcf653f | ||
|
206f589bb3 | ||
|
b27a3ff9ef | ||
|
06702ce221 | ||
|
02579cb1c1 | ||
|
6a2a59b1cb | ||
|
1fbba70e7e | ||
|
df7a0ee73c | ||
|
3dcafac5ac | ||
|
8b4192bd5f | ||
|
829406e81b | ||
|
f907d37cb1 | ||
|
3b4aab93a6 | ||
|
ce3e1fc6be | ||
|
9bda76514a | ||
|
58b2921bfb | ||
|
608f61c3cd | ||
|
b43b8f028a | ||
|
6cf6d31998 | ||
|
b3edfc7590 | ||
|
045499511d | ||
|
1f5d5d1aca | ||
|
7c513e7af1 | ||
|
1444b16222 | ||
|
c89f8599ce | ||
|
d622db6d6b | ||
|
ceead471ff | ||
|
0696064480 | ||
|
0d2318605e | ||
|
0416d0af4e | ||
|
a60e8f1653 | ||
|
e4f38cd9e8 | ||
|
8cb9085dc1 | ||
|
997430abba | ||
|
166b9346b3 | ||
|
2750d0e69e | ||
|
3e5189c2b7 | ||
|
6045888e6a | ||
|
933c6ed8e0 | ||
|
df47d90889 | ||
|
1648f12e83 | ||
|
815b044618 | ||
|
7e39cf1374 | ||
|
8b75ee89a4 | ||
|
5a24508334 | ||
|
b259afc9f2 | ||
|
992d664c53 | ||
|
8ce480c6b9 | ||
|
e978b8d0e5 | ||
|
a335e1c52f | ||
|
3e4481063d | ||
|
50d21787c4 | ||
|
32cae56c40 | ||
|
667720efb9 | ||
|
76d98ded26 | ||
|
3302c56bd4 | ||
|
3dba62a858 | ||
|
9befb7d8db | ||
|
e1e295b64e | ||
|
06fdf6315b | ||
|
bc6e8bcb28 | ||
|
892d74e56b | ||
|
bf9f6f1947 | ||
|
4304dd9322 | ||
|
4381a8a339 | ||
|
fc2fccaee0 | ||
|
a5c75d3e0f | ||
|
049090e009 | ||
|
2da5b71540 | ||
|
37875b8245 | ||
|
cd4c142da1 | ||
|
f86d935f05 | ||
|
992b0b8366 | ||
|
8a4a677b77 | ||
|
da55ef7a60 | ||
|
54b9debbce | ||
|
eef4a6df4c | ||
|
bf7540c1f9 | ||
|
eb98529391 | ||
|
0e5ff9204a | ||
|
6115dbbd75 | ||
|
3f786136b4 | ||
|
431116f629 | ||
|
cbbe1b6b54 | ||
|
d02ad4cb3b | ||
|
a9f0dd35b9 | ||
|
484df66d36 | ||
|
0d691c61cd | ||
|
5849eb9a88 | ||
|
c285ce6e0f | ||
|
817d08ff41 | ||
|
d63f26023f | ||
|
a56182ee06 | ||
|
51819712e7 | ||
|
92db8470a1 | ||
|
3e512b92b7 | ||
|
4f72b0d5c1 | ||
|
045412de6d | ||
|
4b7c565305 | ||
|
d2056dbc21 | ||
|
a555693442 | ||
|
dc5f606edb | ||
|
bba7307bd1 | ||
|
07794dc611 | ||
|
e1c0a99458 | ||
|
0c25aedd12 | ||
|
6ef7f55334 | ||
|
c97de2c807 | ||
|
dc62dd9390 | ||
|
56234ae8d7 | ||
|
eb81f1b856 | ||
|
2fd1033009 | ||
|
a654adf88f | ||
|
8633398149 | ||
|
4afc9df1ed | ||
|
e1bb9289b0 | ||
|
3ee97bef65 | ||
|
4015bb6667 | ||
|
586eb49032 | ||
|
52b7b51b45 | ||
|
852843ba59 | ||
|
01444b4677 | ||
|
76e0f973e6 | ||
|
619a6df36e | ||
|
082c5e04cf | ||
|
5b2020d4d0 | ||
|
12e3e8969f | ||
|
cde133781a | ||
|
fdb7563d21 | ||
|
ffe8306851 | ||
|
96ad752ccc | ||
|
0dcb61262a | ||
|
2e91808200 | ||
|
8cc9c3f257 | ||
|
fa34253f0a | ||
|
78f1f534a1 | ||
|
3c7c06ac30 | ||
|
5036dca96d | ||
|
ec419f8845 | ||
|
2d4ca77d46 | ||
|
c3fd2a2441 | ||
|
082d1f875b | ||
|
4efdb3660d | ||
|
fc06ff66d4 | ||
|
372d5f3031 | ||
|
d87b2a7eaf | ||
|
78a2a0bfe0 | ||
|
ac56327b41 | ||
|
26ce96f7a2 | ||
|
cfb77ae4cf | ||
|
c7a335177b | ||
|
692a4ee1b0 | ||
|
5d6f4fe15e | ||
|
a4411d0f88 | ||
|
b8c217572a | ||
|
48b3577023 | ||
|
20f68caa3a | ||
|
ae4ed52b69 | ||
|
fe41710467 | ||
|
0d34cdd0cc | ||
|
a9c0decd14 | ||
|
de59617532 | ||
|
89da6b32cc | ||
|
bb07735f36 | ||
|
88f04625ed | ||
|
74d3b24c6f | ||
|
f43edba970 | ||
|
cd006184c3 | ||
|
322dec6a4a | ||
|
47e7e67574 | ||
|
60954137d3 | ||
|
61c7d7f015 | ||
|
c7c3415300 | ||
|
7e64838e00 | ||
|
7c18c7d5ff | ||
|
7ea2ab1141 | ||
|
0115917836 | ||
|
b184f8ca1c | ||
|
1abb62e14a | ||
|
ed5cdfb384 | ||
|
7a0f33c5a2 | ||
|
1de788cfaa | ||
|
4d016760c7 | ||
|
47487fe604 | ||
|
6711d06fa1 | ||
|
83e4bd96e9 | ||
|
2a340936a0 | ||
|
3967110b6e | ||
|
66b2a44845 | ||
|
be52637c60 | ||
|
1e513adfde | ||
|
38857171ed | ||
|
88e0222422 | ||
|
63254bbf79 | ||
|
d6242db65c | ||
|
0efe5c5145 | ||
|
18780ddddd | ||
|
45d45de9e0 | ||
|
4a8ce47c46 | ||
|
c1e0d5afed | ||
|
1a57746c36 | ||
|
a49d004b03 | ||
|
b4641440b6 | ||
|
e9332a74a9 | ||
|
04e98cfe9b | ||
|
69615f92ab | ||
|
a7e7add2a8 | ||
|
af281c4a48 | ||
|
c2efaaf71c | ||
|
73880a47d0 | ||
|
b91869655d | ||
|
0879a143f9 | ||
|
56ba335afb | ||
|
5020e92ce8 | ||
|
93f0adaf96 | ||
|
248846731b | ||
|
b8e2d52f9a | ||
|
8ae13da838 | ||
|
446f433648 | ||
|
f3d5c30ee7 | ||
|
94cf18e5f8 | ||
|
314fee4606 | ||
|
7816a8fd47 | ||
|
5d597f5809 | ||
|
b389b5654f | ||
|
cd6514abef | ||
|
5b24ec1cee | ||
|
822310ecfa | ||
|
2d053f1bf6 | ||
|
fe0a81f6f2 | ||
|
86362513e7 | ||
|
624838fe23 | ||
|
214b92704d | ||
|
9594778ddb | ||
|
761f1b9144 | ||
|
e6de6363ae | ||
|
7f90fcf3b1 | ||
|
05f86b52b2 | ||
|
35a9531254 | ||
|
5c084bf8f0 | ||
|
34c82a1b45 | ||
|
c3d54ad2e5 | ||
|
a1dbd1095e | ||
|
a30d850c0f | ||
|
c3134d5fd6 | ||
|
85be9ec734 | ||
|
5c00e45d37 | ||
|
3ec0d432a3 | ||
|
ea4ea45e46 | ||
|
45cdd0980c | ||
|
40f6496aea | ||
|
12ab1057fe | ||
|
bd33449b2d | ||
|
96271dc298 | ||
|
5f2b46b34c | ||
|
bfd48e644e | ||
|
7440903281 | ||
|
769186b043 | ||
|
b2dce8e69f | ||
|
6614e4f83c | ||
|
c51043d468 | ||
|
0a0cbf9f50 | ||
|
09a4cf3f8b | ||
|
a9ccf98bf1 | ||
|
3cafa37292 | ||
|
99e42a95b1 | ||
|
f79151abd0 | ||
|
6a006f3dcd | ||
|
e42f4fe2d4 | ||
|
9f342b68d0 | ||
|
6eb4e4fafd | ||
|
fba8cf0ce6 | ||
|
a7b7f0bc43 | ||
|
157b2072f3 | ||
|
bdf7d7b628 | ||
|
eff14baca7 |
6
.github/dependabot.yml
vendored
Normal file
6
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
@@ -1,5 +1,5 @@
|
|||||||
# This action will automatically close issues fixed in
|
# Automatically close issues fixed in pull requests that doesn't target the default branch.
|
||||||
# pull requests that doesn't target the default branch.
|
|
||||||
name: 🚫 Auto Close Fixed Issues
|
name: 🚫 Auto Close Fixed Issues
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
|
2
.github/workflows/auto-comment.yml
vendored
2
.github/workflows/auto-comment.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# Comment on issues/PRs on certain events (currently not used at all.)
|
||||||
|
|
||||||
name: 💬 Auto Comment
|
name: 💬 Auto Comment
|
||||||
on: [issues, pull_request_target]
|
on: [issues, pull_request_target]
|
||||||
jobs:
|
jobs:
|
||||||
|
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# Continuous integration.
|
||||||
|
|
||||||
name: 👷 CI
|
name: 👷 CI
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
@@ -13,19 +15,19 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [12.x]
|
node-version: [16.x]
|
||||||
steps:
|
steps:
|
||||||
- name: ⤵️ Checkout
|
- name: ⤵️ Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- name: 🌱 Get Cache Directory
|
- name: 🌱 Get Cache Directory
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
- name: 🚸 Setup Cache
|
- name: 🚸 Setup Cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
@@ -49,19 +51,19 @@ jobs:
|
|||||||
github-token: ${{ env.bot_token }}
|
github-token: ${{ env.bot_token }}
|
||||||
path-to-lcov: ./packages/x6/test/coverage/lcov.info
|
path-to-lcov: ./packages/x6/test/coverage/lcov.info
|
||||||
- name: 💡 Codecov(x6)
|
- name: 💡 Codecov(x6)
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
files: ./packages/x6/test/coverage/lcov.info
|
files: ./packages/x6/test/coverage/lcov.info
|
||||||
flags: x6
|
flags: x6
|
||||||
- name: 💡 Codecov(x6-vector)
|
- name: 💡 Codecov(x6-vector)
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
files: ./packages/x6-vector/test/coverage/lcov.info
|
files: ./packages/x6-vector/test/coverage/lcov.info
|
||||||
flags: x6-vector
|
flags: x6-vector
|
||||||
- name: 💡 Codecov(x6-geometry)
|
- name: 💡 Codecov(x6-geometry)
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
files: ./packages/x6-geometry/test/coverage/lcov.info
|
files: ./packages/x6-geometry/test/coverage/lcov.info
|
||||||
|
5
.github/workflows/create-issue-branch.yml
vendored
5
.github/workflows/create-issue-branch.yml
vendored
@@ -1,3 +1,6 @@
|
|||||||
|
# Create a new branch dedicated to a specific issue
|
||||||
|
# (may be superseded by GitHub functionalities)
|
||||||
|
|
||||||
name: 🚧 Create Issue Branch
|
name: 🚧 Create Issue Branch
|
||||||
on:
|
on:
|
||||||
issue_comment:
|
issue_comment:
|
||||||
@@ -6,7 +9,7 @@ jobs:
|
|||||||
cib:
|
cib:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: wow-actions/use-app-token@v1
|
- uses: wow-actions/use-app-token@v1
|
||||||
with:
|
with:
|
||||||
app_id: ${{ secrets.APP_ID }}
|
app_id: ${{ secrets.APP_ID }}
|
||||||
|
4
.github/workflows/delete-stale-releases.yml
vendored
4
.github/workflows/delete-stale-releases.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# Delete all but the last x GitHub releases for certain packages.
|
||||||
|
|
||||||
name: 🚫 Delete Stale Releases
|
name: 🚫 Delete Stale Releases
|
||||||
on:
|
on:
|
||||||
repository_dispatch:
|
repository_dispatch:
|
||||||
@@ -6,7 +8,7 @@ jobs:
|
|||||||
clean:
|
clean:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: wow-actions/use-app-token@v1
|
- uses: wow-actions/use-app-token@v1
|
||||||
with:
|
with:
|
||||||
app_id: ${{ secrets.APP_ID }}
|
app_id: ${{ secrets.APP_ID }}
|
||||||
|
14
.github/workflows/deploy-sites.yml
vendored
14
.github/workflows/deploy-sites.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# Build and deploy updated official site to GitHub pages.
|
||||||
|
|
||||||
name: 🚀 Deploy Sites
|
name: 🚀 Deploy Sites
|
||||||
on:
|
on:
|
||||||
repository_dispatch:
|
repository_dispatch:
|
||||||
@@ -7,12 +9,12 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [12.x]
|
node-version: [16.x]
|
||||||
steps:
|
steps:
|
||||||
- name: ⤵️ Checkout
|
- name: ⤵️ Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
@@ -21,7 +23,7 @@ jobs:
|
|||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
|
|
||||||
- name: 🚸 Setup Cache
|
- name: 🚸 Setup Cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
@@ -30,7 +32,7 @@ jobs:
|
|||||||
|
|
||||||
## cache webpack(babel-loader, eslint-loader)
|
## cache webpack(babel-loader, eslint-loader)
|
||||||
- name: 💩 Setup Webpack Cache
|
- name: 💩 Setup Webpack Cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
node_modules
|
node_modules
|
||||||
@@ -41,7 +43,7 @@ jobs:
|
|||||||
|
|
||||||
## cache sites
|
## cache sites
|
||||||
- name: 💩 Setup Sites Cache
|
- name: 💩 Setup Sites Cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: sites/x6-sites/static/demos
|
path: sites/x6-sites/static/demos
|
||||||
key: ${{ runner.os }}-sites-${{ hashFiles('./packages/x6/package.json', './sites/x6-sites-demos/**/src') }}
|
key: ${{ runner.os }}-sites-${{ hashFiles('./packages/x6/package.json', './sites/x6-sites-demos/**/src') }}
|
||||||
|
6
.github/workflows/gitleaks.yml
vendored
6
.github/workflows/gitleaks.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# https://github.com/gitleaks/gitleaks-action
|
||||||
|
|
||||||
name: 🥤 GitLeaks
|
name: 🥤 GitLeaks
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
@@ -10,7 +12,7 @@ jobs:
|
|||||||
gitleaks:
|
gitleaks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: '1'
|
fetch-depth: '1'
|
||||||
- name: wget
|
- name: wget
|
||||||
@@ -18,4 +20,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
args: -O .gitleaks.toml https://raw.githubusercontent.com/ycjcl868/gitleaks/master/.gitleaks.toml
|
args: -O .gitleaks.toml https://raw.githubusercontent.com/ycjcl868/gitleaks/master/.gitleaks.toml
|
||||||
- name: gitleaks-action
|
- name: gitleaks-action
|
||||||
uses: zricethezav/gitleaks-action@master
|
uses: zricethezav/gitleaks-action@v1.6.0
|
||||||
|
5
.github/workflows/label-commands.yml
vendored
5
.github/workflows/label-commands.yml
vendored
@@ -1,3 +1,8 @@
|
|||||||
|
# Perform certain actions when labels are added to
|
||||||
|
# or removed from issues.
|
||||||
|
#
|
||||||
|
# See .github/workflows/config/label-commands.yml
|
||||||
|
|
||||||
name: 👾 Label Commands
|
name: 👾 Label Commands
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
|
5
.github/workflows/lock.yml
vendored
5
.github/workflows/lock.yml
vendored
@@ -1,3 +1,6 @@
|
|||||||
|
# Locks closed issues and pull requests after a period of inactivity.
|
||||||
|
# https://github.com/dessant/lock-threads
|
||||||
|
|
||||||
name: ⛔️ Lock Threads
|
name: ⛔️ Lock Threads
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
@@ -11,7 +14,7 @@ jobs:
|
|||||||
app_id: ${{ secrets.APP_ID }}
|
app_id: ${{ secrets.APP_ID }}
|
||||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||||
env_name: bot_token
|
env_name: bot_token
|
||||||
- uses: dessant/lock-threads@v2
|
- uses: dessant/lock-threads@v3
|
||||||
with:
|
with:
|
||||||
github-token: ${{ env.bot_token }}
|
github-token: ${{ env.bot_token }}
|
||||||
issue-lock-inactive-days: 365
|
issue-lock-inactive-days: 365
|
||||||
|
3
.github/workflows/needs-more-info.yml
vendored
3
.github/workflows/needs-more-info.yml
vendored
@@ -1,3 +1,6 @@
|
|||||||
|
# Request more info from newly opened issues/PRs that contain either default title/body or whose body is left blank
|
||||||
|
# https://github.com/wow-actions/needs-more-info
|
||||||
|
|
||||||
name: 🚨 Needs More Info
|
name: 🚨 Needs More Info
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
|
3
.github/workflows/potential-duplicates.yml
vendored
3
.github/workflows/potential-duplicates.yml
vendored
@@ -1,3 +1,6 @@
|
|||||||
|
# Search for potential issue duplicates using Damerau–Levenshtein algorithm
|
||||||
|
# https://github.com/wow-actions/potential-duplicates
|
||||||
|
|
||||||
name: 🆖 Potential Duplicates
|
name: 🆖 Potential Duplicates
|
||||||
on:
|
on:
|
||||||
issues:
|
issues:
|
||||||
|
3
.github/workflows/pr-label-branch-name.yml
vendored
3
.github/workflows/pr-label-branch-name.yml
vendored
@@ -1,3 +1,6 @@
|
|||||||
|
# Automatically apply labels to your PRs based on branch name patterns like feature/* or fix/*
|
||||||
|
# https://github.com/TimonVS/pr-labeler-action
|
||||||
|
|
||||||
name: 🏷️ Label(Branch Name)
|
name: 🏷️ Label(Branch Name)
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
|
5
.github/workflows/pr-label-file-paths.yml
vendored
5
.github/workflows/pr-label-file-paths.yml
vendored
@@ -1,3 +1,6 @@
|
|||||||
|
# Label a PR according to the packages it involves, based on changed files
|
||||||
|
# and the rules defined in .github/workflows/config/pr-label-file-paths.yml
|
||||||
|
|
||||||
name: 🏷️ Label(File Paths)
|
name: 🏷️ Label(File Paths)
|
||||||
on: pull_request_target
|
on: pull_request_target
|
||||||
jobs:
|
jobs:
|
||||||
@@ -9,7 +12,7 @@ jobs:
|
|||||||
app_id: ${{ secrets.APP_ID }}
|
app_id: ${{ secrets.APP_ID }}
|
||||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||||
env_name: bot_token
|
env_name: bot_token
|
||||||
- uses: actions/labeler@v2
|
- uses: actions/labeler@v4
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ env.bot_token }}
|
repo-token: ${{ env.bot_token }}
|
||||||
configuration-path: .github/workflows/config/pr-label-file-paths.yml
|
configuration-path: .github/workflows/config/pr-label-file-paths.yml
|
||||||
|
4
.github/workflows/pr-label-patch-size.yml
vendored
4
.github/workflows/pr-label-patch-size.yml
vendored
@@ -1,10 +1,12 @@
|
|||||||
|
# Assign labels based on pull request change sizes.
|
||||||
|
|
||||||
name: 🏷️ Label(Patch Size)
|
name: 🏷️ Label(Patch Size)
|
||||||
on: pull_request_target
|
on: pull_request_target
|
||||||
jobs:
|
jobs:
|
||||||
label:
|
label:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: wow-actions/use-app-token@v1
|
- uses: wow-actions/use-app-token@v1
|
||||||
with:
|
with:
|
||||||
app_id: ${{ secrets.APP_ID }}
|
app_id: ${{ secrets.APP_ID }}
|
||||||
|
7
.github/workflows/pr-label-status-dummy.yml
vendored
7
.github/workflows/pr-label-status-dummy.yml
vendored
@@ -1,9 +1,16 @@
|
|||||||
|
# Automatically label a PR depending on the PR's status (springboard)
|
||||||
|
|
||||||
name: 🏷️ Label(Status) Dummy
|
name: 🏷️ Label(Status) Dummy
|
||||||
on:
|
on:
|
||||||
pull_request_review:
|
pull_request_review:
|
||||||
types: [submitted, dismissed]
|
types: [submitted, dismissed]
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
dummy:
|
dummy:
|
||||||
|
permissions:
|
||||||
|
contents: none
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- run: echo "this is a dummy workflow that triggers a workflow_run; it's necessary because otherwise the repo secrets will not be in scope for externally forked pull requests"
|
- run: echo "this is a dummy workflow that triggers a workflow_run; it's necessary because otherwise the repo secrets will not be in scope for externally forked pull requests"
|
||||||
|
4
.github/workflows/pr-label-status.yml
vendored
4
.github/workflows/pr-label-status.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# Automatically label a PR depending on the PR's status
|
||||||
|
|
||||||
name: 🏷️ Label(Status)
|
name: 🏷️ Label(Status)
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
@@ -17,4 +19,4 @@ jobs:
|
|||||||
- uses: wow-actions/pr-triage@v1
|
- uses: wow-actions/pr-triage@v1
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||||
WORKFLOW-ID: ${{ github.event.workflow_run.id }}
|
WORKFLOW_ID: ${{ github.event.workflow_run.id }}
|
||||||
|
7
.github/workflows/pr-label-title-body.yml
vendored
7
.github/workflows/pr-label-title-body.yml
vendored
@@ -1,5 +1,6 @@
|
|||||||
# Github action for automatically adding label or setting assignee when a new
|
# Automatically add labels or setting assignees when a new issue or PR is opened,
|
||||||
# Issue or PR is opened. https://github.com/marketplace/actions/issue-labeler
|
# based on its title and body.
|
||||||
|
# https://github.com/marketplace/actions/issue-labeler
|
||||||
|
|
||||||
name: 🏷️ Label(Title and Body)
|
name: 🏷️ Label(Title and Body)
|
||||||
on:
|
on:
|
||||||
@@ -16,7 +17,7 @@ jobs:
|
|||||||
app_id: ${{ secrets.APP_ID }}
|
app_id: ${{ secrets.APP_ID }}
|
||||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||||
env_name: bot_token
|
env_name: bot_token
|
||||||
- uses: Naturalclar/issue-action@v2.0.1
|
- uses: Naturalclar/issue-action@v2.0.2
|
||||||
with:
|
with:
|
||||||
title-or-body: title
|
title-or-body: title
|
||||||
github-token: ${{ env.bot_token }}
|
github-token: ${{ env.bot_token }}
|
||||||
|
14
.github/workflows/preview.yml
vendored
14
.github/workflows/preview.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# https://github.com/afc163/surge-preview
|
||||||
|
|
||||||
name: 🔂 Surge PR Preview
|
name: 🔂 Surge PR Preview
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
@@ -11,16 +13,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [12.x]
|
node-version: [16.x]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: 🌱 Get yarn cache directory path
|
- name: 🌱 Get yarn cache directory path
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
|
|
||||||
- name: 🚸 Setup yarn cacha
|
- name: 🚸 Setup yarn cacha
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
@@ -29,7 +31,7 @@ jobs:
|
|||||||
|
|
||||||
## cache webpack(babel-loader, eslint-loader)
|
## cache webpack(babel-loader, eslint-loader)
|
||||||
- name: 💩 Setup webpack cache
|
- name: 💩 Setup webpack cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
node_modules
|
node_modules
|
||||||
@@ -40,7 +42,7 @@ jobs:
|
|||||||
|
|
||||||
## cache sites
|
## cache sites
|
||||||
- name: 💩 Setup sites cache
|
- name: 💩 Setup sites cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: sites/x6-sites/static/demos
|
path: sites/x6-sites/static/demos
|
||||||
key: ${{ runner.os }}-sites-${{ hashFiles('./packages/x6/package.json', './sites/x6-sites-demos/**/src') }}
|
key: ${{ runner.os }}-sites-${{ hashFiles('./packages/x6/package.json', './sites/x6-sites-demos/**/src') }}
|
||||||
@@ -48,7 +50,7 @@ jobs:
|
|||||||
${{ runner.os }}-sites-
|
${{ runner.os }}-sites-
|
||||||
|
|
||||||
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
|
4
.github/workflows/rebase.yml
vendored
4
.github/workflows/rebase.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# Automatically rebase PRs via the /rebase command
|
||||||
|
|
||||||
name: 🎉 Rebase
|
name: 🎉 Rebase
|
||||||
on:
|
on:
|
||||||
issue_comment:
|
issue_comment:
|
||||||
@@ -7,7 +9,7 @@ jobs:
|
|||||||
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
|
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: wow-actions/use-app-token@v1
|
- uses: wow-actions/use-app-token@v1
|
||||||
|
16
.github/workflows/release.yml
vendored
16
.github/workflows/release.yml
vendored
@@ -1,4 +1,8 @@
|
|||||||
# @see: https://dev.to/antongolub/the-chronicles-of-semantic-release-and-monorepos-5cfc
|
# Create new GitHub releases using scripts/monorepo-semantic-release
|
||||||
|
# and the semantic-release package.
|
||||||
|
#
|
||||||
|
# See https://www.npmjs.com/package/semantic-release
|
||||||
|
# See https://dev.to/antongolub/the-chronicles-of-semantic-release-and-monorepos-5cfc
|
||||||
|
|
||||||
name: 🚀 Release
|
name: 🚀 Release
|
||||||
on:
|
on:
|
||||||
@@ -14,19 +18,19 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [12.x]
|
node-version: [16.x]
|
||||||
steps:
|
steps:
|
||||||
- name: ⤵️ Checkout
|
- name: ⤵️ Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- name: 🌱 Get Cache Directory
|
- name: 🌱 Get Cache Directory
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
- name: 🚸 Setup Cache
|
- name: 🚸 Setup Cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
@@ -60,7 +64,7 @@ jobs:
|
|||||||
|
|
||||||
- name: 🔀 Repository Dispatch
|
- name: 🔀 Repository Dispatch
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
uses: peter-evans/repository-dispatch@v1
|
uses: peter-evans/repository-dispatch@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ env.bot_token }}
|
token: ${{ env.bot_token }}
|
||||||
event-type: released
|
event-type: released
|
||||||
|
2
.github/workflows/slash-commands.yml
vendored
2
.github/workflows/slash-commands.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# https://github.com/wow-actions/slash-commands
|
||||||
|
|
||||||
name: 🔱 Slash Commands
|
name: 🔱 Slash Commands
|
||||||
on:
|
on:
|
||||||
issue_comment:
|
issue_comment:
|
||||||
|
4
.github/workflows/stale.yml
vendored
4
.github/workflows/stale.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# Warn and then close issues and PRs that have had no activity for a specified amount of time.
|
||||||
|
|
||||||
name: 👻 Stale
|
name: 👻 Stale
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
@@ -11,7 +13,7 @@ jobs:
|
|||||||
app_id: ${{ secrets.APP_ID }}
|
app_id: ${{ secrets.APP_ID }}
|
||||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||||
env_name: bot_token
|
env_name: bot_token
|
||||||
- uses: actions/stale@v3
|
- uses: actions/stale@v5
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ env.bot_token }}
|
repo-token: ${{ env.bot_token }}
|
||||||
stale-issue-message: |
|
stale-issue-message: |
|
||||||
|
4
.github/workflows/sync-labels.yml
vendored
4
.github/workflows/sync-labels.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# Update issue labels in repo as defined in /.github/workflows/config/labels.yml
|
||||||
|
|
||||||
name: 🔄 Sync Labels
|
name: 🔄 Sync Labels
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -9,7 +11,7 @@ jobs:
|
|||||||
sync:
|
sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: wow-actions/use-app-token@v1
|
- uses: wow-actions/use-app-token@v1
|
||||||
with:
|
with:
|
||||||
app_id: ${{ secrets.APP_ID }}
|
app_id: ${{ secrets.APP_ID }}
|
||||||
|
2
.github/workflows/sync-to-gitee.yml
vendored
2
.github/workflows/sync-to-gitee.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# Sync repo to https://gitee.com/
|
||||||
|
#
|
||||||
# https://github.com/marketplace/actions/gitee-pages-action
|
# https://github.com/marketplace/actions/gitee-pages-action
|
||||||
# 配置步骤如下
|
# 配置步骤如下
|
||||||
# 1. 在命令行终端或 Git Bash 使用命令 ssh-keygen -t rsa -C "youremail@example.com" 生成 SSH Key,注意替换为自己的邮箱。生成的 id_rsa 是私钥,id_rsa.pub 是公钥。(⚠️注意此处不要设置密码)
|
# 1. 在命令行终端或 Git Bash 使用命令 ssh-keygen -t rsa -C "youremail@example.com" 生成 SSH Key,注意替换为自己的邮箱。生成的 id_rsa 是私钥,id_rsa.pub 是公钥。(⚠️注意此处不要设置密码)
|
||||||
|
4
.github/workflows/update-authors.yml
vendored
4
.github/workflows/update-authors.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# Automatically generate and update AUTHORS.txt.
|
||||||
|
|
||||||
name: 🎗 Update Authors
|
name: 🎗 Update Authors
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -9,7 +11,7 @@ jobs:
|
|||||||
authors:
|
authors:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: wow-actions/use-app-token@v1
|
- uses: wow-actions/use-app-token@v1
|
||||||
|
14
.github/workflows/update-cache.yaml
vendored
14
.github/workflows/update-cache.yaml
vendored
@@ -1,4 +1,5 @@
|
|||||||
# Auto update cahe
|
# Cache dependencies and build outputs to improve workflow execution time.
|
||||||
|
# https://github.com/actions/cache
|
||||||
|
|
||||||
name: 🌈 Update Cache
|
name: 🌈 Update Cache
|
||||||
on:
|
on:
|
||||||
@@ -10,17 +11,20 @@ on:
|
|||||||
- next-major
|
- next-major
|
||||||
- alpha
|
- alpha
|
||||||
- beta
|
- beta
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cache:
|
cache:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [12.x]
|
node-version: [16.x]
|
||||||
steps:
|
steps:
|
||||||
- name: ⤵️ Checkout
|
- name: ⤵️ Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- name: 🌱 Get Cache Directory
|
- name: 🌱 Get Cache Directory
|
||||||
@@ -28,7 +32,7 @@ jobs:
|
|||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
- name: 🚸 Setup Cache
|
- name: 🚸 Setup Cache
|
||||||
id: cache
|
id: cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
2
.github/workflows/update-contributors.yml
vendored
2
.github/workflows/update-contributors.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# Update /CONTRIBUTORS.svg to include new contributors' avatars.
|
||||||
|
|
||||||
name: 🤝 Update Contributors
|
name: 🤝 Update Contributors
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
|
4
.github/workflows/update-license.yml
vendored
4
.github/workflows/update-license.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# Renew the copyright notice in LICENSE at the beginning of every year.
|
||||||
|
|
||||||
name: 🔑 Update License
|
name: 🔑 Update License
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
@@ -6,7 +8,7 @@ jobs:
|
|||||||
update:
|
update:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: wow-actions/use-app-token@v1
|
- uses: wow-actions/use-app-token@v1
|
||||||
|
2
.github/workflows/welcome.yml
vendored
2
.github/workflows/welcome.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
# Comment a welcome message on an issue if it's the reporter's first issue.
|
||||||
|
|
||||||
name: 👋 Welcome
|
name: 👋 Welcome
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
|
20
AUTHORS
20
AUTHORS
@@ -6,11 +6,18 @@ Dong <48054715+halodong@users.noreply.github.com>
|
|||||||
Draco <Draco.coder@gmail.com>
|
Draco <Draco.coder@gmail.com>
|
||||||
Eve-Sama <17764594863@163.com>
|
Eve-Sama <17764594863@163.com>
|
||||||
Eve-Sama <948832626@qq.com>
|
Eve-Sama <948832626@qq.com>
|
||||||
|
Gossypol <31892817+gossypol@users.noreply.github.com>
|
||||||
ImgBotApp <ImgBotHelp@gmail.com>
|
ImgBotApp <ImgBotHelp@gmail.com>
|
||||||
|
Indomi <indomi126@gmail.com>
|
||||||
James <san>
|
James <san>
|
||||||
Jógvan <lse>
|
Jógvan <lse>
|
||||||
Ken <ei>
|
Ken <ei>
|
||||||
|
Lixu <37231473+wflixu@users.noreply.github.com>
|
||||||
|
Lloyd <ho>
|
||||||
Lyn <47809781+lyn-boyu@users.noreply.github.com>
|
Lyn <47809781+lyn-boyu@users.noreply.github.com>
|
||||||
|
Mingfei <az8641683@163.com>
|
||||||
|
MrMengJ <2646973632@qq.com>
|
||||||
|
Naveen <172697+naveensrinivasan@users.noreply.github.com>
|
||||||
NewByVector <NewByVector@users.noreply.github.com>
|
NewByVector <NewByVector@users.noreply.github.com>
|
||||||
Olive.Wang <olivewind.wang@gmail.com>
|
Olive.Wang <olivewind.wang@gmail.com>
|
||||||
Opportunity <opportunity@live.in>
|
Opportunity <opportunity@live.in>
|
||||||
@@ -18,18 +25,24 @@ Questions <chip@twostewards.com>
|
|||||||
RuiLin <on>
|
RuiLin <on>
|
||||||
SSC <273702440@qq.com>
|
SSC <273702440@qq.com>
|
||||||
Sindori <441933726@qq.com>
|
Sindori <441933726@qq.com>
|
||||||
|
Susan <527971893@qq.com>
|
||||||
Tony <>
|
Tony <>
|
||||||
Utopia <greatauk11@gmail.com>
|
Utopia <greatauk11@gmail.com>
|
||||||
XLZY <1017866168@qq.com>
|
XLZY <1017866168@qq.com>
|
||||||
|
Xingjian <han>
|
||||||
Zhenyu <o>
|
Zhenyu <o>
|
||||||
|
arthur657834 <kingkom7834@126.com>
|
||||||
boyu.zlj <boyu.zlj@antgroup.com>
|
boyu.zlj <boyu.zlj@antgroup.com>
|
||||||
breezefaith <nyzhangzc@qq.com>
|
breezefaith <nyzhangzc@qq.com>
|
||||||
bubkoo <bubkoo.wy@gmail.com>
|
bubkoo <bubkoo.wy@gmail.com>
|
||||||
bubkoo <bubkoo@users.noreply.github.com>
|
bubkoo <bubkoo@users.noreply.github.com>
|
||||||
budlion <dongqi.ldq@alibaba-inc.com>
|
budlion <dongqi.ldq@alibaba-inc.com>
|
||||||
|
cuidong626 <cuidong1234@outlook.com>
|
||||||
daigang <1210242662@qq.com>
|
daigang <1210242662@qq.com>
|
||||||
doublewu <592581554@qq.com>
|
doublewu <592581554@qq.com>
|
||||||
iceytea <liyunheasap@yeah.net>
|
iceytea <liyunheasap@yeah.net>
|
||||||
|
jiqili <43718732+jiqili@users.noreply.github.com>
|
||||||
|
kelin.zrh <34393362+AricZhu@users.noreply.github.com>
|
||||||
kingshuaishuai <ken.wang@mrs.ai>
|
kingshuaishuai <ken.wang@mrs.ai>
|
||||||
kio <1421104933@qq.com>
|
kio <1421104933@qq.com>
|
||||||
lijing666 <lijing241@yeah.net>
|
lijing666 <lijing241@yeah.net>
|
||||||
@@ -37,10 +50,15 @@ lopn <lopnxrp@126.com>
|
|||||||
luchunwei <luchunwei@gmail.com>
|
luchunwei <luchunwei@gmail.com>
|
||||||
luzhuang <364439895@qq.com>
|
luzhuang <364439895@qq.com>
|
||||||
lvhuiyang <ilvhuiyang@gmail.com>
|
lvhuiyang <ilvhuiyang@gmail.com>
|
||||||
|
myzxlin <myzxlin@163.com>
|
||||||
|
newbyvector <vectorse@126.com>
|
||||||
niexq <1879633916@qq.com>
|
niexq <1879633916@qq.com>
|
||||||
niexq <niexq@firstgrid.cn>
|
niexq <niexq@firstgrid.cn>
|
||||||
pengxingjian.pxj <pengxingjian.pxj@alibaba-inc.com>
|
pengxingjian.pxj <pengxingjian.pxj@alibaba-inc.com>
|
||||||
|
pfdgithub <pfdgithub@users.noreply.github.com>
|
||||||
qingchi <qinky94@163.com>
|
qingchi <qinky94@163.com>
|
||||||
|
qu <33251372+Qujh97@users.noreply.github.com>
|
||||||
|
sallen450 <qinghua10199@gmail.com>
|
||||||
semantic-release-bot <semantic-release-bot@martynus.net>
|
semantic-release-bot <semantic-release-bot@martynus.net>
|
||||||
vector <vectorse@126.com>
|
vector <vectorse@126.com>
|
||||||
wgf <34190465+evelope@users.noreply.github.com>
|
wgf <34190465+evelope@users.noreply.github.com>
|
||||||
@@ -48,6 +66,7 @@ wjqsummer <52412389+wjqsummer@users.noreply.github.com>
|
|||||||
wtzeng1 <wtzeng1@gmail.com>
|
wtzeng1 <wtzeng1@gmail.com>
|
||||||
x6-bot <x6-bot@users.noreply.github.com>
|
x6-bot <x6-bot@users.noreply.github.com>
|
||||||
xrkffgg <xrkffgg@gmail.com>
|
xrkffgg <xrkffgg@gmail.com>
|
||||||
|
yaojin2070 <48686959+yaojin2070@users.noreply.github.com>
|
||||||
zdc1111 <39116292+zdc1111@users.noreply.github.com>
|
zdc1111 <39116292+zdc1111@users.noreply.github.com>
|
||||||
九思⚡⚡⚡ <2228429150@qq.com>
|
九思⚡⚡⚡ <2228429150@qq.com>
|
||||||
何腾飞 <avrin.live.cn@outlook.com>
|
何腾飞 <avrin.live.cn@outlook.com>
|
||||||
@@ -57,6 +76,7 @@ zdc1111 <39116292+zdc1111@users.noreply.github.com>
|
|||||||
文瑀 <wenyu.jqq@antfin.com>
|
文瑀 <wenyu.jqq@antfin.com>
|
||||||
杨凌 <89915256@qq.com>
|
杨凌 <89915256@qq.com>
|
||||||
柏愚 <boyu.zlj@antfin.com>
|
柏愚 <boyu.zlj@antfin.com>
|
||||||
|
粑粑超 <842486229@qq.com>
|
||||||
金强强 <wenyu.jqq@antfin.com>
|
金强强 <wenyu.jqq@antfin.com>
|
||||||
问崖 <bubkoo.wy@gmail.com>
|
问崖 <bubkoo.wy@gmail.com>
|
||||||
问崖 <pengxingjian.pxj@antfin.com>
|
问崖 <pengxingjian.pxj@antfin.com>
|
||||||
|
230
CONTRIBUTORS.svg
230
CONTRIBUTORS.svg
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 8.7 MiB After Width: | Height: | Size: 13 MiB |
@@ -76,7 +76,7 @@ $ yarn add @antv/x6
|
|||||||
```ts
|
```ts
|
||||||
// 从 node_modules 引入
|
// 从 node_modules 引入
|
||||||
import { Graph } from '@antv/x6'
|
import { Graph } from '@antv/x6'
|
||||||
// 从 CND 引入时,我们暴露了 X6 这个全局变量
|
// 从 CDN 引入时,我们暴露了 X6 这个全局变量
|
||||||
// const { Graph } = X6
|
// const { Graph } = X6
|
||||||
|
|
||||||
// 创建 Graph 的实例
|
// 创建 Graph 的实例
|
||||||
@@ -165,9 +165,9 @@ graph.addEdge({
|
|||||||
需要注意的是,提问题时请配上 [CodeSandbox](https://codesandbox.io/s/pensive-sound-f4nhc) 的复现代码,方便快速定位和解决问题。
|
需要注意的是,提问题时请配上 [CodeSandbox](https://codesandbox.io/s/pensive-sound-f4nhc) 的复现代码,方便快速定位和解决问题。
|
||||||
|
|
||||||
<a href="https://qr.dingtalk.com/action/joingroup?code=v1,k1,rOHuvgq5s0EHDktyyQJffDE3ZAmHnbB2e6iwn/w4BKs=&_dt_no_comment=1&origin=11" target="_blank" rel="noopener noreferrer">
|
<a href="https://qr.dingtalk.com/action/joingroup?code=v1,k1,rOHuvgq5s0EHDktyyQJffDE3ZAmHnbB2e6iwn/w4BKs=&_dt_no_comment=1&origin=11" target="_blank" rel="noopener noreferrer">
|
||||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*Up-4S4v8H-0AAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群1" width="375" />
|
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*Up-4S4v8H-0AAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群1" width="260" />
|
||||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*4Y_5S7i26LAAAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群2" width="375" />
|
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*4Y_5S7i26LAAAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群2" width="260" />
|
||||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*KHB4QJAsW4QAAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群3" width="375" />
|
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*KHB4QJAsW4QAAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群3" width="260" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
## 如何开发
|
## 如何开发
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
## @antv/x6-package-json [1.0.2](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.1...@antv/x6-package-json@1.0.2) (2022-06-07)
|
||||||
|
|
||||||
|
## @antv/x6-package-json [1.0.2](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.1...@antv/x6-package-json@1.0.2) (2022-06-06)
|
||||||
|
|
||||||
|
## @antv/x6-package-json [1.0.2](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.1...@antv/x6-package-json@1.0.2) (2022-06-05)
|
||||||
|
|
||||||
|
## @antv/x6-package-json [1.0.2](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.1...@antv/x6-package-json@1.0.2) (2022-05-31)
|
||||||
|
|
||||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-11-14)
|
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-11-14)
|
||||||
|
|
||||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-11-08)
|
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-11-08)
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
"pretty-quick": "^3.1.1",
|
"pretty-quick": "^3.1.1",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"ts-node": "^10.2.1",
|
"ts-node": "^10.2.1",
|
||||||
"typescript": "^4.4.3"
|
"typescript": "^4.4.3",
|
||||||
|
"release-it": "^14.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"name": "@antv/x6-package-json",
|
"name": "@antv/x6-package-json",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"bin": {
|
"bin": {
|
||||||
"package-compare": "./bin/package-compare.js",
|
"package-compare": "./bin/package-compare.js",
|
||||||
"package-inherit": "./bin/package-inherit.js"
|
"package-inherit": "./bin/package-inherit.js"
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
"chalk": "^4.1.0",
|
"chalk": "^4.1.0",
|
||||||
"detect-newline": "^3.1.0",
|
"detect-newline": "^3.1.0",
|
||||||
"parse-package-name": "^0.1.0",
|
"parse-package-name": "^0.1.0",
|
||||||
"workspace-tools": "^0.12.3",
|
"workspace-tools": "^0.18.4",
|
||||||
"yargs-parser": "^20.2.7"
|
"yargs-parser": "^20.2.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,3 +1,119 @@
|
|||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-06-07)
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-06-06)
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-06-05)
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-05-31)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.3
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-05-17)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.2
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-05-16)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.1
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.8](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.7...@antv/x6-app-dag@1.1.8) (2022-05-14)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.0
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-05-09)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.5
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-05-01)
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-04-26)
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-04-21)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.4
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-04-13)
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.3
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-04-09)
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.2
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-04-05)
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-04-05)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.1
|
||||||
|
|
||||||
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-03-23)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.0
|
||||||
|
|
||||||
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-03-10)
|
## @antv/x6-app-dag [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-dag@1.1.6...@antv/x6-app-dag@1.1.7) (2022-03-10)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ant-design/icons": "^4.2.1",
|
"@ant-design/icons": "^4.2.1",
|
||||||
"@antv/x6": "^1.30.2",
|
"@antv/x6": "^1.32.3",
|
||||||
"@antv/x6-react-components": "^1.1.16",
|
"@antv/x6-react-components": "^1.1.16",
|
||||||
"@antv/x6-react-shape": "^1.6.0",
|
"@antv/x6-react-shape": "^1.6.0",
|
||||||
"@types/dompurify": "^2.0.4",
|
"@types/dompurify": "^2.0.4",
|
||||||
|
@@ -1,3 +1,119 @@
|
|||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-06-07)
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-06-06)
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-06-05)
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-05-31)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.3
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-05-17)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.2
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-05-16)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.1
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.6...@antv/x6-app-draw@1.1.7) (2022-05-14)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.0
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-05-09)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.5
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-05-01)
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-04-26)
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-04-21)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.4
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-04-13)
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.3
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-04-09)
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.2
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-04-05)
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-04-05)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.1
|
||||||
|
|
||||||
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-03-23)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.0
|
||||||
|
|
||||||
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-03-10)
|
## @antv/x6-app-draw [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-app-draw@1.1.5...@antv/x6-app-draw@1.1.6) (2022-03-10)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
"precommit": "lint-staged"
|
"precommit": "lint-staged"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/x6": "^1.30.2",
|
"@antv/x6": "^1.32.3",
|
||||||
"@antv/x6-react-components": "^1.1.16",
|
"@antv/x6-react-components": "^1.1.16",
|
||||||
"antd": "^4.4.2",
|
"antd": "^4.4.2",
|
||||||
"react": "^16.8.6",
|
"react": "^16.8.6",
|
||||||
|
@@ -1,3 +1,119 @@
|
|||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-06-07)
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-06-06)
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-06-05)
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-05-31)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.3
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-05-17)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.2
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-05-16)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.1
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.8](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.7...@antv/x6-app-er@1.1.8) (2022-05-14)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.0
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-05-09)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.5
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-05-01)
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-04-26)
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-04-21)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.4
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-04-13)
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.3
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-04-09)
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.2
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-04-05)
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-04-05)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.1
|
||||||
|
|
||||||
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-03-23)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.0
|
||||||
|
|
||||||
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-03-10)
|
## @antv/x6-app-er [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-app-er@1.1.6...@antv/x6-app-er@1.1.7) (2022-03-10)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/x6": "^1.30.2",
|
"@antv/x6": "^1.32.3",
|
||||||
"@antv/x6-react-components": "^1.1.16",
|
"@antv/x6-react-components": "^1.1.16",
|
||||||
"@antv/x6-react-shape": "^1.6.0",
|
"@antv/x6-react-shape": "^1.6.0",
|
||||||
"antd": "^4.4.2",
|
"antd": "^4.4.2",
|
||||||
|
@@ -1,3 +1,318 @@
|
|||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-06-07)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-06-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-06-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-05-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.3
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-05-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.2
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-05-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.1
|
||||||
|
* **@antv/x6-vector:** upgraded to 1.4.0
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.3](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.2...@antv/x6-example-features@1.2.3) (2022-05-14)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.32.0
|
||||||
|
* **@antv/x6-vector:** upgraded to 1.4.0
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-05-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.5
|
||||||
|
* **@antv/x6-vector:** upgraded to 1.3.2
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-05-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-04-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-04-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.4
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-04-13)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.3
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.2
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-04-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6-vector:** upgraded to 1.3.1
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-04-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.1
|
||||||
|
* **@antv/x6-vector:** upgraded to 1.3.1
|
||||||
|
|
||||||
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-03-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 optimize contextmenu tools ([#1391](https://github.com/antvis/x6/issues/1391)) ([cc01fdf](https://github.com/antvis/x6/commit/cc01fdf208f4fbd283a6ce3d7a106716e8e10300))
|
||||||
|
* 🐛 update x6-react-shape version ([#1425](https://github.com/antvis/x6/issues/1425)) ([4208846](https://github.com/antvis/x6/commit/4208846337326d8983f1662faa8da67efd8568b4))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* ⚡️ add simple config to remove rect and text element ([#1449](https://github.com/antvis/x6/issues/1449)) ([0b5f241](https://github.com/antvis/x6/commit/0b5f2413f0b907316784149027615ae2d09616a4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.0
|
||||||
|
|
||||||
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-03-10)
|
## @antv/x6-example-features [1.2.2](https://github.com/antvis/x6/compare/@antv/x6-example-features@1.2.1...@antv/x6-example-features@1.2.2) (2022-03-10)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9,10 +9,10 @@
|
|||||||
"precommit": "lint-staged"
|
"precommit": "lint-staged"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/x6": "^1.30.2",
|
"@antv/x6": "^1.32.3",
|
||||||
"@antv/x6-react-components": "^1.1.16",
|
"@antv/x6-react-components": "^1.1.16",
|
||||||
"@antv/x6-react-shape": "^1.6.0",
|
"@antv/x6-react-shape": "^1.6.0",
|
||||||
"@antv/x6-vector": "^1.3.0",
|
"@antv/x6-vector": "^1.4.0",
|
||||||
"antd": "^4.4.2",
|
"antd": "^4.4.2",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"dagre": "^0.8.5",
|
"dagre": "^0.8.5",
|
||||||
|
@@ -1,173 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import ReactDom from 'react-dom'
|
|
||||||
import { Tooltip } from 'antd'
|
|
||||||
import { Graph, Markup, ToolsView, EdgeView } from '@antv/x6'
|
|
||||||
import '../index.less'
|
|
||||||
|
|
||||||
class TooltipTool extends ToolsView.ToolItem<EdgeView, TooltipTool.Options> {
|
|
||||||
private delay = 100
|
|
||||||
private moveTimer: number
|
|
||||||
private enterTimer: number
|
|
||||||
private leaveTimer: number
|
|
||||||
private tooltipVisible: boolean
|
|
||||||
|
|
||||||
protected onRender() {
|
|
||||||
this.updatePosition()
|
|
||||||
}
|
|
||||||
|
|
||||||
private toggleTooltip(visible: boolean) {
|
|
||||||
ReactDom.unmountComponentAtNode(this.childNodes.foContent)
|
|
||||||
|
|
||||||
if (visible) {
|
|
||||||
ReactDom.render(
|
|
||||||
<Tooltip title={this.options.tooltip} visible={true}>
|
|
||||||
<div />
|
|
||||||
</Tooltip>,
|
|
||||||
this.childNodes.foContent,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
this.tooltipVisible = visible
|
|
||||||
}
|
|
||||||
|
|
||||||
private updatePosition(e?: MouseEvent) {
|
|
||||||
const fo = this.childNodes.fo as SVGForeignObjectElement
|
|
||||||
if (e) {
|
|
||||||
const pos = this.graph.clientToLocal(e.clientX, e.clientY)
|
|
||||||
fo.setAttribute('x', `${pos.x}`)
|
|
||||||
fo.setAttribute('y', `${pos.y}`)
|
|
||||||
} else {
|
|
||||||
fo.setAttribute('x', `-10000`)
|
|
||||||
fo.setAttribute('y', `-10000`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private onMouseEnter({ e }: EdgeView.EventArgs['edge:mouseenter']) {
|
|
||||||
this.updatePosition(e.originalEvent)
|
|
||||||
window.clearTimeout(this.leaveTimer)
|
|
||||||
this.enterTimer = window.setTimeout(
|
|
||||||
() => this.toggleTooltip(true),
|
|
||||||
this.delay,
|
|
||||||
)
|
|
||||||
if (this.options.follow != false) {
|
|
||||||
document.addEventListener('mousemove', this.onMouseMove)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private onMouseLeave() {
|
|
||||||
this.updatePosition()
|
|
||||||
window.clearTimeout(this.enterTimer)
|
|
||||||
this.leaveTimer = window.setTimeout(
|
|
||||||
() => this.toggleTooltip(false),
|
|
||||||
this.delay,
|
|
||||||
)
|
|
||||||
if (this.options.follow != false) {
|
|
||||||
document.removeEventListener('mousemove', this.onMouseMove)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private onMouseMove = (e: MouseEvent) => {
|
|
||||||
window.clearTimeout(this.moveTimer)
|
|
||||||
window.clearTimeout(this.enterTimer)
|
|
||||||
this.updatePosition(e)
|
|
||||||
this.moveTimer = window.setTimeout(() => {
|
|
||||||
if (this.tooltipVisible) {
|
|
||||||
this.toggleTooltip(false)
|
|
||||||
}
|
|
||||||
this.toggleTooltip(true)
|
|
||||||
}, this.delay)
|
|
||||||
}
|
|
||||||
|
|
||||||
delegateEvents() {
|
|
||||||
this.cellView.on('edge:mouseenter', this.onMouseEnter, this)
|
|
||||||
this.cellView.on('edge:mouseleave', this.onMouseLeave, this)
|
|
||||||
return super.delegateEvents()
|
|
||||||
}
|
|
||||||
|
|
||||||
protected onRemove() {
|
|
||||||
this.cellView.off('edge:mouseenter', this.onMouseEnter, this)
|
|
||||||
this.cellView.off('edge:mouseleave', this.onMouseLeave, this)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace TooltipTool {
|
|
||||||
TooltipTool.config({
|
|
||||||
markup: Markup.getForeignObjectMarkup(),
|
|
||||||
})
|
|
||||||
|
|
||||||
export interface Options extends ToolsView.ToolItem.Options {
|
|
||||||
follow?: boolean
|
|
||||||
tooltip?: string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Graph.registerEdgeTool('tooltip', TooltipTool, true)
|
|
||||||
|
|
||||||
export default class Example extends React.Component {
|
|
||||||
private container: HTMLDivElement
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
const graph = new Graph({
|
|
||||||
container: this.container,
|
|
||||||
width: 800,
|
|
||||||
height: 400,
|
|
||||||
grid: true,
|
|
||||||
})
|
|
||||||
|
|
||||||
graph.addEdge({
|
|
||||||
source: { x: 40, y: 40 },
|
|
||||||
target: { x: 380, y: 40 },
|
|
||||||
vertices: [
|
|
||||||
{ x: 40, y: 80 },
|
|
||||||
{ x: 200, y: 80 },
|
|
||||||
{ x: 200, y: 40 },
|
|
||||||
],
|
|
||||||
attrs: {
|
|
||||||
line: {
|
|
||||||
stroke: '#3c4260',
|
|
||||||
strokeWidth: 2,
|
|
||||||
targetMarker: 'classic',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
tools: [
|
|
||||||
{
|
|
||||||
name: 'tooltip',
|
|
||||||
args: { follow: false, tooltip: 'tooltip test 1' },
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
graph.addEdge({
|
|
||||||
source: { x: 40, y: 160 },
|
|
||||||
target: { x: 380, y: 160 },
|
|
||||||
vertices: [
|
|
||||||
{ x: 40, y: 200 },
|
|
||||||
{ x: 200, y: 200 },
|
|
||||||
{ x: 200, y: 160 },
|
|
||||||
],
|
|
||||||
attrs: {
|
|
||||||
line: {
|
|
||||||
stroke: '#3c4260',
|
|
||||||
strokeWidth: 2,
|
|
||||||
targetMarker: 'classic',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
connector: 'smooth',
|
|
||||||
tools: {
|
|
||||||
name: 'tooltip',
|
|
||||||
args: { follow: true, tooltip: 'tooltip test 2' },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
refContainer = (container: HTMLDivElement) => {
|
|
||||||
this.container = container
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div className="x6-graph-wrap">
|
|
||||||
<div ref={this.refContainer} className="x6-graph" />
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,21 +1,16 @@
|
|||||||
import React from 'react'
|
import React, { memo, useEffect, useRef, useState } from 'react'
|
||||||
import { Graph, Node, Color } from '@antv/x6'
|
import { Graph, Node, Color } from '@antv/x6'
|
||||||
import { Portal } from '@antv/x6-react-shape'
|
import { Portal, ReactShape } from '@antv/x6-react-shape'
|
||||||
import '../index.less'
|
import '../index.less'
|
||||||
|
|
||||||
class MyComponent extends React.Component<{ node?: Node; text: string }> {
|
// You should do this outside your components
|
||||||
shouldComponentUpdate() {
|
// (or make sure its not recreated on every render).
|
||||||
const node = this.props.node
|
//
|
||||||
if (node) {
|
// 这个调用需要在组件外进行。
|
||||||
if (node.hasChanged('data')) {
|
const X6ReactPortalProvider = Portal.getProvider()
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
const MyComponent = memo(
|
||||||
}
|
({ node, text }: { node?: ReactShape; text: string }) => {
|
||||||
|
|
||||||
render() {
|
|
||||||
const color = Color.randomHex()
|
const color = Color.randomHex()
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -28,18 +23,25 @@ class MyComponent extends React.Component<{ node?: Node; text: string }> {
|
|||||||
background: color,
|
background: color,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{this.props.text}
|
{text}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
|
(prev, next) => {
|
||||||
|
return Boolean(next.node?.hasChanged('data'))
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const container = useRef<HTMLDivElement>(null)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!container.current) {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Example extends React.Component {
|
|
||||||
private container: HTMLDivElement
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
const graph = new Graph({
|
const graph = new Graph({
|
||||||
container: this.container,
|
container: container.current,
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600,
|
||||||
})
|
})
|
||||||
@@ -61,7 +63,7 @@ export default class Example extends React.Component {
|
|||||||
y: 320,
|
y: 320,
|
||||||
width: 160,
|
width: 160,
|
||||||
height: 60,
|
height: 60,
|
||||||
component: (node) => {
|
component: (node: Node) => {
|
||||||
return <div>{node.attr('body/fill')}</div>
|
return <div>{node.attr('body/fill')}</div>
|
||||||
},
|
},
|
||||||
// component: () => <Test text="target" />,
|
// component: () => <Test text="target" />,
|
||||||
@@ -80,19 +82,18 @@ export default class Example extends React.Component {
|
|||||||
update()
|
update()
|
||||||
|
|
||||||
console.log(graph.toJSON())
|
console.log(graph.toJSON())
|
||||||
}
|
return () => graph.dispose()
|
||||||
|
}, [])
|
||||||
|
|
||||||
refContainer = (container: HTMLDivElement) => {
|
const [counter, setCounter] = useState(0)
|
||||||
this.container = container
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const X6ReactPortalProvider = Portal.getProvider()
|
|
||||||
return (
|
return (
|
||||||
<div className="x6-graph-wrap">
|
<div className="x6-graph-wrap">
|
||||||
|
<button onClick={() => setCounter((i) => i + 1)}>
|
||||||
|
Counter: {counter}
|
||||||
|
</button>
|
||||||
<X6ReactPortalProvider />
|
<X6ReactPortalProvider />
|
||||||
<div ref={this.refContainer} className="x6-graph" />
|
<div ref={container} className="x6-graph" />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@@ -17,6 +17,7 @@ class TooltipTool extends ToolsView.ToolItem<EdgeView, TooltipToolOptions> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private toggleTooltip(visible: boolean) {
|
private toggleTooltip(visible: boolean) {
|
||||||
|
if (this.knob) {
|
||||||
ReactDom.unmountComponentAtNode(this.knob)
|
ReactDom.unmountComponentAtNode(this.knob)
|
||||||
if (visible) {
|
if (visible) {
|
||||||
ReactDom.render(
|
ReactDom.render(
|
||||||
@@ -31,6 +32,7 @@ class TooltipTool extends ToolsView.ToolItem<EdgeView, TooltipToolOptions> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private onMosueEnter({ e }: { e: MouseEvent }) {
|
private onMosueEnter({ e }: { e: MouseEvent }) {
|
||||||
this.updatePosition(e)
|
this.updatePosition(e)
|
||||||
@@ -69,6 +71,7 @@ class TooltipTool extends ToolsView.ToolItem<EdgeView, TooltipToolOptions> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected onRemove() {
|
protected onRemove() {
|
||||||
|
this.toggleTooltip(false)
|
||||||
this.cellView.off('cell:mouseenter', this.onMosueEnter, this)
|
this.cellView.off('cell:mouseenter', this.onMosueEnter, this)
|
||||||
this.cellView.off('cell:mouseleave', this.onMouseLeave, this)
|
this.cellView.off('cell:mouseleave', this.onMouseLeave, this)
|
||||||
this.cellView.off('cell:mousemove', this.onMouseMove, this)
|
this.cellView.off('cell:mousemove', this.onMouseMove, this)
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
import React from 'react'
|
|
||||||
import { Button } from 'antd'
|
import { Button } from 'antd'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
import { Graph } from '@antv/x6'
|
import { Graph } from '@antv/x6'
|
||||||
|
|
||||||
import '../index.less'
|
import '../index.less'
|
||||||
|
|
||||||
export default class Example extends React.Component<
|
export default class Example extends React.Component<
|
||||||
@@ -22,10 +24,13 @@ export default class Example extends React.Component<
|
|||||||
height: 600,
|
height: 600,
|
||||||
grid: true,
|
grid: true,
|
||||||
history: true,
|
history: true,
|
||||||
|
embedding: {
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
this.history = graph.history
|
this.history = graph.history
|
||||||
this.history.on('change', () => {
|
this.history.on('change', (info) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
canRedo: this.history.canRedo(),
|
canRedo: this.history.canRedo(),
|
||||||
canUndo: this.history.canUndo(),
|
canUndo: this.history.canUndo(),
|
||||||
@@ -62,6 +67,21 @@ export default class Example extends React.Component<
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
graph.addNode({
|
||||||
|
x: 400,
|
||||||
|
y: 100,
|
||||||
|
width: 150,
|
||||||
|
height: 150,
|
||||||
|
attrs: {
|
||||||
|
label: {
|
||||||
|
text: '🌎',
|
||||||
|
},
|
||||||
|
body: {
|
||||||
|
strokeWidth: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
graph.addEdge({ source, target, arrts: { line: { strokeWidth: 1 } } })
|
graph.addEdge({ source, target, arrts: { line: { strokeWidth: 1 } } })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
## @antv/x6-angular-shape [1.3.1](https://github.com/antvis/x6/compare/@antv/x6-angular-shape@1.3.0...@antv/x6-angular-shape@1.3.1) (2022-06-05)
|
||||||
|
|
||||||
# @antv/x6-angular-shape [1.3.0](https://github.com/antvis/x6/compare/@antv/x6-angular-shape@1.2.0...@antv/x6-angular-shape@1.3.0) (2022-01-11)
|
# @antv/x6-angular-shape [1.3.0](https://github.com/antvis/x6/compare/@antv/x6-angular-shape@1.2.0...@antv/x6-angular-shape@1.3.0) (2022-01-11)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@antv/x6-angular-shape",
|
"name": "@antv/x6-angular-shape",
|
||||||
"version": "1.3.0",
|
"version": "1.3.1",
|
||||||
"description": "X6 shape for rendering angular components.",
|
"description": "X6 shape for rendering angular components.",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/cdk": "^10.2.3",
|
"@angular/cdk": "^10.2.3",
|
||||||
"@angular/common": "^10.2.3",
|
"@angular/common": "^10.2.3",
|
||||||
"@angular/core": "^10.2.3",
|
"@angular/core": "^11.0.5",
|
||||||
"@rollup/plugin-commonjs": "^20.0.0",
|
"@rollup/plugin-commonjs": "^20.0.0",
|
||||||
"@rollup/plugin-node-resolve": "^13.0.4",
|
"@rollup/plugin-node-resolve": "^13.0.4",
|
||||||
"@rollup/plugin-replace": "^3.0.0",
|
"@rollup/plugin-replace": "^3.0.0",
|
||||||
|
@@ -1,3 +1,17 @@
|
|||||||
|
## @antv/x6-geometry [1.0.12](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.11...@antv/x6-geometry@1.0.12) (2022-05-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* remove the browserslist configuration in package.json ([#2084](https://github.com/antvis/x6/issues/2084)) ([de59617](https://github.com/antvis/x6/commit/de59617532cb20c0103ac701f44f2d0509b782e0))
|
||||||
|
|
||||||
|
## @antv/x6-geometry [1.0.12](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.11...@antv/x6-geometry@1.0.12) (2022-05-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* remove the browserslist configuration in package.json ([#2084](https://github.com/antvis/x6/issues/2084)) ([de59617](https://github.com/antvis/x6/commit/de59617532cb20c0103ac701f44f2d0509b782e0))
|
||||||
|
|
||||||
## @antv/x6-geometry [1.0.11](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.10...@antv/x6-geometry@1.0.11) (2021-11-14)
|
## @antv/x6-geometry [1.0.11](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.10...@antv/x6-geometry@1.0.11) (2021-11-14)
|
||||||
|
|
||||||
# @antv/x6-geometry 1.0.0 (2021-11-11)
|
# @antv/x6-geometry 1.0.0 (2021-11-11)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "1.0.11",
|
"version": "1.0.12",
|
||||||
"name": "@antv/x6-geometry",
|
"name": "@antv/x6-geometry",
|
||||||
"description": "Some useful geometry operations.",
|
"description": "Some useful geometry operations.",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
@@ -91,11 +91,6 @@
|
|||||||
"tslib": "^2.3.1",
|
"tslib": "^2.3.1",
|
||||||
"typescript": "^4.4.3"
|
"typescript": "^4.4.3"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
|
||||||
"last 2 versions",
|
|
||||||
"Firefox ESR",
|
|
||||||
"> 1%"
|
|
||||||
],
|
|
||||||
"author": {
|
"author": {
|
||||||
"name": "bubkoo",
|
"name": "bubkoo",
|
||||||
"email": "bubkoo.wy@gmail.com"
|
"email": "bubkoo.wy@gmail.com"
|
||||||
|
@@ -3,5 +3,5 @@
|
|||||||
/**
|
/**
|
||||||
* Auto generated version file, do not modify it!
|
* Auto generated version file, do not modify it!
|
||||||
*/
|
*/
|
||||||
const version = '1.0.8'
|
const version = '1.0.12'
|
||||||
export { version }
|
export { version }
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@antv/x6-react-shape",
|
"name": "@antv/x6-react-shape",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"description": "X6 shape for rendering react components.",
|
"description": "X6 shape for rendering react components.",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
@@ -10,7 +10,8 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
"es",
|
"es",
|
||||||
"lib"
|
"lib",
|
||||||
|
"src"
|
||||||
],
|
],
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"shape",
|
"shape",
|
||||||
|
@@ -1,3 +1,43 @@
|
|||||||
|
# @antv/x6-vector [1.4.0](https://github.com/antvis/x6/compare/@antv/x6-vector@1.3.1...@antv/x6-vector@1.4.0) (2022-05-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* remove the browserslist configuration in package.json ([#2084](https://github.com/antvis/x6/issues/2084)) ([de59617](https://github.com/antvis/x6/commit/de59617532cb20c0103ac701f44f2d0509b782e0))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* ✨ unified minimap interaction between scroller and panning ([#2109](https://github.com/antvis/x6/issues/2109)) ([3c7c06a](https://github.com/antvis/x6/commit/3c7c06ac30b48d563cbfa5dca298789ac6ea1ba2))
|
||||||
|
|
||||||
|
# @antv/x6-vector [1.4.0](https://github.com/antvis/x6/compare/@antv/x6-vector@1.3.2...@antv/x6-vector@1.4.0) (2022-05-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* ✨ unified minimap interaction between scroller and panning ([#2109](https://github.com/antvis/x6/issues/2109)) ([3c7c06a](https://github.com/antvis/x6/commit/3c7c06ac30b48d563cbfa5dca298789ac6ea1ba2))
|
||||||
|
|
||||||
|
## @antv/x6-vector [1.3.2](https://github.com/antvis/x6/compare/@antv/x6-vector@1.3.1...@antv/x6-vector@1.3.2) (2022-05-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* remove the browserslist configuration in package.json ([#2084](https://github.com/antvis/x6/issues/2084)) ([de59617](https://github.com/antvis/x6/commit/de59617532cb20c0103ac701f44f2d0509b782e0))
|
||||||
|
|
||||||
|
## @antv/x6-vector [1.3.1](https://github.com/antvis/x6/compare/@antv/x6-vector@1.3.0...@antv/x6-vector@1.3.1) (2022-04-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 fix lgtm alert ([#1975](https://github.com/antvis/x6/issues/1975)) ([7440903](https://github.com/antvis/x6/commit/7440903281be9214d8cff7f69c4e44106d751422))
|
||||||
|
|
||||||
|
## @antv/x6-vector [1.3.1](https://github.com/antvis/x6/compare/@antv/x6-vector@1.3.0...@antv/x6-vector@1.3.1) (2022-04-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 fix lgtm alert ([#1975](https://github.com/antvis/x6/issues/1975)) ([7440903](https://github.com/antvis/x6/commit/7440903281be9214d8cff7f69c4e44106d751422))
|
||||||
|
|
||||||
# @antv/x6-vector [1.3.0](https://github.com/antvis/x6/compare/@antv/x6-vector@1.2.3...@antv/x6-vector@1.3.0) (2021-12-18)
|
# @antv/x6-vector [1.3.0](https://github.com/antvis/x6/compare/@antv/x6-vector@1.2.3...@antv/x6-vector@1.3.0) (2021-12-18)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "1.3.0",
|
"version": "1.4.0",
|
||||||
"name": "@antv/x6-vector",
|
"name": "@antv/x6-vector",
|
||||||
"description": "Lightweight library for manipulating and animating SVG.",
|
"description": "Lightweight library for manipulating and animating SVG.",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
@@ -103,11 +103,6 @@
|
|||||||
"tslib": "^2.3.1",
|
"tslib": "^2.3.1",
|
||||||
"typescript": "^4.4.3"
|
"typescript": "^4.4.3"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
|
||||||
"last 2 versions",
|
|
||||||
"Firefox ESR",
|
|
||||||
"> 1%"
|
|
||||||
],
|
|
||||||
"author": {
|
"author": {
|
||||||
"name": "bubkoo",
|
"name": "bubkoo",
|
||||||
"email": "bubkoo.wy@gmail.com"
|
"email": "bubkoo.wy@gmail.com"
|
||||||
|
@@ -94,7 +94,7 @@ export namespace Adopter {
|
|||||||
|
|
||||||
// Make sure, that HTML elements are created with the correct namespace
|
// Make sure, that HTML elements are created with the correct namespace
|
||||||
const wrapper = isHTML ? createHTMLNode('div') : createSVGNode('svg')
|
const wrapper = isHTML ? createHTMLNode('div') : createSVGNode('svg')
|
||||||
wrapper.innerHTML = node
|
wrapper.innerHTML = typeof node === 'string' ? unescape(node) : node
|
||||||
|
|
||||||
// We can use firstChild here because we know,
|
// We can use firstChild here because we know,
|
||||||
// that the first char is < and thus an element
|
// that the first char is < and thus an element
|
||||||
|
@@ -3,5 +3,5 @@
|
|||||||
/**
|
/**
|
||||||
* Auto generated version file, do not modify it!
|
* Auto generated version file, do not modify it!
|
||||||
*/
|
*/
|
||||||
const version = '1.3.0'
|
const version = '1.4.0'
|
||||||
export { version }
|
export { version }
|
||||||
|
@@ -3,7 +3,8 @@ import { SVG } from '../svg/svg'
|
|||||||
import { Image } from './image'
|
import { Image } from './image'
|
||||||
|
|
||||||
describe('Image', () => {
|
describe('Image', () => {
|
||||||
const url = 'http://via.placeholder.com/120x80'
|
const url =
|
||||||
|
'https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*bSBhSbhNr2QAAAAAAAAAAAAAARQnAQ'
|
||||||
|
|
||||||
describe('constructor()', () => {
|
describe('constructor()', () => {
|
||||||
it('should create an instance of Image', () => {
|
it('should create an instance of Image', () => {
|
||||||
|
@@ -1,3 +1,33 @@
|
|||||||
|
# @antv/x6-vue-shape [1.4.0](https://github.com/antvis/x6/compare/@antv/x6-vue-shape@1.3.2...@antv/x6-vue-shape@1.4.0) (2022-05-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* vue3支持使用useTeleport ([#2078](https://github.com/antvis/x6/issues/2078)) ([b8c2175](https://github.com/antvis/x6/commit/b8c217572a696a11fc0fbad7050fffb34ab6c3af))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.5
|
||||||
|
|
||||||
|
## @antv/x6-vue-shape [1.3.2](https://github.com/antvis/x6/compare/@antv/x6-vue-shape@1.3.1...@antv/x6-vue-shape@1.3.2) (2022-04-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **x6-vue-shape:** 🐛 error on removing fragment node ([#1974](https://github.com/antvis/x6/issues/1974)) ([6614e4f](https://github.com/antvis/x6/commit/6614e4f83c5926d97a55db48232f58ba17f64a00))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@antv/x6:** upgraded to 1.31.1
|
||||||
|
|
||||||
## @antv/x6-vue-shape [1.3.1](https://github.com/antvis/x6/compare/@antv/x6-vue-shape@1.3.0...@antv/x6-vue-shape@1.3.1) (2022-01-12)
|
## @antv/x6-vue-shape [1.3.1](https://github.com/antvis/x6/compare/@antv/x6-vue-shape@1.3.0...@antv/x6-vue-shape@1.3.1) (2022-01-12)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@antv/x6-vue-shape",
|
"name": "@antv/x6-vue-shape",
|
||||||
"version": "1.3.1",
|
"version": "1.5.0",
|
||||||
"description": "X6 shape for rendering vue components.",
|
"description": "X6 shape for rendering vue components.",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
@@ -31,7 +31,23 @@
|
|||||||
"build": "run-p build:cjs build:esm build:umd",
|
"build": "run-p build:cjs build:esm build:umd",
|
||||||
"prebuild": "run-s lint clean",
|
"prebuild": "run-s lint clean",
|
||||||
"prepare": "yarn build",
|
"prepare": "yarn build",
|
||||||
"precommit": "lint-staged"
|
"precommit": "lint-staged",
|
||||||
|
"release": "release-it"
|
||||||
|
},
|
||||||
|
"release-it": {
|
||||||
|
"git": {
|
||||||
|
"tagName": "@antv/x6-vue-shape@${version}",
|
||||||
|
"commitMessage": "chore: release ${name}@${version}",
|
||||||
|
"requireCleanWorkingDir": false
|
||||||
|
},
|
||||||
|
"github": {
|
||||||
|
"release": true
|
||||||
|
},
|
||||||
|
"hooks": {
|
||||||
|
"before:init": [
|
||||||
|
"yarn run build"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"src/**/*.ts": [
|
"src/**/*.ts": [
|
||||||
@@ -45,7 +61,7 @@
|
|||||||
"@antv/x6-package-json/rollup.json"
|
"@antv/x6-package-json/rollup.json"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vue-demi": "^0.7.4"
|
"vue-demi": "latest"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@antv/x6": ">=1.0.0",
|
"@antv/x6": ">=1.0.0",
|
||||||
|
@@ -3,3 +3,4 @@ import './hook'
|
|||||||
export * from './node'
|
export * from './node'
|
||||||
export * from './view'
|
export * from './view'
|
||||||
export * from './registry'
|
export * from './registry'
|
||||||
|
export * from './teleport'
|
||||||
|
@@ -1,14 +1,9 @@
|
|||||||
import { Graph, Node, Registry } from '@antv/x6'
|
import { Graph, Node, Registry } from '@antv/x6'
|
||||||
|
import { ComponentInstance } from 'vue-demi'
|
||||||
|
|
||||||
export type VueComponent = {
|
export declare type VueComponent = ComponentInstance
|
||||||
template: string
|
|
||||||
data?: { [key: string]: any }
|
|
||||||
components?: { [key: string]: any }
|
|
||||||
computed?: { [key: string]: any }
|
|
||||||
methods?: { [key: string]: any }
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Definition =
|
export declare type Definition =
|
||||||
| VueComponent
|
| VueComponent
|
||||||
| ((this: Graph, node: Node) => VueComponent)
|
| ((this: Graph, node: Node) => VueComponent)
|
||||||
|
|
||||||
|
118
packages/x6-vue-shape/src/teleport.ts
Normal file
118
packages/x6-vue-shape/src/teleport.ts
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
import { defineComponent, h, reactive, isVue3, Vue } from 'vue-demi'
|
||||||
|
import { Graph, NodeView, Scheduler } from '@antv/x6'
|
||||||
|
import { VueShape } from './node'
|
||||||
|
import { VueShapeView } from './view'
|
||||||
|
|
||||||
|
export function useTeleport(uniqViewId: string) {
|
||||||
|
if (isVue3) {
|
||||||
|
const { Teleport, markRaw, Fragment, VNode, VNodeData } = Vue as any
|
||||||
|
const action: any = 'vue'
|
||||||
|
|
||||||
|
const items = reactive<{ [key: string]: any }>({})
|
||||||
|
|
||||||
|
const TeleportContainer = defineComponent({
|
||||||
|
setup() {
|
||||||
|
return () =>
|
||||||
|
h(
|
||||||
|
Fragment,
|
||||||
|
{},
|
||||||
|
Object.keys(items).map((id) => h(items[id])),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const connect = (
|
||||||
|
id: string,
|
||||||
|
node: VueShape,
|
||||||
|
graph: Graph,
|
||||||
|
component: any,
|
||||||
|
getContainer: () => HTMLDivElement,
|
||||||
|
) => {
|
||||||
|
if (items[id]) {
|
||||||
|
// confirmUpdate可能导致多次调用,所以判断一下
|
||||||
|
return
|
||||||
|
}
|
||||||
|
items[id] = markRaw(
|
||||||
|
defineComponent({
|
||||||
|
render: () =>
|
||||||
|
(getContainer()
|
||||||
|
? h(Teleport, { to: getContainer() } as typeof VNodeData, [
|
||||||
|
h(component, { graph, node } as any),
|
||||||
|
])
|
||||||
|
: null) as typeof VNode,
|
||||||
|
provide: () => ({
|
||||||
|
getGraph: () => graph,
|
||||||
|
getNode: () => node,
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
const disconnect = (id: string) => {
|
||||||
|
delete items[id]
|
||||||
|
}
|
||||||
|
|
||||||
|
class VuePortalShapeView extends NodeView<VueShape> {
|
||||||
|
getTargetId() {
|
||||||
|
return `${this.graph.view.cid}:${this.cell.id}`
|
||||||
|
}
|
||||||
|
init() {
|
||||||
|
super.init()
|
||||||
|
const targetId = this.getTargetId()
|
||||||
|
this.cell.on('removed', () => {
|
||||||
|
disconnect(targetId)
|
||||||
|
})
|
||||||
|
this.renderVueComponent()
|
||||||
|
}
|
||||||
|
renderVueComponent() {
|
||||||
|
const targetId = this.getTargetId()
|
||||||
|
const component = this.graph.hook.getVueComponent(this.cell)
|
||||||
|
// 这里需要将当前View的cell以及graph还有component等对象存储起来给TeleportContainer使用
|
||||||
|
connect(
|
||||||
|
targetId,
|
||||||
|
this.cell,
|
||||||
|
this.graph,
|
||||||
|
component,
|
||||||
|
this.getComponentContainer.bind(this),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
getComponentContainer() {
|
||||||
|
return this.cell.prop('useForeignObject') === false
|
||||||
|
? (this.selectors.content as SVGElement)
|
||||||
|
: (this.selectors.foContent as HTMLDivElement)
|
||||||
|
}
|
||||||
|
confirmUpdate(flag: any) {
|
||||||
|
const ret = super.confirmUpdate(flag)
|
||||||
|
return this.handleAction(ret, action, () => {
|
||||||
|
// 参照VueShapeView进行渲染,修复 #2505
|
||||||
|
Scheduler.scheduleTask(() => {
|
||||||
|
this.renderVueComponent()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
unmount(elem: Element) {
|
||||||
|
// 基类调用removeView的时候,会自动调用unmount
|
||||||
|
const targetId = this.getTargetId()
|
||||||
|
disconnect(targetId)
|
||||||
|
super.unmount(elem)
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
VuePortalShapeView.config({
|
||||||
|
bootstrap: [action],
|
||||||
|
actions: {
|
||||||
|
component: action,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
NodeView.registry.register(uniqViewId, VuePortalShapeView, true)
|
||||||
|
|
||||||
|
return TeleportContainer
|
||||||
|
}
|
||||||
|
// 如果是vue2就默认输出一个警告信息
|
||||||
|
console.warn('useTeleport should run in vue3')
|
||||||
|
// 或者拿默认的view注册一个,保证这个api是可用状态,不至于用户使用了,但是报错
|
||||||
|
NodeView.registry.register(uniqViewId, VueShapeView, true)
|
||||||
|
return defineComponent(() => null)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default useTeleport
|
@@ -1,7 +1,6 @@
|
|||||||
import { NodeView, Scheduler } from '@antv/x6'
|
import { NodeView, Scheduler } from '@antv/x6'
|
||||||
import { isVue2, isVue3, createApp, h, Vue2 } from 'vue-demi'
|
import { isVue2, isVue3, createApp, h, Vue2 } from 'vue-demi'
|
||||||
import { VueShape } from './node'
|
import { VueShape } from './node'
|
||||||
import { VueComponent } from './registry'
|
|
||||||
|
|
||||||
export class VueShapeView extends NodeView<VueShape> {
|
export class VueShapeView extends NodeView<VueShape> {
|
||||||
private vm: any
|
private vm: any
|
||||||
@@ -33,31 +32,28 @@ export class VueShapeView extends NodeView<VueShape> {
|
|||||||
const component = this.graph.hook.getVueComponent(node)
|
const component = this.graph.hook.getVueComponent(node)
|
||||||
if (isVue2) {
|
if (isVue2) {
|
||||||
const Vue = Vue2 as any
|
const Vue = Vue2 as any
|
||||||
const div = document.createElement('div')
|
|
||||||
div.style.width = '100%'
|
|
||||||
div.style.height = '100%'
|
|
||||||
if (typeof component === 'string') {
|
if (typeof component === 'string') {
|
||||||
div.innerHTML = component
|
this.vm = new Vue({ template: component })
|
||||||
this.vm = new Vue({ el: div })
|
|
||||||
} else {
|
} else {
|
||||||
const { template, ...other } = component as VueComponent
|
|
||||||
div.innerHTML = template
|
|
||||||
this.vm = new Vue({
|
this.vm = new Vue({
|
||||||
el: div,
|
render() {
|
||||||
|
// 保留之前的provide,增加传递graph和node
|
||||||
|
return h(component as any, { graph, node } as any)
|
||||||
|
},
|
||||||
provide() {
|
provide() {
|
||||||
return {
|
return {
|
||||||
getGraph: () => graph,
|
getGraph: () => graph,
|
||||||
getNode: () => node,
|
getNode: () => node,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
...other,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
root.appendChild(this.vm.$el)
|
this.vm.$mount(root)
|
||||||
} else if (isVue3) {
|
} else if (isVue3) {
|
||||||
this.vm = createApp({
|
this.vm = createApp({
|
||||||
render() {
|
render() {
|
||||||
return h(component as any)
|
// 保留之前的provide,增加传递graph和node
|
||||||
|
return h(component as any, { graph, node } as any)
|
||||||
},
|
},
|
||||||
provide() {
|
provide() {
|
||||||
return {
|
return {
|
||||||
@@ -73,12 +69,12 @@ export class VueShapeView extends NodeView<VueShape> {
|
|||||||
|
|
||||||
protected unmountVueComponent() {
|
protected unmountVueComponent() {
|
||||||
const root = this.getComponentContainer()
|
const root = this.getComponentContainer()
|
||||||
root.innerHTML = ''
|
|
||||||
if (this.vm) {
|
if (this.vm) {
|
||||||
isVue2 && this.vm.$destroy()
|
isVue2 && this.vm.$destroy()
|
||||||
isVue3 && this.vm.unmount()
|
isVue3 && this.vm.unmount()
|
||||||
this.vm = null
|
this.vm = null
|
||||||
}
|
}
|
||||||
|
root.innerHTML = ''
|
||||||
return root
|
return root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,3 +1,83 @@
|
|||||||
|
## @antv/x6 [1.32.3](https://github.com/antvis/x6/compare/@antv/x6@1.32.2...@antv/x6@1.32.3) (2022-05-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* :bug: Fixed the error when a node meet an invisiable node in node:embedding event ([#2129](https://github.com/antvis/x6/issues/2129)) ([6ef7f55](https://github.com/antvis/x6/commit/6ef7f55334d9415bce217c9cc5885f1bc084de92))
|
||||||
|
|
||||||
|
## @antv/x6 [1.32.2](https://github.com/antvis/x6/compare/@antv/x6@1.32.1...@antv/x6@1.32.2) (2022-05-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 fix minimap error in after resize graph ([#2117](https://github.com/antvis/x6/issues/2117)) ([e1bb928](https://github.com/antvis/x6/commit/e1bb9289b0e5bd8106baaf88e16cbab125c5fc4e))
|
||||||
|
|
||||||
|
## @antv/x6 [1.32.1](https://github.com/antvis/x6/compare/@antv/x6@1.32.0...@antv/x6@1.32.1) (2022-05-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 auto zoom minimap graph to fit content ([#2111](https://github.com/antvis/x6/issues/2111)) ([12e3e89](https://github.com/antvis/x6/commit/12e3e8969f35ed14acff16bf62da6ea9012137da))
|
||||||
|
|
||||||
|
# @antv/x6 [1.32.0](https://github.com/antvis/x6/compare/@antv/x6@1.31.5...@antv/x6@1.32.0) (2022-05-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* ✨ unified minimap interaction between scroller and panning ([#2109](https://github.com/antvis/x6/issues/2109)) ([3c7c06a](https://github.com/antvis/x6/commit/3c7c06ac30b48d563cbfa5dca298789ac6ea1ba2))
|
||||||
|
|
||||||
|
## @antv/x6 [1.31.5](https://github.com/antvis/x6/compare/@antv/x6@1.31.4...@antv/x6@1.31.5) (2022-05-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* :bug: fix the graph function zoomTo not return the graph instance. ([#2090](https://github.com/antvis/x6/issues/2090)) ([692a4ee](https://github.com/antvis/x6/commit/692a4ee1b0c3063580e0e3433922c073cadf1880))
|
||||||
|
* 🐛 not rerender tools when edge update ([#2095](https://github.com/antvis/x6/issues/2095)) ([26ce96f](https://github.com/antvis/x6/commit/26ce96f7a20e272b06e5044840d2393815884d87))
|
||||||
|
* remove the browserslist configuration in package.json ([#2084](https://github.com/antvis/x6/issues/2084)) ([de59617](https://github.com/antvis/x6/commit/de59617532cb20c0103ac701f44f2d0509b782e0))
|
||||||
|
|
||||||
|
## @antv/x6 [1.31.4](https://github.com/antvis/x6/compare/@antv/x6@1.31.3...@antv/x6@1.31.4) (2022-04-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 exclude case-sensitive-attr in kebablizeAttrs ([#2031](https://github.com/antvis/x6/issues/2031)) ([1e513ad](https://github.com/antvis/x6/commit/1e513adfdeee34c833c70eed037d26e28be33594))
|
||||||
|
|
||||||
|
## @antv/x6 [1.31.3](https://github.com/antvis/x6/compare/@antv/x6@1.31.2...@antv/x6@1.31.3) (2022-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fix animationOptions type ([#1989](https://github.com/antvis/x6/issues/1989)) ([5020e92](https://github.com/antvis/x6/commit/5020e92ce8b758d1e7baeb7e3b5035142b3b6186))
|
||||||
|
|
||||||
|
## @antv/x6 [1.31.2](https://github.com/antvis/x6/compare/@antv/x6@1.31.1...@antv/x6@1.31.2) (2022-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 change copystyle not include number propery when toSvg ([#1985](https://github.com/antvis/x6/issues/1985)) ([214b927](https://github.com/antvis/x6/commit/214b92704d6c6099047597110477809a4e0d900c))
|
||||||
|
* 🐛 fix scroller resize size miscalculation when graph resize ([#1977](https://github.com/antvis/x6/issues/1977)) ([e6de636](https://github.com/antvis/x6/commit/e6de6363aea991b1984010cb8f1d90f89a25388a))
|
||||||
|
|
||||||
|
## @antv/x6 [1.31.1](https://github.com/antvis/x6/compare/@antv/x6@1.31.0...@antv/x6@1.31.1) (2022-04-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 fix lgtm alert ([#1975](https://github.com/antvis/x6/issues/1975)) ([7440903](https://github.com/antvis/x6/commit/7440903281be9214d8cff7f69c4e44106d751422))
|
||||||
|
|
||||||
|
# @antv/x6 [1.31.0](https://github.com/antvis/x6/compare/@antv/x6@1.30.2...@antv/x6@1.31.0) (2022-03-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 change the order of statement ([#1910](https://github.com/antvis/x6/issues/1910)) ([eff14ba](https://github.com/antvis/x6/commit/eff14baca749753a10bde0a81adfd55898cf7215))
|
||||||
|
* 🐛 fix cellEditorOptions typo ([#1895](https://github.com/antvis/x6/issues/1895)) ([4d174d7](https://github.com/antvis/x6/commit/4d174d7807463d64ff248fe4ee1e09010bad4bfc))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* ✨ delete the new Function mode to avoid the CSP policy ([#1921](https://github.com/antvis/x6/issues/1921)) ([157b207](https://github.com/antvis/x6/commit/157b2072f35cd7d883eab95b9a874444858758e3))
|
||||||
|
* 🐛 support click on the non-text area without adding a new label ([#1894](https://github.com/antvis/x6/issues/1894)) ([4ae1b9e](https://github.com/antvis/x6/commit/4ae1b9ef4f43b9c9f96796c5c5fa31f968b82bdf))
|
||||||
|
|
||||||
## @antv/x6 [1.30.2](https://github.com/antvis/x6/compare/@antv/x6@1.30.1...@antv/x6@1.30.2) (2022-03-10)
|
## @antv/x6 [1.30.2](https://github.com/antvis/x6/compare/@antv/x6@1.30.1...@antv/x6@1.30.2) (2022-03-10)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -76,7 +76,7 @@ $ yarn add @antv/x6
|
|||||||
```ts
|
```ts
|
||||||
// 从 node_modules 引入
|
// 从 node_modules 引入
|
||||||
import { Graph } from '@antv/x6'
|
import { Graph } from '@antv/x6'
|
||||||
// 从 CND 引入时,我们暴露了 X6 这个全局变量
|
// 从 CDN 引入时,我们暴露了 X6 这个全局变量
|
||||||
// const { Graph } = X6
|
// const { Graph } = X6
|
||||||
|
|
||||||
// 创建 Graph 的实例
|
// 创建 Graph 的实例
|
||||||
@@ -165,9 +165,9 @@ graph.addEdge({
|
|||||||
需要注意的是,提问题时请配上 [CodeSandbox](https://codesandbox.io/s/pensive-sound-f4nhc) 的复现代码,方便快速定位和解决问题。
|
需要注意的是,提问题时请配上 [CodeSandbox](https://codesandbox.io/s/pensive-sound-f4nhc) 的复现代码,方便快速定位和解决问题。
|
||||||
|
|
||||||
<a href="https://qr.dingtalk.com/action/joingroup?code=v1,k1,rOHuvgq5s0EHDktyyQJffDE3ZAmHnbB2e6iwn/w4BKs=&_dt_no_comment=1&origin=11" target="_blank" rel="noopener noreferrer">
|
<a href="https://qr.dingtalk.com/action/joingroup?code=v1,k1,rOHuvgq5s0EHDktyyQJffDE3ZAmHnbB2e6iwn/w4BKs=&_dt_no_comment=1&origin=11" target="_blank" rel="noopener noreferrer">
|
||||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*Up-4S4v8H-0AAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群1" width="375" />
|
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*Up-4S4v8H-0AAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群1" width="260" />
|
||||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*4Y_5S7i26LAAAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群2" width="375" />
|
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*4Y_5S7i26LAAAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群2" width="260" />
|
||||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*KHB4QJAsW4QAAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群3" width="375" />
|
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*KHB4QJAsW4QAAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群3" width="260" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
## 如何开发
|
## 如何开发
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@antv/x6",
|
"name": "@antv/x6",
|
||||||
"version": "1.30.2",
|
"version": "1.34.0",
|
||||||
"description": "JavaScript diagramming library that uses SVG and HTML for rendering.",
|
"description": "JavaScript diagramming library that uses SVG and HTML for rendering.",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
@@ -48,7 +48,8 @@
|
|||||||
"coveralls": "cat ./test/coverage/lcov.info | coveralls",
|
"coveralls": "cat ./test/coverage/lcov.info | coveralls",
|
||||||
"pretest": "run-p clean:coverage",
|
"pretest": "run-p clean:coverage",
|
||||||
"prepare": "run-s build:version test build",
|
"prepare": "run-s build:version test build",
|
||||||
"precommit": "lint-staged"
|
"precommit": "lint-staged",
|
||||||
|
"release": "release-it"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"src/**/*.less": [
|
"src/**/*.less": [
|
||||||
@@ -58,6 +59,20 @@
|
|||||||
"eslint --fix"
|
"eslint --fix"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"release-it": {
|
||||||
|
"git": {
|
||||||
|
"tagName": "@antv/x6@${version}",
|
||||||
|
"commitMessage": "chore: release ${name}@${version}"
|
||||||
|
},
|
||||||
|
"github": {
|
||||||
|
"release": true
|
||||||
|
},
|
||||||
|
"hooks": {
|
||||||
|
"before:init": [
|
||||||
|
"yarn run build"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"inherits": [
|
"inherits": [
|
||||||
"@antv/x6-package-json/cli.json",
|
"@antv/x6-package-json/cli.json",
|
||||||
"@antv/x6-package-json/less.json",
|
"@antv/x6-package-json/less.json",
|
||||||
@@ -134,11 +149,6 @@
|
|||||||
"tslib": "^2.3.1",
|
"tslib": "^2.3.1",
|
||||||
"typescript": "^4.4.3"
|
"typescript": "^4.4.3"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
|
||||||
"last 2 versions",
|
|
||||||
"Firefox ESR",
|
|
||||||
"> 1%"
|
|
||||||
],
|
|
||||||
"author": {
|
"author": {
|
||||||
"name": "bubkoo",
|
"name": "bubkoo",
|
||||||
"email": "bubkoo.wy@gmail.com"
|
"email": "bubkoo.wy@gmail.com"
|
||||||
|
@@ -2,7 +2,6 @@ import { FunctionExt } from '../../util'
|
|||||||
import { View } from '../../view/view'
|
import { View } from '../../view/view'
|
||||||
import { Graph } from '../../graph/graph'
|
import { Graph } from '../../graph/graph'
|
||||||
import { EventArgs } from '../../graph/events'
|
import { EventArgs } from '../../graph/events'
|
||||||
import { Point } from '../../geometry'
|
|
||||||
|
|
||||||
namespace ClassName {
|
namespace ClassName {
|
||||||
export const root = 'widget-minimap'
|
export const root = 'widget-minimap'
|
||||||
@@ -129,8 +128,9 @@ export class MiniMap extends View {
|
|||||||
this.updateViewport,
|
this.updateViewport,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
this.sourceGraph.on('translate', this.onSourceGraphTransform, this)
|
this.sourceGraph.on('translate', this.onTransform, this)
|
||||||
this.sourceGraph.on('scale', this.onSourceGraphTransform, this)
|
this.sourceGraph.on('scale', this.onTransform, this)
|
||||||
|
this.sourceGraph.on('model:updated', this.onModelUpdated, this)
|
||||||
}
|
}
|
||||||
this.sourceGraph.on('resize', this.updatePaper, this)
|
this.sourceGraph.on('resize', this.updatePaper, this)
|
||||||
this.delegateEvents({
|
this.delegateEvents({
|
||||||
@@ -145,8 +145,9 @@ export class MiniMap extends View {
|
|||||||
if (this.scroller) {
|
if (this.scroller) {
|
||||||
this.$graphContainer.off(this.getEventNamespace())
|
this.$graphContainer.off(this.getEventNamespace())
|
||||||
} else {
|
} else {
|
||||||
this.sourceGraph.off('translate', this.onSourceGraphTransform, this)
|
this.sourceGraph.off('translate', this.onTransform, this)
|
||||||
this.sourceGraph.off('scale', this.onSourceGraphTransform, this)
|
this.sourceGraph.off('scale', this.onTransform, this)
|
||||||
|
this.sourceGraph.off('model:updated', this.onModelUpdated, this)
|
||||||
}
|
}
|
||||||
this.sourceGraph.off('resize', this.updatePaper, this)
|
this.sourceGraph.off('resize', this.updatePaper, this)
|
||||||
this.undelegateEvents()
|
this.undelegateEvents()
|
||||||
@@ -158,17 +159,16 @@ export class MiniMap extends View {
|
|||||||
this.targetGraph.dispose()
|
this.targetGraph.dispose()
|
||||||
}
|
}
|
||||||
|
|
||||||
protected onSourceGraphTransform() {
|
protected onTransform(options: { ui: boolean }) {
|
||||||
if (!this.targetGraphTransforming) {
|
if (options.ui || this.targetGraphTransforming) {
|
||||||
this.updatePaper(
|
|
||||||
this.sourceGraph.options.width,
|
|
||||||
this.sourceGraph.options.height,
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
this.updateViewport()
|
this.updateViewport()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected onModelUpdated() {
|
||||||
|
this.targetGraph.zoomToFit()
|
||||||
|
}
|
||||||
|
|
||||||
protected updatePaper(width: number, height: number): this
|
protected updatePaper(width: number, height: number): this
|
||||||
protected updatePaper({ width, height }: EventArgs['resize']): this
|
protected updatePaper({ width, height }: EventArgs['resize']): this
|
||||||
protected updatePaper(w: number | EventArgs['resize'], h?: number) {
|
protected updatePaper(w: number | EventArgs['resize'], h?: number) {
|
||||||
@@ -200,21 +200,26 @@ export class MiniMap extends View {
|
|||||||
height *= ratio // eslint-disable-line
|
height *= ratio // eslint-disable-line
|
||||||
this.targetGraph.resizeGraph(width, height)
|
this.targetGraph.resizeGraph(width, height)
|
||||||
this.targetGraph.translate(x, y)
|
this.targetGraph.translate(x, y)
|
||||||
|
|
||||||
|
if (this.scroller) {
|
||||||
this.targetGraph.scale(ratio, ratio)
|
this.targetGraph.scale(ratio, ratio)
|
||||||
|
} else {
|
||||||
|
this.targetGraph.zoomToFit()
|
||||||
|
}
|
||||||
|
|
||||||
this.updateViewport()
|
this.updateViewport()
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
protected updateViewport() {
|
protected updateViewport() {
|
||||||
const ratio = this.ratio
|
const sourceGraphScale = this.sourceGraph.transform.getScale()
|
||||||
const scale = this.sourceGraph.transform.getScale()
|
const targetGraphScale = this.targetGraph.transform.getScale()
|
||||||
|
|
||||||
let origin = null
|
let origin = null
|
||||||
if (this.scroller) {
|
if (this.scroller) {
|
||||||
origin = this.scroller.clientToLocalPoint(0, 0)
|
origin = this.scroller.clientToLocalPoint(0, 0)
|
||||||
} else {
|
} else {
|
||||||
const ctm = this.sourceGraph.matrix()
|
origin = this.graph.graphToLocal(0, 0)
|
||||||
origin = new Point(-ctm.e / ctm.a, -ctm.f / ctm.d)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const position = this.$(this.targetGraph.container).position()
|
const position = this.$(this.targetGraph.container).position()
|
||||||
@@ -222,10 +227,14 @@ export class MiniMap extends View {
|
|||||||
translation.ty = translation.ty || 0
|
translation.ty = translation.ty || 0
|
||||||
|
|
||||||
this.geometry = {
|
this.geometry = {
|
||||||
top: position.top + origin.y * ratio + translation.ty,
|
top: position.top + origin.y * targetGraphScale.sy + translation.ty,
|
||||||
left: position.left + origin.x * ratio + translation.tx,
|
left: position.left + origin.x * targetGraphScale.sx + translation.tx,
|
||||||
width: (this.$graphContainer.innerWidth()! * ratio) / scale.sx,
|
width:
|
||||||
height: (this.$graphContainer.innerHeight()! * ratio) / scale.sy,
|
(this.$graphContainer.innerWidth()! * targetGraphScale.sx) /
|
||||||
|
sourceGraphScale.sx,
|
||||||
|
height:
|
||||||
|
(this.$graphContainer.innerHeight()! * targetGraphScale.sy) /
|
||||||
|
sourceGraphScale.sy,
|
||||||
}
|
}
|
||||||
this.$viewport.css(this.geometry)
|
this.$viewport.css(this.geometry)
|
||||||
}
|
}
|
||||||
|
@@ -396,12 +396,76 @@ export class Scroller extends View {
|
|||||||
gridWidth: this.options.pageWidth,
|
gridWidth: this.options.pageWidth,
|
||||||
gridHeight: this.options.pageHeight,
|
gridHeight: this.options.pageHeight,
|
||||||
allowNewOrigin: 'negative',
|
allowNewOrigin: 'negative',
|
||||||
|
contentArea: this.calcContextArea(resizeOptions),
|
||||||
...resizeOptions,
|
...resizeOptions,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.graph.fitToContent(this.getFitToContentOptions(options))
|
this.graph.fitToContent(this.getFitToContentOptions(options))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected calcContextArea(
|
||||||
|
resizeOptions:
|
||||||
|
| (TransformManager.FitToContentFullOptions & {
|
||||||
|
direction:
|
||||||
|
| Scroller.AutoResizeDirection
|
||||||
|
| Scroller.AutoResizeDirection[]
|
||||||
|
})
|
||||||
|
| undefined,
|
||||||
|
) {
|
||||||
|
const direction = resizeOptions?.direction
|
||||||
|
|
||||||
|
if (!direction) {
|
||||||
|
return this.graph.transform.getContentArea()
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCellBBox(cell: Cell) {
|
||||||
|
let rect = cell.getBBox()
|
||||||
|
if (rect) {
|
||||||
|
if (cell.isNode()) {
|
||||||
|
const angle = cell.getAngle()
|
||||||
|
if (angle != null && angle !== 0) {
|
||||||
|
rect = rect.bbox(angle)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rect
|
||||||
|
}
|
||||||
|
|
||||||
|
const gridWidth = this.options.pageWidth || 1
|
||||||
|
const gridHeight = this.options.pageHeight || 1
|
||||||
|
let calculativeCells = this.graph.getCells()
|
||||||
|
|
||||||
|
if (!direction.includes('top')) {
|
||||||
|
calculativeCells = calculativeCells.filter((cell) => {
|
||||||
|
const bbox = getCellBBox(cell)
|
||||||
|
return bbox.y >= 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!direction.includes('left')) {
|
||||||
|
calculativeCells = calculativeCells.filter((cell) => {
|
||||||
|
const bbox = getCellBBox(cell)
|
||||||
|
return bbox.x >= 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!direction.includes('right')) {
|
||||||
|
calculativeCells = calculativeCells.filter((cell) => {
|
||||||
|
const bbox = getCellBBox(cell)
|
||||||
|
return bbox.x + bbox.width <= gridWidth
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!direction.includes('bottom')) {
|
||||||
|
calculativeCells = calculativeCells.filter((cell) => {
|
||||||
|
const bbox = getCellBBox(cell)
|
||||||
|
return bbox.y + bbox.height <= gridHeight
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.model.getCellsBBox(calculativeCells) || new Rectangle()
|
||||||
|
}
|
||||||
|
|
||||||
protected getFitToContentOptions(
|
protected getFitToContentOptions(
|
||||||
options: TransformManager.FitToContentFullOptions,
|
options: TransformManager.FitToContentFullOptions,
|
||||||
) {
|
) {
|
||||||
@@ -1021,8 +1085,8 @@ export class Scroller extends View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resize(width?: number, height?: number) {
|
resize(width?: number, height?: number) {
|
||||||
let w = width != null ? width : this.container.clientWidth
|
let w = width != null ? width : this.container.offsetWidth
|
||||||
let h = height != null ? height : this.container.clientHeight
|
let h = height != null ? height : this.container.offsetHeight
|
||||||
|
|
||||||
if (typeof w === 'number') {
|
if (typeof w === 'number') {
|
||||||
w = Math.round(w)
|
w = Math.round(w)
|
||||||
@@ -1201,17 +1265,25 @@ export namespace Scroller {
|
|||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
fitTocontentOptions?:
|
fitTocontentOptions?:
|
||||||
| TransformManager.FitToContentFullOptions
|
| (TransformManager.FitToContentFullOptions & {
|
||||||
|
direction: AutoResizeDirection | AutoResizeDirection[]
|
||||||
|
})
|
||||||
| ((
|
| ((
|
||||||
this: Scroller,
|
this: Scroller,
|
||||||
scroller: Scroller,
|
scroller: Scroller,
|
||||||
) => TransformManager.FitToContentFullOptions)
|
) => TransformManager.FitToContentFullOptions & {
|
||||||
|
direction: AutoResizeDirection | AutoResizeDirection[]
|
||||||
|
})
|
||||||
autoResizeOptions?:
|
autoResizeOptions?:
|
||||||
| TransformManager.FitToContentFullOptions
|
| (TransformManager.FitToContentFullOptions & {
|
||||||
|
direction: AutoResizeDirection | AutoResizeDirection[]
|
||||||
|
})
|
||||||
| ((
|
| ((
|
||||||
this: Scroller,
|
this: Scroller,
|
||||||
scroller: Scroller,
|
scroller: Scroller,
|
||||||
) => TransformManager.FitToContentFullOptions)
|
) => TransformManager.FitToContentFullOptions & {
|
||||||
|
direction: AutoResizeDirection | AutoResizeDirection[]
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Options extends CommonOptions {
|
export interface Options extends CommonOptions {
|
||||||
@@ -1258,6 +1330,8 @@ export namespace Scroller {
|
|||||||
visibility?: number
|
visibility?: number
|
||||||
center?: Point.PointLike
|
center?: Point.PointLike
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type AutoResizeDirection = 'top' | 'right' | 'bottom' | 'left'
|
||||||
}
|
}
|
||||||
|
|
||||||
export namespace Scroller {
|
export namespace Scroller {
|
||||||
|
@@ -125,7 +125,7 @@ export class Selection extends View<Selection.EventArgs> {
|
|||||||
options,
|
options,
|
||||||
}: Collection.EventArgs['node:change:position']) {
|
}: Collection.EventArgs['node:change:position']) {
|
||||||
const { showNodeSelectionBox, pointerEvents } = this.options
|
const { showNodeSelectionBox, pointerEvents } = this.options
|
||||||
const { ui, selection } = options
|
const { ui, selection, translateBy } = options
|
||||||
let allowTranslating = !this.translating
|
let allowTranslating = !this.translating
|
||||||
|
|
||||||
/* Scenarios where this method is not called:
|
/* Scenarios where this method is not called:
|
||||||
@@ -137,6 +137,10 @@ export class Selection extends View<Selection.EventArgs> {
|
|||||||
(showNodeSelectionBox !== true || pointerEvents === 'none')
|
(showNodeSelectionBox !== true || pointerEvents === 'none')
|
||||||
allowTranslating = allowTranslating && ui && !selection
|
allowTranslating = allowTranslating && ui && !selection
|
||||||
|
|
||||||
|
// Avoid circular calls of child nodes
|
||||||
|
allowTranslating =
|
||||||
|
allowTranslating && translateBy && node.id === translateBy
|
||||||
|
|
||||||
if (allowTranslating) {
|
if (allowTranslating) {
|
||||||
this.translating = true
|
this.translating = true
|
||||||
const current = node.position()
|
const current = node.position()
|
||||||
@@ -289,6 +293,7 @@ export class Selection extends View<Selection.EventArgs> {
|
|||||||
offsetY: y,
|
offsetY: y,
|
||||||
scrollerX: 0,
|
scrollerX: 0,
|
||||||
scrollerY: 0,
|
scrollerY: 0,
|
||||||
|
moving: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
this.delegateDocumentEvents(Private.documentEvents, evt.data)
|
this.delegateDocumentEvents(Private.documentEvents, evt.data)
|
||||||
@@ -893,7 +898,7 @@ export class Selection extends View<Selection.EventArgs> {
|
|||||||
added,
|
added,
|
||||||
removed,
|
removed,
|
||||||
options,
|
options,
|
||||||
selected: this.cells,
|
selected: this.cells.filter((cell) => !!this.graph.getCellById(cell.id)),
|
||||||
}
|
}
|
||||||
this.trigger('selection:changed', args)
|
this.trigger('selection:changed', args)
|
||||||
this.graph.trigger('selection:changed', args)
|
this.graph.trigger('selection:changed', args)
|
||||||
|
@@ -12,16 +12,7 @@
|
|||||||
|
|
||||||
&-vertical,
|
&-vertical,
|
||||||
&-horizontal {
|
&-horizontal {
|
||||||
position: absolute;
|
stroke: #2ecc71;
|
||||||
opacity: 1;
|
stroke-width: 1px;
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-horizontal {
|
|
||||||
border-bottom: 1px solid #2ecc71;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-vertical {
|
|
||||||
border-right: 1px solid #2ecc71;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,13 +1,14 @@
|
|||||||
import { ArrayExt, FunctionExt } from '../../util'
|
|
||||||
import { IDisablable } from '../../common'
|
import { IDisablable } from '../../common'
|
||||||
import { Point, Rectangle, Angle } from '../../geometry'
|
import { Angle, Point, Rectangle } from '../../geometry'
|
||||||
import { Node } from '../../model/node'
|
|
||||||
import { Model } from '../../model/model'
|
|
||||||
import { View } from '../../view/view'
|
|
||||||
import { CellView } from '../../view/cell'
|
|
||||||
import { NodeView } from '../../view/node'
|
|
||||||
import { Graph } from '../../graph'
|
import { Graph } from '../../graph'
|
||||||
import { EventArgs } from '../../graph/events'
|
import { EventArgs } from '../../graph/events'
|
||||||
|
import { Model } from '../../model/model'
|
||||||
|
import { Node } from '../../model/node'
|
||||||
|
import { ArrayExt, FunctionExt } from '../../util'
|
||||||
|
import { Vector } from '../../util/vector'
|
||||||
|
import { CellView } from '../../view/cell'
|
||||||
|
import { NodeView } from '../../view/node'
|
||||||
|
import { View } from '../../view/view'
|
||||||
|
|
||||||
export class Snapline extends View implements IDisablable {
|
export class Snapline extends View implements IDisablable {
|
||||||
public readonly options: Snapline.Options
|
public readonly options: Snapline.Options
|
||||||
@@ -17,9 +18,11 @@ export class Snapline extends View implements IDisablable {
|
|||||||
protected filterFunction: Snapline.FilterFunction | null
|
protected filterFunction: Snapline.FilterFunction | null
|
||||||
protected offset: Point.PointLike
|
protected offset: Point.PointLike
|
||||||
protected timer: number | null
|
protected timer: number | null
|
||||||
protected $container: JQuery<HTMLElement>
|
|
||||||
protected $horizontal: JQuery<HTMLElement>
|
public container: SVGElement
|
||||||
protected $vertical: JQuery<HTMLElement>
|
protected containerWrapper: Vector
|
||||||
|
protected horizontal: Vector
|
||||||
|
protected vertical: Vector
|
||||||
|
|
||||||
protected get model() {
|
protected get model() {
|
||||||
return this.graph.model
|
return this.graph.model
|
||||||
@@ -43,6 +46,7 @@ export class Snapline extends View implements IDisablable {
|
|||||||
const { graph, ...others } = options
|
const { graph, ...others } = options
|
||||||
this.graph = graph
|
this.graph = graph
|
||||||
this.options = { tolerance: 10, ...others }
|
this.options = { tolerance: 10, ...others }
|
||||||
|
this.offset = { x: 0, y: 0 }
|
||||||
this.render()
|
this.render()
|
||||||
this.parseFilter()
|
this.parseFilter()
|
||||||
if (!this.disabled) {
|
if (!this.disabled) {
|
||||||
@@ -79,23 +83,27 @@ export class Snapline extends View implements IDisablable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
this.container = document.createElement('div')
|
const container = (this.containerWrapper = new Vector('svg'))
|
||||||
this.$container = this.$(this.container)
|
const horizontal = (this.horizontal = new Vector('path'))
|
||||||
this.$horizontal = this.$(document.createElement('div')).addClass(
|
const vertical = (this.vertical = new Vector('path'))
|
||||||
this.horizontalClassName,
|
|
||||||
)
|
|
||||||
this.$vertical = this.$(document.createElement('div')).addClass(
|
|
||||||
this.verticalClassName,
|
|
||||||
)
|
|
||||||
|
|
||||||
this.$container
|
container.addClass(this.containerClassName)
|
||||||
.hide()
|
horizontal.addClass(this.horizontalClassName)
|
||||||
.addClass(this.containerClassName)
|
vertical.addClass(this.verticalClassName)
|
||||||
.append([this.$horizontal, this.$vertical])
|
|
||||||
|
container.setAttribute('width', '100%')
|
||||||
|
container.setAttribute('height', '100%')
|
||||||
|
|
||||||
|
horizontal.setAttribute('display', 'none')
|
||||||
|
vertical.setAttribute('display', 'none')
|
||||||
|
|
||||||
|
container.append([horizontal, vertical])
|
||||||
|
|
||||||
if (this.options.className) {
|
if (this.options.className) {
|
||||||
this.$container.addClass(this.options.className)
|
container.addClass(this.options.className)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.container = this.containerWrapper.node
|
||||||
}
|
}
|
||||||
|
|
||||||
protected startListening() {
|
protected startListening() {
|
||||||
@@ -566,53 +574,41 @@ export class Snapline extends View implements IDisablable {
|
|||||||
horizontalLeft?: number
|
horizontalLeft?: number
|
||||||
horizontalWidth?: number
|
horizontalWidth?: number
|
||||||
}) {
|
}) {
|
||||||
const ctm = this.graph.matrix()
|
// https://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations
|
||||||
const sx = ctm.a
|
|
||||||
const sy = ctm.d
|
|
||||||
const tx = ctm.e
|
|
||||||
const ty = ctm.f
|
|
||||||
|
|
||||||
const sharp = this.options.sharp
|
|
||||||
const hasScroller = this.graph.scroller.widget != null
|
|
||||||
|
|
||||||
if (metadata.horizontalTop) {
|
if (metadata.horizontalTop) {
|
||||||
this.$horizontal
|
const start = this.graph.localToGraph(
|
||||||
.css({
|
new Point(metadata.horizontalLeft, metadata.horizontalTop),
|
||||||
top: metadata.horizontalTop * sy + ty,
|
)
|
||||||
left: sharp
|
const end = this.graph.localToGraph(
|
||||||
? metadata.horizontalLeft! * sx + tx
|
new Point(
|
||||||
: hasScroller
|
metadata.horizontalLeft! + metadata.horizontalWidth!,
|
||||||
? '-300%'
|
metadata.horizontalTop,
|
||||||
: 0,
|
),
|
||||||
width: sharp
|
)
|
||||||
? metadata.horizontalWidth! * sx
|
this.horizontal.setAttributes({
|
||||||
: hasScroller
|
d: `M ${start.x},${start.y} L ${end.x},${end.y}`,
|
||||||
? '700%'
|
display: 'inherit',
|
||||||
: '100%',
|
|
||||||
})
|
})
|
||||||
.show()
|
|
||||||
} else {
|
} else {
|
||||||
this.$horizontal.hide()
|
this.horizontal.setAttribute('display', 'none')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (metadata.verticalLeft) {
|
if (metadata.verticalLeft) {
|
||||||
this.$vertical
|
const start = this.graph.localToGraph(
|
||||||
.css({
|
new Point(metadata.verticalLeft, metadata.verticalTop),
|
||||||
left: metadata.verticalLeft * sx + tx,
|
)
|
||||||
top: sharp
|
const end = this.graph.localToGraph(
|
||||||
? metadata.verticalTop! * sy + ty
|
new Point(
|
||||||
: hasScroller
|
metadata.verticalLeft,
|
||||||
? '-300%'
|
metadata.verticalTop! + metadata.verticalHeight!,
|
||||||
: 0,
|
),
|
||||||
height: sharp
|
)
|
||||||
? metadata.verticalHeight! * sy
|
this.vertical.setAttributes({
|
||||||
: hasScroller
|
d: `M ${start.x},${start.y} L ${end.x},${end.y}`,
|
||||||
? '700%'
|
display: 'inherit',
|
||||||
: '100%',
|
|
||||||
})
|
})
|
||||||
.show()
|
|
||||||
} else {
|
} else {
|
||||||
this.$vertical.hide()
|
this.vertical.setAttribute('display', 'none')
|
||||||
}
|
}
|
||||||
|
|
||||||
this.show()
|
this.show()
|
||||||
@@ -626,7 +622,6 @@ export class Snapline extends View implements IDisablable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this.$container.show()
|
|
||||||
this.resetTimer()
|
this.resetTimer()
|
||||||
if (this.container.parentNode == null) {
|
if (this.container.parentNode == null) {
|
||||||
this.graph.container.appendChild(this.container)
|
this.graph.container.appendChild(this.container)
|
||||||
@@ -635,16 +630,18 @@ export class Snapline extends View implements IDisablable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this.$container.hide()
|
|
||||||
this.resetTimer()
|
this.resetTimer()
|
||||||
|
this.vertical.setAttribute('display', 'none')
|
||||||
|
this.horizontal.setAttribute('display', 'none')
|
||||||
const clean = this.options.clean
|
const clean = this.options.clean
|
||||||
const delay = typeof clean === 'number' ? clean : clean !== false ? 3000 : 0
|
const delay = typeof clean === 'number' ? clean : clean !== false ? 3000 : 0
|
||||||
if (delay > 0) {
|
if (delay > 0) {
|
||||||
this.timer = window.setTimeout(() => {
|
this.timer = window.setTimeout(() => {
|
||||||
|
if (this.container.parentNode !== null) {
|
||||||
this.unmount()
|
this.unmount()
|
||||||
|
}
|
||||||
}, delay)
|
}, delay)
|
||||||
}
|
}
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -664,6 +661,14 @@ export namespace Snapline {
|
|||||||
enabled?: boolean
|
enabled?: boolean
|
||||||
className?: string
|
className?: string
|
||||||
tolerance?: number
|
tolerance?: number
|
||||||
|
/**
|
||||||
|
* @deprecated The behavior is now to clamp snaplines to the elements
|
||||||
|
* that are being aligned (instead of them spanning the entire graph),
|
||||||
|
* equivalent to `sharp: true`. The `sharp` option will be removed in a future release.
|
||||||
|
*
|
||||||
|
* @deprecated 对齐线将默认在对齐的元素边界截断,而不是跨越整个图的横轴/纵轴;相当于 `sharp: true`.
|
||||||
|
* `sharp` 选项将在之后的版本中去除。
|
||||||
|
*/
|
||||||
sharp?: boolean
|
sharp?: boolean
|
||||||
/**
|
/**
|
||||||
* Specify if snap on node resizing or not.
|
* Specify if snap on node resizing or not.
|
||||||
|
@@ -436,6 +436,7 @@ export class Transform extends Widget<Transform.Options> {
|
|||||||
if (options.rotateGrid) {
|
if (options.rotateGrid) {
|
||||||
target = Util.snapToGrid(target, options.rotateGrid)
|
target = Util.snapToGrid(target, options.rotateGrid)
|
||||||
}
|
}
|
||||||
|
target = Angle.normalize(target)
|
||||||
|
|
||||||
if (currentAngle !== target) {
|
if (currentAngle !== target) {
|
||||||
node.rotate(target, { absolute: true })
|
node.rotate(target, { absolute: true })
|
||||||
|
@@ -3,5 +3,5 @@
|
|||||||
/**
|
/**
|
||||||
* Auto generated version file, do not modify it!
|
* Auto generated version file, do not modify it!
|
||||||
*/
|
*/
|
||||||
const version = '1.30.2'
|
const version = '1.33.1'
|
||||||
export { version }
|
export { version }
|
||||||
|
@@ -47,6 +47,7 @@ export class ClipboardManager extends Base implements IDisablable {
|
|||||||
...this.commonOptions,
|
...this.commonOptions,
|
||||||
...options,
|
...options,
|
||||||
})
|
})
|
||||||
|
this.graph.trigger('clipboard:changed', { cells })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,6 +57,7 @@ export class ClipboardManager extends Base implements IDisablable {
|
|||||||
...this.commonOptions,
|
...this.commonOptions,
|
||||||
...options,
|
...options,
|
||||||
})
|
})
|
||||||
|
this.graph.trigger('clipboard:changed', { cells })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,6 +74,7 @@ export class ClipboardManager extends Base implements IDisablable {
|
|||||||
clean(force?: boolean) {
|
clean(force?: boolean) {
|
||||||
if (!this.disabled || force) {
|
if (!this.disabled || force) {
|
||||||
this.widget.clean()
|
this.widget.clean()
|
||||||
|
this.graph.trigger('clipboard:changed', { cells: [] })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,6 +89,12 @@ export class ClipboardManager extends Base implements IDisablable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export namespace ClipboardManager {
|
export namespace ClipboardManager {
|
||||||
|
export interface ClipboardEventArgs {
|
||||||
|
'clipboard:changed': {
|
||||||
|
cells: Cell[]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export interface Options extends Clipboard.Options {
|
export interface Options extends Clipboard.Options {
|
||||||
enabled?: boolean
|
enabled?: boolean
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
import { Model } from '../model'
|
import { Model } from '../model'
|
||||||
import { CellView } from '../view'
|
import { CellView } from '../view'
|
||||||
import { Selection } from '../addon/selection'
|
import { Selection } from '../addon/selection'
|
||||||
|
import { ClipboardManager } from './clipboard'
|
||||||
import { Renderer } from './renderer'
|
import { Renderer } from './renderer'
|
||||||
|
|
||||||
interface CommonEventArgs<E> {
|
interface CommonEventArgs<E> {
|
||||||
@@ -15,7 +16,8 @@ interface PositionEventArgs<E> extends CommonEventArgs<E> {
|
|||||||
export interface EventArgs
|
export interface EventArgs
|
||||||
extends Omit<Model.EventArgs, 'sorted' | 'updated' | 'reseted'>,
|
extends Omit<Model.EventArgs, 'sorted' | 'updated' | 'reseted'>,
|
||||||
CellView.EventArgs,
|
CellView.EventArgs,
|
||||||
Selection.SelectionEventArgs {
|
Selection.SelectionEventArgs,
|
||||||
|
ClipboardManager.ClipboardEventArgs {
|
||||||
'model:sorted'?: Model.EventArgs['sorted']
|
'model:sorted'?: Model.EventArgs['sorted']
|
||||||
'model:updated': Model.EventArgs['updated']
|
'model:updated': Model.EventArgs['updated']
|
||||||
'model:reseted': Model.EventArgs['reseted']
|
'model:reseted': Model.EventArgs['reseted']
|
||||||
|
@@ -109,6 +109,7 @@ export class FormatManager extends Base {
|
|||||||
|
|
||||||
Object.keys(computedStyle).forEach((property) => {
|
Object.keys(computedStyle).forEach((property) => {
|
||||||
if (
|
if (
|
||||||
|
!NumberExt.isNumeric(property) &&
|
||||||
computedStyle.getPropertyValue(property) !==
|
computedStyle.getPropertyValue(property) !==
|
||||||
defaultComputedStyle[property]
|
defaultComputedStyle[property]
|
||||||
) {
|
) {
|
||||||
|
@@ -691,6 +691,8 @@ export class Graph extends Basecoat<EventArgs> {
|
|||||||
} else {
|
} else {
|
||||||
this.transform.zoom(factor, { ...options, absolute: true })
|
this.transform.zoom(factor, { ...options, absolute: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
zoomToRect(
|
zoomToRect(
|
||||||
@@ -1880,20 +1882,36 @@ export class Graph extends Basecoat<EventArgs> {
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
* @see Snapline.Options.sharp
|
||||||
|
*/
|
||||||
isSharpSnapline() {
|
isSharpSnapline() {
|
||||||
return this.snapline.widget.options.sharp === true
|
return this.snapline.widget.options.sharp === true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
* @see Snapline.Options.sharp
|
||||||
|
*/
|
||||||
enableSharpSnapline() {
|
enableSharpSnapline() {
|
||||||
this.snapline.widget.options.sharp = true
|
this.snapline.widget.options.sharp = true
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
* @see Snapline.Options.sharp
|
||||||
|
*/
|
||||||
disableSharpSnapline() {
|
disableSharpSnapline() {
|
||||||
this.snapline.widget.options.sharp = false
|
this.snapline.widget.options.sharp = false
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
* @see Snapline.Options.sharp
|
||||||
|
*/
|
||||||
toggleSharpSnapline(sharp?: boolean) {
|
toggleSharpSnapline(sharp?: boolean) {
|
||||||
if (sharp != null) {
|
if (sharp != null) {
|
||||||
if (sharp !== this.isSharpSnapline()) {
|
if (sharp !== this.isSharpSnapline()) {
|
||||||
|
@@ -398,6 +398,7 @@ export class HistoryManager
|
|||||||
if (cmds.length > 0) {
|
if (cmds.length > 0) {
|
||||||
this.redoStack = []
|
this.redoStack = []
|
||||||
this.undoStack.push(cmds)
|
this.undoStack.push(cmds)
|
||||||
|
this.consolidateCommands()
|
||||||
this.notify('add', cmds, options)
|
this.notify('add', cmds, options)
|
||||||
}
|
}
|
||||||
this.batchCommands = null
|
this.batchCommands = null
|
||||||
@@ -469,9 +470,66 @@ export class HistoryManager
|
|||||||
this.emit('batch', { cmd, options })
|
this.emit('batch', { cmd, options })
|
||||||
} else {
|
} else {
|
||||||
this.undoStack.push(cmd)
|
this.undoStack.push(cmd)
|
||||||
|
this.consolidateCommands()
|
||||||
this.notify('add', cmd, options)
|
this.notify('add', cmd, options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Conditionally combine multiple undo items into one.
|
||||||
|
*
|
||||||
|
* Currently this is only used combine a `cell:changed:position` event
|
||||||
|
* followed by multiple `cell:change:parent` and `cell:change:children`
|
||||||
|
* events, such that a "move + embed" action can be undone in one step.
|
||||||
|
*
|
||||||
|
* See https://github.com/antvis/X6/issues/2421
|
||||||
|
*
|
||||||
|
* This is an ugly WORKAROUND. It does not solve deficiencies in the batch
|
||||||
|
* system itself.
|
||||||
|
*/
|
||||||
|
private consolidateCommands() {
|
||||||
|
const lastCommandGroup = this.undoStack[this.undoStack.length - 1]
|
||||||
|
const penultimateCommandGroup = this.undoStack[this.undoStack.length - 2]
|
||||||
|
|
||||||
|
// We are looking for at least one cell:change:parent
|
||||||
|
// and one cell:change:children
|
||||||
|
if (!Array.isArray(lastCommandGroup)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const eventTypes = new Set(lastCommandGroup.map((cmd) => cmd.event))
|
||||||
|
if (
|
||||||
|
eventTypes.size !== 2 ||
|
||||||
|
!eventTypes.has('cell:change:parent') ||
|
||||||
|
!eventTypes.has('cell:change:children')
|
||||||
|
) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// We are looking for events from user interactions
|
||||||
|
if (!lastCommandGroup.every((cmd) => cmd.batch && cmd.options?.ui)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// We are looking for a command group with exactly one event, whose event
|
||||||
|
// type is cell:change:position, and is from user interactions
|
||||||
|
if (
|
||||||
|
!Array.isArray(penultimateCommandGroup) ||
|
||||||
|
penultimateCommandGroup.length !== 1
|
||||||
|
) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const maybePositionChange = penultimateCommandGroup[0]
|
||||||
|
if (
|
||||||
|
maybePositionChange.event !== 'cell:change:position' ||
|
||||||
|
!maybePositionChange.options?.ui
|
||||||
|
) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Actually consolidating the commands we get
|
||||||
|
penultimateCommandGroup.push(...lastCommandGroup)
|
||||||
|
this.undoStack.pop()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export namespace HistoryManager {
|
export namespace HistoryManager {
|
||||||
|
@@ -553,13 +553,13 @@ export class Hook extends Base implements Hook.IHook {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (valid && allowNode != null) {
|
// When judging nodes, the influence of the ports should be excluded,
|
||||||
|
// because the ports and nodes have the same terminalView
|
||||||
|
if (valid && allowNode != null && terminalMagnet == null) {
|
||||||
if (typeof allowNode === 'boolean') {
|
if (typeof allowNode === 'boolean') {
|
||||||
if (!allowNode && terminalView != null) {
|
if (!allowNode && NodeView.isNodeView(terminalView)) {
|
||||||
if (NodeView.isNodeView(terminalView) && terminalMagnet == null) {
|
|
||||||
valid = false
|
valid = false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
valid = doValidate(allowNode)
|
valid = doValidate(allowNode)
|
||||||
}
|
}
|
||||||
|
@@ -106,8 +106,13 @@ export class Keyboard extends Disposable implements IDisablable {
|
|||||||
|
|
||||||
protected isGraphEvent(e: KeyboardEvent) {
|
protected isGraphEvent(e: KeyboardEvent) {
|
||||||
const target = (e.srcElement || e.target) as Element
|
const target = (e.srcElement || e.target) as Element
|
||||||
|
const currentTarget = e.currentTarget as Element
|
||||||
if (target) {
|
if (target) {
|
||||||
if (target === this.target || target === document.body) {
|
if (
|
||||||
|
target === this.target ||
|
||||||
|
currentTarget === this.target ||
|
||||||
|
target === document.body
|
||||||
|
) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,8 +124,8 @@ export class Keyboard extends Disposable implements IDisablable {
|
|||||||
|
|
||||||
isInputEvent(e: KeyboardEvent | JQuery.MouseUpEvent) {
|
isInputEvent(e: KeyboardEvent | JQuery.MouseUpEvent) {
|
||||||
const target = e.target as Element
|
const target = e.target as Element
|
||||||
const tagName = target && target.tagName.toLowerCase()
|
const tagName = target?.tagName?.toLowerCase()
|
||||||
return tagName === 'input'
|
return ['input', 'textarea'].includes(tagName)
|
||||||
}
|
}
|
||||||
|
|
||||||
isEnabledForEvent(e: KeyboardEvent) {
|
isEnabledForEvent(e: KeyboardEvent) {
|
||||||
|
@@ -135,14 +135,17 @@ export class MouseWheel extends Disposable implements IDisablable {
|
|||||||
} else {
|
} else {
|
||||||
scroller.zoom(targetScale, { absolute: true })
|
scroller.zoom(targetScale, { absolute: true })
|
||||||
}
|
}
|
||||||
} else if (this.options.zoomAtMousePosition) {
|
} else {
|
||||||
|
if (this.options.zoomAtMousePosition) {
|
||||||
const origin = this.graph.coord.clientToGraphPoint(this.startPos)
|
const origin = this.graph.coord.clientToGraphPoint(this.startPos)
|
||||||
this.graph.zoom(targetScale, {
|
this.graph.transform.zoom(targetScale, {
|
||||||
absolute: true,
|
absolute: true,
|
||||||
center: origin.clone(),
|
center: origin.clone(),
|
||||||
|
ui: true,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.graph.zoom(targetScale, { absolute: true })
|
this.graph.transform.zoom(targetScale, { absolute: true, ui: true })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.currentScale = null
|
this.currentScale = null
|
||||||
|
@@ -130,7 +130,9 @@ export namespace Options {
|
|||||||
/**
|
/**
|
||||||
* Prevent the default context menu from being displayed.
|
* Prevent the default context menu from being displayed.
|
||||||
*/
|
*/
|
||||||
preventDefaultContextMenu: boolean
|
preventDefaultContextMenu:
|
||||||
|
| boolean
|
||||||
|
| ((this: Graph, { view }: { view: CellView | null }) => boolean)
|
||||||
|
|
||||||
preventDefaultDblClick: boolean
|
preventDefaultDblClick: boolean
|
||||||
|
|
||||||
@@ -731,6 +733,7 @@ export namespace Options {
|
|||||||
rubberEdge: false, // next version will set to true
|
rubberEdge: false, // next version will set to true
|
||||||
pointerEvents: 'auto',
|
pointerEvents: 'auto',
|
||||||
multiple: true,
|
multiple: true,
|
||||||
|
multipleSelectionModifiers: ['ctrl', 'meta'],
|
||||||
movable: true,
|
movable: true,
|
||||||
strict: false,
|
strict: false,
|
||||||
useCellGeometry: false,
|
useCellGeometry: false,
|
||||||
|
@@ -102,7 +102,10 @@ export class PanningManager extends Base {
|
|||||||
const dy = e.clientY - this.clientY
|
const dy = e.clientY - this.clientY
|
||||||
this.clientX = e.clientX
|
this.clientX = e.clientX
|
||||||
this.clientY = e.clientY
|
this.clientY = e.clientY
|
||||||
this.graph.translateBy(dx, dy)
|
const ts = this.graph.transform.getTranslation()
|
||||||
|
const tx = ts.tx + dx
|
||||||
|
const ty = ts.ty + dy
|
||||||
|
this.graph.transform.translate(tx, ty, { ui: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
|
@@ -162,6 +162,8 @@ export class Renderer extends Base {
|
|||||||
if (visible) {
|
if (visible) {
|
||||||
this.processEdgeOnTerminalVisibleChanged(cell, true)
|
this.processEdgeOnTerminalVisibleChanged(cell, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this.sortViews()
|
||||||
}
|
}
|
||||||
|
|
||||||
protected processEdgeOnTerminalVisibleChanged(node: Cell, visible: boolean) {
|
protected processEdgeOnTerminalVisibleChanged(node: Cell, visible: boolean) {
|
||||||
|
@@ -76,6 +76,13 @@ export class SelectionManager extends Base {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
allowMultipleSelection(e: JQuery.MouseDownEvent | JQuery.MouseUpEvent) {
|
||||||
|
return (
|
||||||
|
this.isMultiple() &&
|
||||||
|
ModifierKey.isMatch(e, this.widgetOptions.multipleSelectionModifiers)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
protected onCellMouseMove({ cell }: EventArgs['cell:mousemove']) {
|
protected onCellMouseMove({ cell }: EventArgs['cell:mousemove']) {
|
||||||
this.movedMap.set(cell, true)
|
this.movedMap.set(cell, true)
|
||||||
}
|
}
|
||||||
@@ -96,7 +103,7 @@ export class SelectionManager extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!disabled) {
|
if (!disabled) {
|
||||||
if (options.multiple === false || (!e.ctrlKey && !e.metaKey)) {
|
if (!this.allowMultipleSelection(e)) {
|
||||||
this.reset(cell)
|
this.reset(cell)
|
||||||
} else if (this.unselectMap.has(cell)) {
|
} else if (this.unselectMap.has(cell)) {
|
||||||
this.unselectMap.delete(cell)
|
this.unselectMap.delete(cell)
|
||||||
@@ -112,7 +119,7 @@ export class SelectionManager extends Base {
|
|||||||
|
|
||||||
protected onBoxMouseDown({ e, cell }: Selection.EventArgs['box:mousedown']) {
|
protected onBoxMouseDown({ e, cell }: Selection.EventArgs['box:mousedown']) {
|
||||||
if (!this.disabled) {
|
if (!this.disabled) {
|
||||||
if (this.widgetOptions.multiple !== false && (e.ctrlKey || e.metaKey)) {
|
if (this.allowMultipleSelection(e)) {
|
||||||
this.unselect(cell)
|
this.unselect(cell)
|
||||||
this.unselectMap.set(cell, true)
|
this.unselectMap.set(cell, true)
|
||||||
}
|
}
|
||||||
@@ -256,6 +263,7 @@ export namespace SelectionManager {
|
|||||||
rubberband?: boolean
|
rubberband?: boolean
|
||||||
modifiers?: string | ModifierKey[] | null
|
modifiers?: string | ModifierKey[] | null
|
||||||
multiple?: boolean
|
multiple?: boolean
|
||||||
|
multipleSelectionModifiers?: string | ModifierKey[] | null
|
||||||
selectCellOnMoved?: boolean
|
selectCellOnMoved?: boolean
|
||||||
selectNodeOnMoved?: boolean
|
selectNodeOnMoved?: boolean
|
||||||
selectEdgeOnMoved?: boolean
|
selectEdgeOnMoved?: boolean
|
||||||
|
@@ -136,7 +136,13 @@ export class TransformManager extends Base {
|
|||||||
return Dom.matrixToScale(this.getMatrix())
|
return Dom.matrixToScale(this.getMatrix())
|
||||||
}
|
}
|
||||||
|
|
||||||
scale(sx: number, sy: number = sx, ox = 0, oy = 0) {
|
scale(
|
||||||
|
sx: number,
|
||||||
|
sy: number = sx,
|
||||||
|
ox = 0,
|
||||||
|
oy = 0,
|
||||||
|
options: TransformManager.TransformOptions = {},
|
||||||
|
) {
|
||||||
sx = this.clampScale(sx) // eslint-disable-line
|
sx = this.clampScale(sx) // eslint-disable-line
|
||||||
sy = this.clampScale(sy) // eslint-disable-line
|
sy = this.clampScale(sy) // eslint-disable-line
|
||||||
|
|
||||||
@@ -154,7 +160,7 @@ export class TransformManager extends Base {
|
|||||||
matrix.d = sy
|
matrix.d = sy
|
||||||
|
|
||||||
this.setMatrix(matrix)
|
this.setMatrix(matrix)
|
||||||
this.graph.trigger('scale', { sx, sy, ox, oy })
|
this.graph.trigger('scale', { sx, sy, ox, oy, ...options })
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +173,10 @@ export class TransformManager extends Base {
|
|||||||
return this.getScale().sx
|
return this.getScale().sx
|
||||||
}
|
}
|
||||||
|
|
||||||
zoom(factor: number, options?: TransformManager.ZoomOptions) {
|
zoom(
|
||||||
|
factor: number,
|
||||||
|
options?: TransformManager.ZoomOptions & TransformManager.TransformOptions,
|
||||||
|
) {
|
||||||
options = options || {} // eslint-disable-line
|
options = options || {} // eslint-disable-line
|
||||||
|
|
||||||
let sx = factor
|
let sx = factor
|
||||||
@@ -210,11 +219,11 @@ export class TransformManager extends Base {
|
|||||||
const tx = cx - (cx - ts.tx) * (sx / scale.sx)
|
const tx = cx - (cx - ts.tx) * (sx / scale.sx)
|
||||||
const ty = cy - (cy - ts.ty) * (sy / scale.sy)
|
const ty = cy - (cy - ts.ty) * (sy / scale.sy)
|
||||||
if (tx !== ts.tx || ty !== ts.ty) {
|
if (tx !== ts.tx || ty !== ts.ty) {
|
||||||
this.translate(tx, ty)
|
this.translate(tx, ty, { ui: options.ui })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.scale(sx, sy)
|
this.scale(sx, sy, 0, 0, { ui: options.ui })
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
@@ -242,7 +251,11 @@ export class TransformManager extends Base {
|
|||||||
return Dom.matrixToTranslation(this.getMatrix())
|
return Dom.matrixToTranslation(this.getMatrix())
|
||||||
}
|
}
|
||||||
|
|
||||||
translate(tx: number, ty: number) {
|
translate(
|
||||||
|
tx: number,
|
||||||
|
ty: number,
|
||||||
|
options: TransformManager.TransformOptions = {},
|
||||||
|
) {
|
||||||
const matrix = this.getMatrix()
|
const matrix = this.getMatrix()
|
||||||
matrix.e = tx || 0
|
matrix.e = tx || 0
|
||||||
matrix.f = ty || 0
|
matrix.f = ty || 0
|
||||||
@@ -250,7 +263,7 @@ export class TransformManager extends Base {
|
|||||||
const ts = this.getTranslation()
|
const ts = this.getTranslation()
|
||||||
this.options.x = ts.tx
|
this.options.x = ts.tx
|
||||||
this.options.y = ts.ty
|
this.options.y = ts.ty
|
||||||
this.graph.trigger('translate', { ...ts })
|
this.graph.trigger('translate', { ...ts, ...options })
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -594,6 +607,9 @@ export class TransformManager extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export namespace TransformManager {
|
export namespace TransformManager {
|
||||||
|
export interface TransformOptions {
|
||||||
|
ui?: boolean
|
||||||
|
}
|
||||||
export interface FitToContentOptions extends GetContentAreaOptions {
|
export interface FitToContentOptions extends GetContentAreaOptions {
|
||||||
minWidth?: number
|
minWidth?: number
|
||||||
minHeight?: number
|
minHeight?: number
|
||||||
|
@@ -139,13 +139,30 @@ export class GraphView extends View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected isPreventDefaultContextMenu(
|
||||||
|
evt: JQuery.ContextMenuEvent,
|
||||||
|
view: CellView | null,
|
||||||
|
) {
|
||||||
|
let preventDefaultContextMenu = this.options.preventDefaultContextMenu
|
||||||
|
if (typeof preventDefaultContextMenu === 'function') {
|
||||||
|
preventDefaultContextMenu = FunctionExt.call(
|
||||||
|
preventDefaultContextMenu,
|
||||||
|
this.graph,
|
||||||
|
{ view },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return preventDefaultContextMenu
|
||||||
|
}
|
||||||
|
|
||||||
protected onContextMenu(evt: JQuery.ContextMenuEvent) {
|
protected onContextMenu(evt: JQuery.ContextMenuEvent) {
|
||||||
if (this.options.preventDefaultContextMenu) {
|
const e = this.normalizeEvent(evt)
|
||||||
|
const view = this.findView(e.target)
|
||||||
|
|
||||||
|
if (this.isPreventDefaultContextMenu(e, view)) {
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
const e = this.normalizeEvent(evt)
|
|
||||||
const view = this.findView(e.target)
|
|
||||||
if (this.guard(e, view)) {
|
if (this.guard(e, view)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -201,7 +218,10 @@ export class GraphView extends View {
|
|||||||
if (view) {
|
if (view) {
|
||||||
view.onMouseDown(e, localPoint.x, localPoint.y)
|
view.onMouseDown(e, localPoint.x, localPoint.y)
|
||||||
} else {
|
} else {
|
||||||
if (this.options.preventDefaultBlankAction) {
|
if (
|
||||||
|
this.options.preventDefaultBlankAction &&
|
||||||
|
['touchstart'].includes(e.type)
|
||||||
|
) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,8 +490,11 @@ export class GraphView extends View {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
protected onMagnetContextMenu(e: JQuery.ContextMenuEvent) {
|
protected onMagnetContextMenu(evt: JQuery.ContextMenuEvent) {
|
||||||
if (this.options.preventDefaultContextMenu) {
|
const e = this.normalizeEvent(evt)
|
||||||
|
const view = this.findView(e.target)
|
||||||
|
|
||||||
|
if (this.isPreventDefaultContextMenu(e, view)) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
this.handleMagnetEvent(e, (view, e, magnet, x, y) => {
|
this.handleMagnetEvent(e, (view, e, magnet, x, y) => {
|
||||||
|
@@ -1099,7 +1099,7 @@ export namespace Edge {
|
|||||||
port?: string
|
port?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TerminalData = TerminalPointData | TerminalCellData
|
export type TerminalData = TerminalPointData | TerminalCellLooseData
|
||||||
|
|
||||||
export function equalTerminals(a: TerminalData, b: TerminalData) {
|
export function equalTerminals(a: TerminalData, b: TerminalData) {
|
||||||
const a1 = a as TerminalCellData
|
const a1 = a as TerminalCellData
|
||||||
|
@@ -159,27 +159,31 @@ export class Model extends Basecoat<Model.EventArgs> {
|
|||||||
|
|
||||||
protected onEdgeTerminalChanged(edge: Edge, type: Edge.TerminalType) {
|
protected onEdgeTerminalChanged(edge: Edge, type: Edge.TerminalType) {
|
||||||
const ref = type === 'source' ? this.outgoings : this.incomings
|
const ref = type === 'source' ? this.outgoings : this.incomings
|
||||||
const prev = edge.previous<Edge.TerminalCellData>(type)
|
const prev = edge.previous<Edge.TerminalCellLooseData>(type)
|
||||||
|
|
||||||
if (prev && prev.cell) {
|
if (prev && prev.cell) {
|
||||||
const cache = ref[prev.cell]
|
const cellId = Cell.isCell(prev.cell) ? prev.cell.id : prev.cell
|
||||||
|
const cache = ref[cellId]
|
||||||
const index = cache ? cache.indexOf(edge.id) : -1
|
const index = cache ? cache.indexOf(edge.id) : -1
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
cache.splice(index, 1)
|
cache.splice(index, 1)
|
||||||
if (cache.length === 0) {
|
if (cache.length === 0) {
|
||||||
delete ref[prev.cell]
|
delete ref[cellId]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const terminal = edge.getTerminal(type) as Edge.TerminalCellData
|
const terminal = edge.getTerminal(type) as Edge.TerminalCellLooseData
|
||||||
if (terminal && terminal.cell) {
|
if (terminal && terminal.cell) {
|
||||||
const cache = ref[terminal.cell] || []
|
const terminalId = Cell.isCell(terminal.cell)
|
||||||
|
? terminal.cell.id
|
||||||
|
: terminal.cell
|
||||||
|
const cache = ref[terminalId] || []
|
||||||
const index = cache.indexOf(edge.id)
|
const index = cache.indexOf(edge.id)
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
cache.push(edge.id)
|
cache.push(edge.id)
|
||||||
}
|
}
|
||||||
ref[terminal.cell] = cache
|
ref[terminalId] = cache
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9,9 +9,11 @@ export const connection: Attr.Definition = {
|
|||||||
qualify: isEdgeView,
|
qualify: isEdgeView,
|
||||||
set(val, args) {
|
set(val, args) {
|
||||||
const view = args.view as EdgeView
|
const view = args.view as EdgeView
|
||||||
|
const reverse = ((val as any).reverse || false) as boolean
|
||||||
const stubs = ((val as any).stubs || 0) as number
|
const stubs = ((val as any).stubs || 0) as number
|
||||||
let d
|
let d
|
||||||
if (Number.isFinite(stubs) && stubs !== 0) {
|
if (Number.isFinite(stubs) && stubs !== 0) {
|
||||||
|
if (!reverse) {
|
||||||
let offset
|
let offset
|
||||||
if (stubs < 0) {
|
if (stubs < 0) {
|
||||||
const len = view.getConnectionLength() || 0
|
const len = view.getConnectionLength() || 0
|
||||||
@@ -28,6 +30,24 @@ export const connection: Attr.Definition = {
|
|||||||
d = `${sourceParts[0].serialize()} ${targetParts[1].serialize()}`
|
d = `${sourceParts[0].serialize()} ${targetParts[1].serialize()}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
let offset
|
||||||
|
let length
|
||||||
|
const len = view.getConnectionLength() || 0
|
||||||
|
if (stubs < 0) {
|
||||||
|
offset = (len + stubs) / 2
|
||||||
|
length = -stubs
|
||||||
|
} else {
|
||||||
|
offset = stubs
|
||||||
|
length = len - stubs * 2
|
||||||
|
}
|
||||||
|
|
||||||
|
const path = view.getConnection()
|
||||||
|
d = path
|
||||||
|
?.divideAtLength(offset)?.[1]
|
||||||
|
?.divideAtLength(length)?.[0]
|
||||||
|
?.serialize()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return { d: d || view.getConnectionPathData() }
|
return { d: d || view.getConnectionPathData() }
|
||||||
|
@@ -76,9 +76,11 @@ export class ObstacleMap {
|
|||||||
const excludeShapes = options.excludeShapes
|
const excludeShapes = options.excludeShapes
|
||||||
const excType = shape ? excludeShapes.includes(shape) : false
|
const excType = shape ? excludeShapes.includes(shape) : false
|
||||||
const excTerminal = excludedTerminals.some((cell) => cell.id === node.id)
|
const excTerminal = excludedTerminals.some((cell) => cell.id === node.id)
|
||||||
|
const excNode = options.excludeNodes.includes(node)
|
||||||
const excAncestor = excludedAncestors.includes(node.id)
|
const excAncestor = excludedAncestors.includes(node.id)
|
||||||
const excHidden = options.excludeHiddenNodes && !node.isVisible()
|
const excHidden = options.excludeHiddenNodes && !node.isVisible()
|
||||||
const excluded = excType || excTerminal || excAncestor || excHidden
|
const excluded =
|
||||||
|
excType || excTerminal || excNode || excAncestor || excHidden
|
||||||
|
|
||||||
if (!excluded) {
|
if (!excluded) {
|
||||||
const bbox = node.getBBox().moveAndExpand(options.paddingBox)
|
const bbox = node.getBBox().moveAndExpand(options.paddingBox)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { NumberExt } from '../../../util'
|
import { NumberExt } from '../../../util'
|
||||||
import { Point, Rectangle, Angle } from '../../../geometry'
|
import { Point, Rectangle, Angle } from '../../../geometry'
|
||||||
import { Edge } from '../../../model'
|
import { Edge, Node } from '../../../model'
|
||||||
import { EdgeView } from '../../../view'
|
import { EdgeView } from '../../../view'
|
||||||
import { orth } from '../orth'
|
import { orth } from '../orth'
|
||||||
import { Router } from '../index'
|
import { Router } from '../index'
|
||||||
@@ -46,6 +46,11 @@ export interface ResolvedOptions {
|
|||||||
*/
|
*/
|
||||||
excludeShapes: string[]
|
excludeShapes: string[]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Should certain nodes not be considered as obstacles?
|
||||||
|
*/
|
||||||
|
excludeNodes: Node[]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should certain hidden nodes not be considered as obstacles?
|
* Should certain hidden nodes not be considered as obstacles?
|
||||||
*/
|
*/
|
||||||
@@ -141,6 +146,7 @@ export const defaults: ManhattanRouterOptions = {
|
|||||||
perpendicular: true,
|
perpendicular: true,
|
||||||
excludeTerminals: [],
|
excludeTerminals: [],
|
||||||
excludeShapes: [], // ['text']
|
excludeShapes: [], // ['text']
|
||||||
|
excludeNodes: [],
|
||||||
excludeHiddenNodes: false,
|
excludeHiddenNodes: false,
|
||||||
startDirections: ['top', 'right', 'bottom', 'left'],
|
startDirections: ['top', 'right', 'bottom', 'left'],
|
||||||
endDirections: ['top', 'right', 'bottom', 'left'],
|
endDirections: ['top', 'right', 'bottom', 'left'],
|
||||||
@@ -221,7 +227,7 @@ export function resolveOptions(options: ManhattanRouterOptions) {
|
|||||||
|
|
||||||
if (result.padding) {
|
if (result.padding) {
|
||||||
const sides = NumberExt.normalizeSides(result.padding)
|
const sides = NumberExt.normalizeSides(result.padding)
|
||||||
options.paddingBox = {
|
result.paddingBox = {
|
||||||
x: -sides.left,
|
x: -sides.left,
|
||||||
y: -sides.top,
|
y: -sides.top,
|
||||||
width: sides.left + sides.right,
|
width: sides.left + sides.right,
|
||||||
|
@@ -80,10 +80,12 @@ export class Button extends ToolsView.ToolItem<
|
|||||||
let tangent
|
let tangent
|
||||||
let position
|
let position
|
||||||
let angle
|
let angle
|
||||||
if (NumberExt.isPercentage(distance)) {
|
|
||||||
tangent = view.getTangentAtRatio(parseFloat(distance) / 100)
|
const d = NumberExt.normalizePercentage(distance, 1)
|
||||||
|
if (d >= 0 && d <= 1) {
|
||||||
|
tangent = view.getTangentAtRatio(d)
|
||||||
} else {
|
} else {
|
||||||
tangent = view.getTangentAtLength(distance)
|
tangent = view.getTangentAtLength(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tangent) {
|
if (tangent) {
|
||||||
|
@@ -14,7 +14,7 @@ export class CellEditor extends ToolsView.ToolItem<
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
this.createElement()
|
this.createElement()
|
||||||
this.update()
|
this.updateEditor()
|
||||||
this.autoFocus()
|
this.autoFocus()
|
||||||
this.delegateDocumentEvents(this.options.documentEvents!)
|
this.delegateDocumentEvents(this.options.documentEvents!)
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ export class CellEditor extends ToolsView.ToolItem<
|
|||||||
this.container.appendChild(this.editor)
|
this.container.appendChild(this.editor)
|
||||||
}
|
}
|
||||||
|
|
||||||
update() {
|
updateEditor() {
|
||||||
const { graph, cell, editor } = this
|
const { graph, cell, editor } = this
|
||||||
const style = editor.style
|
const style = editor.style
|
||||||
|
|
||||||
@@ -49,7 +49,6 @@ export class CellEditor extends ToolsView.ToolItem<
|
|||||||
const parent = target.parentElement
|
const parent = target.parentElement
|
||||||
const isEdgeLabel =
|
const isEdgeLabel =
|
||||||
parent && Dom.hasClass(parent, this.prefixClassName('edge-label'))
|
parent && Dom.hasClass(parent, this.prefixClassName('edge-label'))
|
||||||
const labelAddable = this.options.labelAddable
|
|
||||||
if (isEdgeLabel) {
|
if (isEdgeLabel) {
|
||||||
const index = parent.getAttribute('data-index') || '0'
|
const index = parent.getAttribute('data-index') || '0'
|
||||||
this.labelIndex = parseInt(index, 10)
|
this.labelIndex = parseInt(index, 10)
|
||||||
@@ -58,7 +57,7 @@ export class CellEditor extends ToolsView.ToolItem<
|
|||||||
pos = new Point(translation.tx, translation.ty)
|
pos = new Point(translation.tx, translation.ty)
|
||||||
minWidth = Dom.getBBox(target).width
|
minWidth = Dom.getBBox(target).width
|
||||||
} else {
|
} else {
|
||||||
if (!labelAddable) {
|
if (!this.options.labelAddable) {
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
pos = graph.clientToLocal(Point.create(e.clientX, e.clientY))
|
pos = graph.clientToLocal(Point.create(e.clientX, e.clientY))
|
||||||
|
@@ -58,5 +58,6 @@ export namespace Base {
|
|||||||
}
|
}
|
||||||
return others
|
return others
|
||||||
},
|
},
|
||||||
|
visible: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
.@{x6-prefix}-graph {
|
.@{x6-prefix}-graph {
|
||||||
position: relative;
|
position: relative;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
touch-action: none;
|
||||||
|
|
||||||
&-background,
|
&-background,
|
||||||
&-grid,
|
&-grid,
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
export const content = `.x6-graph {
|
export const content = `.x6-graph {
|
||||||
position: relative;
|
position: relative;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
touch-action: none;
|
||||||
}
|
}
|
||||||
.x6-graph-background,
|
.x6-graph-background,
|
||||||
.x6-graph-grid,
|
.x6-graph-grid,
|
||||||
@@ -574,7 +575,7 @@ export const content = `.x6-graph {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: -10000px;
|
top: -10000px;
|
||||||
left: -10000px;
|
left: -10000px;
|
||||||
z-index: 100;
|
z-index: 999999;
|
||||||
display: none;
|
display: none;
|
||||||
cursor: move;
|
cursor: move;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
@@ -820,15 +821,8 @@ export const content = `.x6-graph {
|
|||||||
}
|
}
|
||||||
.x6-widget-snapline-vertical,
|
.x6-widget-snapline-vertical,
|
||||||
.x6-widget-snapline-horizontal {
|
.x6-widget-snapline-horizontal {
|
||||||
position: absolute;
|
stroke: #2ecc71;
|
||||||
opacity: 1;
|
stroke-width: 1px;
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
.x6-widget-snapline-horizontal {
|
|
||||||
border-bottom: 1px solid #2ecc71;
|
|
||||||
}
|
|
||||||
.x6-widget-snapline-vertical {
|
|
||||||
border-right: 1px solid #2ecc71;
|
|
||||||
}
|
}
|
||||||
.x6-widget-stencil {
|
.x6-widget-stencil {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@@ -8,6 +8,7 @@ export {
|
|||||||
sortBy,
|
sortBy,
|
||||||
groupBy,
|
groupBy,
|
||||||
difference,
|
difference,
|
||||||
|
max,
|
||||||
} from 'lodash-es'
|
} from 'lodash-es'
|
||||||
|
|
||||||
export * from './diff'
|
export * from './diff'
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user