diff --git a/packages/vx-demo/components/tiles/axis.js b/packages/vx-demo/components/tiles/axis.js index ff8a078eb..66390ca58 100644 --- a/packages/vx-demo/components/tiles/axis.js +++ b/packages/vx-demo/components/tiles/axis.js @@ -88,95 +88,97 @@ export default ({ width, height, margin }) => { curve={curveBasis} /> - ({ - fill: '#8e205f', - textAnchor: 'end', - fontSize: 10, - fontFamily: 'Arial', - dx: '-0.25em', - dy: '0.25em' - })} - tickComponent={({ formattedValue, ...tickProps }) => ( - {formattedValue} - )} - /> - ({ - fill: '#8e205f', - textAnchor: 'start', - fontSize: 10, - fontFamily: 'Arial', - dx: '0.25em', - dy: '0.25em' - })} - /> - - {props => { - const tickLabelSize = 10; - const tickRotate = 45; - const tickColor = '#8e205f'; - const axisCenter = (props.axisToPoint.x - props.axisFromPoint.x) / 2; - return ( - - {props.ticks.map((tick, i) => { - const tickX = tick.to.x; - const tickY = tick.to.y + tickLabelSize + props.tickLength; - return ( - - - - {tick.formattedValue} - - - ); - })} - - {props.label} - - - ); - }} - + + ({ + fill: '#8e205f', + textAnchor: 'end', + fontSize: 10, + fontFamily: 'Arial', + dx: '-0.25em', + dy: '0.25em' + })} + tickComponent={({ formattedValue, ...tickProps }) => ( + {formattedValue} + )} + /> + ({ + fill: '#8e205f', + textAnchor: 'start', + fontSize: 10, + fontFamily: 'Arial', + dx: '0.25em', + dy: '0.25em' + })} + /> + + {props => { + const tickLabelSize = 10; + const tickRotate = 45; + const tickColor = '#8e205f'; + const axisCenter = (props.axisToPoint.x - props.axisFromPoint.x) / 2; + return ( + + {props.ticks.map((tick, i) => { + const tickX = tick.to.x; + const tickY = tick.to.y + tickLabelSize + props.tickLength; + return ( + + + + {tick.formattedValue} + + + ); + })} + + {props.label} + + + ); + }} + + ); }; diff --git a/packages/vx-demo/pages/axis.js b/packages/vx-demo/pages/axis.js index 20edbd1d3..ce6b5aefa 100644 --- a/packages/vx-demo/pages/axis.js +++ b/packages/vx-demo/pages/axis.js @@ -104,95 +104,97 @@ export default ({ width, height, margin }) => { curve={curveBasis} /> - ({ - fill: '#8e205f', - textAnchor: 'end', - fontSize: 10, - fontFamily: 'Arial', - dx: '-0.25em', - dy: '0.25em' - })} - tickComponent={({ formattedValue, ...tickProps }) => ( - {formattedValue} - )} - /> - ({ - fill: '#8e205f', - textAnchor: 'start', - fontSize: 10, - fontFamily: 'Arial', - dx: '0.25em', - dy: '0.25em' - })} - /> - - {props => { - const tickLabelSize = 10; - const tickRotate = 45; - const tickColor = '#8e205f'; - const axisCenter = (props.axisToPoint.x - props.axisFromPoint.x) / 2; - return ( - - {props.ticks.map((tick, i) => { - const tickX = tick.to.x; - const tickY = tick.to.y + tickLabelSize + props.tickLength; - return ( - - - - {tick.formattedValue} - - - ); - })} - - {props.label} - - - ); - }} - + + ({ + fill: '#8e205f', + textAnchor: 'end', + fontSize: 10, + fontFamily: 'Arial', + dx: '-0.25em', + dy: '0.25em' + })} + tickComponent={({ formattedValue, ...tickProps }) => ( + {formattedValue} + )} + /> + ({ + fill: '#8e205f', + textAnchor: 'start', + fontSize: 10, + fontFamily: 'Arial', + dx: '0.25em', + dy: '0.25em' + })} + /> + + {props => { + const tickLabelSize = 10; + const tickRotate = 45; + const tickColor = '#8e205f'; + const axisCenter = (props.axisToPoint.x - props.axisFromPoint.x) / 2; + return ( + + {props.ticks.map((tick, i) => { + const tickX = tick.to.x; + const tickY = tick.to.y + tickLabelSize + props.tickLength; + return ( + + + + {tick.formattedValue} + + + ); + })} + + {props.label} + + + ); + }} + + ); };`}