locked
Maintain size/zoom of nodes regardless the quantity of nodes RRS feed

  • Question

  • I wonder if it is possible to maintain the same size of nodes, no matter how many nodes gets rendered (because now the size of each node depends of how many nodes are there to display).

    I found a similar post where Lev points out that this could be achieved with this code: 
    gViewer.ZoomF = Math.Max((double)graph.Width / (double)gViewer.Width, (double)graph.Height / (double)gViewer.Height);
    but I can't use it since I don't have "gViewer" (it's a web app, server side code).

    Any suggestions?
    Thanks


    • Edited by Emmanuel03 Thursday, October 18, 2012 3:40 PM
    Thursday, October 18, 2012 3:39 PM

Answers

  • Hi Emmanuel,

    You probably should use your client rectangle.Width and .Height  instead of gViewer.Width( Height) in the formula above to calculate the scale.

    Thanks


    Lev Nachmanson

    • Marked as answer by Lev Nachmanson Thursday, October 18, 2012 9:18 PM
    Thursday, October 18, 2012 9:18 PM