Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions HelpSource/Classes/ScatterView.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,9 @@ PRIVATE:: initPlot
EXAMPLES::

code::
// you may want to use Swing or Cocoa
SwingOSC.default.boot
GUI.swing


(
var data = 1000.collect{ [1.0.rand, exprand(0.01, 1)]};
w = GUI.window.new(bounds: Rect(40, 40, 800, 800)).front;
w = Window(bounds: Rect(40, 40, 800, 800)).front;
a = ScatterView(w, Rect(10, 10, 760, 760), data, [0,1].asSpec, [0,1].asSpec);
a.drawAxis_(true).drawMethod_(\fillOval)
.symbolColor_(Color.blue(0.5, 0.5)).symbolSize_(5)
Expand All @@ -108,10 +103,10 @@ a.drawAxis_(true).drawMethod_(\fillOval)

(
var numItems = 630;
w = GUI.window.new(bounds: Rect(40, 40, 800, 150)).front;
w = Window(bounds: Rect(40, 40, 800, 150)).front;
a = ScatterView(w, Rect(10, 10, 760, 100), {|i| [sin(i/50), sin(0.05*i)]}!numItems, [-1,1].asSpec, [-1,1].asSpec);
a.isHighlight = true;
GUI.slider.new(w, Rect(10, 120, 760, 20)).action_{|me|
Slider.new(w, Rect(10, 120, 760, 20)).action_{|me|
a.highlightItemRel = me.value;
a.refresh;
// a.highlightItem = (me.value*numItems).asInteger.min(numItems-1);
Expand Down Expand Up @@ -176,12 +171,12 @@ w.refresh
// use two views stacked
(
var numItems = 630;
w = SCWindow.new(bounds: Rect(40, 40, 800, 150)).front;
w = Window(bounds: Rect(40, 40, 800, 150)).front;
a = ScatterView(w, Rect(10, 10, 760, 100), {|i| [sin(i/50), sin(0.05*i)]}!numItems, [-1,1].asSpec, [-1,1].asSpec);
b = ScatterView(w, Rect(10, 10, 760, 100), {|i| [sin(i/21), sin(0.05*i)]}!numItems, [-1,1].asSpec, [-1,1].asSpec);
a.background = Color.gray(0, 0);
a.isHighlight = true;
SCSlider(w, Rect(10, 120, 760, 10)).action_{|me|
Slider(w, Rect(10, 120, 760, 10)).action_{|me|
a.highlightItemRel = me.value;
w.refresh;
//a.highlightItem = (me.value*numItems).asInteger.min(numItems-1);
Expand All @@ -197,10 +192,10 @@ w.refresh;

(
var numItems = 630;
w = SCWindow.new(bounds: Rect(40, 40, 800, 150)).front;
w = Window(bounds: Rect(40, 40, 800, 150)).front;
a = ScatterView(w, Rect(10, 10, 760, 100), {|i| [sin(i/50), sin(0.05*i)]}!numItems, [-1,1].asSpec, [-1,1].asSpec);
a.isHighlight = true;
SCRangeSlider(w, Rect(10, 120, 760, 10)).action_{|me|
RangeSlider(w, Rect(10, 120, 760, 10)).action_{|me|
a.highlightRangeRel(me.lo, me.hi);
w.refresh;
// a.highlightItem = (me.value*numItems).asInteger.min(numItems-1);
Expand Down
2 changes: 1 addition & 1 deletion HelpSource/Classes/ScatterView2.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ code::
// three dimensional dataset
d = ({1.0.rand}!9000).clump(3);

w = SCWindow.new("ScatterView Example");
w = Window("ScatterView Example");
v = ScatterView2(w, Rect(10, 10, 380, 380), d);
v.selectionMode = \nextNeighbour;
v.background = Color.black;
Expand Down
2 changes: 1 addition & 1 deletion HelpSource/Classes/ScatterView3d.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ code::
(
var data;
data = {{2.0.rand2}!3}!150;
w = Window.new("3D Scatterplot", Rect(40,40, 500, 500)).front;
w = Window("3D Scatterplot", Rect(40,40, 500, 500)).front;
a = ScatterView3d(w, Rect(10,10, 450, 450), data, [-2, 2].asSpec);
a.drawMethod = \fillRect;
a.symbolSize = 3;
Expand Down
Loading