Skip to content

Commit 0270836

Browse files
committed
Modification - VueUiDag - Last small fixes
1 parent 5ccc5c5 commit 0270836

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

TestingArena/ArenaVueUiDag.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const {
2626
2727
const dataset = ref({
2828
nodes: [
29-
{ id: "A", label: "AAA", backgroundColor: '#FF0000', color: 'white'},
29+
{ id: "A", label: "AAA\naaa", backgroundColor: '#FF0000', color: 'white'},
3030
{ id: "B", label: "BBB",},
3131
{ id: "C", label: "CCC", color: '#FF0000'},
3232
{ id: "D", label: "DDD" },

src/atoms/BaseZoomControls.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ const emit = defineEmits(['zoomIn', 'zoomOut', 'resetZoom', 'switchDirection']);
5959
:style="{
6060
color: config.style.chart.controls.color,
6161
width: config.style.chart.controls.fontSize * 4 + 'px',
62-
borderRadius: config.style.chart.controls.borderRadius
62+
borderRadius: config.style.chart.controls.borderRadius,
63+
fontSize: config.style.chart.controls.fontSize + 'px'
6364
}"
6465
>
6566
{{ Math.round(scale * 100) }}%

src/components/vue-ui-dag.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ watch(() => props.config, (_newCfg) => {
196196
titleStep.value += 1;
197197
direction.value = FINAL_CONFIG.value.style.chart.layout.rankDirection;
198198
panZoomActive.value = FINAL_CONFIG.value.style.chart.zoom.active;
199-
});
199+
}, { deep: true });
200200
201201
const { isPrinting, isImaging, generatePdf, generateImage } = usePrinter({
202202
elementId: `dag_${uid.value}`,
@@ -740,7 +740,7 @@ defineExpose({
740740
</div>
741741
742742
<BaseZoomControls
743-
v-if="FINAL_CONFIG.style.chart.controls.position === 'top' && !loading"
743+
v-if="FINAL_CONFIG.style.chart.controls.position === 'top' && !loading && FINAL_CONFIG.style.chart.controls.show"
744744
:config="FINAL_CONFIG"
745745
:scale="scale"
746746
:isFullscreen="isFullscreen"
@@ -858,8 +858,7 @@ defineExpose({
858858
<text
859859
v-if="$slots['node-label']"
860860
:x="node.x"
861-
:y="node.y"
862-
dominant-baseline="middle"
861+
:y="node.y + FINAL_CONFIG.style.chart.nodes.labels.fontSize / 3"
863862
text-anchor="middle"
864863
:font-size="FINAL_CONFIG.style.chart.nodes.labels.fontSize"
865864
:fill="node.original.color"
@@ -875,8 +874,7 @@ defineExpose({
875874
data-cy-node-label
876875
v-else
877876
:x="node.x"
878-
:y="node.y"
879-
dominant-baseline="middle"
877+
:y="node.y + FINAL_CONFIG.style.chart.nodes.labels.fontSize / 3"
880878
text-anchor="middle"
881879
:font-size="FINAL_CONFIG.style.chart.nodes.labels.fontSize"
882880
:fill="node.original.color"
@@ -930,6 +928,10 @@ defineExpose({
930928
}"/>
931929
</svg>
932930
931+
<div v-if="$slots.watermark" class="vue-data-ui-watermark">
932+
<slot name="watermark" v-bind="{ isPrinting: isPrinting || isImaging }"/>
933+
</div>
934+
933935
<!-- Midpoint tooltip -->
934936
<Transition name="fade">
935937
<Teleport :to="isFullscreen ? dagChart : 'body'" v-if="isTooltip">
@@ -980,7 +982,7 @@ defineExpose({
980982
</Transition>
981983
982984
<BaseZoomControls
983-
v-if="FINAL_CONFIG.style.chart.controls.position === 'bottom' && !loading"
985+
v-if="FINAL_CONFIG.style.chart.controls.position === 'bottom' && !loading && FINAL_CONFIG.style.chart.controls.show"
984986
:config="FINAL_CONFIG"
985987
:scale="scale"
986988
:isFullscreen="isFullscreen"

0 commit comments

Comments
 (0)