Wenn Sie den Graph Builder verwenden, können Sie eine bestimmte Datenteilmenge in der Legende „hervorheben“ oder „auswählen“. Die entsprechende Ausgabe im Diagrammersteller und in der Datentabelle wird ebenfalls hervorgehoben. Wenn eine Teilmenge der Daten ausgewählt wird, treten die anderen Teilmengen in den Hintergrund oder erhöhen ihre Transparenz auf interaktive Weise.
Kann ich Referenzlinien hinzufügen, die einem ausgewählten Datensatz entsprechen und sich interaktiv auf die gleiche Weise verhalten? Und kann ich diese Linien automatisch einfärben lassen, so wie sie es tun, wenn ich eine nominale Spalte in das Legendenfeld einfüge?
Indizieren der Liste über
["addrefline"]
- Guter Trick 
Warum funktioniert es?
Es findet das erste Symbol (unabhängig von Groß-/Kleinschreibung und Leerzeichen) – und gibt das erste Argument zurück?
Hier sind einige Starter-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" )} ) )
);
Die JSL installiert eine RowState-Handlerfunktion in der Datentabelle; Diese Funktion wird benachrichtigt, wenn sich die Zeilenstatusdaten der Tabelle ändern (wenn eine Zeile ausgewählt/ausgeblendet/ausgeschlossen wird oder sich der Markierungsstil oder die Farbe ändert). Die Funktion berechnet die Mindest- und Höchstwerte der ausgewählten Spalten, entfernt alte Referenzzeilen und fügt hinzu neue Ref-Linien.
The a-b-c-d ref lines are interactively tracking the rectangular point selectionThe a-b-c-d ref lines are interactively tracking the rectangular point selectionThe a-b-c-d ref lines are interactively tracking the rectangular point selectionThe a-b-c-d ref lines are interactively tracking the rectangular point selectionThe a-b-c-d ref lines are interactively tracking the rectangular point selectionThe a-b-c-d ref lines are interactively tracking the rectangular point selectionThe a-b-c-d ref lines are interactively tracking the rectangular point selectionThe a-b-c-d ref lines are interactively tracking the rectangular point selectionThe a-b-c-d ref lines are interactively tracking the rectangular point selectionThe a-b-c-d ref lines are interactively tracking the rectangular point selectionDie abcd-Referenzlinien verfolgen interaktiv die rechteckige Punktauswahl
Es blinkt während der Aktualisierung, da die Anzeige neu gezeichnet wird, wenn jede Refline hinzugefügt oder entfernt wird. Bei großen Datenmengen kann es zu langsam werden, da das Neuzeichnen des Diagramms zu lange dauert.
Ja. Nicht gut dokumentiert, aber sehr nützlich mit dem modalen Dialog < Modale Dialoge 2/5 von oben nach unten.
axisbox<
Tut mir leid, dass JSL bessere Kommentare verdient hätte!