molstar icon indicating copy to clipboard operation
molstar copied to clipboard

Suggestion/Request: public concatStructures method like NGL

Open ljmartin opened this issue 1 year ago • 3 comments

There's a great example of a docking-viewer app that comes up pretty regularly. My understanding is that this requires building and hosting the applet. In NGL, this is not so since a user can concatStructures after loading NGL from a CDN.

I don't know the work involved, but it would be useful if one could do the same with Molstar. As a use-case example, I wrote a small app (not being a frontend dev in any way) that I think has several advantages: chiefly, the app isn't hosted on a server, so confidential structures can be loaded and kept in-browser. It all relies on the concatStructures method. All the best and thanks for Molstar (and NGL)!

ljmartin avatar Jan 24 '24 19:01 ljmartin

Something like this indeed does come up quite often.

Perhaps a suitable workaround for now would be to include the loadStructuresFromUrlsAndMerge in the default viewer app (apps/viewer). This way the method would be accessible from JS as well. Would you be ok with making a PR with this?

dsehnal avatar Jan 28 '24 04:01 dsehnal

Sure thing. Is is suitable to add this to molstar/src/apps/viewer/app.ts? Similar to this existing example: https://github.com/molstar/molstar/blob/22e5c9d65b2714bc6e59713361d8a39200ee0508/src/apps/viewer/app.ts#L230

ljmartin avatar Jan 29 '24 01:01 ljmartin

Sure thing. Is is suitable to add this to molstar/src/apps/viewer/app.ts?

Yes!

arose avatar Mar 24 '24 17:03 arose