New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

diy-radarchart

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diy-radarchart

Reusable radar chart module for DIY.

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

diy-radarchart

Render a radar chart using d3.

view on requirebin

example

Let's render a chart w/ 4 data points!

var radarchart = require('diy-radarchart');

var target = document.getElementById('passions-chart');

var data = [
    {
        color: '#ccc',
        html: 'Hey there!',
        value: 1
    },
    {
        color: '#999',
        html: 'Hey there darker!',
        value: 3
    },
    {
        color: '#666',
        html: 'Hey there even darker!',
        value: 5
    },
    {
        color: '#333',
        html: 'Hey there the darkest!',
        value: 7
    }
];

radarchart(target, data, { size: 240 });

This would render a radar chart like:

Radar Sample

Note that the html is rendered in a .diy-tooltip element after the svg element and is unstyled in this example.

methods

var radarchart = require('diy-radarchart');

radarchart($el, data, [options])

Appends a svg element and .diy-tooltip element to $el.

$el is the target element. data should be an array of objects with color, html and value properties.

color is the base color (at 100%) that will generate the various shades for the given segment.

html is the html used to render within the tooltip element.

value should be the relative integer value to all data points that will be used to render the segements within the respective data point.

Sample data point:

{
    color: '#999',
    html: '<span>Hey</span>',
    value: 10
}

The chart can handle any number of data points and value amounts and handles averaging everything.

license

APACHE 2.0

FAQs

Package last updated on 12 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc