Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to FontAwesome v5 #9

Closed
asongtoruin opened this issue Nov 15, 2018 · 2 comments · Fixed by #10
Closed

Update to FontAwesome v5 #9

asongtoruin opened this issue Nov 15, 2018 · 2 comments · Fixed by #10

Comments

@asongtoruin
Copy link
Contributor

asongtoruin commented Nov 15, 2018

Hello,

Thanks for creating this module, it's really useful and pretty straightforward to use.

One thing I've noticed is that the module currently uses FontAwesome v4.7.0, with the latest version of FA being v5.5.0. It'd be nice to be able to use the latest set of icons and updating the equivalence should be relatively straightforward through the cheatsheet they provide, but the download is now (I believe since 5.0) split into three .otf files - "solid", "regular" and "brands". I see there being two ways to deal with this:

  1. Pick one of the new three to have as the main reference. The "regular" is I think meant to be the most similar to the old icons, but the "solid" is the most complete.
  2. Keep all three and either:
    1. Add an extra parameter to choose which of the three icon sets to use (e.g. icon_set as a string).
    2. Rename the icon lookups to include which set they come from, and ensure the user only uses icons from one set.

I am happy to work on a PR for this based on your preference. I think 2i would work best (and might start looking at implementing it), but will defer to your judgement. There may also be some compatibility issues with name changes, but I think it's worth it for the wider set of icons available.

Thanks,

Adam

@gyli
Copy link
Owner

gyli commented Nov 21, 2018

Thank you for bringing this up. I will update FontAwesome version shortly.

@asongtoruin
Copy link
Contributor Author

Above is a PR based around 2i from the above suggestions. It seems to work fairly well though I haven't been able to check it extensively. Here's a chart based on one of the examples given for the module and the new icon set

Example waffle chart using democrat and reuplican icons

Generated using:

fig = plt.figure(
    FigureClass=Waffle, 
    rows=5, 
    values=data, 
    colors=("#232066", "#983D3D", "#DCB732"),
    legend={'loc': 'upper left', 'bbox_to_anchor': (1, 1)},
    icons=['democrat', 'republican', 'person-booth'], icon_size=12, 
    icon_legend=True
)

@gyli gyli closed this as completed in #10 Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants