您好,在我的腳本中,我想檢測用戶與gen reg中的解決方案路徑交互的時刻(通過拖動解決方案路徑圖中的垂直線),以便根據所選模型生成一些自定義圖表。 有什麼建議嗎?在此先感謝Matteo
我找到了一個使用mousetrap()的可能解決方案,唉有一些缺點
1)在第一個用戶點擊解決方案路徑框架內,將出現一個刷新按鈕。之後,解決方案路徑的交互性照常恢復。
2)當用戶點擊刷新按鈕時,恢復初始狀態。
然後,我將在刷新按鈕腳本中放置模型詳解函數。
我正在尋找一個更好的解決方案,對用戶來說不那麼可見/不需要干預,如果有人能提出改進下面代碼的建議,我會很高興。
謝謝
馬特奧
m = Fit Model(
Y( :Y ),
Effects( :X1, :X2, :X3 ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( AICc ) ) )
);
f1 = (m << report)[Outline Box( "Solution Path" )][frame box( 1 )];
f2 = (m << report)[Outline Box( "Solution Path" )][frame box( 2 )];
setSolutionPathTraps = Function( {fb1, fb2, bb},
Eval(
Eval Expr(
fb1 << add graphics script(
Mousetrap(
bb << visibility( "visible" ),
Expr( fb2 ) << remove graphics script( 1 );
Expr( fb1 ) << remove graphics script( 1 );
)
);
fb2 << add graphics script(
Mousetrap(
bb << visibility( "visible" ),
Expr( fb1 ) << remove graphics script( 1 );
Expr( fb2 ) << remove graphics script( 1 );
)
);
)
);
bb << visibility( "collapse" );
);
New Window( "a", bb = Button Box( "Refresh", setSolutionPathTraps( f1, f2, bb ) ) );
setSolutionPathTraps( f1, f2, bb );