Exemplo n.º 1
0
Of course if I could find a graphviz-as-as-JS service, that would be cooler...
"""


from __future__ import absolute_import, print_function
import json
from string import Template
from subprocess import PIPE, Popen
from pkg_resources import resource_filename
from pythiaplotter.utils.logging_config import get_logger
from pythiaplotter.utils.common import generate_repr_str
from pythiaplotter.utils.pdgid_converter import pdgid_to_string


log = get_logger(__name__)


class VisPrinter(object):

    def __init__(self, opts):
        """
        Parameters
        ----------
        opts : Argparse.Namespace
            Set of options from the arg parser.

        Attributes
        ----------
        output_filename : str
            Final web page output filename
Exemplo n.º 2
0
Several stages:
1. Go through nodes & edges and attach display attributes [add_display_attr()]
2. Write to Graphviz format file [write_gv()]
3. Render to file [print_diagram()]
"""

from __future__ import absolute_import
import os
from string import Template
from subprocess import call, PIPE, Popen
from pythiaplotter.utils.logging_config import get_logger
from pythiaplotter.utils.common import generate_repr_str
from .dot_display_classes import DotNodeAttrGenerator, DotEdgeAttrGenerator, DotGraphAttrGenerator

log = get_logger(__name__)


class DotPrinter(object):
    """Class to print event to file using Graphviz"""
    def __init__(self, opts):
        """

        Parameters
        ----------
        opts : Argparse.Namespace
            Set of options from the arg parser.

        Attributes
        ----------
        output_filename : str