skills-barchart
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

SkillsBarChart

A simple chart written in d3 that can graph skills from "Novice" to "Expert" level:

sample screenshot of demo

Usage

Install with npm:

npm install skills-barchart

This module will work when added as a global (with a <script> tag, i.e. no module loader) as long as d3 version >=4 is included on the page as well. It will also work in ESNext, commonJS, and TypeScript environments. See the demos/ folder for individual examples.

Here is an example of how to create a new chart:

 
// Create the chart instance
const chart = new SkillsBarChart();
 
// Calls can be chained:
chart
  
  // Set the target HTML element
  .target('#my-chart-id')
 
  // Set the data, should be an array of ICategoryData
  // (see `dist/skills-barchart.d.ts` for the type definition).
  .data(myChartData)
 
  // Render the graph
  .render();
 

Running the Demo

  1. Install devDependencies
npm install
  1. Due to this issue, you must add the following line to node_modules/d3-request/package.json:
"browser": "build/d3-request.js"
  1. Run the demo server
npm run demo
  1. Navigate to any of these URLs:

Building the Project

To build the dist files, first ensure that you have done step 2 of "Running the Demo" above.

Then run:

npm run build

This creates dist/skills-barchart.js and dist/skills-barchart.d.ts.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i skills-barchart

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • andyperlitch