Giter Club home page Giter Club logo

ferricyanide's Introduction

Ferricyanide

Integration

Molecular viewer targeting WebAssembly (WASM).

Ferricyanide is available under the MIT/Apache-2.0 licenses. It is based off of source code published by Chinedu Francis Nwafili. His project is used as an extendable base (most notably the canvas and shader systems).

Goals

This project has no real goals other than as an experiment in WASM and WebGL development. For this experiment, the following sub-goals should be followed.

Demonstration

A demo of ferricyanide is given here. It shows the conversion of a JSmol-based page into a page which uses the ferricyanide WASM application to visualize the molecules. The original site is displayed here. Note that this project was made by the developers of ferricyanide and may not utilize the best practices for deploying JSmol.

Extendability

Code size

Since WASM is the target, compiled code size is a consideration. Currently, the release mode .wasm file clocks in under 100Kb without compression, and ideally it should not grow beyond 500Kb. Therefore, features which add significant code size should be made optional using build configurations. Additionally, libraries which increase code-size significantly should be avoided.

How to build

First, install rustup for your respective operating system and make sure cargo is in your PATH. If you are on Linux or macOS, clone the project and built it using the following commands. On Windows, install wasm-pack and clone the directory.

curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
git clone https://github.com/frodofine/ferricyanide.git
cd ferricyanide

To build with cargo-make, use the following commands in the ferricyanide directory. Note that the use of cargo-make is optional, but this tool is recommended for development as cargo-make can host a local webserver and watch for changes as to rebuild the project automatically.

cargo install cargo-make
cargo make build
# Watch for changes in the source code and auto rebuild
cargo make watch

Alternatively, you can use wasm-pack directly. The --target web option causes ferricyanide to be built as an ES6 module without the need to use webpack to deploy the application in a browser. Other options are available and should be supported without modification to the Rust code. See the official documentation for details.

wasm-pack build --target web --out-name package

This will populate the pkg directory with files starting with package. These files are required to deploy the viewer on a server. You can host a local server with the following command:

cargo make start

If done in the default ferricyanide directory, then it will host a simple demo application at localhost:8000.

Why the name

Ferricyanide is a compound used in photo development to add a sepia tone. It is a Rust colored compound, so it's a perfect name for a package that visualizes molecules.

ferricyanide's People

Contributors

frodofine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

taisho

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.