Skip to content

Instantly share code, notes, and snippets.

View wjaspers's full-sized avatar

Will wjaspers

  • Twin Cities, MN
View GitHub Profile
@wjaspers
wjaspers / .block
Last active August 31, 2017 11:56 — forked from mbostock/.block
Stacked Area Chart
license: gpl-3.0
@wjaspers
wjaspers / d3.css
Last active August 29, 2015 14:23 — forked from bobmonteverde/d3.css
/********************
* TOOLTIP CSS
*/
.nvtooltip {
position: absolute;
background-color: rgba(255,255,255,1);
padding: 10px;
border: 1px solid #ddd;
@wjaspers
wjaspers / README.md
Last active August 29, 2015 14:21 — forked from ZJONSSON/README.md

d3.legend

d3.legend is a quick hack to add a legend to a d3 chart. Simply add a g and .call(d3.legend). Any elements that have a title set in the "data-legend" attribute will be included when d3.legend is called. Each title will appear only once (even when multiple items define the same data-legend) as the process uses a set based on a existing names, not an array of all items.

Color

By default the color in the legend will try to match the fill attribute or the stroke attribute of the relevant items. Color can be explicitly defined by attribute "data-legend-color"

Order

The order of items in the legend will be sorted using the top of the bounding box for each included item. The order can be explicitly defined by attribute "data-legend-pos"

@wjaspers
wjaspers / MyServiceProvider.php
Created December 30, 2014 19:07
ServiceProvider::when loses events
<?php
use Illuminate\Support\ServiceProvider;
class MyServiceProvider extends ServiceProvider
{
protected $defer = true;
public function register()
{
@wjaspers
wjaspers / test
Last active August 29, 2015 13:57
PHP stdClass reflection bug
<?php
// @link https://bugs.php.net/bug.php?id=66821
class Helper
{
protected $reflector;
protected $object;
public function __construct($object)
{