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

Alternative draw_lines methods #289

Open
mtennekes opened this issue Jan 6, 2025 · 1 comment
Open

Alternative draw_lines methods #289

mtennekes opened this issue Jan 6, 2025 · 1 comment
Labels
feature 🎁 Request a new feature

Comments

@mtennekes
Copy link

mtennekes commented Jan 6, 2025

I'm looking for alternative methods to draw lines between nodes. For instance, curved arcs

or half lines:

image

I'm happy to write my own functions, but would like to know what the easiest method is to 'submit' the created sf linestrings to the sfnetwork object.

So far I found out: that for an sfnetwork object x created with edges_as_lines = FALSE, I can add straight lines with

x = sfnetworks:::explicative_edges(x)

which runs sfnetworks:::draw_lines under the hood.

What would be helpful is a function like for instance::

x = explicitize_edges(x, fun = draw_curved_arcs, curvature = 15)

where

draw_curved_arcs = function(sfc_from, sfc_to, curvature = 30) {... }

is a just an example similar to draw_lines but user defined.

@luukvdmeer
Copy link
Owner

I like the idea to increase flexibility in this way. Will add it to the to-do list of v1.0

@luukvdmeer luukvdmeer added the feature 🎁 Request a new feature label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🎁 Request a new feature
Projects
None yet
Development

No branches or pull requests

2 participants