JMP App( Set Name( "Application" ), Set Description( "An empty workspace for creating custom applications with one or more windows and scripts" ), Auto Launch( 1 ), Snap To Grid( 1 ), Show Grid( 1 ), Show Properties( 1 ), Show Sources( 1 ), Group By Category( 1 ), Dashboard Mode( 0 ), Parameters, Tables( ParksAndBrewsTable = GuiTable( Set Path( "/C:/Users/rblucas/Downloads/Hikes/CO Parks and Breweries.jmp" ), Set Label( "CO Parks and Breweries" ), Set Location( "Prompt" ), Set Invisible( 0 ) ) ), Script(JSL Quote(// This script is executed when the application is run. // Named objects have been created for the application modules // (for example, "Module1") and the pre-defined object // "thisApplication" refers to the application object itself. // Variables and functions declared here are scoped to the // Application namespace. ) ), Allocate( Dash = Plan( PreAllocate, Script(JSL Quote(// This script is executed when a new module instance is // created. The pre-defined object "thisModuleInstance" refers // to the instance object, but other objects such as boxes and // scripts have not yet been created. Variables declared here are // scoped to the ModuleInstance namespace. // This special function will receive parameters passed to CreateInstance() OnModuleLoad( {}, ); thisModuleInstance << Create Objects; // After this point your module instance objects have been created // and can be referred to by name (for example, "Button1"). // Start the dashboard with the tabulate tables closed MilesTimes["Miles & Time to get there"] << Close( 1 ); Breweries["Breweries to visit after the hike"] << Close( 1 ); dt = Current Data Table(); // This function retrieves row states after any row state changes getUnexcludedRows = Function( {}, rs = tb << Get row states(); // Add up rows in excluded state n = 0; For( ii = 1, ii <= N Rows( rs ), ii++, If( Excluded( As Row State( rs[ii] ) ), n ++) ); // If there are excluded rows due to user selections, open the tabulate tables // If no rows excluded (at start and when user unselects point), close tabulate tables If( n > 0, MilesTimes["Miles & Time to get there"] << Close( 0 ); Breweries["Breweries to visit after the hike"] << Close( 0 ); , MilesTimes["Miles & Time to get there"] << Close( 1 ); Breweries["Breweries to visit after the hike"] << Close( 1 ); ); // Get row numbers of unexcluded rows to use in button box scripts // for accessing web addresses selrows = Loc( rs < 1 ); ); // Row check rsupdate = Function( {a}, If( Is Matrix( a ), getUnexcludedRows() ) ); // create row state handler to detect changes in graph builder filter rsh = tb << Make Row State Handler( dt, rsupdate ); ) ), Allocate( Outline1 = Outline Box(); DataFilterContext1 = Data Filter Context Box(); List1 = H List Box(); List3 = V List Box(); DataFilterSource1 = Data Filter Source Box(); CO_map = Platform( ParksAndBrewsTable, Graph Builder( Size( 515, 440 ), Show Control Panel( 0 ), Fit to Window( "Maintain Aspect Ratio" ), Variables( X( :Longitude ), Y( :Latitude ) ), Elements( Points( X, Y, Legend( 3 ) ) ), SendToReport( Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Locations of Colorado State Parks" )} ), Dispatch( {}, "Longitude", ScaleBox, {Label Row( {Show Major Labels( 0 ), Show Major Ticks( 0 ), Show Minor Ticks( 0 )} )} ), Dispatch( {}, "Latitude", ScaleBox, {Label Row( {Show Major Labels( 0 ), Show Major Ticks( 0 ), Show Minor Ticks( 0 )} )} ), Dispatch( {}, "graph title", TextEditBox, {Set Text( "Hover cursor over point to view name & picture. Select point to view distances & nearby breweries." )} ), Dispatch( {}, "X title", TextEditBox, {Set Text( "" )} ), Dispatch( {}, "Y title", TextEditBox, {Set Text( "" )} ), Dispatch( {}, "Graph Builder", FrameBox, {Background Color( 70 ), Background Map( Images( "Street Map Service" ) ), Marker Size( 4 ), Marker Selection Mode( "Selected Haloed" ), Grid Line Order( 2 ), Reference Line Order( 3 )} ), Dispatch( {}, "400", LegendBox, {Legend Position( {3, [-1]} ), Position( {-1} )} ) ) ) ); List6 = V List Box(); tb = Text Box(); List4 = H List Box(); TrailInfo = Button Box(); Maps = Button Box(); Spacer7 = Spacer Box(); List2 = V List Box(); MilesTimes = Platform( ParksAndBrewsTable, Tabulate( Change Item Label( Statistics( Min, "----" ) ), Show Control Panel( 0 ), Add Table( Column Table( Analysis Columns( :Miles to Park from Fort Collins, :Name( "Estimated Drive Time (hours)" ) ), Statistics( Min ) ), Row Table( Grouping Columns( :Park Name ) ) ), SendToReport( Dispatch( {}, "Tabulate", OutlineBox, {Set Title( "Miles & Time to get there" )} ) ) ) ); Breweries = Platform( ParksAndBrewsTable, Tabulate( Show Control Panel( 0 ), Add Table( Row Table( Grouping Columns( :Closest City with Breweries, :Breweries ) ) ), SendToReport( Dispatch( {}, "Tabulate", OutlineBox, {Set Title( "Breweries to visit after the hike" )} ) ) ) ); ), Organize( Reparent( List2( Breweries ) ); Reparent( List2( MilesTimes ) ); Reparent( List1( List2 ) ); Reparent( List6( Spacer7 ) ); Reparent( List4( Maps ) ); Reparent( List4( TrailInfo ) ); Reparent( List6( List4 ) ); Reparent( List6( tb ) ); Reparent( List3( List6 ) ); Reparent( DataFilterSource1( CO_map ) ); Reparent( List3( DataFilterSource1 ) ); Reparent( List1( List3 ) ); Reparent( DataFilterContext1( List1 ) ); Reparent( Outline1( DataFilterContext1 ) ); Relocate( Outline1( 0, 0 ) ); ), Initialize( Outline1 << Background Color( 2147483647 ); Outline1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); Outline1 << Enabled( 1 ); Outline1 << Horizontal Alignment( "Default" ); Outline1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); Outline1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); Outline1 << Text Color( 2147483647 ); Outline1 << Vertical Alignment( "Default" ); Outline1 << Visibility( "Visible" ); Outline1 << Set Title( "Colorado State Parks and Local Brews Dashboard" ); Outline1 << SetHorizontal( 0 ); Outline1 << SetOpen( 1 ); Outline1 << Outline Close Orientation( "Auto" ); Outline1 << Set Base Font( "Title" ); Outline1 << Set Font Name( "Segoe UI" ); Outline1 << Set Font Style( "Bold" ); Outline1 << Set Font Size( 18 ); Outline1 << Set Font Scale( 1 ); DataFilterContext1 << Background Color( 2147483647 ); DataFilterContext1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); DataFilterContext1 << Enabled( 1 ); DataFilterContext1 << Horizontal Alignment( "Default" ); DataFilterContext1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); DataFilterContext1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); DataFilterContext1 << Text Color( 2147483647 ); DataFilterContext1 << Vertical Alignment( "Default" ); DataFilterContext1 << Visibility( "Visible" ); List1 << Background Color( 2147483647 ); List1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List1 << Enabled( 1 ); List1 << Horizontal Alignment( "Default" ); List1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List1 << Text Color( 2147483647 ); List1 << Vertical Alignment( "Default" ); List1 << Visibility( "Visible" ); List1 << set horizontal( 1 ); List3 << Background Color( 2147483647 ); List3 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List3 << Enabled( 1 ); List3 << Horizontal Alignment( "Default" ); List3 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List3 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List3 << Text Color( 2147483647 ); List3 << Vertical Alignment( "Default" ); List3 << Visibility( "Visible" ); List3 << set horizontal( 0 ); DataFilterSource1 << Background Color( 2147483647 ); DataFilterSource1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); DataFilterSource1 << Enabled( 1 ); DataFilterSource1 << Horizontal Alignment( "Default" ); DataFilterSource1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); DataFilterSource1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); DataFilterSource1 << Text Color( 2147483647 ); DataFilterSource1 << Vertical Alignment( "Default" ); DataFilterSource1 << Visibility( "Visible" ); CO_map << Background Color( 2147483647 ); CO_map << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); CO_map << Enabled( 1 ); CO_map << Horizontal Alignment( "Default" ); CO_map << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); CO_map << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); CO_map << Text Color( 2147483647 ); CO_map << Vertical Alignment( "Default" ); CO_map << Visibility( "Visible" ); CO_map << set horizontal( 0 ); List6 << Background Color( 2147483647 ); List6 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List6 << Enabled( 1 ); List6 << Horizontal Alignment( "Left" ); List6 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List6 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List6 << Text Color( 2147483647 ); List6 << Vertical Alignment( "Default" ); List6 << Visibility( "Visible" ); List6 << set horizontal( 0 ); tb << Background Color( 2147483647 ); tb << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); tb << Enabled( 1 ); tb << Horizontal Alignment( "Default" ); tb << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); tb << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); tb << Text Color( 2147483647 ); tb << Vertical Alignment( "Default" ); tb << Visibility( "Visible" ); tb << Set Base Font( "Text" ); tb << Set Font Scale( 1 ); tb << Set Text( "Click a button for park info or a map AFTER selecting point above" ); tb << Bullet point( 0 ); tb << Font Color( 100 ); tb << Justify Text( "Left" ); tb << Rotate Text( "Horizontal" ); tb << Set Width( -1 ); tb << Set Wrap( 360 ); tb << Set Tip( "" ); tb << Set Min Size( 347, 16 ); tb << Set Max Size( 347, 16 ); tb << Set Auto Stretching( 0, 0 ); List4 << Background Color( 2147483647 ); List4 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List4 << Enabled( 1 ); List4 << Horizontal Alignment( "Default" ); List4 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List4 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List4 << Text Color( 2147483647 ); List4 << Vertical Alignment( "Default" ); List4 << Visibility( "Visible" ); List4 << set horizontal( 1 ); TrailInfo << Background Color( 2147483647 ); TrailInfo << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); TrailInfo << Enabled( 1 ); TrailInfo << Horizontal Alignment( "Default" ); TrailInfo << Margin( {Left( 2 ), Top( 2 ), Right( 2 ), Bottom( 2 )} ); TrailInfo << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); TrailInfo << Text Color( 2147483647 ); TrailInfo << Vertical Alignment( "Default" ); TrailInfo << Visibility( "Visible" ); TrailInfo << Set Button Name( "Trail Info" ); TrailInfo << Style( "Normal" ); TrailInfo << Set( 0 ); TrailInfo << Set Icon( "" ); TrailInfo << Set Icon Location( "Right" ); TrailInfo << Set Function(JSL Quote(// This script is executed when the Trail Info button is clicked. // The specified park web address is navigated to and opened in a new window // The vector of unexcluded rows from the row state handler functions, in // "selRows" variable is used to navigate to the web addresses in the table. // Specifically,the first value is used here. jmpVer = JMP Version(); // Mac does not support the Web Browser() function, so use Web() instead // Use Web() as workaround for JMP 15.0.0 issue If( Host is( "Mac" ) | Contains( jmpVer, "15." ), Web( Column( dt, "Trails Webpage" )[selRows[1]] ), // else Host is Windows, use Web Browser() nw = New Window( "Park Trail Information", wb = Web Browser Box() ); wb << Navigate( Column( dt, "Trails Webpage" )[selRows[1]] ); wb << Set Auto Stretching( 1, 1 ); wb << Set Max Size( 10000, 10000 ); ); ) ); TrailInfo << Set Min Size( 80, 21 ); TrailInfo << Set Max Size( 80, 21 ); TrailInfo << Set Auto Stretching( 0, 0 ); Maps << Background Color( 2147483647 ); Maps << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); Maps << Enabled( 1 ); Maps << Horizontal Alignment( "Default" ); Maps << Margin( {Left( 2 ), Top( 2 ), Right( 2 ), Bottom( 2 )} ); Maps << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); Maps << Text Color( 2147483647 ); Maps << Vertical Alignment( "Default" ); Maps << Visibility( "Visible" ); Maps << Set Button Name( "Maps or Brochures" ); Maps << Style( "Normal" ); Maps << Set( 0 ); Maps << Set Icon( "" ); Maps << Set Icon Location( "Right" ); Maps << Set Function(JSL Quote(// open a new window that will open the specified location, // which here is a PDF map or brochure, in a web browser window. // The vector of unexcluded rows in "selRows" variable is used // to navigate to the web addresses in the table. Specifically, // the first value is used here Web(Column( dt, "Maps PDF" )[selRows[1]]); ) ); Maps << Set Min Size( 143, 21 ); Maps << Set Max Size( 143, 21 ); Maps << Set Auto Stretching( 0, 0 ); Spacer7 << Background Color( 2147483647 ); Spacer7 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); Spacer7 << Enabled( 1 ); Spacer7 << Horizontal Alignment( "Default" ); Spacer7 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); Spacer7 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); Spacer7 << Text Color( 2147483647 ); Spacer7 << Vertical Alignment( "Default" ); Spacer7 << Visibility( "Visible" ); Spacer7 << Width( 18 ); Spacer7 << Height( 18 ); Spacer7 << Color( 2147483647 ); Spacer7 << Set Fill( 0 ); Spacer7 << Set Min Size( 0, 0 ); Spacer7 << Set Max Size( 30000, 30000 ); Spacer7 << Set Auto Stretching( 1, 1 ); List2 << Background Color( 2147483647 ); List2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List2 << Enabled( 1 ); List2 << Horizontal Alignment( "Default" ); List2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List2 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); List2 << Text Color( 2147483647 ); List2 << Vertical Alignment( "Default" ); List2 << Visibility( "Visible" ); List2 << set horizontal( 0 ); MilesTimes << Background Color( 2147483647 ); MilesTimes << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); MilesTimes << Enabled( 1 ); MilesTimes << Horizontal Alignment( "Default" ); MilesTimes << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); MilesTimes << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); MilesTimes << Text Color( 2147483647 ); MilesTimes << Vertical Alignment( "Default" ); MilesTimes << Visibility( "Visible" ); MilesTimes << set horizontal( 0 ); Breweries << Background Color( 2147483647 ); Breweries << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); Breweries << Enabled( 1 ); Breweries << Horizontal Alignment( "Default" ); Breweries << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); Breweries << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ); Breweries << Text Color( 2147483647 ); Breweries << Vertical Alignment( "Default" ); Breweries << Visibility( "Visible" ); Breweries << set horizontal( 0 ); ) ) ), Initialize( Dash << Auto Launch( 1 ); Dash << Set Module Type( "Report" ); Dash << Set Window Title( "Colorado State Park Hiking Planner" ); Dash << Set Min Size( 0, 0 ); Dash << Set Max Size( 30000, 30000 ); Dash << Set Auto Stretching( ., . ); ) )