Giter VIP home page Giter VIP logo

Comments (3)

hexaeder avatar hexaeder commented on July 18, 2024

Hello :)
yeah this part may be confusing. GraphMakie does not know anything about the internals of NetworkLayout. It just wants a function layout, any function really, which takes a Graph object as an input and returns a vector of node positions.
If you want to use fixed points you can just define a function which returns the same set of points for every graph:

fixed_layout = (g) -> points

The full example looks like this

julia> using GLMakie, GraphMakie, Graphs;

julia> positions = Point.([(0,0), (1,0), (1,1)])

julia> g = complete_graph(3);

julia> graphplot(g; layout=_->positions)

grafik

from graphmakie.jl.

fbanning avatar fbanning commented on July 18, 2024

It just wants a function layout, any function really, which takes a Graph object as an input and returns a vector of node positions.

Ah, that's the key part I was missing! Thank you for getting back to me with the explanation and a simple example. Definitely cleared things up for me and now things are working as expected. :)

It might be helpful to make this a bit clearer in GraphMakie's docs. Would you be interested in a PR for this?

from graphmakie.jl.

hexaeder avatar hexaeder commented on July 18, 2024

Yeah for sure, PRs welcome! The docstring of graphplot mentions this but very briefly

https://github.com/JuliaPlots/GraphMakie.jl/blob/649f1aec493bc57fdd3ca66e57d6b5eaaf946af4/src/recipes.jl#L27

and the part about layouts could also be better...

from graphmakie.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.