안녕하세요, 저는 특정 변수의 값에 따라 그래프 빌더에서 얻은 그래프가 변경되는 JSL에서 코드를 작성하려고 잠시 노력했습니다.
지금 내 특정 예는 매우 간단합니다. 확인란이 있으며 사용자 선택 (선택 / 선택 취소)에 따라 로컬 필터를 사용하여 그래프에 그룹을 추가하거나 제거하고 싶습니다. 다음은 매우 간단한 예입니다.
dt = Open( "$SAMPLE_DATA/Analgesics.jmp" );
// Open Analgesics
cb = 1; // Predefined value<BR /><BR />// Check box to Remove group A from the graph
usw = New Window("Ignore A?", << Modal,
//Check Box defaulted to checked ignore
checkIgnore = check box({"Ignore A?"},
<< Set(1,1),
cb = checkIgnore << Get())
);
// Answer to Cancel or close buttons
If( usw["button"] == -1, throw("User cancelled") );
show(cb); // I can see how the value of cb changes between 0 and 1
nw = New Window( "Example Report",
// Box plot with dots
dot_box_plot = dt << Graph Builder(
Show Control Panel( 0 ),
Show Legend( 0 ),
Show Title( 0 ),
Variables( X(:drug ), Y( :pain ), Color(:drug ) ),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 2 ) ), Box Plot( X, Y, Legend( 3 ) ) ),
Elements( Position( 2, 1 ), Points( X, Y, Legend( 2 ) ), Box Plot( X, Y, Legend( 3 ) ) ),
SendToReport( Dispatch( {}, "X title", TextEditBox, {Set Text( "" )} ) ),
/* This is the part that I'd like to make interactive
to keep or remove A-group from the plot depending on
user selection */
if(cb == 1,
Local Data Filter(
Close Outline( 1 ),
Add Filter( columns( :drug ),
Where( :Drug != "A" )
)
)
)
)
);보시다시피 if 문에는 변경 사항이 없으므로 플롯이 모든 그룹을 유지하기 때문에 내 부분에 문제가 있어야합니다. 물론 IF () 부분 만 제거하면 플롯이 그룹 A를 무시합니다.
어떤 제안이라도 대단히 감사하겠습니다.
플랫폼 코드 수정을 처리하는 데 선호되는 방법은 플랫폼의 초기 처리 후 플랫폼에 메시지를 전달하는 것입니다.플랫폼 문을 수정하려는 시도는 너무 지저분 해지고 너무 불규칙 해집니다.
아래는 Graph Builder 플랫폼이 실행 된 후 필터를 추가하기 위해 수정 된 스크립트입니다.그런 다음 로컬 데이터 필터의 실제 표시를 숨기려면

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Analgesics.jmp" );
// Open Analgesics
cb = 1; // Predefined value// Check box to Remove group A from the graph
usw = New Window( "Ignore A?",
<<MODAL></MODAL>