Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
574e60af
authored
2025-06-27 10:06:59 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 优化桑基图
1 parent
778ef458
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
16 deletions
src/components/RelationNetwork/index.vue
src/views/data_meta/components/Sankey.vue
src/components/RelationNetwork/index.vue
View file @
574e60a
...
...
@@ -82,7 +82,7 @@ watch(() => props.treeData, (val) => {
const
renderGraph
=
(
graph
:
any
,
lineageData
:
any
)
=>
{
if
(
!
graph
||
!
lineageData
)
return
;
graph
.
setMinZoom
(
0.7
);
graph
.
setMinZoom
(
1
);
graph
.
setMaxZoom
(
1
);
graph
.
data
(
lineageData
);
graph
.
render
();
...
...
@@ -265,7 +265,7 @@ const initGraph = () => {
],
},
defaultNode
:
{
size
:
2
4
,
size
:
2
0
,
anchorPoints
:
[
[
0
,
0.5
],
[
1
,
0.5
],
...
...
@@ -292,7 +292,7 @@ const initGraph = () => {
return
16
;
},
getVGap
:
function
getVGap
()
{
return
2
5
;
return
1
5
;
},
getHGap
:
function
getHGap
()
{
return
120
;
...
...
@@ -306,7 +306,7 @@ const initGraph = () => {
label
:
handleLabelLength
((
node
.
isField
?
node
.
metaStandardId
:
node
.
standardName
)
as
string
),
collapsed
:
node
.
children
?.
length
?
false
:
true
,
labelCfg
:
{
offset
:
10
,
offset
:
7
,
style
:
{
fontSize
:
13
,
fill
:
'#212121'
,
...
...
@@ -369,7 +369,7 @@ const observeResize = () => {
return
;
}
graphRef
.
value
.
changeSize
(
width
,
height
);
graphRef
.
value
.
setMinZoom
(
0.7
);
graphRef
.
value
.
setMinZoom
(
1
);
graphRef
.
value
.
setMaxZoom
(
1
);
graphRef
.
value
.
fitView
(
40
,
{
direction
:
'both'
});
graphRef
.
value
.
fitCenter
();
...
...
@@ -385,7 +385,7 @@ const observeResize = () => {
return
;
}
graphRef
.
value
.
changeSize
(
width
,
height
);
graphRef
.
value
.
setMinZoom
(
0.7
);
graphRef
.
value
.
setMinZoom
(
1
);
graphRef
.
value
.
setMaxZoom
(
1
);
graphRef
.
value
.
fitView
(
40
,
{
direction
:
'both'
});
graphRef
.
value
.
fitCenter
();
...
...
@@ -607,7 +607,7 @@ defineExpose({
overflow-y
:
auto
;
.title
{
font-size
:
1
6
px
;
font-size
:
1
4
px
;
color
:
#212121
;
line-height
:
24px
;
font-weight
:
600
;
...
...
@@ -615,7 +615,7 @@ defineExpose({
.row
{
margin-top
:
8px
;
font-size
:
1
4
px
;
font-size
:
1
2
px
;
color
:
#666666
;
word-break
:
break-all
;
line-height
:
21px
;
...
...
src/views/data_meta/components/Sankey.vue
View file @
574e60a
...
...
@@ -78,6 +78,7 @@ const sankeyInstance: any = ref();
const
containerRef
=
ref
();
const
setChartsOption
=
()
=>
{
let
option
=
{
tooltip
:
{
trigger
:
'item'
,
...
...
@@ -85,19 +86,33 @@ const setChartsOption = () => {
if
(
params
.
data
.
name
)
{
return
null
;
}
return
params
.
data
.
source
+
'
-->
'
+
params
.
data
.
target
return
params
.
data
.
source
+
'
>
'
+
params
.
data
.
target
}
},
color
:
[
"#3DBCBE"
,
"#6b67d1"
,
"#7BBCE0"
,
"#2B8EF3"
,
"#51dca2"
,
"#E19D46"
],
series
:
[
{
type
:
'sankey'
,
top
:
8
0
,
bottom
:
4
0
,
top
:
6
0
,
bottom
:
2
0
,
draggable
:
false
,
left
:
40
,
right
:
80
,
data
:
props
.
names
,
left
:
50
,
right
:
100
,
label
:
{
fontSize
:
10
,
},
data
:
props
.
names
?.
map
(
n
=>
{
if
(
n
.
isLast
)
{
return
{
...
n
,
label
:
{
width
:
97
,
overflow
:
'breakAll'
}
}
}
return
n
;
}),
links
:
props
.
treeData
,
lineStyle
:
{
color
:
'source'
,
...
...
@@ -113,10 +128,9 @@ const setChartsOption = () => {
const
resizeObserver
=
ref
();
const
observeResize
=
()
=>
{
resizeObserver
.
value
=
new
ResizeObserver
((
)
=>
{
window
.
addEventListener
(
'resize'
,
(
e
)
=>
{
sankeyInstance
.
value
?.
resize
();
});
resizeObserver
.
value
.
observe
(
containerRef
.
value
);
}
onMounted
(()
=>
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment