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

d3_shape_filler_chart

v0.0.2

Published

D3 Shape Filler Chart, a very simple chart created with a single stacked bar chart inside a SVG Shape

Downloads

5

Readme

Code Climate Test Coverage

D3 Shape Filler Chart

D3 Shape Filler Chart is a very simple chart created with a single stacked bar chart inside a SVG shape body.

Sample

D3 Shape Filler Chart Sample

Github mascot Chart Sample

Have a look in this github page to see it in action.

Getting Started

Download the package, and include the dist/ng-content-editable.min.js file in your page.

Via bower

bower install d3_shape_filler_chart --save

Usage

Include the Shape Filler's Javascript and Stylesheet in your HTML

<script src="d3_shape_filler_chart.js" type="text/javascript"></script>
<link href="d3_shape_filler_chart.css"  rel="stylesheet" type="text/css">

Define HTML div to be the chart container

<div class='shape-filler-chart-container'></div>

JavaScript initialize chart

<script language="javascript">
  startShapeFillerChart(".shape-filler-chart-container", [
    {
      value: 0.51,
      label: "diesel",
      color: "#83ba43"
    },
    {
      value: 0.21,
      label: "gasoline",
      color: "#4370ba"
    },
    {
      value: 0.28,
      label: "ethanol",
      color: "#fbac1c"
    }
  ], {
      width: 133,
      height: 190,
      mouseoverColor: "#6B486B",
      maskSvg: "github-icon.svg"
  })
</script>

Dependencies

  • D3 version 3.5.*

Changelog

Release 0.0.2

  • Complete rename lib from "D3 Water Drop Chart" to "D3 Shape Filler Chart", due the lib was already able to work with any kind of SVG shape and not only with Water Drop what's was in the beginning of the lib
  • Changed the data object removed the attribute x that's must be 0 always, and renamed the attribute y to value that's more semantic correct.

You'll need to change the following code to be able to use this new version:

  1. Change the function called to initialize the chart, use startShapeFillerChart instead of startWaterDropChart;
  2. The data object must have only the value attribute instead of the y, and you must delete the x attribute, follows bellow the old data object format, and the new one:

Old format

    {
      x: 0,
      y: 0.51,
      label: "diesel",
      color: "#83ba43"
    }

New format

    {
      value: 0.51,
      label: "diesel",
      color: "#83ba43"
    }

Release 0.0.1

  • Initial version