cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

Fix Selected States being drawn above all other possible elements in a graph

What inspired this wish list request? 

(edit) Apparently the template drops a bunch of text here.  The inspiration is that selected rows are drawn above EVERY custom user-generated graphics script, regardless of the draw order given.

 

I understand that the devs were trying to fix the issue of un-selected data points being drawn above selected data points, but they took the lazy fix and just clobbered any hope of having the user determine the draw order.  Now selected points are drawn above everything else.  I'm almost surprised that the mouse is drawn above selected data points.

 

 

What is the improvement you would like to see? 

(edit as this form dropped my previous response) I would like to see JMP adhere to the draw order given in the graph customizations list.  If a users attaches a graphics script AFTER the marker seg, then any elements drawn by that script should be drawn on top of all markers,  Period.  End of story.

 

 

Why is this idea important? 

(edit, as this form dropped my first response)  This is clearly important.  Extremely important.  To the point that my org is putting serious resources into alternatives such as Python or online with JS.  There is a large number of work-flows that now cannot be done in JMP14 or 16, full stop.

 

Consider this graph:

ErraticAttack_0-1676590043142.png

Here I might want to highlight a specific item by selecting it in the legend.  When I do, the dense data points completely obscure EVERY SPLINE, even though the splines are drawn as separate scripts AFTER the marker segs.

ErraticAttack_1-1676590119521.png

 

This is just one example.  In my org it is common to have many thousands or even hundreds of thousands of data points.  Drawing some sort of custom summary graphic above the data points (whether it's splines, goal lines, confidence intervals, or any other such custom graphic) is needed for properly consuming the data.  With JMP14 and beyond, this becomes totally useless for interactivity, since selecting items (and the associated data points) completely obscures EVERY and ALL other graphics drawn on the graph.

 

And while my org is slow to update to new JMP versions (as many are still using JMP12), I'm left telling people that it's impossible with the new versions of JMP to have the same workflow as before.  Instead of being faster with better features, we're left with something completely useless.

 

And while I do understand that a user can simply deselect the rows (say by clicking a single data point), this type of work-around to a fundamentally bad design decision by the JMP devs should not be necessary, and is not always acceptable (and also changes the visual story / significance):

ErraticAttack_2-1676590519488.png

 

From my perspective this is so egregiously bad that JMP should provide a hot-fix and patch all users systems in JMP14 and beyond, not wait till JMP18 to fix.

 

7 Comments
hogi
Level XII

I think this behavior is really like expected.

If you select the "red" line in the legend, all rows corresponding to the line are selected. Which also triggers highlighting  the red data points.

If this behavior is differnet in other programs, they don'T have this feature of interactive data highlighting (the one which also highlights corresponding data in other plots).

 

Easy solutions to make the selected line more visible, even if the respective data points are highlightes as well:

- make the data points smaller

- make the data points slightly transparent

- give the linie a slightly different color

- put the data points behind the lines.

 

ErraticAttack
Level VI

Perhaps I wasn't clear -- the added lines are drawn below the selected data points.  It doesn't matter what the color is, what the size of the data points is, or what the transparency is.

 

The Points (or Marker Segs) are behind the lines.

Customize List:

ErraticAttack_1-1676648237911.png

Line of a different color:

ErraticAttack_0-1676648205957.png

Selected points obscure the line:

ErraticAttack_2-1676648291759.png

 

 

Remember, this is just a small example.  Many plots might have 400,000 data points all together, in which case it becomes IMPOSSIBLE to see anything above the selected points.

 

 

The issue is that all selected data points ignore draw order and are drawn on top of any custom-script generated shapes. Period. No workaround possible.

hogi
Level XII

Ok, now I got your point. I understand, this can be quite annoying ...


Nevertheless, Your workaround () is great - I also use it when I am too lazy to optimize the graph itself.

 

Under the line one could say: much better

 

than

 

 

*) curves were not brought to the front in exported interactive html files in Jmp 16. Furtunately, this bug got fixed with JMP 17
Curves in Dashboards: send to front? 

 

To make Jmp even better ...

 

The original wish:

 

collides with the general idea of "highlighting" (send items to the front), right?

 

The actual issue is just:

 

 

How about adding a checkbox to the customization window to force items to stay "on top of everything"
The same feature could be used more generally , e.g. to keep Smoother fits on top of highlighted data points as well.

hogi_1-1676654267458.png

 

Concerning "highlighted" data points which hide data points even when nothing is selected?

Making the points smaller or slightly transparent could help here as well.

 

plot with 200k data points after selecting one subset:

hogi_1-1676655201874.png

 

 

dt = Open( "$SAMPLE_DATA/Airline Delays.jmp" );
dt = dt << Concatenate(
	dt,	dt,	dt,
	Append to first table
);

dt << Concatenate(	dt,	Append to first table);

dt << Select where( :Airline == "Northwest" );
Graph Builder(
	Size( 618, 479 ),
	Show Control Panel( 0 ),
	Summary Statistic( "Median" ),
	Graph Spacing( 4 ),
	Variables( X( :Day of Week ), Y( :Elapsed Time ), Overlay( :Airline ) ),
	Elements( Points( X, Y, Legend( 9 ) ), Smoother( X, Y, Legend( 10 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Elapsed Time",
			ScaleBox,
			{Min( -1.344 ), Max( 370.36832 ), Inc( 100 ), Minor Ticks( 1 )}
		),
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				9,
				Base( 0, 0, 0, Item ID( "American", 1 ) ),
				Base( 1, 0, 1, Item ID( "Delta", 1 ) ),
				Base( 2, 0, 2, Item ID( "Northwest", 1 ) ),
				Base( 3, 0, 3, Item ID( "United", 1 ) ),
				Base( 4, 0, 4, Item ID( "US Airways", 1 ) ),
				Base( 5, 0, 5, Item ID( "Southwest", 1 ) ),
				Properties(
					0,
					{Marker Size( 2 ), Transparency( 0.2 )},
					Item ID( "American", 1 )
				),
				Properties(
					1,
					{Marker Size( 2 ), Transparency( 0.2 )},
					Item ID( "Delta", 1 )
				),
				Properties(
					2,
					{Marker Size( 2 ), Transparency( 0.2 )},
					Item ID( "Northwest", 1 )
				),
				Properties(
					3,
					{Marker Size( 2 ), Transparency( 0.2 )},
					Item ID( "United", 1 )
				),
				Properties(
					4,
					{Marker Size( 2 ), Transparency( 0.2 )},
					Item ID( "US Airways", 1 )
				),
				Properties(
					5,
					{Marker Size( 2 ), Transparency( 0.2 )},
					Item ID( "Southwest", 1 )
				)
			), Legend Model(
				10,
				Properties( 0, {Line Width( 5 )}, Item ID( "American", 1 ) ),
				Properties( 1, {Line Width( 5 )}, Item ID( "Delta", 1 ) ),
				Properties( 2, {Line Width( 5 )}, Item ID( "Northwest", 1 ) ),
				Properties( 3, {Line Width( 5 )}, Item ID( "United", 1 ) ),
				Properties( 4, {Line Width( 5 )}, Item ID( "US Airways", 1 ) ),
				Properties( 5, {Line Width( 5 )}, Item ID( "Southwest", 1 ) )
			)}
		),
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			{Add Graphics Script(
				15,
				Description( "" ),
				Pen Color( "black" );
				Pen Size( 4 );
				Y Function( 120 + Sin( x * 2 ) * 20, x );
			)}
		)
	)
)

 

hogi
Level XII

@mia_stephens - could you give an update on the status of this wish?
Still "new" - or already "acknowledged"?


Here, I moved the grid lines to the front:

hogi_0-1727302055532.png


Surprisingly, JMP moves selected points in front of everything - including the grid lines:

hogi_1-1727302141925.png
sometimes a user might want elements to stay inside the respective "layer".
selected points in front of other points - but still behind bars.


is it possible to add an option to move highlighted  elements [just]  on top of their layer - not on top of everything?

mia_stephens
Staff
Status changed to: Acknowledged

This is acknowledged, thanks!

DaveB
Staff

The issue is pretty much as you have described but a little more complex.  There are actually two drawing passes for all segs.  The first pass allows segs to draw anything that is unselected and the second pass allows segs to draw anything that is selected.  Some segs like marker segs draw in both passes.  Other segs, like graphics script don't have a selected state and therefore they are just drawn during the first unselected pass.  The simplest solutions are to either do what @hogi suggested and add an option that allows the drawing to occur during either pass, or maybe allow the script to be associated with a row state handler so that it could have a more dynamic ability to draw at the correct z-order.  I can imagine a graph with a large number of graphics scripts so some are always obscured and a drawing order based on row selection could help that case also.

 

I realize your sample was a simple case just to show the problem, but I was wondering your particular issue really was with a graphics script that was drawing a line.  If it is, can you switch to using a LineSeg instead?  This modification to your script is a little closer to your goal

Names Default To Here( 1 );
table = New Table( "test table",
	Add Rows( 15000 ),
	<<New Column( "X", "Numeric", <<Set Each Value( Random Normal() ) ),
	<<New Column( "Y", "Numeric", <<Set Each Value( Random Normal() ) )
);
Eval(
	Eval Expr(
		New Window( "Test",
			<<On Close( Close( Expr( table ), No Save ) ),
			Platform( table, ob = Outline Box( "", Bivariate( X( :x ), Y( :y ) ) ) )
		)
	)
);
lsb = Line Seg( [-5, 5], [-5, 5], row states( {as row state(1)} ) );
lsr = Line Seg( [-5, 5], [-5, 5], row states( {as row state(1)} ) );
lsb << set line color( black );
lsb << set line width( 4 );
lsb << set selectable(1);
lsr << set line color( red );
lsr << set line width( 3 );
lsr << set selectable(1);

ob[Frame Box( 1 )] << append seg(
	lsb,
	lsr,
);

DaveB_0-1728324750394.png

 

That example still has an issue with brush selection unfortunately.  The lineseg is selectable but we prioritize markers so brush selection (without the shift key) deselects the line if a marker is selected.  You can click on the line to reselect it but with enough markers there might not be anywhere to click.  An admittedly awkward workaround is to get a cloned version of the line seg that won't deselect during brushing

Names Default To Here( 1 );
table = New Table( "test table",
	Add Rows( 15000 ),
	<<New Column( "X", "Numeric", <<Set Each Value( Random Normal() ) ),
	<<New Column( "Y", "Numeric", <<Set Each Value( Random Normal() ) )
);
Eval(
	Eval Expr(
		New Window( "Test",
			<<On Close( Close( Expr( table ), No Save ) ),
			Platform( table, ob = Outline Box( "", Bivariate( X( :x ), Y( :y ) ) ) )
		)
	)
);
lsb = Line Seg( [-5, 5], [-5, 5], row states( {as row state(1)} ) );
lsr = Line Seg( [-5, 5], [-5, 5], row states( {as row state(1)} ) );
lsb << set line color( black );
lsb << set line width( 4 );
lsb << set selectable(1);
lsr << set line color( red );
lsr << set line width( 3 );
lsr << set selectable(1);

gb=graphbox();
fb = gb[FrameBox(1)];
fb << append seg(lsb);
fb << append seg(lsr);
fb = fb << clone box();
lsb = fb << find seg(LineSeg(1));
lsr = fb << find seg(LineSeg(2));

ob[Frame Box( 1 )] << append seg(
	lsb,
	lsr,
);

Another option would be to use the data table for row states.  The drawback to this is that the lineseg will only check rows 1 to n where is is the number of points in the line so for the line to be selected when any row is selected, a lot of unnecessary points would need to be added.  

Names Default To Here( 1 );
table = New Table( "test table",
	Add Rows( 15000 ),
	<<New Column( "X", "Numeric", <<Set Each Value( Random Normal() ) ),
	<<New Column( "Y", "Numeric", <<Set Each Value( Random Normal() ) )
);
Eval(
	Eval Expr(
		New Window( "Test",
			<<On Close( Close( Expr( table ), No Save ) ),
			Platform( table, ob = Outline Box( "", Bivariate( X( :x ), Y( :y ) ) ) )
		)
	)
);

pts = repeat(5,n rows(table));
pts[1]=-5;
lsb = Line Seg( pts, pts, row states(table) );
lsr = Line Seg( pts, pts, row states( table ));
lsb << set line color( black );
lsb << set line width( 4 );
lsb << set selectable(1);
lsr << set line color( red );
lsr << set line width( 3 );
lsr << set selectable(1);
ob[Frame Box( 1 )] << append seg(
	lsb,
	lsr,
);

 

 

hogi
Level XII

Besides the "workarounds" - any chance to fix the issue in a future release of JMP?