Commit d7c008d8 by Rashid Khan

Moved libraries around, added US state field to loader

parent 54752ce0
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
labjs = labjs.script("common/lib/jquery.flot.js") labjs = labjs.script("common/lib/panels/jquery.flot.js")
.script("common/lib/jquery.flot.time.js") .script("common/lib/panels/jquery.flot.time.js")
angular.module('kibana.histogram', []) angular.module('kibana.histogram', [])
.directive('histogram', function() { .directive('histogram', function() {
......
labjs = labjs.script("common/lib/jquery.jvectormap.min.js") labjs = labjs.script("common/lib/panels/jquery.jvectormap.min.js");
.script("common/lib/jquery-jvectormap-world-mill-en.js")
angular.module('kibana.map', []) angular.module('kibana.map', [])
.directive('map', function() { .directive('map', function() {
...@@ -10,6 +9,7 @@ angular.module('kibana.map', []) ...@@ -10,6 +9,7 @@ angular.module('kibana.map', [])
// Specify defaults for ALL directives // Specify defaults for ALL directives
var _d = { var _d = {
queries : ["*"], queries : ["*"],
map : "world",
interval: secondsToHms(calculate_interval(scope.from,scope.to,40,0)/1000), interval: secondsToHms(calculate_interval(scope.from,scope.to,40,0)/1000),
colors : ["#BF3030","#1D7373","#86B32D","#A98A21","#411F73"], colors : ["#BF3030","#1D7373","#86B32D","#A98A21","#411F73"],
show : ['bars'], show : ['bars'],
...@@ -68,7 +68,7 @@ angular.module('kibana.map', []) ...@@ -68,7 +68,7 @@ angular.module('kibana.map', [])
// Then the insert into facet and make the request // Then the insert into facet and make the request
var results = request var results = request
.facet(ejs.TermsFacet('worldmap') .facet(ejs.TermsFacet('map')
.field(params.field) .field(params.field)
.size(params['size']) .size(params['size'])
.exclude(params.exclude) .exclude(params.exclude)
...@@ -80,7 +80,7 @@ angular.module('kibana.map', []) ...@@ -80,7 +80,7 @@ angular.module('kibana.map', [])
results.then(function(results) { results.then(function(results) {
scope.hits = results.hits.total; scope.hits = results.hits.total;
scope.data = {}; scope.data = {};
_.each(results.facets.worldmap.terms, function(v) { _.each(results.facets.map.terms, function(v) {
scope.data[v.term.toUpperCase()] = v.count; scope.data[v.term.toUpperCase()] = v.count;
}); });
}); });
...@@ -91,22 +91,29 @@ angular.module('kibana.map', []) ...@@ -91,22 +91,29 @@ angular.module('kibana.map', [])
// Parse our params object // Parse our params object
var params = scope.params; var params = scope.params;
// Populate element
$('.jvectormap-label,.jvectormap-zoomin,.jvectormap-zoomout').remove();
elem.text(''); elem.text('');
elem.vectorMap({ $('.jvectormap-label,.jvectormap-zoomin,.jvectormap-zoomout').remove();
map: 'world_mill_en',
regionStyle: {initial: {fill: '#ddd'}}, elem.append("<div class='jvectormap-label'>Loading Map</div>");
zoomOnScroll: false,
backgroundColor: '#fff', loadmap = $LAB.script("common/lib/panels/map."+params.map+".js")
series: {
regions: [{ // Populate element. Note that jvectormap appends, does not replace.
values: scope.data, loadmap.wait(function(){
scale: ['#C8EEFF', '#0071A4'], elem.vectorMap({
normalizeFunction: 'polynomial' map: params.map,
}] regionStyle: {initial: {fill: '#ddd'}},
} zoomOnScroll: false,
}); backgroundColor: '#fff',
series: {
regions: [{
values: scope.data,
scale: ['#C8EEFF', '#0071A4'],
normalizeFunction: 'polynomial'
}]
}
});
})
//elem.show(); //elem.show();
} }
} }
......
labjs = labjs.script("common/lib/jquery.flot.js") labjs = labjs.script("common/lib/panels/jquery.flot.js")
.script("common/lib/jquery.flot.pie.js") .script("common/lib/panels/jquery.flot.pie.js")
angular.module('kibana.piequery', []) angular.module('kibana.piequery', [])
.directive('piequery', function() { .directive('piequery', function() {
......
labjs = labjs.script("common/lib/jquery.flot.js") labjs = labjs.script("common/lib/panels/jquery.flot.js")
.script("common/lib/jquery.flot.pie.js") .script("common/lib/panels/jquery.flot.pie.js")
angular.module('kibana.pieterms', []) angular.module('kibana.pieterms', [])
.directive('pieterms', function() { .directive('pieterms', function() {
......
labjs = labjs.script("common/lib/jquery.flot.js") labjs = labjs.script("common/lib/panels/jquery.flot.js")
.script("common/lib/jquery.flot.time.js") .script("common/lib/panels/jquery.flot.time.js")
.script("common/lib/jquery.flot.stack.js") .script("common/lib/panels/jquery.flot.stack.js")
angular.module('kibana.stackedquery', []) angular.module('kibana.stackedquery', [])
.directive('stackedquery', function() { .directive('stackedquery', function() {
......
...@@ -13,6 +13,7 @@ curl -XPUT http://localhost:9200/_template/shakespeare -d ' ...@@ -13,6 +13,7 @@ curl -XPUT http://localhost:9200/_template/shakespeare -d '
"play_name" : {"type": "string", "index" : "not_analyzed" }, "play_name" : {"type": "string", "index" : "not_analyzed" },
"line_id" : { "type" : "integer", "index": "not_analyzed" }, "line_id" : { "type" : "integer", "index": "not_analyzed" },
"speech_number" : { "type" : "integer", "index": "not_analyzed" }, "speech_number" : { "type" : "integer", "index": "not_analyzed" },
"state" : {"type": "string", "index" : "not_analyzed" },
"country" : {"type": "string", "index" : "not_analyzed" } "country" : {"type": "string", "index" : "not_analyzed" }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment