Cleaned Up BKBaseGraphApplet’s supportData Parsing
The BKBaseGraphApplet can read the data it uses to put on the graphs from the applet PARAM tags a row at a time... or a complete table... or even as a part of the supportData table. This guy was meant for data that didn't make sense to put into the main data table, but was needed to support the proper graphing of the data.
Think colors of scatter points... mouse-over labels... that kind of stuff. More "style data" and not as much "numeric data". But today I realized that the parsing of the supportData and the augmenting of it to the primary data was not working properly.
I had made changes to allow the parsing of a complete table of data, in addition to the row-at-a-time method. But when I did that, I didn't follow-through with all the implications. For instance, the way the code was originally written, it was possible to leave out the primary data table completely, and then pull in parts of the supportData table as the "plotting" (aka primary) data.
In fact, it was possible to augment that as well. Very flexible, and nice, but by putting in the table parsing of the primary source, I broke it. (Well, to be brutally honest, another developer had a crack at it and I just cleaned up what he had written) So... I needed to go back in and clean it all up. Restore all the functionality I had intended to put in there.
The first step was to realize that the easiest way to resolve this was not to have the semi-merge code in the applet... Nope, that's a waste. I have the BKTable's merge() method, all I really needed to do was to put a filter on the supportData table - letting through only the columns the user wanted to merge into the primary data table, and then do the merge(). It was far simpler, and removed a ton of code from the BKBaseGraphApplet's class that was strikingly similar to the BKTable's code, and it was implemented better in the table's class.
Then I had to make sure that all different possibilities worked. No table, some table, etc. This way I could be sure that it was going to work.
In the end, it worked like a charm. The mouse-over is coming from the supportData table, and it's merging in the data exactly as it should. Perfect.