angular - Angular 在咖啡上使用 d3plus 扼流圈
问题描述
我想在 Angular 项目中使用 d3plus。主要是因为它巧妙的文字换行。
我制作了一个d3.lib.ts
文件:
export * from 'd3';
export * from 'd3plus';
IntelliJ 中的“d3plus”为红色。我已经 npm 安装了 d3、d3plus、@types/d3 和 @types/d3plus。这可能是矫枉过正,但肯定这里的东西应该工作。
当我构建时,我得到:
ERROR in ./node_modules/d3plus/src/init.coffee 1:0
Module parse failed: Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type.
> ###*
| # @class d3plus
| ###
ERROR in ./node_modules/d3plus/src/libs.coffee 1:26
Module parse failed: Unexpected token (1:26)
You may need an appropriate loader to handle this file type.
> window.d3 = require "d3"
| window.topojson = require "topojson"
Angular 似乎正在尝试解释咖啡脚本,但我不知道它为什么会这样做。为什么不简单地忽略它并使用其上方文件夹中的 d3plus.js?
我如何让这个工作?这是正确的方法吗?
解决方案
尝试 npm i d3plus@next ,它将安装剩余的软件包。
推荐阅读
- cron - 一天中的 crontab 周不工作 - 它每天发送
- html - 如何从 iframe 内容延迟自动滚动
- regex - 正则表达式:Grafana 变量将连字符分隔的 IP 转换为点分隔的 IP
- javascript - 外部 img src 已损坏 n Chrome
- ionic3 - 如何在ionic3和angular5中使用插件全球化
- jupyter-notebook - f-string 在 Jupyter 中不起作用
- javascript - SweetAlert 确认删除
- angularjs - 使用 api 调用结果填充 typeahead
- fancybox - fancybox 3 - 如何放大图像并继续放大下一张图像
- c# - 如何将列表框中的选定项目用作列表的名称