Skip to content

Commit

Permalink
Update demos
Browse files Browse the repository at this point in the history
  • Loading branch information
jlord committed Mar 20, 2017
1 parent 21da950 commit aa6cc64
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 137 deletions.
53 changes: 18 additions & 35 deletions demos/demo-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,24 @@
<meta charset='utf-8'>
<title>Sheetsee Maps Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js'></script>
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,900,400italic|Source+Code+Pro:400' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" href="../favicon.png">
<script type='text/javascript' src='../js/tabletop1.3.4.js'></script>
<script type='text/javascript' src='../js/sheetsee.js'></script>
<link rel='stylesheet' type='text/css' href='http://api.tiles.mapbox.com/mapbox.js/v1.0.0/mapbox.css' />
<script src='https://cdnjs.cloudflare.com/ajax/libs/tabletop.js/1.5.1/tabletop.min.js'></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script type='text/javascript' src='../js/temp-maps.js'></script>
<link rel='stylesheet' type='text/css' href='../assets/style.css'>
</head>
<style>
#map, #shapesmap {max-width: 800px; height: 500px;}
.leaflet-popup-content li {list-style:none;}
#map {width: 800px; height: 500px; background: #CCF4FF;}
.leaflet-popup-content {width: 102px;}
.leaflet-popup-content img {width: 100px;}
a {border: none;}
</style>
<body>
<div class="container">
<h1>All Pennies Map</h1>
<p><em><a href="https://docs.google.com/a/github.com/spreadsheet/ccc?key=0Ao5u1U6KYND7dGN5QngweVJUWE16bTRob0d2a3dCbnc&usp=drive_web#gid=0" target="_blank">spreadsheet</a></em><p>
<div id="map"></div>
<p><em><a onClick='window.location="view-source:" + window.location.href'>View Source</a> // <a href="../docs/sheetsee-maps.html">View Documentation</a></em></p>
<h2>Using linestrings, polygons and multipolygons</h2>
<div id="shapesmap"></div>
<p><em><a onClick='window.location="view-source:" + window.location.href'>View Source</a> // <a href="https://docs.google.com/spreadsheets/d/1jOz6yFY5nIDre5RYtVROYPgIbkgh9lIddsyXo0-79_0/edit?usp=drive_web" target="_blank">View Spreadsheet</a></em></p>

<footer>
<h4 id="getting-started">Getting Started</h4>
Expand All @@ -40,13 +34,11 @@ <h4 id="ideas">Ideas</h4>
<ul>
<li><a href="../docs/fork-n-go.html">Fork-n-Go</a></li>
<li><a href="../docs/tips.html">Tips!</a></li>
<li><a href="../docs/custom-charts.html">Custom charts</a></li>
</ul>
<h4>Demos</h4>
<ul>
<li><a href="./demo-table.html">Table Demo</a></li>
<li><a href="./demo-map.html">Map Demo</a></li>
<li><a href="./demo-chart.html">Chart Demo</a></li>
</ul>
<h4 id="use">Use</h4>
<ul>
Expand All @@ -62,35 +54,26 @@ <h4 id="use">Contact</h4>
</ul>
<h4><a class="home-link" href="http://jlord.github.io/sheetsee.js">Home Page</a></h4>
</footer>
</div>

<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
var URL = "0Ao5u1U6KYND7dGN5QngweVJUWE16bTRob0d2a3dCbnc"
var URL2 = "1jOz6yFY5nIDre5RYtVROYPgIbkgh9lIddsyXo0-79_0"
Tabletop.init( { key: URL, callback: showInfo, simpleSheet: true } )
Tabletop.init( { key: URL2, callback: shapesMap, simpleSheet: true } )
var URL = '0Ao5u1U6KYND7dGN5QngweVJUWE16bTRob0d2a3dCbnc'
Tabletop.init({key: URL, callback: showInfo, simpleSheet: true})
})

function showInfo(data) {
var optionsJSON = ["placename", "photo-url"]
var template = "<ul><li><a href='{{photo-url}}' target='_blank'>"
+ "<img src='{{photo-url}}'></a></li>"
+ "<li><h4>{{placename}}</h4></li></ul>"
var geoJSON = Sheetsee.createGeoJSON(data, optionsJSON)
var map = Sheetsee.loadMap("map")
Sheetsee.addTileLayer(map, 'jllord.n7aml2bc')
Sheetsee.addMarkerLayer(geoJSON, map, template)
function showInfo (data) {
console.log(data)
var popup = "<a href='{{PhotoUrl}}' target='_blank'>"
+ "<img src='{{PhotoUrl}}'></a><h4>{{PlaceName}}</h4>"
var mapOptions = {
data: data,
mapDiv: 'map',
geoJSONincludes: ['PlaceName', 'PhotoUrl'],
template: popup
}
Sheetsee.loadMap(mapOptions)
}

function shapesMap(data) {
var opts = ['description']
var geojson = Sheetsee.createGeoJSON(data, opts)
var plytemplate = "<h4>{{description}}</h4>"
var shapesmap = Sheetsee.loadMap("shapesmap")
Sheetsee.addTileLayer(shapesmap, 'jllord.n7aml2bc')
Sheetsee.addMarkerLayer(geojson, shapesmap, plytemplate)
}

</script>
</body>
</html>
169 changes: 67 additions & 102 deletions demos/demo-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
<meta charset='utf-8'>
<title>Sheetsee Table Demo</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0'/>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js'></script>
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,900,400italic|Source+Code+Pro:400' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" href="../favicon.png">
<script type='text/javascript' src='../js/tabletop1.3.4.js'></script>
<script type='text/javascript' src='../js/sheetsee.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/tabletop.js/1.5.1/tabletop.min.js'></script>
<script type='text/javascript' src='../js/temp-tables.js'></script>
<link rel='stylesheet' type='text/css' href='../assets/style.css'>
</head>
<style>
Expand All @@ -18,108 +17,74 @@
.no-pag:hover {color: #acacac;}
input {border: none; border-bottom: 1px solid #333;margin: 10px 0px; width: 200px; font-size: 16px; padding-bottom: 6px;}
.tHeader {padding: 8px; cursor: pointer; text-align: left;}
.photo {display: inline-block; float: left; width: 100px;}
#photogrid {overflow: auto;}
</style>
<body>
<div class="container">
<h1>All Pennies</h1>
<p><em><a href="https://docs.google.com/a/github.com/spreadsheet/ccc?key=0Ao5u1U6KYND7dGN5QngweVJUWE16bTRob0d2a3dCbnc&usp=drive_web#gid=0" target="_blank">spreadsheet</a></em><p>
<input id="fullTableFilter" type="text" placeholder="filter by.."></input>
<div id="fullTable"></div>
<h1>California Pennies</h1>
<input id="calFilter" type="text" placeholder="filter by.."></input>
<div id="calTable"></div>
<h1>Pretty Pennies</h1>
<div id="photogrid"></div>
<p><em><a onClick='window.location="view-source:" + window.location.href'>View Source</a> // <a href="../docs/sheetsee-tables.html">View Documentation</a></em></p>
<body>
<div class="container">
<h1>All Pennies</h1>
<p><em><a href="https://docs.google.com/a/github.com/spreadsheet/ccc?key=0Ao5u1U6KYND7dGN5QngweVJUWE16bTRob0d2a3dCbnc&usp=drive_web#gid=0" target="_blank">spreadsheet</a></em><p>
<input id="fullTableFilter" type="text" placeholder="filter by.."></input>
<a class="clear">Clear</a>
<div id="fullTable"></div>
<p><em><a onClick='window.location="view-source:" + window.location.href'>View Source</a> // <a href="../docs/sheetsee-tables.html">View Documentation</a></em></p>

<footer>
<h4 id="getting-started">Getting Started</h4>
<ul>
<li><a href="../docs/about.html">About Sheetsee</a></li>
<li><a href="../docs/building.html">Building Sheetsee</a></li>
<li><a href="../docs/basics.html">Basics</a></li>
</ul>
<h4 id="ideas">Ideas</h4>
<ul>
<li><a href="../docs/fork-n-go.html">Fork-n-Go</a></li>
<li><a href="../docs/tips.html">Tips!</a></li>
<li><a href="../docs/custom-charts.html">Custom charts</a></li>
</ul>
<h4>Demos</h4>
<ul>
<li><a href="./demo-table.html">Table Demo</a></li>
<li><a href="./demo-map.html">Map Demo</a></li>
<li><a href="./demo-chart.html">Chart Demo</a></li>
</ul>
<h4 id="use">Use</h4>
<ul>
<li><a href="../docs/sheetsee-core.html">Sheetsee-core</a></li>
<li><a href="../docs/sheetsee-tables.html">Sheetsee-tables</a></li>
<li><a href="../docs/sheetsee-maps.html">Sheetsee-maps</a></li>
<li><a href="../docs/sheetsee-charts.html">Sheetsee-charts</a></li>
</ul>
<h4 id="use">Contact</h4>
<ul>
<li><a href="http://www.twitter.com/jllord">@jllord</a></li>
<li><a href="https://github.com/jlord/sheetsee.js/issues/new">File an issue</a></li>
</ul>
<h4><a class="home-link" href="http://jlord.github.io/sheetsee.js">Home Page</a></h4>
</footer>
</div>
<footer>
<h4 id="getting-started">Getting Started</h4>
<ul>
<li><a href="../docs/about.html">About Sheetsee</a></li>
<li><a href="../docs/building.html">Building Sheetsee</a></li>
<li><a href="../docs/basics.html">Basics</a></li>
</ul>
<h4 id="ideas">Ideas</h4>
<ul>
<li><a href="../docs/fork-n-go.html">Fork-n-Go</a></li>
<li><a href="../docs/tips.html">Tips!</a></li>
</ul>
<h4>Demos</h4>
<ul>
<li><a href="./demo-table.html">Table Demo</a></li>
<li><a href="./demo-map.html">Map Demo</a></li>
</ul>
<h4 id="use">Use</h4>
<ul>
<li><a href="../docs/sheetsee-core.html">Sheetsee-core</a></li>
<li><a href="../docs/sheetsee-tables.html">Sheetsee-tables</a></li>
<li><a href="../docs/sheetsee-maps.html">Sheetsee-maps</a></li>
<li><a href="../docs/sheetsee-charts.html">Sheetsee-charts</a></li>
</ul>
<h4 id="use">Contact</h4>
<ul>
<li><a href="http://www.twitter.com/jllord">@jllord</a></li>
<li><a href="https://github.com/jlord/sheetsee.js/issues/new">File an issue</a></li>
</ul>
<h4><a class="home-link" href="http://jlord.github.io/sheetsee.js">Home Page</a></h4>
</footer>
</div>

<script id="fullTable_template" type="text/html">
<table>
<tr><th class="tHeader">City</th><th class="tHeader">Place Name</th><th class="tHeader">Year</th><th class="tHeader">Image</th></tr>
{{#rows}}
<tr><td>{{city}}</td><td>{{placename}}</td><td>{{year}}</td><td>{{image}}</td></tr>
{{/rows}}
</table>
</script>
<script id="fullTable_template" type="text/html">
<table>
<tr><th class="tHeader">City</th><th class="tHeader">Place Name</th><th class="tHeader">Year</th><th class="tHeader">Image</th></tr>
{{#rows}}
<tr><td>{{City}}</td><td>{{PlaceName}}</td><td>{{Year}}</td><td>{{Image}}</td></tr>
{{/rows}}
</table>
</script>

<script id="calTable_template" type="text/html">
<table>
<tr><th class="tHeader">City</th><th class="tHeader">Place Name</th><th class="tHeader">Year</th><th class="tHeader">Image</th></tr>
{{#rows}}
<tr><td>{{city}}</td><td>{{placename}}</td><td>{{year}}</td><td>{{image}}</td></tr>
{{/rows}}
</table>
</script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
var URL = "0Ao5u1U6KYND7dGN5QngweVJUWE16bTRob0d2a3dCbnc"
Tabletop.init({key: URL, callback: showInfo, simpleSheet: true})
})

<script id="photogrid" type="text/html">
{{#rows}}
<div class=""><a href="{{photo-url}}" target="_blank"><img class="photo" src="{{photo-url}}" alt="name"></a></div>
{{/rows}}
</script>

<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
var URL = "0Ao5u1U6KYND7dGN5QngweVJUWE16bTRob0d2a3dCbnc"
Tabletop.init( { key: URL, callback: showInfo, simpleSheet: true } )
})

function showInfo(data) {
var tableOptions = {"data": data
, "pagination": 10, "tableDiv": "#fullTable", "filterDiv": "#fullTableFilter"}
Sheetsee.makeTable(tableOptions)
Sheetsee.initiateTableFilter(tableOptions)

var california = Sheetsee.getKeyword(data, "california")
var calOptions = { "data": california,
"pagination": 5,
"tableDiv": "#calTable",
"filterDiv": "#calFilter"
}
Sheetsee.makeTable(calOptions)
Sheetsee.initiateTableFilter(calOptions)

var html = Sheetsee.ich.photogrid({'rows': data})
$('#photogrid').html(html)
}


</script>

</body>
function showInfo (data) {
var tableOptions = {
"data": data,
"pagination": 10,
"tableDiv": "#fullTable",
"filterDiv": "#fullTableFilter"
}
Sheetsee.makeTable(tableOptions)
Sheetsee.initiateTableFilter(tableOptions)
}
</script>
</body>
</html>

0 comments on commit aa6cc64

Please sign in to comment.