- renamed facet-based-edit-dialog -> clustering-dialog
- added help in case the clustering dialog comes up with no clusters - changed 'remove' -> (x) button for text facet git-svn-id: http://google-refine.googlecode.com/svn/trunk@291 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
99ae7dea29
commit
2946f2e8c3
1
src/main/webapp/about.html
Normal file
1
src/main/webapp/about.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>About Gridworks</title>
<link rel="stylesheet" href="/styles/common.css" />
<link rel="stylesheet" href="/styles/index.css" />
<style>
#body {
margin: 0em;
padding: 1em 2em;
}
</style>
</head>
<body>
<div id="header">
<a id="logo" href="http://www.metaweb.com/"><img alt="Metaweb" src="images/metaweb-headerlogo.png" /></a>
</div>
<div id="body">
<h1>Gridworks</h1>
<h2>Credits</h2>
<ul>
<li><a href="http://www.freebase.com/view/en/david_francois_huynh">David Huynh</a></li>
<li><a href="http://www.freebase.com/view/en/stefano_mazzocchi">Stefano Mazzocchi</a></li>
<li><a href="http://www.freebase.com/view/en/vishal_talwar">Vishal Talwar</a></li>
</ul>
<h2>Special Thanks</h2>
<ul>
<li><a href="http://www.paolociccarese.info/">Paolo Ciccarese</a> for his help on clustering</li>
</ul>
</div>
<div id="footer">
<a href="about.html">About Gridworks</a>
•
© 2010 <a href="http://www.metaweb.com/">Metaweb Technologies, Inc.</a>
</div>
</body>
</html>
|
@ -1 +1 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Gridworks</title>
<link type="text/css" rel="stylesheet" href="externals/suggest/css/suggest-1.0.3.min.css" />
<link type="text/css" rel="stylesheet" href="externals/jquery-ui/css/ui-lightness/jquery-ui-1.7.2.custom.css" />
<link rel="stylesheet" href="/styles/common.css" />
<link rel="stylesheet" href="/styles/util/menu.css" />
<link rel="stylesheet" href="/styles/util/dialog.css" />
<link rel="stylesheet" href="/styles/util/custom-suggest.css" />
<link rel="stylesheet" href="/styles/project.css" />
<link rel="stylesheet" href="/styles/project/history.css" />
<link rel="stylesheet" href="/styles/project/browsing.css" />
<link rel="stylesheet" href="/styles/project/process.css" />
<link rel="stylesheet" href="/styles/project/menu-bar.css" />
<link rel="stylesheet" href="/styles/views/data-table-view.css" />
<link rel="stylesheet" href="/styles/dialogs/expression-preview-dialog.css" />
<link rel="stylesheet" href="/styles/dialogs/recon-dialog.css" />
<link rel="stylesheet" href="/styles/dialogs/facet-based-edit-dialog.css" />
<link rel="stylesheet" href="/styles/dialogs/extend-data-preview-dialog.css" />
<link rel="stylesheet" href="/styles/protograph/schema-alignment-dialog.css" />
<script type="text/javascript" src="externals/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="externals/suggest/suggest-1.0.3.min.js"></script>
<script type="text/javascript" src="externals/jquery-ui/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="externals/date.js"></script>
<script type="text/javascript" src="scripts/util/misc.js"></script>
<script type="text/javascript" src="scripts/util/url.js"></script>
<script type="text/javascript" src="scripts/util/string.js"></script>
<script type="text/javascript" src="scripts/util/ajax.js"></script>
<script type="text/javascript" src="scripts/util/menu.js"></script>
<script type="text/javascript" src="scripts/util/dialog.js"></script>
<script type="text/javascript" src="scripts/util/dom.js"></script>
<script type="text/javascript" src="scripts/util/custom-suggest.js"></script>
<script type="text/javascript" src="scripts/project.js"></script>
<script type="text/javascript" src="scripts/project/history-widget.js"></script>
<script type="text/javascript" src="scripts/project/process-widget.js"></script>
<script type="text/javascript" src="scripts/project/menu-bar.js"></script>
<script type="text/javascript" src="scripts/project/browsing-engine.js"></script>
<script type="text/javascript" src="scripts/project/scripting.js"></script>
<script type="text/javascript" src="scripts/facets/list-facet.js"></script>
<script type="text/javascript" src="scripts/facets/range-facet.js"></script>
<script type="text/javascript" src="scripts/facets/text-search-facet.js"></script>
<script type="text/javascript" src="scripts/views/data-table-view.js"></script>
<script type="text/javascript" src="scripts/views/data-table-cell-ui.js"></script>
<script type="text/javascript" src="scripts/views/data-table-column-header-ui.js"></script>
<script type="text/javascript" src="scripts/dialogs/recon-dialog.js"></script>
<script type="text/javascript" src="scripts/dialogs/expression-preview-dialog.js"></script>
<script type="text/javascript" src="scripts/dialogs/facet-based-edit-dialog.js"></script>
<script type="text/javascript" src="scripts/dialogs/extend-data-preview-dialog.js"></script>
<script type="text/javascript" src="scripts/protograph/schema-alignment.js"></script>
<script type="text/javascript" src="scripts/protograph/schema-alignment-ui-node.js"></script>
<script type="text/javascript" src="scripts/protograph/schema-alignment-ui-link.js"></script>
</head>
<body>
<div id="header">
<a id="logo" href="http://www.metaweb.com/"><img alt="Metaweb" src="images/metaweb-headerlogo.png" /></a>
<div id="path"><a class="app-path-section" href="./index.html">Gridworks</a> » </div>
</div>
<div id="body">
<div id="loading-message"><img src="images/large-spinner.gif" /> starting up ...</div>
</div>
<div id="footer">
<a href="about.html">About Gridworks</a>
•
© 2010 <a href="http://www.metaweb.com/">Metaweb Technologies, Inc.</a>
</div>
</body>
</html>
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Gridworks</title>
<link type="text/css" rel="stylesheet" href="externals/suggest/css/suggest-1.0.3.min.css" />
<link type="text/css" rel="stylesheet" href="externals/jquery-ui/css/ui-lightness/jquery-ui-1.7.2.custom.css" />
<link rel="stylesheet" href="/styles/common.css" />
<link rel="stylesheet" href="/styles/util/menu.css" />
<link rel="stylesheet" href="/styles/util/dialog.css" />
<link rel="stylesheet" href="/styles/util/custom-suggest.css" />
<link rel="stylesheet" href="/styles/project.css" />
<link rel="stylesheet" href="/styles/project/history.css" />
<link rel="stylesheet" href="/styles/project/browsing.css" />
<link rel="stylesheet" href="/styles/project/process.css" />
<link rel="stylesheet" href="/styles/project/menu-bar.css" />
<link rel="stylesheet" href="/styles/views/data-table-view.css" />
<link rel="stylesheet" href="/styles/dialogs/expression-preview-dialog.css" />
<link rel="stylesheet" href="/styles/dialogs/recon-dialog.css" />
<link rel="stylesheet" href="/styles/dialogs/clustering-dialog.css" />
<link rel="stylesheet" href="/styles/dialogs/extend-data-preview-dialog.css" />
<link rel="stylesheet" href="/styles/protograph/schema-alignment-dialog.css" />
<script type="text/javascript" src="externals/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="externals/suggest/suggest-1.0.3.min.js"></script>
<script type="text/javascript" src="externals/jquery-ui/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="externals/date.js"></script>
<script type="text/javascript" src="scripts/util/misc.js"></script>
<script type="text/javascript" src="scripts/util/url.js"></script>
<script type="text/javascript" src="scripts/util/string.js"></script>
<script type="text/javascript" src="scripts/util/ajax.js"></script>
<script type="text/javascript" src="scripts/util/menu.js"></script>
<script type="text/javascript" src="scripts/util/dialog.js"></script>
<script type="text/javascript" src="scripts/util/dom.js"></script>
<script type="text/javascript" src="scripts/util/custom-suggest.js"></script>
<script type="text/javascript" src="scripts/project.js"></script>
<script type="text/javascript" src="scripts/project/history-widget.js"></script>
<script type="text/javascript" src="scripts/project/process-widget.js"></script>
<script type="text/javascript" src="scripts/project/menu-bar.js"></script>
<script type="text/javascript" src="scripts/project/browsing-engine.js"></script>
<script type="text/javascript" src="scripts/project/scripting.js"></script>
<script type="text/javascript" src="scripts/facets/list-facet.js"></script>
<script type="text/javascript" src="scripts/facets/range-facet.js"></script>
<script type="text/javascript" src="scripts/facets/text-search-facet.js"></script>
<script type="text/javascript" src="scripts/views/data-table-view.js"></script>
<script type="text/javascript" src="scripts/views/data-table-cell-ui.js"></script>
<script type="text/javascript" src="scripts/views/data-table-column-header-ui.js"></script>
<script type="text/javascript" src="scripts/dialogs/recon-dialog.js"></script>
<script type="text/javascript" src="scripts/dialogs/expression-preview-dialog.js"></script>
<script type="text/javascript" src="scripts/dialogs/clustering-dialog.js"></script>
<script type="text/javascript" src="scripts/dialogs/extend-data-preview-dialog.js"></script>
<script type="text/javascript" src="scripts/protograph/schema-alignment.js"></script>
<script type="text/javascript" src="scripts/protograph/schema-alignment-ui-node.js"></script>
<script type="text/javascript" src="scripts/protograph/schema-alignment-ui-link.js"></script>
</head>
<body>
<div id="header">
<a id="logo" href="http://www.metaweb.com/"><img alt="Metaweb" src="images/metaweb-headerlogo.png" /></a>
<div id="path"><a class="app-path-section" href="./index.html">Gridworks</a> » </div>
</div>
<div id="body">
<div id="loading-message"><img src="images/large-spinner.gif" /> starting up ...</div>
</div>
<div id="footer">
<a href="about.html">About Gridworks</a>
•
© 2010 <a href="http://www.metaweb.com/">Metaweb Technologies, Inc.</a>
</div>
</body>
</html>
|
@ -1,4 +1,4 @@
|
|||||||
function FacetBasedEditDialog(columnName, expression) {
|
function ClusteringDialog(columnName, expression) {
|
||||||
this._columnName = columnName;
|
this._columnName = columnName;
|
||||||
this._expression = expression;
|
this._expression = expression;
|
||||||
this._method = "binning";
|
this._method = "binning";
|
||||||
@ -11,7 +11,7 @@ function FacetBasedEditDialog(columnName, expression) {
|
|||||||
this._cluster();
|
this._cluster();
|
||||||
}
|
}
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._createDialog = function() {
|
ClusteringDialog.prototype._createDialog = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
var frame = DialogSystem.createDialog();
|
var frame = DialogSystem.createDialog();
|
||||||
frame.width("900px");
|
frame.width("900px");
|
||||||
@ -62,7 +62,7 @@ FacetBasedEditDialog.prototype._createDialog = function() {
|
|||||||
'</tr>' +
|
'</tr>' +
|
||||||
'<tr>' +
|
'<tr>' +
|
||||||
'<td colspan="3">' +
|
'<td colspan="3">' +
|
||||||
'<div bind="tableContainer" class="facet-based-edit-dialog-table-container"></div>' +
|
'<div bind="tableContainer" class="clustering-dialog-table-container"></div>' +
|
||||||
'</td>' +
|
'</td>' +
|
||||||
'<td bind="facetContainer" width="200"></td>' +
|
'<td bind="facetContainer" width="200"></td>' +
|
||||||
'</tr>' +
|
'</tr>' +
|
||||||
@ -133,11 +133,13 @@ FacetBasedEditDialog.prototype._createDialog = function() {
|
|||||||
$("#recon-dialog-tabs-strict").css("display", "");
|
$("#recon-dialog-tabs-strict").css("display", "");
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._renderTable = function(clusters) {
|
ClusteringDialog.prototype._renderTable = function(clusters) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var container = this._elmts.tableContainer;
|
var container = this._elmts.tableContainer;
|
||||||
var table = $('<table></table>').addClass("facet-based-edit-dialog-entry-table")[0];
|
|
||||||
|
if (clusters.length > 0) {
|
||||||
|
var table = $('<table></table>').addClass("clustering-dialog-entry-table")[0];
|
||||||
|
|
||||||
var trHead = table.insertRow(table.rows.length);
|
var trHead = table.insertRow(table.rows.length);
|
||||||
trHead.className = "header";
|
trHead.className = "header";
|
||||||
@ -155,39 +157,40 @@ FacetBasedEditDialog.prototype._renderTable = function(clusters) {
|
|||||||
|
|
||||||
$(tr.insertCell(1)).text(cluster.rowCount);
|
$(tr.insertCell(1)).text(cluster.rowCount);
|
||||||
|
|
||||||
var ul = $('<ul>');
|
var ul = $('<ul></ul>');
|
||||||
var choices = cluster.choices;
|
var choices = cluster.choices;
|
||||||
var rowCount = 0;
|
var rowCount = 0;
|
||||||
for (var c = 0; c < choices.length; c++) {
|
for (var c = 0; c < choices.length; c++) {
|
||||||
var choice = choices[c];
|
var choice = choices[c];
|
||||||
var li = $('<li>').appendTo(ul);
|
var li = $('<li></li>');
|
||||||
$('<a href="abcd" title="Use this value"></a>').text(choice.v).click(function() {
|
$('<a href="javascript:{}" title="Use this value"></a>').text(choice.v).click(function() {
|
||||||
var parent = $(this).closest("tr");
|
var parent = $(this).closest("tr");
|
||||||
parent.find("input[type='text']").val($(this).text());
|
parent.find("input[type='text']").val($(this).text());
|
||||||
parent.find("input:not(:checked)").attr('checked', true).change();
|
parent.find("input:not(:checked)").attr('checked', true).change();
|
||||||
return false;
|
return false;
|
||||||
}).appendTo(li);
|
}).appendTo(li);
|
||||||
$('<span>').text("(" + choice.c + " rows)").addClass("facet-based-edit-dialog-entry-count").appendTo(li);
|
$('<span></span>').text("(" + choice.c + " rows)").addClass("clustering-dialog-entry-count").appendTo(li);
|
||||||
rowCount += choice.c;
|
rowCount += choice.c;
|
||||||
|
li.appendTo(ul);
|
||||||
}
|
}
|
||||||
$(tr.insertCell(2)).append(ul);
|
$(tr.insertCell(2)).append(ul);
|
||||||
|
|
||||||
var editCheck = $('<input type="checkbox" />')
|
var editCheck = $('<input type="checkbox" />')
|
||||||
.appendTo(tr.insertCell(3))
|
|
||||||
.change(function() {
|
.change(function() {
|
||||||
cluster.edit = !cluster.edit;
|
cluster.edit = !cluster.edit;
|
||||||
});
|
}).appendTo(tr.insertCell(3));
|
||||||
|
|
||||||
if (cluster.edit) {
|
if (cluster.edit) {
|
||||||
editCheck.attr("checked", "true");
|
editCheck.attr("checked", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
var input = $('<input size="25" />')
|
var input = $('<input size="25" />')
|
||||||
.attr("value", cluster.value)
|
.attr("value", cluster.value)
|
||||||
.appendTo(tr.insertCell(4))
|
|
||||||
.keyup(function() {
|
.keyup(function() {
|
||||||
cluster.value = this.value;
|
cluster.value = this.value;
|
||||||
});
|
}).appendTo(tr.insertCell(4));
|
||||||
};
|
};
|
||||||
|
|
||||||
for (var i = 0; i < clusters.length; i++) {
|
for (var i = 0; i < clusters.length; i++) {
|
||||||
renderCluster(clusters[i]);
|
renderCluster(clusters[i]);
|
||||||
}
|
}
|
||||||
@ -199,9 +202,16 @@ FacetBasedEditDialog.prototype._renderTable = function(clusters) {
|
|||||||
("<b>" + this._clusters.length + "</b> cluster" + ((this._clusters.length != 1) ? "s" : "") + " found") :
|
("<b>" + this._clusters.length + "</b> cluster" + ((this._clusters.length != 1) ? "s" : "") + " found") :
|
||||||
("<b>" + clusters.length + "</b> cluster" + ((clusters.length != 1) ? "s" : "") + " filtered from <b>" + this._clusters.length + "</b> total")
|
("<b>" + clusters.length + "</b> cluster" + ((clusters.length != 1) ? "s" : "") + " filtered from <b>" + this._clusters.length + "</b> total")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
container.html(
|
||||||
|
'<div style="margin: 2em;"><div style="font-size: 130%; color: #333;">No clusters were found with the selected method</div><div style="padding-top: 1em; font-size: 110%; color: #888;">Try selecting another method above or changing its parameters</div></div>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._cluster = function() {
|
ClusteringDialog.prototype._cluster = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var container = this._elmts.tableContainer.html(
|
var container = this._elmts.tableContainer.html(
|
||||||
@ -228,7 +238,7 @@ FacetBasedEditDialog.prototype._cluster = function() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._updateData = function(data) {
|
ClusteringDialog.prototype._updateData = function(data) {
|
||||||
var clusters = [];
|
var clusters = [];
|
||||||
$.each(data, function() {
|
$.each(data, function() {
|
||||||
var cluster = {
|
var cluster = {
|
||||||
@ -261,29 +271,29 @@ FacetBasedEditDialog.prototype._updateData = function(data) {
|
|||||||
this._updateAll();
|
this._updateAll();
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._selectAll = function() {
|
ClusteringDialog.prototype._selectAll = function() {
|
||||||
$(".facet-based-edit-dialog-entry-table input:not(:checked)").attr('checked', true).change();
|
$(".clustering-dialog-entry-table input:not(:checked)").attr('checked', true).change();
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._deselectAll = function() {
|
ClusteringDialog.prototype._deselectAll = function() {
|
||||||
$(".facet-based-edit-dialog-entry-table input:checked").attr('checked', false).change();
|
$(".clustering-dialog-entry-table input:checked").attr('checked', false).change();
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._onApplyClose = function() {
|
ClusteringDialog.prototype._onApplyClose = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
this._apply(function() {
|
this._apply(function() {
|
||||||
self._dismiss();
|
self._dismiss();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._onApplyReCluster = function() {
|
ClusteringDialog.prototype._onApplyReCluster = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
this._apply(function() {
|
this._apply(function() {
|
||||||
self._cluster();
|
self._cluster();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._apply = function(onDone) {
|
ClusteringDialog.prototype._apply = function(onDone) {
|
||||||
var clusters = this._getRestrictedClusters();
|
var clusters = this._getRestrictedClusters();
|
||||||
var edits = [];
|
var edits = [];
|
||||||
for (var i = 0; i < clusters.length; i++) {
|
for (var i = 0; i < clusters.length; i++) {
|
||||||
@ -323,15 +333,15 @@ FacetBasedEditDialog.prototype._apply = function(onDone) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._dismiss = function() {
|
ClusteringDialog.prototype._dismiss = function() {
|
||||||
DialogSystem.dismissUntil(this._level - 1);
|
DialogSystem.dismissUntil(this._level - 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._getBaseClusters = function() {
|
ClusteringDialog.prototype._getBaseClusters = function() {
|
||||||
return [].concat(this._clusters);
|
return [].concat(this._clusters);
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._getRestrictedClusters = function(except) {
|
ClusteringDialog.prototype._getRestrictedClusters = function(except) {
|
||||||
var clusters = this._getBaseClusters();
|
var clusters = this._getBaseClusters();
|
||||||
for (var i = 0; i < this._facets.length; i++) {
|
for (var i = 0; i < this._facets.length; i++) {
|
||||||
var facet = this._facets[i].facet;
|
var facet = this._facets[i].facet;
|
||||||
@ -342,7 +352,7 @@ FacetBasedEditDialog.prototype._getRestrictedClusters = function(except) {
|
|||||||
return clusters;
|
return clusters;
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._updateAll = function() {
|
ClusteringDialog.prototype._updateAll = function() {
|
||||||
for (var i = 0; i < this._facets.length; i++) {
|
for (var i = 0; i < this._facets.length; i++) {
|
||||||
var facet = this._facets[i].facet;
|
var facet = this._facets[i].facet;
|
||||||
var clusters = this._getRestrictedClusters(facet);
|
var clusters = this._getRestrictedClusters(facet);
|
||||||
@ -351,7 +361,7 @@ FacetBasedEditDialog.prototype._updateAll = function() {
|
|||||||
this._renderTable(this._getRestrictedClusters());
|
this._renderTable(this._getRestrictedClusters());
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._resetFacets = function() {
|
ClusteringDialog.prototype._resetFacets = function() {
|
||||||
for (var i = 0; i < this._facets.length; i++) {
|
for (var i = 0; i < this._facets.length; i++) {
|
||||||
var r = this._facets[i];
|
var r = this._facets[i];
|
||||||
r.facet.dispose();
|
r.facet.dispose();
|
||||||
@ -365,15 +375,15 @@ FacetBasedEditDialog.prototype._resetFacets = function() {
|
|||||||
this._createFacet("Value Length Variance", "variance");
|
this._createFacet("Value Length Variance", "variance");
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.prototype._createFacet = function(title, property) {
|
ClusteringDialog.prototype._createFacet = function(title, property) {
|
||||||
var elmt = $('<div>').appendTo(this._elmts.facetContainer);
|
var elmt = $('<div>').appendTo(this._elmts.facetContainer);
|
||||||
this._facets.push({
|
this._facets.push({
|
||||||
elmt: elmt,
|
elmt: elmt,
|
||||||
facet: new FacetBasedEditDialog.Facet(this, title, property, elmt, this._getBaseClusters())
|
facet: new ClusteringDialog.Facet(this, title, property, elmt, this._getBaseClusters())
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.Facet = function(dialog, title, property, elmt, clusters) {
|
ClusteringDialog.Facet = function(dialog, title, property, elmt, clusters) {
|
||||||
this._dialog = dialog;
|
this._dialog = dialog;
|
||||||
this._property = property;
|
this._property = property;
|
||||||
|
|
||||||
@ -419,12 +429,12 @@ FacetBasedEditDialog.Facet = function(dialog, title, property, elmt, clusters) {
|
|||||||
this._from = this._min;
|
this._from = this._min;
|
||||||
this._to = this._max;
|
this._to = this._max;
|
||||||
|
|
||||||
elmt.addClass("facet-based-edit-dialog-facet");
|
elmt.addClass("clustering-dialog-facet");
|
||||||
var html = $(
|
var html = $(
|
||||||
'<div class="facet-based-edit-dialog-facet-header">' + title + '</div>' +
|
'<div class="clustering-dialog-facet-header">' + title + '</div>' +
|
||||||
'<div class="facet-based-edit-dialog-facet-histogram" bind="histogramContainer"></div>' +
|
'<div class="clustering-dialog-facet-histogram" bind="histogramContainer"></div>' +
|
||||||
'<div class="facet-based-edit-dialog-facet-slider" bind="slider"></div>' +
|
'<div class="clustering-dialog-facet-slider" bind="slider"></div>' +
|
||||||
'<div class="facet-based-edit-dialog-facet-selection" bind="selectionContainer"></div>'
|
'<div class="clustering-dialog-facet-selection" bind="selectionContainer"></div>'
|
||||||
).appendTo(elmt);
|
).appendTo(elmt);
|
||||||
|
|
||||||
this._elmts = DOM.bind(html);
|
this._elmts = DOM.bind(html);
|
||||||
@ -443,10 +453,10 @@ FacetBasedEditDialog.Facet = function(dialog, title, property, elmt, clusters) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.Facet.prototype.dispose = function() {
|
ClusteringDialog.Facet.prototype.dispose = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.Facet.prototype.restrict = function(clusters) {
|
ClusteringDialog.Facet.prototype.restrict = function(clusters) {
|
||||||
if (this._baseBins.length == 0 || (this._from == this._min && this._to == this._max)) {
|
if (this._baseBins.length == 0 || (this._from == this._min && this._to == this._max)) {
|
||||||
return clusters;
|
return clusters;
|
||||||
}
|
}
|
||||||
@ -462,7 +472,7 @@ FacetBasedEditDialog.Facet.prototype.restrict = function(clusters) {
|
|||||||
return clusters2;
|
return clusters2;
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.Facet.prototype.update = function(clusters) {
|
ClusteringDialog.Facet.prototype.update = function(clusters) {
|
||||||
if (this._baseBins.length == 0) {
|
if (this._baseBins.length == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -494,11 +504,11 @@ FacetBasedEditDialog.Facet.prototype.update = function(clusters) {
|
|||||||
).appendTo(this._elmts.histogramContainer);
|
).appendTo(this._elmts.histogramContainer);
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.Facet.prototype._setRangeIndicators = function() {
|
ClusteringDialog.Facet.prototype._setRangeIndicators = function() {
|
||||||
this._elmts.selectionContainer.text(this._from + " to " + this._to);
|
this._elmts.selectionContainer.text(this._from + " to " + this._to);
|
||||||
};
|
};
|
||||||
|
|
||||||
FacetBasedEditDialog.Facet.prototype._computeDistribution = function(clusters) {
|
ClusteringDialog.Facet.prototype._computeDistribution = function(clusters) {
|
||||||
var bins = [];
|
var bins = [];
|
||||||
for (var b = 0; b < this._binCount; b++) {
|
for (var b = 0; b < this._binCount; b++) {
|
||||||
bins.push(0);
|
bins.push(0);
|
@ -238,7 +238,7 @@ ListFacet.prototype.render = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ListFacet.prototype._doEdit = function() {
|
ListFacet.prototype._doEdit = function() {
|
||||||
new FacetBasedEditDialog(this._config.columnName, this._config.expression);
|
new ClusteringDialog(this._config.columnName, this._config.expression);
|
||||||
};
|
};
|
||||||
|
|
||||||
ListFacet.prototype._editChoice = function(choice, choiceDiv) {
|
ListFacet.prototype._editChoice = function(choice, choiceDiv) {
|
||||||
|
@ -45,7 +45,11 @@ TextSearchFacet.prototype._initializeUI = function() {
|
|||||||
var headerDiv = $('<div></div>').addClass("facet-title").appendTo(container);
|
var headerDiv = $('<div></div>').addClass("facet-title").appendTo(container);
|
||||||
$('<span></span>').text(this._config.name).appendTo(headerDiv);
|
$('<span></span>').text(this._config.name).appendTo(headerDiv);
|
||||||
|
|
||||||
var removeButton = $('<a href="javascript:{}"></a>').addClass("facet-choice-link").text("remove").click(function() {
|
var removeButton = $('<img>')
|
||||||
|
.attr("src", "images/close.png")
|
||||||
|
.attr("title", "Remove this facet")
|
||||||
|
.addClass("facet-choice-link")
|
||||||
|
.click(function() {
|
||||||
self._remove();
|
self._remove();
|
||||||
}).prependTo(headerDiv);
|
}).prependTo(headerDiv);
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ DataTableColumnHeaderUI.prototype._createMenuForColumnHeader = function(elmt) {
|
|||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
label: "Cluster & Edit ...",
|
label: "Cluster & Edit ...",
|
||||||
click: function() { new FacetBasedEditDialog(self._column.name, "value"); }
|
click: function() { new ClusteringDialog(self._column.name, "value"); }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
72
src/main/webapp/styles/dialogs/clustering-dialog.css
Normal file
72
src/main/webapp/styles/dialogs/clustering-dialog.css
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
.clustering-dialog-table-container {
|
||||||
|
height: 500px;
|
||||||
|
overflow: auto;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.clustering-dialog-entry-table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.clustering-dialog-entry-table > tbody > tr.header {
|
||||||
|
background: #ccc;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.clustering-dialog-entry-table > tbody > tr > td {
|
||||||
|
padding: 2px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.clustering-dialog-entry-table > tbody > tr.odd > td {
|
||||||
|
background: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.clustering-dialog-entry-table > tbody > tr.even > td {
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.clustering-dialog-entry-table input {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 0 0.1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.clustering-dialog-entry-table a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.clustering-dialog-entry-table a:hover {
|
||||||
|
text-decoration: underline
|
||||||
|
}
|
||||||
|
|
||||||
|
.clustering-dialog-entry-count {
|
||||||
|
color: #aaa;
|
||||||
|
margin-left: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clustering-dialog-controls {
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clustering-dialog-controls td {
|
||||||
|
padding-right: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.clustering-dialog-facet {
|
||||||
|
margin-bottom: 1em;
|
||||||
|
}
|
||||||
|
.clustering-dialog-facet-header {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.clustering-dialog-facet-histogram {
|
||||||
|
margin: 10px 8px 5px 8px;
|
||||||
|
height: 52px;
|
||||||
|
}
|
||||||
|
.clustering-dialog-facet-slider {
|
||||||
|
margin: 5px;
|
||||||
|
}
|
||||||
|
.clustering-dialog-facet-selection {
|
||||||
|
text-align: center;
|
||||||
|
color: #888;
|
||||||
|
}
|
@ -1,72 +0,0 @@
|
|||||||
.facet-based-edit-dialog-table-container {
|
|
||||||
height: 500px;
|
|
||||||
overflow: auto;
|
|
||||||
border: 1px solid #aaa;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.facet-based-edit-dialog-entry-table {
|
|
||||||
border-collapse: collapse;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.facet-based-edit-dialog-entry-table > tbody > tr.header {
|
|
||||||
background: #ccc;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.facet-based-edit-dialog-entry-table > tbody > tr > td {
|
|
||||||
padding: 2px 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.facet-based-edit-dialog-entry-table > tbody > tr.odd > td {
|
|
||||||
background: #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.facet-based-edit-dialog-entry-table > tbody > tr.even > td {
|
|
||||||
background: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.facet-based-edit-dialog-entry-table input {
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
padding: 0 0.1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.facet-based-edit-dialog-entry-table a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.facet-based-edit-dialog-entry-table a:hover {
|
|
||||||
text-decoration: underline
|
|
||||||
}
|
|
||||||
|
|
||||||
.facet-based-edit-dialog-entry-count {
|
|
||||||
color: #aaa;
|
|
||||||
margin-left: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.facet-based-edit-dialog-controls {
|
|
||||||
margin-bottom: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.facet-based-edit-dialog-controls td {
|
|
||||||
padding-right: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.facet-based-edit-dialog-facet {
|
|
||||||
margin-bottom: 1em;
|
|
||||||
}
|
|
||||||
.facet-based-edit-dialog-facet-header {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.facet-based-edit-dialog-facet-histogram {
|
|
||||||
margin: 10px 8px 5px 8px;
|
|
||||||
height: 52px;
|
|
||||||
}
|
|
||||||
.facet-based-edit-dialog-facet-slider {
|
|
||||||
margin: 5px;
|
|
||||||
}
|
|
||||||
.facet-based-edit-dialog-facet-selection {
|
|
||||||
text-align: center;
|
|
||||||
color: #888;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user