Error on saving interactive plot to HTML: UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f50d' in position 3366: character maps to <undefined>
igorkf opened this issue · 3 comments
Hello. First of all, this library is amazing!
I am trying to save the interactive plot to HTML, but I am getting this error:
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f50d' in position 3366: character maps to <undefined>
It seems this Unicode char is a LEFT-POINTING MAGNIFYING GLASS:
https://www.fileformat.info/info/unicode/char/1f50d/index.htm
And I think this error in happening because I set enable_search=True
, which includes a search box with a magnifying glass symbol on it:
plot = datamapplot.create_interactive_plot(
coords,
df['group'].values,
hover_text=hover_data,
cluster_boundary_polygons=False,
color_cluster_boundaries=False,
enable_search=True
)
plot.save('datamapplot.html')
plot
However, when setting enable_search=False
, the HTML is saved fine.
P.S.: I am using Windows 10.
Hmm, I have not seen that issue on systems I've used (it seems to accept the magnifying glass just fine). Perhaps I can make the icon/character user settable. In the meantime you can solve the problem by editing these lines in your installation and simply replacing the magnifying glass character with something that will save correctly on your system (just the text "enter search query here" would do for example).
Hmm, I have not seen that issue on systems I've used (it seems to accept the magnifying glass just fine). Perhaps I can make the icon/character user settable. In the meantime you can solve the problem by editing these lines in your installation and simply replacing the magnifying glass character with something that will save correctly on your system (just the text "enter search query here" would do for example).
Thanks for the quick reply.
Just changed the magnifying glass to something like "Search: " and worked fine.
Thanks!