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

Provide a function to generate NetworkGraph #90

Open
PabloCastellano opened this issue Jun 22, 2020 · 1 comment
Open

Provide a function to generate NetworkGraph #90

PabloCastellano opened this issue Jun 22, 2020 · 1 comment

Comments

@PabloCastellano
Copy link
Contributor

PabloCastellano commented Jun 22, 2020

The _netjson_networkgraph function is used to generate a NetJSON NetworkGraph.

https://github.com/openwisp/netdiff/blob/master/netdiff/utils.py#L127

Right now it is more like an internal function. It would be nice providing it to the module users so that they don't have to reinvent the wheel so much.

For example, in openwisp-network-topology, the json method of the Topology model is already reinventing it:

https://github.com/openwisp/openwisp-network-topology/blob/fac83331cee7194aef4ba92f0a5fa067d3597aac/openwisp_network_topology/base/topology.py#L139-L169

@nemesifier
Copy link
Member

I'm not sure I see the benefit in doing this. Creating a NetworkGraph JSON object is pretty easy and the way it's constructed depends on the application internals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants