score:1

Accepted answer

It's much easier to do the filtering before you bind the data to the DOM, rather than trying to transform it after you've drawn elements, etc. You can use a standard array filter to remove the undefined data points from your data set:

array.filter( function(d){ // your filter code here } )

In context:

group.selectAll("circle")
    .data( ds.filter(function(d) {return d.param1 != undefined}) )
    .enter()
    .append("circle")  

The same principle applies for the area plot:

group.append("path")
    .attr("class","area")
    .datum( ds.filter(function(d){ return d.param2 != undefined }) )
    .attr("d",area);

Data is much easier to manipulate before it is bound to the DOM, so do as much cleaning and filtering as you can beforehand.


Related Query

More Query from same tag