-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Raphaël Benitte
authored and
Raphaël Benitte
committed
May 16, 2019
1 parent
4553d55
commit edf72ca
Showing
19 changed files
with
226 additions
and
7 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,153 @@ | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* (c) 2016 Raphaël Benitte | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
import React from 'react' | ||
import { AreaBump } from '@nivo/bump' | ||
import bumpLightNeutralImg from '../../assets/icons/bump-light-neutral.png' | ||
import bumpLightColoredImg from '../../assets/icons/bump-light-colored.png' | ||
import bumpDarkNeutralImg from '../../assets/icons/bump-dark-neutral.png' | ||
import bumpDarkColoredImg from '../../assets/icons/bump-dark-colored.png' | ||
import { ICON_SIZE, Icon, colors, IconImg } from './styled' | ||
|
||
const chartProps = { | ||
width: ICON_SIZE, | ||
height: ICON_SIZE, | ||
data: [ | ||
{ | ||
id: 'A', | ||
data: [ | ||
{ | ||
x: -1, | ||
y: 2, | ||
}, | ||
{ | ||
x: 0, | ||
y: 2, | ||
}, | ||
{ | ||
x: 1, | ||
y: 3, | ||
}, | ||
{ | ||
x: 2, | ||
y: 3, | ||
}, | ||
{ | ||
x: 3, | ||
y: 3, | ||
}, | ||
], | ||
}, | ||
{ | ||
id: 'B', | ||
data: [ | ||
{ | ||
x: -1, | ||
y: 1, | ||
}, | ||
{ | ||
x: 0, | ||
y: 1, | ||
}, | ||
{ | ||
x: 1, | ||
y: 1, | ||
}, | ||
{ | ||
x: 2, | ||
y: 2, | ||
}, | ||
{ | ||
x: 3, | ||
y: 2, | ||
}, | ||
], | ||
}, | ||
{ | ||
id: 'C', | ||
data: [ | ||
{ | ||
x: -1, | ||
y: 2, | ||
}, | ||
{ | ||
x: 0, | ||
y: 2, | ||
}, | ||
{ | ||
x: 1, | ||
y: 2, | ||
}, | ||
{ | ||
x: 2, | ||
y: 1, | ||
}, | ||
{ | ||
x: 3, | ||
y: 1, | ||
}, | ||
], | ||
}, | ||
], | ||
margin: { | ||
top: 8, | ||
right: 5, | ||
bottom: 8, | ||
left: 5, | ||
}, | ||
align: 'end', | ||
spacing: 4, | ||
borderWidth: 0, | ||
endLabel: false, | ||
axisTop: null, | ||
axisBottom: null, | ||
enableGridX: false, | ||
isInteractive: true, | ||
} | ||
|
||
const AreaBumpIconItem = ({ type }) => ( | ||
<Icon id={`area-bump-${type}`} type={type}> | ||
<AreaBump | ||
{...chartProps} | ||
colors={colors[type].colors} | ||
theme={{ | ||
axis: { | ||
domain: { | ||
line: { | ||
stroke: colors[type].colors[3], | ||
strokeWidth: 3, | ||
strokeLinecap: 'square', | ||
}, | ||
}, | ||
}, | ||
grid: { | ||
line: { | ||
strokeWidth: 2, | ||
strokeOpacity: 0.5, | ||
stroke: colors[type].colors[1], | ||
}, | ||
}, | ||
}} | ||
/> | ||
</Icon> | ||
) | ||
|
||
const AreaBumpIcon = () => ( | ||
<> | ||
<AreaBumpIconItem type="lightNeutral" /> | ||
<IconImg url={bumpLightNeutralImg} /> | ||
<AreaBumpIconItem type="lightColored" /> | ||
<IconImg url={bumpLightColoredImg} /> | ||
<AreaBumpIconItem type="darkNeutral" /> | ||
<IconImg url={bumpDarkNeutralImg} /> | ||
<AreaBumpIconItem type="darkColored" /> | ||
<IconImg url={bumpDarkColoredImg} /> | ||
</> | ||
) | ||
|
||
export default AreaBumpIcon |
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,4 +1,4 @@ | ||
/* glue: 0.13 hash: c3ab469375 */ | ||
/* glue: 0.13 hash: 0a618edcf6 */ | ||
.sprite-icons-waffle-light-neutral, | ||
.sprite-icons-waffle-light-colored, | ||
.sprite-icons-waffle-dark-neutral, | ||
|
@@ -103,7 +103,11 @@ | |
.sprite-icons-bar-light-neutral, | ||
.sprite-icons-bar-light-colored, | ||
.sprite-icons-bar-dark-neutral, | ||
.sprite-icons-bar-dark-colored { | ||
.sprite-icons-bar-dark-colored, | ||
.sprite-icons-area-bump-light-neutral, | ||
.sprite-icons-area-bump-light-colored, | ||
.sprite-icons-area-bump-dark-neutral, | ||
.sprite-icons-area-bump-dark-colored { | ||
background-image: url('../assets/icons.png'); | ||
background-repeat: no-repeat; | ||
} | ||
|
@@ -738,6 +742,30 @@ | |
height: 52px; | ||
} | ||
|
||
.sprite-icons-area-bump-light-neutral { | ||
background-position: -604px -304px; | ||
width: 52px; | ||
height: 52px; | ||
} | ||
|
||
.sprite-icons-area-bump-light-colored { | ||
background-position: -604px -364px; | ||
width: 52px; | ||
height: 52px; | ||
} | ||
|
||
.sprite-icons-area-bump-dark-neutral { | ||
background-position: -604px -424px; | ||
width: 52px; | ||
height: 52px; | ||
} | ||
|
||
.sprite-icons-area-bump-dark-colored { | ||
background-position: -604px -484px; | ||
width: 52px; | ||
height: 52px; | ||
} | ||
|
||
@media screen and (-webkit-min-device-pixel-ratio: 1), | ||
screen and (min--moz-device-pixel-ratio: 1), | ||
screen and (-o-min-device-pixel-ratio: 100/100), | ||
|
@@ -847,7 +875,11 @@ | |
.sprite-icons-bar-light-neutral, | ||
.sprite-icons-bar-light-colored, | ||
.sprite-icons-bar-dark-neutral, | ||
.sprite-icons-bar-dark-colored { | ||
.sprite-icons-bar-dark-colored, | ||
.sprite-icons-area-bump-light-neutral, | ||
.sprite-icons-area-bump-light-colored, | ||
.sprite-icons-area-bump-dark-neutral, | ||
.sprite-icons-area-bump-dark-colored { | ||
background-image: url('../assets/icons.png'); | ||
-webkit-background-size: 660px 600px; | ||
-moz-background-size: 660px 600px; | ||
|
@@ -964,7 +996,11 @@ | |
.sprite-icons-bar-light-neutral, | ||
.sprite-icons-bar-light-colored, | ||
.sprite-icons-bar-dark-neutral, | ||
.sprite-icons-bar-dark-colored { | ||
.sprite-icons-bar-dark-colored, | ||
.sprite-icons-area-bump-light-neutral, | ||
.sprite-icons-area-bump-light-colored, | ||
.sprite-icons-area-bump-dark-neutral, | ||
.sprite-icons-area-bump-dark-colored { | ||
background-image: url('../assets/[email protected]'); | ||
-webkit-background-size: 660px 600px; | ||
-moz-background-size: 660px 600px; | ||
|