グラフ ビルダーを使用すると、凡例内の特定のデータ サブセットを「強調表示」または「選択」できます。 グラフ ビルダーとデータ テーブル上の対応する出力も強調表示されます。 データのサブセットが選択されると、他のサブセットは背景にフェードインするか、インタラクティブな方法で透明度を高めます。
選択したデータセットに対応する参照線を同様に対話的に追加することはできますか? また、公称列を凡例フィールドにドロップしたときと同じように、これらの線に自動的に色を付けることはできますか?
リストのインデックス作成
["addrefline"]
- 素敵なトリック 
なぜ効果があるのでしょうか?
最初のシンボル (大文字/小文字、スペースに関係なく) が検索され、最初の引数? が返されます。
これがスターター JSL です。
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
oldselection = [];// don't update when nothing changes by comparing old to new
f = Function( {a}, // this callback tells which points are changing selected state
// and may send between 1 and N row numbers in the matrix a.
// this example will ignore a and just ask the table about the range of the currently
// selected points.
{subset, hmin, hmax, wmin, wmax, newselection}, // local variables
newselection = dt << getselectedrows; // compare to previous selection...
If( Try( N Rows( newselection ) != N Rows( oldselection ) | Any( newselection != oldselection ), 1 ),
oldselection = newselection; // remember the new selection for next time
dtSubset = dt << subset( SelctedRows( 1 ), LinkToOriginalDataTable( 1 ), invisible ); // make a subset of the selection to summarize
dtSummary = dtSubset << Summary( Min( :height ), Min( :weight ), Max( :height ), Max( :weight ), Freq( "None" ), Weight( "None" ) );
Close( dtSubset, "nosave" ); // done with the subset, use the summary...
hmin = dtSummary:name( "Min(Height)" )[1]; // capture the range of the selected axis
hmax = dtSummary:name( "Max(Height)" )[1];
wmin = dtSummary:name( "Min(Weight)" )[1];
wmax = dtSummary:name( "Max(Weight)" )[1];
Close( dtSummary, "nosave" ); // done with the summary, use the captured values...
// remove 2 old reflines first, from each axis, then add 2 new ones
// remove the old ref lines from the weight axis (1==horizontal)
Report( gb )[axisbox( 1 )] << removerefline( (Report( gb )[axisbox( 1 )] << getscript)["addrefline"] );
Report( gb )[axisbox( 1 )] << removerefline( (Report( gb )[axisbox( 1 )] << getscript)["addrefline"] );
// remove the old ref lines from the height axis (2==vertical)
Report( gb )[axisbox( 2 )] << removerefline( (Report( gb )[axisbox( 2 )] << getscript)["addrefline"] );
Report( gb )[axisbox( 2 )] << removerefline( (Report( gb )[axisbox( 2 )] << getscript)["addrefline"] );
// add the new ref lines...extend the bounding box by .5 for the integer height/weight (not required)
Report( gb )[axisbox( 1 )] << addrefline( wmin - .5, "solid", "red", "a", 2 );
Report( gb )[axisbox( 1 )] << addrefline( wmax + .5, "solid", "green", "b", 2 );
Report( gb )[axisbox( 2 )] << addrefline( hmin - .5, "solid", "blue", "c", 1 );
Report( gb )[axisbox( 2 )] << addrefline( hmax + .5, "solid", "black", "d", 1 );
);
);
rs = dt << make row state handler( f );
gb = Graph Builder(
Size( 416, 300 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ) ),
SendToReport( Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "" )} ), Dispatch( {}, "graph title", TextEditBox, {Set Text( "Demo" )} ) )
);
JSL はデータテーブルに RowState ハンドラー関数をインストールします。この関数は、テーブルの行状態データが変更されたとき (行が選択/非表示/除外されたとき、またはマーカーのスタイルや色が変更されたとき) に通知されます。この関数は、選択された列の最小値と最大値を計算し、古い参照行を削除し、追加します。新しい参照ライン。
The a-b-c-d ref lines are interactively tracking the rectangular point selectionabcd ref ラインは、長方形の点の選択を対話的に追跡します。
各参照線が追加または削除されると表示が再描画されるため、更新すると点滅します。データが大きいと速度が低下し、グラフの再描画に時間がかかりすぎる可能性があります。