Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3-legend

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-legend

Simple legend using data-legend attributes on paths.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
328
increased by13.1%
Maintainers
1
Weekly downloads
 
Created
Source

d3-legend

Originally (C) 2012 ziggy.jonsson.nyc@gmail.com

Usage

Add this script to your html and it will define d3.legend.

var svg = d3.select("body").append("svg")...

// add a data-legend attribute to your path
cities.append('path')
    .attr('class', 'line')
    .attr('d', line)
    .attr('data-legend', 'cities')

// add legend to svg.
var legend = svg.append('g')
    .attr('class', 'legend')
    .attr('transform', 'translate(50, 30)')
    .style('font-size', '12px')
    .call(d3.legend)

Alternatively, use require with browserify:

npm install d3-legend

var d3 = require('d3');
var d3legend = require('d3-legend')(d3);

Keywords

FAQs

Package last updated on 20 May 2015

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