-
-
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.
feat(composition): init more granular approach to components
- Loading branch information
Raphaël Benitte
committed
Dec 11, 2017
1 parent
a6f5137
commit da5c6fb
Showing
85 changed files
with
2,502 additions
and
791 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"lerna": "2.5.1", | ||
"packages": [ | ||
"website", | ||
"packages/*" | ||
], | ||
"version": "0.33.0" | ||
|
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@nivo/babel-preset"] | ||
} |
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,18 @@ | ||
parser: babel-eslint | ||
|
||
parserOptions: | ||
ecmaVersion: 6 | ||
sourceType: module | ||
ecmaFeatures: | ||
jsx: true | ||
experimentalObjectRestSpread: true | ||
|
||
env: | ||
browser: true | ||
|
||
globals: | ||
global: true | ||
|
||
extends: | ||
- eslint:recommended | ||
- plugin:react/recommended |
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,20 @@ | ||
# src (will be transpiled) | ||
/src | ||
|
||
# logs | ||
*.log* | ||
|
||
# OSX | ||
.DS_Store | ||
|
||
# config/build | ||
.babelrc | ||
|
||
# storybook | ||
/.storybook | ||
/stories | ||
/storybook-static | ||
|
||
# test | ||
/coverage | ||
/tests |
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,47 @@ | ||
{ | ||
"name": "@nivo/axes", | ||
"version": "0.33.0", | ||
"license": "MIT", | ||
"main": "./lib/index.js", | ||
"module": "es/index.js", | ||
"jsnext:main": "es/index.js", | ||
"dependencies": { | ||
"@nivo/core": "0.33.0", | ||
"d3-format": "^1.2.0", | ||
"d3-scale": "^1.0.6", | ||
"d3-shape": "^1.2.0", | ||
"react-motion": "^0.5.2", | ||
"recompose": "^0.26.0" | ||
}, | ||
"devDependencies": { | ||
"@nivo/babel-preset": "0.33.0", | ||
"@nivo/generators": "0.33.0", | ||
"babel-cli": "^6.26.0", | ||
"babel-eslint": "^8.0.3", | ||
"babel-jest": "^20.0.3", | ||
"cross-env": "^5.0.5", | ||
"eslint": "^4.12.1", | ||
"eslint-plugin-react": "^7.5.1", | ||
"jest": "^21.0.1", | ||
"react": "^16.2.0", | ||
"react-dom": "^16.2.0", | ||
"react-test-renderer": "^16.2.0" | ||
}, | ||
"peerDependencies": { | ||
"prop-types": "^15.5.10", | ||
"react": ">= 16.2.0 < 17.0.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"lint": "eslint src stories tests", | ||
"test": "jest --verbose ./tests", | ||
"test:cover": "jest --verbose --coverage ./tests", | ||
"build:commonjs": "rm -rf lib && cross-env NODE_ENV=commonjs babel src --out-dir lib", | ||
"build:commonjs:watch": "npm run build:commonjs -- --watch", | ||
"build:es": "rm -rf es && cross-env NODE_ENV=es babel src --out-dir es", | ||
"build:es:watch": "npm run build:es -- --watch", | ||
"build": "npm run build:commonjs && npm run build:es" | ||
} | ||
} |
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,29 @@ | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
import { renderGridLinesToCanvas } from './render' | ||
|
||
const GridCanvas = ({ ctx, width, height, xScale, yScale }) => { | ||
renderGridLinesToCanvas(ctx, { | ||
width, | ||
height, | ||
scale: xScale, | ||
axis: 'x', | ||
}) | ||
|
||
renderGridLinesToCanvas(ctx, { | ||
width, | ||
height, | ||
scale: yScale, | ||
axis: 'y', | ||
}) | ||
|
||
return null | ||
} | ||
|
||
export default GridCanvas |
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,61 @@ | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
import PropTypes from 'prop-types' | ||
import { renderAxisToCanvas } from './render' | ||
|
||
const XAxisCanvas = ({ | ||
ctx, | ||
width, | ||
height, | ||
position, | ||
scale, | ||
tickSize, | ||
tickPadding, | ||
tickRotation, | ||
format, | ||
}) => { | ||
renderAxisToCanvas(ctx, { | ||
width, | ||
height, | ||
position, | ||
scale, | ||
tickSize, | ||
tickPadding, | ||
tickRotation, | ||
format, | ||
}) | ||
|
||
return null | ||
} | ||
|
||
XAxisCanvas.propTypes = { | ||
ctx: PropTypes.object.isRequired, | ||
|
||
// generic | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired, | ||
position: PropTypes.oneOf(['top', 'bottom']).isRequired, | ||
scale: PropTypes.func.isRequired, | ||
|
||
// ticks | ||
tickValues: PropTypes.array, | ||
tickCount: PropTypes.number, | ||
tickSize: PropTypes.number.isRequired, | ||
tickPadding: PropTypes.number.isRequired, | ||
tickRotation: PropTypes.number.isRequired, | ||
format: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), | ||
} | ||
|
||
XAxisCanvas.defaultProps = { | ||
tickSize: 5, | ||
tickPadding: 5, | ||
tickRotation: 0, | ||
} | ||
|
||
export default XAxisCanvas |
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,61 @@ | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
import PropTypes from 'prop-types' | ||
import { renderAxisToCanvas } from './render' | ||
|
||
const YAxisCanvas = ({ | ||
ctx, | ||
width, | ||
height, | ||
position, | ||
scale, | ||
tickSize, | ||
tickPadding, | ||
tickRotation, | ||
format, | ||
}) => { | ||
renderAxisToCanvas(ctx, { | ||
width, | ||
height, | ||
position, | ||
scale, | ||
tickSize, | ||
tickPadding, | ||
tickRotation, | ||
format, | ||
}) | ||
|
||
return null | ||
} | ||
|
||
YAxisCanvas.propTypes = { | ||
ctx: PropTypes.object.isRequired, | ||
|
||
// generic | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired, | ||
position: PropTypes.oneOf(['left', 'right']).isRequired, | ||
scale: PropTypes.func.isRequired, | ||
|
||
// ticks | ||
tickValues: PropTypes.array, | ||
tickCount: PropTypes.number, | ||
tickSize: PropTypes.number.isRequired, | ||
tickPadding: PropTypes.number.isRequired, | ||
tickRotation: PropTypes.number.isRequired, | ||
format: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), | ||
} | ||
|
||
YAxisCanvas.defaultProps = { | ||
tickSize: 5, | ||
tickPadding: 5, | ||
tickRotation: 0, | ||
} | ||
|
||
export default YAxisCanvas |
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,12 @@ | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
export { default as XAxisCanvas } from './XAxisCanvas' | ||
export { default as YAxisCanvas } from './YAxisCanvas' | ||
export { default as GridCanvas } from './GridCanvas' | ||
export * from './render' |
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
Oops, something went wrong.