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
3892350a
authored
2025-07-09 14:12:49 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
桑基图大数据量下查看
1 parent
1ae1e578
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
src/views/data_meta/components/Sankey.vue
src/views/data_meta/components/Sankey.vue
View file @
3892350
<
template
>
<div
ref=
"containerRef"
class=
'canvas-wrapper'
>
<div
ref=
"mainRef"
class=
'canvas-wrapper'
>
<div
ref=
"containerRef"
class=
'canvas-wrapper-content'
>
</div>
</div>
</
template
>
<
script
lang=
"ts"
setup
name=
"topbar"
>
...
...
@@ -78,6 +80,11 @@ const sankeyInstance: any = ref();
const
containerRef
=
ref
();
const
setChartsOption
=
()
=>
{
if
(
props
.
names
.
length
>
250
)
{
containerRef
.
value
.
style
.
height
=
(
props
.
names
.
length
*
3.5
)
+
'px'
;
}
else
{
containerRef
.
value
.
style
.
height
=
'100%'
;
}
let
option
=
{
tooltip
:
{
...
...
@@ -94,7 +101,7 @@ const setChartsOption = () => {
{
type
:
'sankey'
,
top
:
60
,
bottom
:
2
0
,
bottom
:
4
0
,
draggable
:
false
,
left
:
50
,
emphasis
:
{
...
...
@@ -112,7 +119,7 @@ const setChartsOption = () => {
return
{
...
n
,
label
:
{
width
:
97
,
width
:
props
.
names
.
length
>
300
?
86
:
97
,
overflow
:
'breakAll'
}
}
...
...
@@ -135,6 +142,11 @@ const resizeObserver = ref();
const
observeResize
=
()
=>
{
window
.
addEventListener
(
'resize'
,
(
e
)
=>
{
if
(
props
.
names
.
length
>
250
)
{
containerRef
.
value
.
style
.
height
=
(
props
.
names
.
length
*
3.5
)
+
'px'
;
}
else
{
containerRef
.
value
.
style
.
height
=
'100%'
;
}
sankeyInstance
.
value
?.
resize
();
});
}
...
...
@@ -154,5 +166,12 @@ onMounted(() => {
width
:
100%
;
height
:
100%
;
position
:
relative
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
}
.canvas-wrapper-content
{
width
:
100%
;
height
:
100%
;
}
</
style
>
\ No newline at end of file
...
...
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