[refactor][s]: rename view-flot-graph to view-graph and FlotGraph to Graph.
This commit is contained in:
@@ -45,7 +45,7 @@
|
|||||||
<script type="text/javascript" src="../src/backend/localcsv.js"></script>
|
<script type="text/javascript" src="../src/backend/localcsv.js"></script>
|
||||||
<script type="text/javascript" src="../src/view.js"></script>
|
<script type="text/javascript" src="../src/view.js"></script>
|
||||||
<script type="text/javascript" src="../src/view-grid.js"></script>
|
<script type="text/javascript" src="../src/view-grid.js"></script>
|
||||||
<script type="text/javascript" src="../src/view-flot-graph.js"></script>
|
<script type="text/javascript" src="../src/view-graph.js"></script>
|
||||||
<script type="text/javascript" src="../src/view-map.js"></script>
|
<script type="text/javascript" src="../src/view-map.js"></script>
|
||||||
<script type="text/javascript" src="../src/view-transform-dialog.js"></script>
|
<script type="text/javascript" src="../src/view-transform-dialog.js"></script>
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ function standardViews(dataset) {
|
|||||||
{
|
{
|
||||||
id: 'graph',
|
id: 'graph',
|
||||||
label: 'Graph',
|
label: 'Graph',
|
||||||
view: new recline.View.FlotGraph({
|
view: new recline.View.Graph({
|
||||||
model: dataset
|
model: dataset
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ also easily write your own). Each view holds a pointer to a Dataset:</p>
|
|||||||
<li>DataExplorer: the parent view which manages the overall app and sets up
|
<li>DataExplorer: the parent view which manages the overall app and sets up
|
||||||
sub views.</li>
|
sub views.</li>
|
||||||
<li>DataGrid: the data grid view.</li>
|
<li>DataGrid: the data grid view.</li>
|
||||||
<li>FlotGraph: a simple graphing view using <a
|
<li>Graph: a simple graphing view using <a
|
||||||
href="http://code.google.com/p/flot/">Flot</a>.</li>
|
href="http://code.google.com/p/flot/">Flot</a>.</li>
|
||||||
<li>Map: a map view using <a href="http://leaflet.cloudmade.com/">Leaflet</a>.</li>
|
<li>Map: a map view using <a href="http://leaflet.cloudmade.com/">Leaflet</a>.</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -271,7 +271,7 @@ are useful:</p>
|
|||||||
<li><a href="docs/model.html">Models</a></li>
|
<li><a href="docs/model.html">Models</a></li>
|
||||||
<li><a href="docs/view.html">DataExplorer View (plus common view code)</a></li>
|
<li><a href="docs/view.html">DataExplorer View (plus common view code)</a></li>
|
||||||
<li><a href="docs/view-grid.html">DataGrid View</a></li>
|
<li><a href="docs/view-grid.html">DataGrid View</a></li>
|
||||||
<li><a href="docs/view-flot-graph.html">Graph View (based on Flot)</a></li>
|
<li><a href="docs/view-graph.html">Graph View (based on Flot)</a></li>
|
||||||
<li><a href="docs/view-map.html">Map View (based on Leaflet)</a></li>
|
<li><a href="docs/view-map.html">Map View (based on Leaflet)</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|||||||
2
make
2
make
@@ -13,7 +13,7 @@ def docs():
|
|||||||
print("** Building docs")
|
print("** Building docs")
|
||||||
|
|
||||||
docco_executable = os.environ.get('DOCCO_EXECUTABLE','docco')
|
docco_executable = os.environ.get('DOCCO_EXECUTABLE','docco')
|
||||||
cmd = '%s src/model.js src/view.js src/view-grid.js src/view-flot-graph.js src/view-map.js' % (docco_executable)
|
cmd = '%s src/model.js src/view.js src/view-grid.js src/view-graph.js src/view-map.js' % (docco_executable)
|
||||||
os.system(cmd)
|
os.system(cmd)
|
||||||
if os.path.exists('/tmp/recline-docs'):
|
if os.path.exists('/tmp/recline-docs'):
|
||||||
shutil.rmtree('/tmp/recline-docs')
|
shutil.rmtree('/tmp/recline-docs')
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ this.recline.View = this.recline.View || {};
|
|||||||
//
|
//
|
||||||
// NB: should *not* provide an el argument to the view but must let the view
|
// NB: should *not* provide an el argument to the view but must let the view
|
||||||
// generate the element itself (you can then append view.el to the DOM.
|
// generate the element itself (you can then append view.el to the DOM.
|
||||||
my.FlotGraph = Backbone.View.extend({
|
my.Graph = Backbone.View.extend({
|
||||||
|
|
||||||
tagName: "div",
|
tagName: "div",
|
||||||
className: "data-graph-container",
|
className: "data-graph-container",
|
||||||
@@ -34,7 +34,7 @@ this.recline.View = this.recline.View || {};
|
|||||||
//
|
//
|
||||||
// **el**: (required) DOM element to bind to. NB: the element already
|
// **el**: (required) DOM element to bind to. NB: the element already
|
||||||
// being in the DOM is important for rendering of some subviews (e.g.
|
// being in the DOM is important for rendering of some subviews (e.g.
|
||||||
// FlotGraph).
|
// Graph).
|
||||||
//
|
//
|
||||||
// **views**: (optional) the dataset views (Grid, Graph etc) for
|
// **views**: (optional) the dataset views (Grid, Graph etc) for
|
||||||
// DataExplorer to show. This is an array of view hashes. If not provided
|
// DataExplorer to show. This is an array of view hashes. If not provided
|
||||||
@@ -52,7 +52,7 @@ this.recline.View = this.recline.View || {};
|
|||||||
// {
|
// {
|
||||||
// id: 'graph',
|
// id: 'graph',
|
||||||
// label: 'Graph',
|
// label: 'Graph',
|
||||||
// view: new recline.View.FlotGraph({
|
// view: new recline.View.Graph({
|
||||||
// model: dataset
|
// model: dataset
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<script type="text/javascript" src="../src/view.js"></script>
|
<script type="text/javascript" src="../src/view.js"></script>
|
||||||
<script type="text/javascript" src="../src/view-grid.js"></script>
|
<script type="text/javascript" src="../src/view-grid.js"></script>
|
||||||
<script type="text/javascript" src="../src/view-transform-dialog.js"></script>
|
<script type="text/javascript" src="../src/view-transform-dialog.js"></script>
|
||||||
<script type="text/javascript" src="../src/view-flot-graph.js"></script>
|
<script type="text/javascript" src="../src/view-graph.js"></script>
|
||||||
<script type="text/javascript" src="view-grid.test.js"></script>
|
<script type="text/javascript" src="view-grid.test.js"></script>
|
||||||
<script type="text/javascript" src="view-graph.test.js"></script>
|
<script type="text/javascript" src="view-graph.test.js"></script>
|
||||||
<script type="text/javascript" src="view.test.js"></script>
|
<script type="text/javascript" src="view.test.js"></script>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
module("View - FlotGraph");
|
module("View - Graph");
|
||||||
|
|
||||||
test('basics', function () {
|
test('basics', function () {
|
||||||
var dataset = Fixture.getDataset();
|
var dataset = Fixture.getDataset();
|
||||||
var view = new recline.View.FlotGraph({
|
var view = new recline.View.Graph({
|
||||||
model: dataset
|
model: dataset
|
||||||
});
|
});
|
||||||
$('.fixtures').append(view.el);
|
$('.fixtures').append(view.el);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ test('menu - hideColumn', function () {
|
|||||||
assertPresent('.column-header[data-field="x"]');
|
assertPresent('.column-header[data-field="x"]');
|
||||||
var hideColumn = view.el.find('.column-header[data-field="x"] a[data-action="hideColumn"]');
|
var hideColumn = view.el.find('.column-header[data-field="x"] a[data-action="hideColumn"]');
|
||||||
hideColumn.trigger('click');
|
hideColumn.trigger('click');
|
||||||
assertNotPresent('.column-header[data-field="x"]');
|
assertNotPresent('.column-header[data-field="x"]', view.el);
|
||||||
|
|
||||||
// also test a bit of state
|
// also test a bit of state
|
||||||
deepEqual(view.state.toJSON(), {hiddenFields: ['x']});
|
deepEqual(view.state.toJSON(), {hiddenFields: ['x']});
|
||||||
|
|||||||
Reference in New Issue
Block a user