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

Layout mechanism in drawing #28

Open
mojaie opened this issue Aug 2, 2020 · 2 comments
Open

Layout mechanism in drawing #28

mojaie opened this issue Aug 2, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@mojaie
Copy link
Owner

mojaie commented Aug 2, 2020

  • Position of atom/bond indices
  • Position of charges and electrons
  • Merge molecules
  • Add annotation text (descriptors, functional groups)
@mojaie mojaie added the enhancement New feature or request label Aug 2, 2020
@timholy
Copy link
Contributor

timholy commented Dec 1, 2020

One thought I've had here is to interface with GraphPlot. Currently it requires LightGraphs but perhaps one could generalize it. One of the easiest ways might be to export an adjacency matrix like

struct AdjacencyMatrix{G<:AbstractGraph} <: AbstractMatrix{Bool}
    g::G
end

Base.size(A::AdjacencyMatrix) = (n = nodecount(A.g); return (n, n))

Base.getindex(A::AdjacencyMatrix, i::Int, j::Int) = hasedge(A.g, i, j)

and then modify GraphPlot to accept an adjacency matrix. You'd also need to supply node labels, but the package already looks like it supports that. Trickier would be double & triple bonds, but again that could probably be implemented there.

@timholy
Copy link
Contributor

timholy commented Dec 1, 2020

Now that I think about it, for chemical graphs it may not make a lot of sense, because there are bond-angle constraints that it would be nice to respect.

This idea came up for me more in the context of #42, trying to understand the nature of the graph (by visualization) constructed by that call to plaingraph. Might be useful for the general-purpose MolecularGraph.Graph, but perhaps not for actual molecules.

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

2 participants