Giter VIP home page Giter VIP logo

Comments (2)

hexaeder avatar hexaeder commented on July 18, 2024 1

I agree that this would look nice.

It is however quite hard to find the correct positions of the arrowheads a priori. The arrowheads are placed in data space, their position depends on:

  • the size&shape of the node marker
  • the size&shape of the arrow head

For triangular markes for example there is also a dependency on the direction. Additionally, the marker space is (per default) different from data space (i.e. the arrows and nodes won't change size if you zoom in and out of the figure). So it should also depend on

  • markerspace for both arrows and node symbols and
  • the relation of markerspace and dataspace (i.e. current zoom level of axis).

In presence of curvy edges, the problem becomes trickier since the relation between position on edge and distance between node and arrow marker is non-linear.

This is why I've decided to throw the nicer aesthetics out of the window and go with markers in the center of a the edges in the first place. And tbh for me this reasoning still holds and its not worth the hassle. But maybe I am missing something and if there is a relatively straight forward way of calculating those positions!

In the mean time it might be worth investigating a function which fixes this after the plot (similar to your manual approach). Something like

fig, ax, p = graphplot(...)
move_arrows_to_nodes!(p)

Under the assumption that there are some Makie internals to calculate the intersection between arrow marker and node markers on a per edge base, this data could be used to bisect the the arrow_shift parameter for each edge until the markers barely touch. Obviously this brute force method is far to inefficient to become part of the "normal" graphplot pipeline.

from graphmakie.jl.

hdavid16 avatar hdavid16 commented on July 18, 2024

Makes sense...

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.