cytoscape / cyjShiny

An R/shiny widget for cytoscape.js
Other
92 stars 28 forks source link

Possible to Avoid Build Using Pre-Built CDN Versions? #31

Closed cannin closed 3 years ago

cannin commented 3 years ago

Is it possible to avoid the build using a version from here: https://js.cytoscape.org/#getting-started/including-cytoscape.js (example: https://www.jsdelivr.com/package/npm/cytoscape?path=dist)

paul-shannon commented 3 years ago

@cannin Thanks for this suggestion, Augustin. I found this too, and tried it out. It works, and works with great simplicity, for many uses. But some of the more-or-less standard layout algorithms are omitted. I asked Max about this, and he said that drawing the line -- deciding what libraries to include, which to leave out - was never a simple task.

I hope that our GSoC staffer, @Dharna5599, can find a no-webpack means to build cyjShiny with the library you point to, along with a modest set of extension libraries which provide us a good functional minimum.

Make sense?

cannin commented 3 years ago

Yes makes sense. I'm curious, what were the "must haves" that you needed that were missing from CDN version? I understand the need for a "core" CDN version. But maybe we can petition Gary and Max to put a more "complete" version on CDN. Projects like Bootstrap have "bundle" version with extra components (https://getbootstrap.com/docs/4.0/getting-started/contents/).

paul-shannon commented 3 years ago

@cannin - good idea.
My "must haves" was reached without much thought. I noticed that some layout algorithms were missing.

Dharna (@Dharna5599) figured out how to add these to the single file bundle.js. I have asked her to document the process.

To do justice to "must haves" perhaps we should identify a set of target networks and operations? With input from the broader community? Then have those drive the definition of standard cyjs plugins.

Dharna5599 commented 3 years ago

@paul-shannon, I have done the documentation part which you asked for. Kindly review it.

paul-shannon commented 3 years ago

@cannin, @Dharna5599

I just created branch abandonWebPack-try2, ready for you to try. I removed all webpack files, use the latest cytoscape.js.min (version 3.18.2) in the simplest htmlwidget directory structure:

cyjShiny/inst/htmlwidgets/
       cyjShiny.js
       cyjShiny.yaml
       lib/cyjShiny.jss
           cytoscape-3.18.2-min.js

These steps set you up to run this version:

git checkout abandonWebPack-try2
make install
make test
make demo  

With the demo, open up the javascript console, and try all of the layouts. You will see that several of them are missing. Augustin, you suggested we approach Max and Gary, see if they could add these missing layouts to the standard build.

Max was sympathetic to this idea a year or more ago, but argued it was a slippery slope. Maybe you (Augustin) could contact them, see if they now might be able to help out?

paul-shannon commented 3 years ago

@cannin This is now solved. See the htmlwidget directory, its yaml file, and the layout libraries included there. webpack is not needed yet plugins are easy to add. I cribbed this approach from https://github.com/unistbig/shinyCyJS