Poly seg association with data table/ row statesIs there a way to associate poly segs with a data table like you can with markerseg() so that selection of the segment also highlights rows?
For instance
Names default to here(1);
dt = open("$SAMPLE_DATA\Big Class.jmp");
dt_sum = dt << Summary(
Group( :sex ),
Freq( "None" ),
Weight( "None" )
);
dt_sum:sex << Set Labelled;
gb = graphbox();
fb = gb[framebox(1)];
new window("Test",
gb
);
fps = polyseg([70, 90, 90, 70], [30, 30, 10, 10]);
fb << append seg(fps);
mps = polyseg([10, 30, 30, 10], [30, 30, 10, 10]);
fb << append seg(mps);
ms = markerseg([80, 20], [50, 50], row states(dt_sum));
fb << append seg(ms);
//can I assign fps to row 1 and mps to row 2 so that when I click them
// they select in both tables (since the tables are linked)Re: Poly seg association with data table/ row statesOh cool! I have use them, but forgot it allowed row states. Thanks!
Re: Poly seg association with data table/ row statesI've found that shapeseg() allows me to truly map to row states which took a little bit to learn to use but now it's working pretty well.
Re: Poly seg association with data table/ row statesOops, I forgot to add the script to find the polygon centers. I believe that is a JMP 14 function. So if you are on an earlier version, using the 1st point in the polygon, making the point extra small, and the polygon line width 2 or more then point should be "invisible."
Note I create the point first so it is in the background. As you noted JMP fully implements, all row state characteristics per point. So selection modes like faded when not selected is visible for points.
This solution is only partial in that it only allows colors to sync with the table. It would be nice to have this feature for curves and polygons. Also nice to have would be able to access the mousebox/callback associated with each builtin framebox, or reference a framebos and add the mousebox.
Re: Poly seg association with data table/ row statesVince,
Try the attached script. It is not a complete solution. This script is relying on the row state handler, obviously built-in by the Marker Segs. Without the marker segs, this script would need to add a row state handler scoped to this display. The handler function would need to send an Inval to the framebox and Update Window when a row state changed.
To extend this script, I would find the center of the polygon and add a markerseg so all the extra scripting would be handled by the existent JMP builtin code.
Hope this helps.
Names default to here(1);
dt = open("$SAMPLE_DATA\Big Class.jmp");
dt_sum = dt << Summary(
Group( :sex ),
Freq( "None" ),
Weight( "None" )
);
dt_sum:sex << Set Labelled;
gb = graphbox();
fb = gb[framebox(1)];
new window("Test",
gb
);
mpolyseg = Function({xmat, ymat, states=[]},{i,scrp=Expr(Glue()), c, rs=0},
show(states);
if(
IsMatrix(states) & nrow(states)==0
| //or
IsList(states) & nitems(states) ==0,
states=J(nrow(xmat),1,0),
Type(states) == "Table",
rs=1
);
For(i=1, i<=nrow(xmat), i++,
If(rs,
c = Parse(EvalInsert("Color Of(As Row State((^states^<<GET row="" states=""></GET>This function also allows specifying fixed states or colors.
Another method would be to create a row state handler and find all windows and find all frameboxes (using xpath) and inval and update window all of them.