Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am trying to develop a custom visual using d3-hierarchy (https://github.com/d3/d3-hierarchy). I've installed both the library and the typings using npm into the node_modules folder, and added the files to the tsconfig.json and pbiviz.json.
When I try to import the module, both VS Code and the TS compiler complain that they can't find a module called d3-hierarchy. Strangely, I get auto complete in VS Code for the library.
How can I set up my environment so I can use d3-hierarchy?
Hello @Anonymous
The current version of Power BI Visuals Tools don't support ES2015 (import/export) module system.
In other words, you should use another type definisitions that doesn't use ES2015.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
@Anonymous,
You may check the following link.
Adding typings is just for the sake, that you will get intellisense for respective methods in given object.
If you don't need to have this, then you can directly go with solution as @v-chuncz-msft mentioned.
If I am not wrong, you don't need to import the module.
Just define lib in global dependencies in typings.json as it is done here for d3 .
To use this library in your file , define variable with same name where ever you want to use this lib.
Thank you for your answer. I don't understand yet what string I have to enter. I included a screenshot of my typings.json
I've looked into the github repository, but the string for d3 doesn't match the repositories structure, so I'm at a bit of a loss here 😕
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
13 | |
2 | |
2 | |
1 | |
1 |