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

Mark cyclic dependencies red #3

Closed
ellcs opened this issue Apr 26, 2017 · 7 comments
Closed

Mark cyclic dependencies red #3

ellcs opened this issue Apr 26, 2017 · 7 comments

Comments

@ellcs
Copy link

ellcs commented Apr 26, 2017

I hate dependency cycles. I like to get rid of them. I would like to use rubrowser to find them.
So what about an option to mark cyclic dependencies?

Cheers, ellcs

@emad-elsaid
Copy link
Owner

Sure, I will try to work on it as soon as possible

@emad-elsaid
Copy link
Owner

Proposed change:

  • Backend definition base class should have a method cyclic? that tells us if this class is part of cyclic dependencies
  • JSON formatter should output this property to the frontend
  • Graph should add a class to any node with cyclic attribute = true
  • switch that add/remove class to graph to apply red color,
  • css class that paint circles with red if graph has a certain class

@ellcs
Copy link
Author

ellcs commented Apr 28, 2017

Glad to hear that! 👍

Which algorithm do you use for the cycle detection? I think there should be something like strong component detection in graph theory.

https://en.wikipedia.org/wiki/Strongly_connected_component#Algorithms

@emad-elsaid
Copy link
Owner

I didn't research this part yet, also if there is a gem that already has these algorithms implemented it would be great to utilise it instead of writing the algorithm ourselves

@ellcs
Copy link
Author

ellcs commented Apr 28, 2017

Looks like that there is a algorithm in ruby itself. 🎁

http://ruby-doc.org/stdlib-2.0.0/libdoc/tsort/rdoc/TSort.html

@steven-solomon
Copy link
Contributor

steven-solomon commented Aug 18, 2017

If anyone is interested in pairing, I would love to make a start on this

@emad-elsaid
Copy link
Owner

yes, sure that would be great, maybe we can mark any node that is part of a cyclic dependency with extra attribute.
and lets have the rendering of this attribute to later after we are done with the backend part.

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

No branches or pull requests

3 participants