Visualize Digg data in treemaps : 2 (now with pretty power)

I have finally finished my Digg Treemap application. The application is called DiggGraphr (couldnt call it DiggMapper since everyone expected a yahoo map to come up at some time). Anyway here it is in all its glory.
The application was developed in Flex since I am porting my treemap classes to Flex right now. However the core logic is still the same as my earlier As3 implementation.
You can right click to choose which page you want to go to (Digg or source). You can also click on the channels button to choose a particular channel you want to read. Drag the slider around to change the number of stories you want to see in the containers.

This application will die soon since today Digg clamped its api behind a application id and I dont have one yet. But before it dies, do Digg it if you like it.

Link: DiggGraphr

Have you tried the new fan application yet?

I am trying to gather some feedback and/or feature requests on our major Flex application, the Fan. The feature page is here on the CIM labs page. I have a big “how we did it” entry here.

Remember its still an alpha launch so things may act a little wonky once in a while.

If you have any suggestions, please leave them as a comment here.

thanks

Fan 4.0 alpha: Anatomy of a kick@$$ Flex app

The application I have been working on for the last month and a half finally hit the Comcast Interactive Media (CIM) Labs page. You can launch the application from here.This should still be considered alpha since this is one state of the completed application. Once completed, the application will include the Circular view of the fan that is the traditional view of the Fan, with the ability to switch between the views. I thought I would quickly write some notes on the experience of writing the application that will be in front of a LOT of people very soon.

Why Flex ?

We have some of the best Flash developers here at CIM working in a very traditional software development method. All of our code is written in reusable classes with modularity and startup speed as the primary focus. So to use Flex, something new to a lot of the team, instead of Flash was not a decision taken lightly. The biggest objection was always the size of the swf file generated. However, looking at the design we saw that almost every Flex component was used in the final version of the application. Since new components add only a marginal size to the swf once you have accepted the framework, it seemed to be a good case for using Flex. I would also like to dispel a myth at this point: Filesize does not slow down an application as much as network latency does. If your application pings a server multiple times to get startup data, its going to be much slower than one that loads in all the data at once. So we tried to keep startup calls to a minimum. The Fan also serves only the Comcast high speed cable internet subscribers so we were guaranteed the high speed connection. Moreover, its easy to write a component that does most things right but people tend to forget the small nuances. For example, if you write a drop down box, do you check to see that you may be on the edge of the Flash canvas and may need to drop up to render properly? Most people forget the small things that kill the experience.

Flex Skinning:

We had heard a lot of scary stories on how difficult it is to skin Flex. I think the core reasons people dont skin Flex applications is because the default look seems fine when you start the development (maybe adobe did too good a job on the default look 😉 ). I would like to say, skinning Flex isnt that hard, especially using graphic assets from a swf or something. Skinning in code is a lot more involved and needs a deeper knowledge of the framework. We started with simple symbols-in-a-swf method and later moved to code based skinning. I did run into a few issues with some components where designers wanted the tabs to bleed into the browse-area but Flex kept clipping my skin. We’ll revisit that and I’ll update everyone once I have an answer. But besides that skinning flex wasnt that difficult.

CSS and Runtime style changes:

This was another reason Flex won over a simple AS3 implementation. There were designs around differently skinned instanced of the application and even though we did have a home-grown skinning framework, the one that Flex offers was much more mature. I already have a few prototypes for skinned instances and they work pretty well. The only thing we needed to learn was how to switch graphical assets at runtime since thats a little more work but at the end it was easy to implement.

Custom components, renderers and AS3 wrappers:

There are a couple of custom components in this application but without styling, the application is just a custom video-player, a panel containing a list and a canvas with a tilelist and tab-bar. All the list elements have custom renderers that represent the data. There are some interesting features to note here:
1) The numbered playlist renderer has the number value bound to its index in the list using the itemRendererToIndex property
2) The tilelist renderers have a start animation delayed by a multiple of their row index making the startup animation a lot more interesting.
3) The color of the playlist renderer changes based on if the video is playing or not. This is via the dataBinding classes. I actually have a function bound to the setter of the ‘isVideoPlaying’ property. Again, this required some learning on my part.

The video player itself was written in raw AS3 since we will embed videos at other places outside the Flex environment. So we wrote an AS3 wrapper that listens to Flex events and then calls resize, play pause events on the player. The player talks to Flex via the wrapper as well. Buttons/scrubbers , input boxes etc inside the player were custom classes written in AS3 in the spirit of Flex but not within the framework.

Reverse migration to 9,0,16,0:

This was something that came up that had me stumped for a while. The application worked on a bunch of computers and then wouldnt on others. It was only later I realized that I was using events exposed in the 9,0,28,0 release and since I had Flex 2.01, my code complete suggestions would expose those events and I would use them and it would work great. 9,0,28,0 has api extensions to the player not available in 9,0,16,0. I was using the addedToStage event and that was crashing the app on others machines. And since they didnt have the debug versions, I couldnt view the stack traces. Now like any good developer, I have my debug player set to 9,0,16,0. If you are developing a Flex app that doesnt use fullScreen (or even if it does) make sure it is 9,0,16,0 friendly. You can use the flash.system.Capabilities to check the users Flash player version.

So how was the experience?

The new features in AS3 are just amazing to work with and Flex is just the icing on top! The feature I loved most is the new E4X XML parsing. There are elements in the application that do some non trivial XML parsing and it could all be handled so easy using E4X. At one point I wrote a code that ran through XML, created objects and stuffed them in an array to use later (a-la AS2) and then refactored all the code to just store the XML as a variable and run through it as I would an array. AWESOME !

Custom events rock and stack traces are beautiful to see (umm..not really but you know what I mean).

The other cool thing was the decoupling of UI symbols and the ability to instantiate them in code. All assets are referenced through an AssetManager (Singleton) class that holds the references of the images. These can be swapped easily even at runtime.

Custom namespaces gives us an easy way to grant limited access to properties rather than making them public.

Issues?

No onReleaseOutside event. We went around this by listening to release events on the stage. Every DisplayObject has a reference to the stage so that wasnt too crazy, but seems hack-ish.
Flex builder really needs to know the targeted version for the application and surface events only available on that. Would have saved a lot of time on the backward migration to 9,0,16,0

Lack of private constructors kill the Singleton pattern although there are implementations that do the job, but again: hack-ish.

Depth management is tricky since you cannot allocate a number value to the depth. For an AS3 implementation for buttons, I would have loved to have created the icon on depth 500 and do all the sprite swapping under it. Since rollover, rollout sprites arent created until the event, you have to add them to the depth of the icon making it move up.Not too bad but it gets complicated if you are adding/removing children often.

All in all, phase 1 was really fun (and fast). I have 2 tips for anyone looking into Flex for hardcore development.
1) Know the properties and events available. A lot of properties exist in the framework that I had never used before. Case in point: We were HRule objects or some graphical UIComponent to separate a list from the lower content via a blue line. Turns out Lists have the border style where you can create borders around any or all the sides. All we ended up doing is just creating a pixel border at the bottom. Saved us some memory.

2)Understand data binding. While using the [Bindable] meta tag is convenient, it isnt a panacea. It took me a while to figure out how to use the ChangeWatcher and the BindingUtil class to conditionally bind to different objects (since item renderers are reused in the list as you scroll and you may need a very granular level of control). Maybe I can post something on that later unless someone has seen a good resource on that (please leave a link if you have).

Drop me a comment and let me know what you think so far.

As always, we are still looking for talented Flex / Flash developers so drop me a line at arpit_mathur [at] comcast.net if you wanna be part of the team.

update:

Fan 4 on the blogs (not all flattering of course 😉 )

Mike Potter on Riapedia
Ryan Stewart on ZDNet
Ryan Stewart’s blog
Pete Cashmore on Mashable
Riability
Shelly Powers on burningbird
Cable 360 article: ‘ Comcast Expands Web Video In “Convergence Revolution” ‘
The fan is also featured on scalenine.com

Webby nominees are out !

The nominees for the webby awards are out. Check them all out here. Almost every site is amazing to look at and learn from. The one thing that tickled me a bit was the nominees for the “Best Navigation/Structure” are predominantly Flash and/or multimedia based. I love seeing that and then reading the “Flash breaks navigation” paragraphs on Jakob Nielsen’s ‘Flash=99% bad‘ article.

I got dugg and blew it ;)

This is hilarious: I was followed a link off of metah’s blog to a java application called Google Browser by Touchgraph.which apparently maps how websites connect to each other. Of course, I tried it with this site and I saw a link from digg coming in. Following it I found that Brajeshwar had actually seeded my DiggMapper application. And in keeping with Murphy’s law, that was the night I moved some files around and actually blew the location of the swf the application was loading in. Hence most of the comments are “this sucks, it doesnt work at all !”.
Either way, I did get a few diggs and hey, I formally have a dugg application :).

The page on digg is here. I never finished DiggMapper but now I am psyched enough to finish it and make it all pretty :).

Thanks Brajeshwar.

WordPress in Flex/AS3

As some of you, who wandered over to Gabo’s blog recently may know, Gabo is trying to create a flash UI for WordPress. I gave me a peek earlier this week and all I can say is its gonna be awesome. Of course his one requirement was getting the data out of WP in XML so he wrote some custom PHP code for that. However there is an XML-RPC interface to WordPress and I decided to see if I could quickly whip up something using it.
Turns out I didn’t even have to write an XML-RPC library, since there already is one written by Akeem Philbert. So I just wrote a custom WordPress class extending his class and ta-daaa. This is just the first stab at the implementation and its not feature complete yet (ie, not the complete API has been implemented). But if someone wants to use it, go ahead and try it out.

Note: The XML-RPC library always authenticates against WordPress to get data. Data is also sent over HTTP-POST so is exposed if someone uses a browser traffic sniffer. So I recommend creating a new user on WordPress with only ‘subscriber’ privileges and using that if you are creating a public application that doesnt need authentication.

Note 2: The XML-RPC implementation can be used to post, edit and delete entries as well, so if someone wants to make a blog manager application, you can use this as well.

View the Flex WordPress app here and right click to view source.

To compile the application, you will need to download the as3-rpclib library from here

Got Gabo ?

We do !!! Remember gabocorp? remember the reason half of us got into flash? yep…same guy. Gabo is in charge of the user experience (UX) team here at Comcast. And he finally has a blog. So head over at gabocorp to check it out. And of course, we are still looking for flash developers, flex developers, architects and UX team members, so if you want to work with gabo and me, drop me an email at arpit_mathur [at] comcast.net.

My code is on FlexBox and code inspired by my code on FlexLib

This is cooooool. FlexBox features my Squarified TreeMaps code. Plus FlexLib has the SuperTabNavigator component that Doug McCune developed using my earlier closeable / draggable Tab Navigator class. So my ‘six degrees of separation‘ has Mike Chambers,Ted Patrick, Doug McCune and Darron Schall. I am psyched !!!

I am still working on the final releasable swc for a Flex component for the Squarified TreeMaps but I do have it working: check out my DiggMapper app.

Showing XML structure in a Tree

This is a subcomponent of a larger application I am working on but is a pretty neat widget on its own. The code loads any xml file on the www thats accessible to Flash and renders it as is. All attributes are rendered in a node named __attributes and have a different icon than node icons. This took me a couple of hours but is interesting if you are making the leap from the XML Object in AS2 to the e4x way of AS3. The app can be seen here and the source can be seen here



Whats interesting is xhtml stuff comes out looking pretty clean as well. Anyone thinking dom-reader type application ?

2 years : wow we did that ? (plus do you want in ;) ?)

Its been a fun two and a half years at Comcast. Well, crazy at times but when you lean back and look at the big picture, it does feel amazing to have created applications that, well, are so much fun!. So I decided to write a post on it and since we are looking for new talent as well, ping the blogosphere to see if anyone wants to join our growing team.

First of all a disclaimer: this is a personal blog entry and please do not put comments in here that should be directed to Comcast. I am putting this up for a few friends and as a personal archive as well so that I can look at it 5 years down and be like: “oh yeah that was fun”.

Explore and Express: RIA before RIA was a buzzword

When I joined Comcast, we were launching what is now the current portal. Way back then when Flash 7 had just about come out, to make that the technology on the homepage of one of the top most traffic-ed websites took guts. But we did launch Comcast explore and Comcast Express. Running on an elaborate AS2 architecture, with interactive modules pinging a large number of services for weather, movies etc and elaborate personalization features, the portal still is used in conversations as a testament to the power flash had even 2 years ago. While explore was 80% flash, Comcast express was a 100%-flash news based RIA.

explore

express

The Fan 3.0: thinking outside the box

One of the most famous icons of the Comcast portal is the circular video player called the Fan. Early 2006, Fan 3.0 was launched. The fan is probably the most unique RIA out there. With features like drag and drop enabled blades as a metaphor for rearranging and managing playlists, video search, playlist integration and a more conventional view for the more traditional video watcher, the fan is definitely one of the most unique apps out there. The fan also won the peoples’ choice award at Flash Forward 2006 at Austin.

fan

Game Invasion:sweeeeet

This is definitely my fave project here. When we developed gameinvasion, the flash team was called on to implement a compelling entry point experience for the application. The result was the circular navigation for the top 10 shows of the day (hmm…circles again, I am sensing a theme here;) ).

gameinvasion

The shows themselves are once again 100% flash applications giving users the ability to browse images,reviews and videos on the latest games. Its always great to be able to say you are debugging an app when you are watching Master Chief kick @$$ :D.

Ziddio: Smile…you are on TV

Ziddio, which came out recently, is a beta application that allows users to upload their videos for online contests and win amazing prizes….plus winners get their videos on the Comcast on demand channel. Now where is my camera….

ziddio

Whats next:

There are a lot of really cool projects coming out soon. If you are into flex, then you’ll love some of the new things that come out. In the meanwhile, keep your eyes on labs.comcast.net. Oh and while you are at it, check out my previous entry on my return to work after vacation, just to show how crazy we really are :). In the meanwhile if you are interested in joining my team, do drop me an email at arpit_mathur [ at ] comcast.net.

Cheers.