diff --git a/README.md b/README.md index 1613a3b0..8cada0e7 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ # GitHub Tracker -Replace this readme with your own information about your project. - -Start by briefly describing the assignment in a sentence or two. Keep it short and to the point. +Week 7 of bootcamp, this is a github tracker tracking projects from the Technigo bootcamp using github api. The site is built mainly using JavaScript, its a heading with the github user avatars and a project list with all repos linked to the Technigo bootcamp. The project card shows some info regarding the status of the project. At the bottom there is a pie chart showing the progress in the bootcamp. The project/repo list os possible to sort and filter. ## The problem -Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next? +The challenge this week was to get the asynchronous nature of fetch to work with multiple fetches within a fetch, for this I used Promise.All. It was also a challenge to get the filters and sort working. ## View it live -Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about. +https://gustav-week7-github-tracker.netlify.app/ diff --git a/code/chart.js b/code/chart.js index 92e85a30..f78e7ec3 100644 --- a/code/chart.js +++ b/code/chart.js @@ -2,3 +2,50 @@ const ctx = document.getElementById('chart').getContext('2d') //"Draw" the chart here 👇 + +const pieData = { + labels: ['Projects to go', 'Projects done'], + datasets: [ + { + label: 'Technigo project progress', + data: [19, 0], + backgroundColor: ['RGB(22, 27, 33)', 'RGB(37, 166, 65)'], + borderColor: '#21262c', + hoverOffset: 4, + }, + ], +} + +const pieConfig = { + type: 'doughnut', + data: pieData, +} + +const pieChart = new Chart(ctx, pieConfig) + +const updatePieChart = (chart, newData) => { + chart.data.datasets.forEach(dataset => { + dataset.data.pop() + dataset.data.push(newData) + }) + chart.update() +} + +// const lineData = { +// // labels: ['Soon', 'Done'], +// datasets: [ +// { +// label: 'Technigo project progress', +// data: [19, 0], +// backgroundColor: ['rgb(255, 99, 132)', 'rgb(255, 205, 86)'], +// hoverOffset: 4, +// }, +// ], +// }; + +// const lineConfig = { +// type: 'line', +// data: lineData, +// }; + +// let lineChart = (ctx) => new Chart(ctx, lineConfig); diff --git a/code/index.html b/code/index.html index 2fb5e0ae..94ce4b69 100644 --- a/code/index.html +++ b/code/index.html @@ -1,21 +1,43 @@ -
- - - -Sort by:
+ + + + + +Filter by:
+ + + +