Published
Edited
May 8, 2021
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// TODO: bij amendementen is het van belang alle stemmingen te tonen
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
API_BASE = "https://parlement.thundr.be"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
plenary_meetings_unfolded = Promise.all(session.meetings.plenary.map(url => fetch(url).then(r => r.json())))
Insert cell
session_members = Promise.all(session.members.map(m => fetch(m)
.then(resp => resp.json()).then(r => {r.url = m; return r;})))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
async function getTopic(topic) {
return Promise.all(Object.entries(topic).map(url => {
return fetch(url[1]).then(res => res.json())
}))
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function getVoteData(namevote) {
const result = []
if (!namevote || !namevote.voters) {
return result;
}
const voters = namevote.voters
function createMember(voter, vote_type) {
return {
name: voter.last_name + " " + voter.first_name,
id: voter.id,
party: voter.party,
url: `${member_url}?session=${session_num}&member=${voter.id}`,
vote: vote_type
};
}
for (const y of voters.yes) {
result.push(createMember(y, 'yes'));
}
for (const y of voters.no) {
result.push(createMember(y, 'no'));
}
for (const y of voters.abstention) {
result.push(createMember(y, 'abstention'));
}
return result
}
Insert cell
Insert cell
Insert cell
xAxis = g => g
.attr('transform', `translate(0,${height - margin.top})`)
.call(d3.axisBottom(x))
Insert cell
margin = ({
left: 50,
right: 30,
top: 30,
bottom: 30
})
Insert cell
x = d3.scaleBand()
.domain(voteTypes)
.range([margin.left, width - margin.right])
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
voteTypeTrans = ({yes:"ja", abstention:"onthouding", no:"nee"})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more