Skip to content

Commit

Permalink
fix: Top-level as g, not fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Apr 10, 2021
1 parent cff0123 commit f2e88ad
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
56 changes: 28 additions & 28 deletions __tests__/__snapshots__/axis.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`axis with default options 1`] = `
Array [
<g>
<g
className="tick"
transform="translate(0.5,0)"
Expand All @@ -20,7 +20,7 @@ Array [
>
0.0
</text>
</g>,
</g>
<g
className="tick"
transform="translate(0.6,0)"
Expand All @@ -39,7 +39,7 @@ Array [
>
0.1
</text>
</g>,
</g>
<g
className="tick"
transform="translate(0.7,0)"
Expand All @@ -58,7 +58,7 @@ Array [
>
0.2
</text>
</g>,
</g>
<g
className="tick"
transform="translate(0.8,0)"
Expand All @@ -77,7 +77,7 @@ Array [
>
0.3
</text>
</g>,
</g>
<g
className="tick"
transform="translate(0.9,0)"
Expand All @@ -96,7 +96,7 @@ Array [
>
0.4
</text>
</g>,
</g>
<g
className="tick"
transform="translate(1,0)"
Expand All @@ -115,7 +115,7 @@ Array [
>
0.5
</text>
</g>,
</g>
<g
className="tick"
transform="translate(1.1,0)"
Expand All @@ -134,7 +134,7 @@ Array [
>
0.6
</text>
</g>,
</g>
<g
className="tick"
transform="translate(1.2,0)"
Expand All @@ -153,7 +153,7 @@ Array [
>
0.7
</text>
</g>,
</g>
<g
className="tick"
transform="translate(1.3,0)"
Expand All @@ -172,7 +172,7 @@ Array [
>
0.8
</text>
</g>,
</g>
<g
className="tick"
transform="translate(1.4,0)"
Expand All @@ -191,7 +191,7 @@ Array [
>
0.9
</text>
</g>,
</g>
<g
className="tick"
transform="translate(1.5,0)"
Expand All @@ -210,18 +210,18 @@ Array [
>
1.0
</text>
</g>,
</g>
<path
className="domain"
d="M0.5,6V0.5H1.5V6"
fill="transparent"
stroke="currentColor"
/>,
]
/>
</g>
`;

exports[`axis with top orientation 1`] = `
Array [
<g>
<g
className="tick"
transform="translate(0.5,0)"
Expand All @@ -240,7 +240,7 @@ Array [
>
0.0
</text>
</g>,
</g>
<g
className="tick"
transform="translate(0.6,0)"
Expand All @@ -259,7 +259,7 @@ Array [
>
0.1
</text>
</g>,
</g>
<g
className="tick"
transform="translate(0.7,0)"
Expand All @@ -278,7 +278,7 @@ Array [
>
0.2
</text>
</g>,
</g>
<g
className="tick"
transform="translate(0.8,0)"
Expand All @@ -297,7 +297,7 @@ Array [
>
0.3
</text>
</g>,
</g>
<g
className="tick"
transform="translate(0.9,0)"
Expand All @@ -316,7 +316,7 @@ Array [
>
0.4
</text>
</g>,
</g>
<g
className="tick"
transform="translate(1,0)"
Expand All @@ -335,7 +335,7 @@ Array [
>
0.5
</text>
</g>,
</g>
<g
className="tick"
transform="translate(1.1,0)"
Expand All @@ -354,7 +354,7 @@ Array [
>
0.6
</text>
</g>,
</g>
<g
className="tick"
transform="translate(1.2,0)"
Expand All @@ -373,7 +373,7 @@ Array [
>
0.7
</text>
</g>,
</g>
<g
className="tick"
transform="translate(1.3,0)"
Expand All @@ -392,7 +392,7 @@ Array [
>
0.8
</text>
</g>,
</g>
<g
className="tick"
transform="translate(1.4,0)"
Expand All @@ -411,7 +411,7 @@ Array [
>
0.9
</text>
</g>,
</g>
<g
className="tick"
transform="translate(1.5,0)"
Expand All @@ -430,12 +430,12 @@ Array [
>
1.0
</text>
</g>,
</g>
<path
className="domain"
d="M0.5,-6V0.5H1.5V-6"
fill="transparent"
stroke="currentColor"
/>,
]
/>
</g>
`;
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const Axis = <Domain extends AxisDomain>({
};

return (
<>
<g>
{values.map((tick: any, i: number) => (
<g
className="tick"
Expand Down Expand Up @@ -170,6 +170,6 @@ export const Axis = <Domain extends AxisDomain>({
fill="transparent"
d={domainPath}
/>
</>
</g>
);
};

0 comments on commit f2e88ad

Please sign in to comment.