切换布局
显示结果
<!DOCTYPE html> <html> <head> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/d3@7"></script> </head> <body> <h3>Simple transitions</h3> <script> d3.select("body").transition().duration(2000).style("background-color", "red") // make the background-color lightblue.transition() .transition().duration(1000).style("background-color", "green"); // make the background-color gray </script> </body> </html>