Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
85a90192
Commit
85a90192
authored
Mar 10, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整关系图节点大小
parent
2e3f725f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
Relation.jsx
src/view/Manage/AssetBrowse/Component/Relation.jsx
+17
-13
No files found.
src/view/Manage/AssetBrowse/Component/Relation.jsx
View file @
85a90192
...
...
@@ -6,7 +6,7 @@ import G6 from '@antv/g6';
import
centerImg
from
'../assets/center.png'
;
import
expandImg
from
'../assets/expand.png'
;
const
m
inInnerRaduis
=
2
0
,
imageWidth
=
30
,
textFontSize
=
8
;
const
m
axInnerRaduis
=
4
0
,
imageWidth
=
30
,
textFontSize
=
8
;
const
centerColorGroup
=
[
'#D8E9FF'
,
'#A7CEFF'
,
'#196AD2'
];
const
centerHighlightColorGroup
=
[
'#99c6ff'
,
'#4d8ddf'
,
'#145ab3'
];
...
...
@@ -73,14 +73,16 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) {
});
const
calcRaduis
=
(
node
)
=>
{
if
(
!
node
?.
levelId
)
return
{
innerRaduis
:
m
inInnerRaduis
,
raduis
:
min
InnerRaduis
+
30
};
if
(
!
node
?.
levelId
)
return
{
innerRaduis
:
m
axInnerRaduis
,
raduis
:
max
InnerRaduis
+
30
};
const
nodeLevel
=
node
?.
levelId
.
split
(
'-'
).
length
;
let
innerRaduis
=
minInnerRaduis
;
if
(
nodeLevel
===
1
)
{
innerRaduis
=
minInnerRaduis
+
10
*
(
totalLevel
-
nodeLevel
-
1
)
+
20
;
}
else
if
(
nodeLevel
>
1
)
{
innerRaduis
=
minInnerRaduis
+
10
*
(
totalLevel
-
nodeLevel
);
let
innerRaduis
=
maxInnerRaduis
;
if
(
nodeLevel
>
1
)
{
innerRaduis
=
maxInnerRaduis
-
15
-
5
*
(
nodeLevel
-
2
);
}
if
(
innerRaduis
<
15
)
{
innerRaduis
=
15
;
}
return
{
innerRaduis
,
raduis
:
(
innerRaduis
+
30
)
};
...
...
@@ -135,8 +137,10 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) {
});
const
data
=
[
{
type
:
'expand'
,
value
:
50
},
{
type
:
'center'
,
value
:
50
}
{
type
:
'expand'
,
value
:
49.7
},
{
type
:
'interval1'
,
value
:
0.3
},
{
type
:
'center'
,
value
:
49.7
},
{
type
:
'interval2'
,
value
:
0.3
}
];
view
.
data
(
data
);
...
...
@@ -151,10 +155,9 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) {
.
interval
()
.
adjust
(
'stack'
)
.
position
(
'value'
)
.
color
(
chartColor
)
.
color
(
'type'
,[
chartColor
,
'#fff'
,
chartColor
,
'#fff'
]
)
.
style
({
stroke
:
'white'
,
lineWidth
:
5
,
lineWidth
:
0
,
cursor
:
'pointer'
,
})
.
state
({
...
...
@@ -162,7 +165,7 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) {
style
:
(
element
)
=>
{
const
shape
=
element
.
shape
;
return
{
lineWidth
:
1
,
lineWidth
:
0
,
fillOpacity
:
shape
.
attr
(
"fillOpacity"
)
*
0.4
,
}
}
...
...
@@ -315,6 +318,7 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) {
if
(
!
model
?.
virtual
&&
model
?.
haveChild
)
{
const
group
=
item
.
getContainer
();
console
.
log
(
'group'
,
group
);
const
keyShape
=
group
.
get
(
'children'
)[
0
];
const
pathShape1
=
group
.
get
(
'children'
)[
1
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment