JMP Pro 12.2访问冲突错误(包括脚本)我正在尝试构建一个自定义报告,用于查看各种数据,比较各种工具的缺陷密度。 我有时可以显示许多(超过20个)工具,导致样条曲线混淆。 当通过图例选择工具时,我找到了一种强调样条曲线的方法,但该功能会导致JMP上的间歇性崩溃。
这是一个可以重现错误的脚本,但它是间歇性的 - 只需选择图例的各种元素,并使用取消选择所有元素
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Consumer Preferences.jmp" );
dt << Color or Mark by Column( "Gender" );
change_lines = Function( {table, ns},
{default local},
Wait( 0.1 );
If( ns:nit > 1,
If( Is Scriptable( ns:dla ),
sd = ns:dla << Summary( Group( Column( ns:dla, ns:tool ) ), "Private" );
Current Data Table( sd );
sm = 0;
For( k = 1, k <= ns:nit, k++,
sm += Selected( Row State( k ) )
);
For( i = 1, i <= ns:nit, i++,
c = Color To HLS( Color Of( Row State( i ) ) );
s = Selected( Row State( i ) );
If( Is Scriptable( c ) & N Items( c ) == 3,
If( sm != 0,
If( s == 1,
ns:biv << (Curve[i] << Line Color( HLS Color( c[1], 0.5 - 0.5 * c[2], c[3] ) ) << Line Width( 4 )),
ns:biv << (Curve[i] << Line Color( HLS Color( c[1], 0.5 + 0.5 * c[2], c[3] ) ) << Line Width( 1 ))
),
ns:biv << (Curve[i] << Line Color( HLS Color( c[1], c[2], c[3] ) ) << Line Width( 3 ))
)
);
);
Close( sd, nosave );
)
);
);
New Window( "Explore the SegFault",
Outline Box( "Bivariate and Oneway",
H List Box(
biv = Bivariate(
Y( :Name( "Salary" ) ),
X( :Name( "Birth Year" ) ),
SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 400, 300 ), Marker Size( 3 )} ) )
);
biv << Group By( "Gender" );
biv << Fit Spline( 1, standardized );
bivr = biv << Report();
bivr[Outline Box( 1 )] << Set Title( "Salary vs. Birth Year" );
bivr[Picture Box( 2 )] << Delete;
N = N Items( Associative Array( Column( dt, "Gender" ) ) << Get Keys );
For( i = 1, i <= N, i++,
biv << (Curve[i] << Report( 0 ))
);
biv;,
ow = Oneway(
Y( :Name( "Salary" ) ),
X( :Name( "Gender" ) ),
All Graphs( 0 ),
Means and Std Dev( 1 ),
Plot Quantile by Actual( 1 ),
Line of Fit( 0 ),
Box Plots( 1 ),
Mean Error Bars( 1 ),
Std Dev Lines( 1 ),
Connect Means( 1 ),
X Axis Proportional( 0 ),
Points Jittered( 1 ),
Points Spread( 1 ),
SendToReport(
Dispatch(
{"Normal Quantile Plot"},
"Oneway QuantilePlot",
FrameBox,
{Frame Size( 350, 300 ), Marker Size( 3 ), Row Legend(
Column( dt, "Gender" ),
Marker( 1 ),
Marker Theme( "Paired" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
);
owr = ow << Report();
owr[Table Box( 1 )] << Set Selectable Rows();
owr[Outline Box( 1 )] << Set Title( "Proability Plot" );
legend = owr[String Col Box( 2 )];
legend << Sib Append( Number Col Box( "Mean", owr[Number Col Box( 2 )] << Get ) );
legend << Sib Append( Number Col Box( "Number", owr[Number Col Box( 1 )] << Get ) );
owr[Lineup Box( 1 )] << delete;
owr[Picture Box( 3 )] << delete;
owr[Outline Box( 2 )] << delete;
owr[Outline Box( 2 )] << Set Title( "" );
ns = New Namespace();
ns:nit = N;
ns:dla = dt;
ns:tool = "Gender";
ns:biv = biv;
owr[Number Col Box( 2 )] << Set Row Change Function( Function( {this}, change_lines( this, ns ) ) );
ow;
)
)
);
我有什么办法可以不发生这种错误吗?我包含了初始等待功能 - 它似乎是图例选择更改未选择标记的问题(我有未选择的标记被褪色),也许我的功能也试图在备用更新期间更改显示。 增加等待时间似乎使错误不那么频繁,但并不能完全缓解这种情况。
谢谢!
回复:JMP Pro 12.2访问冲突错误(包括脚本)JMP技术支持已经为此问题打开了一个缺陷,并期望在未来的JMP版本中解决它。
回复:JMP Pro 12.2访问冲突错误(包括脚本)谢谢你的帮助!我能够接受你的建议,不删除元素,使脚本工作没有错误。 我不喜欢删除元素,但我不知道隐藏它们的方便方法。
这是我修改的原始脚本,以便它完全正常工作。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Consumer Preferences.jmp" );
dt << Color or Mark by Column( "Gender" );
change_lines = Function( {table, ns},
{default local},
flag = 0;
lst = As List( table << Get Selected Rows() );
For( i = 1, i <= ns:nit, i++,
c = Color To HLS( Color Of( Column( ns:rs, "rsd" )[i] ) );
If( N Items( As List( Loc( lst, i ) ) ) == 0,
ns:biv << (Curve[i] << Line Color( HLS Color( c[1], 0.5 + 0.5 * c[2], c[3] ) ) << Line Width( 1 )),
ns:biv << (Curve[i] << Line Color( HLS Color( c[1], 0.5 - 0.5 * c[2], c[3] ) ) << Line Width( 4 ));
flag = 1;
);
);
If( flag == 0,
For( i = 1, i <= ns:nit, i++,
c = Color To HLS( Color Of( Column( ns:rs, "rsd" )[i] ) );
ns:biv << (Curve[i] << Line Color( HLS Color( c[1], c[2], c[3] ) ) << Line Width( 3 ));
)
);
);
New Window( "Explore the SegFault",
Outline Box( "Bivariate and Oneway",
H List Box(
ns = New Namespace();
ns:biv = Bivariate(
Y( :Name( "Salary" ) ),
X( :Name( "Birth Year" ) ),
SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 400, 300 ), Marker Size( 3 )} ) )
);,
ns:ow = Oneway(
Y( :Name( "Salary" ) ),
X( :Name( "Gender" ) ),
All Graphs( 0 ),
Means and Std Dev( 1 ),
Plot Quantile by Actual( 1 ),
Line of Fit( 0 ),
Box Plots( 1 ),
Mean Error Bars( 1 ),
Std Dev Lines( 1 ),
Connect Means( 1 ),
X Axis Proportional( 0 ),
Points Jittered( 1 ),
Points Spread( 1 ),
SendToReport(
Dispatch(
{"Normal Quantile Plot"},
"Oneway QuantilePlot",
FrameBox,
{Frame Size( 350, 300 ), Marker Size( 3 ), Row Legend(
Column( dt, "Gender" ),
Marker( 1 ),
Marker Theme( "Paired" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
);
ns:owr = ns:ow << Report();
ns:owr[Table Box( 1 )] << Set Selectable Rows();
ns:owr[Outline Box( 1 )] << Set Title( "Proability Plot" );
legend = ns:owr[String Col Box( 2 )];
legend << Sib Append( Number Col Box( "Mean", ns:owr[Number Col Box( 2 )] << Get ) );
legend << Sib Append( Number Col Box( "Number", ns:owr[Number Col Box( 1 )] << Get ) );
ns:owr[Lineup Box( 1 )] << delete;
ns:owr[Picture Box( 3 )] << delete;
ns:owr[Outline Box( 2 )] << delete;
ns:owr[Outline Box( 2 )] << Set Title( "" );
ns:dla = dt;
ns:tool = "Gender";
ns:biv = ns:biv;
ns:rs = ns:dla << Summary( Group( Column( ns:dla, ns:tool ) ), "Private" );
ns:rs << New Column( "rsd", Row State, Set Formula( Color State( Color Of( Row State() ) ) ) );
ns:nit = N Items( legend << Get );
ns:biv << group by( Column( ns:dla, ns:tool ) );
ns:biv << fit spline( 1, standardized );
ns:bivr = ns:biv << Report();
ns:bivr[Outline Box( 1 )] << Set Title( "Trend Chart" );
ns:bivr[Picture Box( 2 )] << Visibility( "Collapse" );
isdone = 0;
For( i = 1, i <= ns:nit, i++,
ns:biv << (Curve[i] << Report( 0 ));
ns:bivr[List Box( 4 + i )] << Visibility( "Collapse" );
);
ns:owr[Number Col Box( 2 )] << Set Row Change Function( Function( {this}, change_lines( this, ns ) ) );
)
)
);回复:JMP Pro 12.2访问冲突错误(包括脚本)我将补充说,从平台报告中删除内容通常会导致问题。 我会建议:
- 如果存在,请使用平台选项 - 这是格鲁吉亚所做的
ow << Means and Std Dev(0);
- 当平台选项不可用时,您可以使用箱<<可视性(“折叠”) 消息而不是删除。这表现类似于 IfBox() 跳过部分报告以进行布局和绘图。
除了避免崩溃之外,这些方法的一个优点是它们将在脚本中被记住。 如果以交互方式修改其中一个平台并使用“将脚本保存到脚本”窗口,则自定义项将包含在脚本中。 如果要添加过滤器,这也可能很重要,这也会导致平台从脚本中重新生成。
回复:JMP Pro 12.2访问冲突错误(包括脚本)我能够重现访问冲突并使用脚本和博客参考将报告发送到JMP。
我选择了M然后我选择了F并且我被倾倒了。
我同意大卫的观点。
我发现了一些奇怪的语法,做了一些脚本更改并有几条评论:
我附上了您之前发布的脚本和更简单脚本的修改。它使用图例和摘要表以及rowstate处理程序。它不会像脚本那样“淡化”未选择的样条线。
我无法保证,不会发生访问冲突。如果仍然发生,请回复。
回复:JMP Pro 12.2访问冲突错误(包括脚本)对于它的价值,我无法重现访问冲突(有或没有等待)。 我试过各种版本,包括12.2。
如果我遇到这个问题,我会寻求重构代码。 特别是,我的观点是应该使用New Window函数来呈现显示框,而JMP可能会容忍JSL的插入,这是丑陋的,不是必需的,也可能是问题。 例如,发送到biv报告的所有消息都将在新窗口定义之后执行。