CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Static Public Attributes
DOTExport.DotExport Class Reference
Inheritance diagram for DOTExport.DotExport:

Public Member Functions

def __init__
 
def dotIndenter
 
def export
 
def get_png_size
 
def processMap
 
def selectNode
 
def write_output
 

Public Attributes

 include_nodes
 
 shapes
 

Static Public Attributes

tuple file_types = ('bmp','dot','eps','gif','jpg','pdf','png','ps','svg','tif','png+map','stdout')
 
dictionary option_types
 
string plugin_name = 'DOT Export'
 

Detailed Description

Export a CMSSW config file to DOT (http://www.graphviz.org) markup, either as raw markup or by invoking the dot program, as an image.

Definition at line 261 of file DOTExport.py.

Constructor & Destructor Documentation

def DOTExport.DotExport.__init__ (   self)

Definition at line 295 of file DOTExport.py.

Member Function Documentation

def DOTExport.DotExport.dotIndenter (   self,
  dot 
)
Simple indenter for dot output, mainly to prettify it for human reading.

Definition at line 309 of file DOTExport.py.

def DOTExport.DotExport.export (   self,
  data,
  filename,
  filetype 
)

Definition at line 463 of file DOTExport.py.

def DOTExport.DotExport.get_png_size (   self,
  filename 
)

Definition at line 489 of file DOTExport.py.

def DOTExport.DotExport.processMap (   self,
  mapdata 
)
Re-process the client-side image-map produces when png+map is selected.
DOT will only ever put a single URL in the imagemap corresponding to a node, with the 'url' parameter (after html encoding) as the url, and the 'title' parameter as the title. This isn't useful behaviour for our purposes. We want probably several link areas, or a javascript link to make a menu appear, or other more complex behaviour.

If the option 'urlprocess' is turned on, this function is called, and it expects to find a dictionary it can eval in the url parameter. I can't think of a less messy way of passing data to this function without having inner access to DOT at the moment.

This function iterates through all the areas in the mapfile, replacing each one with one or more areas according to the rules in the dictionary stored in the URL parameter.

The dictionary should have structure:
{
  split_x:#,
  split_y:#,
  scale_x:#,
  scale_y:#,
  cells:[
      {
        top:#,
        left:#,
        width:#,
        height:#,
        html_attribute1:"...",
        html_attribute2:"..."
    ]
}
The imagemap is first scaled in size by scale_x and scale_y.
It is then split into split_x*split_y rectangular cells.
New areas are created for each defined cell with the defined top,left location and width,height. This will not check you aren't making new areas that overlap if you define them as such.
The areas then get attributes defined by html_attribute fields - eg, 'html_href':'mypage.htm' becomes 'href'='mypage.htm' in the area. Probably you want as a minimum to define html_href and html_alt. It would also be useful to set html_class to allow highlighting of different link types, or html_onclick/onmouseover for more exotic behaviour.

This will probably be quite sensitive to the presence of special characters, complex splitting schemes, etc. Use with caution.

This may be somewhat replaceable with the <html_label> and cut-down table format that graphviz provides, but I haven't had much of an experiment with that.

Definition at line 393 of file DOTExport.py.

def DOTExport.DotExport.selectNode (   self,
  dotdata,
  node,
  depth_s 
)

Definition at line 328 of file DOTExport.py.

def DOTExport.DotExport.write_output (   self,
  dot,
  filename,
  filetype 
)

Definition at line 498 of file DOTExport.py.

Member Data Documentation

tuple DOTExport.DotExport.file_types = ('bmp','dot','eps','gif','jpg','pdf','png','ps','svg','tif','png+map','stdout')
static

Definition at line 294 of file DOTExport.py.

Referenced by FileExportPlugin.FileExportPlugin.fileTypes().

DOTExport.DotExport.include_nodes

Definition at line 373 of file DOTExport.py.

dictionary DOTExport.DotExport.option_types
static
Initial value:
1 = {
2  'legend':('Show Legend','boolean',True),
3  'source':('Show Source','boolean',True),
4  'es':('Show Event Setup','boolean',False),
5  'tagconnect':('Connect InputTags','boolean',True),
6  'seqconnect':('Connect Module Sequence','boolean',False),
7  'services':('Show Services','boolean',False),
8  'endpath':('Show EndPaths','boolean',True),
9  'seq':('Group Sequences','boolean',True),
10  'class':('Show Class','boolean',True),
11  'file':('Show File','boolean',True),
12  'schedule':('Show Schedule','boolean',False),
13  'taglabel':('Show Tag Labels','boolean',True),
14  'color_path':('Path Color','color','#ff00ff'),
15  'color_endpath':('EndPath Color','color','#ff0000'),
16  'color_sequence':('Sequence Color','color','#00ff00'),
17  'color_inputtag':('InputTag Color','color','#0000ff'),
18  'color_schedule':('Schedule Color','color','#00ffff'),
19  'url':('Include URLs','boolean',False), #this is only purposeful for png+map mode
20  'urlprocess':('Postprocess URL (for client-side imagemaps)','boolean',False), #see processMap documentation; determines whether to treat 'urlbase' as a dictionary for building a more complex imagemap or a simple URL
21  'urlbase':('URL to generate','string',"{'split_x':1,'split_y':2,'scale_x':1.,'scale_y':1.,'cells':[{'top':0,'left':0,'width':1,'height':1,'html_href':'http://cmslxr.fnal.gov/lxr/ident/?i=$classname','html_alt':'LXR','html_class':'LXR'},{'top':1,'left':0,'width':1,'height':1,'html_href':'http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/$pypath?view=markup#$pyline','html_alt':'CVS','html_class':'CVS'}]}"), #CVS markup view doesn't allow line number links, only annotate view (which doesn't then highlight the code...)
22  'node_graphs':('Produce individual graphs focussing on each node','boolean',False),
23  'node_graphs_restrict':('Select which nodes to make node graphs for','string',''),
24  'node_depth':('Search depth for individual node graphs','int',1),
25  'font_name':('Font name','string','Times-Roman'),
26  'font_size':('Font size','int',8),
27  'png_max_size':('Maximum edge for png image','int',16768)
28  }

Definition at line 265 of file DOTExport.py.

Referenced by FileExportPlugin.FileExportPlugin.listOptions().

string DOTExport.DotExport.plugin_name = 'DOT Export'
static

Definition at line 293 of file DOTExport.py.

Referenced by FileExportPlugin.FileExportPlugin.pluginName().

DOTExport.DotExport.shapes

Definition at line 299 of file DOTExport.py.