☐ 很酷的新功能 - 没有,但是:
☑ 可以帮助很多用户!!!!
☑ 删除一些感觉像“错误”的东西
☐ 很高兴有
☐ 没人需要它
是什么启发了这个愿望清单请求?
当用户通过将 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" )} )
)
)