3

In our application, we are using D3.js to dynamically altering SVG components using the code as below.

    linkContainer.selectAll("line").remove();        
    var link = self.drawLinks(linkContainer, links);        
    self.context.nodeContainer.selectAll("g").remove();

Here, once we enable locker service, i think we can't grab line tags and thus selectAll function in not valid anymore. We are facing below error.

   Error in $A.getCallback() [linkContainer.selectAll is not a function]

Thanks for helping on this one.

5
  • 1
    D3 wasn't working several months ago - salesforce.stackexchange.com/questions/143697/….
    – Keith C
    Commented Jan 31, 2017 at 17:40
  • 2
    It seems, we have to modify d3.Js file or move our implemention on new version I.e. Ver 4.x. Commented Jan 31, 2017 at 18:44
  • If you have a good list of which versions of which libraries work with locker service, please post as an answer and it'll get my +1.
    – Keith C
    Commented Jan 31, 2017 at 19:04
  • @ThisIsRSN Is this working as expected after upgrading D3 versions? Commented Feb 3, 2017 at 18:30
  • @ThisIsRSN If this is not working after upgrading to version 4.x of D3, can you provide your markup and enough info to reproduce the issue locally so we can investigate. Commented Feb 14, 2017 at 18:02

0

You must log in to answer this question.