Example #1
0
def graph (app_type) :
    """Class/association graph describing MOM meta object model"""
    doc_p = hasattr (MOM, "Document")
    iht_p = hasattr (MOM, "Id_Entity_has_Tag")
    result = MOM.Graph.Spec.Graph \
        ( app_type
        , ET.MOM.Id_Entity
            ( Child.MOM.Object    (offset     = CD.N)
            , Child.MOM.Link1
                ( Attr.left       (guide_prio = 0.25)
                , offset     = CD.W
                )
            , Child.MOM._Link_n_
                ( Attr.left       (guide_prio = 0.25)
                , Attr.right      (guide_prio = 0.75)
                , Child.MOM.Link2
                    ( offset = CD.E
                    )
                , Child.MOM.Link3
                    ( Attr.middle ()
                    , offset = CD.W
                    )
                , guide_prio = 0.5
                , offset     = CD.S
                )
            ,
            )
        , desc  = _T ("Graph displaying MOM meta object model")
        , title = _T ("MOM graph")
        )
    if doc_p :
        result ["MOM.Link1"]._add \
            ( Child.MOM.Document
                ( offset     = CD.N
                )
            )
    if iht_p :
        result ["MOM.Id_Entity"]._add \
            ( ET.MOM.Id_Entity_has_Tag
                ( IS_A.MOM.Link2
                , Role.left  ()
                , Role.right
                    ( IS_A.MOM.Object
                    , offset     = CD.N
                    )
                , offset     = CD.E
                )
            )
    return result