Git Product home page Git Product logo

molstar-svelte's Introduction

Molstar Svelte Library

A collection of Svelte components for Mol*-based visualizations

build status badge deploy status badge publish status badge

Goals

  • Provide a set of composable components that can be used to build web applications, websites or components enabling visualization and analysis of biomolecular structures.
  • Provide a set of examples of how to use the components in a Svelte application.
  • Keep the components as simple as possible, and let the user decide how to use them.
  • The goal is not to redo the Molstar Viewer in Svelte.
  • The goal is not to provide a full set of components with extensive Molstar API coverage, but rather a set of building blocks (and examples/inspirations) that can be used to build a custom application.

The components are designed to be used in a Svelte or SvelteKit application. They could be also be used in any framework that supports Web Components (later).

Please Note!

This package is still in early development, and the API is not stable. Until it reaches version 1.0.0, breaking changes may be introduced in any versions.

Pin your dependencies if you're bold enough to use it! (and drop me a message, I'd really love to hear about it!).

Usage, Getting Started, Documentation, Showcase

https://0gust1.github.io/molstar-svelte/

See the dedicated Get started page.

Feedback, issues, contributions, questions

Feel free to initiate a discussion in the Repository Discussions or Repository Issues.

Library Development

Install the dependencies...

# we use npm ci to install the pinned dependencies from package-lock.json
npm ci 
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

Everything inside src/lib is part of the library, everything inside src/routes is used to generate the documentation/showcase/e2e website.

Building

To build the library:

npm run package

To build the library and create a production version of the documentation/showcase app:

npm run build

You can preview the production build with npm run preview.

Updating the documentation/showcase website

Website/doc deployment is done through github actions, on push on master

Publishing on npmjs.com

Publishing is done through github actions, on release creation on master.

Licensing and attributions

molstar-svelte is licensed under the MIT License.

Mol*:

David Sehnal, Sebastian Bittrich, Mandar Deshpande, Radka Svobodová, Karel Berka, Václav Bazgier, Sameer Velankar, Stephen K Burley, Jaroslav Koča, Alexander S Rose:
Mol* Viewer: modern web app for 3D visualization and analysis of large biomolecular structures, Nucleic Acids Research, 2021; 10.1093/nar/gkab31.
In memory of Jaroslav Koča.

molstar-svelte's People

Contributors

0gust1 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

molstar-svelte's Issues

Figure out what to test and how

The actual project has a test execution pipeline that is ready and hooked into the CI.

Example tests are present (and running), but they don't add much value right now (phony/placeholder tests).

  • playwright is ready for e2e tests
  • vitest is ready for Unit/integration tests

Ideally, E2E tests should be implemented as soon as possible, when the functional/feature coverage of the library would be clearer.

Right now I guess that the e2e testing would be roughly:

  • load a showcase website page
  • target an example, click some UI controls & do things
  • access the component's Molstar instance and assert the actions effects.
  • possibly take screenshots and compare with previous run (not fan of theses approaches, very brittle in practice)

Feature: ability to load an AlphaFold structure and display visually the plddt score

The standard Molstar Viewer (React-based) does this, but in a way that is not compatible with the current library technology (Svelte) and approach (composable components toolbox).

Refs:

Figure out the wrappers config API

At the hearth of the lib, there are wrapper components whose responsibility is to:

  • initialize molstar
  • handle the <canvas>
  • and make the molstar instance available to subcomponents (through setContext() and getContext()).

In order to do some custom things, like implementing custom Themes/coloring (example: AlphaFold plddt confidence), the molstar instance should register custom "presets" (molstar concept is still unclear right now), at the right time, before an attempted usage.

Decide if we really need two slots on the wrapper component

The wrapper component actually has 2 slots: inside and outside.

The reason is mostly to offer the user enough options to place its own components around the molstar <canvas>.
Typically, the inside slot would be useful for any UI element that should be placed "over" the molstar canvas (the parent has a position:relative CSS behavior.

But in fact those two slot may complexify the API for the user. Further tests with various layouts are needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.