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

Feature: Non-bendy graph paths #668

Open
2 tasks done
Dhghomon opened this issue Feb 4, 2025 · 0 comments
Open
2 tasks done

Feature: Non-bendy graph paths #668

Dhghomon opened this issue Feb 4, 2025 · 0 comments
Labels
feature New feature or request triage This issue is new

Comments

@Dhghomon
Copy link
Contributor

Dhghomon commented Feb 4, 2025

Is your feature request related to a problem?

The following code to simulate the distances in the Solar System works pretty well, until you get past Saturn and the paths get too long. At that point they bend back on each other so much that it all ends up looking like a big ball of string.

CREATE the:counter SET val = 1;

DEFINE FUNCTION fn::make_path($from: record<body>, $to: record<body>, $steps: int) {
    FOR $step IN 0..=$steps {
        IF $step = 0 {
            UPDATE ONLY the:counter SET val += 1;
            LET $next = type::thing("way", the:counter.val);
            CREATE ONLY $next;
            RELATE $from->to->$next;
        }
        ELSE IF $step = $steps {
            LET $current = type::thing("way", the:counter.val);
            RELATE $current->to->$to;
        } ELSE {
            LET $this_stop = type::thing("way", the:counter.val);
            UPDATE ONLY the:counter SET val += 1;
            LET $next = type::thing("way", the:counter.val);
            CREATE ONLY $next;
            RELATE $this_stop->to->$next;
        }
    }    
};

CREATE body:sun, body:earth, body:venus, body:mercury, body:mars, body:jupiter, body:saturn/*, body:uranus, body:neptune, body:pluto, body:eris*/;

fn::make_path(body:sun, body:mercury, 1);
fn::make_path(body:sun, body:venus, 2);
fn::make_path(body:sun, body:earth, 3);
fn::make_path(body:sun, body:mars, 4);
fn::make_path(body:sun, body:jupiter, 13);
fn::make_path(body:sun, body:saturn, 24);
-- fn::make_path(body:sun, body:uranus, 48);
-- fn::make_path(body:sun, body:neptune, 75);
-- fn::make_path(body:sun, body:pluto, 102);
-- fn::make_path(body:sun, body:eris, 173);

SELECT id, ->to->? FROM body, way;

Describe the solution

A box to click on if you prefer straight paths. When choosing straight paths, they will move outward and thus the display area will be chosen by the longest path. In the case of the Solar System example, Eris would be the longest line, the next closer bodies would be consecutively smaller, and by the time you get to the Inner Solar System you can't see it without zooming in.

Like this

Image

Have you considered contributing this feature yourself?

No response

Contact Details

Slack

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Dhghomon Dhghomon added feature New feature or request triage This issue is new labels Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request triage This issue is new
Projects
None yet
Development

No branches or pull requests

1 participant