デンドログラムに現在表示されている行を取得するこんにちは、
ズーム操作の後、デンドログラムに現在どの個体が表示されているかを知る方法があるかどうかを知りたいです。
次に例を示します。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Birth Death Subset.jmp" );
Hierarchical Cluster(
Y( :birth, :death ),
Label( :country ),
Method( "Ward" ),
Standardize Data( 1 ),
Dendrogram Scale( "Distance Scale" ),
Number of Clusters( 4 ),
SendToReport(
Dispatch( {}, "Dendrogram", OutlineBox, {SetHorizontal( 1 )} ),
Dispatch(
{"Dendrogram"},
"2",
ScaleBox,
{Min( 18 ), Max( 31 ), Inc( 5 ), Minor Ticks( 0 )}
)
)
);選択された 13 か国のリストを取得したいと思います。
良い解決策は、最小値と最大値 (18 と 31) を取得することだと思いますが、これまでのところ、それらを抽出する方法が見つかりません...
よろしくお願いします。
Re: デンドログラムで現在表示されている行を取得するやあ@txnelson 、
私はこの機能を使ったことはありませんが、本当に JMP の可能性を広げてくれます。
私の状況では、実際に行を選択する必要はありませんが、minOrder と maxOrder の値を取得するだけです。 そのため、言及されているように干渉の問題はないと思います@ジュリアン. 私はそれをテストする必要があります:)
ご協力いただきありがとうございました。
Re: デンドログラムで現在表示されている行を取得するああ、そこに行きます。 それを考えるべきだった!
//編集: グラフィック スクリプトを追加すると、選択したクラスターをダブルクリックしてズームするのが妨げられるようです。 確かに機能させる方法はいくつかありますが、現時点では、特にデンドログラムで個人を選択できるようにしたいが、選択を現在のズームに再確立したい場合は、ボタンはかなり簡単に思えます.
Re: デンドログラムで現在表示されている行を取得するグラフィックスクリプトを添付できます
obj << グラフィックを追加 script()
デンドグラフ フレームボックスに。グラフに何かが行われるたびにトリガーされます。追加されたスクリプトで、minOrder または MaxOrder が変更されたかどうかを確認できます。
Re: デンドログラムで現在表示されている行を取得するやあ@anne_sa 、
それは素晴らしいアイデアですが、それを実現する簡単な方法が見つかりませんでした。 選択を呼び出すためのウィンドウの下部にあるボタンはどうですか?
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Birth Death Subset.jmp" );
hcPlatform = Hierarchical Cluster(
Y( :birth, :death ),
Label( :country ),
Method( "Ward" ),
Standardize Data( 1 ),
Dendrogram Scale( "Distance Scale" ),
Number of Clusters( 4 ),
SendToReport(
Dispatch( {}, "Dendrogram", OutlineBox, {SetHorizontal( 1 )} ),
Dispatch( {"Dendrogram"}, "2", ScaleBox, {Min( 18 ), Max( 31 ), Inc( 5 ), Minor Ticks( 0 )} )
)
);
//save the order displayed in the platform
displayOrd = hcPlatform << Save Display Order;
selectZoom = expr(
//get the script, which contains the Min() and Max() information
exprPlat = hcPlatform << Get Script;
//Extract the Min and Max. This is indexed in the reverse of the Display Order
//that is, the max value is the first in the order (as if it is an axis), so subtracting
//this value from the number of rows in the table brings things into alignment
minOrder = 1 + N Rows( dt ) - Arg( Extract Expr( exprPlat, Max( Wild() ) ) );
maxOrder = N Rows( dt ) - Arg( Extract Expr( exprPlat, Min( Wild() ) ) );
//select the rows in the table that meet the condition of being in the randge displayed
dt << Select Where( And( As Column( displayOrd ) >= minOrder, As Column( displayOrd ) <= maxOrder ) );
//get the matrix of row numbers for the selected rows, i.e., rows displayed in zoom
matchingRows = dt << get selected rows;
);
//add the button to the report
report(hcPlatform)<<APPEND></APPEND>
@ジュリアン
Re: デンドログラムで現在表示されている行を取得するやあ@ジュリアン、
この迅速な回答に感謝します。まさに私が探していたものです!!!
ちょっとした追加の質問があります。デンドログラムでズーム操作が行われたことを検出する方法はありますか? <Re: デンドログラムで現在表示されている行を取得する非常にうまくできました。
Re: デンドログラムで現在表示されている行を取得する
やあ@anne_sa 、
これらの行を直接取得する方法はわかりませんが、最小値と最大値の情報はプラットフォームのスクリプトの一部であり、樹状図の行の表示順序を保存できるため、この方法でスクリプトを作成できます。少しの作業で結果に。 それは完全にエレガントではありませんが、ここに私が思いついた1つの方法があります:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Birth Death Subset.jmp" );
hcPlatform = Hierarchical Cluster(
Y( :birth, :death ),
Label( :country ),
Method( "Ward" ),
Standardize Data( 1 ),
Dendrogram Scale( "Distance Scale" ),
Number of Clusters( 4 ),
SendToReport(
Dispatch( {}, "Dendrogram", OutlineBox, {SetHorizontal( 1 )} ),
Dispatch( {"Dendrogram"}, "2", ScaleBox, {Min( 18 ), Max( 31 ), Inc( 5 ), Minor Ticks( 0 )} )
)
);
//save the order displayed in the platform
displayOrd = hcPlatform << Save Display Order;
//get the script, which contains the Min() and Max() information
exprPlat = hcPlatform << Get Script;
//Extract the Min and Max. This is indexed in the reverse of the Display Order
//that is, the max value is the first in the order (as if it is an axis), so subtracting
//this value from the number of rows in the table brings things into alignment
minOrder = 1 + N Rows( dt ) - Arg( Extract Expr( exprPlat, Max( Wild() ) ) );
maxOrder = N Rows( dt ) - Arg( Extract Expr( exprPlat, Min( Wild() ) ) );
//select the rows in the table that meet the condition of being in the randge displayed
dt << Select Where( And( As Column( displayOrd ) >= minOrder, As Column( displayOrd ) <= maxOrder ) );
//get the matrix of row numbers for the selected rows, i.e., rows displayed in zoom
matchingRows = dt << get selected rows;
これが役立つことを願っています!
@ジュリアン