Skip to content

Instantly share code, notes, and snippets.

@oneybee
oneybee / ExampleTwoDeepComponent_recharts.js
Last active April 21, 2018 05:33
ExampleTwoDeepComponent_recharts
<LineChart width={900} height={300} data={this.state.data} margin={{right: 200}}>
<XAxis dataKey="name" />
<YAxis/>
<CartesianGrid strokeDasharray="3 3"/>
<Tooltip/>
<Legend />
<Line type="monotone" dataKey="goals" stroke="#8884d8" activeDot={{r: 8}}/>
<Line type="monotone" dataKey="goalsAgainst" stroke="#82ca9d" />
</LineChart>
@oneybee
oneybee / ExampleTwoDeepComponent.js
Last active April 21, 2018 05:33
football-data api
data: [
{name: 'Bayern', goalsAgainst: responseJson.standing[0].goalsAgainst, goals: responseJson.standing[0].goals, amt: 2400},
{name: 'Dortmund', goalsAgainst: responseJson.standing[1].goalsAgainst, goals: responseJson.standing[1].goals, amt: 2210},
{name: 'Leverkusen', goalsAgainst: responseJson.standing[2].goalsAgainst, goals: responseJson.standing[2].goals, amt: 2290},
{name: 'Gladbach', goalsAgainst: responseJson.standing[3].goalsAgainst, goals: responseJson.standing[3].goals, amt: 2000},
{name: 'Schalke 04', goalsAgainst: responseJson.standing[4].goalsAgainst, goals: responseJson.standing[4].goals, amt: 2181},
{name: 'Mainz', goalsAgainst: responseJson.standing[5].goalsAgainst, goals: responseJson.standing[5].goals, amt: 2500},
{name: 'Hertha', goalsAgainst: responseJson.standing[6].goalsAgainst, goals: responseJson.standing[6].goals, amt: 2100},
]
@oneybee
oneybee / ExampleTwoDeepComponent.js
Last active April 9, 2022 07:55
football-data api & recharts
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import Interactive from 'react-interactive';
import { Link } from 'react-router-dom';
import { Li } from '../styles/style';
import s from '../styles/exampleTwoDeepComponent.style';
import {LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend} from 'Recharts';
var obj = {
@oneybee
oneybee / ExampleTwoDeepComponent.js
Last active April 21, 2018 05:31
api setting_football-data
var obj = {
method: 'GET',
headers: {
'X-Auth-Token': 'e600784123014d489c796ab72ed9587d'
},
}
//var obj 코드는 API key가 있는 경우만 필요합니다.
class ExampleTwoDeepComponent extends Component {
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import Interactive from 'react-interactive';
import { Link } from 'react-router-dom';
import { Li } from '../styles/style';
import s from '../styles/exampleTwoDeepComponent.style';
class ExampleTwoDeepComponent extends Component {
@oneybee
oneybee / ExampleComponent.js
Created March 25, 2018 11:39
recharts piechart
import React from 'react';
import Interactive from 'react-interactive';
import { Switch, Route, Link } from 'react-router-dom';
import ExampleTwoDeepComponent from './ExampleTwoDeepComponent';
import PageNotFound from './PageNotFound';
import s from '../styles/exampleComponent.style';
import {PieChart, Pie, Legend} from 'Recharts';
const data = [{name: 'Group A', value: 400}, {name: 'Group B', value: 300},
{name: 'Group C', value: 300}, {name: 'Group D', value: 200},
import React, {Component} from 'react';
import Interactive from 'react-interactive';
import { Switch, Route, Link } from 'react-router-dom';
import ExampleTwoDeepComponent from './ExampleTwoDeepComponent';
import PageNotFound from './PageNotFound';
import s from '../styles/exampleComponent.style';
import {LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend} from 'Recharts';
var obj = {
import React, {Component} from 'react';
import Interactive from 'react-interactive';
import { Switch, Route, Link } from 'react-router-dom';
import ExampleTwoDeepComponent from './ExampleTwoDeepComponent';
import PageNotFound from './PageNotFound';
import s from '../styles/exampleComponent.style';
import {LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend} from 'Recharts';
var obj = {
import React, {Component} from 'react';
import Interactive from 'react-interactive';
import { Switch, Route, Link } from 'react-router-dom';
import ExampleTwoDeepComponent from './ExampleTwoDeepComponent';
import PageNotFound from './PageNotFound';
import s from '../styles/exampleComponent.style';
class exampleComponent extends Component {
@oneybee
oneybee / Home.js
Created March 5, 2018 13:42
reactapp/src/components/Home.js
import React from 'react';
import Interactive from 'react-interactive';
import { Link } from 'react-router-dom';
import { Code } from '../styles/style';
import s from '../styles/home.style';
export default function Home() {
const repoReadmeLink = text => (
<Interactive
as="a"