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