Skip to content

Commit 76afaec

Browse files
committed
Merge pull request #359 from BibMartin/try_branca
Try branca dependency
2 parents f7675a6 + 2d332bc commit 76afaec

26 files changed

+77
-1948
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ before_install:
1616
- travis_retry conda create --yes -n test python=$PYTHON --file requirements.txt
1717
- source activate test
1818
- conda install --yes --file requirements-dev.txt;
19+
- pip install git+https://github.com/python-visualization/branca.git@a27055b3a9bd823a917a9a9847efac8dbd590238
1920
- if [[ "$PYTHON" == "3.4" ]]; then
2021
travis_retry conda install --yes nbconvert jupyter_client ipykernel;
2122
conda install --yes -c ioos geopandas;

examples/Colormaps.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"import sys\n",
3232
"sys.path.append('..')\n",
3333
"import folium\n",
34+
"import branca\n",
3435
"print (folium.__file__)\n",
3536
"print (folium.__version__)"
3637
]
@@ -142,7 +143,7 @@
142143
},
143144
"outputs": [],
144145
"source": [
145-
"import folium.colormap as cm"
146+
"import branca.colormap as cm"
146147
]
147148
},
148149
{
@@ -747,7 +748,7 @@
747748
"name": "python",
748749
"nbconvert_exporter": "python",
749750
"pygments_lexer": "ipython3",
750-
"version": "3.4.3"
751+
"version": "3.5.1"
751752
}
752753
},
753754
"nbformat": 4,

examples/Features.ipynb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
},
2222
"outputs": [],
2323
"source": [
24+
"import branca\n",
2425
"import folium\n",
2526
"from folium import features"
2627
]
@@ -94,7 +95,7 @@
9495
}
9596
],
9697
"source": [
97-
"f = folium.element.Figure(figsize=(8,8))\n",
98+
"f = branca.element.Figure(figsize=(8,8))\n",
9899
"m = folium.Map([0,0], zoom_start=1)\n",
99100
"mk = features.Marker([0,0])\n",
100101
"pp = features.Popup(\"hello\")\n",
@@ -137,7 +138,7 @@
137138
}
138139
],
139140
"source": [
140-
"f = folium.element.Figure()\n",
141+
"f = branca.element.Figure()\n",
141142
"m = folium.Map([0,0], zoom_start=1)\n",
142143
"mk = features.RegularPolygonMarker([0,0])\n",
143144
"mk2 = features.RegularPolygonMarker([0,45])\n",
@@ -187,7 +188,7 @@
187188
"scatter = vincent.Scatter(multi_iter2, iter_idx='x', height=100, width=200)\n",
188189
"data = json.loads(scatter.to_json())\n",
189190
"\n",
190-
"f = folium.element.Figure()\n",
191+
"f = branca.element.Figure()\n",
191192
"m = folium.Map([0,0], zoom_start=1)\n",
192193
"mk = features.Marker([0,0])\n",
193194
"p = features.Popup(\"Hello\")\n",
@@ -238,7 +239,7 @@
238239
"scatter = vincent.Scatter(multi_iter2, iter_idx='x', height=400, width=600)\n",
239240
"data = json.loads(scatter.to_json())\n",
240241
"\n",
241-
"f = folium.element.Figure()\n",
242+
"f = branca.element.Figure()\n",
242243
"v = features.Vega(data, height=40, width=600)\n",
243244
"f.add_children(v)\n",
244245
"\n",
@@ -283,7 +284,7 @@
283284
"scatter = vincent.Scatter(multi_iter2, iter_idx='x', height=250, width=420)\n",
284285
"data = json.loads(scatter.to_json())\n",
285286
"\n",
286-
"f = folium.element.Figure()\n",
287+
"f = branca.element.Figure()\n",
287288
"\n",
288289
"# Create two maps\n",
289290
"m = folium.Map([0,0], tiles='stamenwatercolor',\n",
@@ -441,7 +442,7 @@
441442
"scatter = vincent.Scatter(multi_iter2, iter_idx='x', height=250, width=420)\n",
442443
"data = json.loads(scatter.to_json())\n",
443444
"\n",
444-
"f = folium.element.Figure()\n",
445+
"f = branca.element.Figure()\n",
445446
"\n",
446447
"d1 = f.add_subplot(1,2,1)\n",
447448
"d2 = f.add_subplot(1,2,2)\n",

examples/GeoJSON and choropleth.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@
436436
}
437437
],
438438
"source": [
439-
"from folium.colormap import linear\n",
439+
"from branca.colormap import linear\n",
440440
"\n",
441441
"colormap = linear.YlGn.scale(\n",
442442
" unemployment.Unemployment.min(),\n",
@@ -871,7 +871,7 @@
871871
"name": "python",
872872
"nbconvert_exporter": "python",
873873
"pygments_lexer": "ipython3",
874-
"version": "3.4.4"
874+
"version": "3.5.1"
875875
}
876876
},
877877
"nbformat": 4,

examples/ImageOverlay.ipynb

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -22,50 +22,12 @@
2222
},
2323
"outputs": [],
2424
"source": [
25-
"import sys"
26-
]
27-
},
28-
{
29-
"cell_type": "code",
30-
"execution_count": 5,
31-
"metadata": {
32-
"collapsed": true
33-
},
34-
"outputs": [],
35-
"source": [
36-
"sys.path.insert(0,'..')"
37-
]
38-
},
39-
{
40-
"cell_type": "code",
41-
"execution_count": 6,
42-
"metadata": {
43-
"collapsed": true
44-
},
45-
"outputs": [],
46-
"source": [
47-
"import folium"
48-
]
49-
},
50-
{
51-
"cell_type": "code",
52-
"execution_count": 7,
53-
"metadata": {
54-
"collapsed": true
55-
},
56-
"outputs": [],
57-
"source": [
58-
"from folium.six import PY3"
59-
]
60-
},
61-
{
62-
"cell_type": "code",
63-
"execution_count": 8,
64-
"metadata": {
65-
"collapsed": false
66-
},
67-
"outputs": [],
68-
"source": [
25+
"import sys\n",
26+
"sys.path.insert(0,'..')\n",
27+
"\n",
28+
"from branca.six import PY3\n",
29+
"\n",
30+
"import folium\n",
6931
"from folium import plugins"
7032
]
7133
},

examples/Popups.ipynb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"import sys\n",
2828
"sys.path.insert(0,'..')\n",
2929
"import folium\n",
30+
"import branca\n",
3031
"print (folium.__file__)\n",
3132
"print (folium.__version__)"
3233
]
@@ -222,7 +223,7 @@
222223
" </code>\n",
223224
" </p>\n",
224225
" \"\"\"\n",
225-
"iframe = folium.element.IFrame(html=html, width=500, height=300)\n",
226+
"iframe = branca.element.IFrame(html=html, width=500, height=300)\n",
226227
"popup = folium.Popup(iframe, max_width=2650)\n",
227228
"\n",
228229
"folium.Marker([30,-100], popup=popup).add_to(m)\n",
@@ -265,11 +266,11 @@
265266
],
266267
"source": [
267268
"# Let's create a Figure, with a map inside.\n",
268-
"f = folium.element.Figure()\n",
269+
"f = branca.element.Figure()\n",
269270
"folium.Map([-25,150], zoom_start=3).add_to(f)\n",
270271
"\n",
271272
"# Let's put the figure into an IFrame.\n",
272-
"iframe = folium.element.IFrame(width=500, height=300)\n",
273+
"iframe = branca.element.IFrame(width=500, height=300)\n",
273274
"f.add_to(iframe)\n",
274275
"\n",
275276
"# Let's put the IFrame in a Popup\n",
@@ -299,21 +300,21 @@
299300
],
300301
"metadata": {
301302
"kernelspec": {
302-
"display_name": "Python 3",
303+
"display_name": "Python 2.7",
303304
"language": "python",
304-
"name": "python3"
305+
"name": "py27"
305306
},
306307
"language_info": {
307308
"codemirror_mode": {
308309
"name": "ipython",
309-
"version": 3
310+
"version": 2
310311
},
311312
"file_extension": ".py",
312313
"mimetype": "text/x-python",
313314
"name": "python",
314315
"nbconvert_exporter": "python",
315-
"pygments_lexer": "ipython3",
316-
"version": "3.5.1"
316+
"pygments_lexer": "ipython2",
317+
"version": "2.7.11"
317318
}
318319
},
319320
"nbformat": 4,

examples/folium_examples.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"import sys\n",
1212
"sys.path.insert(0,'..')\n",
1313
"import folium\n",
14+
"import branca\n",
1415
"#import pandas as pd\n",
1516
"#folium.initialize_notebook()"
1617
]
@@ -414,7 +415,7 @@
414415
"df = pd.read_csv(county_data, na_values=[' '])\n",
415416
"\n",
416417
"\n",
417-
"colorscale = folium.colormap.linear.YlOrRd.scale(0,50e3)\n",
418+
"colorscale = branca.colormap.linear.YlOrRd.scale(0,50e3)\n",
418419
"employed_series = df.set_index('FIPS_Code')['Employed_2011']\n",
419420
"\n",
420421
"def style_function(feature):\n",
@@ -458,7 +459,7 @@
458459
}
459460
],
460461
"source": [
461-
"colorscale = folium.colormap.linear.YlGnBu.scale(0,30)\n",
462+
"colorscale = branca.colormap.linear.YlGnBu.scale(0,30)\n",
462463
"employed_series = df.set_index('FIPS_Code')['Unemployment_rate_2011']\n",
463464
"\n",
464465
"def style_function(feature):\n",
@@ -502,7 +503,7 @@
502503
}
503504
],
504505
"source": [
505-
"colorscale = folium.colormap.linear.PuRd.scale(0,100000)\n",
506+
"colorscale = branca.colormap.linear.PuRd.scale(0,100000)\n",
506507
"employed_series = df.set_index('FIPS_Code')['Median_Household_Income_2011'].dropna()\n",
507508
"\n",
508509
"def style_function(feature):\n",

folium/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
MarkerCluster, MultiPolyLine, PolyLine, Vega,
1313
RegularPolygonMarker, TopoJson, WmsTileLayer)
1414

15-
import folium.colormap as colormap
16-
1715
__version__ = '0.3.0.dev'
1816

1917
__all__ = ['Map',
@@ -27,7 +25,6 @@
2725
'Popup',
2826
'TileLayer',
2927
'ClickForMarker',
30-
'colormap',
3128
'CustomIcon',
3229
'DivIcon',
3330
'GeoJson',

0 commit comments

Comments
 (0)