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

Bugfix/90 prevent graph cycles #104

Merged

Conversation

TheCrimsonKing92
Copy link
Contributor

This PR resolves #90. A minimal change in compiler.js exposes a new detectCycles function, which is leveraged in editor.js for detection and prevention. Additionally, a new dialog is spawned when a cycle is prevented, and while I have endeavored to imitate the style of the repository, I made a stylistic choice to omit text centering in the new dialog box (though this can of course be added).

Comments, questions, and feedback are welcomed.

@maximecb maximecb merged commit 41fae15 into maximecb:main Apr 5, 2023
maximecb added a commit that referenced this pull request Apr 5, 2023
@maximecb
Copy link
Owner

maximecb commented Apr 5, 2023

Seems I merged this too fast. There is a bug:

editor.js:166 Uncaught ReferenceError: Model is not defined
    at Editor.detectCycles (editor.js:166:21)
    at UINode.portClick (editor.js:1123:24)
    at portDiv.onpointerup (editor.js:1146:23)

I think we should probably also move the detectCycles logic into the Model class.

Reverting for now.

@TheCrimsonKing92
Copy link
Contributor Author

@maximecb I apologize, I see I missed an import during cleanup. I'll refactor and create a new PR with modified contents.

@maximecb
Copy link
Owner

maximecb commented Apr 5, 2023

No worries :)

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

Successfully merging this pull request may close these issues.

Illegal graph components delete graph on reload
2 participants