@@ -16,7 +16,7 @@ import {
16
16
sankeyCenter as d3SankeyCenter ,
17
17
sankeyJustify as d3SankeyJustify ,
18
18
} from 'd3-sankey' ;
19
- import { configureSvgSize } from '../../setupGraphViewbox.js' ;
19
+ import { setupGraphViewbox } from '../../setupGraphViewbox.js' ;
20
20
import { Uid } from '../../rendering-util/uid.js' ;
21
21
import type { SankeyNodeAlignment } from '../../config.type.js' ;
22
22
@@ -70,12 +70,6 @@ export const draw = function (text: string, id: string, _version: string, diagOb
70
70
const suffix = conf ?. suffix ?? defaultSankeyConfig . suffix ! ;
71
71
const showValues = conf ?. showValues ?? defaultSankeyConfig . showValues ! ;
72
72
73
- // FIX: using max width prevents height from being set, is it intended?
74
- // to add height directly one can use `svg.attr('height', height)`
75
- //
76
- // @ts -ignore TODO: svg type vs selection mismatch
77
- configureSvgSize ( svg , height , width , useMaxWidth ) ;
78
-
79
73
// Prepare data for construction based on diagObj.db
80
74
// This must be a mutable object with `nodes` and `links` properties:
81
75
//
@@ -208,6 +202,8 @@ export const draw = function (text: string, id: string, _version: string, diagOb
208
202
. attr ( 'd' , d3SankeyLinkHorizontal ( ) )
209
203
. attr ( 'stroke' , coloring )
210
204
. attr ( 'stroke-width' , ( d : any ) => Math . max ( 1 , d . width ) ) ;
205
+
206
+ setupGraphViewbox ( undefined , svg , 0 , useMaxWidth ) ;
211
207
} ;
212
208
213
209
export default {
0 commit comments