extract d3 script block