Recently I have spent a considerable amount of time researching data visualization techniques using Flash and AS3. The main driving force for this research was to inspire first year Digital Media students without allowing them to be intimidated by AS3. To make the process of visualizing data in AS3 less daunting I have started writing a toolkit of classes the students can use to bypass some of the fundamental and structural elements of visualizing data. This way the students can concentrate on the creative and experimental aspects of the visualizations and achieve results at a much faster rate.
Here is one of the classes I have completed that I believe to be quite useful. The purpose of the class is to convert time into units along an axis. The class takes the start time and end time for a period of data collection and maps that across either the x or y axis. The class has a getPoint method which you can pass any time within the data collection period and it will return the point in pixels along the specified axis.
Once an instance of timeToAxis.as has been defined only two lines are required to start utilising the class for example:
converter.setAxis(“12:00:00″, // The start time
“12:05:00″, // The end time
“x”); // the axis to apply the units to
trace(converter.getPoint(“12:02:00″)); //get a value along the defined axis
Anybody is welcome to use this class I just hope other people find it as useful as I do. However I would love to know any improvements that could be made to the class and how it has been implemented.