Skip to content

Commit a83b774

Browse files
authored
Merge pull request #52 from Priyami/visualizedata
Bubblechart d3.js
2 parents 0103387 + 421ec37 commit a83b774

File tree

6 files changed

+434
-0
lines changed

6 files changed

+434
-0
lines changed

package-lock.json

+301
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"@testing-library/jest-dom": "^5.14.1",
77
"@testing-library/react": "^11.2.7",
88
"@testing-library/user-event": "^12.8.3",
9+
"d3": "^7.1.1",
910
"react": "^17.0.2",
1011
"react-dom": "^17.0.2",
1112
"react-router-dom": "^5.3.0",

src/components/Api/GitApi.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import React, { useEffect, useState } from "react";
2+
import Bubblechart from "../Resources/Bubblechart";
3+
4+
const GitApi = () => {
5+
6+
const [contributor, setContributor] = useState([]);
7+
8+
useEffect(() => {
9+
const url = "https://api.github.com/repos/frontendstudygroup/frontendstudygroup.github.io/contributors";
10+
11+
const fetchData = async () => {
12+
try {
13+
const response = await fetch(url);
14+
const json = await response.json();
15+
setContributor(json)
16+
17+
} catch (error) {
18+
console.log("error", error);
19+
}
20+
};
21+
22+
fetchData();
23+
24+
}, []);
25+
26+
return (
27+
28+
<div>
29+
30+
<Bubblechart data = {contributor}></Bubblechart>
31+
32+
</div>
33+
);
34+
};
35+
36+
37+
export default GitApi;

0 commit comments

Comments
 (0)