function ScatterplotFacet(div, config, options) { this._div = div; this._config = config; this._options = options; this._error = false; this._initializedUI = false; } ScatterplotFacet.prototype.reset = function() { delete this._config.from_x; delete this._config.from_y; delete this._config.to_x; delete this._config.to_y; this._plotImg.imgAreaSelect({ hide : true}); }; ScatterplotFacet.reconstruct = function(div, uiState) { return new ScatterplotFacet(div, uiState.c, uiState.o); }; ScatterplotFacet.prototype.getUIState = function() { var json = { c: this.getJSON(), o: this._options }; return json; }; ScatterplotFacet.prototype.getJSON = function() { this._config.type = "scatterplot"; return this._config; }; ScatterplotFacet.prototype.hasSelection = function() { return ("from_x" in this._config); }; ScatterplotFacet.prototype._initializeUI = function() { var self = this; var container = this._div.empty(); var headerDiv = $('
').addClass("facet-title").appendTo(container); $('').text(this._config.name).appendTo(headerDiv); var resetButton = $('').addClass("facet-choice-link").text("reset").click(function() { self.reset(); self._updateRest(); }).prependTo(headerDiv); var removeButton = $('') .attr("src", "images/close.png") .attr("title", "Remove this facet") .addClass("facet-choice-link") .click(function() { self._remove(); }).prependTo(headerDiv); var bodyDiv = $('').addClass("facet-scatterplot-body").appendTo(container); this._messageDiv = $('