visjs / vis-network

:dizzy: Display dynamic, automatically organised, customizable network views.
https://visjs.github.io/vis-network/
Apache License 2.0
3k stars 367 forks source link

Font-awesome icons are not rendered in example page #1967

Open ax1 opened 1 year ago

ax1 commented 1 year ago

In the documentation at https://visjs.github.io/vis-network/examples/network/nodeStyles/customGroups.html the FA icons are not properly displayed. I changed to https:...fontawesome css in firefox and seemed to solve it but in chrome browser the problem is the same. Also tested using `document.addEventListener("DOMContentLoaded",...) in a local page but same results.

ax1 commented 1 year ago

issue #163 contains a link to https://visjs.github.io/vis-network/examples/network/nodeStyles/icons.html where fa-icons (v4 and v5) are displayed, I will try that code instead.

Anyway having a look/fix at the first URL would be great since we cannot pull-request to gh-pages (doc says that non-master PRs will be closed). The example pages are very convenient as templates.

Thanks.

ax1 commented 1 year ago

Ok, document.fonts.load('normal normal 400 24px/1 "FontAwesome"').then(paint).catch(console.error) solves the problem.

For those reading the issue, you can also use the newer fa version 5 in icons.html.

(I leave the issue as open for some days, just in case any contributor wants to update the customGroups example file.)

Steven0706 commented 1 year ago

https://jsfiddle.net/api/post/library/pure/ can someone please help fix this example? having the same issue but not sure how above solution can be applied to here.