Skip to content

Commit

Permalink
feat: generate points on click
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierSwaak committed Jul 13, 2024
1 parent 353de45 commit 8a7aa89
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/assets/uncertainty/uncertainty.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#click_box {
width: 200px;
height: 200px;
width: 500px;
height: 500px;
border: 1px solid black;
cursor: pointer;
position: relative;
}

.datapoint {
height:10px;
width: 10px;
background-color: #4051b5;
border-radius: 50%;
display: inline-block;
position: absolute;
}
9 changes: 9 additions & 0 deletions docs/assets/uncertainty/uncertainty.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@ function addPoint(e) {
var x = e.clientX - rect.left;
var y = e.clientY - rect.top;
console.log(x + ", " + y);

const datapoint = document.createElement("span");
datapoint.classList.add("datapoint");

const parent = document.getElementById("click_box");
parent.appendChild(datapoint);

datapoint.style.left = x + 'px';
datapoint.style.top = y + 'px';
}

0 comments on commit 8a7aa89

Please sign in to comment.