Skip to content

Commit

Permalink
Format with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
jayb committed Sep 19, 2024
1 parent 9b115c7 commit 2965925
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
23 changes: 20 additions & 3 deletions packages/chart/src/components/Axis/Categorical.Axis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,14 @@ const CategoricalYAxis = ({ yMax, leftSize, max, xMax }) => {
const keys = Object.keys(transformedData[0])
return (
<Group left={leftSize - xScale.bandwidth()} top={0}>
<BarStack data={transformedData} keys={keys} x={() => xScale(xScaleValue)} xScale={xScale} yScale={yScale} color={colorScale}>
<BarStack
data={transformedData}
keys={keys}
x={() => xScale(xScaleValue)}
xScale={xScale}
yScale={yScale}
color={colorScale}
>
{barStacks =>
barStacks.map(barStack =>
barStack.bars.map(bar => {
Expand All @@ -96,7 +103,11 @@ const CategoricalYAxis = ({ yMax, leftSize, max, xMax }) => {
</li></ul>`
return (
<Group key={`${barStack.index}--${bar.index}--${orientation}`}>
<Group key={`bar-stack-${barStack.index}-${bar.index}`} id={`barStack${barStack.index}-${bar.index}`} className='stack vertical'>
<Group
key={`bar-stack-${barStack.index}-${bar.index}`}
id={`barStack${barStack.index}-${bar.index}`}
className='stack vertical'
>
{createBarElement({
type: 'axisBar',
config: config,
Expand Down Expand Up @@ -126,7 +137,13 @@ const CategoricalYAxis = ({ yMax, leftSize, max, xMax }) => {
{bar.key}
</Text>
{/* gridLines */}
{config.runtime.yAxis.gridLines && <Line from={{ x: bar.x + xScale.bandwidth(), y: bar.y }} to={{ x: xMax + xScale.bandwidth(), y: bar.y }} stroke='#d6d6d6' />}
{config.runtime.yAxis.gridLines && (
<Line
from={{ x: bar.x + xScale.bandwidth(), y: bar.y }}
to={{ x: xMax + xScale.bandwidth(), y: bar.y }}
stroke='#d6d6d6'
/>
)}
{/* White background spacing between stackes */}
{!isLastIndex && <rect x={bar.x} y={bar.y} width={bar.width} height={1} fill={'#fff'}></rect>}
{/* Right side Axis line */}
Expand Down
6 changes: 1 addition & 5 deletions packages/chart/src/components/LinearChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -784,11 +784,7 @@ const LinearChart: React.FC<LinearChartProps> = props => {
)}

{runtime.yAxis.rightGridLines ? (
<Line
from={{ x: tick.from.x + xMax, y: tick.from.y }}
to={tick.from}
stroke='#d6d6d6'
/>
<Line from={{ x: tick.from.x + xMax, y: tick.from.y }} to={tick.from} stroke='#d6d6d6' />
) : (
''
)}
Expand Down

0 comments on commit 2965925

Please sign in to comment.