그래프 빌더를 사용하면 범례 내의 특정 데이터 하위 집합을 "강조 표시"하거나 "선택"할 수 있습니다. 그래프 빌더와 데이터 테이블의 해당 출력도 강조 표시됩니다. 데이터의 하위 집합을 선택하면 다른 하위 집합은 대화형 방식으로 배경으로 사라지거나 투명도가 높아집니다.
선택한 데이터 세트에 해당하는 참조선을 추가하여 동일한 방식으로 대화형으로 작동하도록 할 수 있습니까? 그리고 명목상 열을 범례 필드에 놓을 때와 마찬가지로 이러한 선에 자동으로 색상이 지정되도록 할 수 있습니까?
다음을 통해 목록 인덱싱
["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 참조선은 직사각형 점 선택을 대화식으로 추적합니다.
각 기준선이 추가되거나 제거될 때 디스플레이가 다시 그려지기 때문에 업데이트될 때 깜박입니다. 그래프를 다시 그리는 데 너무 오랜 시간이 걸리는 대용량 데이터의 경우 너무 느려질 수 있습니다.