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 🙏

© 2026 – Pkg Stats / Ryan Hefner

d3-vue-components

v1.1.3

Published

A Vue.js plugin that allows for the simple creation of d3.js visualizations.

Readme

d3-vue-components

d3-vue-components is a Vue.js plugin that will allow you to easily add d3-based visualizations to your Vue.js app.

This is a project that I'm slowly working on as I have time, so this package is very incomplete. Right now it only supports the following visualizations:

Feel free to submit pull requests to help out!

Installation

npm i d3-vue-components

Usage

In your main.js file:

import d3VueComponents from 'd3-vue-components'

Vue.use(d3VueComponents)

Your app now has access to all of the components included in the plugin.

Sankey Diagram

This diagram expects you to feed it a JSON object in the following format:

{
  "nodes": [
    { "name": "Node1" },
    { "name": "Node2" },
    { "name": "Node3" }],
  "links": [
    {
      "source": 0, // Flows from Node1
      "target": 1, // to Node2
      "value": 12500 // in this amount
    },
    {
      "source": 0, // Flows from Node1
      "target": 2, // to Node3
      "value": 98526 // in this amount
    }
  ]
}

Below you can see how you might implement the diagram for this JSON object:

<template lang="html">
  <Sankey
    :data="data"
    numberFormat="currency" // options are: currency, float, or integer.
    height="1200"
    width="1200"
    depth0Style="font: 18px sans-serif" // set the style for top-tier node labels
    depth1Style="font: 14px sans-serif" // set the style for tier 1 node labels
    depth2Style="font: 10px sans-serif" // set the style for tier 2 node labels
    depth3Style="font: 6px sans-serif" // set the style for tier 3 node labels
    transformSVG="translate(0, 0)" // you can use any SVG transformation (e.g. rotate(45), scale(2))
    labelTranslateX="2" // this allows you to reposition your labels, if necessary
    labelTranslateY="5" // this allows you to reposition your labels, if necessary>
  </Sankey>
</template>

<script>
  export default {
    data () {
      return {
        data: require('@/assets/somedata.json')
      }
    }
  }
</script>

Circle Pack Diagram

This diagram expects you to feed it a JSON object in the following format:

{
  "name": "Grandpappy",
  "children": [
    {
      "name": "Child1",
      "children": [
        {
          "name": "Grandchild1",
          "value": 65418
        },
        {
        "name": "Grandchild2",
        "value": 98735
        }
      ]
    },
    {
      "name": "Child2",
      "children": [
        {
          "name": "Grandchild3",
          "value": 32598
        },
        {
        "name": "Grandchild4",
        "value": 19876
        }
      ]
    }
  ]
}

Below you can see how you might implement the diagram for this JSON object:

<template lang="html">
  <CirclePack
    :data="data"
    numberFormat="currency" // options are: currency, float, or integer.
    height="900"
    width="900"
    padding="3"
    title="My Circle Pack Diagram"
    style="font: 22px sans-serif" // this is the style for the title
    transformSVG="translate(0, 0)" // you can use any SVG transformation (e.g. rotate(45), scale(2))
    transformCircles="translate(0, -10)"
    transformTitle="translate(0, 20)">
  </CirclePack>
</template>

<script>
  export default {
    data () {
      return {
        data: require('@/assets/somedata.json')
      }
    }
  }
</script>

Calendar

This fixed-size diagram expects you to feed it a JSON object in the following format:

[
  { "date": "2019-01-01", "value": 17 },
  { "date": "2019-01-02", "value": 9 },
  { "date": "2019-01-03", "value": 34 },
  { "date": "2019-01-04", "value": 22 },
  // ...and so on
]

Below you can see how you might implement the diagram for this JSON object:

<template lang="html">
  <Calendar
    :data="data"
    numberFormat="currency" // options are: currency, float, or integer.>
  </Calendar>
</template>

<script>
  export default {
    data () {
      return {
        data: require('@/assets/somedata.json')
      }
    }
  }
</script>

Contributing

This project currently only includes a few visualizations. Feel free to submit pull requests to add new visualizations that make use of the vast d3.js library.

License

MIT