cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
JanneI
Level III

Referencing to underlaying (overlapping) datapoints on hover textlet/graphlet

Hello,

Sometimes dataset may contain overlapping points. Default mouse over hover gridlet is showing the number of overlapping points (N) and some other information (see example image below from big class.jmp dataset).

 

JanneI_1-1652249214413.png

 

I am interested in to get this information also be utilized in textlet or graphet script. How do I get hovered rows to list? I can use following syntax for selected rows but well,  hovering does not make selection. And as far as I know, there is not "Get hovered rows" function. Any suggestions?

selected_rows = as list(dt << get selected rows);

 

Following returns the first row of the overlapped rows. How can I reference to underlaying data point(s) eg in For-loops? 

:height[local:_firstRow]

 

Following, as part of textlet, returns number of underlaying rows but as far as I know, does not return the rows eg as a list. 

<b>Underlying Rows</b>: {local:_underlyingRows}

I have tried to read the following chapter carefully but I cannot find solution to my question:

Scripting Guide > Scripting Graphs > Hover Labels > Work with the Hover Label Execution Context 

 

So far I have come over this by using jitter to avoid overlapping points but I am sure that there is better way to do this. Thanks for your advices!

 

Janne

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Referencing to underlaying (overlapping) datapoints on hover textlet/graphlet

Very quick example here:

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt << Graph Builder(
	Variables(X(:height), Y(:weight)),
	Elements(Points(X, Y, Legend(1))),
	SendToReport(
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			Set Textlet(
				Setup(
					expr = Parse(local:_where);
					local:r = local:_dataTable << Get Rows Where(expr)
				),
				Markup("{local:r} rows")
			)
		)
	)
);

jthi_1-1652279617628.png

(I clicked on the point to highlight them in data table)

 

 

-Jarmo

View solution in original post

3 REPLIES 3
jthi
Super User

Re: Referencing to underlaying (overlapping) datapoints on hover textlet/graphlet

If I remember correctly JMP Help had quite good documentation on Hover Labels and their execution context: Work with the Hover Label Execution Context (jmp.com). You might have to use the information you can get to perform query to data table to get all the rows.

-Jarmo
jthi
Super User

Re: Referencing to underlaying (overlapping) datapoints on hover textlet/graphlet

Very quick example here:

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt << Graph Builder(
	Variables(X(:height), Y(:weight)),
	Elements(Points(X, Y, Legend(1))),
	SendToReport(
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			Set Textlet(
				Setup(
					expr = Parse(local:_where);
					local:r = local:_dataTable << Get Rows Where(expr)
				),
				Markup("{local:r} rows")
			)
		)
	)
);

jthi_1-1652279617628.png

(I clicked on the point to highlight them in data table)

 

 

-Jarmo
JanneI
Level III

Re: Referencing to underlaying (overlapping) datapoints on hover textlet/graphlet

Hi Jarmo,

 

Thanks for your suggestion to read the documentation more careful and your quick example. With this help, I understood better how the Hover Label Execution Context Variables works (especially _where). I was able to incorporate this concept to my application. Thanks again,

Janne