我想在一个角度的项目中使用d3plus。主要是因为它巧妙的文字包装。
我用以下内容创建了一个d3.lib.ts文件:
export * from 'd3';
export * from 'd3plus';'d3plus‘是红色的IntelliJ。我已经安装了d3、d3plus、@type/d3和@type/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"它似乎是在试图解释coffeescript,但我不知道它为什么会这样做。为什么它不简单地忽略这一点并在上面的文件夹中使用d3plus.js呢?
我该怎么做呢?这样做对吗?
发布于 2018-12-07 14:58:11
尝试NPMId3plus@next,它将安装剩余的软件包。
发布于 2019-03-04 20:36:54
我将警告我的答案-我正在使用d3plus的文本包装功能。我不能使用在一些博客中发布的d3plus.textwrap函数。我从在线信息中推断,在d3 v4中,必须使用单独的d3plus包。例如,对于文本缠绕,我们必须使用d3plus-text包,然后按如下方式访问文本缠绕函数:
new d3plus-text.textWrap()...https://stackoverflow.com/questions/53524034
复制相似问题