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;
)
)
);
このエラーが発生しないようにするためにできることはありますか?私は最初のWait機能を含めました - それは凡例の選択が選択されていないマーカーを変更することに問題があるようです(選択されていないマーカーは消えています)。 待機時間を長くすると、エラーの頻度が少なくなるように思われますが、状況が完全に緩和されるわけではありません。
ありがとうございます。
再: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);
- プラットフォームのオプションが利用できない場合は、 box << Visibility( "Collapse") 削除する代わりにメッセージ これは、 IfBox() レイアウトや描画のためにレポートの一部をスキップすること。
クラッシュを回避することに加えて、これらのアプローチの1つの利点はそれらがスクリプトで記憶されるということです。 プラットフォームの1つを対話的に変更して[スクリプトをスクリプトウィンドウに保存]を使用すると、カスタマイズ内容がスクリプトに含まれます。 これは、フィルタを追加したい場合にも重要です。これにより、プラットフォームがスクリプトから再生成されます。
再:JMP Pro 12.2のアクセス違反エラー(スクリプトが含まれる)私はアクセス違反を再現することができて、スクリプトとブログ参照と共にJMPに報告を送りました。
私はMを選択してからFを選択してダンプしました。
私はDavidに賛成です。
私はいくつかの奇妙な構文を見つけ、いくつかのスクリプトの変更を加え、そしていくつかのコメントがあります。
私はあなたが書いたスクリプトと以前に投稿した簡単なスクリプトの修正を添付しました。凡例とサマリーテーブル、およびrowstateハンドラを使用します。それはあなたのスクリプトがしたように選択されていないスプラインを「消す」ことではありません。
保証できません、アクセス違反は発生しません。それでも発生する場合は返信してください。
再:JMP Pro 12.2のアクセス違反エラー(スクリプトが含まれる)それが価値があるもののために、私は(待機の有無にかかわらず)アクセス違反を再現することができませんでした。 私は12.2を含むさまざまなバージョンで試しました。
この問題が発生した場合は、コードをリファクタリングする必要があります。 特に、私の見解では、New Window関数はディスプレイボックスをレンダリングするために使用されるべきであり、JMPはJSLの挿入を許容するかもしれませんが、それは醜く、必要ではなく潜在的に問題があります。 そのため、たとえば、bivレポートに送信されたすべてのメッセージは、New Window定義の後に行います。