Seven Orders of Magnitude

john's Avatar

john

Apr 13, 2015 @ 09:50 AM

I was curious just how far I can zoom into and out of the NodeBox Canvas. So I made this extremely simple example, NodeBox file and screenshot attached.

The NodeBox network consists of seven rectangles of different widths and heights joined by a combine node.
  - The first rectangle is .1 x .1
  - The second rectangle is 1 x 1
  - The third rectangle is 10 x 10
  - The fourth rectangle is 100 x 100
  - The fifth rectangle is 1000 x 1000
  - The sixth rectangle is 10,000 x 10,000
  - The seventh rectangle is 100,000 x 100,000

The rectangles are centered vertically on the X axis and positioned so that each rectangle is immediately to the right of the preceding rectangle (with just a bit of empty space between). On my 2560 x 1440 monitor I can zoom out so that all of the seventh rectangle is in view (as shown in the screenshot). When I zoom in as far as NodeBox will let me, the first rectangle is small but clear, about the size of the head of a pin.

Could I see a million x million rectangle if I had a big enough monitor? Perhaps Frederik can comment. But for all practical purposes it appears we have about seven orders of magnitude to play with.

John

  1. Support Staff 1 Posted by Frederik De Ble... on Apr 13, 2015 @ 05:30 PM

    Frederik De Bleser's Avatar

    I can answer!

    The viewer zooms in to a scale of 6400% and out to a scale of 1%.

    See https://github.com/nodebox/nodebox/blob/master/src/main/java/nodebox/client/Viewer.java for the source!

    Best,

    F

  2. Support Staff 2 Posted by john on Sep 11, 2015 @ 02:13 AM

    john's Avatar

    A followup...

    Yesterday I was curious about how much of a size range I could export from NodeBox in a single PDF doc, so I did some experiments.

    There seems to be an upper limit of 14,400 by 14,400 pixels for PDFs. I wanted to see how this worked on an iPad, so created a world map that was 14400 by 10800. I put a red dot over the San Francisco bay area and inside that dot wrote the names and titles of 36 of my colleagues who work there in 5 and 2 point Verdana. Next to one of these names I placed the first sentence of the Gettysburg Address in .5 Verdana and above that an even smaller sentence in .25 Verdana.

    I then tried viewing this doc from various apps and browsers on the Mac, PC, and iPad. The results varied. Some apps/browsers let me zoom all the way down to .25 Verdana; with others I couldn't even clearly read the 5 pt. names inside the dot.

    The best results came from an iPad app called PDF Expert (which can be called directly from another great app called Documents). The zooming was quick and buttery smooth; the doc looked great at every level. It's wonderful pinch-zooming into something like that.

    I am creating some large and dense visualizations that I need to share with people who don't have NodeBox. Large PDF exports is an interesting option and you could pack a lot into 155 million pixels. Just be aware that not all people will be able to zoom all the way down.

    John

  3. Support Staff 3 Posted by john on Sep 11, 2015 @ 01:41 PM

    john's Avatar

    A followup to my followup...

    NodeBox supplies an ample range of magnitude but when pushing the boundaries there is another limiting factor: memory and performance.

    To test this limit, I created an array of randomly colored "person dots", each drawn at a size of 4 pixels with a random person name drawn in .5 point Verdana. A block of 100 such dots fits in a rectangle of only 45 x 45 pixels and is quite easy to read at full magnification (PNG screenshot at less than full magnification attached).

    In theory, I could fill my 14,400 by 10, 800 PDF with 7.68 million of these dots!

    I was able to make ten thousand without too much trouble; NodeBox became sluggish, but it drew them. I was able to double this to 20,000 dots. But when I tried for 30,000 NodeBox spun its wheels for a few minutes and eventually coughed up the following error message:

    "Out of memory. Are you trying to process an infinite list?"

    I thought I might be able to reduce the overall calculation load by saving 10,000 dots at a time in an SVG file and rendering that multiple times, but this only made matters worse. NodeBox stores text as shapes so 10,000 names is a lot of shapes to draw. The SVG file weighed in at 83 megs and took four minutes to load! I could draw two of them, but not three.

    So while there is theoretically space for millions of text strings in a single PDF, the true upper limit is more like ten thousand.

    John

Reply to this discussion

Internal reply

        No formatting (switch to Markdown)

        Already uploaded files

        • seven-magnitudes.ndbx 2.58 KB
        • seven-magnitudes.png 167 KB

          You can attach files up to 10MB

          If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

            Keyboard shortcuts

            Generic

            ? Show this help
            ESC Blurs the current field

            Comment Form

            r Focus the comment reply box
            ^ + ↩ Submit the comment

            You can use Command ⌘ instead of Control ^ on Mac

            Recent Discussions

            11 May 02:07
            09 May 13:15
            07 May 03:57
            06 May 06:46
            06 May 02:15

             

            21 Apr 10:47
            21 Apr 10:41
            21 Apr 05:56
            19 Apr 19:17
            18 Apr 00:04
            14 Apr 22:18