Add validation to d3 visualization