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
DMR
DMR
Level V

Icons of the Graphic Markers

Hi,

I'm writing a dashboard at the moment in which I'd like to offer the user a choice of the marker symbol that will be used in a chart that will be created from the user's various selections.

I'd like to add an icon to each element in the list of options which shows what each symbol looks like, along the lines of the little demo script I've attached in which I've used a few standard icons in the list box on the left to illustrate what I mean - but obviously I'd like to replace these with the real set of marker symbols shown on the right.

A quick search using the Built-In JMP Icons add-in suggests that these 32 symbols don't exist as predefined icons that I can access by name, so I'm assuming that I would need to create each one individually as a set of icons of my own. I could do that easily enough but it could get a bit tedious - so before I attempt it, can anyone suggest an easier way to tackle this?

Clear Log();

Marker_List = {{"  Dot", "WinHelpSearch"}, {"  Square", "WinHelpAbout"}, {"  Cross", "SearchIndex"},
{"  Filled Triangle", "Gear"}, {"  Asterisk", "ListItemUp"}, {"  Diamond", "ListItemDown"}};

Marker_ListBox = List Box( Marker_List );

New Window( "Markers",
	H List Box(
		Panel Box( "Select a Marker Symbol", Marker_ListBox ), 
//		Marker_ListBox,
		Panel Box( "All 32 Marker Symbols",
			Graph Box(
				FrameSize( 300, 300 ),
				Y Scale( -1, 16 ),
				X Scale( 0, 7 ),
				For(
					i = 0;
					jj = 15;,
					i < 16;
					jj >= 0;,
					i++;
					jj--;, // 16 rows, 2 columns
					Marker Size( 3 );
					Marker( i, {1, jj + .2} ); // markers 0-15
					Marker( i + 16, {4, jj + .2} ); // markers 16-31
					Text( {1.5, jj}, "Marker ", i ); // marker labels 0-15
					Text( {4.5, jj}, "Marker ", i + 16 ); // marker labels 16-31
				)
			)
		)
	)
);

 

Many thanks

4 REPLIES 4
pmroz
Super User

Re: Icons of the Graphic Markers

You could use a table box containing colboxes of graph boxes to show your original listbox.  Here's some code that can get you started:

nw = new window("test markers",
	tb = tablebox(
		marker_cb = col box("",
			graph box(
				FrameSize( 10, 10 ), Y Scale( 0, 2 ), X Scale( 0, 2 ), suppressaxes(1),
				marker(15, {1, 1}),
			),
			graph box(
				FrameSize( 10, 10 ), Y Scale( 0, 2 ), X Scale( 0, 2 ), suppressaxes(1),
				marker(16, {1, 1}),
			)
		),
		stringcolbox("Marker",
			{"15", "16"}
		)
	)
);
tb << set selectable rows(1);

MarkerListBox.png

DMR
DMR
Level V

Re: Icons of the Graphic Markers

Ingenious!  Or alternatively I could abandon the idea of a menu as such altogether, and just offer the user a grid of possible markers to select from: something based on the attached script would do that.

 

One quick question though - how can I disable the functionality to scroll either axis (I can still do this by hovering over at least the Y axis until I see the "hand" symbol, and then dragging this axis up or down) without actually suppressing the axes?  I find that if I suppress the axes as you did in your example, I then lose the ability to define the low and high values, the increment and the gridlines.

 

Many thanks - that's been very useful.

 

Clear Log();

x0 = -1;

tb = Text Box( "Click on a Marker", <<justify text( center ) );

gb = Graph Box(
	FrameSize( 100, 150 ),
	X Scale( 0, 8 ),
	Y Scale( 0, 4 ),
	Marker Size( 4 ),
	Mousetrap(
		x0 = Floor( x );
		y0 = Floor( y );
		tb << set text( "Marker(" || Char( 32 - 4 * (y0 + 1) + x0 ) || ")" );
	),
	If( x0 > -0.5,
		Fill Color( {0, 255, 255} );
		Rect( {x0, y0}, {x0 + 1, y0 + 1}, 8 );
	);
	For( i = 0, i <= 7, i++,
		For( j = 0, j <= 3, j++,
			k = 4 * i + j;
			Marker( k, {j + 0.5, 8 - (i + 0.5)} );
		)
	);
);

gb[AxisBox( 1 )] << Max( 8 );
gb[AxisBox( 2 )] << Max( 4 );

For( i = 1, i <= 2, i++,
	gb[AxisBox( i )] << show major grid( 1 ) << Min( 0 ) << inc( 1 ) << show labels( 0 ) << show major ticks( 0 ) << remove axis label()
);

New Window( "Marker Selection Grid", Lineup Box( N Col( 1 ), gb, Border Box( tb, <<sides( 15 ) ) ) );

 

Craige_Hales
Super User

Re: Icons of the Graphic Markers

see https://community.jmp.com/t5/JSL-Cookbook/Custom-Button-Icons/ta-p/50294 , thanks for the idea!

button iconsbutton icons

Craige
DMR
DMR
Level V

Re: Icons of the Graphic Markers

Hi Craige - that's a very instructive script there: I can see several uses for something like this in the context of what I'm doing!

 

Many thanks