Skip to content

Instantly share code, notes, and snippets.

@caspg
Created December 10, 2016 17:57
Show Gist options
  • Save caspg/badf282b8ff23786893866f888a359b0 to your computer and use it in GitHub Desktop.
Save caspg/badf282b8ff23786893866f888a359b0 to your computer and use it in GitHub Desktop.
import React from 'react'
import Axis from '../Axis'
export default ({ scales, margins, svgDimensions }) => {
const { height, width } = svgDimensions
const xProps = {
orient: 'Bottom',
scale: scales.xScale,
translate: `translate(0, ${height - margins.bottom})`,
tickSize: height - margins.top - margins.bottom,
}
const yProps = {
orient: 'Left',
scale: scales.yScale,
translate: `translate(${margins.left}, 0)`,
tickSize: width - margins.left - margins.right,
}
return (
<g>
<Axis {...xProps} />
<Axis {...yProps} />
</g>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment