-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from NASA-IMPACT/develop
v0.3.0
- Loading branch information
Showing
49 changed files
with
2,348 additions
and
844 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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
76 changes: 76 additions & 0 deletions
76
app/assets/scripts/components/common/data-browser/popover.js
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,76 @@ | ||
import React from 'react'; | ||
import styled, { css } from 'styled-components'; | ||
import { PropTypes as T } from 'prop-types'; | ||
|
||
import { themeVal } from '../../../styles/utils/general'; | ||
import { glsp } from '../../../styles/utils/theme-values'; | ||
|
||
const POPOVER_SHOW_HIDE_ANIM_TIME = 240; | ||
|
||
const easeOutBack = 'cubic-bezier(0.175, 0.885, 0.32, 1.275)'; | ||
const easeInBack = 'cubic-bezier(0.6, -0.28, 0.735, 0.045)'; | ||
|
||
const popoverAnim = css` | ||
&.pop-chart-appear, | ||
&.pop-chart-enter { | ||
transition: transform ${POPOVER_SHOW_HIDE_ANIM_TIME}ms ${easeOutBack}, opacity ${POPOVER_SHOW_HIDE_ANIM_TIME}ms ease-in-out; | ||
transform: scale(0); | ||
opacity: 0; | ||
} | ||
&.pop-chart-appear-active, | ||
&.pop-chart-enter-active { | ||
transform: scale(1); | ||
opacity: 1; | ||
} | ||
&.pop-chart-exit { | ||
transition: transform ${POPOVER_SHOW_HIDE_ANIM_TIME}ms ${easeInBack}, opacity ${POPOVER_SHOW_HIDE_ANIM_TIME}ms ease-in-out; | ||
transform: scale(1); | ||
opacity: 1; | ||
} | ||
&.pop-chart-exit-active { | ||
transform: scale(0); | ||
opacity: 0; | ||
} | ||
`; | ||
|
||
const PopoverPositioner = styled.div` | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
z-index: 1000; | ||
pointer-events: none; | ||
transform-origin: 0; | ||
${popoverAnim} | ||
`; | ||
|
||
const PopoverSelf = styled.article` | ||
border-radius: ${themeVal('shape.rounded')}; | ||
background-color: ${themeVal('color.surface')}; | ||
box-shadow: 0 0 8px 0 ${themeVal('color.baseAlphaC')}; | ||
padding: ${glsp(0.25, 0.5)}; | ||
transform: translate(-50%, -100%); | ||
margin-top: -0.5rem; | ||
`; | ||
|
||
export default function Popover ({ | ||
children, | ||
style, | ||
...rest | ||
}) { | ||
return ( | ||
<PopoverPositioner style={style}> | ||
<PopoverSelf {...rest}> | ||
{children} | ||
</PopoverSelf> | ||
</PopoverPositioner> | ||
); | ||
} | ||
|
||
Popover.propTypes = { | ||
children: T.node, | ||
style: T.object | ||
}; |
File renamed without changes.
File renamed without changes.
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
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
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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import no2 from './layer-no2'; | ||
import population from './layer-population'; | ||
import carCount from './layer-car-count'; | ||
import nightlights from './layer-nightlights'; | ||
|
||
export default [ | ||
no2, | ||
population | ||
population, | ||
carCount, | ||
nightlights | ||
]; |
Oops, something went wrong.