Rich-Text in Nodes

<span =“Apple-tab-span” style=“white-space:pre”> Is there any way by which I can add RichText to Node in GoJs.

Thanks in advance.

We support the styling of TextBlocks by setting the font property, but we do not support arbitrary rich text (ie, you cannot have a single TextBlock sentence where the middle word is bolded, but the rest is not)

The font property must be a valid CSS string describing a font. The font string can accept several CSS properties but they must be in a specific order in order to render correctly across all browsers:

“font-style font-variant font-weight font-size font-family”

For example, “Italic small-caps bold 32px Georgia, Serif” is a valid font string using every CSS font property. For more information about CSS font syntax, see CSS fonts.

Any update on this feature ?

Sorry, no, we have not had time to implement some sort of styled text display.

Is rich text feature on your roadmap? If yes, when are you planning to release it?

It is not currently being worked on. Could you describe exactly what the functionality would be? How would you want to use it – what API would you want to use?

Our product has a requirement to add a rich text or render HTML into nodes. Typically we use an open source TinyMCE in our application for editing text. Is it any way that it would be possible to render HTML into TextBlock?

No, a TextBlock just shows text, not HTML. If it did support HTML we wouldn’t be able to render it to PNG or JPG or SVG, and performance would be much worse when showing thousands of nodes.

Note that it should be relatively easy to use TinyMCE as a text editor, by implementing a custom text editor: TextEditingTool and GoJS HTML Interaction -- Northwoods Software.

However that does not change the rendering supported by TextBlock, which must be of a single style.

Is it some changes?

I need only 2 features:

  1. write some Lists, like this

    1. List item
    2. List item
    3. List item
  2. Change part of text, like this
    bold Italic normal

is it possible now or are you planning to implement it?

Not yet. I can’t commit to any future feature, especially since we’re near to releasing 2.0 beta, which does not have this feature but might offer a new feature by which one could implement something like this with a lot of work.

For people finding this topic, we have a demo of HTML rendered using SVG and foreignObject: Rich Text Rendering