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 = $( '' ).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(); params_changer(); }; this._elmts.keyingFunctionSelector.change(changer); this._elmts.distanceFunctionSelector.change(changer); var params_changer = function() { self._params = {}; $(".dialog-body input.param:visible").each(function() { var e = $(this); var name = e.attr('name'); var datatype = e.attr('datatype') || 'string'; var value = e.val(); if (datatype == 'int') { value = parseInt(value); } else if (datatype == 'float') { value = parseFloat(value); } self._params[name] = value; }); self._cluster(); }; this._elmts.ngramSize.change(params_changer); this._elmts.radius.change(params_changer); this._elmts.ngramBlock.change(params_changer); var left_footer = footer.find(".left"); $('').text("Select All").click(function() { self._selectAll(); }).appendTo(left_footer); $('').text("Deselect All").click(function() { self._deselectAll(); }).appendTo(left_footer); var right_footer = footer.find(".right"); $('').text("Apply & Re-Cluster").click(function() { self._onApplyReCluster(); }).appendTo(right_footer); $('').text("Apply & Close").click(function() { self._onApplyClose(); }).appendTo(right_footer); $('').text("Close").click(function() { self._dismiss(); }).appendTo(right_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("Merge?"); $(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 = $('