Skip to main content
100%

print_template

✓ Published0🌍 Public
RRobinL
Last edited Jun 23, 2016
Created on Jun 23, 2016

This example demonstrates how to use d3.scale.linear to map numeric values to both a numeric range and a color range, then prints the resulting intermediate value and color to the SVG canvas. The code implements a simple debugging tool: each call to the print function adds a text label to the display, positioning them vertically down the canvas. Using the d3.select API to target the SVG element, it renders the scale output for the midpoint of the domain (0.5), showing the mapped numeric result and hexadecimal color.

AI-generated description

Similar vizzes