Posts Tagged “Flex”

I’ve promIsed my next article would be on Spring 3, as part 3 in my series on the web application. However, I’m going to take a little segway to a neat solution I’ve come up with for a common requirement that is a little tricky to solve. Copying data out of a data grid and being able to paste that data into Microsoft’s Excel.

Flex is often used for displaying and calculating many different metrics. Sometimes a new metric, or a one off request will come in to see the data in a slightly different way or with an additional calculation. A lot of times the one off requests don’t illicit a development investment to get the new analytic. Others might be too much of an immediate need and a development cycle would take too long. For this the ability to export the data to a less than friendly(IMHO), but standard and well know tool is a huge plus. Enter stage left…. Copy to Excel.

Copy the entire contents of the grids (both AdvancedDataGrid and DataGrid are supported, I wish these implemented a common interface) by not selecting any rows, or just the selected rows by selecting them (use shift or ctrl with click to multi select/deselect). This will call a static method in a util class (source available) that takes a single parameter, the grid itself. All data conversion from its dataProvider is handled, along with a header row with the headerText and if any of the fields use a labelFunction, that too is called to formate the data.

This is released under the MIT License, and is free for anyone to use/modify/distribute as they see fit. Just give props back here somewhere in the source.

Comments No Comments »

**UPDATE**

So I realized I overlooked a few datails on the heat map. First, I hardcoded into the component the starting location and zoom of the map. Second, I did not expose any of the awesome geo-locating code that allowed adding markers to the map from a standard U.S. Address (or most others for that matter). So I added those features, as well as clearing up the add points by click button by changing it to a checkbox. Below is a picture of the newer version with Cincinnati’s City Hall marked on the map and some example data, pretend its sales in the Cincinnati area or something.

heatmap2

So one of my interest is data visualization. Good thing I happen to be proficient in one of the best technologies for displaying data sets in new an interesting way. I first ran across a heat map in the package I use to track statistics on this very site. http://www.phpmyvisites.us/ What they did is take a picture of your page and track user clicks, which can be infinitely useful for someone who is trying to optimize how users navigate their site. (not that I do too much of that here.) Essentially it shows you where many clicks amass, causing certain areas of the site to “heat up”.

I used Google maps, both because this could be used for just a map api wrapper, and because I’m a bit of a cheerleader for Google. Let me know what you think, It’s not the prettiest, but its been a fun little project. Binarys to come…

Source here.

Example here.

Comments No Comments »