Skip to content

Commit cb5feb0

Browse files
committed
Workaround empty map problem in Firefox
1 parent 026b445 commit cb5feb0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/components/Zigbee2mqttNetworkmap.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
align-items: center;
1818
}
1919
</v-style>
20-
<d3-network :net-nodes="nodes" :net-links="links" :options="options" :link-cb="link_cb" />
20+
<d3-network :net-nodes="nodes" :net-links="links" :options="options" :link-cb="link_cb" ref="net" />
2121
<svg width="0" height="0">
2222
<defs>
2323
<marker id="m-end" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto" markerUnits="strokeWidth" >
@@ -63,7 +63,8 @@ export default {
6363
nodeLabels: true,
6464
nodeSize: config.node_size || 16,
6565
size: {
66-
h: config.height || 400
66+
h: config.height || 400,
67+
w: config.width || undefined
6768
}
6869
}
6970
}
@@ -155,6 +156,13 @@ export default {
155156
}
156157
})
157158
}
159+
},
160+
mounted () {
161+
setTimeout(() => {
162+
if (!this.options.size.w) {
163+
this.$refs.net.onResize()
164+
}
165+
}, 100)
158166
}
159167
}
160168
</script>

0 commit comments

Comments
 (0)