Greg Hewgill (ghewgill) wrote,
Greg Hewgill

mandelbrot set viewer

A couple of years ago I had the idea to build a Mandelbrot set fractal viewer in the spirit of Google Maps. Google Maps itself has a method to display your own map data by implementing a "tile" server, but it seems specifically oriented toward geographical data and doesn't have features like arbitrary zoom depth (which you'd clearly want for fractals). I looked around for other similar generic solutions and didn't find anything at the time.

Back then, I implemented a drag-scrollable zoomable fractal viewer in Javascript from first principles. This involved doing all the crufty cross-browser compatibility work myself, which was really annoying and very nearly took all the fun out of the project. Recently, after playing with jQuery a bit, I thought it would be good to go back to the fractal viewer and reimplement it using jQuery.

You can see the results of my efforts at my Mandelbrot set viewer.

The controls are pretty much what you'd expect. Panning and dragging work as expected (but sometimes you have to wait for the tile server to keep up). The zoom control zooms in 2x for each step, with an effective upper bound limited only by the floating point precision of Javascript. Double-clicking zooms in 2x on a particular point on the plane. The currently-unlabeled button below the zoom control allows you to generate a larger (desktop-sized) snapshot of your current view.

I was talking to Phil today who suggested I look at OpenLayers. Sure enough, in their Gallery there is already a Fractal Browser which does almost exactly the work that I've already done!

Once again, somebody out there on the internet has already thought of the same idea. Nevertheless, I'm happy with my viewer (even though it's not everything I had envisioned yet) and I think I'll leave it as is and move along to something else. Finally, because this is Open Source Wednesday, you can find the code in ghewgill/mandelbrot on GitHub. Enjoy!

  • 2013 in review

    2013 is the year when everything changed. The biggest event was the birth of our daughter Lily. She was born prematurely in Shanghai while we…

  • 2012 in review

    2012 has been fairly quiet. Maybe it just seems that way because I haven't actually written anything new in this blog since last year's annual…

  • new photo galleries

    I've been busy processing photo galleries from the last year (or two) and putting them online for your perusal. Vancouver 2010 Northland…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded