Skip to content

Commit c3d6623

Browse files
committed
add reset button
1 parent a83f32d commit c3d6623

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

index.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ <h1>NK-Grahps</h1>
5353
<span id="resultp_jump"></span>
5454
</div>
5555
<button onclick="addNewWithControls()">Add</button>
56+
57+
<hr>
58+
<button onclick="reset()">Reset</button>
5659
</div>
5760

5861
<div id="navigation"></div>
@@ -174,21 +177,20 @@ <h1>NK-Grahps</h1>
174177
document.getElementById('resultp_jump').innerText = newEntry['p_jump'];
175178
}
176179

177-
function initInput() {
178-
document.getElementById('resultN').value = newEntry['N'];
179-
document.getElementById('resultK').value = newEntry['K'];
180-
document.getElementById('resultC').value = newEntry['C'];
181-
document.getElementById('resultp_jump').value = newEntry['p_jump'];
182-
}
183-
initInput();
184-
185180
function updateControls(e) {
186181
newEntry[e.name] = e.value;
187182
updateTextInput();
188183
}
189184

190185
updateTextInput();
191186

187+
function reset() {
188+
console.log("rest")
189+
chart.data.datasets = [];
190+
active = {};
191+
chart.update();
192+
}
193+
192194
</script>
193195

194196

0 commit comments

Comments
 (0)