很酷的新功能 - 不,但是:
☑ 可以幫助很多使用者!
☑ 刪除一些感覺像是「bug」的東西
很高興擁有
無人需要它
是什麼激發了這個願望清單請求?
當使用者透過將 X 或 Y 軸上的標籤拖曳到另一個位置來更改圖形產生器中子圖的順序時,會發生奇怪的事情:
https://community.jmp.com/t5/Discussions/Graph-Builder-settings-for-new-FrameBoxes/mp/561610/highlight/true#M77469
在這個例子中,
- 將 Y 軸上的「高度」拖曳到頂部可重設顏色(!!)
- 向右拖曳 X 軸上的「高度」不會重設顏色(?
)
- 只需抓住並釋放 X 軸上的“高度”即可重置顏色(!!!)
此外,當添加新的子圖時,情節的外觀幾乎是一場賭博:
顏色/標記設定被克隆到新的子圖,如果透過拖放添加變量
- 在現有 X 變數的右側
- 在現有 Y 變數的底部
如果新增變量,則不會複製設定
-在現有 X 變數的左側
- 在現有 Y 變數的頂部(99% 的用例!!!)
您希望看到什麼改進?
請解決問題!
當使用者更改子圖的順序或新增變數時,應在管道層上執行一些操作,以便在瓷器層上一切都按預期運行。
為什麼這個想法很重要?
1)當改變子圖的順序時,每個使用者都期望只有子圖改變它們的位置-沒有人會期望顏色設定改變。
2) 當使用者在 x 或 y 軸上新增變數時,結果應該是可預測的。無論您將新變數新增至現有變數的左側、右側、頂部或底部,結果都應該是相同的。
其他願望
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt << Graph Builder(
Size( 534, 496 ),
Graph Spacing( 4 ),
Variables( X( :height ), Y( :weight ), Color( :sex ) ),
Elements( Points( X, Y, Legend( 9 ) ) )
);
// change color/marker settings
scalebox = gb << get legend server();
scalebox << Legend Model(
9,
Properties( 0, {Line Color( 43 ), Marker( "Down Triangle" )}, Item ID( "F", 1 ) ),
Properties( 1, {Line Color( 0 ), Marker Size( 10 )}, Item ID( "M", 1 ) )
);
// add second Y variable
gb << add variable( {:height, Role( "Y" )} );
gb << add variable( {:sex, Role( "X" )} );
Wait( 0 );
New Window( "Modal Dialog example",
<<TYPE></TYPE>
在解決這個問題時,我現在更了解為什麼 Jmp 會這樣。
運行第一篇文章中的腳本後,圖形產生器報告的原始程式碼如下所示:
Graph Builder(
Variables( X( :height ), X( :sex ), Y( :weight ), Y( :height ), Color( :sex ) ),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 9 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 10 ) ) ),
Elements( Position( 2, 1 ), Points( X, Y, Legend( 11 ) ) ),
Elements( Position( 2, 2 ), Points( X, Y, Legend( 12 ) ) ),
SendToReport(
Dispatch( {}, "400", ScaleBox,
{Legend Model(
9,
Properties(
0,
{Line Color( 43 ), Marker( "Down Triangle" )},
Item ID( "F", 1 )
),
Properties(
1,
{Line Color( 0 ), Marker Size( 10 )},
Item ID( "M", 1 )
)
)}
)
)
);人們可以看到圖例#9 的第一個子圖有一些特殊的線條和標記設置,其他子圖(圖例#10-12)沒有。因此,設定 #9 會自動「廣播」到其他子圖,因為它們共用相同的顏色列,因此具有相同的圖例條目。
這是因為先套用設置,然後產生新的子圖。如果使用者僅使用圖例中的一組項目來變更設置,也會發生相同的情況:

然後,新設定立即套用於所有繪圖 - 並且在腳本中,變更僅出現在第一個圖例 # 中。
如果使用者啟動每個子圖的圖例條目,他可以單獨更改子圖。

現在讓我們切換到另一個圖表(下面的程式碼)並看看會發生什麼。在這裡,每個子圖都有自己的格式(沒有共同的顏色列),當我採用其中一個子圖組(Y 軸上的一列)並將其拖曳到另一個位置時,其他子圖保留其設置,只是移動的子圖忘記了他們的設置。
這是可接受的行為(**) - 因為該列也可以拖曳到完全不同的位置(影片後面:拖曳到 x 軸)。那麼沒有人會想到格式可以被複製。
影片結束時,柱子被放回原來的位置 - 並且情節看起來與之前不同。這在某種程度上是可以的 - 應該是,因為我們已經接受了這樣的行為(**):)
只是有點令人驚訝。
注意:要恢復舊圖,可以按 CTRL + Z,或在拖曳列時按 ESC。
dt = new table();
dt << add rows(1);
c1= dt << new column ("col1",Nominal,set each value (1));
c2= dt << new column ("col2",Nominal,set each value (2));
c3= dt << new column ("col3",Nominal,set each value (3));
c4= dt << new column ("col4",Nominal,set each value (4));
c5= dt << new column ("col5",Nominal,set each value (5));
c6= dt << new column ("col6",Nominal,set each value (6));
Graph Builder(
Size( 330, 347 ),
Show Control Panel( 0 ),
Graph Spacing( 10 ),
Variables(
X( :col1 ),
X( :col2 ),
X( :col3 ),
Y( :col6 ),
Y( :col5 ),
Y( :col4 )
),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 7 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 1 ) ) ),
Elements( Position( 1, 3 ), Points( X, Y, Legend( 2 ) ) ),
Elements( Position( 2, 1 ), Points( X, Y, Legend( 8 ) ) ),
Elements( Position( 2, 2 ), Points( X, Y, Legend( 3 ) ) ),
Elements( Position( 2, 3 ), Points( X, Y, Legend( 4 ) ) ),
Elements( Position( 3, 1 ), Points( X, Y, Legend( 9 ) ) ),
Elements( Position( 3, 2 ), Points( X, Y, Legend( 5 ) ) ),
Elements( Position( 3, 3 ), Points( X, Y, Legend( 6 ) ) ),
SendToReport(
Dispatch( {}, "400", ScaleBox,
{Legend Model(
7,
Properties(
0,
{Line Color( 3 ), Marker( "Backslash" ),
Marker Size( 30 )},
Item ID( "col6", 1 )
)
), Legend Model(
1,
Properties(
0,
{Line Color( 38 ), Marker( "Filled Left Triangle" ),
Marker Size( 30 )},
Item ID( "col5", 1 )
)
), Legend Model(
2,
Properties(
0,
{Line Color( 36 ), Marker( "Slash" ), Marker Size( 30 )},
Item ID( "col4", 1 )
)
), Legend Model(
8,
Properties(
0,
{Line Color( 3 ), Marker( "Filled Up Triangle" ),
Marker Size( 30 )},
Item ID( "col6", 1 )
)
), Legend Model(
3,
Properties(
0,
{Line Color( 38 ), Marker( "FilledCircle" ),
Marker Size( 30 )},
Item ID( "col5", 1 )
)
), Legend Model(
4,
Properties(
0,
{Line Color( 36 ), Marker( "Filled Down Triangle" ),
Marker Size( 30 )},
Item ID( "col4", 1 )
)
), Legend Model(
9,
Properties(
0,
{Line Color( 3 ), Marker( "Slash" ), Marker Size( 30 )},
Item ID( "col6", 1 )
)
), Legend Model(
5,
Properties(
0,
{Line Color( 38 ), Marker( "Filled Right Triangle" ),
Marker Size( 30 )},
Item ID( "col5", 1 )
)
), Legend Model(
6,
Properties(
0,
{Line Color( 36 ), Marker( "Backslash" ),
Marker Size( 30 )},
Item ID( "col4", 1 )
)
)}
),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "" )} ),
Dispatch( {}, "X title", TextEditBox, {Set Text( "1" )} ),
Dispatch( {}, "Y title", TextEditBox,
{Set Text( "6" ), Rotate Text( "Horizontal" )}
),
Dispatch( {}, "Y 1 title", TextEditBox,
{Set Text( "5" ), Rotate Text( "Horizontal" )}
),
Dispatch( {}, "Y 2 title", TextEditBox,
{Set Text( "4" ), Rotate Text( "Horizontal" )}
),
Dispatch( {}, "X 1 title", TextEditBox, {Set Text( "2" )} ),
Dispatch( {}, "X 2 title", TextEditBox, {Set Text( "3" )} )
)
)