Skip to content

Instantly share code, notes, and snippets.

View stephen101's full-sized avatar

Stephen Young stephen101

  • Cape Town, South Africa
View GitHub Profile
Verifying that +stephenyo is my blockchain ID. https://onename.com/stephenyo
@stephen101
stephen101 / README.md
Last active December 29, 2015 12:39
Minimum Circle Example

#Minimum Circle

Calculates the centrepoint and radius of the smallest circle that encircles all the points provided as input. Drag the points around in the above vizualisation to see the circle update.

Source: https://github.com/stephen101/d3-plugins/tree/master/src/minimumCircle

Instantiation

First create the layout and pass in the data points you are working with

@stephen101
stephen101 / README.md
Last active December 29, 2015 07:59 — forked from mbostock/.block
LineTool example
@stephen101
stephen101 / README.md
Last active December 22, 2015 02:19 — forked from mbostock/.block

D3 support for CIE L*a*b* and HCL. These perceptually-motivated color spaces are designed with humans (rather than computers) in mind. RGB and HSL interpolation can cause unintentional grouping due to parts of the color space appearing more visually similar; L*a*b* and HCL, in contrast, are perceptually uniform. For more information, see Gregor Aisch’s post How To Avoid Equidistant HSV Colors and Drew Skau’s post Dear NASA: No More Rainbow Color Scales, Please.

You can create L*a*b* or HCL colors directly using d3.lab or d3.hcl. For example:

var steelblue = d3.lab(52, -4, -32);
var steelblue = d3.hcl(-97, 32, 52);

You can also convert from RGB or HSL. This is useful for creating brighter or darker colors with uniform changes in perception:

Created by Christopher Manning

Summary

Voronoi Diagram with Force Directed Nodes and Delaunay Links

Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.

The white lines are the Delaunay triangulation and the purple cells are the Voronoi diagram.

model =
#Contains a hash of all the valid input field URI's, the key is the URI, the value
#contains a hash of instances of inputFields, for this hash the key is a combination of URI
#and GUID, we need this to know the diffirence between "INTEREST_RATE" for BankAccount1,
#vs "INTEREST_RATE" for BankAccount2. We get the GUID from the GUID generated in the UI
inputFields: {}
#contains a hash of all the valid output field URI's, the keys is the URI, the value
#contains a hash of instances of ouputFields, key is a combination of URI and GUID,