Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

real life diagrams - part 1 #68

Open
PiotrJustyna opened this issue Sep 5, 2024 · 7 comments
Open

real life diagrams - part 1 #68

PiotrJustyna opened this issue Sep 5, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@PiotrJustyna
Copy link
Owner

PiotrJustyna commented Sep 5, 2024

Try to replicate a real life diagram:

source

@PiotrJustyna PiotrJustyna self-assigned this Sep 5, 2024
@PiotrJustyna PiotrJustyna added the enhancement New feature or request label Sep 6, 2024
@PiotrJustyna
Copy link
Owner Author

Take 1: fail fast, fail cheap...

svg:

real-life-diagram-1-diagram

input:

[
    {
        "iconDescription": "transport",
        "iconKind": "Title",
        "iconName": "1",
        "iconNamesOfDependentIcons": [
            "2"
        ]
    },
    {
        "iconDescription": "Cryopreservation",
        "iconKind": "Headline",
        "iconName": "2",
        "iconNamesOfDependentIcons": [
            "3"
        ]
    },
    {
        "iconDescription": "perfusion",
        "iconKind": "Question",
        "iconName": "3",
        "iconNamesOfDependentIcons": [
            "4",
            "6"
        ]
    },
    {
        "iconDescription": "perfuse the brain",
        "iconKind": "Action",
        "iconName": "4",
        "iconNamesOfDependentIcons": [
            "6"
        ]
    },
    {
        "iconDescription": "The end",
        "iconKind": "End",
        "iconName": "6",
        "iconNamesOfDependentIcons": []
    }
]

@PiotrJustyna
Copy link
Owner Author

It's a problem with LayoutEngine as this is what I'm getting in the layout file:

[
    {
        "icon": {
            "iconDescription": "transport",
            "iconKind": "Title",
            "iconName": "1",
            "iconNamesOfDependentIcons": [
                "2"
            ]
        },
        "iconPositionX": 0,
        "iconPositionY": 0
    },
    {
        "icon": {
            "iconDescription": "Cryopreservation",
            "iconKind": "Headline",
            "iconName": "2",
            "iconNamesOfDependentIcons": [
                "3"
            ]
        },
        "iconPositionX": 0,
        "iconPositionY": -1
    },
    {
        "icon": {
            "iconDescription": "perfusion",
            "iconKind": "Question",
            "iconName": "3",
            "iconNamesOfDependentIcons": [
                "4",
                "6"
            ]
        },
        "iconPositionX": 0,
        "iconPositionY": -2
    },
    {
        "icon": {
            "iconDescription": "The end",
            "iconKind": "End",
            "iconName": "6",
            "iconNamesOfDependentIcons": []
        },
        "iconPositionX": 0,
        "iconPositionY": -3
    },
    {
        "icon": {
            "iconDescription": "perfuse the brain",
            "iconKind": "Action",
            "iconName": "4",
            "iconNamesOfDependentIcons": [
                "6"
            ]
        },
        "iconPositionX": 2,
        "iconPositionY": -3
    }
]

@PiotrJustyna
Copy link
Owner Author

PiotrJustyna commented Sep 6, 2024

Progress - I had a bug in the layout engine. It simply disregarded the order in which dependencies were defined. Resolved here: c0db4b3

But we have a new problem. Althought invisible, the connection between perfusion" question and "The end" does exist - it just runs in straight line behind "perfuse the brain" action icon which is incorrect. The expected behavior is that the connection should go around the action icon as in the original diagram. Will have to correct it next.

real-life-diagram-1-diagram

@PiotrJustyna
Copy link
Owner Author

PiotrJustyna commented Sep 8, 2024

@PiotrJustyna
Copy link
Owner Author

OK, I feel like I'm making steady progress:

drakon-diagram

Bypassing multiple icons 🎉

But now a quick break to work on a related issue, link shortly.

@PiotrJustyna
Copy link
Owner Author

More progress:

Image

@PiotrJustyna
Copy link
Owner Author

A bit of a detour in the last 2 weeks but managed to rewrite the layout engine and remove the dependency on the ghc package (directed graphs).

drakon-diagram

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant