Showing results for 
Search instead for 
Did you mean: 
MattCalderwood Frequent Visitor
Frequent Visitor

D3.js Supported versions?



I am currently working with writing custom visuals in Power BI using the D3.js library. 
Initially I had issues getting the D3 files packaged into the PowerBI packages via the pbiviz command line interface.


It looks as though custom visualisations only work with earlier versions of the D3 library (Version 3) Using V4 doesn't appear to work at all. 


I used the Microsoft SVG-Utils npm package to get going with a solution that works ( ) and this contains version 3.5.5


Is this the latest supported version?
Is there any information on when newer versions will be supported (if they aren't already)?

Thanks in advance,


nikitagrachev Regular Visitor
Regular Visitor

Re: D3.js Supported versions?

Hello @MattCalderwood,

Yes, svg-utils don't support v4 yet, but it's in backlog.
D3 v3 was one large library. You had to include all of it, even if you didn't need all of it.
D3 v4 is actually a set of small modules. You can choose to use one or more as you need them.
For example, if you need 'selection' from D3 v4, you can add the following packages to your project:

Nikita Grachev,
Team Leader
Microsoft Power BI Custom Visuals,
MattCalderwood Frequent Visitor
Frequent Visitor

Re: D3.js Supported versions?

Hi @nikitagrachev

Thanks for the reply.

Have you successfully got Version 4 running in a custom visual? 
This blog post suggests that it doesn't currently work (but it is a few months old). 
I am unable to find any guidance that is more recent.

Think I will try it out again.




Moderator v-viig

Re: D3.js Supported versions?

D3 v4 actually works. However, you can't use ES2015 module system (import/export).

I suppose that you should use window.window.d3 to access d3 v4.


Another option is to use prebundler such as webpack or rollup in order to generate a single JS file and use this file in pbiviz tools.


Ignat Vilesov,

Software Engineer


Microsoft Power BI Custom Visuals

MattCalderwood Frequent Visitor
Frequent Visitor

Re: D3.js Supported versions?

Thanks for the reply @v-viig I will give this a try asap.