Skip to content

Instantly share code, notes, and snippets.

@acqant
Created February 3, 2020 18:08
Show Gist options
  • Save acqant/719b1c052259bf9ae82d894127230fa3 to your computer and use it in GitHub Desktop.
Save acqant/719b1c052259bf9ae82d894127230fa3 to your computer and use it in GitHub Desktop.
// cells
regex = /\//
rows
.selectAll("td")
.data(d => Object.values(d))
.join("td")
// update the below logic to apply to your dataset
.attr("class", function(d) {
if (d.match(regex)) {
return 'date_f'
} else if (d > 2) {
return 'high'
} else if (d < 3) {
return 'low'
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment