雖然種類很多聯合管理計劃圖形目前在最新版本中是交互式的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 的腳本的作者。