I did the latest git pull and the code changes were in there as @louis had mentioned. However, I am still not seeing multiple links. I am using xdp for link detection.
New pull request the issue
Do not optimize if array $config[ânetwork_map_itemsâ] contains âmacâ.
Currently on master, I only see 1 link between devices on the map instead of all the links of the aggregate (I have $config['network_map_items'] = ["xdp"];
)
Still works on my side
You should debug print-map.inc.php to see whatâs going on
Any hint on how to debug it ? Iâm not really familiar with this part
I took a look at the generated JSON code used by viz and it looks like all the data is there (all the links) so I assume they are all overlapping ?
Well done
In that case, try with this config
$config[ânetwork_map_vis_optionsâ] = â{
ânodesâ: {
âcolorâ: {
âbackgroundâ: ârgba(20,252,18,1)â
},
âfontâ: {âsizeâ:20},
âshadowâ: {âenabledâ:true}
},
âphysicsâ: {
âsolverâ: ârepulsionâ,
âminVelocityâ: 1.75,
ârepulsionâ: {
âcentralGravityâ: 0.1,
ânodeDistanceâ: 300,
âspringLengthâ: 300,
âspringConstantâ: 0.05
},
}
}â;
$config[ânetwork_map_legendâ][âdnâ][ânodeâ] = ârgba(193,66,66,1)â;
$config[ânetwork_map_legendâ][âdnâ][âedgeâ] = ârgba(193,66,66,1)â;
Yes, this way I do see multiple links correctly
But on routers with a lot of aggregate between them, they are too close and are quite difficult to read, I suppose there is a configuration for that ?
play with parameters and post them so that we can do a pull request to change default parameters
âphysicsâ: {
âsolverâ: ârepulsionâ,
âminVelocityâ: 1.75,
ârepulsionâ: {
âcentralGravityâ: 0.1,
ânodeDistanceâ: 300,
âspringLengthâ: 300,
âspringConstantâ: 0.05
I started playing with those, I could mostly fix the global map, but with the device level map, I always get the 2 devices completely overlapping, Iâm stil investigating on how to fix this part.
This is my current config
"physics": {
"solver": "repulsion",
"minVelocity": 1.75,
"repulsion": {
"centralGravity": 0.1,
"nodeDistance": 1000,
"springLength": 800,
"springConstant": 0.05
},
}
Hi @kedare @louis !
Please trie using this config. I think the parameter âforceAtlas2Basedâ would help you.
$config[ânetwork_map_vis_optionsâ] = '{
ânodesâ: {
âborderWidthSelectedâ: null,
âcolorâ: {
âhighlightâ: {},
âhoverâ: {}
},
âfontâ: {
âsizeâ: 24,
âstrokeWidthâ: null
},
âshapePropertiesâ: {
âborderRadiusâ: null
},
âsizeâ: null
},
âedgesâ: {
âfontâ: {
âsizeâ: 19,
âalignâ: âtopâ
},
âsmoothâ: {
âforceDirectionâ: ânoneâ
}
},
âphysicsâ: {
âforceAtlas2Basedâ: {
âgravitationalConstantâ: -200,
âcentralGravityâ: 0.005,
âspringLengthâ: 600,
âspringConstantâ: 0.09,
âavoidOverlapâ: 0.29
},
âminVelocityâ: 0.92,
âsolverâ: âforceAtlas2Basedâ
}
}';
This is an example:
Regards
Thank you, indeed this one works better
I still have a few issue with some links but I suppose I just have too many links between some devices
Hi Kedare
Yes, when you have many links between devices its more difficult to make them look right, trie to modify this values:
âcentralGravityâ: 0.005,
âspringLengthâ: 600, <<<<<<< move to 1000
âspringConstantâ: 0.09,
âavoidOverlapâ: 0.29
Regards
Could make a pull request to set that by default ?
That would be great! i will check what are the steps to make a pull request, because i never did it.
Regards
Steps are on github with an account :
- click on fork
- sync to your workstation
git clone https://github.com/your-login/librenms
- create a new branch
git branch network_map_vis_options
- go to branch
git checkout network_map_vis_options
- commit your patch on the branch
git commit -am "network_map_vis_options default
- make a pull request from webui
Hi Louis! This are the logs when i tried to make a pull request:
root@R2D2:/opt/librenms# git commit -am ânetwork_map_vis_options defaultâ
On branch network_map_vis_options
Untracked files:
includes/my-port-descr-parser.inc.php
librenms/
nothing added to commit but untracked files present
The modification on the code doesnât figure because the "config[ânetwork_map_vis_optionsâ] " is in config.php?
root@R2D2:/opt/librenms# git add config.php
The following paths are ignored by one of your .gitignore files:
config.php
Use -f if you really want to add them.
Regards
I think the default options are set in ./misc/config_definitions.json ? (But nore sure, btw config.php.default still refers to includes/default.inc.php that is gone)
config.php should not be in the git repository indeed (as itâs specific to your setup)
Yes, it looks like the default config of network map is in â/misc/config_definitions.jsonâ
> "network_map_vis_options": {
> "default": "{\n layout:{\n randomSeed:2\n },\n \"edges\": {\n arrows: {\n to: {enabled: true, scaleFactor:0.5},\n },\n \"smooth\": {\n enabled: false\n },\n font: {\n size: 14,\n color: \"red\",\n face: \"sans\",\n background: \"white\",\n strokeWidth:3,\n align: \"middle\",\n strokeWidth: 2\n }\n },\n \"physics\": {\n \"barnesHut\": {\n \"gravitationalConstant\": -2000,\n \"centralGravity\": 0.3,\n \"springLength\": 200,\n \"springConstant\": 0.04,\n \"damping\": 0.09,\n \"avoidOverlap\": 1\n },\n\n \"forceAtlas2Based\": {\n \"gravitationalConstant\": -50,\n \"centralGravity\": 0.01,\n \"springLength\": 200,\n \"springConstant\": 0.08,\n \"damping\": 0.4,\n \"avoidOverlap\": 1\n },\n\n \"repulsion\": {\n \"centralGravity\": 0.2,\n \"springLength\": 250,\n \"springConstant\": 0.2,\n \"nodeDistance\": 200,\n \"damping\": 0.07\n },\n\n \"hierarchicalRepulsion\": {\n \"nodeDistance\": 300,\n \"centralGravity\": 0.2,\n \"springLength\": 300,\n \"springConstant\": 0.2,\n \"damping\": 0.07\n },\n\n \"maxVelocity\": 50,\n \"minVelocity\": 0.4,\n \"solver\": \"hierarchicalRepulsion\",\n \"stabilization\": {\n \"enabled\": true,\n \"iterations\": 1000,\n \"updateInterval\": 100,\n \"onlyDynamicEdges\": false,\n \"fit\": true\n },\n\n \"timestep\": 0.4,\n }\n}",
> "type": "text"
> },
yes do
git add misc/config_definitions.json