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

deltav-quick-surface

v1.1.1

Published

This is a Surface type built on the deltav framework. The goal of this surface is to create a rapid prototyping system that minimizes any complexity of getting a rendering surface working.

Downloads

3

Readme

Quick Surface

This is a Surface type built on the deltav framework. The goal of this surface is to create a rapid prototyping system that minimizes any complexity of getting a rendering surface working.

Essentially, this is a surface with a LOT of unmodifiable defaults that let's you use and work with existing deltav layers and instances to output a graphic or result VERY easily.

One way of looking at it, is this is a data-centric Surface instead of a rendering pipeline focused system.

Use

Using the QuickSurface is extremely easy:

npm install deltav-quick-surface

Then to use the surface:

new QuickSurface({
  container: document.getElementById('main'),
  data: {
    circles: {
      large: [ new CircleInstance({...}) ],
      small: [ new CircleInstance({...}) ],
    },
    labels: {
      xAxis: [ new LabelInstance({...}) ],
      yAxis: [ new LabelInstance({...}) ],
    }
  }
})

And that's it!

The data object is ANY object structure who's leaves are lists of recognized Instances! The following is even valid:

new QuickSurface({
  container: document.getElementById('main'),
  data: {
    circles: [ new CircleInstance({...}), ... ],
  }
})

As you can see: this is a Surface that is designed to get you rolling as quick as possible and STILL handle the hundreds of thousands of points that the powerful deltav framework handles!

Custom Views

You can customize the views your data should appear in VERY easily. This example causes ALL items under the data key "circles" to render within a custom viewport:

new QuickSurface({
  container: document.getElementById('main'),
  data: {
    circles: {
      large: [ new CircleInstance({...}) ],
      small: [ new CircleInstance({...}) ],
    },
    labels: {
      xAxis: [ new LabelInstance({...}) ],
      yAxis: [ new LabelInstance({...}) ],
    }
  },
  views: {
    circles: view({ viewport: {...} })
  }
})

Now the circles render in a new viewport while the labels will render in the default viewport. You can use this to easily group and cluster instances as you see fit.

Event Handling

Events with the QuickView can also be applied easily to groups of Instances based on data key. The following applies a mouse click handler for all circles:

new QuickSurface({
  container: document.getElementById('main'),
  data: {
    circles: {
      large: [ new CircleInstance({...}) ],
      small: [ new CircleInstance({...}) ],
    },
    labels: {
      xAxis: [ new LabelInstance({...}) ],
      yAxis: [ new LabelInstance({...}) ],
    }
  },
  onMouseClick: {
    circles: info => {
      info.instances((circle: CircleInstance) => {
        // Do something to large and small circles
      });
    }
  }
})

If you have mixed instance types in your data, you need to filter the instances by type so you don't try to perform an operation on the wrong instance:

new QuickSurface({
  container: document.getElementById('main'),
  data: {
    mixed: {
      circles: [ new CircleInstance({...}) ],
      labels: [ new LabelInstance({...}) ],
    },
  },
  onMouseClick: {
    mixed: info => {
      info.instances(instance => {
        if (instance instanceof CircleInstance) {
          // Do something with a circle
        }

        else if (instance instanceof LabelInstance) {
          // Do something with a label
        }
      });
    }
  }
})

Developing

npm run dev

Unit Testing

npm run unit-test

Developing Unit Tests

npm run unit-test-dev

Releasing a new version

Make commits that include messages with the following format:

feature: new feature stuff fixed: thing got fixed task: get something done

Then when you have some valid features and fixes you run:

npm run release