10 useful tips for automating the publishing of JMP Live reports
Jan 3, 2019 12:51 PM
You may have already seen JMP Public and reports that folks have shared on the website. What you may have not heard about is JMP Server and JMP Live, the enabling technology behind JMP Public.
JMP Public is a website for JMP users around the world to share their discoveries and explore interesting public data sets. With JMP 14.2 and later, you can easily publish interactive reports to JMP Public and share your finding with others, even if they don’t have JMP.
Later this year, with the release of JMP 15.0, we are going to be offering publishing capabilities similar to JMP Public for an organization’s proprietary data – in a private and secure environment. The relationship between JMP Server, JMP Live and JMP Public is shown in the figure below. But you don’t need to wait until the end of the year to start improving your publishing skills. Here are 10 tips to improve your publishing efficiency and to help automate routine publishing tasks.
P.S. I should note that this is a JSL-heavy blog post…
P.P.S. You can download my annotated published script at the end of this blog post as a good starting point for your own publish scripts.
For these 10 tips, we are going to look at a recent report I published to JMP Public, which explores an interesting data set made available from the US Food and Drug Administration’s Center for Drug Evaluation and Research (CDER). Check out the report on JMP Public:
Get to know the JSL functions for creating web reports and adding JMP reports to a collection of reports. The nice thing about publishing to a JMP server is that after you publish an initial report, the syntax required to publish similar reports will be identical. So even if you aren’t a JSL guru, you can easily automate the publishing of your reports by using my code here. Below is a snippet of code from the JSL script attached to this post.
// Create the web report element to hold the graphs and window.
webreport = New Web Report();
// Add title and description for the index page.
webreport << Index(
Title( "Biomarkers in Labels (CDER)" ),
"Source: <a href=\!"https://www.fda.gov/drugs/scienceresearch/ucm572698.htm\!">Table of Pharmacogenomic Biomarkers in Drug Labeling</a>"
// Add graphs using add report message. You can also add a description if required.
webreport << add report( graph1, title( "Number of Drugs Added Per Quarter by Therapeutic Area" ) );
webreport << add report( graph2, title( "Labeling Sections MCA" ) );
webreport << add report( graph3, title( "Therapeutic Area Packed Bar Chart" ) );
webreport << add report( win, title( "Links to Drug Detail Page (External)" ) );
When you look at my published reports, you will see an index page and four reports in the collection. In the script for the report, the following JSL functions will be useful:
New Web Report() creates a container that will be used to publish my report collection. The web report accepts JSL message to load it up with reports and also metadata (we will talk about the window latter). I create the report, add information to index (including a title and description), and then add reports to it. These reports are just windows in JMP.
Description() can link to other websites by using HTML href syntax. Notice in the JSL above, my description has a link to an external website. In order to make that link work when the report is published to JMP Public, I just have to wrap a <a href=”link”>Link Title</a> around it. Note that you need to use escaped parentheses, \!”, within the href argument. Then the link will be recognized and when clicked, go to the appropriate place, even another JMP Public report.
<< Add Report() lets me add all of the graphs that I want in my final published reports to the container I build using New Web Report(). If you decide you report needs new graph, it's as easy as adding another line, another add report and re-running the script.
You can replace a package easily by copying its unique ID after publishing the first time. When you publish a package, it is given a unique ID. This ID is in the URL. If you want to integrate automatically replacing it into a script, just copy that ID and then place it into a “replace” argument script in your publish command, as below.
You can control whether or not your published report is just “for me” or “public”, by adding the public (1|0) into your script. Notice in the script snippet above, I have “public (1)” in the message. This makes the report available to all. If I want it just for me, putting public (0) would do this.
If you want a list of links to other websites, you can collect them into a New Window. In the CDER data, I wanted to be able to link all the drugs back to their detail pages. This is pretty easy to do because the URL is just a combination of a base HTML argument with the application number appended to the end. The below JSL snippet does this. Basically, I want to create a window, and then loop through an application number column. Then the window is published to my report collection.
win = New Window( "Drug Information", V List Box() );
For Each Row(dt3,
applicationNum = Char(:Application Number);
drug = Char(:Drug Name);
button_expr = EvalInsert("\[one_button = button box("^drug^", web("^link^"), <<underlinestyle)]\");
win << append(V List Box());
win << append(one_button)
If you want your script to auto-run when it is open, simply add a //! to the first line of the script. Pretty easy one, but for data that changes, this makes it easier to republish automatically by opening the file, saving a click. If you want to auto-publish on a schedule (because your data is updating on a regular basis and you always want your published report to be up-to-date), take advantage of the Automator on MacOS X or the task scheduler on Windows.
Think about summarizing your data if it is large. Reports published to JMP Public has a size limit imposed on all files that are uploaded. You should use this as a model and best practice. Because the entire data set is published when you publish a JMP report to a JMP server, if you can aggregate, do it. It will make the report load up faster and make the package more compact. The same goes for unnecessary columns. If you don’t need them, delete them in the data set you publish.
If your interactive HTML reports are not fully supported, you can determine which parts are not working by using Window -> log in JMP. The log will stream out what specific parts of your report are not supported as interactive HTML. While we do aim to have as much as possible available as interactive when you publish reports, we don’t have complete coverage. However, there are often ways to redo your graph or report to remove the unsupported element.
Use the column labels to add some context to your published reports. Since a published report doesn’t have the link back to the data table as easily as a graph in JMP, adding labels as appropriate can help the viewer of your graph or report to get a bit more context when looking at your graph. It is easy to make a column a label column by right-clicking on the column in the columns list and turning on the Label/Unlabel option.
Dashboards are great, but you don’t need to rely on them when publishing. When you publish multiple interactive HTML reports as a report collection to a JMP server, you automatically get a useful index page, which in many cases can serve the same purpose as a dashboard. Plus, you get the advantage of having a title and description for each individual report published to the collection if you want. And you are more forgiving of the various screen sizes that your consumers may have (phone, tablet, laptop etc.).
I hope these 10 tips help with your own published scripts. If you haven’t tried publishing a report or collection of reports to JMP Public with a script, I encourage you to download my example script and data as a template. It’s pretty easy to replace the individual graphs with those of your own. The publish syntax doesn’t change that much. There is a lot more you can do with automation, and I hope to explore that more in the coming months.