Skip to content

Render Event human readable name #600

@denisSurkov

Description

@denisSurkov

Event has human readable name, but graph labels do not use it. Is it possible to fix it?

from statemachine import StateMachine, State, Event
from statemachine.contrib.diagram import DotGraphMachine


class ExampleStateMachine(StateMachine):
    active = State(name='Active Human Text', initial=True)
    suspended = State(name='Suspended Human Text', final=True)

    suspend = Event(
        active.to(suspended),
        name="Human Suspend",
    )

graph_machine = DotGraphMachine(ExampleStateMachine)
g = graph_machine()
g.write_png('example.png')
Image

Thank you for this nice library!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions