-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9679dd8
commit 3420126
Showing
16 changed files
with
902 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* THIS IS A BIT-AUTO-GENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. */ | ||
|
||
{ | ||
"version": "14.8.8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name,uv,pv,amt | ||
Page A,4000,2400,2400 | ||
Page B,3000,1398,2210 | ||
page C,2000,9800,2290 | ||
page D,2780,3908,2000 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React from "react"; | ||
import AUTHORS_QUERY from "components/Queries/authors.js"; | ||
import { gql } from "@apollo/client"; | ||
import { useMutation } from "react-apollo"; | ||
import { Query } from "react-apollo"; | ||
|
||
const AUTHOR_UPDATE_MUTATION = gql` | ||
mutation($oldname: String!, $newname: String!) { | ||
updateAuthor(where: { name: $oldname }, data: { name: $newname }) { | ||
id | ||
} | ||
} | ||
`; | ||
|
||
export default function Authors() { | ||
const [changeAuthor] = useMutation(AUTHOR_UPDATE_MUTATION); | ||
let input; | ||
|
||
return ( | ||
<> | ||
<div className="text-center"> | ||
<Query query={AUTHORS_QUERY}> | ||
{({ loading, error, data }) => { | ||
if (loading) return <div>Fetching</div>; | ||
if (error) return <div>Error</div>; | ||
const items = data.authors; | ||
|
||
return ( | ||
<div> | ||
<form | ||
onSubmit={(e) => { | ||
e.preventDefault(); | ||
changeAuthor({ | ||
variables: { | ||
oldname: items[0].name, | ||
newname: input.value, | ||
}, | ||
}); | ||
input.value = ""; | ||
}} | ||
> | ||
<input | ||
ref={(node) => { | ||
input = node; | ||
}} | ||
/> | ||
<button type="submit">Update first Author</button> | ||
</form> | ||
{items.map((item) => ( | ||
<div> | ||
<p> | ||
{item.name}:{item.country},{item.age} | ||
</p> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}} | ||
</Query> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import React from "react"; | ||
import BarChart from "@bit/recharts.recharts.bar-chart"; | ||
import Bar from "@bit/recharts.recharts.bar"; | ||
import XAxis from "@bit/recharts.recharts.x-axis"; | ||
import YAxis from "@bit/recharts.recharts.y-axis"; | ||
import CartesianGrid from "@bit/recharts.recharts.cartesian-grid"; | ||
import Tooltip from "@bit/recharts.recharts.tooltip"; | ||
import Legend from "@bit/recharts.recharts.legend"; | ||
|
||
const data = [ | ||
{ | ||
name: "Page A", | ||
uv: 4000, | ||
pv: 2400, | ||
amt: 2400, | ||
}, | ||
{ | ||
name: "Page B", | ||
uv: 3000, | ||
pv: 1398, | ||
amt: 2210, | ||
}, | ||
{ | ||
name: "Page C", | ||
uv: 2000, | ||
pv: 9800, | ||
amt: 2290, | ||
}, | ||
{ | ||
name: "Page D", | ||
uv: 2780, | ||
pv: 3908, | ||
amt: 2000, | ||
}, | ||
{ | ||
name: "Page E", | ||
uv: 1890, | ||
pv: 4800, | ||
amt: 2181, | ||
}, | ||
{ | ||
name: "Page F", | ||
uv: 2390, | ||
pv: 3800, | ||
amt: 2500, | ||
}, | ||
{ | ||
name: "Page G", | ||
uv: 3490, | ||
pv: 4300, | ||
amt: 2100, | ||
}, | ||
]; | ||
|
||
const Barchart = () => { | ||
return ( | ||
<BarChart | ||
width={600} | ||
height={500} | ||
data={data} | ||
margin={{ | ||
top: 5, | ||
right: 30, | ||
left: 20, | ||
bottom: 5, | ||
}} | ||
> | ||
<CartesianGrid strokeDasharray="3 3" /> | ||
<XAxis dataKey="name" /> | ||
<YAxis /> | ||
<Tooltip /> | ||
<Legend /> | ||
<Bar dataKey="pv" fill="#8884d8" /> | ||
<Bar dataKey="uv" fill="#82ca9d" /> | ||
</BarChart> | ||
); | ||
}; | ||
|
||
export default Barchart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from "react"; | ||
import LineChart from "@bit/recharts.recharts.line-chart"; | ||
import XAxis from "@bit/recharts.recharts.x-axis"; | ||
import YAxis from "@bit/recharts.recharts.y-axis"; | ||
import CartesianGrid from "@bit/recharts.recharts.cartesian-grid"; | ||
import Line from "@bit/recharts.recharts.line"; | ||
import Tooltip from "@bit/recharts.recharts.tooltip"; | ||
import Legend from "@bit/recharts.recharts.legend"; | ||
import Papa from "papaparse"; | ||
import { CSVReader } from "react-papaparse"; | ||
|
||
const Linechart = () => { | ||
const results = readString("/assets/csv/calcium.csv"); | ||
console.log(results); | ||
|
||
return <div>hi</div>; | ||
// Papa.parse("assets/csv/calcium.csv", { | ||
// complete: function (results) { | ||
// <LineChart | ||
// width={600} | ||
// height={500} | ||
// data={results.data} | ||
// margin={{ | ||
// top: 5, | ||
// right: 30, | ||
// left: 20, | ||
// bottom: 5, | ||
// }} | ||
// > | ||
// <CartesianGrid strokeDasharray="3 3" /> | ||
// <XAxis dataKey="name" /> | ||
// <YAxis /> | ||
// <Tooltip /> | ||
// <Legend /> | ||
// <Line | ||
// type="monotone" | ||
// dataKey="cal" | ||
// stroke="#82ca9d" | ||
// strokeDasharray="3 4 5 2" | ||
// /> | ||
// </LineChart>; | ||
// }, | ||
// }); | ||
}; | ||
|
||
export default Linechart; |
Oops, something went wrong.