@@ -248,11 +248,11 @@ function computeSankeyCoordinates(ds) {
248248
249249 const links = [];
250250 for (const node in nodes) {
251- let sourceY = nodeCoordinates[node].absoluteY ;
251+ let sourceY = nodeCoordinates[node].absoluteY + FINAL_CONFIG . value . style . chart . padding . top ;
252252
253253 if (nodes[node].children ) {
254254 nodes[node].children .forEach (({ target, value }, i ) => {
255- const targetY = nodeCoordinates[target].y ;
255+ const targetY = nodeCoordinates[target].y + FINAL_CONFIG . value . style . chart . padding . top ;
256256 const sourceCoord = nodeCoordinates[node];
257257 const targetCoord = nodeCoordinates[target];
258258
@@ -582,6 +582,20 @@ defineExpose({
582582 :class =" { 'vue-data-ui-fullscreen--on': isFullscreen, 'vue-data-ui-fulscreen--off': !isFullscreen }" :style =" `max-width:100%; overflow: visible; background:transparent;color:${FINAL_CONFIG.style.chart.color}`"
583583 >
584584 <PackageVersion />
585+
586+ <!-- BACKGROUND SLOT -->
587+ <foreignObject
588+ v-if =" $slots['chart-background']"
589+ :x =" 0"
590+ :y =" 0"
591+ :width =" drawingArea.width"
592+ :height =" drawingArea.height"
593+ :style =" {
594+ pointerEvents: 'none'
595+ }"
596+ >
597+ <slot name =" chart-background" />
598+ </foreignObject >
585599
586600 <defs >
587601 <linearGradient
@@ -611,7 +625,7 @@ defineExpose({
611625 v-for =" (node, i) in mutableDataset.nodes"
612626 class =" vue-ui-flow-node"
613627 :x =" node.x"
614- :y =" checkNaN(node.absoluteY)"
628+ :y =" checkNaN(node.absoluteY) + FINAL_CONFIG.style.chart.padding.top "
615629 :height =" checkNaN(node.height)"
616630 :width =" nodeWidth"
617631 :fill =" node.color"
@@ -625,7 +639,7 @@ defineExpose({
625639 <text
626640 v-for =" (node, i) in mutableDataset.nodes"
627641 :x =" node.x + nodeWidth / 2"
628- :y =" checkNaN(node.absoluteY + node.height / 2 - (FINAL_CONFIG.style.chart.nodes.labels.fontSize / 4))"
642+ :y =" checkNaN(node.absoluteY + node.height / 2 - (FINAL_CONFIG.style.chart.nodes.labels.fontSize / 4)) + FINAL_CONFIG.style.chart.padding.top "
629643 :font-size =" FINAL_CONFIG.style.chart.nodes.labels.fontSize"
630644 :fill =" adaptColorToBackground(node.color)"
631645 text-anchor =" middle"
@@ -636,7 +650,7 @@ defineExpose({
636650 <text
637651 v-for =" (node, i) in mutableDataset.nodes"
638652 :x =" node.x + nodeWidth / 2"
639- :y =" checkNaN(node.absoluteY + node.height / 2 + (FINAL_CONFIG.style.chart.nodes.labels.fontSize))"
653+ :y =" checkNaN(node.absoluteY + node.height / 2 + (FINAL_CONFIG.style.chart.nodes.labels.fontSize)) + FINAL_CONFIG.style.chart.padding.top "
640654 :font-size =" FINAL_CONFIG.style.chart.nodes.labels.fontSize"
641655 :fill =" adaptColorToBackground(node.color)"
642656 text-anchor =" middle"
0 commit comments