Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
robot
Level VI

Cause and Effect Diagram Color

Is it possible to embed color information into a table for a Cause and Effect Diagram?  If not, could this be a feature request?

 

This would be very useful for keeping track of progress in a root cause investigation.  And especially useful when there multiple Text Edit Boxes with the same name (eg: Temperature, Setup).

 

I am using JMP14.3.0

 

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Ishikawa.jmp" );
dt << Diagram(
	Y( :Child ),
	X( :Parent ),
	SendToReport(
		Dispatch( {}, "Solder process", TextEditBox, {Font Color( 5 )} ),
		Dispatch( {}, "Splatter", TextEditBox, {Font Color( 5 )} ),
		Dispatch( {}, "Flux", TextEditBox, {Font Color( 5 )} ),
		Dispatch( {}, "Chain speed", TextEditBox, {Font Color( 5 )} ),
		Dispatch( {}, "Temperature", TextEditBox, {Font Color( 5 )} ),
		Dispatch( {}, "Setup", TextEditBox, {Font Color( 5 )} ),
		Dispatch( {}, "Control", TextEditBox, {Font Color( 5 )} ),
		Dispatch( {}, "Wave pump", TextEditBox, {Font Color( 5 )} ),
		Dispatch( {}, "Height", TextEditBox, {Font Color( 5 )} ),
		Dispatch( {}, "Flow", TextEditBox, {Font Color( 5 )} ),
		Dispatch( {}, "Raw card", TextEditBox, {Font Color( 3 )} ),
		Dispatch( {}, "Short circuit", TextEditBox, {Font Color( 3 )} ),
		Dispatch( {}, "Shroud", TextEditBox, {Font Color( 3 )} ),
		Dispatch( {}, "Moisture context", TextEditBox, {Font Color( 3 )} ),
		Dispatch( {}, "Time", TextEditBox, {Font Color( 3 )} ),
		Dispatch( {}, "Temperature", Text Edit Box( 2 ), {Font Color( 3 )} ),
		Dispatch( {}, "Components", TextEditBox, {Font Color( 0 )} ),
		Dispatch( {}, "Missing from reel", TextEditBox, {Font Color( 0 )} ),
		Dispatch( {}, "Vendor", TextEditBox, {Font Color( 0 )} ),
		Dispatch( {}, "Setup", Text Edit Box( 2 ), {Font Color( 0 )} ),
		Dispatch( {}, "Wrong part", TextEditBox, {Font Color( 0 )} ),
		Dispatch( {}, "Functional failure", TextEditBox, {Font Color( 0 )} )
	)
);
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
robot
Level VI

Re: Cause and Effect Diagram Color

Thanks @andreacoombs1.  Your script did indeed get most of the way there.  I think this script goes the rest of the way.  I have not yet tested for robustness, but seems to work okay.

 

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Ishikawa.jmp" );

// Add color column.
dt << New Column( "Color",
	Numeric,
	"Continuous",
	Format( "Best", 12 ),
	Value Labels( {3 = "Red", 5 = "Blue"} ),
	Use Value Labels( 1 ),
	Set Values( [., 5, 3, ., ., ., ., ., 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, ., ., ., ., ., ., ., ., ., ., .] )
);

// Create diagram.
dgram = dt << Diagram( Y( :Child ), X( :Parent ) );

// Get diagram order.
dgramRep = dgram << Report;
dgramRep[Hier Box( 1 )] << Make Into Data Table();
orderDt = Current Data Table();
orderDt << Set Name( "Row Order" );
orderDt << New Column( "Row Order", Numeric, Continuous, Values( Index( 1, N Rows( orderDt ) ) ) );

// Update dt with row order.
dt << Update( With( orderDt ), By Matching Columns( :Parent == :Parent, :Child == :Child ) );
Close( orderDt, No Save );

// Set colors.
orderList = As List( dt:Row Order << Get Values() );
colorList = As List( dt:Color << Get Values() );

For( i = 1, i <= N Rows( dt ), i++,
	c = colorList[Loc( orderList, i )][1];
	If( !Is Missing( c ),
		dgramRep[Text Edit Box( i + 1 )] << Font Color( c )
	);
);

View solution in original post

7 REPLIES 7
Highlighted
Byron_JMP
Staff

Re: Cause and Effect Diagram Color

I'm pretty sure I saw @andreacoombs1 set up a table template to use with a script that colored the branches of the fishbone.   Unfortunately, I don't have that script.

JMP Systems Engineer, Pharm and BioPharm Sciences
Highlighted

Re: Cause and Effect Diagram Color

It is possible to set up the data table to color your fishbone with a script.  Here are the three key steps and a few notes on what is happening.

 

1.  The data table must be sorted in the order the fishbone is created.  Any row with a Parent that was a Child in a preceding row, must be in the subsequent row. The Ishikawa.jmp data set is not in this order.  The script below will create a new data table called "Ishikawa Sorted".  Notice, for example, that within Solder Process there is a Child called Temperature which is a Parent in other rows.  Solder Process, Temperature is in row 9 and Temperature, Setup immediately follows in row 10.

2.  Add a column called "Color" that contains a standard JMP color.  For demonstration purposes, the script below adds this column and also adds a Row State column for this color and colors the data table to make the color scheme apparent.  I have colored the 5 potential root cause categories separate colors. I have also colored some of them gray which you could do, for example, as you reach a conclusion about potential root cause. 

3.  The final step is to run the script that 1) creates the fishbone diagram, 2) pulls the colors from the data table, and 3) colors the text in the fishbone.  A script that contains these three steps can be saved to your data table.  The text strings in the fishbone diagram are stored in text edit boxes.  The first text edit box corresponds to the first or highest order parent in the data table which, in this case, is "Defects in circuit board".  That is why the For loop contains i+1 for the text edit box and i for the corresponding color. 

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Ishikawa.jmp" );

//Reorder by defect groups
dt << New Column("Row Order", set values (
	{1,5,15,21,27,2,3,4,6,7,8,9,12,10,11,13,14,16,17,
	18,19,20,22,25,26,23,24,28,29,30,31,32,33})
);

ndt = Data Table( "Ishikawa" ) << Sort(
	By( :Row Order ),
	Order( Ascending ),
	Output Table( "Ishikawa Sorted" )
);

//Add column for color, color rows by color
ndt << New Column ("Color", set values(
	{4,4,4,1,5,5,5,5,1,1,1,5,5,5,3,
	3,3,3,3,3,8,8,8,8,8,8,6,6,6,6,6,1,6})
);

ndt << New column ("Color State", "Row State", Formula(Color State( :Color )));
Column(ndt,"Color State")<<Copy to Row States();
ndt << Color Rows by Row State;

//Make fishbone and get display box
fb = ndt << Diagram(
	Y( :Child ),
	X( :Parent ))
;

fbrep = fb<<report;

//Color text edit boxes by color in data table
colorlist = ndt:Color<<get values();

for (i=1, i<=nitems(colorlist), i++,
	fbrep[texteditbox(i+1)]<<font color(colorlist[i])
);

 

Highlighted
robot
Level VI

Re: Cause and Effect Diagram Color

Thanks @andreacoombs1 .  Do you know a method to automate values in the dt:Row Order column?

Highlighted

Re: Cause and Effect Diagram Color

This script can get you most of the way there.  I would have to put some more thought on how to pull the corresponding Parent but here is how you can get the Child and Row Order.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Ishikawa.jmp" );

fb1 = dt << Diagram(
	Y( :Child ),
	X( :Parent ))
;
fb1rep = fb1<<report;
dtrow = New Table ("Ishikawa Row Order", Add rows(33),
	New Column("Parent", "Character"),
	New Column("Child", "Character"), 
	New Column ("Row Order", set each value(row())));

for (i=1, i<=33, i++,
text = fb1rep[texteditbox(i+1)]<<Get text;
Column("Child")[i]=text;
);
Highlighted
robot
Level VI

Re: Cause and Effect Diagram Color

Thanks @andreacoombs1.  Your script did indeed get most of the way there.  I think this script goes the rest of the way.  I have not yet tested for robustness, but seems to work okay.

 

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Ishikawa.jmp" );

// Add color column.
dt << New Column( "Color",
	Numeric,
	"Continuous",
	Format( "Best", 12 ),
	Value Labels( {3 = "Red", 5 = "Blue"} ),
	Use Value Labels( 1 ),
	Set Values( [., 5, 3, ., ., ., ., ., 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, ., ., ., ., ., ., ., ., ., ., .] )
);

// Create diagram.
dgram = dt << Diagram( Y( :Child ), X( :Parent ) );

// Get diagram order.
dgramRep = dgram << Report;
dgramRep[Hier Box( 1 )] << Make Into Data Table();
orderDt = Current Data Table();
orderDt << Set Name( "Row Order" );
orderDt << New Column( "Row Order", Numeric, Continuous, Values( Index( 1, N Rows( orderDt ) ) ) );

// Update dt with row order.
dt << Update( With( orderDt ), By Matching Columns( :Parent == :Parent, :Child == :Child ) );
Close( orderDt, No Save );

// Set colors.
orderList = As List( dt:Row Order << Get Values() );
colorList = As List( dt:Color << Get Values() );

For( i = 1, i <= N Rows( dt ), i++,
	c = colorList[Loc( orderList, i )][1];
	If( !Is Missing( c ),
		dgramRep[Text Edit Box( i + 1 )] << Font Color( c )
	);
);

View solution in original post

Highlighted
Vball247
Level IV

Re: Cause and Effect Diagram Color

I just saw this posting, and I had just submitted to the JMP Wish List to add other features to make the JMP Cause and Effect more like mind mapping, based on my topic at the JMP Discovery Summit 2020.

You can see my presentation for JMP Discovery Summit 2020: Structured Problem Solving using JMP Cause and Effect Diagram, mind-mapping software, and JSL (2020-... 

 

I was able to make an interactive floating window that allows the user to add "E","C", "N" in the Labels column, by sending messages to the Text Edit Boxes, and it includes a different font color for each letter. The script also creates the "Label" column if missing. 

 

I am attempting to do the same for your problem of coloring any of the initial text, but having some issues when sending a message to a sub-parent, it wants to color all the text below it. But this posting is an interesting concept, we have had JMP users who take the same Cause and Effect diagram and manually color code different text for each problem, using the built in capability of right-clicking over each text edit box. The interactive floating window concept is nice in that you can color or return back to original color while a team is brainstorming.

I will add your suggestion to the same wish list for Cause and Effect diagram, maybe the developers will look into this in a future version, and add as a 4th column option. Here is the posting under the JMP Wish List: Fishbone/Cause-and-Effect-Diagram: enhancements to current platform to enable mind mapping 

Highlighted

Re: Cause and Effect Diagram Color

@robot I didn't realize you could make a data table from HierBox(1). That does it!!