jwass / mplleaflet

Easily convert matplotlib plots from Python into interactive Leaflet web maps.
BSD 3-Clause "New" or "Revised" License
521 stars 76 forks source link

Not JSON serializable #54

Open Deki4 opened 6 years ago

Deki4 commented 6 years ago

When attempting to plot matplotlib path and line collection I get the error "TypeError: Object of type 'int64' is not JSON serializable" because the collection is a numpy array.

I am able to fix this manually with a tolist() argument in the _display() module.

Was wondering if this will be addressed in a future release?

Thanks

rodrigolece commented 4 years ago

@Deki4 where exactly did you add the tolist() call?

I tried the line that throws the error in my case gjdata = json.dumps(renderer.geojson().tolist()) but that didn't work...