Static Console Hacks


Hi guys,

I’m pretty new to this stuff so I might be out of line starting this thread. I personally think that we need a thread to collect “hacks” on how to simplify one’s life.

So here is my Hack #1.
In Console run:

C3.typesys.Obj.prototype.g_ = function(){c3Grid(this);}
C3.typesys.Obj.prototype.t_ = function(){c3Tree(this);}
C3.typesys.Obj.prototype.v_ = function(){c3Viz(this);}

This will add g_(), t_() and v_() to all new Obj types. So you for example you could do Type.fetch().g_() instead of having to call c3Grid(Type.fetch())

Ideally this shouldn’t be a “hack” but implemented in Obj platform type.

Anyway, I’ll use this topic to keep posting stuff I discover :wink:



Related - If you want to see how one of the js utility functions available in the static console is implemented, you can enter a function name without actually invoking the function, hit enter, then click on the result that is printed out and it will take you to the implementation of that function within util.js so you can see what it is actually doing.



“Tip/Hack 3” - make sure you check all defined “Ann” - there might be one you might need and didn’t know it existed. Like for example for Canonical you can use @ser(name=“XXX”) to map between an external field name (that might contain white spaces or keywords) and the canonical field.

1 Like