almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.85k stars 1.48k forks source link

fullscreen #1917

Closed joaofgf closed 7 years ago

joaofgf commented 8 years ago

is there a way to make network fullscreen by clicking a button? thanks

jordanA29 commented 8 years ago

It is possible but you will have to add the buttons ( your own ones) manually to the "vis-navigation" div. You can have a look at this example http://tiddlymap.org/.

Regards, JordanA

Tooa commented 7 years ago

This should work with angularjs and angular-screenfull. You should get the idea.

style.css

.vis-fullscreen-button {
    right: 15px;
    bottom: 90px;
    background-image: url("assets/button.png");
}

network.html

 <div ngsf-fullscreen="NetworkController">
   <div id="mynetwork">
    <vis-network data="graphData" options="graphOptions" layout-fill events="graphEvents"></vis-network>
</div>
</div>

NetworkController.js

  function addNetworkButton() {
       var panel = angular.element(document.getElementsByClassName('vis-navigation')[0]);
       var button = $compile('<div class="vis-button vis-fullscreen-button" ng-click="NetworkController.toggleFullscreen()"></div>')($scope);
       panel.append(button);
   }
mojoaxel commented 7 years ago

closing because of inactivity