【发布时间】:2018-08-07 04:01:32
【问题描述】:
我的目标是创建一个使用最新版本的 d3 js https://github.com/d3/d3/ 的简单 Angular Dart 程序。我很难创建最新版本的库。 在 Dart 中使用 d3 js 库的正确方法是什么?
这是我尝试过的:
dartlang 的 d3 Dart 包是 2015 年的。我想要最新版本,所以这不好。 https://pub.dartlang.org/packages/d3
我尝试确定类型,这样我就可以使用 dart_js_facade_gen 将 typescript 文件转换为 dart 文件。 https://github.com/dart-lang/js_facade_gen
d3 肯定输入了 github:https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3 在 d3 路径下,有一个 index.d.ts 文件。我只在本地复制了那个文件并运行了这个命令:
dart_js_facade_gen index.d.ts
并收到错误:
/usr/local/lib/node_modules/dart_js_facade_gen/index.js:11
if (e.name !== 'DartFacadeError') throw e;
^
TypeError: Cannot read property 'isExternalLibraryImport' of undefined
at resolvedPath.forEach (/usr/local/lib/node_modules/dart_js_facade_gen/build/lib/main.js:90:31)
...
【问题讨论】:
-
你有没有关注这个关于加载程序错误的帖子:?github.com/TypeStrong/ts-loader/issues/586 里面有几个可能的罪魁祸首。
-
这个问题似乎无关紧要。让我试着让我的问题更清楚。