Col List Box
Col List Box using New Window
Example 1
Summary: Creates a new window with multiple column list boxes, allowing users to select columns for analysis.
Code:
dt = Open("data_table.jmp");
New Window( "Col List Box Example",
H List Box(
V List Box(
clb = Col List Box( all, width( 250 ), maxSelected( 1 ) ),
clb1 = Col List Box( all, width( 250 ), maxSelected( 1 ) ),
clb2 = Col List Box( all, width( 250 ), maxSelected( 1 ) ),
clb3 = Col List Box( all, width( 250 ), maxSelected( 1 ) ),
clb4 = Col List Box( all, width( 250 ), maxSelected( 1 ) ),
clb5 = Col List Box( all, width( 250 ), maxSelected( 1 ) ),
),
Spacer Box( Size( 300, -1 ), Color( "Light Blue" ) )
)
);
clb1 << Set Font Size( 13 );
clb2 << Set Width( 200 );
clb3 << Set Size( 200, 50 );
clb4 << Set Font Size( 13 );
clb4 << Set Width( 200 );
clb5 << Set Font Size( 13 );
Code Explanation:
- Open table.
- Create new window.
- Add horizontal list box.
- Add vertical list box.
- Add column list box.
- Add column list box.
- Add column list box.
- Add column list box.
- Add column list box.
- Adjust column list box properties.
Example 2
Summary: Creates a new window with multiple column list boxes, allowing for interactive selection and customization.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
New Window( "Col List Box Example",
H List Box(
V List Box(
clb = Col List Box( all, width( 250 ), maxSelected( 1 ) ),
clb1 = Col List Box( all, width( 250 ), maxSelected( 1 ) ),
clb2 = Col List Box( all, width( 250 ), maxSelected( 1 ) ),
clb3 = Col List Box( all, width( 250 ), maxSelected( 1 ) ),
clb4 = Col List Box( all, width( 250 ), maxSelected( 1 ) ),
clb5 = Col List Box( all, width( 250 ), maxSelected( 1 ) ),
),
Spacer Box( Size( 300, -1 ), Color( "Light Blue" ) )
)
);
clb1 << Set Font Size( 13 );
clb2 << Set Width( 200 );
clb3 << Set Size( 200, 50 );
clb4 << Set Font Size( 13 );
clb4 << Set Width( 200 );
clb5 << Set Font Size( 13 );
clb5 << Set Size( 200, 50 );
Code Explanation:
- Set default names scope.
- Open data table;
- Create new window.
- Add horizontal list box.
- Add vertical list box.
- Create column list box clb.
- Create column list box clb1.
- Create column list box clb2.
- Create column list box clb3.
- Create column list box clb4.
- Create column list box clb5.
- Set font size for clb1.
- Set width for clb2.
- Set size for clb3.
- Set font size for clb4.
- Set width for clb4.
- Set font size for clb5.
- Set size for clb5.
Example 3
Summary: Creates a new window with a column list box, allowing users to select and visualize columns from a data table.
Code:
dt = Open("data_table.jmp");
New Window( "Col List Box Example 1", clb = Col List Box( all, width( 250 ), maxSelected( 1 ) ) );
clb << Padding( 20 );
Code Explanation:
- Open data table.
- Create new window titled "Col List Box Example 1".
- Add column list box to window.
- Set list box to show all columns.
- Set list box width to 250.
- Limit selection to 1 item.
- Apply padding of 20 units to list box.
Example 4
Summary: Creates a new window with a list box and column list box, configuring various settings such as width, height, padding, and margin.
Code:
New Window( "Example",
Panel Box( "List Box",
lb = List Box(
{"First Item", "This is a fairly long testing Second Item", "Third Item", "Fourth Item", "Fifth Item", "Sixth Item",
"Seventh Item", "Eighth Item"},
width( 200 ),
max selected( 2 ),
nlines( 6 )
)
)
);
lb << Padding( 20 );
lb << Margin( 20 );
dt = Open("data_table.jmp");
New Window( "Col List Box Example 1", clb = Col List Box( all, width( 250 ), maxSelected( 1 ) ) );
clb << Padding( 20 );
clb << Margin( 20 );
Code Explanation:
- Create new window "Example".
- Add panel box titled "List Box".
- Insert list box with items.
- Set list box width to 200.
- Allow max 2 selections.
- Set list box height to 6 lines.
- Apply padding to list box.
- Apply margin to list box.
- Open data table.
- Create new window "Col List Box Example 1".
- Add column list box with all columns.
- Set column list box width to 250.
- Allow max 1 selection.
- Apply padding to column list box.
- Apply margin to column list box.
Example 5
Summary: Opens a data table and creation of a new window with an outline box and column list box, retrieving items from the column list box.
Code:
dt = Open("data_table.jmp");
nw = New Window( "Test Case 1a", Outline Box( "Test", clb = Col List Box( all ) ) );
colItems = clb << get items;
Code Explanation:
- Open data table;
- Create new window titled "Test Case 1a".
- Add outline box named "Test".
- Insert column list box with all columns.
- Retrieve items from column list box.
Example 6
Summary: Selects and processes columns in a JMP data table, creating two new windows with column list boxes that interactively select and run scripts.
Code:
Open("data_table.jmp");
vartest = {};
New Window( "Test Case 1a", clb = Col List Box( all, Insert Into( vartest, clb << Get Selected Indices ) ) );
clb << Set Selected( 2, 1 );
clb << Set Selected( 3, 1, Run Script( 0 ) );
clb << Set Selected( 4, 1, Run Script( 1 ) );
clb << Close Window;
vartest = {};
New Window( "Test Case 1b",
clb = Col List Box( all, <<Set Function( Function( {this}, {}, Insert Into( vartest, clb << Get Selected Indices ) ) ) )
);
clb << Set Selected( 2, 1 );
clb << Set Selected( 3, 1, Run Script( 0 ) );
clb << Set Selected( 4, 1, Run Script( 1 ) );
clb << Close Window;
Code Explanation:
- Open data table.
- Initialize empty list
vartest. - Create new window "Test Case 1a".
- Add column list box to window.
- Select columns 2 and 1.
- Select columns 3 and 1, run script 0.
- Select columns 4 and 1, run script 1.
- Close the window.
- Reinitialize
vartestas empty list. - Create new window "Test Case 1b" with set function.
- Select columns 2 and 1.
- Select columns 3 and 1, run script 0.
- Select columns 4 and 1, run script 1.
- Close the window.
Example 7
Summary: Runs the selection and enabling/disabling of columns in a Column List Box, capturing log messages for debugging purposes.
Code:
dt = Open("data_table.jmp");
log = "";
vartest = {};
New Window( "Test Case 3", clb = Col List Box( all, vartest = clb << Get Selected Indices ) );
clb << Set Selected( 2 );
clb << Enable( 0 );
clb << Set Selected( 3 );
clb << Enable( 1 );
clb << Set Selected( 2, 0 );
log = Trim( Log Capture( clb << Enable ) );
log = "1";
clb << Enable( 0 );
log = Trim( Log Capture( clb << Enable ) );
clb << Close Window;
Code Explanation:
- Open data table.
- Initialize log variable.
- Initialize variable test.
- Create new window.
- Add column list box.
- Select second column.
- Disable column list box.
- Select third column.
- Enable column list box.
- Deselect second column.
Example 8
Summary: Creates a column list box with various analysis types and data types, allowing for interactive exploration of data in JMP.
Code:
dt = Open("data_table.jmp");
New Window( "S1262898", c = Col List Box() );
c << Set Analysis Type( "Any" );
c << Set Analysis Type( "Nominal" );
c << Set Analysis Type( "Ordinal" );
c << Set Analysis Type( "Continuous" );
c << Set Analysis Type( "Any" );
c << Set Data Type( "Any" );
c << Set Data Type( "Numeric" );
c << Set Data Type( "Character" );
c << Set Data Type( "Expression" );
c << Set Data Type( "Row State" );
c << close window;
Code Explanation:
- Open data table;
- Create new window.
- Add column list box.
- Set analysis type to Any.
- Set analysis type to Nominal.
- Set analysis type to Ordinal.
- Set analysis type to Continuous.
- Set analysis type to Any.
- Set data type to Any.
- Set data type to Numeric.
- Set data type to Character.
- Set data type to Expression.
- Set data type to Row State.
- Close window.
Example 9
Summary: Creates a new window with a column list box, appending specific columns and setting font styles.
Code:
dt = Open("data_table.jmp");
New Window( "Col List Box Example", Col List Box( all, width( 250 ), maxSelected( 1 ) ), lb = Col List Box() );
lb << append( "weight" );
lb << append( "height" );
lb << Set Base Font( "Title" );
tt = "Heading";
lb << Set Base Font( tt );
Small = "Mono";
lb << Set Base Font( Small );
lb << Set Base Font( "duh" );
lb << Set Base Font( 2 );
lb << Set Base Font();
lb << Set Base Font( . );
lb << Set Base Font( Empty() );
lb << Set Base Font( "text" );
lb << Set Base Font( "SMALL" );
lb << Set Base Font( "formula editor" );
lb << Set Base Font( "ANNOtatioN" );
lb << Set Base Font( "axiS" );
Code Explanation:
- Open data table.
- Create new window.
- Add column list box.
- Append "weight" to list box.
- Append "height" to list box.
- Set base font to "Title".
- Define heading variable.
- Set base font to heading.
- Set base font to "Mono".
- Set base font to "duh".
Example 10
Summary: Creates a column list box with font scaling and log capture in JMP.
Code:
dt = Open("data_table.jmp");
New Window( "Col List Box Example", Col List Box( all, width( 250 ), maxSelected( 1 ) ), lb = Col List Box() );
lb << append( "weight" );
lb << append( "height" );
lb << Set Font Scale( 2 );
tt = .75;
lb << Set Font Scale( tt );
log = "";
log = Log Capture( lb << Set Font Scale( 0 ) );
log = "";
log = Log Capture( lb << Set Font Scale() );
log = "";
log = Log Capture( lb << Set Font Scale( . ) );
log = "";
log = Log Capture( lb << Set Font Scale( Empty() ) );
log = "";
log = Log Capture( lb << Set Font Scale( -5 ) );
lb << Set Font Scale( 1 );
Code Explanation:
- Open data table.
- Create new window.
- Add column list box.
- Append "weight" to list box.
- Append "height" to list box.
- Set font scale to 2.
- Set font scale to 0.75.
- Capture log of setting font scale.
- Clear log.
- Set font scale to 1.
Example 11
Summary: Selects and displays specific columns in a new window, utilizing a Column List Box to interactively filter data.
Code:
dt = Open("data_table.jmp");
New Window( "Test Case 7", ll = Col List Box( "all" ) );
ll << Set Selected( 2 );
ll << Set Selected( 3 );
ll << Close Window;
Code Explanation:
- Open data table;
- Create new window titled "Test Case 7".
- Add column list box to window.
- Set selected index to 2.
- Set selected index to 3.
- Close the window.
Example 12
Summary: Creates a new window with a column list box and filter column selector, allowing users to interactively select columns for analysis.
Code:
dt = Open("data_table.jmp");
myitems = dt << get column names( string );
nw1 = New Window( "Col List Box Example", Col List Box( all, width( 250 ), maxSelected( 1 ) ), fontobj = lb = Col List Box() );
lb << Set Items( myitems );
lb << Get Items;
nw2 = New Window( "Filter Col Selector Example", fontobj = lb = Filter Col Selector( width( 250 ) ) );
myend = Tick Seconds();
Code Explanation:
- Open data table;
- Retrieve column names.
- Create new window with column list box.
- Set column list box items.
- Get selected items from list box.
- Create another new window.
- Add filter column selector to window.
- Capture end time.
Col List Box using Define Tag
Summary: Process of tagging string columns in a data table and displaying them in a column list box within a new window.
Code:
dt = Open( "$SAMPLE_DATA/data_table.jmp", Invisible );
dt << Define Tag( "Everything", Symbol( "ü•á" ) );
For Each( {col}, dt << Get Column Names( "String" ), Column( dt, col ) << Set Property( "Tags", {"Everything"} ) );
emojWin = New Window( "EmojiClippingIssue",
<<Type( "Dialog" ),
Col List Box( All, Width( 200 ), N Lines( 3 ), Max Selected( 1 ), <<Padding( 8 ), <<Margin( 24 ) )
);
cols = dt << get tagged columns( "Everything" );
emojWin << Close window;
Code Explanation:
- Open data table;
- Define "Everything" tag with ü•á symbol.
- For each string column, set "Everything" tag.
- Create new window EmojiClippingIssue.
- Add dialog type to window.
- Add column list box to window.
- Retrieve columns tagged "Everything".
- Close EmojiClippingIssue window.