|
|
|
|
@ -33,14 +33,8 @@ FluidPlotter {
|
|
|
|
|
ymin = ymin_;
|
|
|
|
|
ymax = ymax_;
|
|
|
|
|
|
|
|
|
|
if(dict_.isNil,{this.dictNotProperlyFormatted});
|
|
|
|
|
if(dict_.size != 2,{this.dictNotProperlyFormatted});
|
|
|
|
|
if(dict_.at("data").isNil,{this.dictNotProperlyFormatted});
|
|
|
|
|
if(dict_.at("cols").isNil,{this.dictNotProperlyFormatted});
|
|
|
|
|
if(dict_.at("cols") != 2,{this.dictNotProperlyFormatted});
|
|
|
|
|
|
|
|
|
|
this.createCatColors;
|
|
|
|
|
this.dict_(dict_);
|
|
|
|
|
if(dict_.notNil,{this.dict_(dict_)});
|
|
|
|
|
this.createPlotWindow(bounds,parent_,mouseMoveAction,dict_);
|
|
|
|
|
this.background_(Color.white);
|
|
|
|
|
}
|
|
|
|
|
@ -54,6 +48,7 @@ FluidPlotter {
|
|
|
|
|
|
|
|
|
|
setCategories_ {
|
|
|
|
|
arg labelSetDict;
|
|
|
|
|
if(dict_internal.notNil,{
|
|
|
|
|
dict_internal.keysValuesDo({
|
|
|
|
|
arg id, pt;
|
|
|
|
|
var col, cat = labelSetDict.at("data").at(id)[0].interpret;
|
|
|
|
|
@ -62,6 +57,9 @@ FluidPlotter {
|
|
|
|
|
pt.color_(col);
|
|
|
|
|
});
|
|
|
|
|
this.refresh;
|
|
|
|
|
},{
|
|
|
|
|
"FluidPlotter::setCategories_ FluidPlotter cannot receive setCategories. It has no data. First set a dictionary.".warn;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setSizeMultiplier_ {
|
|
|
|
|
@ -113,11 +111,18 @@ FluidPlotter {
|
|
|
|
|
|
|
|
|
|
dict_ {
|
|
|
|
|
arg d;
|
|
|
|
|
|
|
|
|
|
if(d.isNil,{^this.dictNotProperlyFormatted});
|
|
|
|
|
if(d.size != 2,{^this.dictNotProperlyFormatted});
|
|
|
|
|
if(d.at("data").isNil,{^this.dictNotProperlyFormatted});
|
|
|
|
|
if(d.at("cols").isNil,{^this.dictNotProperlyFormatted});
|
|
|
|
|
if(d.at("cols") != 2,{^this.dictNotProperlyFormatted});
|
|
|
|
|
|
|
|
|
|
dict = d;
|
|
|
|
|
dict_internal = Dictionary.new;
|
|
|
|
|
dict.at("data").keysValuesDo({
|
|
|
|
|
arg k, v;
|
|
|
|
|
/* k.postln;
|
|
|
|
|
/* k.postln;
|
|
|
|
|
v.postln;*/
|
|
|
|
|
dict_internal.put(k,FluidPlotterPoint(k,v[0],v[1],Color.black,1));
|
|
|
|
|
});
|
|
|
|
|
@ -170,11 +175,12 @@ FluidPlotter {
|
|
|
|
|
userView = UserView(parent,Rect(xpos,ypos,bounds.width,bounds.height));
|
|
|
|
|
|
|
|
|
|
userView.drawFunc_({
|
|
|
|
|
if(dict_internal.notNil,{
|
|
|
|
|
dict_internal.keysValuesDo({
|
|
|
|
|
arg key, pt;
|
|
|
|
|
var pointSize_, scaledx, scaledy, color;
|
|
|
|
|
|
|
|
|
|
/* key.postln;
|
|
|
|
|
/* key.postln;
|
|
|
|
|
pt.postln;
|
|
|
|
|
pt.x.postln;
|
|
|
|
|
pt.y.postln;*/
|
|
|
|
|
@ -197,6 +203,7 @@ FluidPlotter {
|
|
|
|
|
Pen.draw;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
userView.mouseMoveAction_({
|
|
|
|
|
arg view, x, y, modifiers;
|
|
|
|
|
|