You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.
Hi,
I am building a website using DJango and need to generate some maps. I have created the map using vincent in the following manner:
state_topo = r'us_states.topo.json'
geo_data = [{'name': 'states','url': state_topo,'feature': 'us_states.geo'}]
vis = vincent.Map(data=gdf, geo_data=geo_data, scale=800,projection='albersUsa', data_bind='MENTIONS', data_key='STATE',map_key={'states': 'properties.NAME'}, brew='RdPu')
vis.scales[0].type='threshold'
vis.scales[0].domain = list(domain)
vis.legend(title='Mentions')
Is there any way I can return this map as an HttpResponse, similar to what we do for matplotlib charts:
buffer = StringIO.StringIO()
canvas = pylab.get_current_fig_manager().canvas
canvas.draw()
pilImage = PIL.Image.fromstring("RGB", canvas.get_width_height(), canvas.tostring_rgb())
pilImage.save(buffer, "PNG")
pylab.close()
return HttpResponse(buffer.getvalue(), content_type="image/png")
?
The text was updated successfully, but these errors were encountered: