我真的很喜欢这个为 popoto.js 的 cypher 查询构建的图形查询,但我想预定义经常使用的 cypher 查询,是否有可能以某种方式“注入(inject)”一些查询?
http://www.popotojs.com/examples.html
特别是在这里:http://www.popotojs.com/live/graph-results/index.html 您可以通过单击(顶部)和结果(底部)来创建查询,但只是视觉上的。但我希望有多个按钮用于一些标准查询,而不采用视觉方式。
谢谢:)
最佳答案
在最新版本 ( 1.1.2 ) 中,您可以使用新功能以预定义状态打开或保存图表。
查看一个简单的示例 here 。您可以直接查看页面源代码以查看详细信息。
简而言之,您可以使用这些代码示例来实现此类功能:
// This property will add a save icon in graph:
popoto.tools.SAVE_GRAPH = true;
// Add a listener on graph save icon click where you can save the graph
popoto.graph.onSave(function (graph) {/* save your graph here */});
// Or get current graph schema at any time that can be saved
popoto.graph.getSchema();
// Start can be called with a saved graph
popoto.start(savedGraph);
// This can also be done at any time to load a graph
popoto.graph.setDefaultGraph(savedGraph);
popoto.tools.reset();
关于javascript - popoto.js - 预定义密码查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43700683/