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 use three JS libraries in my visual; d3, lodash and one called tinycolor.
d3 just "works", in that I just install d3 and its relevant @types package, add it to the external_js section of pbiviz.json, and can then start using its features in my visual.
The other two, on the other hand, need to be explicitly defined in my visual.ts file after doing the above. I don't know if there's a more elegant method than the one here but that's the one that works for me. So I have the following in visual.ts:
let _ = (<any>window)._; let tinycolor = (<any>window).tinycolor;
If I remove one of these lines then the TypeScript fails to compile because it "Cannot find name '_'" (and equivalent for tinycolor), yet d3 works just fine without it.
I hope I explained the situation well enough. I'm just curious what the reason behind this discrepancy is?
Solved! Go to Solution.
Power BI applies a special workaround to define d3 and jQuery at the global context.
Other libraries are out of support at least for now. In other words, you should define other libraries manually.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Power BI applies a special workaround to define d3 and jQuery at the global context.
Other libraries are out of support at least for now. In other words, you should define other libraries manually.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Additional type definitions (d.ts files) are installed.
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 |