anvaka / anvaka/ngraph.graph

About weighted graph support.

Open
#39 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
580
Forks
72
PR merge metrics
No merged PRs in 30d

Description

Hello, lots of thanks for your great work on graph in js.

Here is question I've encountered in using these awesome projects. I am using `pm` to visualize some GitHub projects networks and it works fine right now but I need link weight support from the layout generation method.

I am using `ngraph.offline.layout` right now and I looked into the projects and I found that actually the physical simulator supports link weight/length in spring force calculation. But as this project is the basic data structure of `ngraph` and the type of `addLink` method only supports `fromId`, `toId` and `data` for custom data store.

Right now I need to do this as a work around:

```
(addLink(fromId, toId) as any).length = l;
```

Should I modify the interface to let users know that link length is supported already?

Thank you for your awesome work again~

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the addLink interface in ngraph.graph and trace how link data is exposed to ngraph.offline.layout and its physical simulator. Confirm how link length is used in spring-force calculation, then define and test an explicit supported way to provide link length instead of assigning it through a type escape hatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.