Generally, ready() should be used only for things that rely on async things from init happening first before your ready() code, but that doesn't seem to be the case here:
[ ] The setting of the container dimensions should be done in CSS or in the style attribute of the container itself.
[ ] The cyj ref should be defined at the top scope of the file rather than in ready(), and the cyj value can be assigned the return value of calling cytoscape().
[ ] Fitting options should be set in the init layout options.
Generally,
ready()
should be used only for things that rely on async things from init happening first before yourready()
code, but that doesn't seem to be the case here:https://github.com/cytoscape/cyjShiny/blob/9a69ccb2a399465a136811a99f4f8d62c1b40379/inst/browserCode/src/cyjShiny.js#L37-L47
cyj
ref should be defined at the top scope of the file rather than inready()
, and thecyj
value can be assigned the return value of callingcytoscape()
.