Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Moved Deltas Below Mini-Graphs #159

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 34 additions & 3 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,11 @@ h6 {
margin-bottom: auto;
margin-top: 0.25rem;
h6 {
color: $green-mid;
color: $gray-mid;
font-weight: 900;
}
h3 {
color: $green;
color: $gray;
font-weight: 600;
}
h3, h6 {
Expand Down Expand Up @@ -734,6 +734,35 @@ table {
flex-direction: column;
margin-top: 1rem;
width: 100%;
.confirmed {
display: flex;
flex-direction: column;
justify-content: flex-start;
}

.delta {
position: relative;
left: 0.2rem;
top: 4px;;
}

.is-cherry {
h1 {color: $cherry;}
h4, h5 {color: $cherry-mid;}
}
.is-blue {
h1 {color: $blue;}
h4, h5 {color: $blue-mid;}
}
.is-green {
h1 {color: $green;}
h4, h5 {color: $green-mid;}
}
.is-gray {
h1 {color: $gray;}
h4, h5 {color: $gray-mid;}
}

.stats {
padding: 0.25rem;
position: absolute;
Expand Down Expand Up @@ -828,10 +857,12 @@ table {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-bottom: 5rem;
.svg-parent {
width: 5rem;
margin-top: 5px;
background: transparent !important;
height: 7rem;
height: 2rem;
}
margin-bottom: -3rem;
.tooltip {
Expand Down
2 changes: 1 addition & 1 deletion src/components/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function Home(props) {
</div>

<Level data={states} deltas={deltas}/>
<Minigraph timeseries={timeseries} animate={true}/>
<Minigraph deltas={deltas} timeseries={timeseries} animate={true}/>

<Table states={states} summary={false} onHighlightState={onHighlightState} />

Expand Down
6 changes: 1 addition & 5 deletions src/components/level.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,22 @@ function Level(props) {
<div className="Level fadeInUp" style={{animationDelay: '0.8s'}}>

<div className="level-item is-cherry">
<h5>Confirmed</h5>
<h4>[{props.deltas ? props.deltas.confirmeddelta>=0 ? '+'+props.deltas.confirmeddelta : props.deltas.confirmeddelta : ''}]</h4>
<h5 className='heading'>Confirmed</h5>
<h1>{confirmed} </h1>
</div>

<div className="level-item is-blue">
<h5 className="heading">Active</h5>
<h4>[{props.deltas ? props.deltas.confirmeddelta-props.deltas.recovereddelta-props.deltas.deceaseddelta >=0 ? '+'+(props.deltas.confirmeddelta-props.deltas.recovereddelta-props.deltas.deceaseddelta).toString() : props.deltas.confirmeddelta-props.deltas.recovereddelta-props.deltas.deceaseddelta : ''}]</h4>
<h1 className="title has-text-info">{active}</h1>
</div>

<div className="level-item is-green">
<h5 className="heading">Recovered</h5>
<h4>[{props.deltas ? props.deltas.recovereddelta>=0 ? '+'+props.deltas.recovereddelta : props.deltas.recovereddelta : ''}]</h4>
<h1 className="title has-text-success">{recoveries} </h1>
</div>

<div className="level-item is-gray">
<h5 className="heading">Deceased</h5>
<h4>[{props.deltas ? props.deltas.deceaseddelta>=0 ? '+'+props.deltas.deceaseddelta : '+0' : ''}]</h4>
<h1 className="title has-text-grey">{deaths}</h1>
</div>

Expand Down
30 changes: 20 additions & 10 deletions src/components/minigraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,23 +297,33 @@ function Minigraph(props) {

return (
<div className="Minigraph">

<div className="svg-parent fadeInUp" style={{animationDelay: '0.6s'}}>
<svg ref={graphElement1} width="100" height="100" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet"/>
<div className="graph-content is-cherry fadeInUp" style={{animationDelay: '0.6s'}}>
<div className="svg-parent">
<svg ref={graphElement1} width="100" height="100" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet"/>
</div>
<h4 className='delta'>[{props.deltas ? props.deltas.confirmeddelta>=0 ? '+'+props.deltas.confirmeddelta : props.deltas.confirmeddelta : ''} Today]</h4>
</div>

<div className="svg-parent is-blue fadeInUp" style={{animationDelay: '0.7s'}}>
<svg ref={graphElement2} width="100" height="100" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet"/>
<div className="graph-content is-blue fadeInUp" style={{animationDelay: '0.7s'}}>
<div className="svg-parent is-blue">
<svg ref={graphElement2} width="100" height="100" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet"/>
</div>
<h4 className='delta'>[{props.deltas ? props.deltas.confirmeddelta-props.deltas.recovereddelta-props.deltas.deceaseddelta >=0 ? '+'+(props.deltas.confirmeddelta-props.deltas.recovereddelta-props.deltas.deceaseddelta).toString() : props.deltas.confirmeddelta-props.deltas.recovereddelta-props.deltas.deceaseddelta : ''} Today]</h4>
</div>

<div className="svg-parent is-green fadeInUp" style={{animationDelay: '0.8s'}}>
<svg ref={graphElement3} width="100" height="100" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet"/>
<div className="graph-content is-green fadeInUp" style={{animationDelay: '0.8s'}}>
<div className="svg-parent is-green">
<svg ref={graphElement3} width="100" height="100" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet"/>
</div>
<h4 className='delta'>[{props.deltas ? props.deltas.recovereddelta>=0 ? '+'+props.deltas.recovereddelta : props.deltas.recovereddelta : ''} Today]</h4>
</div>

<div className="svg-parent is-gray fadeInUp" style={{animationDelay: '0.9s'}}>
<svg ref={graphElement4} width="100" height="100" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet"/>
<div className="graph-content is-gray fadeInUp" style={{animationDelay: '0.9s'}}>
<div className="svg-parent is-gray">
<svg ref={graphElement4} width="100" height="100" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet"/>
</div>
<h4 className='delta'>[{props.deltas ? props.deltas.deceaseddelta>=0 ? '+'+props.deltas.deceaseddelta : '+0' : ''} Today]</h4>
</div>

</div>

);
Expand Down