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
1ff43196
Commit
1ff43196
authored
Jun 09, 2021
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed url bug and hide label
parent
71efdb3a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
22 deletions
+32
-22
Relation.css
src/view/Manage/Map/Component/Relation.css
+4
-4
Relation.jsx
src/view/Manage/Map/Component/Relation.jsx
+28
-18
No files found.
src/view/Manage/Map/Component/Relation.css
View file @
1ff43196
...
...
@@ -6,7 +6,7 @@
width
:
400px
;
height
:
620px
;
margin-top
:
-310px
;
background-image
:
url(
'./assets/border-left.0932.png'
)
;
background-image
:
url(
./assets/border-left.0932.png
)
;
background-size
:
cover
;
background-position
:
0
;
-webkit-animation
:
leftflyin
1s
;
...
...
@@ -46,7 +46,7 @@
width
:
400px
;
height
:
620px
;
margin-top
:
-310px
;
background-image
:
url(
https://static.allhistory.com/online/common/img
/border-right.61f0.png)
;
background-image
:
url(
./assets
/border-right.61f0.png)
;
background-size
:
cover
;
background-position
:
100%
;
-webkit-animation
:
rightflyin
1s
;
...
...
@@ -81,7 +81,7 @@
#top-bg-container
{
top
:
-120px
;
height
:
240px
;
background-image
:
url(https://static.allhistory.com/online/common/img/top-bg.7c77.png)
;
/* background-image: url(https://static.allhistory.com/online/common/img/top-bg.7c77.png); */
background-size
:
100%
240px
}
...
...
@@ -98,7 +98,7 @@
#bottom-bg-container
{
bottom
:
0
;
height
:
289px
;
background-image
:
url(
https://static.allhistory.com/online/common/img
/bottom-bg.8d9e.png)
;
background-image
:
url(
./assets
/bottom-bg.8d9e.png)
;
background-size
:
cover
;
background-position
:
top
}
...
...
src/view/Manage/Map/Component/Relation.jsx
View file @
1ff43196
...
...
@@ -436,6 +436,8 @@ G6.registerEdge(
// x and y should be minus width / 2 and height / 2 respectively to translate the center of the rect to the midPoint
// x 和 y 分别减去 width / 2 与 height / 2,使矩形中心在 midPoint 上
},
name
:
'rect'
,
visible
:
false
});
const
toMatrix
=
G6
.
Util
.
transform
(
[
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
],
...
...
@@ -450,30 +452,32 @@ G6.registerEdge(
textAlign
:
'center'
,
fontSize
:
4
,
fill
:
'#000'
,
opacity
:
0.85
,
}
opacity
:
0.85
},
name
:
'text'
,
visible
:
false
})
const
bbox
=
text
.
getBBox
()
text
.
moveTo
(
midPoint
.
x
,
midPoint
.
y
+
(
bbox
.
height
>>
1
))
text
.
rotateAtPoint
(
midPoint
.
x
,
midPoint
.
y
,
rad
>
Math
.
PI
*
.
5
?
radius
+
Math
.
PI
:
radius
)
}
{
const
arrow
=
group
.
addShape
(
'marker'
,
{
attrs
:
{
x
:
0
,
y
:
0
,
r
:
2
,
fill
:
'#fff'
,
symbol
:
'triangle'
,
},
// must be assigned in G6 3.3 and later versions. it can be any value you want
name
:
'marker-shape'
,
});
const
x
=
midPoint
.
x
+
((
rw
>>
1
)
+
2.5
)
*
dx
/
dst
,
y
=
midPoint
.
y
+
((
rw
>>
1
)
+
2.5
)
*
dy
/
dst
arrow
.
moveTo
(
x
,
y
)
arrow
.
rotateAtPoint
(
x
,
y
,
radius
+
Math
.
PI
*
.
5
)
}
//
{
//
const arrow = group.addShape('marker', {
//
attrs: {
//
x: 0,
//
y: 0,
//
r: 2,
//
fill: '#fff',
//
symbol: 'triangle',
//
},
//
// must be assigned in G6 3.3 and later versions. it can be any value you want
//
name: 'marker-shape',
//
});
//
const x = midPoint.x + ((rw >> 1) + 2.5) * dx / dst, y = midPoint.y + ((rw >> 1) + 2.5) * dy / dst
//
arrow.moveTo(x, y)
//
arrow.rotateAtPoint(x, y, radius + Math.PI * .5)
//
}
return
group
;
},
...
...
@@ -483,10 +487,16 @@ G6.registerEdge(
setState
:
(
name
,
value
,
item
)
=>
{
if
(
name
===
'active'
)
{
const
keyShape
=
item
.
get
(
'keyShape'
).
get
(
'children'
)[
0
];
// const rect = item.get('keyShape').get('children')[1];
// const text = item.get('keyShape').get('children')[2];
if
(
value
)
{
keyShape
.
attr
(
'stroke'
,
highlight
);
// rect.show()
// text.show()
}
else
{
keyShape
.
attr
(
'stroke'
,
'#aaa'
);
// rect.hide()
// text.hide()
}
}
// if (name === 'focus') {
...
...
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