
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
d3.layout.grid
Advanced tools
Lightweight grid layout designed for categorical data
Demo: http://felixlaumon.github.io/d3.layout.grid/examples/basic.html
d3.layout.grid
is designed to display categorical data, allowing users to sort and group by different categorical variables.
To maintain flexibility and the possibility to animate between layout type (e.g. between grid and force layout), d3.layout.grid
does not include animation logic, but set x
and y
coordinates to the data.
Like other classes in D3, d3.layout.grid
is chainable.
var grid = d3.layout.grid()
.width(500)
.height(1000)
.data(data)
.groupBy('color')
d3.selectAll('circle')
.enter()
.append('circle')
.attr('r', 10)
.attr('cx', function (d) { return d.x; })
.attr('cy', function (d) { return d.y; })
.attr('fill', function (d) { return d.color; })
See examples/basic.html
and examples/basic.js
for a complete example.
Returns a new grid layout with the following default settings:
width
= 500height
= 1000colWidth
= 50rowHeight
= 50sectionPadding
= 100marginLeft
= 50marginTop
= 100Data associated with the grid. Relayouting (triggered by groupBy(...)
or sort(...)
) will set x
and y
properties to each datum
, which can then be used for animation.
Group data using underscore's _.groupBy
.
Will trigger relayout.
groupComparator
is used to produce the group order, which is invoked with the group names (a string
) from grid.groupBy()
dataComparator
is used to sort the data within a group, which is inovked with the data from grid.data()
Will trigger relayout.
Returns information about current grouping. Most notably it returns the y-coordinate of each group, which allows easy placement for the group headers.
If 1 argument is specified, set that corresponding config; otherwise return that config.
This should be normally done with the initialization of d3.layout.grid()
. Note that this doesn't trigger a relayout. To change a config with animation, call grid.relayout()
Force manual relayout of the grid
ISC. Copyright (c) 2014 Felix Lau.
FAQs
Lightweight grid layout designed for categorical data
We found that d3.layout.grid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.