Skip to content

Commit

Permalink
feat(website): add swarmplot icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte authored and Raphaël Benitte committed Apr 17, 2019
1 parent 5dcebd6 commit aa07469
Show file tree
Hide file tree
Showing 43 changed files with 240 additions and 83 deletions.
15 changes: 14 additions & 1 deletion conf/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -402,4 +402,17 @@ capture:
output: ./website/src/assets/icons/sunburst-dark-neutral.png
- path: /internal/icons
selector: '#sunburst-darkColored'
output: ./website/src/assets/icons/sunburst-dark-colored.png
output: ./website/src/assets/icons/sunburst-dark-colored.png

- path: /internal/icons
selector: '#swarmplot-lightNeutral'
output: ./website/src/assets/icons/swarmplot-light-neutral.png
- path: /internal/icons
selector: '#swarmplot-lightColored'
output: ./website/src/assets/icons/swarmplot-light-colored.png
- path: /internal/icons
selector: '#swarmplot-darkNeutral'
output: ./website/src/assets/icons/swarmplot-dark-neutral.png
- path: /internal/icons
selector: '#swarmplot-darkColored'
output: ./website/src/assets/icons/swarmplot-dark-colored.png
Binary file modified website/src/assets/icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/chord-dark-colored.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/chord-dark-neutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/chord-light-neutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/code-dark-colored.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/code-dark-neutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/code-light-colored.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/code-light-neutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/data-dark-neutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/data-light-colored.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/data-light-neutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/geomap-dark-colored.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/geomap-light-neutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/parallel-coordinates-light-neutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/pie-dark-colored.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/pie-dark-neutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/pie-light-colored.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/pie-light-neutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/radar-dark-colored.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/radar-dark-neutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/radar-light-colored.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/radar-light-neutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/sankey-dark-colored.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/sankey-dark-neutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/sankey-light-colored.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/src/assets/icons/sankey-light-neutral.png
Binary file modified website/src/assets/icons/scatterplot-dark-neutral.png
Binary file modified website/src/assets/icons/scatterplot-light-colored.png
Binary file modified website/src/assets/icons/scatterplot-light-neutral.png
Binary file modified website/src/assets/icons/stream-light-colored.png
Binary file modified website/src/assets/icons/sunburst-dark-colored.png
Binary file modified website/src/assets/icons/sunburst-dark-neutral.png
Binary file modified website/src/assets/icons/sunburst-light-neutral.png
Binary file modified website/src/assets/[email protected]
2 changes: 1 addition & 1 deletion website/src/components/icons/CirclePackingIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const chartProps = colors => ({
{ id: 'm', value: 0.2, color: colors[0] },
],
},
colorBy: d => d.color,
colors: { datum: 'color' },
padding: 2,
enableLabel: false,
leavesOnly: true,
Expand Down
2 changes: 2 additions & 0 deletions website/src/components/icons/Icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import SankeyIcon from './SankeyIcon'
import ScatterPlotIcon from './ScatterPlotIcon'
import StreamIcon from './StreamIcon'
import SunburstIcon from './SunburstIcon'
import SwarmPlotIcon from './SwarmPlotIcon'
import TreeMapIcon from './TreeMapIcon'
import WaffleIcon from './WaffleIcon'
import ParallelCoordinatesIcon from './ParallelCoordinatesIcon'
Expand Down Expand Up @@ -80,6 +81,7 @@ const Icons = () => (
<ScatterPlotIcon />
<StreamIcon />
<SunburstIcon />
<SwarmPlotIcon />
<TreeMapIcon />
<VoronoiIcon />
<WaffleIcon />
Expand Down
106 changes: 106 additions & 0 deletions website/src/components/icons/SwarmPlotIcon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
* 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 { SwarmPlot } from '@nivo/swarmplot'
import swarmplotLightNeutralImg from '../../assets/icons/swarmplot-light-neutral.png'
import swarmplotLightColoredImg from '../../assets/icons/swarmplot-light-colored.png'
import swarmplotDarkNeutralImg from '../../assets/icons/swarmplot-dark-neutral.png'
import swarmplotDarkColoredImg from '../../assets/icons/swarmplot-dark-colored.png'
import { ICON_SIZE, Icon, colors, IconImg } from './styled'

const values = [
1,
1,
2,
2,
2,
2,
2,
3,
3,
3,
3,
3,
3,
3,
3,
4,
4,
4,
5,
5,
6,
6,
6,
6,
6,
7,
7,
8,
9,
]

const chartProps = {
width: ICON_SIZE,
height: ICON_SIZE,
scale: {
type: 'linear',
min: 1,
max: 9,
},
forceStrength: 6,
simulationIterations: 400,
data: [
{
id: 'A',
data: values.map((v, i) => ({
id: i,
value: v,
})),
},
],
margin: {
top: 6,
right: 6,
bottom: 6,
left: 6,
},
layout: 'vertical',
enableGridX: false,
enableGridY: false,
axisTop: null,
axisRight: null,
axisBottom: null,
axisLeft: null,
nodeSize: 10,
nodePadding: 1,
isInteractive: false,
animate: true,
}

const SwarmPlotIconItem = ({ type }) => (
<Icon id={`swarmplot-${type}`} type={type}>
<SwarmPlot {...chartProps} colors={[colors[type].colors[3]]} />
</Icon>
)

const SwarmPlotIcon = () => (
<>
<SwarmPlotIconItem type="lightNeutral" />
<IconImg url={swarmplotLightNeutralImg} />
<SwarmPlotIconItem type="lightColored" />
<IconImg url={swarmplotLightColoredImg} />
<SwarmPlotIconItem type="darkNeutral" />
<IconImg url={swarmplotDarkNeutralImg} />
<SwarmPlotIconItem type="darkColored" />
<IconImg url={swarmplotDarkColoredImg} />
</>
)

export default SwarmPlotIcon
Loading

0 comments on commit aa07469

Please sign in to comment.