Merge branch 'master' into gh-pages

Conflicts resolved:
	docs/tutorial-multiview.markdown
This commit is contained in:
Matt Fullerton 2015-05-02 20:35:52 +02:00
commit 4fb6c37c2e
19 changed files with 854 additions and 340 deletions

View File

@ -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)

View File

@ -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
View File

@ -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

File diff suppressed because one or more lines are too long

View File

@ -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]);

View File

@ -142,7 +142,7 @@ my.Pager = Backbone.View.extend({
&lt;div class="pagination"&gt; \
&lt;ul class="pagination"&gt; \
&lt;li class="prev action-pagination-update"&gt;&lt;a href="" class="btn btn-default"&gt;&amp;laquo;&lt;/a&gt;&lt;/li&gt; \
&lt;li class="page-range"&gt;&lt;a&gt;&lt;label for="from"&gt;From&lt;/label&gt;&lt;input name="from" type="text" value="{{from}}" /&gt; &amp;ndash; &lt;label for="to"&gt;To&lt;/label&gt;&lt;input name="to" type="text" value="{{to}}" /&gt; &lt;/a&gt;&lt;/li&gt; \
&lt;li class="page-range"&gt;&lt;a&gt;&lt;label for="from"&gt;From&lt;/label&gt;&lt;input id="from" name="from" type="text" value="{{from}}" /&gt; &amp;ndash; &lt;label for="to"&gt;To&lt;/label&gt;&lt;input id="to" name="to" type="text" value="{{to}}" /&gt; &lt;/a&gt;&lt;/li&gt; \
&lt;li class="next action-pagination-update"&gt;&lt;a href="" class="btn btn-default"&gt;&amp;raquo;&lt;/a&gt;&lt;/li&gt; \
&lt;/ul&gt; \
&lt;/div&gt; \

View File

@ -145,8 +145,8 @@ my.QueryEditor = Backbone.View.extend({
&lt;div class="input-group-addon"&gt; \
&lt;i class="glyphicon glyphicon-search"&gt;&lt;/i&gt; \
&lt;/div&gt; \
&lt;label&gt;Search&lt;/label&gt; \
&lt;input class="form-control search-query" type="text" name="q" value="{{q}}" placeholder="Search data ..."&gt; \
&lt;label for="q"&gt;Search&lt;/label&gt; \
&lt;input class="form-control search-query" type="text" id="q" name="q" value="{{q}}" placeholder="Search data ..."&gt; \
&lt;/div&gt; \
&lt;/div&gt; \
&lt;button type="submit" class="btn btn-default"&gt;Go &amp;raquo;&lt;/button&gt; \

View File

@ -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 -->

View File

@ -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

View File

@ -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]);

View File

@ -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;
}

View File

@ -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;

View File

@ -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({

View File

@ -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}

View File

@ -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;

View File

@ -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);
}

View File

@ -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