MerrimanInd / MerrimanInd/drawpyo
Missing TreeDiagram support for multiple pages / page naming
- Dominant language
- Python
- Stars
- 412
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
I want to generate one DrawIO file with multiple pages, one TreeDiagram per page. The problem here is that TreeDiagram instantiates its own File and Page object right in the constructor.
I'm currently doing something like
```
def generate_page(start_node) -> Page:
return tree_diagram.page
def write_file():
base_diagram = TreeDiagram(file_path="", file_name="something.drawio")
del base_diagram.page.file
for page_name, start_node in stuff.items():
page = generate_page()
page.diagram.name = page_name
page.file = base_diagram.file
base_diagram.write()
```
What I'd like is I think two-fold, for the TreeDiagram constructor:
Optional passing in of a File object. This is mutually exclusive with the pair of file_name/file_path.
Optional passing in of a page name
As before I'm happy to make the PR but since you say you want an issue and discussion first, here you go.
Contributor guide
Research direction
Start at the TreeDiagram constructor and inspect how it creates its File and Page objects. Review the File, Page, and write flow, then verify that callers can reuse a File, assign page names, and write one DrawIO file containing multiple pages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100