Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to import D3plus v1 into Vue.js? #695

Open
TsengTofu opened this issue May 15, 2020 · 1 comment
Open

How to import D3plus v1 into Vue.js? #695

TsengTofu opened this issue May 15, 2020 · 1 comment

Comments

@TsengTofu
Copy link

TsengTofu commented May 15, 2020

Hi, I'm trying to import D3plus v1 into Vue-CLI, but it's not working.
I can import D3.js into Vue.js, use import * as d3 from "d3".
And I've try with same way for D3plus -> import d3plus from 'd3plus', still not working.
Is this possible to import D3plus to Vue.js?

By the way, I've found the same problem to other framework, here is the link below: Here
Error message is the same below.

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"

The link said try npm i d3plus@next, but this will turn D3plus version from 1 to 2, this is not what I want. And still get other error, the error message is same as the comment below the answer.

./node_modules/d3plus/index.js Module build failed: Error: ENOENT: no such file or directory, open 'C:\Users\me\projects\project\node_modules\d3plus\index.js'

Please help, thank you!

@TsengTofu
Copy link
Author

Just reply by myself.
I use vue-script-load to load d3plus.js (cdn link) in specific component, and it work fine.
Maybe there will be more convenient way to deal with in the future.
By the way, the version is 1.0, not still in development version 2.0.

Hope it will helpful for others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant