gpt4 book ai didi

javascript - Sigma js无法加载外部gexf

转载 作者:行者123 更新时间:2023-11-28 00:58:29 27 4
gpt4 key购买 nike

https://github.com/jacomyal/sigma.js 下载 sigma.js zip尝试 gexf 文件的基本加载。不幸的是,html-load-external-gexf.html 没有加载任何图表。

    <!-- START SIGMA IMPORTS -->
<script src="../src/sigma.core.js"></script>
<script src="../src/conrad.js"></script>
<script src="../src/utils/sigma.utils.js"></script>
<script src="../src/utils/sigma.polyfills.js"></script>
<script src="../src/sigma.settings.js"></script>
<script src="../src/classes/sigma.classes.dispatcher.js"></script>
<script src="../src/classes/sigma.classes.configurable.js"></script>
<script src="../src/classes/sigma.classes.graph.js"></script>
<script src="../src/classes/sigma.classes.camera.js"></script>
<script src="../src/classes/sigma.classes.quad.js"></script>
<script src="../src/captors/sigma.captors.mouse.js"></script>
<script src="../src/captors/sigma.captors.touch.js"></script>
<script src="../src/renderers/sigma.renderers.canvas.js"></script>
<script src="../src/renderers/sigma.renderers.webgl.js"></script>
<script src="../src/renderers/sigma.renderers.def.js"></script>
<script src="../src/renderers/webgl/sigma.webgl.nodes.def.js"></script>
<script src="../src/renderers/webgl/sigma.webgl.nodes.fast.js"></script>
<script src="../src/renderers/webgl/sigma.webgl.edges.def.js"></script>
<script src="../src/renderers/webgl/sigma.webgl.edges.fast.js"></script>
<script src="../src/renderers/webgl/sigma.webgl.edges.arrow.js"></script>
<script src="../src/renderers/canvas/sigma.canvas.labels.def.js"></script>
<script src="../src/renderers/canvas/sigma.canvas.hovers.def.js"></script>
<script src="../src/renderers/canvas/sigma.canvas.nodes.def.js"></script>
<script src="../src/renderers/canvas/sigma.canvas.edges.def.js"></script>
<script src="../src/renderers/canvas/sigma.canvas.edges.curve.js"></script>
<script src="../src/renderers/canvas/sigma.canvas.edges.arrow.js"></script>
<script src="../src/renderers/canvas/sigma.canvas.edges.curvedArrow.js"></script>
<script src="../src/middlewares/sigma.middlewares.rescale.js"></script>
<script src="../src/middlewares/sigma.middlewares.copy.js"></script>
<script src="../src/misc/sigma.misc.animation.js"></script>
<script src="../src/misc/sigma.misc.bindEvents.js"></script>
<script src="../src/misc/sigma.misc.drawHovers.js"></script>
<!-- END SIGMA IMPORTS -->
<script src="../plugins/sigma.parsers.gexf/gexf-parser.js"></script>
<script src="../plugins/sigma.parsers.gexf/sigma.parsers.gexf.js"></script>
<div id="container">
<style>
#graph-container {
top: 0;
bottom: 0;
left: 0;
right: 0;
position: absolute;
}
</style>
<div id="graph-container"></div>
</div>
<script>
/**
* Here is just a basic example on how to properly display a graph
* exported from Gephi in the GEXF format.
*
* The plugin sigma.parsers.gexf can load and parse the GEXF graph file,
* and instantiate sigma when the graph is received.
*
* The object given as the second parameter is the base of the instance
* configuration object. The plugin will just add the "graph" key to it
* before the instanciation.
*/
sigma.parsers.gexf('data/arctic.gexf', {
container: 'graph-container'
});
</script>

文件 arctic.gexf 也存在于数据目录下。我使用的是 Google Chrome 37

有什么问题吗?我可以在示例目录下加载其他示例 html,但 load-external-json.html 也不起作用。

最佳答案

假设您没有在服务器上运行此托管程序,则会发生这种情况,因为 Chrome 的默认安全设置 - 它不会从您的硬盘驱动器加载文件(除非您正在运行服务器)。

使用开发人员工具,您将看到XMLHttpRequest 无法加载错误

使用 Firefox,您不会遇到此限制,并且无需运行服务器即可加载这些示例。

关于javascript - Sigma js无法加载外部gexf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25946354/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com