mirror of https://gitee.com/bigwinds/arangodb
custom visitors
This commit is contained in:
parent
3ffdfe0756
commit
94a362c3c7
|
@ -630,7 +630,7 @@ function post_api_traversal(req, res) {
|
|||
|
||||
if (json.visitor !== undefined) {
|
||||
try {
|
||||
visitor = new Function('config', 'result', 'vertex', 'path', json.visitor);
|
||||
visitor = new Function('config', 'result', 'vertex', 'path', 'connected', json.visitor);
|
||||
}
|
||||
catch (err4) {
|
||||
return badParam(req, res, "invalid visitor function");
|
||||
|
|
|
@ -5806,7 +5806,13 @@ function CALCULATE_SHORTEST_PATHES_WITH_DIJKSTRA (graphName, options) {
|
|||
params.weight = options.weight;
|
||||
params.defaultWeight = options.defaultWeight;
|
||||
params = SHORTEST_PATH_PARAMS(params);
|
||||
params.visitor = TRAVERSAL_DIJSKTRA_VISITOR;
|
||||
// add user-defined visitor, if specified
|
||||
if (typeof options.visitor === "string") {
|
||||
params.visitor = GET_VISITOR(options.visitor, params);
|
||||
}
|
||||
else {
|
||||
params.visitor = TRAVERSAL_DIJSKTRA_VISITOR;
|
||||
}
|
||||
var result = [], fromVertices = RESOLVE_GRAPH_TO_FROM_VERTICES(graphName, options),
|
||||
toVertices = RESOLVE_GRAPH_TO_TO_VERTICES(graphName, options);
|
||||
|
||||
|
|
Loading…
Reference in New Issue