We have added the gojs diagram in an Appian plugin.
my NodeDataArray :
nodes{
{
icon:“\uf1ad”
},
{
icon:“\uf013”
}}
I am trying to render the icon in a node like below,
$(go.TextBlock,
{
font:‘12pt FontAwesome’,
stroke:‘#000’,
margin:8
},
new go.Binding(“text”,“icon”)
),
When I try this code in a local JS file the icon is rendering on the go.js graph node.
But when I try to integrate the code in the Appian plugin the icon is not rendering.
But In appian when I try to give hardcorded value icon is rendering on the node, as per the below code.
My guess is that when you are putting your code in that Appian plugin the literal data is being “corrupted” because the escaping of the Unicode character in the string is broken. Your experiments have cleverly shown that once the string is correct in the GoJS model, everything works the way that you want.
Check that the model data’s data.icon property value really does have the character in it that you want as soon as the data arrives/exists for you to add to the GoJS model.
We debugged, the unicode value coming in the nodeArray is coming properly. But not showing as icon on node.
We are getting the unicode character from appian input, is there any way , so that the string will not break .Can you suggest any other way to display icon apart from Textblock using the same unicode value(or the actual icon name .Ex: ‘\uf1ad’ represents 'building")
I thought your earlier code showed that when the font was already loaded and myDiagram.model.nodeDataArray[0].icon.length === 1 the displayed text showed the desired icon.