cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Jazib
Level II

Unable to Highlight on Graph Builder and Select Corresponding Rows

Hi everyone,

 

I have multiple graphs in graph builder from multiple data tables. 2 things to note:

 

  • They were all created using JSL.
  • Most of them have been appended to a JMP window except the last one.

 

For some reason I am only able to highlight data on the last graph builder plot (and selected the corresponding rows in its table).

 

Why is that and is there any way to fix it?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Unable to Highlight on Graph Builder and Select Corresponding Rows

The issue is that you are appending the Report for the Graph Builder, not the Graph Builder Object.  Take a look at the results from the below script, and you will see that the appended report becomes a static graph, where the embedded object does notembedded.PNG

names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");

mygb = Expr(
gb = Graph Builder(
	Size( 528, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :weight ), Y( :height ), Overlay( :sex ) ),
	Elements( Line( X, Y, Legend( 7 ) ) )
);
);

mygb;

nw = new window("Report",);

nw << append(report(gb));

nw << append(mygb);
Jim

View solution in original post

9 REPLIES 9
txnelson
Super User

Re: Unable to Highlight on Graph Builder and Select Corresponding Rows

You have not provided enough information(details) to really allow any real diagnosis. A copy of the script and an image of the output would really help

Jim
Thierry_S
Super User

Re: Unable to Highlight on Graph Builder and Select Corresponding Rows

Hi,
As @txnelson mentioned, this is almost impossible to diagnose your problem with the information you provided. The only thing I can think of at this stage is a possible issue with the way you append the graph to the new window: do you use a graphic element capture or do you append the entire graph to your new window? The former will eliminate the connection back to the table.
Best,
TS
Thierry R. Sornasse
Jazib
Level II

Re: Unable to Highlight on Graph Builder and Select Corresponding Rows

Thanks @txnelson and @Thierry_S for the reply.

 

Unfortunately I can't share the entire script or the plots because of NDA reasons, but I can provide more details where possible.

 

This is what the window looks like:

 

 
CreateResultsWindow = Function(
    // Inputs
    {Title},

    // Local variables
    {
        Window, ReturnList,
        OutLineBox1, BorderBox1, LineUpBox1
    },

    Window = NewWindow(Title,
        OutLineBox1 = OutLineBox(
            "Outline Box 1",
            
            BorderBox1 = BorderBox(
                Left(40), Right(40), Top(40), Bottom(40), Sides(30),
                LineUpBox1 = LineUpBox(NCol(2));
            );

        );
    );

    ReturnList = {};

    InsertInto(ReturnList, OutLineBox1);
    InsertInto(ReturnList, LineUpBox1);
    
    EvalList ( ReturnList );
);
 

 

 

I call this function multiple times for multiple types of plots and am appending to the Lineup Box like this:

 

Create multiple GB objects and insert them into a GB list

 

GB = DT << GraphBuilder(...);

InsertInto(GBList, GB);
 
 
Append them based on some value (R^2 in my case):
 
AppendPlotBasedOnDescendingValue(GBList, R2List, LineUpBox1);


AppendPlotBasedOnDescendingValue = Function(
    // Inputs
    {PlotBoxList, ValueList, AppendBox},

    // Local variables
    {i, RankList, ReorderedPlotBoxList},

    // Vector of indices used as subscript into original list
    RankList = RankIndex(ValueList);
    
    // Reorder plots based on values
    ReorderedPlotBoxList = PlotBoxList[RankList];

    // Plot by descending
    For(i=NItems(ReorderedPlotBoxList), i>=1, i--,
        AppendBox << Append(Report(ReorderedPlotBoxList[i]));

        ReorderedPlotBoxList[i] << CLoseWindow;
    );
);
 
It gets appended correctly, but I am just not able to select/highlight on the data tables/plots.
 
So to your question @Thierry_S I think I am using a graphic element (Lineup Box)
 
Thanks.

 

Jazib
Level II

Re: Unable to Highlight on Graph Builder and Select Corresponding Rows

Hi @txnelson and @Thierry_S .

 

Thanks for the reply. For some reason my previous reply was marked as abuse so here is a rewrite:

 

Unfortunately, I can't share the entire script or the plots because of NDA but I can try to provide more details:

 

I am creating the windows using this function:

 

CreateResultsWindow = Function(
	// Inputs
	{Title},

	// Local variables
	{
		Window, ReturnList,
		OutLineBox1, BorderBox1, LineUpBox1
	},

	Window = NewWindow(Title,
		OutLineBox1 = OutLineBox(
			Title,
			
			BorderBox1 = BorderBox(
				Left(40), Right(40), Top(40), Bottom(40), Sides(30),
				LineUpBox1 = LineUpBox(NCol(2));
			);

		);
	);

	ReturnList = {};

	InsertInto(ReturnList, LineUpBox1);
	
	EvalList ( ReturnList );
);

 

 

I then create Graph Builder objects in a for loop and add them to a list:

 

GB = GraphBuilder(...);
InsertInto(GBList, GB);

And then I attach them to a display object in the window (the Lineup Box) by calling this function:

 

 

AppendPlotBasedOnDescendingValue = Function(
	// Inputs
	{PlotBoxList, ValueList, AppendBox},

	// Local variables
	{i, RankList, ReorderedPlotBoxList},

	// Vector of indices used as subscript into original list
	RankList = RankIndex(ValueList);
	
	// Reorder plots based on values
	ReorderedPlotBoxList = PlotBoxList[RankList];

	// Plot by descending
	For(i=NItems(ReorderedPlotBoxList), i>=1, i--,
		AppendBox << Append(Report(ReorderedPlotBoxList[i]));

		ReorderedPlotBoxList[i] << CLoseWindow;
	);
);

I call the function with the graph builder list and a list of R^2 values.

AppendPlotBasedOnDescendingValue(GBList, R2List, LineupBox);

It works, but I am unable to select/highlight the data on the table/graph builder.

 

Thanks.

 

txnelson
Super User

Re: Unable to Highlight on Graph Builder and Select Corresponding Rows

The issue is that you are appending the Report for the Graph Builder, not the Graph Builder Object.  Take a look at the results from the below script, and you will see that the appended report becomes a static graph, where the embedded object does notembedded.PNG

names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");

mygb = Expr(
gb = Graph Builder(
	Size( 528, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :weight ), Y( :height ), Overlay( :sex ) ),
	Elements( Line( X, Y, Legend( 7 ) ) )
);
);

mygb;

nw = new window("Report",);

nw << append(report(gb));

nw << append(mygb);
Jim
Jazib
Level II

Re: Unable to Highlight on Graph Builder and Select Corresponding Rows

I tried to append the graph builder object itself, but that gives this error:

 

Not a display in access or evaluation of 'Append' , Append( ReorderedPlotBoxList[i] ) /*###*/
txnelson
Super User

Re: Unable to Highlight on Graph Builder and Select Corresponding Rows

Your GBList contains pointers to the output from an already run output.  What needs to be appended, is the Graph Builder(..........) JSL, so it is run within the Display object.

 

If I am reading your skeleton code correctly, what I think you are doing, is gathering information from the different Graph Builders, and then using that information to order the output.  If this is the case, and you need for the output to be dynamic, rather than static, you may need to run the graphs a second time within the output display window.  I have done that many times in the past.  I also take a slightly different approach sometimes.  If you are using the R2 to do the ordering, then what I suggest, is that you use the Response Screening platform to get the desired R2 values, and from that result, generate the desired outputs based upon that order.

Jim
Jazib
Level II

Re: Unable to Highlight on Graph Builder and Select Corresponding Rows

Hi @txnelson .

 

That is exactly what I am doing.

 

It worked. I appended it directly the second time I created the plots instead of appending it in a separate function. I think the problem might have been from the fact that all the graph builder objects were coming from various data tables and using variables in them so when rerunning the expression JMP didn't know which tables to use for each graph builder and the variables weren't defined.

 

Thanks for the help!

txnelson
Super User

Re: Unable to Highlight on Graph Builder and Select Corresponding Rows

That can easily happen. Change your reference JSL to
gb = dt << graph builder(.........)
Jim