Skip to content

Instantly share code, notes, and snippets.

View davelandry's full-sized avatar
🍻

Dave Landry davelandry

🍻
View GitHub Profile
@davelandry
davelandry / README.md
Last active August 22, 2016 15:24
Hiding the Focus Tooltip

Visualizations that support setting a Focus Element automatically create a tooltip on the right side of the visualization for that element (if there is data to show).

To disable this tooltip from displaying, we simply set the "tooltip" parameter of .focus( ) to false.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:24
Make Colored Text Legible on White Backgrounds

Using d3plus.color.legible, a color's luminosity and saturation can be tweaked so that it is much easier to read on a white background, while still retaining as much of the original color as possible.

This example shows how various colors are modified using this function. The lighter colors are darkened the most.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:24
Advanced Visualization Interface Elements
@davelandry
davelandry / README.md
Last active August 22, 2016 15:24
Using Icon Images

The .icon( ) method specifies a specific key in the data that points to an image URL. These icons are used in Legends and Tooltips.

Additionally, in this example, advanced parameters of the icon can be set, including the "style", which defines whether or not to fill the background square with the object's color.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:24
Simple Sankey

Sankey charts show the flows in and out of a focus data point.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:24
Edge Directional Arrows in a Network

The "arrows" property of the .edges( ) method toggles the visibility of edge directional arrows. The directionality defaults to pointing at the "target" node.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:24
Stacked Areas as Share Percentages

The Stacked Area Chart, along with the other Chart Visualizations, has access to the various keys offered by the .x( ) and .y( ) methods. In this example, the .x( ) scale is changed to "share" after 2 seconds.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:24
Filtering Geo Map Coordinates

When creating a Geo Map, it is possible to initiate the visualization using only a subset of the available geographies passed to .coords( ). Similar to many of the other methods, the .coords( ) method allows you to Filter Data by it's .id( ) key. In our example here, we are "soloing" a few countries in Europe.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:24
Grouped Line Chart

When passing the .id( ) method an array instead of a single key, the Line Chart visualization will group lines based on the keys (and order) you pass it in the array.

The Y values for the lines are averaged, by default. This aggregation can be changed using the .aggs( ) method.

When clicking on a grouped line, the visusalization will automatically zoom into that group, showing the items within it. This feature can be toggled using the .zoom( ) method.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:24
Grouped Scatterplot

When passing the .id( ) method an array instead of a single key, the Scatter Plot visualization will group data nodes based on the keys (and order) you pass it in the array.

The values for the groups are averaged, by default. This aggregation can be changed using the .aggs( ) method.

When clicking on a grouped node, the visusalization will automatically zoom into that group, showing the items within it. This feature can be toggled using the .zoom( ) method.

Featured on D3plus.org