Skip to content

Commit 4755dd8

Browse files
authored
Merge branch 'frontendstudygroup:master' into master
2 parents ff5688e + b7d0385 commit 4755dd8

File tree

6 files changed

+34
-15
lines changed

6 files changed

+34
-15
lines changed

src/components/Api/GitApi.css

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.b-chart
2+
{
3+
display: flex;
4+
justify-content:center;
5+
}
6+
7+
.title
8+
{
9+
justify-content: flex-start;
10+
}

src/components/Api/GitApi.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useEffect, useState } from "react";
22
import Bubblechart from "../Resources/Bubblechart";
3+
import "./GitApi.css";
34

45
const GitApi = () => {
56

@@ -25,10 +26,9 @@ const GitApi = () => {
2526

2627
return (
2728

28-
<div>
29-
30-
<Bubblechart data = {contributor}></Bubblechart>
31-
29+
<div className = "b-chart">
30+
<h1 className="b-title">Contributors</h1>
31+
<Bubblechart data = {contributor}></Bubblechart>
3232
</div>
3333
);
3434
};

src/components/Footer/Footer.css

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
.info > a {
3232
color: #71b6f6;
3333
}
34+
.info .contributor {
35+
color: #71b6f6;
36+
text-decoration: underline;
37+
cursor: pointer;
38+
}
3439

3540
.copyright > p {
3641
color: #a3a9a4;

src/components/Footer/Footer.js

+6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import React from 'react';
22
import './Footer.css'
33
import WWCodeFrontEnd from '../../assets/images/WWCode-Logo.png'
4+
import { useHistory } from 'react-router-dom';
45

56

67
export default function Footer(){
8+
const history = useHistory();
9+
710
return(
811
<div className="footer">
912
<div className="footer-items">
@@ -42,6 +45,9 @@ export default function Footer(){
4245
<a href="https://www.womenwhocode.com/frontend"
4346
target="_blank"
4447
rel="noopener noreferrer">https://www.womenwhocode.com/frontend</a>
48+
49+
<p className="contributor" onClick={() => history.push('/contributor')}>contributors
50+
</p>
4551
</div>
4652
</div>
4753

src/components/Resources/Bubblechart.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,39 @@ import "./Bubblechart.css";
55

66
const Bubblechart = (aData) => {
77
let jsonToDisplay = { "children":[...aData.data] };
8-
var diameter = 1000,
8+
let diameter = 1000,
99
color = d3.scaleOrdinal(["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"]);
10-
var bubble = d3.pack()
10+
let bubble = d3.pack()
1111
.size([diameter, diameter])
1212
.padding(2);
1313

14-
var margin = {
14+
let margin = {
1515
left: 100,
1616
right: 100,
1717
top: 0,
1818
bottom: 0
1919
}
2020

21-
var svg = d3.select('#chart').append('svg')
21+
let svg = d3.select('#chart').append('svg')
2222
.attr('viewBox', '0 0 ' + (diameter + margin.right) + ' ' + diameter)
2323
.attr('width', (diameter + margin.right))
2424
.attr('height', diameter)
2525
.attr('class', 'chart-svg');
2626

2727

28-
var root = d3.hierarchy(jsonToDisplay)
28+
let root = d3.hierarchy(jsonToDisplay)
2929
.sum(function (d) { return d.id })
3030
.sort(function (a, b) { return b.id - a.id });
3131

3232

3333
bubble(root);
3434

35-
var node = svg.selectAll('.node')
35+
let node = svg.selectAll('node')
3636
.data(root.children)
3737
.enter()
3838
.append('g').attr('class', 'node')
39-
.attr('transform', function (d) { return 'translate(' + d.x + ' ' + d.y + ')'; })
40-
.append('g').attr('class', 'graph');
39+
.attr('transform', function (d) {return 'translate(' + d.x + ' ' + d.y + ')'; })
40+
4141

4242
node.append("circle")
4343
.attr('r', function (d) {

src/components/Router.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import SingleResource from "./SingleResource/SingleResource";
88
import Contact from "./ContactUs/Contact";
99
import About from "./About/About";
1010
import TableView from "./Resources/TableView";
11-
import Bubblechart from "./Resources/Bubblechart";
1211
import GitApi from "./Api/GitApi";
1312

1413

@@ -24,8 +23,7 @@ const Router = () => (
2423
<Route exact path="/contact" component={Contact} />
2524
<Route exact path="/about" component={About} />
2625
<Route exact path="/TableView" component={TableView} />
27-
<Route exact path="/bubblechart" component={Bubblechart} />
28-
<Route exact path="/gitapi" component={GitApi} />
26+
<Route exact path="/contributor" component={GitApi} />
2927

3028
</Switch>
3129
<Footer/>

0 commit comments

Comments
 (0)