context.removeDataStoreListener(this);
}
@Override
public void redraw() {
StylingPolicy stylepolicy = context.getStyleResult().getStylingPolicy();
// bubble size
final double bubble_size = context.getStyleLibrary().getSize(StyleLibrary.BUBBLEPLOT);
if(stylepolicy instanceof ClassStylingPolicy) {
ClassStylingPolicy colors = (ClassStylingPolicy) stylepolicy;
setupCSS(svgp, colors);
// draw data
for(DBID objId : sample.getSample()) {
final Double radius = getScaledForId(objId);
if(radius > 0.01 && !Double.isInfinite(radius)) {
final NumberVector<?, ?> vec = rel.get(objId);
if(vec != null) {
double[] v = proj.fastProjectDataToRenderSpace(vec);
Element circle = svgp.svgCircle(v[0], v[1], radius * bubble_size);
SVGUtil.addCSSClass(circle, BUBBLE + colors.getStyleForDBID(objId));
layer.appendChild(circle);
}
}
}
}
else {
// draw data
for(DBID objId : sample.getSample()) {
final Double radius = getScaledForId(objId);
if(radius > 0.01 && !Double.isInfinite(radius)) {
final NumberVector<?, ?> vec = rel.get(objId);
if(vec != null) {
double[] v = proj.fastProjectDataToRenderSpace(vec);
Element circle = svgp.svgCircle(v[0], v[1], radius * bubble_size);
int color = stylepolicy.getColorForDBID(objId);
final StringBuffer style = new StringBuffer();
if(fill) {
style.append(SVGConstants.CSS_FILL_PROPERTY + ":").append(SVGUtil.colorToString(color));
style.append(SVGConstants.CSS_FILL_OPACITY_PROPERTY + ":0.5");
}