1 pv.SvgScene.dot = function(scenes) {
  2   var e = scenes.$g.firstChild;
  3   for (var i = 0; i < scenes.length; i++) {
  4     var s = scenes[i];
  5 
  6     /* visible */
  7     if (!s.visible) continue;
  8     var fill = pv.color(s.fillStyle), stroke = pv.color(s.strokeStyle);
  9     if (!fill.opacity && !stroke.opacity) continue;
 10 
 11     /* points */
 12     var radius = Math.sqrt(s.size), fillPath = "", strokePath = "";
 13     switch (s.shape) {
 14       case "cross": {
 15         fillPath = "M" + -radius + "," + -radius
 16             + "L" + radius + "," + radius
 17             + "M" + radius + "," + -radius
 18             + "L" + -radius + "," + radius;
 19         break;
 20       }
 21       case "triangle": {
 22         var h = radius, w = radius * 2 / Math.sqrt(3);
 23         fillPath = "M0," + h
 24             + "L" + w +"," + -h
 25             + " " + -w + "," + -h
 26             + "Z";
 27         break;
 28       }
 29       case "diamond": {
 30         radius *= Math.sqrt(2);
 31         fillPath = "M0," + -radius
 32             + "L" + radius + ",0"
 33             + " 0," + radius
 34             + " " + -radius + ",0"
 35             + "Z";
 36         break;
 37       }
 38       case "square": {
 39         fillPath = "M" + -radius + "," + -radius
 40             + "L" + radius + "," + -radius
 41             + " " + radius + "," + radius
 42             + " " + -radius + "," + radius
 43             + "Z";
 44         break;
 45       }
 46       case "tick": {
 47         fillPath = "M0,0L0," + -s.size;
 48         break;
 49       }
 50       default: {
 51         function circle(r) {
 52           return "M0," + r
 53               + "A" + r + "," + r + " 0 1,1 0," + (-r)
 54               + "A" + r + "," + r + " 0 1,1 0," + r
 55               + "Z";
 56         }
 57         if (s.lineWidth / 2 > radius) strokePath = circle(s.lineWidth);
 58         fillPath = circle(radius);
 59         break;
 60       }
 61     }
 62 
 63     /* transform */
 64     var transform = "translate(" + s.left + "," + s.top + ")"
 65         + (s.angle ? " rotate(" + 180 * s.angle / Math.PI + ")" : "");
 66 
 67     /* The normal fill path. */
 68     e = this.expect("path", e);
 69     e.setAttribute("d", fillPath);
 70     e.setAttribute("transform", transform);
 71     e.setAttribute("fill", fill.color);
 72     e.setAttribute("fill-opacity", fill.opacity);
 73     e.setAttribute("cursor", s.cursor);
 74     if (strokePath) {
 75       e.setAttribute("stroke", "none");
 76     } else {
 77       e.setAttribute("stroke", stroke.color);
 78       e.setAttribute("stroke-opacity", stroke.opacity);
 79       e.setAttribute("stroke-width", s.lineWidth);
 80     }
 81     e = this.append(e, scenes, i);
 82 
 83     /* The special-case stroke path. */
 84     if (strokePath) {
 85       e = this.expect("path", e);
 86       e.setAttribute("d", strokePath);
 87       e.setAttribute("transform", transform);
 88       e.setAttribute("fill", stroke.color);
 89       e.setAttribute("fill-opacity", stroke.opacity);
 90       e.setAttribute("cursor", s.cursor);
 91       e = this.append(e, scenes, i);
 92     }
 93   }
 94   return e;
 95 };
 96