Fisheye Component v0.3

May 13th, 2006

A few days ago I was idly browsing the web when I ran across a nice little DHTML animation that zoomed in on text as you moved your mouse around it. The effect reminded me of the Fisheye Menus developed by Ben Benderson at the University of Washington. I remember reading about the concept years ago and thought was a great little bit of UI innovation. Well, one thing led to another, and shortly thereafter a Flex component popped out.

Try out a demo below…

I’ve been poking and prodding it in my spare time, and decided it’s far enough along to put out for anyone to play around with. So without further ado, here’s the Fisheye component v0.1. It’s available under the MIT Open Source license, so feel free to use it or modify it in your own applications.

* 1D Demo
* 2D Demo
* Download Source

A couple of notes:

### Flash vs. Flex
One important goal with this component, as with a bunch of things I’ve been working on lately, is to help the community see how you can merge the best of what flex gives you (productivity, development process, consistent component model) with the best of what people have been doing in flash for years (rich, highly interactive, fluid, etc). The SDK’s GUI components provide a lot of value, but they’re really just the tip of the iceberg of what’s possible with Flex. Hopefully these kinds of demos whet your appetite.

### Item Renderers
The Fisheye component is based around the concept of itemRenderer factories, just like the flex list and charting components. The goal is to use composition to separate behavior from content, so you can reuse the basic fisheye effect across many different applications and uses. Take a look at the source and see how it’s done.

### states as a contract
I’m experimenting a bit in this component with the idea of using view states to communicate state information form the component to its item renderers. In addition to telling the Fisheye component what to use as its item renderer, you can tell it what state to put the renderer in when it’s hilighted or selected.

It’s a nice idea, but it’s complicated by the fact that there’s only _one_ state variable for each component. With this approach, for example, you couldn’t have the fisheye menu use states as a contract _and_ have the item renderer itself use states to control whether or not it’s expanded or collapsed.

For what it’s worth, we actually identified this limitation when we designed states for Flex 2. We sacrificed this use case in favor of the simpler approach on the belief it would make it easier to understand and use in the more general case. I’m still hoping we can find a way to get the functionality in the next release.

### Separating layout from intent

The Fisheye component uses a pattern that’s been coming up a lot lately where the _intended_ layout of the component is not the same as the _actual_ layout.

In this case, the fluid animation as you move the mouse across the component is built by migrating the actual layout of the renderers towards the intended layout (as determined by the mouse position) over time. Over and over again, I find myself writing layout routines that update external structures rather than the components themselves, and update routines that use a variety of algorithms to reconcile them.

It’s come up enough now that I think I’ll try pulling it out into a reusable ‘mixin’ for my next project.

### Styling

I borrowed the styling used in the explorer from a mockup by one of the excellent designers on the Adobe Experience Design team, Ty Lettau. Thank god for designers.

### Limitations

I’m a little embarassed to point out the original Fisheye Menu as an inspiration for this, since at this point I’ve really only copied the form and not the function. The Fisheye menu is intended as an alternate way to present a large list of information on one screen without having to resort to paging or scrolling.

But this Fisheye component doesn’t make any attempt to fit the contents to its space on screen. RIght now the layout is determined entirely by the value of its styles.

In the next version, I hope to have it dynamically adjusting those values to keep the items constrainted within the component’s bounds.

## Useful?

Personally, I think the real promise of Flex is in the marriage of the productivity of the platform with the expressiveness of flash. But I’m curious what you think. Where should the flex team be spending its time in the next releases? On features that make it easier to build ‘expressive’ content like this? Or elsewhere, on other things? Like what?

Leave a comment, let me know what you think.

8 Responses to “Fisheye Component v0.3”

  1. Quietly Scheming » Blog Archive » Fisheye Updated for Beta 3 Says:

    [...] I’ve udpated the Fisheye demos to Flex 2 Beta 3, and moved it to its own page. [...]

  2. James Ward’s Blog » Blog Archive » Flex at JavaPolis - “Umm That’s Sexy!” Says:

    [...] Last night Christoph and I built a little Flex app with Ely Greenfield’s FishEye component, to show all the people who have visited our booth: If you are at JavaPolis, we are having two more sessions on Friday: [...]

  3. dougmccune.com » Blog Archive » Demo Mashup of various Flex 2 community components Says:

    [...] Here’s a little demo Flex app I put together. It’s another MXNA RSS reader (I know, I know, like there aren’t anough of those already). But really I didn’t start out making an RSS reader, I started playing with Ely Greenfield’s FishEye component. Then I figured it would be cool to have the icons I used for the FishEye component rotate a badass 3d cube thingy, which uses the awesome distortion classes from Alex Uhlmann. And of course it’s got to have the requisite web 2.0 reflection, which was made by Ben Stucki. Then I figured that I should have something sweet displayed in the rotating cube, and I remembered Josh Tynjala’s TreeMap component. And I remembered seeing a demo of an MXNA reader that Josh had made using that TreeMap component, so that’s how I ended up making another RSS reader. [...]

  4. dougmccune.com » Blog Archive » Updated MXNA RSS Reader Flex App - Now With Source Says:

    [...] FishEye component from Ely Greenfield [...]

  5. Robert Shiue’s Blog » Blog Archive » Excellent Flex Extensions Says:

    [...] Fisheye Component [...]

  6. Code Sweat Blog » Blog Archive » Some Flex 2 Related Links (pt. two) Says:

    [...] Quietly Scheming » Fisheye Component v0.3 [...]

  7. » Adobe Flex Samples Raduti’s Playground Says:

    [...] Ely Greenfield :: FishEye Component :: More info [...]

  8. 9 Opensource Fisheye Menus Says:

    [...] Fisheye Component v0.3 Text and Images [...]

Leave a Reply