简体   繁体   English

require.js错误(topojson未加载)

[英]require.js error (topojson not loading)

Can anyone help me understand/fix this error? 任何人都可以帮助我理解/修复此错误吗?

Uncaught ReferenceError: topojson is not defined 未捕获的ReferenceError:未定义topojson

I am new to requireJS and don't fully understand it. 我是requireJS的新手,并不完全理解它。

Thank you in advance! 先感谢您!

 require.config({ paths: { d3: "//cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min", geo: "//d3js.org/d3.geo.projection.v0.min", topo: "//d3js.org/topojson.v1.min" }, shim: { geo: { deps: ["d3"] }, topo:{ deps: ["d3","geo"] } } }); require(["d3","geo","topo"],function(){ $(document).ready(RecruitingData.ondomready); $(document).bind('framework.resize',RecruitingData.scalescharts()); $(document).bind('framework.resize',RecruitingData.scalescharts1()); $(document).bind('framework.resize',RecruitingData.linechart()); $(document).bind('framework.resize',RecruitingData.mapchart()); }) 

I don't know anything about require.js but looking at the api, you are missing the arguments to your require callback: 我对require.js但看着api,你错过了你的require回调的参数:

require(["d3","geo","topo"],function(d3,geo,topojson){
    // you can now use topojson!
});

Example here . 这里的例子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM