share a graph facebook
This commit is contained in:
@@ -4598,7 +4598,35 @@ def workout_view(request,id=0):
|
||||
res = interactive_chart(id)
|
||||
script = res[0]
|
||||
div = res[1]
|
||||
|
||||
|
||||
# create map
|
||||
f1 = row.csvfilename
|
||||
u = row.user.user
|
||||
r = getrower(u)
|
||||
rowdata = rdata(f1)
|
||||
hascoordinates = 1
|
||||
if rowdata != 0:
|
||||
try:
|
||||
latitude = rowdata.df[' latitude']
|
||||
if not latitude.std():
|
||||
hascoordinates = 0
|
||||
except KeyError,AttributeError:
|
||||
hascoordinates = 0
|
||||
|
||||
else:
|
||||
hascoordinates = 0
|
||||
|
||||
|
||||
if hascoordinates:
|
||||
mapscript,mapdiv = leaflet_chart(rowdata.df[' latitude'],
|
||||
rowdata.df[' longitude'],
|
||||
row.name)
|
||||
|
||||
|
||||
else:
|
||||
mapscript = ""
|
||||
mapdiv = ""
|
||||
|
||||
|
||||
# render page
|
||||
if (len(g)<=3):
|
||||
@@ -4609,6 +4637,8 @@ def workout_view(request,id=0):
|
||||
'first_name':u.first_name,
|
||||
'interactiveplot':script,
|
||||
'aantalcomments':aantalcomments,
|
||||
'mapscript':mapscript,
|
||||
'mapdiv':mapdiv,
|
||||
'teams':get_my_teams(request.user),
|
||||
'the_div':div})
|
||||
else:
|
||||
@@ -4620,6 +4650,8 @@ def workout_view(request,id=0):
|
||||
'first_name':u.first_name,
|
||||
'teams':get_my_teams(request.user),
|
||||
'aantalcomments':aantalcomments,
|
||||
'mapscript':mapscript,
|
||||
'mapdiv':mapdiv,
|
||||
'interactiveplot':script,
|
||||
'the_div':div})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user