midmm[i - 1].put((yPos[i] + yPos[i - 1]) / 2.);
}
}
}
SVGPath path = new SVGPath();
if(!rounded) {
// Straight lines
for(int i = 0; i < dim; i++) {
path.drawTo(getVisibleAxisX(i), mms[i].getMax());
if(i < dim - 1) {
path.drawTo(getVisibleAxisX(i + .5), midmm[i].getMax());
}
}
for(int i = dim - 1; i >= 0; i--) {
if(i < dim - 1) {
path.drawTo(getVisibleAxisX(i + .5), midmm[i].getMin());
}
path.drawTo(getVisibleAxisX(i), mms[i].getMin());
}
path.close();
}
else {
// Maxima
path.drawTo(getVisibleAxisX(0), mms[0].getMax());
for(int i = 1; i < dim; i++) {
path.quadTo(getVisibleAxisX(i - .5), midmm[i - 1].getMax(), getVisibleAxisX(i), mms[i].getMax());
}
// Minima
path.drawTo(getVisibleAxisX(dim - 1), mms[dim - 1].getMin());
for(int i = dim - 1; i > 0; i--) {
path.quadTo(getVisibleAxisX(i - .5), midmm[i - 1].getMin(), getVisibleAxisX(i - 1), mms[i - 1].getMin());
}
path.close();
}
Element intervals = path.makeElement(svgp);
SVGUtil.addCSSClass(intervals, CLUSTERAREA + cnum);
layer.appendChild(intervals);
}
}