I want to use d3plus in an Angular project. Mainly for its clever text wrapping.
I made a d3.lib.ts
file with:
export * from 'd3';
export * from 'd3plus';
The 'd3plus' is red in IntelliJ. I've npm installed d3, d3plus, @types/d3 and @types/d3plus. That might be overkill, but surely something here should work.
When I build, I get:
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"
It seems Angular is trying to interpret coffeescript, but I have no idea why it would do that. Why is it not simply ignoring that and using the d3plus.js in the folder above it?
And how do I get this working? Is this the right approach?
try npm i d3plus@next , it will install remaining packages.