Does the KNIME 3.6
org.knime.js.core.node.AbstractSVGWizardNodeModel class support the customCSS for the exported SVG image?
Thanks in advance.
yes and no. On the Java side you are all set if you implement the CSSModifiable interface and save/load the CSS string into your node’s config with the setCssStyles() and getCssStyles() methods. It’s important to have it as a field in your config, so that this field will also show up in the flow variables tab of the node’s dialog. Once you have that, a view that you open up on your node should already respect any additional styling that is applied.
However to make the CSS also appear in the generated SVG of your node, you need to call
in your getSVG() function before serialising the SVG element to a string.
Hope this helps. Let me know if you need any additional help.
Thank you Christian
I didn’t notice the existence of that method in
knimeService, so I wrote my own code to extract CSS roles from document and add them to svg element: it worked but custom CSS roles were missing.
knimeService.inlineSvgStyles() method, user CSS roles are included too!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.