Skip to content

Commit

Permalink
Merge pull request #374 from openfin/develop
Browse files Browse the repository at this point in the history
Merge to master 1.2.1
  • Loading branch information
Jonathan Eiten authored Oct 28, 2016
2 parents 482d392 + 1328d38 commit 9602ddf
Show file tree
Hide file tree
Showing 23 changed files with 206 additions and 476 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@

<img src="images/README/gridshot04.gif">

### Current Release (1.2.0 - 26 October 2016)
### Current Release (1.2.1 - 27 October 2016)

The current version 1.0 replaces last year's [prototype version](https://github.com/openfin/fin-hypergrid/tree/polymer-prototype), which was built around Polymer. It is now completely "de-polymerized" and is being made available as:
* An [npm module](https://www.npmjs.com/package/fin-hypergrid) for use with browserify.
* A single JavaScript file [fin-hypergrid.js](https://openfin.github.io/fin-hypergrid/build/fin-hypergrid.js) you can reference in a `<script>` tag.

_For a complete list of changes, see the [release notes](https://github.com/openfin/fin-hypergrid/releases)._
**The release notes for v1.2.0 are under review and will be posted no later than 27 October 2016.**

### Demos

Expand Down
220 changes: 0 additions & 220 deletions add-ons/group-view.js

This file was deleted.

2 changes: 1 addition & 1 deletion add-ons/grouped-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function setHeaders(headers) {
return Math.max(column.header.split(delimiter).length, max);
}, 0);

var headerDataModel = this.grid.behavior.getSubgrid('header'),
var headerDataModel = this.grid.behavior.subgrids.header,
headerRowHeight = levels * 4 / 3 * this.grid.properties.defaultRowHeight;
this.grid.setRowHeight(0, headerRowHeight, headerDataModel);

Expand Down
38 changes: 13 additions & 25 deletions add-ons/totals-toolkit/mix-ins/behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,6 @@

module.exports = {

// This override properly maintain the subgrids dictionary.
set subgrids(subgrids) {
// first delete dictionary members in case supplied object is an existing dictionary
Object.keys(subgrids).filter(function(property) {
return !/^\d+$/.test(property);
}).forEach(function(nonNumericProperty) {
delete subgrids[nonNumericProperty];
});

// extract names from named subgrids and add to dictionary
subgrids.forEach(function(subgrid) {
if (subgrid.name) {
subgrids[subgrid.name] = subgrid;
}
});

this._subgrids = subgrids;
},
get subgrids() {
return this._subgrids;
},

/** @typedef {*[]} valueList
* @desc One of:
* * `activeColumnsList` falsy - Array of row values semantically congruent to `this.columns`.
Expand Down Expand Up @@ -104,7 +82,9 @@ module.exports = {
setTotals: function(key, rows, activeColumnsList) {
key += 'Totals';

if (!this.subgrids[key]) {
var totals = this.subgrids[key];

if (!totals) {
throw new this.HypergridError('Expected subgrids.' + key + '.');
}

Expand All @@ -122,9 +102,17 @@ module.exports = {
}, this);
}

this.subgrids[key].setData(rows);
var newRowCount = rows.length,
oldRowCount = totals.getRowCount();

totals.setData(rows);

if (newRowCount === oldRowCount) {
this.grid.repaint();
} else {
this.grid.behavior.shapeChanged();
}

this.grid.repaint();
return rows;
},

Expand Down
13 changes: 0 additions & 13 deletions demo/calculated-column.html

This file was deleted.

49 changes: 49 additions & 0 deletions demo/computed-column.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<title>Hypergrid Computed Values Demo</title>
<script src="build/fin-hypergrid.js"></script>
<script src="build/add-ons/hyper-filter.js"></script>
<script src="build/add-ons/hyper-sorter.js"></script>
<script src="js/computed-column.js"></script>

<script src="http://joneit.github.io/datasaur-indexed/build/datasaur-indexed.js"></script>
<script src="http://joneit.github.io/datasaur-filter/build/datasaur-filter.js"></script>

<style>
th, td {
width: 50%;
padding: .65em;
vertical-align: top;
border:1px solid #444;
font-size: small;
font-family: sans-serif;
}
table { border-collapse: collapse }
caption { text-align: left; padding: 1em 0 .65em 0 }
table, div#example { width:400px; }
div#example {
position:relative;
height:150px;
margin-top:1em
}
code { font-weight: bold }
</style>
</head>
<body>
<h3>Computed Column</h3>
<div id="example"></div>
<table>
<caption>Note the following differences between computed columns <i>vs.</i> computed cells:</caption>
<tr><th>Computed Column</th><th>Computed Cell</th></tr>
<tr>
<td>A single function reference in the <code>calculator</code> <em>column property</em> is used to compute the values for all the cells in the column.</td>
<td>Each computed cell has a calculator function <em>in place of</em> its value. The grid displays the value returned by the calculator.</code></td>
</tr>
<tr>
<td>There can also be a cell value, which the calculator can reference and operate on <em>in addition to</em> the other columns' value and any other variables in it's closure.</td>
<td>The cell value <em>is</em> a reference to a calculator function. There is no cell value <i>per se;</i> the calculator therefore can <em>only</em> operate on the values of the other columns' values and other variables in it's closure.</td>
</tr>
</table>
</body>
</html>
18 changes: 0 additions & 18 deletions demo/group-view.html

This file was deleted.

2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script src="build/add-ons/drill-down.js"></script>
<script src="build/add-ons/totals-toolkit.js"></script>
<script src="build/add-ons/tree-view.js"></script>
<script src="build/add-ons/group-view.js"></script>
<!--<script src="build/add-ons/group-view.js"></script>-->
<script src="build/add-ons/aggregations-view.js"></script>

<script src="http://joneit.github.io/datasaur-indexed/build/datasaur-indexed.js"></script>
Expand Down
Loading

0 comments on commit 9602ddf

Please sign in to comment.