Skip to content

Commit

Permalink
feat(deps): upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte authored and Raphaël Benitte committed Aug 24, 2018
1 parent 292fa96 commit 3f4b429
Show file tree
Hide file tree
Showing 66 changed files with 2,307 additions and 842 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ package-lint-%: ##@1 packages run eslint on package

packages-lint: ##@1 packages run eslint on all packages
@echo "${YELLOW}Running eslint on all packages${RESET}"
@./node_modules/.bin/eslint ./packages/*/{src,tests}
@./node_modules/.bin/eslint "./packages/*/{src,tests}/**/*.js"

package-tslint-%: ##@1 packages run tslint on package
@echo "${YELLOW}Running tslint on package ${WHITE}@nivo/${*}${RESET}"
Expand Down
66 changes: 33 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ yarn add @nivo/bar @nivo/sankey ...

## Features

* Highly customizable
* Motion/transitions, powered by [react-motion](https://github.com/chenglou/react-motion)
* [Component playground](http://nivo.rocks)
* [Exhaustive documentation](http://nivo.rocks)
* Isomorphic rendering
* [SVG charts](http://nivo.rocks/components?filter=svg)
* [HTML charts](http://nivo.rocks/components?filter=html)
* [Canvas charts](http://nivo.rocks/components?filter=canvas)
* [server side rendering API](https://github.com/plouc/nivo-api)
* [SVG patterns](http://nivo.rocks/guides/patterns)
* [Gradients](http://nivo.rocks/guides/gradients)
* [responsive charts](http://nivo.rocks/components?q=responsive)
- Highly customizable
- Motion/transitions, powered by [react-motion](https://github.com/chenglou/react-motion)
- [Component playground](http://nivo.rocks)
- [Exhaustive documentation](http://nivo.rocks)
- Isomorphic rendering
- [SVG charts](http://nivo.rocks/components?filter=svg)
- [HTML charts](http://nivo.rocks/components?filter=html)
- [Canvas charts](http://nivo.rocks/components?filter=canvas)
- [server side rendering API](https://github.com/plouc/nivo-api)
- [SVG patterns](http://nivo.rocks/guides/patterns)
- [Gradients](http://nivo.rocks/guides/gradients)
- [responsive charts](http://nivo.rocks/components?q=responsive)

## Discussion

Expand Down Expand Up @@ -118,36 +118,36 @@ please try the [components explorer](http://nivo.rocks/components).

Components available through the HTTP rendering API.

* [Bar](https://nivo-api.herokuapp.com/samples/bar.svg)
* [Bubble](https://nivo-api.herokuapp.com/samples/bubble.svg)
* [Chord](https://nivo-api.herokuapp.com/samples/chord.svg)
* [HeatMap](https://nivo-api.herokuapp.com/samples/heatmap.svg)
* [Line](https://nivo-api.herokuapp.com/samples/line.svg)
* [Pie](https://nivo-api.herokuapp.com/samples/pie.svg)
* [Radar](https://nivo-api.herokuapp.com/samples/radar.svg)
* [Sankey](https://nivo-api.herokuapp.com/samples/sankey.svg)
* [Sunburst](https://nivo-api.herokuapp.com/samples/sunburst.svg)
* [TreeMap](https://nivo-api.herokuapp.com/samples/treemap.svg)
- [Bar](https://nivo-api.herokuapp.com/samples/bar.svg)
- [Bubble](https://nivo-api.herokuapp.com/samples/bubble.svg)
- [Chord](https://nivo-api.herokuapp.com/samples/chord.svg)
- [HeatMap](https://nivo-api.herokuapp.com/samples/heatmap.svg)
- [Line](https://nivo-api.herokuapp.com/samples/line.svg)
- [Pie](https://nivo-api.herokuapp.com/samples/pie.svg)
- [Radar](https://nivo-api.herokuapp.com/samples/radar.svg)
- [Sankey](https://nivo-api.herokuapp.com/samples/sankey.svg)
- [Sunburst](https://nivo-api.herokuapp.com/samples/sunburst.svg)
- [TreeMap](https://nivo-api.herokuapp.com/samples/treemap.svg)

## Guides

* [colors](http://nivo.rocks/guides/colors)
* [legends](http://nivo.rocks/guides/legends)
* [gradients](http://nivo.rocks/guides/gradients)
* [patterns](http://nivo.rocks/guides/patterns)
- [colors](http://nivo.rocks/guides/colors)
- [legends](http://nivo.rocks/guides/legends)
- [gradients](http://nivo.rocks/guides/gradients)
- [patterns](http://nivo.rocks/guides/patterns)

## Repositories

* [nivo](https://github.com/plouc/nivo) - nivo packages, website, storybook and examples
* [nivo-api](https://github.com/plouc/nivo-api) - the nivo http api
* [nivo-api-docker](https://github.com/plouc/nivo-api-docker) - a Docker image for the nivo http api
- [nivo](https://github.com/plouc/nivo) - nivo packages, website, storybook and examples
- [nivo-api](https://github.com/plouc/nivo-api) - the nivo http api
- [nivo-api-docker](https://github.com/plouc/nivo-api-docker) - a Docker image for the nivo http api

## Credits

* [d3](https://d3js.org/)
* [react](https://facebook.github.io/react/)
* [react-motion](https://github.com/chenglou/react-motion)
*
- [d3](https://d3js.org/)
- [react](https://facebook.github.io/react/)
- [react-motion](https://github.com/chenglou/react-motion)
-

[license-image]: https://img.shields.io/github/license/plouc/nivo.svg?style=flat-square
[license-url]: https://github.com/plouc/nivo/blob/master/LICENSE.md
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,26 @@
"clog-cli": "^1.0.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^4.16.0",
"eslint": "^5.4.0",
"eslint-plugin-react": "^7.6.0",
"gh-pages": "^1.0.0",
"jest": "^22.1.4",
"lerna": "^2.5.1",
"jest": "^23.5.0",
"lerna": "^3.1.4",
"lodash": "^4.17.4",
"prettier": "^1.6.1",
"prettier": "^1.14.2",
"prop-types": "^15.5.10",
"puppeteer": "^0.13.0",
"raf": "^3.4.0",
"react": "16.2.0",
"react-dom": "16.2.0",
"react-test-renderer": "^16.2.0",
"rollup": "^0.55.1",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-node-resolve": "^3.0.2",
"rollup": "^0.64.1",
"rollup-plugin-babel": "^3.0.7",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-prettier": "^0.4.0",
"rollup-plugin-strip-banner": "^0.2.0",
"tslint": "^5.10.0",
"typescript": "^2.9.1"
"tslint": "^5.11.0",
"typescript": "^3.0.1"
},
"scripts": {
"fmt": "prettier --print-width=100 --tab-width=4 --bracket-spacing --no-semi --trailing-comma es5 --single-quote --color --write \"{src,specs,test,.storybook,stories}/**/*.js\"",
Expand Down
8 changes: 7 additions & 1 deletion packages/core/src/components/axes/GridLines.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ export default class GridLines extends Component {
const { lines, animate, motionStiffness, motionDamping, theme } = this.props

if (!animate) {
return <g>{lines.map(line => <GridLine key={line.key} {...line} {...theme.grid} />)}</g>
return (
<g>
{lines.map(line => (
<GridLine key={line.key} {...line} {...theme.grid} />
))}
</g>
)
}

const springConfig = {
Expand Down
16 changes: 7 additions & 9 deletions packages/core/src/hocs/withColors.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ import { getColorsGenerator } from '../lib/colors'
* Using it prevent from having a new ref each time
* we pass through the component, useful for shallow comparison.
*/
export default (
{
colorsKey = 'colors',
colorByKey = 'colorBy',
destKey = 'getColor',
defaultColors = 'nivo',
defaultColorBy = 'id',
} = {}
) =>
export default ({
colorsKey = 'colors',
colorByKey = 'colorBy',
destKey = 'getColor',
defaultColors = 'nivo',
defaultColorBy = 'id',
} = {}) =>
compose(
defaultProps({
[colorsKey]: defaultColors,
Expand Down
9 changes: 6 additions & 3 deletions packages/core/src/hocs/withHierarchy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ import { getAccessorFor } from '../lib/propertiesConverters'
* Using it prevent from having a new ref each time
* we pass through the component, useful for shallow comparison.
*/
export default (
{ srcKey = 'root', destKey = 'root', valueKey = 'value', valueDefault = 'value' } = {}
) =>
export default ({
srcKey = 'root',
destKey = 'root',
valueKey = 'value',
valueDefault = 'value',
} = {}) =>
compose(
defaultProps({
[valueKey]: valueDefault,
Expand Down
25 changes: 14 additions & 11 deletions packages/core/src/lib/colors/inherit.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@ import { rgb } from 'd3-color'
/**
* Memoize both color generator & color generator result.
*/
const memoizedColorModifier = memoize((method, _amount) => {
const amount = parseFloat(_amount)

return memoize(
d =>
rgb(d.color)
[method](amount) // eslint-disable-line no-unexpected-multiline
.toString(),
d => d.color
)
}, (method, amount) => `${method}.${amount}`)
const memoizedColorModifier = memoize(
(method, _amount) => {
const amount = parseFloat(_amount)

return memoize(
d =>
rgb(d.color)
[method](amount) // eslint-disable-line no-unexpected-multiline
.toString(),
d => d.color
)
},
(method, amount) => `${method}.${amount}`
)

const noneGenerator = () => 'none'
const inheritGenerator = d => d.color
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/lib/polar/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

export const TWO_PI = Math.PI * 2

export const degreesToRadians = degrees => degrees * Math.PI / 180
export const degreesToRadians = degrees => (degrees * Math.PI) / 180

export const radiansToDegrees = radians => 180 * radians / Math.PI
export const radiansToDegrees = radians => (180 * radians) / Math.PI

export const midAngle = arc => arc.startAngle + (arc.endAngle - arc.startAngle) / 2

Expand Down
4 changes: 2 additions & 2 deletions packages/pie/src/PieLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ export const enhance = Component =>
adjustedBox.x = (width - adjustedBox.width) / 2
adjustedBox.y = (height - adjustedBox.height) / 2

centerX = (centerX - box.x) / box.width * box.width * ratio + adjustedBox.x
centerY = (centerY - box.y) / box.height * box.height * ratio + adjustedBox.y
centerX = ((centerX - box.x) / box.width) * box.width * ratio + adjustedBox.x
centerY = ((centerY - box.y) / box.height) * box.height * ratio + adjustedBox.y

boundingBox = { box, ratio, points }

Expand Down
2 changes: 1 addition & 1 deletion packages/radar/src/Radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ const enhance = compose(
radiusScale,
centerX: width / 2,
centerY: height / 2,
angleStep: Math.PI * 2 / data.length,
angleStep: (Math.PI * 2) / data.length,
}
}
),
Expand Down
2 changes: 1 addition & 1 deletion packages/radar/src/RadarGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ RadarGrid.propTypes = {
const enhance = compose(
withPropsOnChange(['indices', 'levels', 'radius', 'angleStep'], props => ({
radii: range(props.levels)
.map(i => props.radius / props.levels * (i + 1))
.map(i => (props.radius / props.levels) * (i + 1))
.reverse(),
angles: range(props.indices.length).map(i => i * props.angleStep - Math.PI / 2),
})),
Expand Down
6 changes: 5 additions & 1 deletion packages/scatterplot/src/enhance.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ import { ScatterPlotDefaultProps } from './props'

export const computeScales = ({ data, width, height, scales: _scales }) => {
const scales = _scales.map(scaleConfig => {
const { id, axis, domain: [min, max] } = scaleConfig
const {
id,
axis,
domain: [min, max],
} = scaleConfig

let minValue = min
let maxValue = max
Expand Down
3 changes: 2 additions & 1 deletion packages/scatterplot/stories/scatterplot.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ stories.add(
<span style={{ color }}>
<strong>
{id} ({serie})
</strong>: {`x: ${x}, y: ${y}`}
</strong>
: {`x: ${x}, y: ${y}`}
</span>
)}
theme={{
Expand Down
28 changes: 13 additions & 15 deletions packages/sunburst/src/Sunburst.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,18 @@ const Sunburst = ({
{({ showTooltip, hideTooltip }) => (
<SvgWrapper width={outerWidth} height={outerHeight} margin={margin}>
<g transform={`translate(${centerX}, ${centerY})`}>
{nodes
.filter(node => node.depth > 0)
.map((node, i) => (
<SunburstArc
key={i}
node={node}
arcGenerator={arcGenerator}
borderWidth={borderWidth}
borderColor={borderColor}
showTooltip={showTooltip}
hideTooltip={hideTooltip}
theme={theme}
/>
))}
{nodes.filter(node => node.depth > 0).map((node, i) => (
<SunburstArc
key={i}
node={node}
arcGenerator={arcGenerator}
borderWidth={borderWidth}
borderColor={borderColor}
showTooltip={showTooltip}
hideTooltip={hideTooltip}
theme={theme}
/>
))}
</g>
</SvgWrapper>
)}
Expand Down Expand Up @@ -172,7 +170,7 @@ const enhance = compose(
Object.assign(node.data, {
id: getIdentity(node.data),
value: node.value,
percentage: 100 * node.value / total,
percentage: (100 * node.value) / total,
depth: node.depth,
ancestor,
})
Expand Down
7 changes: 6 additions & 1 deletion packages/voronoi/src/enhance.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ import { withTheme, withDimensions } from '@nivo/core'
import { VoronoiDefaultProps } from './props'

export default Component =>
compose(defaultProps(VoronoiDefaultProps), withTheme(), withDimensions(), pure)(Component)
compose(
defaultProps(VoronoiDefaultProps),
withTheme(),
withDimensions(),
pure
)(Component)
3 changes: 2 additions & 1 deletion website/src/components/ChartTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ export default class ChartTabs extends Component {
{currentTab === 'chart' &&
nodeCount !== undefined && (
<span className="chart-tabs__node-count">
<strong>{nodeCount}</strong>&nbsp;nodes
<strong>{nodeCount}</strong>
&nbsp;nodes
</span>
)}
</div>
Expand Down
12 changes: 8 additions & 4 deletions website/src/components/charts/bar/Bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ export default class Bar extends Component {
rel="noopener noreferrer"
>
example
</a>.
</a>
.
</p>
<p className="description">
The responsive alternative of this component is <code>ResponsiveBar</code>.
Expand All @@ -216,7 +217,8 @@ export default class Bar extends Component {
rel="noopener noreferrer"
>
nivo-api
</a>, see{' '}
</a>
, see{' '}
<a
href={`${config.nivoApiUrl}/samples/bar.svg`}
target="_blank"
Expand All @@ -232,11 +234,13 @@ export default class Bar extends Component {
rel="noopener noreferrer"
>
the storybook
</a>.
</a>
.
</p>
<p>
See the <Link to="/guides/legends">dedicated guide</Link> on how to setup
legends for this component.<br />
legends for this component.
<br />
However it requires an extra property for each legend configuration you pass to{' '}
<code>legends</code> property: <code>dataFrom</code>, it defines how to compute
legend's data and accept <code>indexes</code> or <code>keys</code>.<br />
Expand Down
3 changes: 2 additions & 1 deletion website/src/components/charts/bar/BarCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ export default class BarCanvas extends Component {
lose the isomorphic ability and transitions.
</p>
<p className="description">
The responsive alternative of this component is <code>ResponsiveBarCanvas</code>.
The responsive alternative of this component is <code>ResponsiveBarCanvas</code>
.
</p>
</div>
)
Expand Down
Loading

0 comments on commit 3f4b429

Please sign in to comment.