Skip to content

Commit

Permalink
feat: basic errorbars
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierSwaak committed Jul 14, 2024
1 parent 70e09f0 commit b7b1b7a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
16 changes: 12 additions & 4 deletions docs/assets/uncertainty/uncertainty.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,18 @@ function updateCentre() {
var dx = Math.pow(x_square_sum, 0.5) / xs.length
var dy = Math.pow(y_square_sum, 0.5) / ys.length

const xbar = document.getElementById("bar");
const click_box = document.getElementById("click_box");
var rect = click_box.getBoundingClientRect();
xbar.x1.baseVal.value = dx;
const xbar = document.getElementById("xbar");
const ybar = document.getElementById("ybar");

xbar.x1.baseVal.value = x - dx;
xbar.x2.baseVal.value = x + dx;
xbar.y1.baseVal.value = y;
xbar.y2.baseVal.value = y;

ybar.x1.baseVal.value = x;
ybar.x2.baseVal.value = x;
ybar.y1.baseVal.value = y - dy;
ybar.y2.baseVal.value = y + dy;

const meanpoint = document.getElementById("mean_point");
meanpoint.style.left = x + "%";
Expand Down
3 changes: 2 additions & 1 deletion docs/mvc.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ Het oorspronkelijke script dat je gebruikte voor je meting is steeds leger gewor
<div class="border_zone" id="right_box">
<div id="display_box">
<svg width="100%" preserveAspectRatio="none" style="display: block;" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<line id="bar" x1="0" y1="0" x2="100" y2="50" stroke="black" /></svg>
<line id="xbar" x1="0" y1="0" x2="0" y2="0" stroke="black" />
<line id="ybar" x1="0" y1="0" x2="0" y2="0" stroke="black" /></svg>
</div>
</div>

Expand Down

0 comments on commit b7b1b7a

Please sign in to comment.