Skip to content

prisms-center/CASMcode_casmvis

Repository files navigation

Overview for developers

This is a web application that is run on a user's local computer to help visualize CASM structures and data. It is built as a static site and included in the casm-project Python package. After installing casm-project, you can run the web application using the command:

casm-vis

This launches three server applications included in casm-project which are used to run the application locally:

  • casm-api-server: A server that provides an API for interacting with local CASM projects and data.
  • casm-bokeh-server: A server that provides Bokeh plots and visualizations.
  • casm-vis-server: The main web application server that serves the static files and provides the user interface.

It is expected that any state that is saved or modified while using the application is done by the casm-api-server server. This could create or modify CASM projects. State for the CASMvis application itself is expected to be stored in ~/.casmvis/.

Finally, casm-vis will open the web application in your default web browser. When casm-vis is killed, the servers will also be stopped.

Run in development mode

The casm-project package must be installed. First launch the two servers that the application depends on:

casm-api-server

casm-bokeh-server

Then run the web application in development mode:

npm run dev

The web application will be available at http://localhost:3000.

In development mode, the server URLs are read from a .env.local file in the project root (this file is gitignored and must be created manually). Create it with the server URLs matching your ~/.casmvis/config.json:

VITE_CASMVIS_API_SERVER=http://localhost:3001
VITE_CASMVIS_BOKEH_SERVER=http://localhost:3002

Configuration

The ports used for the servers can be configured by adding or modifying the `~/.casmvis/config.json file. The default configuration is:

{
  "CASMVIS_API_SERVER": "http://localhost:3001",
  "CASMVIS_BOKEH_SERVER": "http://localhost:3002",
  "CASMVIS_SERVER": "http://localhost:3000"
}

Note that the CASMVIS_SERVER port only configures the port used by the web application when it is launched using casm-vis. If you run the web application using npm run dev, it will always use port 3000 as configured in vite.config.ts.

Build

The following command builds the web application as a static site for use in casm-project.

npm run build

The output will be placed in the src/dist directory. When the built distribution is updated, it can be copied into the CASMcode_project repository as casm/vis/dist.

About

CASM visualizations app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors