npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@aics/simularium-viewer

v3.9.1

Published

An npm package to view simulations.

Downloads

441

Readme

Simularium repositories

This repository is part of the Simularium project (simularium.allencell.org), which includes repositories:

  • simulariumIO - Python package that converts simulation outputs to the format consumed by the Simularium viewer website
  • simularium-engine - C++ backend application that interfaces with biological simulation engines and serves simulation data to the front end website
  • simularium-viewer - NPM package to view Simularium trajectories in 3D
  • simularium-website - Front end website for the Simularium project, includes the Simularium viewer

Node.js CI NPM Package Publish

Simularium Viewer

simularium-viewer is an NPM package to view simularium trajectories in 3D https://www.npmjs.com/package/@aics/simularium-viewer


Description

This viewer can visualize trajectories that are in Simularium format (see the file format documentation here). The viewer can operate in the following modes:

drag-and-drop
Drag a Simularium file into the window (WebGL) area of the viewer.

remote-streaming
Connect to a simularium-engine instance, and stream data through a web-socket connection.


Installation in your project

  1. npm i @aics/simularium-viewer
  2. In Viewer.jsx/tsx
import SimulariumViewer, { SimulariumController } from "@aics/simularium-viewer";
import "@aics/simularium-viewer/style/style.css";

const netConnectionSettings = {
    serverIp: "staging-node1-agentviz-backend.cellexplore.net",
    serverPort: 9002,
};

const simulariumController = new SimulariumController({
    trajectoryPlaybackFile: "ATPsynthase_9.h5",
    netConnectionSettings: netConnectionSettings,
});
class Viewer extends React.Component {

    public constructor(props) {
        super(props);
        this.viewerRef = React.createRef();

        this.state = {
                highlightId: -1,
                particleTypeIds: [],
                currentFrame: 0,
                currentTime: 0,
                hideAllAgents: false,
                showPaths: true,
                timeStep: 1,
                totalDuration: 100,
                }
    }

    handleTimeChange = (timeData) => {
        console.log(timeData)
    }

    handleJsonMeshData = (jsonData) => {
        console.log(jsonData)
    }
    onTrajectoryFileInfoChanged = (trajData) => {
        console.log(trajData)
    }

    render () {

        return (<SimulariumViewer
                    ref={this.viewerRef}
                    height={500}
                    width={500}
                    onTimeChange={this.handleTimeChange}
                    simulariumController={simulariumController}
                    onJsonDataArrived={this.handleJsonMeshData}
                    onTrajectoryFileInfoChanged={this.handleTrajectoryInfo}
                    highlightedParticleType={this.state.highlightId}
                    loadInitialData={true}
                    hideAllAgents={this.state.hideAllAgents}
                    showPaths={this.state.showPaths}
                />)
    }

Run an example app locally

  1. Run npm run install-examples to install the dependencies.
  2. Run npm start
  3. Navigate to http://localhost:8080/public/ - the / at the end is required

This will run the example in /examples/src/, demonstrating the viewer's functionality.


Quick Start

| script | comments | | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | build | create ES module build | | clean | remove generated artifacts | | generateTypes | generate type declarations | | lint | run eslint on src directory | | transpileES | run babel on src directory; do not transpile import/export statements for an ES module compatible build (used by bundlers for tree-shaking) | | test | run vitest; searches for any files matching the pattern "src/*/.test.js" | | typeCheck | run tsc in type-check only mode | | start | runs an example app from examples for testing. Runs at localhost:8080/public/. Use --localserver to run backend locally. With no flags, this script will default to using the staging octopus server as backend |


Development

See CONTRIBUTING.md for information related to developing the code.