Skip to content

Commit

Permalink
[es6modules] unwrap amd modules, hoist imports
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Feb 3, 2016
1 parent 2a5cdae commit 5fe5ea9
Show file tree
Hide file tree
Showing 473 changed files with 28,526 additions and 29,472 deletions.
128 changes: 63 additions & 65 deletions src/fixtures/agg_resp/geohash_grid.js
Original file line number Diff line number Diff line change
@@ -1,83 +1,81 @@
define(function (require) {
return function GeoHashGridAggResponseFixture() {
export default function GeoHashGridAggResponseFixture() {

var _ = require('lodash');
var _ = require('lodash');

// for vis:
//
// vis = new Vis(indexPattern, {
// type: 'tile_map',
// aggs:[
// { schema: 'metric', type: 'avg', params: { field: 'bytes' } },
// { schema: 'split', type: 'terms', params: { field: '@tags', size: 10 } },
// { schema: 'segment', type: 'geohash_grid', params: { field: 'geo.coordinates', precision: 3 } }
// ],
// params: {
// isDesaturated: true,
// mapType: 'Scaled%20Circle%20Markers'
// },
// });
// for vis:
//
// vis = new Vis(indexPattern, {
// type: 'tile_map',
// aggs:[
// { schema: 'metric', type: 'avg', params: { field: 'bytes' } },
// { schema: 'split', type: 'terms', params: { field: '@tags', size: 10 } },
// { schema: 'segment', type: 'geohash_grid', params: { field: 'geo.coordinates', precision: 3 } }
// ],
// params: {
// isDesaturated: true,
// mapType: 'Scaled%20Circle%20Markers'
// },
// });

var geoHashCharts = _.union(
_.range(48, 57), // 0-9
_.range(65, 90), // A-Z
_.range(97, 122) // a-z
);
var geoHashCharts = _.union(
_.range(48, 57), // 0-9
_.range(65, 90), // A-Z
_.range(97, 122) // a-z
);

var totalDocCount = 0;
var totalDocCount = 0;

var tags = _.times(_.random(4, 20), function (i) {
// random number of tags
var docCount = 0;
var buckets = _.times(_.random(40, 200), function () {
return _.sample(geoHashCharts, 3).join('');
})
.sort()
.map(function (geoHash) {
var count = _.random(1, 5000);
var tags = _.times(_.random(4, 20), function (i) {
// random number of tags
var docCount = 0;
var buckets = _.times(_.random(40, 200), function () {
return _.sample(geoHashCharts, 3).join('');
})
.sort()
.map(function (geoHash) {
var count = _.random(1, 5000);

totalDocCount += count;
docCount += count;

return {
key: geoHash,
doc_count: count,
1: {
value: 2048 + i
}
};
});
totalDocCount += count;
docCount += count;

return {
key: 'tag ' + (i + 1),
doc_count: docCount,
3: {
buckets: buckets
},
key: geoHash,
doc_count: count,
1: {
value: 1000 + i
value: 2048 + i
}
};
});

return {
took: 3,
timed_out: false,
_shards: {
total: 4,
successful: 4,
failed: 0
},
hits: {
total: 298,
max_score: 0.0,
hits: []
key: 'tag ' + (i + 1),
doc_count: docCount,
3: {
buckets: buckets
},
aggregations: {
2: {
buckets: tags
}
1: {
value: 1000 + i
}
};
});

return {
took: 3,
timed_out: false,
_shards: {
total: 4,
successful: 4,
failed: 0
},
hits: {
total: 298,
max_score: 0.0,
hits: []
},
aggregations: {
2: {
buckets: tags
}
}
};
});
};
38 changes: 18 additions & 20 deletions src/fixtures/fake_chart_events.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
define(function (require) {
var results = {};
var results = {};

results.timeSeries = {
data: {
ordered: {
date: true,
interval: 600000,
max: 1414437217559,
min: 1414394017559
}
},
label: 'apache',
value: 44,
point: {
label: 'apache',
x: 1414400400000,
y: 44,
y0: 0
results.timeSeries = {
data: {
ordered: {
date: true,
interval: 600000,
max: 1414437217559,
min: 1414394017559
}
};
});
},
label: 'apache',
value: 44,
point: {
label: 'apache',
x: 1414400400000,
y: 44,
y0: 0
}
};
Loading

0 comments on commit 5fe5ea9

Please sign in to comment.