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

devesh-main-vim-webgl-component

v0.0.4

Published

A demonstration app built on top of the vim-webgl-viewer

Downloads

3

Readme

Vim Webgl Component

Documentation

API Documentation

Live Demo

About The Project

The VIM WebGL Component is an open-source high-performance 3D model viewer and BIM inspector that specializes in loading extremely large AEC (Architectural/Engineering/Construction) models represented as VIM files.

The VIM file format is a high-performance 3D scene format that supports rich BIM data, and can be easily extended to support other relational or non-relation data sets.

Unlike IFC the VIM format is already tessellated, and ready to render. This results in very fast load times. Unlike glTF the VIM format is faster to load, scales better, and has a consistent structure for relational BIM data.

More information on the vim format can be found here: https://github.com/vimaec/vim

Intents:

  • Provide a smooth online user experience while browsing complex bim data.
  • Test and demonstrate the capabilities of the underlying vim-webgl-viewer.
  • Be easy to use, extend and customize for other developpers.

Built With

Getting Started

  1. Clone the project.
  2. Open the project in VS Code.
  3. Install packages by running npm install.
  4. Run the dev command to start a live test server.

Make sure you have a recent version of NodeJS installed as Vite requires it.

How To

Customize Inputs

// Define the new input scheme.
class MyScheme implements VIM.InputScheme {
  default: VIM.DefaultInputScheme

  constructor (viewer: VIM.Viewer) {
    this.default = new VIM.DefaultInputScheme(viewer)
  }

  onMainAction (hit: VIM.InputAction): void {
    console.log('Custom click message')
    this.default.onMainAction(hit)
  }

  // Idle action is called when the mouse is idle for a certain delay
  onIdleAction (hit: VIM.InputAction): void {
    console.log('Idle action is disabled')
    // Because we are not calling default
  }

  onKeyAction (key: number): boolean {
    switch (key) {
      case VIM.KEYS.KEY_SPACE: {
        console.log('Space bar is disabled.')
        // Because we are not calling default
        return true
      }
    }
    return this.default.onKeyAction(key)
  }
}

createVimComponent((cmp: VimComponentRef) => {
  cmp.viewer.loadVim('https://vim.azureedge.net/samples/residence.vim')
  // Override the viewer input scheme.
  cmp.viewer.inputs.scheme = new MyScheme(cmp.viewer)
})

Customize Context Menu

createVimComponent((cmp: VimComponentRef) => {
  cmp.viewer.loadVim('https://vim.azureedge.net/samples/residence.vim')
  cmp.customizeContextMenu((menu) => [
    // Keep existing menu
    ...menu,
    // Append a divider
    {
      id: 'custom-divier',
      enabled: true
    },
    // Append a custom button
    {
      action: () => console.log('Custom button'),
      enabled: true,
      id: 'custom-button',
      keyboard: '',
      label: 'Custom Button'
    }
  ])
})

Isolate an object

createVimComponent((cmp: VimComponentRef) => {
  cmp.viewer
    .loadVim('https://vim.azureedge.net/samples/residence.vim')
    .then((vim) => {
      // Get object using its BIM id form the loaded vim.
      const objects = vim.getObjectsFromElementId(ID)
      cmp.isolation.isolate(objects, 'custom')
    })
})

Display a Custom Message

createVimComponent((cmp: VimComponentRef) => {
  cmp.viewer
    .loadVim('https://vim.azureedge.net/samples/residence.vim')
    .then((vim) => {
      cmp.setMsg('Custom message for 3 seconds')
      setTimeout(() => cmp.setMsg(undefined), 3000)
    })
})

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Acknowledgments

Thanks to these great packages and more: