Skip to content

Commit

Permalink
feat(marimekko): improve documentation about data props
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Nov 16, 2020
1 parent 146a04b commit 3178ce8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
12 changes: 10 additions & 2 deletions website/src/data/components/marimekko/mapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ export default settingsMapper(
defs: (value, values) => {
if (!values['showcase pattern usage']) return

return [
/*
[
patternDotsDef('dots', {
background: 'inherit',
color: 'rgba(255, 255, 255, 0.3)',
Expand All @@ -78,11 +79,15 @@ export default settingsMapper(
spacing: 10,
}),
]
*/

return
},
fill: (value, values) => {
if (!values['showcase pattern usage']) return

return [
/*
[
{ match: { id: 'ruby' }, id: 'dots' },
{ match: { id: 'c' }, id: 'dots' },
{ match: { id: 'go' }, id: 'dots' },
Expand All @@ -92,6 +97,9 @@ export default settingsMapper(
{ match: { id: 'elixir' }, id: 'lines' },
{ match: { id: 'javascript' }, id: 'lines' },
]
*/

return
},
},
{
Expand Down
22 changes: 4 additions & 18 deletions website/src/data/components/marimekko/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,11 @@ const props = [
group: 'Base',
help: 'Chart data, which should be immutable.',
description: `
Chart data, which must conform to this structure
if using the default \`id\` and \`value\` accessors:
\`\`\`
Array<{
id: string | number,
value: number
}>
\`\`\`
If using a different data structure, you must make sure
to adjust both \`id\` and \`value\`. Meaning you can provide
a completely different data structure as long as \`id\` and \`value\`
return the appropriate values.
Immutability of the data is important as re-computations
depends on it.
The data doesn't have to conform to a specific schema,
it's gonna depend on how you configure \`id\`, \`value\`
and \`dimensions\`.
`,
type: 'object[]',
type: 'RawDatum[]',
required: true,
},
{
Expand Down

0 comments on commit 3178ce8

Please sign in to comment.