虽然种类很多联合管理计划图形目前在最新版本中是交互式的JMP 直播,有时 JMP 平台内的特定选项在启用时会阻止完全交互。 通过使用增量方法,可以稍微调整图表的外观,以便在 JMP Live 上获得更好的交互性。
JMP Live 输出是使用 HTML5 基础构建的。 这意味着什么? 这意味着,虽然 JMP Live 上还存在 HTML5 之外的其他功能(例如,在用于在服务器上重新生成图形的计算中包含已过滤的行),但许多交互性测试可以在没有 JMP Live 的情况下通过仅检查 HTML5 来执行输出。
让我们研究一下检查和修复交互性的两种方法:交互式(无双关语)和通过脚本编辑器。 两种方法都将使用通过运行以下示例 JSL 脚本生成的图形。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp", Invisible );
jmpreport = NewWindow("Test",
VListBox(
DataFilterContextBox(
HListBox(
dt << DataFilter(Conditional, Count Excluded Rows(0), Local, Add Filter(columns(:age))),
dt << GraphBuilder(
Show Control Panel( 0 ),
Fit to Window( "Off" ),
X Group Edge( "Bottom" ),
Variables(
Y( :weight ),
Group X( :age )
),
Elements( Box Plot( Y, Legend( 1 ), Jitter( "None" ), Box Style( "Solid" ) ) )
)
)
)
)
);
结果如下:
A data filter and box plot as they appear on the JMP client.A data filter and box plot as they appear on the JMP client.A data filter and box plot as they appear on the JMP client.A data filter and box plot as they appear on the JMP client.JMP 客户端上显示的数据过滤器和箱线图。
互动方式
检查交互性的一种方法是通过“发布”菜单选项。 在任何 JMP 窗口的菜单栏上,单击文件 > 发布。 在“选择报告”窗口中,选中测试结果窗口的“测试”框。 请注意窗口列表正下方的消息:“此报告已部分实现交互式 HTML。 请查看日志消息。”这是第一个线索,表明您的结果的某些方面可能不完全交互式。
The interactive Publish menu option.The interactive Publish menu option.The interactive Publish menu option.The interactive Publish menu option.交互式发布菜单选项。
检查日志窗口(查看 > 日志)。 在其他消息中,您会看到以下消息:“交互式 HTML:具有实体样式的箱线图不是交互式的。”现在您可以专注于这个特定的图形元素。
Log containing interactivity messages.Log containing interactivity messages.Log containing interactivity messages.Log containing interactivity messages.包含交互消息的日志。
如果您继续发布此报表(发布到文件或 JMP Live)并将鼠标指针悬停在箱线图中的方框上,您将看到此工具提示:“此功能不是交互式的。” (尽管这些框中不会包含相应数据表行的描述性悬停文本,但 JMP Live 仍然允许根据本地数据过滤器中的过滤器选择更改重新绘制图表。)
A data filter and box plot in JMP Live. The box plot is marked non-interactive.A data filter and box plot in JMP Live. The box plot is marked non-interactive.A data filter and box plot in JMP Live. The box plot is marked non-interactive.A data filter and box plot in JMP Live. The box plot is marked non-interactive.JMP Live 中的数据过滤器和箱线图。 箱线图被标记为非交互式。
在这种情况下,如果您愿意选择实体以外的箱线图样式,则可以获得更好的交互性。 返回 JMP 客户端中的原始测试窗口,右键单击箱线图中的方框,然后选择箱线图 > 箱线样式 > 正态。
Changing the box plot options interactively in the JMP client.Changing the box plot options interactively in the JMP client.Changing the box plot options interactively in the JMP client.Changing the box plot options interactively in the JMP client.在 JMP 客户端中以交互方式更改箱线图选项。
如果重复发布过程,将鼠标悬停在箱形图上时,您将看到数据点的描述性文本。
Interactive data filter and box plot in JMP Live.Interactive data filter and box plot in JMP Live.Interactive data filter and box plot in JMP Live.Interactive data filter and box plot in JMP Live.JMP Live 中的交互式数据过滤器和箱线图。
脚本编辑器
检查交互性的另一种方法是通过脚本编辑器。 将以下代码附加到示例脚本并运行它以在本地保存 Web 报告:
webreport = New Web Report();
webreport << Add Report(
jmpreport,
Title( "Test" )
);
url = webreport << Save("$DOCUMENTS/Test");
If( !Is Empty( url ),
Web( url )
);
或者,附加并运行以下代码(适当替换您的实际 URL、用户名和 API 密钥)以发布到 JMP Live:
webreport = New Web Report();
webreport << Add Report(
jmpreport,
Title( "Test" )
);
url = webreport << Publish(URL("https://your_url.com/"), username("your_username"), ApiKey("your_api_key"));
If( !Is Empty( url ),
Web( url )
);
检查日志窗口。 您将看到与交互式方法生成的相同消息,包括“交互式 HTML:具有实体样式的箱形图不是交互式的”。
Log containing interactivity messages.Log containing interactivity messages.Log containing interactivity messages.Log containing interactivity messages.包含交互消息的日志。
当您通过将鼠标指针悬停在箱线图中的方框上来检查报告(本地或 JMP Live 上)时,工具提示“此功能不是交互式的”。被揭露。
A data filter and box plot in JMP Live. The box plot is marked non-interactive.A data filter and box plot in JMP Live. The box plot is marked non-interactive.A data filter and box plot in JMP Live. The box plot is marked non-interactive.A data filter and box plot in JMP Live. The box plot is marked non-interactive.JMP Live 中的数据过滤器和箱线图。 箱线图被标记为非交互式。
您可以通过直接在脚本编辑器窗口中直接更新脚本来进行与交互方法中相同的修复。 具体来说,将 GraphBuilder() > Elements() > Box Style() 从 Solid 更改为 Normal。
Elements( Box Plot( Y, Legend( 1 ), Jitter( "None" ), Box Style( "Normal" ) ) )
如果您重新运行脚本(其中包含“保存”或“发布”消息)并重新检查输出,则将鼠标悬停在描述性框图数据点文本上时,您将看到该文本。
Interactive data filter and box plot in JMP Live.Interactive data filter and box plot in JMP Live.Interactive data filter and box plot in JMP Live.Interactive data filter and box plot in JMP Live.JMP Live 中的交互式数据过滤器和箱线图。
额外提示:在交互式方法和脚本方法之间切换
您可以轻松地在交互式方法和脚本方法之间切换。 在客户端上大多数 JMP 图形的红色小三角菜单上,有一个命令可显示用于生成图形的脚本。 单击“保存脚本”>“到脚本窗口”。
Saving a graphics script to a script window.Saving a graphics script to a script window.Saving a graphics script to a script window.Saving a graphics script to a script window.将图形脚本保存到脚本窗口。
通过这样做,您可以打开一个新的脚本窗口或将用于生成图形的脚本附加到当前脚本窗口。
Graphics script saved to a script window.Graphics script saved to a script window.Graphics script saved to a script window.Graphics script saved to a script window.图形脚本保存到脚本窗口。
同样,在 JMP Live 上查看图形时,您可以导航至“详细信息”部分(单击看起来像小写“i”的按钮),然后单击每个数据表或 JSL 旁边的下载按钮(向下的箭头)用于保存它们的本地副本的脚本。 (请注意,仅当指定了“发布数据”和“允许下载数据”发布选项时,这些下载按钮才可用。)
Data table and JSL script available for download from JMP Live.Data table and JSL script available for download from JMP Live.Data table and JSL script available for download from JMP Live.Data table and JSL script available for download from JMP Live.数据表和 JSL 脚本可从 JMP Live 下载。
有了数据表和脚本,您就可以逐步检查平台脚本选项更改对最终交互性的影响,即使您不是发布到 JMP Live 的脚本的作者。