-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REF/ENH: Add templates for ipynb, update requirements and dependencies
- Loading branch information
Showing
7 changed files
with
119 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,58 @@ | ||
<!DOCTYPE html> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | ||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" /> | ||
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script> | ||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" /> | ||
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script> | ||
|
||
{{ dvf_js }} | ||
{{ d3 }} | ||
{{ vega }} | ||
{{ jquery }} | ||
|
||
|
||
<style> | ||
|
||
#map { | ||
position:absolute; | ||
top:0; | ||
bottom:0; | ||
right:0; | ||
left:0; | ||
} | ||
|
||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
<div id="map" {{ size }}></div> | ||
<div id="{{ map_id }}" {{ size }}></div> | ||
|
||
<script> | ||
|
||
{{ vega_parse }} | ||
var map = L.map('map').setView([{{ lat }}, {{ lon }}], {{ zoom_level }}); | ||
|
||
var map = L.map('{{ map_id }}').setView([{{ lat }}, {{ lon }}], {{ zoom_level }}); | ||
|
||
L.tileLayer('{{ Tiles }}', { | ||
maxZoom: {{ max_zoom }}, | ||
attribution: '{{ attr }}' | ||
}).addTo(map); | ||
|
||
{% for mark, popup, add_mark in markers %} | ||
{{ mark }} | ||
{{ popup }} | ||
{{ add_mark }} | ||
{% endfor %} | ||
|
||
{% for line, add_line in lines %} | ||
{{ line }} | ||
{{ add_line }} | ||
{% endfor %} | ||
|
||
{{ lat_lng_pop }} | ||
|
||
{{ click_pop }} | ||
|
||
</script> | ||
|
||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script> | ||
|
||
var folium_event = new CustomEvent( | ||
"folium_libs_loaded", | ||
{bubbles: true, cancelable: true} | ||
); | ||
|
||
var load_folium_charts = function(){ | ||
window.dispatchEvent(folium_event); | ||
}; | ||
|
||
function load_folium_libs(){ | ||
console.log('Loading all Folium libraries...') | ||
$.getScript("http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js", function(){ | ||
load_folium_charts() | ||
}) | ||
|
||
if(typeof define === "function" && define.amd){ | ||
if (window['d3'] === undefined){ | ||
require.config( | ||
{paths: {d3: 'http://d3js.org/d3.v3.min'} | ||
} | ||
); | ||
require(["d3"], function(d3){ | ||
console.log('Loading from require.js...') | ||
window.d3 = d3; | ||
load_folium_libs(); | ||
}); | ||
} else { | ||
load_folium_libs(); | ||
} | ||
}else{ | ||
console.log('Require.js not found!'); | ||
throw "Require.js not found!" | ||
}; | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
<div id="{{ map_id }}" {{ size }}></div> | ||
|
||
<script> | ||
|
||
var make_plot = function(){ | ||
if (typeof L === 'undefined'){ | ||
window.addEventListener('leaflet_libs_loaded', make_plot) | ||
return; | ||
} | ||
|
||
var render_plot = (function(){ | ||
|
||
{{ vega_parse }} | ||
|
||
var map = L.map('{{ map_id }}').setView([{{ lat }}, {{ lon }}], {{ zoom_level }}); | ||
|
||
L.tileLayer('{{ Tiles }}', { | ||
maxZoom: {{ max_zoom }}, | ||
attribution: '{{ attr }}' | ||
}).addTo(map); | ||
|
||
{% for mark, popup, add_mark in markers %} | ||
{{ mark }} | ||
{{ popup }} | ||
{{ add_mark }} | ||
{% endfor %} | ||
|
||
{% for line, add_line in lines %} | ||
{{ line }} | ||
{{ add_line }} | ||
{% endfor %} | ||
|
||
{{ lat_lng_pop }} | ||
|
||
{{ click_pop }} | ||
|
||
})(); | ||
|
||
}; | ||
|
||
make_plot(); | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | ||
<script src="https://code.jquery.com/jquery-2.1.0.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<script src="http://trifacta.github.com/vega/vega.js"></script> | ||
<script src="http://trifacta.github.io/vega/vega.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Jinja2==2.6 | ||
Jinja2==2.7.2 |