Subscribe Bookmark RSS Feed

Callback from Column Switcher and posting code in the User Community

brian_bircumsha

Community Trekker

Joined:

Dec 6, 2014

Hi MS,

That worked great!  Thank you.

Two follow-up questions:

  1. Is there any way to set a script to be performed when the Column Switcher is used by the user?  Using your suggestion, I can re-scale the object.  If I put the re-scale script in the Graph Builder FrameBox it constantly updates the scale.  However, it constantly runs in the background, and slows things down.  A better way (I think) would be to set a script to the Column Switcher, like you might set to a RadioButtonBox.
  2. How do you paste script into the community dialog with the formatting from the script windows?  When I paste the text, it automatically gets converted into the standard font.

Thank you again!

Brian

5 REPLIES
ms

Super User

Joined:

Jun 23, 2011

(Answer 1 and code below should be read in the context of this thread: Using Column Switcher deletes Object References?)

1. You can try to set a script to the ListBoxBox() element of the Column Switcher. This code sets a script that when the column selection changes 1) restores the variable (both <<next and manual selection in the column switchers seem to delete the object reference) and 2) runs a function to customize the Graph Builder object. It seems to work but it probably needs further testing.

CustRpt[ListBoxBox( 1 )] << set script(

  gbObj = custRpt[Outline Box( "Graph Builder" )] << get scriptable object;

  setContoursGB( gbObj, 100, 115, 11 );

);

2. On the Mac I just copy from the JMP script editor and paste into the Safari browser. Colors and fonts are preserved but indentation is partially lost. Another way is to first paste into MS Word and then into the browser.

Craige_Hales

Staff

Joined:

Mar 21, 2013

I posted about posting code.


// in neat code blocks like this


// you might need to choose the "advanced" button to find the


// "insert" button


Craige
pmroz

Super User

Joined:

Jun 23, 2011

  1. How do you paste script into the community dialog with the formatting from the script windows?  When I paste the text, it automatically gets converted into the standard font.

As MS mentioned, in Microsoft Windows you need to copy/paste to MS-Word, and then copy/paste from Word to the forum editor.  I like to use tabs in the JMP editor, so I usually convert them to 4 spaces in MS-Word.

// Here's some sample code

dt = open("$sample_data\Big Class.jmp");

Distribution(

    Continuous Distribution( Column( :weight ) ),

    Nominal Distribution( Column( :age ) )

);

Craige_Hales

Staff

Joined:

Mar 21, 2013

JMP's editor doesn't put HTML format on the clipboard, but does put RTF and plain text on the clipboard.  Word loves the RTF format, and in turn will put many formats on the clipboard, including HTML.  The community editor loves the HTML format more than plain text and doesn't understand RTF.  RTF and HTML support syntax highlighting; plain text does not.

Craige
brian_bircumsha

Community Trekker

Joined:

Dec 6, 2014

All,

Thank you for the responses!  The "<< get scriptable" addition from MS worked beautifully.

The code pasting routine from PMroz worked well.  And, thank you Craige@JMP for the explanation!

For those interested in the final code, please see below.

-Brian

dtData = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );

///////////////////////////////////////////////////////////////////////////////////

/*

setContoursGB(toWindow,LV,HV,numContours)

Function to set contours on a Graph Builder object = toWindow.

Contours are equally spaced between LV and HV, with numContours contours.

*/

///////////////////////////////////////////////////////////////////////////////////

setContoursGB = Function({toWindow,LV,HV,numContours},

{toWindow,locContours,LV,HV,numContours,i},

      locContours = 1::numContours;

      For(i=1,i<=numContours,i++,

      locContours[i]=LV+(i-1)*(HV-LV)/(numContours-1));

      toWindow << SendToReport(

            Dispatch(

                  {},

                  "400",

                  ScaleBox,

                  {Legend Model(

                        1,

                        Properties(

                              0,

                              {gradient(

                                    {Color Theme( "Cool to Warm" ),

                                    Label Levels(

                                          locContours

                                    ), Width( 12 )}

                              )}

                        ),

                        Properties( 1, {Marker( "Pipe" ), Fill Color( 0 )} )

                  )}

            ))

);

  1. ///////////////////////////////////////////////////////////////////////////////////

/* Open Window */

custRpt = New Window( "Analysis",

AnaNotesBox = Outline Box( "Analysis Notes",

Text Box( "Information..." ),

)

);

/* Append the Graph Builder Object (GB) */

custRpt << append(

gbObj = Graph Builder(

      Size( 570, 374 ),

      Show Control Panel( 0 ),

      Variables( X( :Wafer ID in lot ID ), Y( :SITE ), Color( :NPN1 ) ),

      Elements( Points( X, Y, Legend( 1 ), Jitter( 1 ) ) ),

      SendToReport(

            Dispatch(

                  {},

                  "400",

                  ScaleBox,

                  {Legend Model(

                        1,

                        Properties(

                              0,

                              {gradient( {Color Theme( "Cool to Warm" ), Width( 12 )} )}

                        ),

                        Properties( 1, {Marker( "Pipe" ), Fill Color( 0 )} )

                  )}

            ),

            Dispatch( {}, "Graph Builder", FrameBox, {Marker Size( 5 )} )

      )

));

/* Open the Column Switcher */

csObj = gbObj << Column Switcher(

            NPN1,

            {NPN1, PNP1, PNP2, NPN2, PNP3, IVP1, PNP4, NPN3, IVP2, NPN4, SIT1, INM1,

            INM2, VPM1, VPM2, VPM3, PMS1, SNM1}

      );

/* Run through GB scaling exercises. */

popup = New Window("Message",

<<Modal, Text Box("Next, apply higher contrast coloring."),

SpacerBox(Size(0,20)),

HCenterBox(Button Box( "OK"))

);

setContoursGB(gbObj,110,120,11);

custRpt << Bring Window to Front;

popup = New Window("Message",

<<Modal, Text Box("Now, play with scale."),

SpacerBox(Size(0,20)),

HCenterBox(Button Box( "OK"))

);

setContoursGB(gbObj,105,115,11);

wait(1);

setContoursGB(gbObj,115,125,11);

wait(1);

setContoursGB(gbObj,113,117,11);

wait(1);

setContoursGB(gbObj,110,120,11);

/* Use Column Switcher. We're OK to here. */

popup = New Window("Message",

<<Modal, Text Box("Now, set Column Switcher to PNP1."),

SpacerBox(Size(0,20)),

HCenterBox(Button Box( "OK"))

);

csObj << Next;

/* Try to rescale GB, and things break. */

popup = New Window("Message",

<<Modal, Text Box("Try to re-scale Graph Builder."),

SpacerBox(Size(0,20)),

HCenterBox(Button Box( "OK"))

);

gbObj = custRpt[Outline Box( "Graph Builder" )] << get scriptable object;

setContoursGB(gbObj,200,400,11);