Inserting existing svg

17 views
Skip to first unread message

Laurent-Xavier Barjon

unread,
May 25, 2018, 12:19:43 AM5/25/18
to d3-js
I was using this portion of code to insert existing svg into my d3 project :

d3.xml("/images/svg/pause.svg").mimeType("image/svg+xml").get(function(error, xml) {
            if (error) throw error;
            control.focusLine.pauseIcon.node().appendChild(xml.documentElement);
            control.focusLine.pauseIcon.select('svg')
                .attr('width', 32)
                .attr('height', 32);
        });

It was working before i use d3 v5, now i get a javascript error : d3.xml(...).mimeType is not a function.
Wasn't able to find any useful information about that on the web.

Help or information about how to integrate existing svg to a d3 UI would be greatly appreciated.
Reply all
Reply to author
Forward
0 new messages