Canvas Parallel Coordinates - 7637 Rows - Oridinal/Quantitative dimensions
An example of an SVG interaction layer over a canvas rendering layer. This example has 7637 data points from the USDA Nutrition Dataset. Uses requestAnimationFrame to prevent path rendering from locking up the UI. '''NEW''' support for ordinal dimensions!
Interactions done with the brush component
Based on d3.js Parallel Coordinates
Changes:
- Map over each dimension. Assign quantitative scales to all dimensions where every value is a number or null.
NOTE!: +"" = 0 AND parseFloat("") !== "". When setting the domain of a quantitative scale. Make sure to coerce "" or nulls to an appropriate value.
If you use d3.extent w/o coercing the quantitative strings to numbers... it will grab the extent as if they are strings.
- Set the domain of the ordinal scales to the unique values for that dimension (see line 133)
- After brushing, convert ordinal dimension's values to pixels before checking if it lies with in the brushes extent. (see line 173)
Pro tip: Use Mike's trick from axis.js to see if a scale is quantitative or not.
d3.scale.linear().ticks = true
d3.scale.ordinal().ticks = undefined