是否可以将MathML添加到cytoscape.js中的节点?

时间:2015-08-24 20:57:55

标签: cytoscape.js

我正在努力为cytoscape.js中的节点添加一些数学运算。我可以通过从乳胶中截取屏幕截图来做到这一点,但由于它们是光栅化图像,所以它们不能很好地伸展。有没有办法在cytoscape.js中使用MathML?

谢谢

1 个答案:

答案 0 :(得分:0)

是!

步骤:

(1)使用MathJax(https://www.mathjax.org/

之类的东西为MathML生成SVG图像

(2)将SVG图像指定为节点的 Traceback (most recent call last): File "/Users/XX/PycharmProjects/Test_Proj/Comscore_connector.py", line 9, in <module> proxy = WSDL.Proxy(WSDLFILE) File "/Users/XXpython_projects/lib/python2.7/site-packages/SOAPpy/WSDL.py", line 85, in __init__ self.wsdl = reader.loadFromString(str(wsdlsource)) File "/Users/XX/python_projects/lib/python2.7/site-packages/wstools/WSDLTools.py", line 47, in loadFromString return self.loadFromStream(StringIO(data)) File "/Users/XX/python_projects/lib/python2.7/site-packages/wstools/WSDLTools.py", line 28, in loadFromStream document = DOM.loadDocument(stream) File "/Users/XX/python_projects/lib/python2.7/site-packages/wstools/Utility.py", line 645, in loadDocument return xml.dom.minidom.parse(data) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/minidom.py", line 1918, in parse return expatbuilder.parse(file) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/expatbuilder.py", line 928, in parse result = builder.parseFile(file) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile parser.Parse(buffer, 0) xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 6 Process finished with exit code 1

提示:您可能希望在样式表中使用函数映射器并使用缓存机制(例如lodash)使其更快(或者您将始终生成MathML SVG),例如:在样式表中:

background-image