def anchor(name)
      mark_anchor(name).left(lambda {
        s=scene.target[self.index]
        case self.name
          when 'bottom' then s.left;
          when 'top' then s.left;
          when 'center' then s.left;
          when 'left' then nil;
          else
            s.left+s.shape_radius
        end
      }).right(lambda {
        s=scene.target[self.index]
        self.name()=='left' ? s.right+s.shape_radius : nil
      }).top(lambda {
        s=scene.target[self.index]
        case self.name
          when 'left' then  s.top;
          when 'right' then s.top;
          when 'center' then s.top;
          when 'top' then nil;
          else
            s.top+s.shape_radius
        end
      }).bottom(lambda {
        s=scene.target[self.index]
        self.name()=='top' ? s.bottom+s.shape_radius : nil
      }).text_align(lambda {
        case self.name
          when 'left' then  'right';
          when 'bottom' then 'center';
          when 'top' then 'center';
          when 'center' then 'center';
          else
            'left'
        end
      }).text_baseline( lambda {
        case self.name
          when 'right' then  'middle';
          when 'left' then 'middle';
          when 'center' then 'middle';
          when 'bottom' then 'top';
          else
            'bottom'
        end
      
      })
    end
def anchor(name)
      mark_anchor(name).left(lambda {
        s=scene.target[self.index]
        case self.name
          when 'bottom' then s.left;
          when 'top' then s.left;
          when 'center' then s.left;
          when 'left' then nil;
          else
            s.left+s.shape_radius
        end
      }).right(lambda {
        s=scene.target[self.index]
        self.name()=='left' ? s.right+s.shape_radius : nil
      }).top(lambda {
        s=scene.target[self.index]
        case self.name
          when 'left' then  s.top;
          when 'right' then s.top;
          when 'center' then s.top;
          when 'top' then nil;
          else
            s.top+s.shape_radius
        end
      }).bottom(lambda {
        s=scene.target[self.index]
        self.name()=='top' ? s.bottom+s.shape_radius : nil
      }).text_align(lambda {
        case self.name
          when 'left' then  'right';
          when 'bottom' then 'center';
          when 'top' then 'center';
          when 'center' then 'center';
          else
            'left'
        end
      }).text_baseline( lambda {
        case self.name
          when 'right' then  'middle';
          when 'left' then 'middle';
          when 'center' then 'middle';
          when 'bottom' then 'top';
          else
            'bottom'
        end
      
      })
    end
Constructs a new dot anchor with default properties. Dots support five
 different anchors:<ul>

 <li>top
 <li>left
 <li>center
 <li>bottom
 <li>right

 </ul>In addition to positioning properties (left, right, top bottom), the
 anchors support text rendering properties (text-align, text-baseline). Text is
 rendered to appear outside the dot. Note that this behavior is different from
 other mark anchors, which default to rendering text <i>inside</i> the mark.

 <p>For consistency with the other mark types, the anchor positions are
 defined in terms of their opposite edge. For example, the top anchor defines
 the bottom property, such that a bar added to the top anchor grows upward.