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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@leslieetubo/heatmap

v1.1.2

Published

A client side data collector for bevy analytics

Readme

example

Bevyjs

npm version

A vue directive for collecting and displaying user activity on a component

Install

You can use NPM or Yarn to add this plugin to your project

npm install vue-heatmapjs
# or
yarn add vue-heatmapjs

Usage

You need to install this plugin in you main.js

// main.js

import Vue from 'vue'
import heatmap from 'vue-heatmapjs'

Vue.use(heatmap)

v-heatmap

And then you can add the v-heatmap directive to the dom elements you want to track.

<!-- App.vue -->
<div v-heatmap>
  ...
</div>

v-scrollmap

You can use the v-scrollmap directive to collect scroll position data from your application

<!-- App.vue -->
<div v-scrollmap>
  ...
</div>

Toggle heatmap

You can toggle the heatmaps on and off by passing an expression into the directive, the example below will produce something similar to the image at the top of these docs

<template>
  ...
  <div v-heatmap="show" v-scrollmap="show"></div>
  <button @click="show = !show">Toggle Heatmap</button>
  ...
</template>

<script>
  ...
    data() {
      return {
        show: false,
      }
    },
  ...
</script>

Listen for events

Streams

You can pass in an Observable into the plugin options and subscribe to events captured for the heatmaps.

// main.js
import { Subject } from 'rxjs';

const stream = new Subject();
Vue.use(Vueheatmap, {
  stream,
});

stream.subscribe(console.log);

Callback

You can pass an afterAdd method through with the plugin options, this will allow you to access and process the events captured for the heatmap

// main.js

Vue.use(heatmap, {
  afterAdd(data) {
    console.log(data)
    // you can fire this back to your analytics server
  },
})

Pause collection

You can pass an RXJS Subject through with the plugin options that will allow you to toggle whether your directives collect data or not

//main.js
export const pauser = new Subject();

Vue.config.productionTip = false;
Vue.use(Vueheatmap, {
  pauser,
});
// Pause data collection
pauser.next(true);
// Resume data collection
pauser.next(false);

Preload heatmap

Once you have captured heatmap data and persisted the data somewhere you will probably need a way of loading this data back in to your heatmap.

You can pass in an array of heatmap events using the heatmap preload plugin option

//main.js
Vue.use(Vueheatmap, {
  heatmapPreload: [{ x: 10, y: 10, value: 100 }],
});

The plugin can also handle a Promise

//main.js
Vue.use(Vueheatmap, {
  heatmapPreload: fetch('http://api.example.com').then(response => response.json()),
});