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

@redsift/d3-rs-lines

Package Overview
Dependencies
Maintainers
3
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redsift/d3-rs-lines

Generates line charts using D3v4.

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
212
decreased by-5.78%
Maintainers
3
Weekly downloads
 
Created
Source

d3-rs-lines

d3-rs-lines generate a range of line charts. Supports area fills, hovers and highlights.

Builds

Circle CI

Example

View @redsift/d3-rs-lines on Codepen

Line chart

Sample bars with a bottom orientation

Area chart

Sample bars with a left orientation

Combination

Sample bars with a top orientation and time label

Usage

Browser

<script src="//static.redsift.io/reusable/d3-rs-lines/latest/d3-rs-lines.umd-es2015.min.js"></script>
<script>
	var chart = d3_rs_lines.html();
	d3.select('body').datum([ 1, 2, 3, 10, 100 ]).call(chart);
</script>

ES6

import { chart } from "@redsift/d3-rs-lines";
let eml = chart.html();
...

Require

var chart = require("@redsift/d3-rs-lines");
var eml = chart.html();
...

Datum

  • Simplest form, array of numbers: [1,2,3,4...]

Parameters

PropertyDescriptionTransitionPreview
classedString SVG custom classN
width, height, size, scaleInteger SVG container sizesY
styleString Custom CSS to inject into chartN
minValue,maxValueNumber Sets the minimum and maximum Value scale range. Note that for log scales, minValue must be > 0.Y
tickCountIndex,tickCountValueNumber, String, Interval Function Hints at the number of ticks to set in the corresponding axis. Supports strings for example (time intervals)[https://github.com/d3/d3-time#intervals]
tickMinorIndex, tickMinorValueNumber, String, Interval Function Hints at the number of minor ticks to set in the corresponding axis.
tickFormatIndex, tickFormatValueString, Function Sets the formatting string or function for the ticks
tickDisplayIndex, tickDisplayValueFunction Alternatively you can customise all tick presentation logic with this function
curveString, Function, https://github.com/d3/d3-shape#curves, excluding closed and open curves. If a function is supplied, it should implement https://github.com/d3/d3-shape#custom-curves
symbol(Array of) String, Function https://github.com/d3/d3-shape#symbolCircle or https://github.com/d3/d3-shape#custom-symbol-types
legendOrientationString top, left, bottom, right, voronoi
voronoiAttractionNumber -1...0...1 When using the voronoi legendOrientation, how far the label is dragged to the data line. 0 implies no dragging, -1 pushes the labels away
fillString, Array, Function If function, in addition to usual data, index parameters, a 3rd string parameter indicates the context - one of area, stroke, symbol, legend
fillAreaOpacityUnit Number
fillArea, fillStrokeBoolean, Array[Boolean] Sets if the lines should be filled or stroked. By default is set appropriately for line and stack presentation
stackOffset, stackOrderString, Array, Function https://github.com/d3/d3-shape#stack-orders https://github.com/d3/d3-shape#stack-offsets
animationString reveal, value, default
trimInteger Level to trim the array to
tipHtmlString, Function parameters of the function are (d, i, s) where d is the data element, i is the index, s is the series of the data
onClickFunction handler for a click event on the data series

Time

TODO: Explain string use and intervals like utcDecade;

TODO: timeMultiFormat

TODO: Discuss timeMultiFormat and tickCountIndex with relation to UTC

Keywords

FAQs

Package last updated on 22 Jul 2016

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