https://github.com/redsift/d3-rs-network
https://github.com/redsift/d3-rs-network
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/redsift/d3-rs-network
- Owner: redsift
- License: mit
- Created: 2018-04-16T12:17:56.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-16T14:57:43.000Z (about 2 years ago)
- Last Synced: 2025-09-04T11:43:52.338Z (9 months ago)
- Language: HTML
- Size: 1.25 MB
- Stars: 0
- Watchers: 18
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# d3-rs-network
[](https://circleci.com/gh/redsift/d3-rs-network)
[](https://www.npmjs.com/package/@redsift/d3-rs-network)
[](https://raw.githubusercontent.com/redsift/d3-rs-network/master/LICENSE)
`d3-rs-network`
## Usage
### Browser
let VIZ = {
"nodes": [
{ id: "grandparent1", strata: 0 },
{id: "parent1", strata: 1},
{id: "child1", strata: 2},
{id: "child2", strata: 2},
{id: "child3", strata: 2, friendlyName: "napoleon"},
{id: "child4", strata: 2},
{ id: "grandparent2", strata: 0 }
// ...
],
"links": [
{ source: "grandparent1", target: "grandparent2", value: 40, color: 'red' },
{ source: "child1", target: "child3", value: 10.34, color: 'red' },
{ source: "child2", target: "child3", value: 10.34, color: 'red' }
// ...
],
"owns": [
{ parent: "grandparent1", child: "parent1" },
{ parent: "parent1", child: "child1" },
{ parent: "parent1", child: "child2" },
// ...
]
};
var chart = d3_rs_network.html('blank').category(category)
.tryGetChildren(tryGetChildren).tryGetParent(tryGetParent)
.tryGetIndexBrothers(tryGetIndexBrothers).tryGetNumberOfBrothers(tryGetNumberOfBrothers)
.textDisplay(textDisplay)
;
d3.select('body').datum(VIZ).call(chart);
### ES6
import { html as chart } from "@redsift/d3-rs-network";
let eml = chart();
...
### Require
var chart = require("@redsift/d3-rs-network");
var eml = chart.html();
...
### TODO
Additional functions for customisation of the visualizations.
- Size of circles depending of given parameter as input
- Color of circles depending on strata
- Width of lines depending of given parameter as input
- Color of lines depending of given parameter as input
- Saturation of lines depending of given parameter as input
- Possibility to display different hierarchy of links