Problems with ScatterView

I am trying to look at 2d data with ScatterView (or ScatterView2 or ScatterView3D) and getting errors trying the example codes in the help files. I get Class not defined for ScatterView and error about not understanding relativeOrigin_ for the 3D version. I’m running this on linux, fedora. Anyone able to run scatterview ? Any suggestions how I might dynamically graph 2D data ?

thanks
Oded

I just tried the examples, it works for me on Arch Linux and SuperCollider 3.13-dev. Anyway, I don’t think it works because I’m on the sc-dev version.

Are you sure you have MathLib Quark installed/updated? Just to make sure:

Quarks.install("MathLib")

If this doesn’t work, could you please post the errors you get (and perhaps also the exact code you run)?

Oh, and in ScatterView example code, please ignore the first two lines:

SwingOSC.default.boot
GUI.swing

These things are deprecated since long time and you shouldn’t run them.

MathLib is installed.
I am running

(
var data = 1000.collect{ [1.0.rand, exprand(0.01, 1)]};
w = GUI.window.new(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)
.xAxisName_("uniform").yAxisName_("exponential");
)

and I get the following error:
CALL STACK:
DoesNotUnderstandError:reportError
arg this =
Nil:handleError
arg this = nil
arg error =
Thread:handleError
arg this =
arg error =
Object:throw
arg this =
Object:doesNotUnderstand
arg this =
arg selector = ‘relativeOrigin_’
arg args = [*1]
ScatterView:initPlot
arg this =
arg parent =
arg bounds =
arg data = [*1000]
arg argSpecX =
arg argSpecY =
var widthSpec = nil
var heightSpec = nil
var cross =
var possibleMethods = [*4]
< closed FunctionDef >
var data = [*1000]
Interpreter:interpretPrintCmdLine
arg this =
var res = nil
var func =
var code = “(
var data = 1000.collect{ […”
var doc = nil
var ideClass =
Process:interpretPrintCmdLine
arg this =
^^ ERROR: Message ‘relativeOrigin_’ not understood.
Perhaps you misspelled ‘relativeOrigin’, or meant to call ‘relativeOrigin_’ on another receiver?
RECEIVER: a QUserView

I see… I get this warning instead:

WARNING: Called from Object:relativeOrigin_, method Meta_AbsLayout:new is deprecated and will be removed.
The definition of 'Meta_AbsLayout:new' is to be found here: '/.../downloaded-quarks/wslib/wslib-classes/GUI/AbsLayout.sc'

Do you have wslib installed? And what SC version are you running?

Thanks. Installing wslib resolved the matter. For future reference, Is there a way I could have identified such missing dependencies ?

Personally, I don’t know if there is any “missing dependencies” check… but Quarks.install("MathLib") should pull required dependencies automatically.

And you can run this script to see if any of your installed Quarks is missing dependencies:

Quarks.installed.collect { |q|
	q.name -> q.dependencies.reject(_.isInstalled);
}.asDict.reject(_.isEmpty)

you’ll get an IdentityDictionary where keys are “dependent” quarks and values its missing dependencies.

FYI ScatterView has been fixed in MathLib so that wslib shouldn’t be needed anymore IIUC.

1 Like