It is just an answer, as I could not find the answer myself, so wrote it for community. Some commented out code to play with too.
<div id="map"> </div>
<script type="text/javascript">
    function getMapHeight() {
        return (window.innerHeight - 90);
    }
    $(function () {
        let options = {
            autoResize: true,
            // width: '100%',
            height: getMapHeight() + "px",
        };
        let network = new vis.Network($("#map"), data, options);
        $(window).on('resize', function(){
            network.setOptions({
                // width: (window.innerWidth - 100) + "px",
                height: getMapHeight() + "px",
            });
        });
    });
</script>
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With