nomnoml
nomnoml copied to clipboard
Weightless associations causes error with "direction: right"
Weightless edges, e.g. _>
, cause the diagram to appear empty. Here's a simple example
nomnoml::nomnoml('
[foo]->[bar]
[foo]_>[baz]
')
In R this renders as an empty page, whereas online it appears like this
If I pop the diagram out into the browser, there are errors in the javascript console
Uncaught TypeError: can't access property "forEach", t.points is undefined
undo http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/graphre-0.1.3/graphre.js:2902
undo http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/graphre-0.1.3/graphre.js:2909
layout http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/graphre-0.1.3/graphre.js:3791
B http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/graphre-0.1.3/graphre.js:1038
layout http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/graphre-0.1.3/graphre.js:3790
layout http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/graphre-0.1.3/graphre.js:3929
B http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/graphre-0.1.3/graphre.js:1038
layout http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/graphre-0.1.3/graphre.js:3509
B http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/graphre-0.1.3/graphre.js:1038
layout http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/graphre-0.1.3/graphre.js:3429
layoutCompartment http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/nomnoml-1.4.0/nomnoml.js:994
layout http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/nomnoml-1.4.0/nomnoml.js:1099
parseAndRender http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/nomnoml-1.4.0/nomnoml.js:2992
draw http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/nomnoml-1.4.0/nomnoml.js:3007
resizeCanvas http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/nomnoml-binding-0.2.5/nomnoml.js:35
renderValue http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/nomnoml-binding-0.2.5/nomnoml.js:84
renderValue http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/htmlwidgets-1.5.4/htmlwidgets.js:886
staticRender http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/htmlwidgets-1.5.4/htmlwidgets.js:653
forEach http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/htmlwidgets-1.5.4/htmlwidgets.js:55
staticRender http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/htmlwidgets-1.5.4/htmlwidgets.js:576
forEach http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/htmlwidgets-1.5.4/htmlwidgets.js:55
staticRender http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/htmlwidgets-1.5.4/htmlwidgets.js:574
maybeStaticRenderLater http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/htmlwidgets-1.5.4/htmlwidgets.js:698
<anonymous> http://localhost:25130/session/viewhtml17d6d3b7c4dc4/lib/htmlwidgets-1.5.4/htmlwidgets.js:705
graphre.js:2902:13
I just realized that it's the direction: right
directive that's causing the problem. There's an open issue in the upstream nomnoml repo: https://github.com/skanaar/nomnoml/issues/160
The upstream issue is still open. I'm going to pull in a newer version of nomnoml.js
but this is unlikely to fix.
Weightless edges have now been removed from nomnoml.js
https://github.com/skanaar/nomnoml/issues/160#issuecomment-1556214365