Unified naming patterns

This commit is contained in:
2022-08-30 22:24:07 +02:00
parent 334eaa346f
commit 759a5835f7
4 changed files with 6 additions and 12 deletions

View File

@@ -40,10 +40,9 @@ fetch(url)
.padAngle(2 / 300) .padAngle(2 / 300)
.cornerRadius(8); .cornerRadius(8);
const js = d3.select("#js"); const canvas = d3.select("#canvas");
js.select(".loading").remove();
const svg = js const svg = canvas
.append("svg") .append("svg")
.attr("viewBox", "-320 -320 640 640") .attr("viewBox", "-320 -320 640 640")
.attr("width", 400) .attr("width", 400)

View File

@@ -40,11 +40,10 @@ arc = (
.cornerRadius(8) .cornerRadius(8)
) )
py = d3.select("#py") canvas = d3.select("#canvas")
py.select(".loading").remove()
svg = ( svg = (
py.append("svg") canvas.append("svg")
.attr("viewBox", "-320 -320 640 640") .attr("viewBox", "-320 -320 640 640")
.attr("width", 400) .attr("width", 400)
.attr("height", 400) .attr("height", 400)

View File

@@ -13,9 +13,7 @@
<div> <div>
<h1>Duolingo XP nach Sprache</h1> <h1>Duolingo XP nach Sprache</h1>
<h2>JavaScript</h2> <h2>JavaScript</h2>
<div id="js" style="width: 400px; height: 400px; margin: auto"> <div id="canvas" style="width: 400px; height: 400px; margin: auto"></div>
<div class="loading"></div>
</div>
</div> </div>
<script type="importmap"> <script type="importmap">

View File

@@ -16,9 +16,7 @@
<div> <div>
<h1>Duolingo XP nach Sprache</h1> <h1>Duolingo XP nach Sprache</h1>
<h2>PyScript</h2> <h2>PyScript</h2>
<div id="py" style="width: 400px; height: 400px; margin: auto"> <div id="canvas" style="width: 400px; height: 400px; margin: auto"></div>
<div class="loading"></div>
</div>
</div> </div>
<script type="importmap"> <script type="importmap">