I used font awesome icon for the text shown in screenshot as icon=“fa fa-asterisk”.
I already gone through Icons sample, Icons GoJS Sample and I couldn’t find an icon that I need. It will be helpful if you can provide me a code sample to achieve my requirement.
Most people just use a Picture there, showing whatever SVG they want, or else just a Shape, again showing whatever SVG path string or arbitrarily-constructed Geometry that they want.
As shown in above screenshot I need to show font awesome asterisk icon in my double tree node just before the text. Tree node shown in above screenshot is created using a different technology. I used below html element to add the font awesome icon
Here class name tells the icon name to be shown and title shows the tooltip and you can color code the icon.
I want to know whether GOJS supports font awesome icons, I mean provide class name and node should render the icon.
Reason for asking is, I want the icons to be consistent at all places and it will be very easy tomorrow if I want to change it to a different icon.
Yes, it should work to have a TextBlock whose TextBlock.font is a “Font Awesome” font and whose TextBlock.text is a single-character string if you want to show a single icon.
But I really think it is more natural, and it is certainly more flexible, if you use either a Shape or a Picture to show whatever icon you like to the left of the general text string in a TextBlock. Get Started with GoJS.