diff --git a/demo/components/sidenav.js b/demo/components/sidenav.js index 87471a5..d6a2e2f 100644 --- a/demo/components/sidenav.js +++ b/demo/components/sidenav.js @@ -92,7 +92,11 @@ const Sidenav = ({ active, expanded }) => { {contents[d].map((e) => { - const normalizedName = e.replace(/[A-Z]/g, (match, offset) => (offset > 0 ? '-' : '') + match.toLowerCase()) + const normalizedName = e.replace( + /[A-Z]/g, + (match, offset) => + (offset > 0 ? '-' : '') + match.toLowerCase() + ) return ( [i, (i + 1) * 9]) +export const data = Array(11) + .fill(null) + .map((_, i) => [i, (i + 1) * 9]) # Bar This is a simple bar chart. - + @@ -31,7 +33,7 @@ This is a simple bar chart. ```jsx - + @@ -47,7 +49,7 @@ This is a simple bar chart. ### Horizontal bar - + @@ -59,7 +61,7 @@ This is a simple bar chart. ```jsx - + @@ -73,7 +75,7 @@ This is a simple bar chart. ### Floating bar - + @@ -85,7 +87,7 @@ This is a simple bar chart. ```jsx - + @@ -99,24 +101,30 @@ This is a simple bar chart. ### Multiple colors - + - ['pink', 'red', 'orange', 'yellow'][i % 4])} /> + ['pink', 'red', 'orange', 'yellow'][i % 4])} + /> ```jsx - + - ['pink', 'red', 'orange', 'yellow'][i % 4])} /> + ['pink', 'red', 'orange', 'yellow'][i % 4])} + /> diff --git a/demo/pages/stacked-bar.md b/demo/pages/stacked-bar.md index 02416fd..2fad3d4 100644 --- a/demo/pages/stacked-bar.md +++ b/demo/pages/stacked-bar.md @@ -10,15 +10,18 @@ import { StackedBar, } from '@carbonplan/charts' -export const data = Array(11).fill(null).map((_, i) => [i, 0, (i + 1) * 2, (i + 1) * 5, (i + 1) * 9]) -export const getRandomColor = () => ['pink', 'red', 'orange', 'yellow', 'green'][Math.floor(Math.random() * 5)] +export const data = Array(11) + .fill(null) + .map((_, i) => [i, 0, (i + 1) * 2, (i + 1) * 5, (i + 1) * 9]) +export const getRandomColor = () => + ['pink', 'red', 'orange', 'yellow', 'green'][Math.floor(Math.random() * 5)] # StackedBar This is a simple bar chart. - + @@ -32,7 +35,7 @@ This is a simple bar chart. ```jsx - + @@ -48,7 +51,7 @@ This is a simple bar chart. ### Horizontal bar - + @@ -60,7 +63,7 @@ This is a simple bar chart. ```jsx - + @@ -74,24 +77,30 @@ This is a simple bar chart. ### Floating bar - + - [x, ...yValues])} color={'purple'} /> + [x, ...yValues])} + color={'purple'} + /> ```jsx - + - [x, ...yValues])} color={'purple'} /> + [x, ...yValues])} + color={'purple'} + /> @@ -102,7 +111,7 @@ This is a simple bar chart. #### Custom stack colors - + @@ -114,7 +123,7 @@ This is a simple bar chart. ```jsx - + @@ -126,29 +135,37 @@ This is a simple bar chart. ``` #### Completely customized colors + - + - d.slice(2).map((_, i) => getRandomColor()))} /> + d.slice(2).map((_, i) => getRandomColor()))} + /> ```jsx - + - d.slice(2).map(() => getRandomColor()))} /> + d.slice(2).map(() => getRandomColor()))} + /> ``` - -export default ({ children }) =>
{children}
+export default ({ children }) => ( +
{children}
+)