JavaScript update display in loop when drawing many d3 svg objects lenovo smart display update loop

I draw many circles with some loops via d3.js

var line = d3.svg.line()
var  r = 1


var svg = d3.select("body").append("svg:svg")
    .attr("width", 1000)
    .attr("height",1000)

for ( var x=0; x< 1000 ; x+=3*r)
  {
    for ( var y=0; y< 1000 ; y+=3*r)
    {
      svg.append("circle")
          .attr("cx", x)
          .attr("cy", y)
          .attr("r", r)
    }
  }

fiddle

It seems the browser refreshes the display only after the loops have finished. Then all objects appear at once. How can I force a refresh after every element, so I can watch the progress of the image?

Thanks

Answer:1

this is my html code : <div> <label for="accompanying_person" class="col-sm-4 col-form-label">Select number of accompanying person</label> <div class="col-sm-8"&...

this is my html code : <div> <label for="accompanying_person" class="col-sm-4 col-form-label">Select number of accompanying person</label> <div class="col-sm-8"&...

I want user mouse position while the user is holding down the mouse button continuously? I try to do the with following code: $(div).mousedown(function(eventObj){ console.log(eventObj.clientX); ...

I want user mouse position while the user is holding down the mouse button continuously? I try to do the with following code: $(div).mousedown(function(eventObj){ console.log(eventObj.clientX); ...

I am using Selenium WebDriver and coding in Java. In a code I need to scroll down to a specific element in the web page for clicking it. I am using JavascriptExecutor command. My question is how will ...

I am using Selenium WebDriver and coding in Java. In a code I need to scroll down to a specific element in the web page for clicking it. I am using JavascriptExecutor command. My question is how will ...

I'd like to bind 2 Angular model variables to a range input element according to the following: update first model variable for every change of the range input update second model variable after x ms ...

I'd like to bind 2 Angular model variables to a range input element according to the following: update first model variable for every change of the range input update second model variable after x ms ...

  1. input bind variables