var SnapMX = (function(){ function SnapMX (w, h) { w = w || 100 h = h || 100 var snap = this.snap = new Snap (w, h) var el = this.el = snap.node var mx = this.mx = new MX.Object3D (el) scene.add(mx) } SnapMX.prototype.resize = function(w, h){ this.snap.attr({ width: w, height: h|0, }) this.mx.width = w this.mx.height = h } SnapMX.prototype.clear = function(){ this.snap.clear() } SnapMX.prototype.show = function(){ this.visible = true this.mx.style.display = "block" } SnapMX.prototype.hide = function(){ this.visible = false this.mx.style.display = "hide" } return SnapMX })()