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
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:23
Lighten Colors

Using d3plus.color.lighter( ), a color's luminosity can be increased based on a specified increment. In this example, each color in the default D3plus color scale is shown at various ligher states, by increments of 0.1.

Featured on D3plus.org

@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
Forms from Javascript

Javascript data arrays can be easily transformed into D3plus Forms.

d3plus.form() behaves similarly to d3plus.viz(), but also contains methods unique to itself.

HTML elements can also be transformed into D3plus forms.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:24
Forms from HTML

HTML form elements already present on a page can be easily transformed into D3plus Forms.

d3plus.form() behaves similarly to d3plus.viz(), but also contains methods unique to itself.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:23
Changing the Language to Portuguese

The formatting method allows the localization of common interface words, such as the "Back" button and the "Share" label in this visualization.

A list of currently supported localizations (and how to contribute) can be found here.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:23
Adding Custom Interface Elements

Custom Interface Elements can be created by passing the .ui( ) method an array of obejcts.

Each object needs to contain both the method that it corresponds with, and the values that the user should be able to toggle between.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:23
Using a Timeline

When passing the .time( ) method a key, D3plus will map the associated values to a timeline, and display that timeline on the bottom of the visualization.

The timeline can be hidden by toggling the .timeline( ) method.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:23
Changing the Default Color Heatmap

The default color heatmap used by the .color( ) method when coloring by a range of positive numbers can be changed using the "heatmap" key inside of the method's object.

Featured on D3plus.org

@davelandry
davelandry / README.md
Last active August 22, 2016 15:23
Changing the Default Color Range

The default color range used by the .color( ) method when coloring by a range of numbers from negative to positive can be changed by modifying the "range" value inside of the method.

Featured on D3plus.org