datahub/index.html

246 lines
11 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Recline DataExplorer</title>
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="vendor/bootstrap/2.0.0/css/bootstrap.css" />
<link rel="stylesheet" href="http://opendatahandbook.org/en/_static/bootstrap-sphinx.css" />
<style type="text/css">
html, body {
background-color: #eee;
}
body {
padding-top: 40px; /* 40px to make the container go all the way to the bottom of the topbar */
}
.content {
background-color: #fff;
padding: 20px;
margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
-webkit-border-radius: 0 0 6px 6px;
-moz-border-radius: 0 0 6px 6px;
border-radius: 0 0 6px 6px;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.page-header {
background-color: #f5f5f5;
padding: 20px 20px 10px;
margin: -20px -20px 20px;
}
.page-header h1 {
font-size: 30px;
}
</style>
</head>
<body>
<a href="http://github.com/okfn/recline"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 100000;" src="https://a248.e.akamai.net/assets.github.com/img/7afbc8b248c68eb468279e8c17986ad46549fb71/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub"></a>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="#">Recline Data Explorer</a>
<ul class="nav">
<li><a href="demo/">Demo</a></li>
<li><a href="#docs">Docs</a></li>
<li><a href="http://github.com/okfn/recline/">Code on GitHub</a></li>
<li><a href="http://github.com/okfn/recline/issues">Issues</a></li>
</ul>
<a class="nav-logo pull-right" href="http://okfn.org/" title="An Open Knowledge Foundation Project">
<img src="http://assets.okfn.org/p/okfn/img/logo_28x30.png" alt="Open Knowledge Foundation logo" />
</a>
<ul class="nav" style="float: right;">
<li><a href="http://twitter.com/maxogden">@maxogden</a></li>
<li><a href="http://twitter.com/rufuspollock">@rufuspollock</a></li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="content">
<div class="page-header">
<h1>
Recline Data Explorer <small>Powerful, extensible JS grid/spreadsheet built on <a href="http://backbonejs.org/">Backbone</a></small>
</h1>
</div>
<h4>Recline combines a data grid, Google Refine-style data transforms
and visualizations all in lightweight javascript and html.</h4>
<p>Designed for standalone use or as a library to integrate into your own
app. Recline builds on the powerful but lightweight Backbone framework
making it extremely easy to extend and adapt.</p>
<h2 id="features">Main Features</h2>
<ul>
<li>View and edit your data in a clean grid / table interface</li>
<li>Bulk update/clean your data using an easy scripting UI</li>
<li>Easily extensible with new Backends so you can connect to your
database or storage layer</li>
<li>Visualize data</li>
<li>Open-source, pure javascript and designed for integration -- so it is
easy to embed in other sites and applications</li>
<li>Built on the simple but powerful <a
href="http://documentcloud.github.com/backbone/">Backbone</a> giving a
clean and robust design which is easy to extend</li>
<li>Properly designed model with clean separation of data and presentation</li>
<li>Componentized design means you use only what you need</li>
</ul>
<h2>Screenshots</h2>
<img src="http://farm8.staticflickr.com/7020/6847468031_0f474de5f7_b.jpg" alt="Recline Data Explorer Screenshot" style="width: 700px; display: block; margin-bottom: 30px;" />
<h2 id="demo">Demo</h2>
<p><a href="demo/index.html" class="btn">For Recline Demo Click Here &raquo;</a></p>
<h2 id="downloads">Downloads & Dependencies <small>(Right-click, and use 'Save As')</small></h2>
<p><a href="recline.js" class="btn">Recline Current Version (v0.3) &raquo;</a></p>
<h3>Dependencies</h3>
<p>Javascript Libraries:</p>
<ul>
<li>Jquery >= 1.6</li>
<li>Underscore and Backbone (0.5.1)</li>
<li>JQuery Mustache</li>
<li>(Optional) JQuery Flot - for graphing</li>
</ul>
<p><strong>CSS</strong>: the demo utilizes bootstrap but you can integrate with your own HTML and CSS. Data Explorer specific CSS can be found here in the repo: <a href="https://github.com/okfn/recline/tree/master/css">https://github.com/okfn/recline/tree/master/css</a>.</p>
<h2 id="docs">Documentation</h2>
<h3 id="using">Quickstart</h3>
<pre>
// Note: you should have included the relevant JS libraries (and CSS)
// See above for dependencies
// Dataset is a Backbone model so the first hash become model attributes
var dataset = recline.Model.Dataset({
id: 'my-id'
},
// Either a backend instance or string id for a backend in the registry
backend
);
// DataExplorer is a Backbone View
var explorer = recline.View.DataExplorer({
model: dataset,
// you can specify any element to bind to in the dom
el: $('.data-explorer-here')
});
// Start Backbone routing (if you want routing support)
Backbone.history.start();
</pre>
<p>More details and examples: see docs below and the <a
href="demo/">Demo</a> -- just hit view source (NB: the javascript for the
demo is in: <a href="demo/js/app.js">app.js</a>).</p>
<h3 id="doc-concepts">Architecture and Model</h3>
<p>Recline has a simple structure layered on top of the basic Model/View
distinction inherent in Backbone. There are the following two main domain objects (both Backbone Models):</p>
<ul>
<li>Dataset: represents the dataset. Holds dataset info and a pointer to list of data items (Documents in our terminology) which it can load from the relevant Backend.</li>
<li>Document: an individual data item (e.g. a row from a relational database or a spreadsheet, a document from from a document DB like CouchDB or MongoDB).</li>
</ul>
<p>More detail of how these work can be found in the <a href="docs/model.html">Model source docs</a>.</p>
<p><strong>Backends</strong> connect Dataset and Documents to data
from a specific 'Backend' data source. They provide methods for loading and
saving Datasets and individuals Documents as well as for bulk loading via a
query API and doing bulk transforms on the backend. More <a
href="#doc-backends">info on backends can be found below</a>.</p>
<p>Complementing the model are various Views (you can easily write your own). Each view holds a pointer to a Dataset:</p>
<ul>
<li>DataExplorer: the parent view which manages the overall app and sets up sub views.</li>
<li>DataGrid: the data grid view.</li>
<li>FlotGraph: a simple graphing view using <a href="http://code.google.com/p/flot/">Flot</a>.</li>
</ul>
<h3 id="doc-backends">Backends</h3>
<p>Backends are connectors to backend data sources from which data can be retrieved.</p>
<p>Backends are implemented as Backbone models but this is just a convenience
(they do not save or load themselves from any remote source). You can see
detailed examples of backend implementation in the source documentation
below.</p>
<p>A backend <em>must</em> implement two methods:</p>
<pre>
sync(method, model, options)
query(dataset, queryObj)
</pre>
<h4>sync(method, model, options)</h4>
<p>This is an implemntation of Backbone.sync and is used to override
Backbone.sync on operations for Datasets and Documents which are using this
backend.</p>
<p>For read-only implementations you will need only to implement read method
for Dataset models (and even this can be a null operation). The read method
should return relevant metadata for the Dataset. We do not require read support
for Documents because they are loaded in bulk by the query method.</p>
<p>For backends supporting write operations you must implement update and
delete support for Document objects.</p>
<p>All code paths should return an object conforming to the jquery promise
API.</p>
<h4>query(dataset, queryObj)</h4>
<p>Query the backend for documents returning them in bulk. This method will be
used by the Dataset.query method to search the backend for documents,
retrieving the results in bulk. This method should also set the docCount
attribute on the dataset.</p>
<p><code>queryObj</code> should be either a recline.Model.Query object or a
Hash. The structure of data in the Query object or Hash should follow that
defined in <a href="http://github.com/okfn/recline/issues/34">issue 34</a>. (Of
course, if you are writing your own backend, and hence have control over the
interpretation of the query object, you can use whatever structure you
like).</p>
<h3>Source Docs (via Docco)</h3>
<ul>
<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-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/backend/memory.html">Backend: Memory (local data)</a></li>
<li><a href="docs/backend/elasticsearch.html">Backend: ElasticSearch</a></li>
<li><a href="docs/backend/dataproxy.html">Backend: DataProxy</a></li>
<li><a href="docs/backend/gdocs.html">Backend: Google Docs (Spreadsheet)</a></li>
</ul>
<h2 id="tests">Tests</h2>
<p><a href="test/index.html">Run the tests online</a>.</p>
<h2 id="history">History</h2>
<p>Max Ogden was developing Recline as the frontend data browser and editor
for his <a href="http://datacouch.com/">http://datacouch.com/</a> project.
Meanwhile, Rufus Pollock and the <a href="http://ckan.org/">CKAN team</a>
at the <a href="http://okfn.org/">Open Knowledge Foundation</a> had been
working on a <a href="http://github.com/okfn/dataexplorer">Data
Explorer</a> for use in <a href="http://thedatahub.org">the DataHub</a>
and <a href="http://ckan.org/">CKAN software</a>.</p>
<p>When they met up, they realized that they were pretty much working on
the same thing and so decided to join forces to produce the new Recline
Data Explorer.</p>
<p>The new project forked off <a
href="https://github.com/maxogden/recline">Max's original recline
codebase</a> combining some portions of the <a
href="http://github.com/okfn/dataexplorer">original Data Explorer</a>.
However, it has been rewritten from the ground up using Backbone.</p>
</div>
</div>
</body>
</html>