diff --git a/package.json b/package.json index 48c511c3a..26162b02a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "biotablero", - "version": "1.7.0", + "version": "1.8.0", "scripts": { "start": "react-scripts start", "build": "react-scripts build", @@ -13,9 +13,11 @@ "@material-ui/icons": "^4.9.1", "@material-ui/lab": "^4.0.0-alpha.57", "@nivo/bar": "^0.69.0", + "@nivo/bullet": "^0.69.1", "@nivo/core": "^0.69.0", "@nivo/line": "^0.69.0", "@nivo/pie": "^0.69.0", + "@nivo/tooltip": "^0.69.0", "@vx/axis": "0.0.170", "@vx/glyph": "0.0.170", "@vx/grid": "0.0.170", @@ -35,6 +37,7 @@ "react-masonry-component": "6.2.1", "react-router-dom": "5.2.0", "react-scripts": "4.0.2", + "react-spring": "^9.1.2", "styled-components": "^5.2.3" }, "devDependencies": { diff --git a/src/app/layout/Footer.jsx b/src/app/layout/Footer.jsx index d767ce842..7c57ad949 100644 --- a/src/app/layout/Footer.jsx +++ b/src/app/layout/Footer.jsx @@ -6,6 +6,7 @@ import nasa from 'images/nasa.png'; import temple from 'images/temple.png'; import geobon from 'images/geobonlogo.png'; import usaid from 'images/usaidlogo.png'; +import umed from 'images/umed.png'; const logosData = { nasa: { img: nasa, url: 'https://www.nasa.gov/' }, @@ -13,11 +14,12 @@ const logosData = { siac: { img: logoSiac, url: 'http://www.siac.gov.co/siac.html' }, geobon: { img: geobon, url: 'https://geobon.org/' }, usaid: { img: usaid, url: 'https://www.usaid.gov/' }, + umed: { img: umed, url: 'https://udemedellin.edu.co/' }, }; const logoSet = { default: ['nasa', 'temple', 'siac'], - monitoreo: ['usaid', 'geobon', 'temple'], + monitoreo: ['usaid', 'geobon', 'umed', 'temple'], }; const Footer = ( diff --git a/src/components/CssIcons.jsx b/src/components/CssIcons.jsx new file mode 100644 index 000000000..268e1283f --- /dev/null +++ b/src/components/CssIcons.jsx @@ -0,0 +1,16 @@ +import styled from 'styled-components'; + +const Icon = styled.div` + background: ${({ image }) => `url(${image}) no-repeat center center`}; + width: 25px; + height: 27px; + display: inline-block; + + &:hover { + background: ${({ hoverImage }) => `url(${hoverImage}) no-repeat center center`}; + width: 25px; + height: 27px; + } +`; + +export default Icon; diff --git a/src/components/CssLegends.jsx b/src/components/CssLegends.jsx index e48c1a316..5a0f64622 100644 --- a/src/components/CssLegends.jsx +++ b/src/components/CssLegends.jsx @@ -9,33 +9,93 @@ const Legend = styled.p` color: #424242; line-height: 1; margin-right: 10px; +`; +const PointLegend = styled(Legend)` &:before { display: inline-block; content: ""; width: 12px; height: 12px; - margin-right: 5px; + margin-right: ${(props) => (props.marginRight ? props.marginRight : '5px')}; border-radius: 6px; vertical-align: middle; + margin-left: ${(props) => (props.marginLeft ? props.marginLeft : '0')}; } `; -const LegendColor = styled(Legend)` +const LegendColor = styled(PointLegend)` &:before { background-color: ${({ color }) => color}; } `; -const BorderLegendColor = styled(Legend)` +const BorderLegendColor = styled(PointLegend)` &:before { color: #ffffff; border: 2px solid ${({ color }) => color}; width: 7px; height: 7px; border-radius: 0; - vertical-align: bottom; } `; -export { LegendColor, BorderLegendColor }; +const LineLegend = styled(Legend)` + &:before { + display: inline-block; + content: ""; + width: 15px; + height: 3px; + margin-right: 5px; + margin-bottom: 4px; + border-bottom: 3px solid ${({ color }) => color}; + vertical-align: middle; + } +`; + +const ThickLineLegend = styled(LineLegend)` + &:before { + border-bottom: 8px solid ${({ color }) => color}; + height: 0px; + } +`; + +const TextLegend = styled(Legend)` + margin-right: 1px; + padding-bottom: 3px; + color: ${({ color }) => color}; + + &:before { + display: inline-block; + content: ""; + background: ${({ image }) => (image ? `url(${image}) no-repeat center` : '')}; + background-size: 15px; + width: 15px; + height: 26px; + margin-right: 5px; + vertical-align: middle; + } + + &:hover { + cursor: pointer; + } + + &:hover:before { + background: ${({ hoverImage }) => (hoverImage ? `url(${hoverImage}) no-repeat center` : '')}; + background-size: 15px; + width: 15px; + height: 26px; + } + + &.filtered { + border-bottom: 2px solid tomato; + } +`; + +export { + LegendColor, + BorderLegendColor, + LineLegend, + ThickLineLegend, + TextLegend, +}; diff --git a/src/components/GradientLegend.jsx b/src/components/GradientLegend.jsx new file mode 100644 index 000000000..3b10012cd --- /dev/null +++ b/src/components/GradientLegend.jsx @@ -0,0 +1,38 @@ +import PropTypes from 'prop-types'; +import React from 'react'; + +import styled from 'styled-components'; + +const Gradient = styled.div` + height: 12px; + width: 95%; + margin: 0 auto; + background: linear-gradient(0.25turn, ${({ fromColor }) => fromColor}, ${({ toColor }) => toColor}); +`; + +const GradientLegend = (props) => { + const { + from, + to, + fromColor, + toColor, + } = props; + return ( +