- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Need help to remove labels from a graphlet in JSL
Hello,
I have a script that displays several metrics means (Line) in a graph builder and also generates a graphlet with individual metrics (points).
[1] - I would like to remove the labels from the graphlet, and so far no success.
In this example (script below), I would like to remove the "Position2 and Mean()" labels, only keeping the graph (with its own notations).
From the scripting guide, it seems to require a Gridlet (P 704) but all my attempts failed.
[2] - when lines on the first graph are close to each other (:Speed and :Height in example), the graphlet tends to disappear when I move the mouse to try to click on it to open the graph builder with the individual data. Is there an option "click" to open it directly instead of "Hover line then Hover graphlet then click"? (Scripting guide P696 mentions the "Click" option but it's not clear)
Could you help me on this?
Thanks in advance
-Voiz
See below my last "stable" version
Names Default To Here( 1 );
dt = Open( "$sample_data\Football.jmp" );
y_values = {"Height", "Weight", "Fat", "Speed"};
RelEventCol = "Position2";
variables_expr = Eval Expr( Variables( X( As Column( dt, Expr( RelEventCol ) ) ) ) );
Show( variables_expr );
For Each( {y_col}, y_values,
temp_expr = Expr( Y() );
Insert Into( temp_expr, Name Expr( As Column( dt, y_col ) ) );
Insert Into( temp_expr, Name Expr( Position( 1 ) ) );
Insert Into( variables_expr, Name Expr( temp_expr ) );
);
Show( variables_expr );
gb_expr = Expr(
Graph Builder( Show Control Panel( 0 ) )
);
temp_expr3 = Expr( Line() );
Insert Into( temp_expr3, Name Expr( X ) );
For Each( {y_col, idx}, y_values,
temp_expr2 = Expr( Y() );
Insert Into( temp_expr2, idx );
Insert Into( temp_expr3, Name Expr( temp_expr2 ) );
);
Show( temp_expr3 );
Insert Into( temp_expr3, Name Expr( Legend( 7 ) ) );
Show( temp_expr3 );
temp_expr4 = Expr( Elements() );
Insert Into( temp_expr4, Name Expr( temp_expr3 ) );
Show( temp_expr4 );
Insert Into( gb_expr, Name Expr( variables_expr ) );
Insert Into( gb_expr, Name Expr( temp_expr4 ) );
Insert Into(
gb_expr,
Name Expr(
Dispatch(
{},
"Graph Builder",
FrameBox,
{Set Graphlet(
Picture(
dt << Graph Builder(
Size( 800, 700 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( As Column( dt, Expr( RelEventCol ) ) ), Y( Column( local:_measurements ) ) ),
Elements( X, Y )
);
),
Skip Filters( 1, Column( dt, Name Expr( RelEventCol ) ) )
)
}
)
)
);
Show( gb_expr );
Eval( gb_expr );
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Need help to remove labels from a graphlet in JSL
I found how to remove unwanted parts of the hover label a few weeks ago. Here's one way to do it.
Names Default To Here( 1 );
dt = Open( "$sample_data\Football.jmp" );
y_values = {"Height", "Weight", "Fat", "Speed"};
RelEventCol = "Position2";
variables_expr = Eval Expr( Variables( X( As Column( dt, Expr( RelEventCol ) ) ) ) );
Show( variables_expr );
For Each( {y_col}, y_values,
temp_expr = Expr( Y() );
Insert Into( temp_expr, Name Expr( As Column( dt, y_col ) ) );
Insert Into( temp_expr, Name Expr( Position( 1 ) ) );
Insert Into( variables_expr, Name Expr( temp_expr ) );
);
Show( variables_expr );
gb_expr = Expr(
Graph Builder( Show Control Panel( 0 ) )
);
temp_expr3 = Expr( Line() );
Insert Into( temp_expr3, Name Expr( X ) );
For Each( {y_col, idx}, y_values,
temp_expr2 = Expr( Y() );
Insert Into( temp_expr2, idx );
Insert Into( temp_expr3, Name Expr( temp_expr2 ) );
);
Show( temp_expr3 );
Insert Into( temp_expr3, Name Expr( Legend( 7 ) ) );
Show( temp_expr3 );
temp_expr4 = Expr( Elements() );
Insert Into( temp_expr4, Name Expr( temp_expr3 ) );
Show( temp_expr4 );
Insert Into( gb_expr, Name Expr( variables_expr ) );
Insert Into( gb_expr, Name Expr( temp_expr4 ) );
Insert Into(
gb_expr,
Name Expr(
Dispatch( {}, "Graph Builder", FrameBox,
{Set Graphlet(
Picture(
dt << Graph Builder(
Size( 800, 700 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( As Column( dt, Expr( RelEventCol ) ) ), Y( Column( local:_measurements ) ) ),
Elements( X, Y )
);
),
Skip Filters( 1, Column( dt, Name Expr( RelEventCol ) ) )
), Set Gridlet(
Expunge(
{{Matcher( "Position2" )}, {Matcher( "Mean(Height)" )}, {Matcher( "Mean(Weight)" )}, {Matcher( "Mean(Fat)" )},
{Matcher( "Mean(Speed)" )}}
)
) //Removes these from the default gridlet
}
)
)
);
Show( gb_expr );
Eval( gb_expr );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Need help to remove labels from a graphlet in JSL
Instead of the list of "Mean(..." values, this should probably be used. It will remove anything with "Mean" in the name.
{Matcher( Pat Regex( "Mean" ) )}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Need help to remove labels from a graphlet in JSL
Hover Labels are most likely what you are looking for https://www.jmp.com/support/help/en/18.1/index.shtml#page/jmp/hover-labels.shtml# . Purpose of Click is to trigger when user clicks on the thumbnail on the hover label
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Need help to remove labels from a graphlet in JSL
I found how to remove unwanted parts of the hover label a few weeks ago. Here's one way to do it.
Names Default To Here( 1 );
dt = Open( "$sample_data\Football.jmp" );
y_values = {"Height", "Weight", "Fat", "Speed"};
RelEventCol = "Position2";
variables_expr = Eval Expr( Variables( X( As Column( dt, Expr( RelEventCol ) ) ) ) );
Show( variables_expr );
For Each( {y_col}, y_values,
temp_expr = Expr( Y() );
Insert Into( temp_expr, Name Expr( As Column( dt, y_col ) ) );
Insert Into( temp_expr, Name Expr( Position( 1 ) ) );
Insert Into( variables_expr, Name Expr( temp_expr ) );
);
Show( variables_expr );
gb_expr = Expr(
Graph Builder( Show Control Panel( 0 ) )
);
temp_expr3 = Expr( Line() );
Insert Into( temp_expr3, Name Expr( X ) );
For Each( {y_col, idx}, y_values,
temp_expr2 = Expr( Y() );
Insert Into( temp_expr2, idx );
Insert Into( temp_expr3, Name Expr( temp_expr2 ) );
);
Show( temp_expr3 );
Insert Into( temp_expr3, Name Expr( Legend( 7 ) ) );
Show( temp_expr3 );
temp_expr4 = Expr( Elements() );
Insert Into( temp_expr4, Name Expr( temp_expr3 ) );
Show( temp_expr4 );
Insert Into( gb_expr, Name Expr( variables_expr ) );
Insert Into( gb_expr, Name Expr( temp_expr4 ) );
Insert Into(
gb_expr,
Name Expr(
Dispatch( {}, "Graph Builder", FrameBox,
{Set Graphlet(
Picture(
dt << Graph Builder(
Size( 800, 700 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( As Column( dt, Expr( RelEventCol ) ) ), Y( Column( local:_measurements ) ) ),
Elements( X, Y )
);
),
Skip Filters( 1, Column( dt, Name Expr( RelEventCol ) ) )
), Set Gridlet(
Expunge(
{{Matcher( "Position2" )}, {Matcher( "Mean(Height)" )}, {Matcher( "Mean(Weight)" )}, {Matcher( "Mean(Fat)" )},
{Matcher( "Mean(Speed)" )}}
)
) //Removes these from the default gridlet
}
)
)
);
Show( gb_expr );
Eval( gb_expr );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Need help to remove labels from a graphlet in JSL
Instead of the list of "Mean(..." values, this should probably be used. It will remove anything with "Mean" in the name.
{Matcher( Pat Regex( "Mean" ) )}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Need help to remove labels from a graphlet in JSL
Thanks you all for your help.
It works well
- Voiz