handleiding_nieuw:sub_spacematrix
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
handleiding_nieuw:sub_spacematrix [2025/04/14 11:35] – support | handleiding_nieuw:sub_spacematrix [2025/04/15 15:51] (current) – support | ||
---|---|---|---|
Line 1: | Line 1: | ||
< | < | ||
< | < | ||
- | | + | |
- | | + | display: flex; |
- | margin: | + | align-items: center; |
- | padding: | + | gap: 10px; |
- | border: 1px solid #ccc; | + | margin-bottom: |
- | | + | } |
- | background-color: | + | .inputrow label { |
- | } | + | width: 200px; |
- | .calculator-wrapper h2 { | + | |
- | | + | .inputrow input { |
- | } | + | width: 80px; |
- | .calculator-wrapper label { | + | } |
- | | + | .resultblock { |
- | | + | margin-left: |
- | } | + | font-size: 0.9em; |
- | .calculator-wrapper input { | + | min-width: |
- | width: 100%; | + | text-align: right; |
- | | + | |
- | | + | table.rekenblok { |
- | | + | border-collapse: |
- | .output | + | |
- | | + | font-size: 0.9em; |
- | | + | |
- | background-color: #eef; | + | table.rekenblok td, table.rekenblok th { |
- | border: | + | |
- | } | + | border: 1px solid #ccc; |
+ | text-align: right; | ||
+ | | ||
+ | table.rekenblok th { | ||
+ | | ||
+ | } | ||
+ | .scheiding td { | ||
+ | | ||
+ | border-top: 2px solid #666; | ||
+ | } | ||
+ | .kaartcontainer | ||
+ | | ||
+ | top: 0; | ||
+ | | ||
+ | width: 320px; | ||
+ | | ||
+ | .kaartcontainer img { | ||
+ | width: 100%; | ||
+ | | ||
+ | } | ||
+ | .stipje | ||
+ | | ||
+ | width: 14px; | ||
+ | | ||
+ | | ||
+ | border-radius: 50%; | ||
+ | | ||
+ | | ||
+ | } | ||
</ | </ | ||
- | < | + | < |
- | < | + | <div class="kaartcontainer"> |
- | < | + | <img src="https://www.sumsonite.nl/wiki/ |
- | Oppervlak projectgebied (in m²): | + | <div class="stipje" id="stipje"></ |
- | <input type=" | + | </div> |
- | </ | + | </div> |
- | < | + | |
- | FSI (bijv. 1.2): | + | |
- | <input type="number" | + | |
- | </label> | + | |
- | < | + | |
- | % sociale huur: | + | |
- | <input type=" | + | |
- | </ | + | |
- | < | + | |
- | % middenhuur: | + | |
- | <input type="number" | + | |
- | </ | + | |
- | < | + | |
- | % koop: | + | |
- | <input type="number" id="koop" value=" | + | |
- | | + | |
- | <label> | + | |
- | Gemiddelde BVO per woning (m²): | + | |
- | | + | |
- | | + | |
- | < | + | |
- | | + | < |
- | <em>Voer waarden in en klik op "Bereken" | + | |
- | </ | + | <div class=" |
+ | <label for=" | ||
+ | < | ||
+ | <div class=" | ||
+ | </ | ||
+ | <div class="inputrow"> | ||
+ | <label for=" | ||
+ | <input id=" | ||
+ | <div class=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | <label for=" | ||
+ | <input id=" | ||
+ | <div class=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | <label for=" | ||
+ | <input id=" | ||
+ | <div class=" | ||
</ | </ | ||
+ | |||
+ | <div style=" | ||
+ | <table class=" | ||
+ | < | ||
+ | <tr> | ||
+ | < | ||
+ | <th style=" | ||
+ | <th style=" | ||
+ | < | ||
+ | < | ||
+ | </tr> | ||
+ | </ | ||
+ | <tbody id=" | ||
+ | < | ||
+ | <tr class=" | ||
+ | < | ||
+ | <td id=" | ||
+ | <td id=" | ||
+ | <td id=" | ||
+ | <td id=" | ||
+ | </tr> | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <div id=" | ||
< | < | ||
- | | + | const types = [ |
- | const opp = parseFloat(document.getElementById('opp').value); | + | "egw sociaal", |
- | const fsi = parseFloat(document.getElementById('fsi').value); | + | "mgw sociaal", |
- | const sociaal | + | ]; |
- | const midden | + | |
- | const koop = parseFloat(document.getElementById(' | + | const tbody = document.getElementById(" |
- | const bvo = parseFloat(document.getElementById('bvo').value); | + | |
+ | types.forEach((type, | ||
+ | const row = document.createElement(" | ||
+ | if (i === 5) row.className = " | ||
+ | row.innerHTML = ` | ||
+ | <td style=" | ||
+ | < | ||
+ | < | ||
+ | <td id=" | ||
+ | <td id=" | ||
+ | `; | ||
+ | tbody.appendChild(row); | ||
+ | }); | ||
+ | |||
+ | | ||
+ | return n.toLocaleString(" | ||
+ | | ||
+ | |||
+ | function updateStipje(fsi, | ||
+ | const stip = document.getElementById(" | ||
+ | const x = Math.min(100, | ||
+ | const y = Math.max(0, Math.min(100, | ||
+ | stip.style.left = `${x}%`; | ||
+ | stip.style.top = `${y}%`; | ||
+ | } | ||
+ | |||
+ | function updateLaadvermogen() { | ||
+ | | ||
+ | const fsi = parseFloat(document.getElementById("fsi").value); | ||
+ | const gsi = parseFloat(document.getElementById(" | ||
+ | const voorzieningPerc | ||
+ | |||
+ | const laadvermogen = Math.round(opp * fsi); | ||
+ | const bvoVoorzieningen = Math.round(laadvermogen * voorzieningPerc); | ||
+ | const bvoWonen = laadvermogen - bvoVoorzieningen; | ||
+ | |||
+ | document.getElementById(" | ||
+ | document.getElementById(" | ||
+ | document.getElementById(" | ||
+ | |||
+ | updateStipje(fsi, | ||
+ | bereken(); | ||
+ | | ||
+ | |||
+ | function bereken() { | ||
+ | | ||
+ | const fsi = parseFloat(document.getElementById(" | ||
+ | const voorzieningPerc = parseFloat(document.getElementById(" | ||
+ | const laadvermogen = opp * fsi; | ||
+ | const woonBVO = laadvermogen * (1 - voorzieningPerc); | ||
+ | |||
+ | let gewogenBVO = 0; | ||
+ | let totalPerc = 0; | ||
+ | const details = []; | ||
+ | |||
+ | for (let i = 0; i < types.length; | ||
+ | const perc = parseFloat(document.getElementById(`perc_${i}`).value) || 0; | ||
+ | const bvo = parseFloat(document.getElementById(`bvo_${i}`).value) | ||
+ | gewogenBVO += (perc / 100) * bvo; | ||
+ | totalPerc += perc; | ||
+ | details.push({ i, perc, bvo }); | ||
+ | } | ||
+ | |||
+ | if (totalPerc === 0 || gewogenBVO === 0) return; | ||
+ | |||
+ | const totaalWoningenExact = woonBVO / gewogenBVO; | ||
+ | let sumWon = 0; | ||
+ | let sumBVO = 0; | ||
+ | let wonPerType = []; | ||
+ | |||
+ | let restant = Math.round(totaalWoningenExact); | ||
+ | for (let i = 0; i < details.length; | ||
+ | const { perc } = details[i]; | ||
+ | let aant = (perc / 100) * totaalWoningenExact; | ||
+ | let afgerond = Math.floor(aant); | ||
+ | wonPerType.push(afgerond); | ||
+ | restant -= afgerond; | ||
+ | } | ||
+ | |||
+ | const decimaalSort = details.map((d, | ||
+ | i, rest: ((d.perc / 100) * totaalWoningenExact) % 1 | ||
+ | })).sort((a, | ||
+ | |||
+ | for (let j = 0; j < restant; j++) { | ||
+ | wonPerType[decimaalSort[j].i]++; | ||
+ | } | ||
+ | |||
+ | for (let i = 0; i < details.length; | ||
+ | const aant = wonPerType[i]; | ||
+ | const bvoTot = aant * details[i].bvo; | ||
+ | document.getElementById(`aantal_${i}`).innerText = formatGetal(aant); | ||
+ | document.getElementById(`totbvo_${i}`).innerText = formatGetal(bvoTot); | ||
+ | sumWon += aant; | ||
+ | sumBVO += bvoTot; | ||
+ | } | ||
- | const totaalBVO | + | document.getElementById(" |
- | const bvoSociaal | + | |
- | const bvoMidden | + | |
- | const bvoKoop | + | |
- | const aantSociaal = Math.round(bvoSociaal / bvo); | + | document.getElementById(" |
- | const aantMidden = Math.round(bvoMidden | + | < |
- | | + | < |
+ | `; | ||
+ | | ||
- | | + | |
- | < | + | |
- | Totaal laadvermogen: | + | |
- | Sociale huur: ${aantSociaal} woningen< | + | |
- | Middenhuur: ${aantMidden} woningen< | + | |
- | Koop: ${aantKoop} woningen< | + | |
- | `; | + | |
- | } | + | |
</ | </ | ||
</ | </ | ||
handleiding_nieuw/sub_spacematrix.1744630506.txt.gz · Last modified: 2025/04/14 11:35 by support