Skip to content

Commit 0ca14b2

Browse files
minor changes
1 parent f00fc82 commit 0ca14b2

File tree

6 files changed

+35
-28
lines changed

6 files changed

+35
-28
lines changed

src/components/Charts.js

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export default class Charts extends Component {
4444
<Tooltip />
4545
<Legend
4646
wrapperStyle={{
47-
// padding: "5rem",
4847
margin: "-3rem 1rem",
4948
}}
5049
/>
@@ -54,24 +53,9 @@ export default class Charts extends Component {
5453
stroke={colors.red}
5554
activeDot={{ r: 8 }}
5655
/>
57-
<Line
58-
type="monotone"
59-
dataKey="active"
60-
stroke={colors.orange}
61-
// activeDot={{ r: 8 }}
62-
/>
63-
<Line
64-
type="monotone"
65-
dataKey="discharged"
66-
stroke={colors.green}
67-
// activeDot={{ r: 8 }}
68-
/>
69-
<Line
70-
type="monotone"
71-
dataKey="deaths"
72-
stroke={colors.purple}
73-
// activeDot={{ r: 8 }}
74-
/>
56+
<Line type="monotone" dataKey="active" stroke={colors.orange} />
57+
<Line type="monotone" dataKey="discharged" stroke={colors.green} />
58+
<Line type="monotone" dataKey="deaths" stroke={colors.purple} />
7559
</LineChart>
7660
)}
7761
</div>

src/components/CovidApp.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,12 @@ const styles = {
5050
alignItems: "center",
5151
padding: "4rem",
5252
},
53-
contentArea: {},
53+
contentArea: {
54+
width: "30vw",
55+
},
5456
chartArea: {
5557
flex: "1",
58+
minWidth: "50vw",
5659
display: "flex",
5760
flexDirection: "column",
5861
justifyContent: "center",
@@ -182,7 +185,9 @@ class CovidApp extends Component {
182185
/>
183186
{!this.state.isLoading && (
184187
<div className={classes.content}>
185-
<div className={classes.contentArea}></div>
188+
<div className={classes.contentArea}>
189+
<h1>Hello World</h1>
190+
</div>
186191
<div className={classes.chartArea}>
187192
<Map mapData={mapData} />
188193
<Charts
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.display-flex {
2+
display: flex;
3+
}
4+
5+
.fill {
6+
flex: 1;
7+
}
8+
9+
.center {
10+
text-align: center;
11+
}
12+
13+
.mt16 {
14+
margin-top: 16px;
15+
}

src/components/Map/LinearGradient.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
22
import PropTypes from "prop-types";
3+
import "./LinearGradient.css";
34

45
const LinearGradient = (props) => {
56
const { data } = props;

src/components/Map/Map.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.container {
2+
background-color: rgba(129, 124, 155, 0.05);
3+
padding: 3rem;
4+
border-radius: 2.5rem;
5+
}

src/components/Map/Map.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { scaleQuantile } from "d3-scale";
44
import ReactTooltip from "react-tooltip";
55
import LinearGradient from "./LinearGradient.js";
66
import INDIA_TOPO_JSON from "./india.topo.json";
7+
import "./Map.css";
78

89
/**
910
* Courtesy: https://rawgit.com/Anujarya300/bubble_maps/master/data/geography-data/india.topo.json
@@ -31,10 +32,6 @@ const COLOR_RANGE = [
3132

3233
const DEFAULT_COLOR = "#EEE";
3334

34-
const getRandomInt = () => {
35-
return parseInt(Math.random() * 100);
36-
};
37-
3835
const geographyStyle = {
3936
default: {
4037
outline: "none",
@@ -55,8 +52,8 @@ class Map extends Component {
5552
this.state = {
5653
tooltipContent: "",
5754
data: [
58-
{ id: "AP", state: "Andhra Pradesh", value: getRandomInt() },
59-
{ id: "AR", state: "Arunachal Pradesh", value: getRandomInt() },
55+
{ id: "AP", state: "Andhra Pradesh", value: 5 },
56+
{ id: "AR", state: "Arunachal Pradesh", value: 2 },
6057
],
6158
};
6259
}
@@ -87,7 +84,7 @@ class Map extends Component {
8784
.range(COLOR_RANGE);
8885

8986
return (
90-
<div className="full-width-height container">
87+
<div className="container">
9188
<ReactTooltip>{this.state.tooltipContent}</ReactTooltip>
9289
<ComposableMap
9390
projectionConfig={PROJECTION_CONFIG}

0 commit comments

Comments
 (0)