Skip to content

Commit f00fc82

Browse files
Fix label bud
1 parent 8636dbd commit f00fc82

File tree

3 files changed

+37
-20
lines changed

3 files changed

+37
-20
lines changed

src/components/Charts.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,27 @@ export default class Charts extends Component {
2727
return (
2828
<div className="charts">
2929
{!isLoading && (
30-
<LineChart width={700} height={500} data={result}>
30+
<LineChart
31+
width={600}
32+
height={300}
33+
data={result}
34+
margin={{
35+
top: 5,
36+
right: 30,
37+
left: 20,
38+
bottom: 5,
39+
}}
40+
>
3141
<XAxis dataKey="date" />
3242
<YAxis />
3343
<CartesianGrid strokeDasharray="3 3" />
3444
<Tooltip />
35-
<Legend />
45+
<Legend
46+
wrapperStyle={{
47+
// padding: "5rem",
48+
margin: "-3rem 1rem",
49+
}}
50+
/>
3651
<Line
3752
type="monotone"
3853
dataKey="confirmed"
@@ -43,19 +58,19 @@ export default class Charts extends Component {
4358
type="monotone"
4459
dataKey="active"
4560
stroke={colors.orange}
46-
activeDot={{ r: 8 }}
61+
// activeDot={{ r: 8 }}
4762
/>
4863
<Line
4964
type="monotone"
5065
dataKey="discharged"
5166
stroke={colors.green}
52-
activeDot={{ r: 8 }}
67+
// activeDot={{ r: 8 }}
5368
/>
5469
<Line
5570
type="monotone"
5671
dataKey="deaths"
5772
stroke={colors.purple}
58-
activeDot={{ r: 8 }}
73+
// activeDot={{ r: 8 }}
5974
/>
6075
</LineChart>
6176
)}

src/components/CovidApp.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,15 @@ const styles = {
4848
display: "flex",
4949
justifyContent: "space-between",
5050
alignItems: "center",
51+
padding: "4rem",
5152
},
5253
contentArea: {},
5354
chartArea: {
5455
flex: "1",
56+
display: "flex",
57+
flexDirection: "column",
58+
justifyContent: "center",
59+
// alignItems: "center",
5560
},
5661
};
5762

@@ -175,17 +180,18 @@ class CovidApp extends Component {
175180
getData={this.getData}
176181
loadingStatus={this.loadingStatus}
177182
/>
178-
179-
<div className={classes.content}>
180-
<div className={classes.contentArea}>hello world</div>
181-
<div className={classes.chartArea}>
182-
<Map mapData={mapData} />
183-
<Charts
184-
data={this.state.completeData}
185-
isLoading={this.state.isLoading}
186-
/>
183+
{!this.state.isLoading && (
184+
<div className={classes.content}>
185+
<div className={classes.contentArea}></div>
186+
<div className={classes.chartArea}>
187+
<Map mapData={mapData} />
188+
<Charts
189+
data={this.state.completeData}
190+
isLoading={this.state.isLoading}
191+
/>
192+
</div>
187193
</div>
188-
</div>
194+
)}
189195
</div>
190196
</div>
191197
);

src/components/Map/Map.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { ComposableMap, Geographies, Geography } from "react-simple-maps";
33
import { scaleQuantile } from "d3-scale";
44
import ReactTooltip from "react-tooltip";
55
import LinearGradient from "./LinearGradient.js";
6+
import INDIA_TOPO_JSON from "./india.topo.json";
67

78
/**
89
* Courtesy: https://rawgit.com/Anujarya300/bubble_maps/master/data/geography-data/india.topo.json
910
* Looking topojson for other countries/world?
1011
* Visit: https://github.com/markmarkoh/datamaps
1112
*/
12-
const INDIA_TOPO_JSON = require("./india.topo.json");
1313

1414
const PROJECTION_CONFIG = {
1515
scale: 350,
@@ -73,10 +73,6 @@ class Map extends Component {
7373
this.setState({ tooltipContent: "" });
7474
};
7575

76-
onChangeButtonClick = () => {
77-
this.setState({ data: this.formatData(this.props.completeData) });
78-
};
79-
8076
render() {
8177
const data = this.props.mapData;
8278
const gradientData = {

0 commit comments

Comments
 (0)