You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/basics.md
+28-19Lines changed: 28 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,39 @@
1
1
# Spreadsheets as Databases
2
2
3
-
Spreadsheets are a great _lightweight_database. Google Spreadsheets in particular are easy to work with and share, making this unlike most traditional database set ups. That being said, traditional databases are great for bigger, more secure jobs. If you're storing lots and lots and lots of information, or storing sensitive or complex information -- the spreadsheet is not for you. But if you're working on small to medium sized personal or community projects, try a spreadsheet!
3
+
Spreadsheets are a great _lightweight_databases. Google Spreadsheets in particular are easy to work with and share, making this unlike most traditional database setups. That being said, traditional databases are great for bigger, more secure jobs. If you're storing lots and lots and lots of information, or storing sensitive or complex information -- the spreadsheet is not for you. But if you're working on small to medium sized personal or community projects, try a spreadsheet!
4
4
5
5
## The Short & Sweet
6
6
7
-
1. Link to Sheetsee.js, [tabletop.js](https://github.com/jsoma/tabletop/) and [jquery](http://www.jquery.org) in your HTML head.
7
+
1. Link to Sheetsee.js, [tabletop.js](https://github.com/jsoma/tabletop/) and [jQuery](http://www.jquery.org) in your HTML head.
8
8
2. Create a place holder `<div>` in your HTML for any chart, map or table you want to have.
9
9
3. Create templates for tables in `<script>` tags.
10
-
4. Copy the script tag that waits for the document to load and then initializes tabletop and runs your functions when it's returned with the spreadsheet data.
11
-
6. Use the Sheetsee.js functions that you need for the maps, charts and tables you desire. Style it up with some CSS.
10
+
4. Inside of a `<script>` tag initialize Tabletop.js. It waits for the document to load and then initializes tabletop and calls back a function when it has returned with the spreadsheet data.
6. Define the function that Tabletop.js calls when it returns with the data. This function will contain all the Sheetsee.js functions that you use for the maps, charts and tables you desire. Style it up with some CSS.
19
+
```JAVASCRIPT
20
+
functioncallback(data) {
21
+
// All the sheetsee things you want to do!
22
+
}
23
+
```
12
24
5. Set it and forget. Now all you need to do is edit the spreadsheet and visitors will get the latest information every time they load the page.
13
25
14
26
## Bare Minimum Setup
15
27
16
-
Ignoring some HTML things to conserve space, you get the point. This gives you a page with a map of your spreadsheets points.
28
+
Ignoring some HTML things to conserve space, you get the point. This is a basic setup.
You must add a column to your spreadsheet with the heading _hexcolor_ (case insensitive). The maps, charts and such use colors and this is the easiest way to standardize that. The color scheme is up to you, all you need to do is fill the column with hexidecimal color values. This [color picker](http://color.hailpixel.com/) by [Devin Hunt](https://twitter.com/hailpixel) is really nice. #Funtip: Coloring the background of the cell it's hexcolor brings delight!
74
+
You must add a column to your spreadsheet with the heading _hexcolor_ (case insensitive). The maps, charts and such use colors and this is the easiest way to standardize that. The color scheme is up to you, all you need to do is fill the column with hexidecimal color values. This [color picker](http://color.hailpixel.com/) by [Devin Hunt](https://twitter.com/hailpixel) is really nice. #Funtip: Coloring the background of the cell it's hexcolor brings delight!
64
75
65
76
### Geocoding
66
77
67
78
If you intend to map your data and only have addresses you'll need to geocode the addresses into lat/long coordinates. Mapbox built a [plugin](http://mapbox.com/tilemill/docs/guides/google-docs/#geocoding)
68
79
that does this for you in Google Docs. You can also use websites like [latlong.net](http://www.latlong.net/) to get the coordinates and paste them into rows with column headers _lat_ and _long_.
You should have an address in a box at the bottom, your key is the portion between the = and the &. You'll retrieve this later when you hook up your site to the spreadsheet.
89
+
You should have an address in a box at the bottom, your key is the portion between the = and the &. You'll retrieve this later when you hook up your site to the spreadsheet._Actually, you technically can use the whole URL, but it's so long..._
Copy file name to clipboardExpand all lines: docs/tips.md
+33-6Lines changed: 33 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@ A few things to think about beyond charts, maps and tables.
4
4
5
5
## ICanHaz.js
6
6
7
-
You can use templates for more than just tables. Use them to create lists `ol`, `ul`; array of images... You'll need a placeholder `<div>` in your HTML, a `<script>` for your template and a script to call ICanHaz from your Tabletop.js callback.
7
+
You can use templates for more than just tables. Use them to create lists `ol`, `ul`; array of images... You'll need a placeholder `<div>` in your HTML, a `<script>` for your template and a script to call ICanHaz from your Tabletop.js callback. For a live example, see the bottom photo grid of the [sheetsee-table demo](../demos/demo-table.html).
@@ -64,6 +64,33 @@ With a some CSS and such, the resulting website has a table with the hack spots
64
64
65
65
When the page builds, it creates the correct link for each row. When someone clicks on the buttons it takes them directly to the Google Map search result for that address. BAM!
66
66
67
-
# IFTTT
67
+
##IFTTT
68
68
69
-
[Ifttt.com](http://www.ifttt.com) offers lots of options sending data from your actions (Twitter, Instagram, GitHub, Pocket...) to Google Spreadsheets.
69
+
[Ifttt.com](http://www.ifttt.com) offers lots of options sending data from your actions (Twitter, Instagram, GitHub, Pocket...) to Google Spreadsheets.
70
+
71
+
## Row Numbers
72
+
73
+
When Tabletop.js returns your spreadsheet data, it adds a key/value of `rownumber`. This is great to use when you need to uniquely match or find a row in your data.
74
+
75
+
## Images
76
+
77
+
Your spreadsheet can contain URLs to images which you can use to display the images on the page you build. Your template would look something like this:
78
+
79
+
```HTML
80
+
<imgsrc='{{imgurl}}'/>
81
+
```
82
+
83
+
## Data as Classes
84
+
85
+
You can use your data as classes to style with CSS. For instance, if you had data about recipes and a column called 'Taste' that contained either 'savory' or 'sweet'. In a table of the recipes you could do something like:
0 commit comments