The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.