function FacetBasedEditDialog(columnName, expression) { this._columnName = columnName; this._expression = expression; this._method = "binning"; this._function = "fingerprint"; this._params = {}; this._facets = []; this._createDialog(); this._cluster(); } FacetBasedEditDialog.prototype._createDialog = function() { var self = this; var frame = DialogSystem.createDialog(); frame.width("900px"); var header = $('
').addClass("dialog-header").text("Cluster & Edit column " + this._columnName).appendTo(frame); var body = $('
').addClass("dialog-body").appendTo(frame); var footer = $('
').addClass("dialog-footer").appendTo(frame); var html = $( '
' + '
' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
' + 'Method: ' + '' + '
Keying Function:
' + '' + '
' + '' + '' + '' + '
' + '
' + '
' + '
' ).appendTo(body); this._elmts = DOM.bind(html); this._elmts.methodSelector.change(function() { var selection = $(this).find("option:selected").text(); if (selection == 'key collision') { body.find(".binning-controls").show(); body.find(".knn-controls").hide(); self._method = "binning"; self._elmts.keyingFunctionSelector.change(); } else if (selection = 'nearest neightbor') { body.find(".binning-controls").hide(); body.find(".knn-controls").show(); self._method = "knn"; self._elmts.distanceFunctionSelector.change(); } }); var changer = function() { self._function = $(this).find("option:selected").text(); $(".function-params").hide(); $("#" + self._function + "-params").show(); self._cluster(); }; this._elmts.keyingFunctionSelector.change(changer); this._elmts.distanceFunctionSelector.change(changer); this._elmts.ngramSize.change(function() { try { self._params = { "ngram-size" : parseInt($(this).val()) }; self._cluster(); } catch (e) { alert("ngram size must be a number"); } }); this._elmts.radius.change(function() { try { self._params = { "radius" : parseFloat($(this).val()) }; self._cluster(); } catch (e) { alert("radius must be a number"); } }); this._elmts.ngramBlock.change(function() { try { self._params = { "blocking-ngram-size" : parseInt($(this).val()) }; self._cluster(); } catch (e) { alert("radius must be a number"); } }); //this._elmts.clusterButton.click(function() { self._cluster(); }); //this._elmts.unclusterButton.click(function() { self._uncluster(); }); $('').text("Apply & Re-Cluster").click(function() { self._onApplyReCluster(); }).appendTo(footer); $('').text("Apply & Close").click(function() { self._onApplyClose(); }).appendTo(footer); $('').text("Close").click(function() { self._dismiss(); }).appendTo(footer); this._level = DialogSystem.showDialog(frame); $("#recon-dialog-tabs").tabs(); $("#recon-dialog-tabs-strict").css("display", ""); }; FacetBasedEditDialog.prototype._renderTable = function(clusters) { var self = this; var container = this._elmts.tableContainer; var table = $('
').addClass("facet-based-edit-dialog-entry-table")[0]; var trHead = table.insertRow(table.rows.length); trHead.className = "header"; $(trHead.insertCell(0)).text("Cluster Size"); $(trHead.insertCell(1)).text("Row Count"); $(trHead.insertCell(2)).text("Values in Cluster"); $(trHead.insertCell(3)).text("Edit?"); $(trHead.insertCell(4)).text("New Cell Value"); var renderCluster = function(cluster) { var tr = table.insertRow(table.rows.length); tr.className = table.rows.length % 2 == 0 ? "odd" : "even"; $(tr.insertCell(0)).text(cluster.choices.length); $(tr.insertCell(1)).text(cluster.rowCount); var ul = $('