1.1.2 • Published 2 years ago

d3-chaos v1.1.2

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
2 years ago

d3-chaos v1.1.2

d3 v4 port of a sortable chaos line chart

Installing

If you use NPM, npm install d3-chaos.

API Reference

# d3.chaos()

Constructs a new default chaos generator.

# chaos(data)

For example:

var data = [{"gender":"Male","race":"unknown","date":"7/1/2012","COD":"Gunshot",},{"gender":"Male","race":"White","date":"3/9/2014","COD":"Gunshot",},{"gender":"Male","race":"Black","date":"3/5/2014","COD":"Gunshot",},{"gender":"Male","race":"unknown","date":"9/21/2012","COD":"Gunshot",},{"gender":"Male","race":"unknown","date":"8/3/2012","COD":"Gunshot",}]; 
var chaos = d3.chaos().data(data).key({xKey: "date", highlightKey: "2012", xLabelFormat: getYear});
var parent = d3.select('body').call(chaos);

# chaos.layout({width:width,height:height,margin{top:top,bottom:bottom,left:left,right:right}})

If layout is specified, sets the layout and returns this chaos generator. If layout is not specified, returns the current layout, which defaults to: {margin:{top: 100, right: 80, bottom: 100, left: 10},width:1500, height:2000}

# chaos.keys({top,middle,bottom})

If key object is specified, sets the keys and returns this chaos generator. If key object is not specified, returns the current keys, which are the keys for the range values, which include: {xKey: "Key used for organizing the x-axis", highlightKey: "xKey value highlighted", xLabelFormat: "A function used for formatting the xKey values on the x-axis labels"}

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago