I have found that using the dt<<set row states(single column matrix) function to be much faster than using the more traditional ForEachRow(Rowstate() = Colorstate(LevelColor(Row(),n_groups,"JMP Light")) ), and so I would like to use it. However in order to do this the scripter needs to build the single column matrix (here called "rscode") directly. According to the JMP scripting guide, the matrix is determines the row states in the following way:
I have read Erin Vang's blog post from 2010 about how to set the marker values (she discussed how to include unicode characters as markers), but I have not yet found an equivalent discussion for colors. The issue I am having is that the "color of" function returns numbers that are not valid color states, but rather negative numbers. Ideally what I want to do is use the built-in color themes like "Spectral" and "JMP Default" rather than have to create one on my own. So I would like to be able to use the ColorOf(ColorState(<HeatColor(...) or LevelColor(...)>)) to set values in the row state matrix.
Now, setting the color states in a dummy table and using the (dt<<Get Row States)/256 command, one obtains a vector of color indices, however these are not integers. One of my questions is how are the non-integral parts calculated?
For example create a dummy table, set its colorstates, and then see the inconsistency between the entries of the output vector (which contains indices from JMP's color table 0-84) and the ColorOf(...) function which gives negative numbers, many of which are large. Is there any pattern to this or any functions I am missing? Note that blah != blah2 and the resulting table colors are very different.
So what I decided to do for now is to simply create a dummy table with the number of rows equaling the number of groups that I have, setting their states, and then extracting the state info using get row states.
I did some timing analysis and ForEachRow(...) seems to take a negligible amount of time for data times that are small enough, but the time it takes to run ForEachRow(...) scales much faster with the number of rows and at some point ForEachRow(...) takes > 10x as long (for tables with ~1000 rows or more) than generating the rowstate vector directly and then using dt<<Set Row States.