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

Cannot import {pointer} function as it is not available to import #317

Closed
husseinhaidarsword opened this issue Mar 7, 2024 · 4 comments
Closed

Comments

@husseinhaidarsword
Copy link

I'm trying to upgrade my d3 package from 5==>7. For that, I am following the migration guide one major version at a time.
As per this: https://observablehq.com/@d3/d3v6-migration-guide, it mentions that mouse functions are deprecated at and replaced with the pointer function.

I have tried d3.pointer and pointer - nothing works

When trying to use it after upgrading to v6 for d3 and v3.0.0 for d3-selection, I am unable to import the pointer function, although when digging inside the dist - the library clearly exports it.
package.json:L
"@ngx-translate/http-loader": "^7.0.0",
"d3": "^6.0.0",
"d3-geo": "^1.11.3",
"d3-selection": "^3.0.0",
"file-saver": "^2.0.5",
"geojson": "^0.5.0",

"@cypress/schematic": "^2.5.1",
"@ngrx/schematics": "^14.3.2",
"@types/d3": "^5.7.0",
"@types/d3-geo": "^1.11.3",
"@types/file-saver": "^2.0.5",
@Fil
Copy link
Member

Fil commented Mar 7, 2024

Please share details of how you're importing, because it definitely should work.

@husseinhaidarsword
Copy link
Author

@Fil
image
I've tried several libraries

@Fil
Copy link
Member

Fil commented Mar 7, 2024

I can't reproduce: I did the following:

npm init
npm add d3
code index.js

import pointer

@Fil Fil closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2024
@mbostock
Copy link
Member

mbostock commented Mar 7, 2024

Looks like you still have old types installed (@types/d3), so you’ll need to upgrade those too. Also, you shouldn’t import d3 and d3-selection — either use d3 if you want everything bundled together, or use the individual libraries.

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