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

glvis

v0.6.3

Published

A lightweight WebGL tool for accurate and flexible finite element visualization

Downloads

11

Readme

GLVis JavaScript Library

Using Emscripten GLVis can be built as a JavaScript & WebAssembly library.

A fully-featured web version of GLVis is available at https://glvis.org/live with documentation in live/README.md.

Using a pre-built version of the glvis.js library

A pre-built JavaScript library is included at src/glvis.js, but because of its size it is stored using Git's Large File Storage, git-lfs.

To use the pre-built library, e.g. with the examples in the examples/ directory, or with the web version in the live/ directory, you need first to enable git-lfs on your system, see the instructions on the git-lfs page.

For example, a simple run with the pre-built library can be executed on a Mac from scratch with:

brew install git-lfs
git lfs install
git clone [email protected]:GLVis/glvis-js.git
cd glvis-js/examples
open basic.html

Building glvis.js

  1. Install Emscripten

    [git clone https://github.com/emscripten-core/emsdk.git]
    cd emsdk
    git pull
    ./emsdk install latest
    ./emsdk activate latest
    source "/path/to/emsdk/emsdk_env.sh"
  2. Get copies of glvis and mfem

    git clone [email protected]:mfem/mfem.git
    git clone [email protected]:GLVis/glvis.git
  3. Clone included submodules

    git clone --recurse-submodules [email protected]:GLVis/glvis-js.git

    If you've already cloned you can pull submodules with:

    git submodule update --init --recursive
  4. Get a copy of OpenSans.ttf and put it in the GLVis root directory. For example

    cd glvis-js
    curl -s -o ../glvis/OpenSans.ttf https://raw.githubusercontent.com/google/fonts/master/apache/opensans/OpenSans-Regular.ttf
  5. Build:

    make realclean # or just clean if you don't want to rebuild mfem
    make install -j
  6. Patch glvis.js (temporary):

    Edit src/glvis.js and add return 0; to the top of _JSEvents_requestFullscreen (see Known Issues)

NOTE: Emscripten handles SDL2 and GLEW but if you have another installation in your path the link might fail.

Serving to a device on your local network

The serve make target allows you to serve your local glvis-js to other devices on your network.

For example, on a Mac:

  1. First, get your IP address:

    ipconfig getifaddr en0

    or alternatively your hostname:

    hostname -s
  2. Then, serve glvis-js to all devices in your local network:

    make serve
  3. Any device in your network can now connect to {your IP address}:8000 or {hostname}:8000 to use the local version of glvis-js. On the local host, you can also use localhost:8000.

Contributing

Please run make style before pushing your changes. make style uses prettier and requires that you have npx in your path. prettier will be installed for you when running make style if you don't already have it.

Updating glvis.js

  1. Use make install to build and install a new glvis.js and versions.js to src/

  2. Please add the output of make versions to the commit body.

Releasing

  1. Update the version: npm version <update_type>

    • <update_type> is one of patch, minor, or major
  2. npm login

  3. npm publish

More info here.

Known issues and limitations

  • Opening new examples results in memory growth

  • Fullscreen events captured by the Emscripten Module are difficult to control

    • _JSEvents_requestFullscreen in glvis.js takes over the whole screen
      • For now we patch this to be a noop
      • Setting a noop with emscripten_set_fullscreenchange_callback doesn't seem to do it
    • _emscripten_set_canvas_element_size and __set_canvas_element_size print errors and duplicate some existing behavior
  • Lots of console warnings

TODO

  • Multiple output windows
    • MFEM stream with multiple fields causes the visualizations to write over each other
  • Improve the I/O e.g. corresponding to key F6
  • Improve experience on mobile devices with touch interfaces
  • Allow for screenshots/printing with S/Ctr-P, see https://github.com/GLVis/pyglvis/issues/5
  • Provide easier ways to generate *.saved files
  • Support Binary streams
  • Browser differences
    • Fullscreen in Safari
    • Help menu overflow in Safari and Firefox
  • Secure websockets