Monthly Archives: November 2007

Open Source Flex Component: TreeMap

For some time, I’ve been working on a component to display treemaps in Flex applications. A while back, I put the source code in a public repository, and it was set free. I’ve received a lot of great feedback since I released the code, a few helpful bug reports, and I thank everyone who’s played with it already. Today, my TreeMap component for Flex reached an important milestone. I’ve marked it version 1.0, and I created a proper zip download containing the SWC, source code, API documentation, and several examples. You can download the package on the TreeMap project page right now.

I put together several examples. Take a look at a few of them:

Screenshot of TreeMap Component Stock Market Example

Stock Market (source). A TreeMap displaying fake stock data. The weight (size) of each item corresponds to the market cap and the color is the percentage price change.

Screenshot of TreeMap Component and Tree Comparison Example

TreeMap and Tree (source). The TreeMap component side by side with a regular Flex Tree. Both are displaying from the same data provider.

Screenshot of TreeMap Component Selection Example

Selectable TreeMap Nodes (source). Demonstrates a TreeMap with selection enabled.

The TreeMap component is now available under the terms of the MIT open source license, so it may easily be used in both commercial and open source projects. Please download the component, mess around with it, read the documentation, and have fun. Be sure to submit bugs if you find any.

Some Controversy over ECMAScript 4

Last week, I presented a first look at ECMAScript 4, the standard that Adobe uses as a basis for ActionScript. What I hadn’t yet discovered when I posted is that ES4 has caused a bit of controversy among the wider web developer community. We developers on the Flash side don’t always stay in touch with the developers using JavaScript, so I thought I’d highlight some of the arguments and conversations.

Some prominent JavaScript developers, including Douglas Crockford (creator of JSON and a fellow Yahoo) and some folks from Microsoft, believe that the changes in ES4 are too drastic and don’t address problems that should have been fixed. Douglas points out that JavaScript is inherently unsafe, and he argues that ES4 does nothing to fix the security risks. Another common argument is that nothing proposed in ES4 adds functionality that couldn’t be done in the previous version. In short, what’s more important? New functionality that wasn’t available before or better syntax for existing functionality?

The new syntax makes ECMAScript more like traditional programming languages, but the language also aims to stay backwards compatible with the current version. In other words, you can build classes using the new class syntax or you may use prototype like JS developers do today (sort of like how AS1 and AS2 gave us these same options in Flash for a long time). It raises a question in many minds, “Why?”.

The web may face an ugly transition involving widely different coding styles, and poor support for the new syntax across browsers. After almost a decade, developers encounter many differences across implementations of the current version of JavaScript. With so many new syntax options, bugs may cause heavy incompatibilities among early implementations of the new version. While the previously-mentioned version transition in ActionScript was mostly smooth, the browser world has a very different ecosystem that could make widespread adoption of the syntax changes more difficult.

Links

An interesting discussion overall. I’ll be watching with fascination to see what happens to “the language of the web” over the next year. Do I expect major changes to ES4 that could affect the next updates to ActionScript? Not particularly, but the desire for a language that stays true to JavaScript’s current version is strong among those that oppose ES4. I can’t say whether another JS-like language will be proposed as an alternative to ES4, but it’s certainly a possibility. I’m curious to see what happens.

Update: New information about this topic is available in my article How will ECMAScript “Harmony” affect ActionScript 3.