CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Static Public Attributes
svgfig.Dots Class Reference

Public Member Functions

def __init__
 
def __repr__
 
def SVG
 

Public Attributes

 attr
 
 d
 
 height
 
 symbol
 
 width
 

Static Public Attributes

dictionary defaults = {}
 

Detailed Description

Dots draws SVG symbols at a set of points.

d                      required               list of (x,y) points
symbol                 default=None           SVG symbol or a new identifier to
                                              label an auto-generated symbol;
                                              if None, use pre-defined _circular_dot
width, height          default=1, 1           width and height of the symbols
                                              in SVG coordinates
attribute=value pairs  keyword list           SVG attributes

Definition at line 1908 of file svgfig.py.

Constructor & Destructor Documentation

def svgfig.Dots.__init__ (   self,
  d = [],
  symbol = None,
  width = 1.,
  height = 1.,
  attr 
)

Definition at line 1924 of file svgfig.py.

1925  def __init__(self, d=[], symbol=None, width=1., height=1., **attr):
1926  self.d = list(d)
1927  self.width = width
1928  self.height = height
1930  self.attr = dict(self.defaults)
1931  self.attr.update(attr)
1932 
1933  if symbol == None:
1934  self.symbol = _circular_dot
1935  elif isinstance(symbol, SVG):
1936  self.symbol = symbol
1937  else:
1938  self.symbol = make_symbol(symbol)
def make_symbol
Definition: svgfig.py:1894
def __init__
Definition: svgfig.py:1924
dictionary defaults
Definition: svgfig.py:1919

Member Function Documentation

def svgfig.Dots.__repr__ (   self)

Definition at line 1921 of file svgfig.py.

References svgfig.SVG.attr, svgfig.Path.attr, svgfig.Curve.attr, svgfig.Poly.attr, svgfig.Text.attr, svgfig.TextGlobal.attr, svgfig.Dots.attr, svgfig.Fig.d, svgfig.Plot.d, svgfig.Frame.d, svgfig.Path.d, svgfig.Poly.d, svgfig.Text.d, svgfig.TextGlobal.d, and svgfig.Dots.d.

Referenced by data_sources.json_file.__str__().

1922  def __repr__(self):
1923  return "<Dots (%d nodes) %s>" % (len(self.d), self.attr)
def __repr__
Definition: svgfig.py:1921
def svgfig.Dots.SVG (   self,
  trans = None 
)
Apply the transformation "trans" and return an SVG object.

Definition at line 1939 of file svgfig.py.

References svgfig.Fig.d, svgfig.Plot.d, svgfig.Frame.d, svgfig.Path.d, svgfig.Poly.d, svgfig.Text.d, svgfig.TextGlobal.d, svgfig.Dots.d, svgfig.Plot.height, svgfig.Frame.height, svgfig.Dots.height, svgfig.Dots.symbol, svgfig.totrans(), svgfig.Plot.width, svgfig.Frame.width, and svgfig.Dots.width.

1940  def SVG(self, trans=None):
1941  """Apply the transformation "trans" and return an SVG object."""
1942  if isinstance(trans, str): trans = totrans(trans)
1943 
1944  output = SVG("g", SVG("defs", self.symbol))
1945  id = "#%s" % self.symbol["id"]
1946 
1947  for p in self.d:
1948  x, y = p[0], p[1]
1949 
1950  if trans == None: X, Y = x, y
1951  else: X, Y = trans(x, y)
1952 
1953  item = SVG("use", x=X, y=Y, xlink__href=id)
1954  if self.width != None: item["width"] = self.width
1955  if self.height != None: item["height"] = self.height
1956  output.append(item)
1957 
1958  return output
def totrans
Definition: svgfig.py:598

Member Data Documentation

svgfig.Dots.attr

Definition at line 1929 of file svgfig.py.

Referenced by svgfig.Dots.__repr__(), svgfig.LineGlobal.__repr__(), svgfig.Ticks.__repr__(), svgfig.Axes.__repr__(), svgfig.HGrid.__repr__(), svgfig.VGrid.__repr__(), svgfig.Grid.__repr__(), svgfig.LineGlobal.SVG(), svgfig.Axes.SVG(), svgfig.XErrorBars.SVG(), and svgfig.YErrorBars.SVG().

svgfig.Dots.d

Definition at line 1925 of file svgfig.py.

Referenced by svgfig.Dots.__repr__(), svgfig.XErrorBars.__repr__(), svgfig.YErrorBars.__repr__(), svgfig.Dots.SVG(), svgfig.XErrorBars.SVG(), and svgfig.YErrorBars.SVG().

dictionary svgfig.Dots.defaults = {}
static

Definition at line 1919 of file svgfig.py.

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

svgfig.Dots.height

Definition at line 1927 of file svgfig.py.

Referenced by TkAlMap.TkAlMap.draw_cms_prelim(), presentation.PageLayout.fit(), TkAlMap.TkAlMap.load_geometry(), and svgfig.Dots.SVG().

svgfig.Dots.symbol

Definition at line 1933 of file svgfig.py.

Referenced by svgfig.Dots.SVG().

svgfig.Dots.width

Definition at line 1926 of file svgfig.py.

Referenced by python.rootplot.utilities.Hist.__init_TGraph(), python.rootplot.root2matplotlib.Hist.bar(), python.rootplot.root2matplotlib.Hist.barh(), TkAlMap.TkAlMap.draw_cms_prelim(), presentation.PageLayout.fit(), TkAlMap.TkAlMap.load_geometry(), and svgfig.Dots.SVG().