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報告的所有消息都將在新窗口定義之後執行。