CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Static Public Attributes
svgfig.Text Class Reference

Public Member Functions

def __init__ (self, x, y, d, attr)
 
def __repr__ (self)
 
def SVG (self, trans=None)
 

Public Attributes

 attr
 
 d
 
 x
 
 y
 

Static Public Attributes

dictionary defaults = {"stroke":"none", "fill":"black", "font-size":5}
 

Detailed Description

Draws at text string at a specified point in local coordinates.

x, y                   required      location of the point in local coordinates
d                      required      text/Unicode string
attribute=value pairs  keyword list  SVG attributes 

Definition at line 1834 of file svgfig.py.

Constructor & Destructor Documentation

def svgfig.Text.__init__ (   self,
  x,
  y,
  d,
  attr 
)

Definition at line 1847 of file svgfig.py.

1847  def __init__(self, x, y, d, **attr):
1848  self.x = x
1849  self.y = y
1850  self.d = str(d)
1851  self.attr = dict(self.defaults)
1852  self.attr.update(attr)
1853 
def __init__(self, x, y, d, attr)
Definition: svgfig.py:1847
dictionary defaults
Definition: svgfig.py:1842
#define str(s)

Member Function Documentation

def svgfig.Text.__repr__ (   self)
def svgfig.Text.SVG (   self,
  trans = None 
)
Apply the transformation "trans" and return an SVG object.

Definition at line 1854 of file svgfig.py.

References svgfig.SVG.attr, svgfig.Path.attr, svgfig.Curve.attr, svgfig.Poly.attr, svgfig.Text.attr, svgfig.Fig.d, svgfig.Plot.d, svgfig.Frame.d, svgfig.Path.d, svgfig.Poly.d, svgfig.Text.d, svgfig.totrans(), MuonGeometryArrange::MGACollection.x, svgfig.Plot.x, svgfig.Frame.x, svgfig.Text.x, MuonGeometryArrange::MGACollection.y, svgfig.Plot.y, svgfig.Frame.y, svgfig.Curve.Sample.y, and svgfig.Text.y.

1854  def SVG(self, trans=None):
1855  """Apply the transformation "trans" and return an SVG object."""
1856  if isinstance(trans, str): trans = totrans(trans)
1857 
1858  X, Y = self.x, self.y
1859  if trans != None: X, Y = trans(X, Y)
1860  return SVG("text", self.d, x=X, y=Y, **self.attr)
1861 
def SVG(self, trans=None)
Definition: svgfig.py:1854
def totrans(expr, vars=("x","y"), globals=None, locals=None)
Definition: svgfig.py:597

Member Data Documentation

svgfig.Text.attr
svgfig.Text.d
dictionary svgfig.Text.defaults = {"stroke":"none", "fill":"black", "font-size":5}
static

Definition at line 1842 of file svgfig.py.

Referenced by tree.Tree.reset(), and tree.Tree.var().

svgfig.Text.x
svgfig.Text.y