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

Document how to clone a DirectedGraph #59

Open
ChrisRus opened this issue Feb 27, 2019 · 0 comments
Open

Document how to clone a DirectedGraph #59

ChrisRus opened this issue Feb 27, 2019 · 0 comments
Labels

Comments

@ChrisRus
Copy link
Member

Add documentation about how to clone a DirectedGraph instance (because it's not necessarily obvious).

Currently, the best way is as follows:

const arccore = require("@encapsule/arccore");
var response = arccore.graph.directed.create({ name: "Source Graph" });
if (response.error) throw new Error(response.error);
var sourceDigraph = response.result;

// Clone sourceDigraph
response = arccore.graph.directed.create(sourceDigraph.toJSON());
if (response.error) throw new Error(response.error);
var clonedDigraph = response.result;
@ChrisRus ChrisRus added the docs label Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant