Merge branch 'master' into gh-pages
Conflicts resolved: docs/tutorial-multiview.markdown
This commit is contained in:
commit
4fb6c37c2e
@ -27,7 +27,7 @@ See CONTRIBUTING.md.
|
||||
* [Adrià Mercader](http://amercader.net/)
|
||||
* [Dominik Moritz](https://github.com/domoritz)
|
||||
* [Friedrich Lindenberg](http://pudo.org/)
|
||||
* [Alioune Dia](http://https://github.com/aliounedia)
|
||||
* [Alioune Dia](https://github.com/aliounedia)
|
||||
* [kielni](https://github.com/kielni)
|
||||
* And [many more](https://github.com/okfn/recline/graphs/contributors)
|
||||
|
||||
|
||||
@ -4,9 +4,6 @@
|
||||
<![endif]-->
|
||||
<link rel="stylesheet" href="{{page.root}}vendor/leaflet.markercluster/MarkerCluster.css">
|
||||
<link rel="stylesheet" href="{{page.root}}vendor/leaflet.markercluster/MarkerCluster.Default.css">
|
||||
<!--[if lte IE 8]>
|
||||
<link rel="stylesheet" href="{{page.root}}vendor/leaflet.markercluster/MarkerCluster.Default.ie.css" />
|
||||
<![endif]-->
|
||||
<link rel="stylesheet" href="{{page.root}}vendor/slickgrid/2.0.1/slick.grid.css">
|
||||
<link rel="stylesheet" href="{{page.root}}vendor/timeline/css/timeline.css">
|
||||
|
||||
|
||||
2
dist/recline.js
vendored
2
dist/recline.js
vendored
@ -1381,7 +1381,7 @@ my.Flot = Backbone.View.extend({
|
||||
}
|
||||
|
||||
var yfield = self.model.fields.get(field);
|
||||
var y = doc.getFieldValueUnrendered(yfield);
|
||||
var y = parseFloat(doc.getFieldValueUnrendered(yfield));
|
||||
|
||||
if (self.state.attributes.graphType == 'bars') {
|
||||
points.push([y, x]);
|
||||
|
||||
2
dist/recline.min.js
vendored
2
dist/recline.min.js
vendored
File diff suppressed because one or more lines are too long
@ -622,7 +622,7 @@ could have a lot of values and so we limit to max 15 (we assume)</p>
|
||||
}
|
||||
|
||||
<span class="hljs-keyword">var</span> yfield = self.model.fields.get(field);
|
||||
<span class="hljs-keyword">var</span> y = doc.getFieldValueUnrendered(yfield);
|
||||
<span class="hljs-keyword">var</span> y = <span class="hljs-built_in">parseFloat</span>(doc.getFieldValueUnrendered(yfield));
|
||||
|
||||
<span class="hljs-keyword">if</span> (self.state.attributes.graphType == <span class="hljs-string">'bars'</span>) {
|
||||
points.push([y, x]);
|
||||
|
||||
@ -142,7 +142,7 @@ my.Pager = Backbone.View.extend({
|
||||
<div class="pagination"> \
|
||||
<ul class="pagination"> \
|
||||
<li class="prev action-pagination-update"><a href="" class="btn btn-default">&laquo;</a></li> \
|
||||
<li class="page-range"><a><label for="from">From</label><input name="from" type="text" value="{{from}}" /> &ndash; <label for="to">To</label><input name="to" type="text" value="{{to}}" /> </a></li> \
|
||||
<li class="page-range"><a><label for="from">From</label><input id="from" name="from" type="text" value="{{from}}" /> &ndash; <label for="to">To</label><input id="to" name="to" type="text" value="{{to}}" /> </a></li> \
|
||||
<li class="next action-pagination-update"><a href="" class="btn btn-default">&raquo;</a></li> \
|
||||
</ul> \
|
||||
</div> \
|
||||
|
||||
@ -145,8 +145,8 @@ my.QueryEditor = Backbone.View.extend({
|
||||
<div class="input-group-addon"> \
|
||||
<i class="glyphicon glyphicon-search"></i> \
|
||||
</div> \
|
||||
<label>Search</label> \
|
||||
<input class="form-control search-query" type="text" name="q" value="{{q}}" placeholder="Search data ..."> \
|
||||
<label for="q">Search</label> \
|
||||
<input class="form-control search-query" type="text" id="q" name="q" value="{{q}}" placeholder="Search data ..."> \
|
||||
</div> \
|
||||
</div> \
|
||||
<button type="submit" class="btn btn-default">Go &raquo;</button> \
|
||||
|
||||
@ -40,9 +40,6 @@ Before writing any code with Recline, you need to do the following preparation s
|
||||
<link href="vendor/leaflet.markercluster/MarkerCluster.css" rel="stylesheet">
|
||||
<link href="vendor/leaflet.markercluster/MarkerCluster.Default.css" rel=
|
||||
"stylesheet">
|
||||
<!--[if lte IE 8]>
|
||||
<link rel="stylesheet" href="vendor/leaflet.markercluster/MarkerCluster.Default.ie.css" />
|
||||
<![endif]-->
|
||||
<link rel="stylesheet" href="vendor/slickgrid/2.0.1/slick.grid.css">
|
||||
|
||||
<!-- recline css -->
|
||||
|
||||
@ -230,9 +230,6 @@ library and the Recline Map view:
|
||||
<![endif]-->
|
||||
<link rel="stylesheet" href="vendor/leaflet.markercluster/MarkerCluster.css">
|
||||
<link rel="stylesheet" href="vendor/leaflet.markercluster/MarkerCluster.Default.css">
|
||||
<!--[if lte IE 8]>
|
||||
<link rel="stylesheet" href="vendor/leaflet.markercluster/MarkerCluster.Default.ie.css" />
|
||||
<![endif]-->
|
||||
<link rel="stylesheet" href="css/map.css">
|
||||
|
||||
<!-- javascript -->
|
||||
@ -275,7 +272,7 @@ map.render();
|
||||
### Creating a Timeline
|
||||
|
||||
<div class="alert alert-info">
|
||||
The source code along with all dependencies for the map part of the tutorial can be found at <a href="https://github.com/mattfullerton/recline-view-timeline-demo">this GitHub repository</a>. See it in action via <a href="http://mattfullerton.github.io/recline-view-timeline-demo/">GitHub Pages</a>.
|
||||
The source code along with all dependencies for the timeline part of the tutorial can be found at <a href="https://github.com/mattfullerton/recline-view-timeline-demo">this GitHub repository</a>. See it in action via <a href="http://mattfullerton.github.io/recline-view-timeline-demo/">GitHub Pages</a>.
|
||||
</div>
|
||||
|
||||
Now, let's create a timeline for this dataset using the date information which is
|
||||
|
||||
@ -343,7 +343,7 @@ my.Flot = Backbone.View.extend({
|
||||
}
|
||||
|
||||
var yfield = self.model.fields.get(field);
|
||||
var y = doc.getFieldValueUnrendered(yfield);
|
||||
var y = parseFloat(doc.getFieldValueUnrendered(yfield));
|
||||
|
||||
if (self.state.attributes.graphType == 'bars') {
|
||||
points.push([y, x]);
|
||||
|
||||
@ -161,7 +161,12 @@ my.SlickGrid = Backbone.View.extend({
|
||||
}
|
||||
|
||||
function sanitizeFieldName(name) {
|
||||
var sanitized = $(name).text();
|
||||
var sanitized;
|
||||
try{
|
||||
sanitized = $(name).text();
|
||||
} catch(e){
|
||||
sanitized = '';
|
||||
}
|
||||
return (name !== sanitized && sanitized !== '') ? sanitized : name;
|
||||
}
|
||||
|
||||
|
||||
13
test/base.js
13
test/base.js
@ -6,18 +6,19 @@ var Fixture = {
|
||||
{id: 'x'},
|
||||
{id: 'y'},
|
||||
{id: 'z'},
|
||||
{id: 'p'},
|
||||
{id: 'country'},
|
||||
{id: 'title'},
|
||||
{id: 'lat'},
|
||||
{id: 'lon'}
|
||||
];
|
||||
var documents = [
|
||||
{id: 0, date: '2011-01-01', x: 1, y: 2, z: 3, country: 'DE', title: 'first', lat:52.56, lon:13.40},
|
||||
{id: 1, date: '2011-02-02', x: 2, y: 4, z: 24, country: 'UK', title: 'second', lat:54.97, lon:-1.60},
|
||||
{id: 2, date: '2011-03-03', x: 3, y: 6, z: 9, country: 'US', title: 'third', lat:40.00, lon:-75.5},
|
||||
{id: 3, date: '2011-04-04', x: 4, y: 8, z: 6, country: 'UK', title: 'fourth', lat:57.27, lon:-6.20},
|
||||
{id: 4, date: '2011-05-04', x: 5, y: 10, z: 15, country: 'UK', title: 'fifth', lat:51.58, lon:0},
|
||||
{id: 5, date: '2011-06-02', x: 6, y: 12, z: 18, country: 'DE', title: 'sixth', lat:51.04, lon:7.9}
|
||||
{id: 0, date: '2011-01-01', x: 1, y: 2, z: 3, p: '4%', country: 'DE', title: 'first', lat:52.56, lon:13.40},
|
||||
{id: 1, date: '2011-02-02', x: 2, y: 4, z: 24, p: '14%',country: 'UK', title: 'second', lat:54.97, lon:-1.60},
|
||||
{id: 2, date: '2011-03-03', x: 3, y: 6, z: 9, p: '43%', country: 'US', title: 'third', lat:40.00, lon:-75.5},
|
||||
{id: 3, date: '2011-04-04', x: 4, y: 8, z: 6, p: '21%', country: 'UK', title: 'fourth', lat:57.27, lon:-6.20},
|
||||
{id: 4, date: '2011-05-04', x: 5, y: 10, z: 15, p: '29%', country: 'UK', title: 'fifth', lat:51.58, lon:0},
|
||||
{id: 5, date: '2011-06-02', x: 6, y: 12, z: 18, p: '87%', country: 'DE', title: 'sixth', lat:51.04, lon:7.9}
|
||||
];
|
||||
var dataset = new recline.Model.Dataset({records: documents, fields: fields});
|
||||
return dataset;
|
||||
|
||||
@ -55,6 +55,27 @@ test('dates in graph view', function () {
|
||||
view.remove();
|
||||
});
|
||||
|
||||
test('percentages in graph view', function () {
|
||||
var dataset = Fixture.getDataset();
|
||||
var view = new recline.View.Flot({
|
||||
model: dataset,
|
||||
state: {
|
||||
'graphType': 'lines',
|
||||
'group': 'country',
|
||||
'series': ['p']
|
||||
}
|
||||
});
|
||||
view.render();
|
||||
$('.fixtures').append(view.el);
|
||||
view.redraw();
|
||||
var graphData = view.plot.getData()[0].data;
|
||||
$.each(graphData, function(i, p){
|
||||
var percentage = p[1];
|
||||
equal($.isNumeric(percentage), true);
|
||||
});
|
||||
view.remove();
|
||||
});
|
||||
|
||||
test('FlotControls basics', function () {
|
||||
var dataset = Fixture.getDataset();
|
||||
var view = new recline.View.FlotControls({
|
||||
|
||||
@ -27,7 +27,7 @@ test('state', function () {
|
||||
var view = new recline.View.SlickGrid({
|
||||
model: dataset,
|
||||
state: {
|
||||
hiddenColumns:['x','lat','title'],
|
||||
hiddenColumns:['x','lat','title','p'],
|
||||
columnsOrder:['lon','id','z','date', 'y', 'country'],
|
||||
columnsWidth:[
|
||||
{column:'id',width: 250}
|
||||
@ -71,7 +71,7 @@ test('editable', function () {
|
||||
var view = new recline.View.SlickGrid({
|
||||
model: dataset,
|
||||
state: {
|
||||
hiddenColumns:['x','lat','title'],
|
||||
hiddenColumns:['x','lat','title','p'],
|
||||
columnsOrder:['lon','id','z','date', 'y', 'country'],
|
||||
columnsWidth:[
|
||||
{column:'id',width: 250}
|
||||
@ -108,7 +108,7 @@ test('delete-row' , function(){
|
||||
var view = new recline.View.SlickGrid({
|
||||
model: dataset,
|
||||
state: {
|
||||
hiddenColumns:['x','lat','title'],
|
||||
hiddenColumns:['x','lat','title','p'],
|
||||
columnsOrder:['lon','id','z','date', 'y', 'country'],
|
||||
columnsWidth:[
|
||||
{column:'id',width: 250}
|
||||
@ -154,7 +154,7 @@ test('delete-row-with-row-reorder-activated' , function(){
|
||||
var view = new recline.View.SlickGrid({
|
||||
model: dataset,
|
||||
state: {
|
||||
hiddenColumns:['x','lat','title'],
|
||||
hiddenColumns:['x','lat','title','p'],
|
||||
columnsOrder:['lon','id','z','date', 'y', 'country'],
|
||||
columnsWidth:[
|
||||
{column:'id',width: 250}
|
||||
@ -197,7 +197,7 @@ var dataset = Fixture.getDataset();
|
||||
var view = new recline.View.SlickGrid({
|
||||
model: dataset,
|
||||
state: {
|
||||
hiddenColumns:['x','lat','title'],
|
||||
hiddenColumns:['x','lat','title','p'],
|
||||
columnsOrder:['lon','id','z','date', 'y', 'country'],
|
||||
columnsWidth:[
|
||||
{column:'id',width: 250}
|
||||
@ -226,7 +226,7 @@ test('update', function() {
|
||||
var view = new recline.View.SlickGrid({
|
||||
model: dataset,
|
||||
state: {
|
||||
hiddenColumns:['x','lat','title'],
|
||||
hiddenColumns:['x','lat','title','p'],
|
||||
columnsOrder:['lon','id','z','date', 'y', 'country'],
|
||||
columnsWidth:[
|
||||
{column:'id',width: 250}
|
||||
|
||||
@ -19,6 +19,28 @@
|
||||
background-color: rgba(241, 128, 23, 0.6);
|
||||
}
|
||||
|
||||
/* IE 6-8 fallback colors */
|
||||
.leaflet-oldie .marker-cluster-small {
|
||||
background-color: rgb(181, 226, 140);
|
||||
}
|
||||
.leaflet-oldie .marker-cluster-small div {
|
||||
background-color: rgb(110, 204, 57);
|
||||
}
|
||||
|
||||
.leaflet-oldie .marker-cluster-medium {
|
||||
background-color: rgb(241, 211, 87);
|
||||
}
|
||||
.leaflet-oldie .marker-cluster-medium div {
|
||||
background-color: rgb(240, 194, 12);
|
||||
}
|
||||
|
||||
.leaflet-oldie .marker-cluster-large {
|
||||
background-color: rgb(253, 156, 115);
|
||||
}
|
||||
.leaflet-oldie .marker-cluster-large div {
|
||||
background-color: rgb(241, 128, 23);
|
||||
}
|
||||
|
||||
.marker-cluster {
|
||||
background-clip: padding-box;
|
||||
border-radius: 20px;
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
/* IE 6-8 fallback colors */
|
||||
.marker-cluster-small {
|
||||
background-color: rgb(181, 226, 140);
|
||||
}
|
||||
.marker-cluster-small div {
|
||||
background-color: rgb(110, 204, 57);
|
||||
}
|
||||
|
||||
.marker-cluster-medium {
|
||||
background-color: rgb(241, 211, 87);
|
||||
}
|
||||
.marker-cluster-medium div {
|
||||
background-color: rgb(240, 194, 12);
|
||||
}
|
||||
|
||||
.marker-cluster-large {
|
||||
background-color: rgb(253, 156, 115);
|
||||
}
|
||||
.marker-cluster-large div {
|
||||
background-color: rgb(241, 128, 23);
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
|
||||
-webkit-transition: -webkit-transform 0.25s ease-out, opacity 0.25s ease-in;
|
||||
-moz-transition: -moz-transform 0.25s ease-out, opacity 0.25s ease-in;
|
||||
-o-transition: -o-transform 0.25s ease-out, opacity 0.25s ease-in;
|
||||
transition: transform 0.25s ease-out, opacity 0.25s ease-in;
|
||||
-webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;
|
||||
-moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;
|
||||
-o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;
|
||||
transition: transform 0.3s ease-out, opacity 0.3s ease-in;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user