Skip to content

Instantly share code, notes, and snippets.

View jklemmack's full-sized avatar

Johann Klemmack jklemmack

View GitHub Profile
@jklemmack
jklemmack / Correct SQL
Last active August 29, 2015 14:08
ServiceStack.OrmLite LoadSelect with OrderBy, and Skip == 0 doesn't always load correct child references
SELECT "Id", "Value" FROM "Child" WHERE "Id" IN (SELECT TOP 1 "ChildId"
FROM "Parent" ORDER BY "Id" DESC)

This choropleth uses a threshold scale for quantization, mapping arbitrary slices of a continuous domain to discrete values in the range. Unemployment rates ranging from 2 to 10% are quantized into different shades of purple.

var color = d3.scale.threshold()
    .domain([.02, .04, .06, .08, .10])
    .range(["#f2f0f7", "#dadaeb", "#bcbddc", "#9e9ac8", "#756bb1", "#54278f"]);