Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- JMP User Community
- :
- Discussions
- :
- Update Graphics Script with Local Data Filter

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Oct 31, 2019 5:03 AM
(675 views)

Is there a way to make the graphics script obey the local data filter? I'm trying to get the convex hull of a select number of points within the data table. However, the graph script calculates the convex hull of all the points in the table ignoring the local data filter.

The script I'm using for the convex hull is this:

```
tri = Triangulation( X( :MXC, :MZC ) );
Path( tri << Get Hull Path );
```

Is there a way to send an update or recalculate kind of a command to this script as the user interfaces with the local data filter?

What we see of the real world is not the unvarnished real world but a model of the real world, constructed so it is useful for dealing with the real world. —Richard Dawkins

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Check the Scripting Index example for the Box<<MakeRowStateHandler message. This allows you to hook up a JSL callback when the filter row states change. Unfortunately, the Triangulation object will use the global row states for the computation. I think you would have to get the subset of values and pass in arrays of coordinates instead of column names for the X's.

Or....

In JMP 15 Graph Builder the convex hull is directly available as part of the Contour element, when used with a color role. In this case the contour is based on a triangulation, and you can turn off the contours and show only the boundary. This script in JMP 15 will demonstrate the feature:

```
Open("$SAMPLE_DATA/Big Class.jmp");
Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( :height ), Y( :weight ), Color( :height ) ),
Elements(
Contour( X, Y, Legend( 4 ), Fill( 0 ) ),
Points( X, Y, Color( 0 ), Legend( 5 ) )
),
Local Data Filter(
Add Filter(
columns( :age ),
Where( :age == 13 ),
Display( :age, Height( 102 ) )
)
)
);
```

One big advantage of the built-in version (if using JMP 15 of course...) is that all of the Graph Builder grouping computations are already taken care of. So, if you use another column in the overlay role, you will get a convex hull for each group:

2 REPLIES 2

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Check the Scripting Index example for the Box<<MakeRowStateHandler message. This allows you to hook up a JSL callback when the filter row states change. Unfortunately, the Triangulation object will use the global row states for the computation. I think you would have to get the subset of values and pass in arrays of coordinates instead of column names for the X's.

Or....

In JMP 15 Graph Builder the convex hull is directly available as part of the Contour element, when used with a color role. In this case the contour is based on a triangulation, and you can turn off the contours and show only the boundary. This script in JMP 15 will demonstrate the feature:

```
Open("$SAMPLE_DATA/Big Class.jmp");
Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( :height ), Y( :weight ), Color( :height ) ),
Elements(
Contour( X, Y, Legend( 4 ), Fill( 0 ) ),
Points( X, Y, Color( 0 ), Legend( 5 ) )
),
Local Data Filter(
Add Filter(
columns( :age ),
Where( :age == 13 ),
Display( :age, Height( 102 ) )
)
)
);
```

One big advantage of the built-in version (if using JMP 15 of course...) is that all of the Graph Builder grouping computations are already taken care of. So, if you use another column in the overlay role, you will get a convex hull for each group:

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Update Graphics Script with Local Data Filter

Incredible. I cannot wait for my organization to upgrade!

In the meantime, I'll try to put something together for v14 as you described.

What we see of the real world is not the unvarnished real world but a model of the real world, constructed so it is useful for dealing with the real world. —Richard Dawkins

Article Labels

There are no labels assigned to this post.