diff --git a/src/main/java/com/metaweb/gridworks/model/ColumnModel.java b/src/main/java/com/metaweb/gridworks/model/ColumnModel.java index 36aa64e3e..71feb2794 100644 --- a/src/main/java/com/metaweb/gridworks/model/ColumnModel.java +++ b/src/main/java/com/metaweb/gridworks/model/ColumnModel.java @@ -28,6 +28,7 @@ public class ColumnModel implements Jsonizable { transient protected Map _cellIndexToColumn; transient protected List _rootColumnGroups; transient protected List _columnNames; + transient boolean _hasDependentRows; public ColumnModel() { internalInitialize(); @@ -93,6 +94,8 @@ public class ColumnModel implements Jsonizable { writer.object(); + writer.key("hasDependentRows"); writer.value(_hasDependentRows); + writer.key("columns"); writer.array(); for (Column column : columns) { diff --git a/src/main/java/com/metaweb/gridworks/model/Project.java b/src/main/java/com/metaweb/gridworks/model/Project.java index 32d435479..c60633a91 100644 --- a/src/main/java/com/metaweb/gridworks/model/Project.java +++ b/src/main/java/com/metaweb/gridworks/model/Project.java @@ -297,7 +297,7 @@ public class Project { } } - if (row.contextRowSlots != null) { + if (row.contextRowSlots != null && row.contextRowSlots.length > 0) { row.recordIndex = -1; row.contextRows = new ArrayList(); for (int index : row.contextRowSlots) { @@ -306,6 +306,8 @@ public class Project { } } Collections.sort(row.contextRows); + + columnModel._hasDependentRows = true; } else { row.recordIndex = recordIndex++; } diff --git a/src/main/webapp/scripts/facets/list-facet.js b/src/main/webapp/scripts/facets/list-facet.js index cb1219365..829c5cbe1 100644 --- a/src/main/webapp/scripts/facets/list-facet.js +++ b/src/main/webapp/scripts/facets/list-facet.js @@ -110,7 +110,7 @@ ListFacet.prototype.render = function() { } catch (e) { } - var container = this._div.empty().html( + var container = this._div.empty().show().html( '
' + '' + '' + diff --git a/src/main/webapp/scripts/facets/range-facet.js b/src/main/webapp/scripts/facets/range-facet.js index b5f24ecd1..d72630522 100644 --- a/src/main/webapp/scripts/facets/range-facet.js +++ b/src/main/webapp/scripts/facets/range-facet.js @@ -110,7 +110,7 @@ RangeFacet.prototype.hasSelection = function() { RangeFacet.prototype._initializeUI = function() { var self = this; - var container = this._div.empty(); + var container = this._div.empty().show(); var headerDiv = $('
').addClass("facet-title").appendTo(container); $('').text(this._config.name).appendTo(headerDiv); diff --git a/src/main/webapp/scripts/facets/scatterplot-facet.js b/src/main/webapp/scripts/facets/scatterplot-facet.js index ff6e248a5..64988069d 100644 --- a/src/main/webapp/scripts/facets/scatterplot-facet.js +++ b/src/main/webapp/scripts/facets/scatterplot-facet.js @@ -44,7 +44,7 @@ ScatterplotFacet.prototype.hasSelection = function() { ScatterplotFacet.prototype._initializeUI = function() { var self = this; - var container = this._div.empty(); + var container = this._div.empty().show(); var headerDiv = $('
').addClass("facet-title").appendTo(container); $('').text(this._config.name).appendTo(headerDiv); diff --git a/src/main/webapp/scripts/facets/text-search-facet.js b/src/main/webapp/scripts/facets/text-search-facet.js index 1b0185e99..483f12c8e 100644 --- a/src/main/webapp/scripts/facets/text-search-facet.js +++ b/src/main/webapp/scripts/facets/text-search-facet.js @@ -48,15 +48,17 @@ TextSearchFacet.prototype.hasSelection = function() { TextSearchFacet.prototype._initializeUI = function() { var self = this; - this._div.empty().html( + this._div.empty().show().html( '
' + '' + '' + this._config.name + '' + '
' + '
' + - '' + - '' + - '' + + '' + + '' + + '' + + '' + + '' + '
case sensitive
regular expression
case sensitiveregular expression
' ); diff --git a/src/main/webapp/scripts/project/browsing-engine.js b/src/main/webapp/scripts/project/browsing-engine.js index 0dde94562..e6c1b94b1 100644 --- a/src/main/webapp/scripts/project/browsing-engine.js +++ b/src/main/webapp/scripts/project/browsing-engine.js @@ -47,21 +47,31 @@ BrowsingEngine.prototype._initializeUI = function() { var self = this; this._div.html( - '
' + - '
' + - '

Explore data ...

' + - '

by choosing a facet or filter method from the menus at the top of each column.

' + - '

Not sure how to get started? Watch this screencast.

' + - '
' + - '
refreshing facets ...
' + - '
' + - '

' + - 'refresh • ' + - 'reset • ' + - 'remove all facets' + - '

' + - '

show dependent rows

' + + '
' + + '

Explore data ...

' + + '

by choosing a facet or filter method from the menus at the top of each column.

' + + '

Not sure how to get started? Watch this screencast.

' + + '
' + + '
' + + '
' + + ' refreshing facets ...' + '
' + + '
' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
' + + 'Refresh' + + '' + + 'Reset All' + + '' + + 'Remove All' + + '
show dependent rows
' + '
' + '
    ' ); @@ -134,7 +144,7 @@ BrowsingEngine.prototype.addFacet = function(type, config, options) { }; BrowsingEngine.prototype._createFacetContainer = function() { - return $('
  • ').addClass("facet-container").appendTo(this._elmts.facets); + return $('
  • ').addClass("facet-container").hide().appendTo(this._elmts.facets); }; BrowsingEngine.prototype.removeFacet = function(facet) { @@ -166,8 +176,11 @@ BrowsingEngine.prototype.removeFacet = function(facet) { BrowsingEngine.prototype.update = function(onDone) { var self = this; - this._elmts.indicator.show(); - this._elmts.controls.hide(); + this._elmts.help.hide(); + + this._elmts.header.show(); + this._elmts.controls.css("visibility", "hidden"); + this._elmts.indicator.css("visibility", "visible"); $.post( "/command/compute-facets?" + $.param({ project: theProject.id }), @@ -179,10 +192,16 @@ BrowsingEngine.prototype.update = function(onDone) { self._facets[i].facet.updateState(facetData[i]); } - self._elmts.indicator.hide(); + self._elmts.indicator.css("visibility", "hidden"); if (self._facets.length > 0) { - self._elmts.controls.show(); - self._elmts.help.hide(); + self._elmts.header.show(); + self._elmts.controls.css("visibility", "visible"); + + if (theProject.columnModel.hasDependentRows) { + self._elmts.dependentRowControls.show(); + } else { + self._elmts.dependentRowControls.hide(); + } } else { self._elmts.help.show(); } diff --git a/src/main/webapp/scripts/views/data-table-view.js b/src/main/webapp/scripts/views/data-table-view.js index 0c1018643..6ddbe1b3a 100644 --- a/src/main/webapp/scripts/views/data-table-view.js +++ b/src/main/webapp/scripts/views/data-table-view.js @@ -54,9 +54,9 @@ DataTableView.prototype._renderSummaryText = function(elmt) { var from = (theProject.rowModel.start + 1); var to = Math.min(theProject.rowModel.filtered, theProject.rowModel.start + theProject.rowModel.limit); if (theProject.rowModel.filtered == theProject.rowModel.total) { - summaryText = from + ' to ' + to + ' of ' + (theProject.rowModel.total) + ' rows'; + summaryText = from + ' – ' + to + ' of ' + (theProject.rowModel.total) + ' rows'; } else { - summaryText = from + ' to ' + to + ' of ' + + summaryText = from + ' – ' + to + ' of ' + (theProject.rowModel.filtered) + ' matching rows (' + (theProject.rowModel.total) + ' total)'; } $('').html(summaryText).appendTo(elmt); diff --git a/src/main/webapp/styles/project.css b/src/main/webapp/styles/project.css index 555b5e9db..4113291b6 100644 --- a/src/main/webapp/styles/project.css +++ b/src/main/webapp/styles/project.css @@ -50,7 +50,7 @@ body { background: white; overflow: hidden; padding: 0px; - font-size: 12px; + font-size: 11px; } .left-panel .ui-tabs { padding: 0; diff --git a/src/main/webapp/styles/project/browsing.css b/src/main/webapp/styles/project/browsing.css index 8f9ddc86b..29c3f10c6 100644 --- a/src/main/webapp/styles/project/browsing.css +++ b/src/main/webapp/styles/project/browsing.css @@ -1,20 +1,18 @@ .browsing-panel-header { - height: 5em; position: relative; + display: none; } .browsing-panel-indicator { - display: none; + visibility: hidden; position: absolute; width: 100%; top: 0px; } .browsing-panel-controls { - display: none; - position: absolute; - width: 100%; - top: 0px; + visibility: hidden; } + .browsing-panel-help { padding: 10px; background: white; @@ -90,7 +88,7 @@ a.facet-mode-link.facet-mode-link-selected { color: #f88; } .facet-body-scrollable { - height: 20em; + height: 17em; overflow: auto; } @@ -163,7 +161,6 @@ img.facet-choice-link { } .facet-text-body { - border: 1px solid #ccc; padding: 5px; } .facet-scatterplot-plot {