Skip to content

Instantly share code, notes, and snippets.

@turner
Created June 23, 2016 17:34
Show Gist options
  • Save turner/d381fb8c7970627fdd26b4b0ec3cb4dc to your computer and use it in GitHub Desktop.
Save turner/d381fb8c7970627fdd26b4b0ec3cb4dc to your computer and use it in GitHub Desktop.
CMap - Histogram Bins - Linear Gradient Based On Pert-Type Color
svg_root_container_selection = d3.select("#svg-root-container")
.append("svg")
.attr("overflow", "visible")
.attr("x", 0)
.attr("y", 0)
.attr("width", 13 * (scarpa.CSHistogram.bbox.width + scarpa.CSHistogram.bbox.x))
.attr("height", 1.25 * scarpa.CSHistogram.bbox.height);
// fun with gradients
gradient_selection = svg_root_container_selection.append("defs")
.append("linearGradient")
.attr("id", "oekd_gradient")
.attr("x1", "0%")
.attr("x2", "100%")
.attr("spreadMethod", "pad");
gradient_selection.append("stop")
.attr("offset", "0%")
.attr("stop-color", "#B438BE")
.attr("stop-opacity", 1);
gradient_selection.append("stop")
.attr("offset", "100%")
.attr("stop-color", "#27AAE0")
.attr("stop-opacity", 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment