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

Revisiting the directionality of edges (Nov 2018) #131

Closed
jayqi opened this issue Nov 18, 2018 · 5 comments
Closed

Revisiting the directionality of edges (Nov 2018) #131

jayqi opened this issue Nov 18, 2018 · 5 comments
Assignees
Labels

Comments

@jayqi
Copy link
Collaborator

jayqi commented Nov 18, 2018

Right now we have a convention:

    # Convention: If B depends on A, then B is the TARGET 
    # and A is the SOURCE so that it looks like A -> B

This was chosen as the convention by democratic polling among pkgnet authors back about a year ago or so.

I would like to reopen the discussion for the reason that our current convention disagrees with UML which a lot of other applications out there follow.

Unified Modeling Language (UML)

UML is a widely used modeling framework for software engineering that is also an ISO standard.

For diagramming dependencies:

In the UML, this is indicated by a dashed line pointing from the dependent (or client) to the independent (or supplier) element. The arrow representing a Dependency specifies the direction of a relationship, not the direction of a process.

For class diagrams showing inheritance

To model inheritance on a class diagram, a solid line is drawn from the child class (the class inheriting the behavior) with a closed, unfilled arrowhead (or triangle) pointing to the super class.

@jayqi
Copy link
Collaborator Author

jayqi commented Nov 23, 2018

Examples of other people:

Dependency graph

I googled "dependency graph visualization" and clicked on a bunch of stuff on the first page. Everything I looked at either had no directionality or had directionality consistent with UML: dependent -> independent.

Dependent -> Independent

Examples using this convention:

Independent -> Dependent

Didn't find any.

Inheritance graph

Child -> Parent

Examples using this convention:

Parent -> Child

Examples using this convention:

  • Sphinx, the Python docs generator

@jameslamb
Copy link
Collaborator

I think @jayqi makes a pretty convincing point that we should switch the order of inheritance.

If we decide to, I think we need to pull this into v0.3.0 milestone since I want to do some publicity around that release and it would suck to get people into using pkgnet and then release a big breaking change in a followup release.

@jayqi
Copy link
Collaborator Author

jayqi commented Nov 25, 2018

I think this also makes more sense if we consider the network measures we calculate.

For example, PageRank:

PageRank works by counting the number and quality of links to a page to determine a rough estimate of how important the website is. The underlying assumption is that more important websites are likely to receive more links from other websites.

In the Independent -> Dependent convention, a function is considered high-score if it has a dependency on functions that depends on a lot of other functions? This measures some sort of complexity of a function and not its importance in graph. People usually don't use PageRank in this way.

Whereas in the Dependent -> Independent convention, a function is considered high-score if it is depended on by functions that are depended on by a lot of other functions. This is more in-line with the normal interpretation of PageRank, which measures importance of a node.

@bburns632
Copy link
Collaborator

Ok @jayqi & @jameslamb. You make a convincing argument. What I am hearing is that there is a UML convention and adhering to that convention will make it easier to integrate with other packages and for them to integrate with us. The only potential counterpoint I can think of is edge aesthetics which is subjective and a minor point comparatively.

Let's fit this in the next release, v0.3.0.

@bburns632 bburns632 added this to the Release v0.3.0 milestone Nov 30, 2018
@jayqi
Copy link
Collaborator Author

jayqi commented Dec 3, 2018

It's funny Sphinx is the only one that does it the other way. There's a two-year-old open issue about it where people say it's more common to see the UML convention.

jayqi added a commit to jayqi/pkgnet that referenced this issue Dec 4, 2018
jayqi added a commit to jayqi/pkgnet that referenced this issue Dec 4, 2018
@jayqi jayqi self-assigned this Dec 5, 2018
jayqi added a commit to jayqi/pkgnet that referenced this issue Dec 9, 2018
jayqi added a commit to jayqi/pkgnet that referenced this issue Dec 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants