hyper-analytics
Advanced tools
Comparing version 0.13.0 to 0.15.0
@@ -9,7 +9,5 @@ 'use strict'; | ||
if (index.length) { | ||
var groupsOffset = Number(aggregator.hasGroups()); | ||
// redimension the data | ||
var data = this.data; | ||
data.length = groupsOffset + aggregator.aggregates.length; | ||
data.length = aggregator.aggregates.length; | ||
@@ -20,3 +18,3 @@ var sorter = aggregator.sorterInstance; | ||
aggregator.aggregates.forEach(function(aggregate, i) { | ||
data[groupsOffset + i] = aggregate(sorter); | ||
data[i] = aggregate(sorter); | ||
}); | ||
@@ -23,0 +21,0 @@ } |
@@ -85,3 +85,3 @@ 'use strict'; | ||
this.depth = depth; | ||
this.data[0] = this.computeDepthString(); | ||
this.data[-1] = this.computeDepthString(); | ||
}, | ||
@@ -88,0 +88,0 @@ |
@@ -33,3 +33,3 @@ 'use strict'; | ||
}); | ||
this.data[0] = this.computeDepthString(); | ||
this.data[-1] = this.computeDepthString(); | ||
}, | ||
@@ -87,3 +87,3 @@ | ||
this.expanded = expand; | ||
this.data[0] = this.computeDepthString(); | ||
this.data[-1] = this.computeDepthString(); | ||
if (this.expanded) { | ||
@@ -90,0 +90,0 @@ this.getRowData(drillDown); |
@@ -52,9 +52,3 @@ 'use strict'; | ||
if (index.length) { | ||
// var groupsOffset = drillDown.hasGroups() ? 1 : 0, | ||
// data = this.data, | ||
// dataLen = drillDown.getColumnCount() - groupsOffset, | ||
// i = 0, | ||
// sorter = drillDown.sorterInstance; | ||
var groupsOffset = Number(drillDown.hasGroups()), | ||
sorter = drillDown.sorterInstance, | ||
var sorter = drillDown.sorterInstance, | ||
data = this.data, | ||
@@ -65,5 +59,4 @@ dataLen = sorter.getColumnCount(), | ||
sorter.index = index; | ||
//data[0] = ""; //No need to repeat the first column info above the group | ||
for (i; i < dataLen; i++) { | ||
data[i + groupsOffset] = sorter.getValue(i, 0); | ||
data[i] = sorter.getValue(i, 0); | ||
} | ||
@@ -70,0 +63,0 @@ } |
@@ -27,3 +27,3 @@ 'use strict'; | ||
*/ | ||
this.treeColumnIndex = 0; | ||
this.treeColumnIndex = -1; | ||
@@ -124,4 +124,10 @@ /** | ||
this.clearAggregations(); | ||
this._schema = [{name: 'Tree'}]; | ||
this._schema = []; | ||
//copy negative indices | ||
for (var i = -1; i in this.dataSource.schema; i--){ | ||
this._schema[i] = this.dataSource.schema[i]; | ||
} | ||
for (var key in aggregations) { | ||
@@ -290,2 +296,7 @@ this.addAggregate(key, aggregations[key]); | ||
isLeafNode: function(y) { | ||
return this.view[y] instanceof DataNodeLeaf; | ||
}, | ||
/** | ||
@@ -297,9 +308,9 @@ * @memberOf DataSourceAggregator# | ||
isDrillDown: function(columnIndex) { | ||
var result = this.viewMakesSense(); | ||
if (result && columnIndex) { | ||
result = columnIndex === this.treeColumnIndex; | ||
} | ||
return result; | ||
return this.viewMakesSense(); | ||
}, | ||
isDrillDownCol: function (event) { | ||
return event && event.gridCell && event.gridCell.x === this.treeColumnIndex; | ||
}, | ||
getDataIndex: function(y) { | ||
@@ -306,0 +317,0 @@ return this.viewMakesSense() ? y : this.dataSource.getDataIndex(y); |
@@ -54,3 +54,3 @@ 'use strict'; | ||
*/ | ||
this.treeColumnIndex = 0; | ||
this.treeColumnIndex = -1; | ||
@@ -124,4 +124,8 @@ /** | ||
var parentSchema = this.dataSource.schema.slice(0); | ||
parentSchema.unshift({name: 'Tree'}); | ||
this._schema = parentSchema; | ||
//copy negative indices | ||
for (var i = -1; i in this.dataSource.schema; i--){ | ||
this._schema[i] = this.dataSource.schema[i]; | ||
} | ||
}, | ||
@@ -163,2 +167,6 @@ | ||
isLeafNode: function(y) { | ||
return this.view[y] instanceof DataNodeLeaf; | ||
}, | ||
/** | ||
@@ -233,10 +241,10 @@ * @memberOf DataSourceGroupView# | ||
*/ | ||
isDrillDown: function(columnIndex) { | ||
var result = this.viewMakesSense(); | ||
if (result && columnIndex) { | ||
result = columnIndex === this.treeColumnIndex; | ||
} | ||
return result; | ||
isDrillDown: function() { | ||
return this.viewMakesSense(); | ||
}, | ||
isDrillDownCol: function (event) { | ||
return event && event.gridCell && event.gridCell.x === this.treeColumnIndex; | ||
}, | ||
getDataIndex: function(y) { | ||
@@ -358,5 +366,6 @@ return this.viewMakesSense() ? y : this.dataSource.getDataIndex(y); | ||
var groups = this.view[y]; | ||
var groups = this.view[y], | ||
node = groups ? groups : this.tree; | ||
return groups ? groups : this.tree; | ||
return toObject(this.schema, node.data); | ||
}, | ||
@@ -388,4 +397,13 @@ | ||
function toObject(names, values) { | ||
var result = {}; | ||
for (var i = 0; i < names.length; i++) { | ||
var key = names[i].field || names[i].name; | ||
result[key] = values[i]; | ||
} | ||
return result; | ||
} | ||
Object.defineProperty(DataSourceGroupView.prototype, 'type', { value: 'groupviewer' }); // read-only property | ||
module.exports = DataSourceGroupView; |
@@ -260,2 +260,6 @@ 'use strict'; | ||
isDrillDownCol: function (event) { | ||
return event && event.dataCell.x === this._treeColumn.index; | ||
}, | ||
/** | ||
@@ -262,0 +266,0 @@ * @summary Handle a click event in the drill-down column. |
{ | ||
"name": "hyper-analytics", | ||
"version": "0.13.0", | ||
"version": "0.15.0", | ||
"description": "Data transformations on arrays of congruent JavaScript objects.", | ||
@@ -15,3 +15,3 @@ "repository": { | ||
"devDependencies": { | ||
"fin-hypergrid-data-source-base": "^0.4.7", | ||
"fin-hypergrid-data-source-base": "^0.4.11", | ||
"gulp": "^3.9.0", | ||
@@ -18,0 +18,0 @@ "gulp-eslint": "^1.1.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91999
2823
1