- Package the Visualizer for simple jar release
- Fix Error with Visualizer labeling.
- Research Javascript Unit Tests
- Adjust the Monitor to change unit measure to minimize the number of visible digits.
- Adjusting the Monitor’s refresh timing
- Apply URLs to both Visualizer and Monitor that allow copy&pasting of URLs to get same output.
Similar to last week I took on the Visualizer components (1,2,3) , Edward handled the Monitor (4,5), and Bao (all but mostly 6) passed through the between. With our goals set we went to work.
First off I packaged the Visualizer similar to the steps we had taken to Milestone 1, creating a self-contained jar file which could run the visualizer (download here). Unfortunately after releasing the download an error was found regarding the naming of sources. When sources took long to return information they were passed by the following queries resulting in the names being transferred to another source.
The problem especially occurs with virtual sources (the simulation sources which are a collection of other sources added together).
(Example: Notice SIM_WAIAU, a virtual source of all SIM_WAIAU sources has lower values in this chart)
This became the puzzle block of the week, since my efforts from the past week to attach the source to the labels seemed to work in other instances. I had investigated and after talking with Robert several times about steps to take he had advised me to ask the Google Visualization API Google Group over the matter.
While they responded quickly and provided me with a two ideas (either to make each query have a unique return process or have the server give an extra variable, both of which don’t seem possible) the inspiration for a solution came at random. With the problem being the queries acting simultaneously and returning at different times I resorted to making the process more single stream in exchange for making it function. The solution came down to one of the fundamentals in programming: Recursion.
By making the program handle queries recursively they only work with one query at a time and will not cross paths, which allows the program to correctly label the queries in the order they arrive.
(Example: Notice the names/colors are now correctly assigned with WAIAU being higher than WAIAU 8 and 9)
To double check the values I had called the sources on their own (which I know correctly calls a source and data) and made note of the numbers then compared it.
(Notice: The graph may look different because it is zoomed in but the number value is the same)
After this I started researching different Unit Test systems for the Javascript. Unit Testing involves being able to make tests which insure certain actions are performed and results are given. As it stood I was using Firebug to look at the Javascript/HTML interaction, but I needed something that could run checks on build. After looking my current research has lead me to investigate RhinoUnit as a way to do it (which unlike the others I’ve found works with the ANT system we are using to build). This will need more research if I want to be able to implement it soon. With one more week till Milestone 2, time rolls on.
Want to try the WattDepot-apps Visualizer out? Mislabelling Version 2.0.225 and Newest version 2.0.228 can be found here.
No comments:
Post a Comment