| |
@@ -62,7 +62,7 @@
|
| |
return self.members
|
| |
|
| |
def ask_byCountry(self,since=None):
|
| |
-
|
| |
+ ''' Depreciated'''
|
| |
print("Go for coffee...")
|
| |
#get all the msg since "since variable" to today
|
| |
baseurl = "https://apps.fedoraproject.org/datagrepper/raw?topic=org.fedoraproject.prod.askbot.post.edit"
|
| |
@@ -113,8 +113,11 @@
|
| |
|
| |
def plot_world2(self,title='Map', label='# Elements', filename='base_file', notebook=False):
|
| |
'''plot a fancy map with heat information '''
|
| |
- import plotly.plotly as py
|
| |
+ import plotly.graph_objs as gobj
|
| |
+ import pandas as pd
|
| |
from iso3166 import countries
|
| |
+ from plotly.offline import download_plotlyjs,init_notebook_mode,plot,iplot
|
| |
+ init_notebook_mode(connected=notebook)
|
| |
|
| |
ct = Counter(self.members.country_code.values.tolist())
|
| |
del ct[None]
|
| |
@@ -154,15 +157,17 @@
|
| |
showcountries = True,
|
| |
showcoastlines = False,
|
| |
projection = dict(
|
| |
- type = 'Mercator'
|
| |
+ type = 'natural earth'
|
| |
)
|
| |
)
|
| |
)
|
| |
- fig = dict( data=data, layout=layout )
|
| |
+
|
| |
+ fig = gobj.Figure(data = data,layout = layout)
|
| |
+
|
| |
if notebook:
|
| |
- return py.iplot(fig,filename=filename )
|
| |
+ return iplot(fig,filename=filename )
|
| |
else:
|
| |
- return py.plot(fig,filename=filename )
|
| |
+ return plot(fig,filename=filename )
|
| |
|
| |
|
| |
|
| |
Fixing old api problems