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 1835 of file svgfig.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 1848 of file svgfig.py.

1848  def __init__(self, x, y, d, **attr):
1849  self.x = x
1850  self.y = y
1851  self.d = str(d)
1852  self.attr = dict(self.defaults)
1853  self.attr.update(attr)
1854 

Member Function Documentation

◆ __repr__()

def svgfig.Text.__repr__ (   self)

◆ SVG()

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

Definition at line 1855 of file svgfig.py.

1855  def SVG(self, trans=None):
1856  """Apply the transformation "trans" and return an SVG object."""
1857  if isinstance(trans, str): trans = totrans(trans)
1858 
1859  X, Y = self.x, self.y
1860  if trans != None: X, Y = trans(X, Y)
1861  return SVG("text", self.d, x=X, y=Y, **self.attr)
1862 

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.

Member Data Documentation

◆ attr

svgfig.Text.attr

◆ d

svgfig.Text.d

◆ defaults

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

Definition at line 1843 of file svgfig.py.

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

◆ x

svgfig.Text.x

◆ y

svgfig.Text.y
str
#define str(s)
Definition: TestProcessor.cc:48
svgfig.totrans
def totrans(expr, vars=("x", "y"), globals=None, locals=None)
Definition: svgfig.py:598
update
#define update(a, b)
Definition: TrackClassifier.cc:10