打开 javascript github 个示例时出现问题

Problems opening javascript github examples

所以我想开始使用 dc.js 包来创建一些仪表板,我找到了这个教程:

https://github.com/austinlyons/dcjs-leaflet-untappd

我已经下载了整个文件夹并试图打开 html 看看它是否有效,但我只得到了页面的某些部分(没有数据,没有图表,你可以看到预期的和附上图片)。我在发现的其他一些教程中遇到了同样的问题,但无法弄清楚原因。当它是 link 时,我可以在浏览器中打开页面:

https://austinlyons.github.io/dcjs-leaflet-untappd/

有什么想法吗?我正在使用 Chrome 顺便说一句,但它在 IE 中也不起作用。

您需要在终端中 运行 python -m SimpleHTTPServer

Try it yourself

If you want to play with the code as we go, I recommend downloading the source code from this GitHub repository, navigating to the directory where the files are located, and kicking off Python's SimpleHTTP server so that you can see your visualization in your own browser at http://localhost:8000 (If this is new for you, see this link for a bit more information).

如果有人感兴趣,对于那些不愿意使用服务器的人来说,有一个非常好的解决方法。出于某种原因,Firefox 允许打开此类页面,因此无需 运行 服务器即可测试 D3 和其中的类似代码。