Skip to content

Commit

Permalink
#29 minor issues
Browse files Browse the repository at this point in the history
- lookup in metric/dimension picker by name/key.
- fixed issue with double dimension allocation when exporting.
  • Loading branch information
itayw committed Oct 25, 2015
1 parent 8e45d18 commit 4cc8a3b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/lib/viz/DimensionPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ var DimensionPicker = module.exports = function (options, callback) {

list.forEach(function (dimension) {
var collection = {key: dimension.collection};
var $li = $$('<div class="dimensionOption" data-member="' + dimension.key + '">' + (dimension.name || dimension.key) + '</div>');
var $li = $$('<div class="dimensionOption" data-member="' + (dimension.name || dimension.key) + '">' + (dimension.name || dimension.key) + '</div>');
$li.off('click');
$li.on('click', function (e) {
var $this = $$(this);
Expand Down Expand Up @@ -303,4 +303,4 @@ joola.events.on('core.init.finish', function () {
}
});

util.inherits(DimensionPicker, events.EventEmitter);
util.inherits(DimensionPicker, events.EventEmitter);
6 changes: 3 additions & 3 deletions src/lib/viz/MetricPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ var MetricPicker = module.exports = function (options, callback) {
list = _.sortBy(list, function (item) {
return item.name || item.key;
});

list.forEach(function (metric) {
var collection = {key: metric.collection};
if (typeof collection !== 'object')
collection = {key: collection};

var $li = $$('<div class="metricOption" data-member="' + collection.key + '.' + metric.key + '">' + (metric.name || metric.key) + '</div>');
var $li = $$('<div class="metricOption" data-member="' + collection.key + '.' + (metric.name || metric.key) + '">' + (metric.name || metric.key) + '</div>');
$li.off('click');
$li.on('click', function (e) {
var $this = $$(this);
Expand Down Expand Up @@ -298,4 +298,4 @@ joola.events.on('core.init.finish', function () {
}
});

util.inherits(MetricPicker, events.EventEmitter);
util.inherits(MetricPicker, events.EventEmitter);
2 changes: 1 addition & 1 deletion src/lib/viz/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ var Table = module.exports = function (options, callback) {

this.export = function (canvas) {
var data = [];
var dimensions = [self.options.query[0].dimensions[0]];
var collection = [self.options.query[0].collection];
var dimensions =[];
var metrics = [];
var headers = [];
self.options.query[0].dimensions.forEach(function (d) {
Expand Down

0 comments on commit 4cc8a3b

Please sign in to comment.