MCPcopy Create free account
hub / github.com/adobe/Marinus / resize

Function resize

web_server/public/javascripts/draw_graph.js:757–792  ·  view source on GitHub ↗
(showDocs)

Source from the content-addressed store, hash-verified

755 desiredDocsHeight = 300;
756
757function resize(showDocs) {
758 var docsHeight = 0,
759 graphHeight,
760 $docs = $('#docs-container'),
761 $graphCtnr = $('#graph-container'),
762 $graphBox = $('#graph'),
763 $graphSVG = $('#graph-svg'),
764 $close = $('#docs-close');
765
766 if (typeof showDocs == 'boolean') {
767 showingDocs = showDocs;
768 $docs[showDocs ? 'show' : 'hide']();
769 }
770
771 if (showingDocs) {
772 docsHeight = desiredDocsHeight;
773 $docs.css('height', docsHeight + 'px');
774 }
775
776 let graphElement = document.getElementById('graph');
777
778 graphHeight = window.innerHeight - docsHeight;
779 $graphBox.css('height', graphHeight + 'px');
780 $graphSVG.css('width', graphElement.clientWidth + 'px');
781 $graphSVG.css('height', graphElement.clientHeight + 'px');
782 $graphCtnr.css('height', graphHeight + 'px');
783
784 if (graph.simulation) {
785 graph.simulation.force("center", d3.forceCenter(graphElement.clientWidth / 2, graphElement.clientHeight / 2));
786 }
787
788 $close.css({
789 top: graphHeight + docsClosePadding + 'px',
790 right: window.innerWidth - $docs[0].clientWidth + docsClosePadding + 'px'
791 });
792}
793
794/* eslint-disable-next-line no-unused-vars */
795function doZoom(event, obj) {

Callers 3

draw_graph.jsFile · 0.70
selectObjectFunction · 0.70
deselectObjectFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected