Topojson'默认'属性未定义

时间:2017-03-21 01:12:50

标签: node.js npm topojson

我在过去一小时左右一直试图调试这个无济于事。我试图使用d3-world-mapstopojson依赖d3-world-maps

var _topojson = require('topojson'); var _topojson2 = _interopRequireDefault(_topojson); this.countries = _topojson['default'].feature(_assetsTopo_countriesJson2['default'], _assetsTopo_countriesJson2['default'].objects.countries); 包内的问题在于:

_topojson['default']

似乎default未定义,我对这个库或其依赖关系不太熟悉,足以找出原因......

有人能指出我正确的方向吗?我已经记录了该对象,我可以看到该属性d3-world-maps未定义(该对象存在) - 但我不确定为什么function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 使用它,如果它没有'存在......除非我在这里错过了什么。

编辑:

刚看了一下这个函数:

<!DOCTYPE html>
<html lang="en">
  <head>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <!-- Bootstrap CSS -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
  </head>
  <body>


<nav class="navbar fixed-top navbar-light bg-faded">
  <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="#">Navbar</a>

  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item active">
        <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
      <li class="nav-item">
        <a class="nav-link disabled" href="#">Disabled</a>
      </li>
    </ul>
    <form class="form-inline my-2 my-lg-0">
      <input class="form-control mr-sm-2" type="text" placeholder="Search">
      <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
    </form>
  </div>
</nav>

<div class = 'container'>
dsfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf vsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdf
sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv

sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf
sdfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf vsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdf
sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv

sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf

sdfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf vsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdf
sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv

sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf vsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdf
sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv

sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf
</div>

<div class = 'container'>
dsfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf vsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdf
sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv

sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf
sdfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf vsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdf
sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv

sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf

sdfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf vsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdf
sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv

sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf vsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdf
sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv

sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf
</div>
<div class = 'container'>
dsfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf vsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdf
sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv

sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf
sdfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf vsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdf
sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv

sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf

sdfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf vsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdf
sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv

sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdfsdf sdf sdf sdfsdfsdf sdf sdfv sdfsdfsdf sdf sdf sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf vsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdf
sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfv

sdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfvsdfsdfsdf sdf sdfsdfsdfsdf sdf sdfsdfsdfsdf sdf sdf
</div>


    <!-- jQuery first, then Tether, then Bootstrap JS. -->
    <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>


    <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>


    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
  </body>
</html>

这到底是做什么以及为什么?

1 个答案:

答案 0 :(得分:0)

问题似乎是topojson中的API更改。正如您所看到的hered3-world-maps使用*作为topojson版本,这意味着无论如何都会获得最新版本。

尝试编辑程序包以使用特定的旧版topojson并找到它所期望的版本,并向程序包提交拉取请求以进行修复!