Forum Discussion

tylersbrown01's avatar
tylersbrown01
Frequent Visitor
8 years ago
Solved

Setting up D3 V4 with Custom Visuals and Types

D3 V4 has been out for some time now, but there is not a straightforward way to get it working inside a pbiviz. Instead, most Power BI examples and documentation show you how to work with D3 version ...
  • v-viig's avatar
    8 years ago

    There's no need to use module bundler.

    The solution is:

    1. Remove let d3 = (<any>window).d3; from TypeScript code.
    2. Instead you should create a new file "d3Injector.js" (you can call it as you want).
    3. Put var d3 = window.d3; into created file
    4. Include d3Injector.js into externlaJS property of pbiviz.json right after "node_modules/d3/build/d3.min.js"

     

    Please let me know if that works for you as well.

      

    Ignat Vilesov,

    Software Engineer

     

    Microsoft Power BI Custom Visuals

    [email protected]