Skip to content

Commit

Permalink
feat(website): add theme property documentation to all components
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Jun 28, 2020
1 parent 975503a commit f967380
Show file tree
Hide file tree
Showing 21 changed files with 83 additions and 30 deletions.
2 changes: 2 additions & 0 deletions website/src/data/components/area-bump/props.js
Expand Up @@ -8,6 +8,7 @@
*/
import { AreaBumpDefaultProps as defaults } from '@nivo/bump'
import {
themeProperty,
axesProperties,
defsProperties,
groupProperties,
Expand Down Expand Up @@ -137,6 +138,7 @@ const props = [
step: 0.05,
},
},
themeProperty,
{
key: 'colors',
group: 'Style',
Expand Down
2 changes: 2 additions & 0 deletions website/src/data/components/bar/props.js
Expand Up @@ -8,6 +8,7 @@
*/
import { BarDefaultProps as defaults } from '@nivo/bar'
import {
themeProperty,
axesProperties,
motionProperties,
defsProperties,
Expand Down Expand Up @@ -214,6 +215,7 @@ const props = [
controlType: 'margin',
group: 'Base',
},
themeProperty,
{
key: 'colors',
help: 'Defines color range.',
Expand Down
8 changes: 7 additions & 1 deletion website/src/data/components/bubble/props.js
Expand Up @@ -7,7 +7,12 @@
* file that was distributed with this source code.
*/
import { BubbleDefaultProps as defaults } from '@nivo/circle-packing'
import { motionProperties, defsProperties, groupProperties } from '../../../lib/componentProperties'
import {
themeProperty,
motionProperties,
defsProperties,
groupProperties,
} from '../../../lib/componentProperties'

const props = [
{
Expand Down Expand Up @@ -133,6 +138,7 @@ const props = [
max: 32,
},
},
themeProperty,
{
key: 'colors',
help: 'Defines how to compute node color.',
Expand Down
3 changes: 2 additions & 1 deletion website/src/data/components/bullet/props.js
Expand Up @@ -7,7 +7,7 @@
* file that was distributed with this source code.
*/
import { BulletDefaultProps as defaults } from '@nivo/bullet'
import { motionProperties, groupProperties } from '../../../lib/componentProperties'
import { themeProperty, motionProperties, groupProperties } from '../../../lib/componentProperties'

const props = [
{
Expand Down Expand Up @@ -146,6 +146,7 @@ const props = [
step: 0.05,
},
},
themeProperty,
{
key: 'rangeComponent',
flavors: ['svg'],
Expand Down
8 changes: 7 additions & 1 deletion website/src/data/components/bump/props.js
Expand Up @@ -7,7 +7,12 @@
* file that was distributed with this source code.
*/
import { BumpDefaultProps as defaults } from '@nivo/bump'
import { motionProperties, axesProperties, groupProperties } from '../../../lib/componentProperties'
import {
themeProperty,
motionProperties,
axesProperties,
groupProperties,
} from '../../../lib/componentProperties'

const props = [
{
Expand Down Expand Up @@ -134,6 +139,7 @@ const props = [
step: 0.05,
},
},
themeProperty,
{
key: 'colors',
help: 'Defines color range.',
Expand Down
8 changes: 4 additions & 4 deletions website/src/data/components/calendar/props.js
Expand Up @@ -8,7 +8,7 @@
*/
import { boxAlignments } from '@nivo/core'
import { CalendarDefaultProps as defaults } from '@nivo/calendar'
import { groupProperties } from '../../../lib/componentProperties'
import { themeProperty, groupProperties } from '../../../lib/componentProperties'

const props = [
{
Expand Down Expand Up @@ -161,10 +161,10 @@ const props = [
max: 600,
},
},
themeProperty,
{
key: 'colors',
help: 'Chart colors.',
group: 'Base',
group: 'Style',
help: 'Cell colors.',
description: `
An array of colors to be used in conjunction with
Expand All @@ -183,7 +183,7 @@ const props = [
required: false,
defaultValue: defaults.emptyColor,
controlType: 'colorPicker',
group: 'Base',
group: 'Style',
},
{
key: 'pixelRatio',
Expand Down
3 changes: 2 additions & 1 deletion website/src/data/components/chord/props.js
Expand Up @@ -8,6 +8,7 @@
*/
import { ChordDefaultProps as defaults } from '@nivo/chord'
import {
themeProperty,
motionProperties,
groupProperties,
getLegendsProps,
Expand Down Expand Up @@ -166,6 +167,7 @@ const props = [
step: 0.01,
},
},
themeProperty,
{
key: 'colors',
help: 'Defines how to compute arc/ribbon color.',
Expand Down Expand Up @@ -284,7 +286,6 @@ const props = [
},
{
key: 'labelTextColor',
help: 'Labels color.',
description: `
How to compute label text color,
[see dedicated documentation](self:/guides/colors).
Expand Down
2 changes: 1 addition & 1 deletion website/src/data/components/choropleth/props.js
Expand Up @@ -7,7 +7,7 @@
* file that was distributed with this source code.
*/
import { GeoMapDefaultProps, ChoroplethDefaultProps } from '@nivo/geo'
import { getLegendsProps, groupProperties } from '../../../lib/componentProperties'
import { themeProperty, getLegendsProps, groupProperties } from '../../../lib/componentProperties'
import { props as geoProps } from '../geo/props'

const props = [
Expand Down
3 changes: 2 additions & 1 deletion website/src/data/components/funnel/props.js
Expand Up @@ -7,7 +7,7 @@
* file that was distributed with this source code.
*/
import { FunnelDefaultProps as defaults } from '@nivo/funnel'
import { groupProperties, motionProperties } from '../../../lib/componentProperties'
import { themeProperty, groupProperties, motionProperties } from '../../../lib/componentProperties'

const props = [
{
Expand Down Expand Up @@ -103,6 +103,7 @@ const props = [
controlType: 'valueFormat',
group: 'Base',
},
themeProperty,
{
key: 'colors',
help: 'Defines how to compute parts color.',
Expand Down
3 changes: 2 additions & 1 deletion website/src/data/components/geo/props.js
Expand Up @@ -7,7 +7,7 @@
* file that was distributed with this source code.
*/
import { GeoMapDefaultProps } from '@nivo/geo'
import { defsProperties } from '../../../lib/componentProperties'
import { themeProperty, defsProperties } from '../../../lib/componentProperties'

export const props = [
{
Expand Down Expand Up @@ -145,6 +145,7 @@ export const props = [
],
},
},
themeProperty,
{
key: 'borderWidth',
help: 'Control border width.',
Expand Down
8 changes: 7 additions & 1 deletion website/src/data/components/heatmap/props.js
Expand Up @@ -7,7 +7,12 @@
* file that was distributed with this source code.
*/
import { HeatMapDefaultProps as defaults } from '@nivo/heatmap'
import { axesProperties, motionProperties, groupProperties } from '../../../lib/componentProperties'
import {
themeProperty,
axesProperties,
motionProperties,
groupProperties,
} from '../../../lib/componentProperties'

const props = [
{
Expand Down Expand Up @@ -181,6 +186,7 @@ const props = [
controlType: 'margin',
group: 'Base',
},
themeProperty,
{
key: 'cellShape',
help: `Cell shape/component.`,
Expand Down
3 changes: 2 additions & 1 deletion website/src/data/components/line/props.js
Expand Up @@ -9,6 +9,7 @@
import { lineCurvePropKeys, DotsItemDefaultProps as dotDefaults } from '@nivo/core'
import { LineDefaultProps as defaults } from '@nivo/line'
import {
themeProperty,
axesProperties,
motionProperties,
getLegendsProps,
Expand Down Expand Up @@ -209,6 +210,7 @@ const props = [
})),
},
},
themeProperty,
{
key: 'colors',
help: 'Defines color range.',
Expand Down Expand Up @@ -362,7 +364,6 @@ const props = [
required: false,
defaultValue: defaults.enablePointLabel,
controlType: 'switch',
group: 'Points',
},
{
key: 'pointLabel',
Expand Down
3 changes: 2 additions & 1 deletion website/src/data/components/parallel-coordinates/props.js
Expand Up @@ -8,7 +8,7 @@
*/
import { lineCurvePropKeys } from '@nivo/core'
import { commonDefaultProps as defaults } from '@nivo/parallel-coordinates'
import { motionProperties, groupProperties } from '../../../lib/componentProperties'
import { themeProperty, motionProperties, groupProperties } from '../../../lib/componentProperties'

const props = [
{
Expand Down Expand Up @@ -218,6 +218,7 @@ const props = [
controlType: 'margin',
group: 'Base',
},
themeProperty,
{
key: 'colors',
help: 'Defines color range.',
Expand Down
3 changes: 2 additions & 1 deletion website/src/data/components/pie/props.js
Expand Up @@ -7,7 +7,7 @@
* file that was distributed with this source code.
*/
import { PieDefaultProps as defaults } from '@nivo/pie'
import { defsProperties, groupProperties } from '../../../lib/componentProperties'
import { themeProperty, defsProperties, groupProperties } from '../../../lib/componentProperties'

const props = [
{
Expand Down Expand Up @@ -178,6 +178,7 @@ const props = [
controlType: 'margin',
group: 'Base',
},
themeProperty,
{
key: 'colors',
help: 'Defines color range.',
Expand Down
3 changes: 2 additions & 1 deletion website/src/data/components/radar/props.js
Expand Up @@ -8,7 +8,7 @@
*/
import { closedCurvePropKeys, DotsItemDefaultProps as dotDefaults } from '@nivo/core'
import { RadarDefaultProps as defaults, RadarDots } from '@nivo/radar'
import { motionProperties, groupProperties } from '../../../lib/componentProperties'
import { themeProperty, motionProperties, groupProperties } from '../../../lib/componentProperties'

const dotsDefaults = RadarDots.defaultProps

Expand Down Expand Up @@ -149,6 +149,7 @@ const props = [
controlType: 'margin',
group: 'Base',
},
themeProperty,
{
key: 'colors',
help: 'Defines how to compute slice color.',
Expand Down
21 changes: 11 additions & 10 deletions website/src/data/components/sankey/props.js
Expand Up @@ -7,7 +7,7 @@
* file that was distributed with this source code.
*/
import { SankeyDefaultProps as defaults, sankeyAlignmentPropKeys } from '@nivo/sankey'
import { motionProperties, groupProperties } from '../../../lib/componentProperties'
import { themeProperty, motionProperties, groupProperties } from '../../../lib/componentProperties'

const props = [
{
Expand Down Expand Up @@ -97,15 +97,6 @@ const props = [
})),
},
},
{
key: 'colors',
help: 'Defines how to compute nodes color.',
type: 'string | Function | string[]',
required: false,
defaultValue: defaults.colors,
controlType: 'ordinalColors',
group: 'Base',
},
{
key: 'width',
enableControlForFlavors: ['api'],
Expand Down Expand Up @@ -152,6 +143,16 @@ const props = [
controlType: 'margin',
group: 'Base',
},
themeProperty,
{
key: 'colors',
help: 'Defines how to compute nodes color.',
type: 'string | Function | string[]',
required: false,
defaultValue: defaults.colors,
controlType: 'ordinalColors',
group: 'Style',
},
{
key: 'nodeThickness',
help: 'Node thickness.',
Expand Down
2 changes: 2 additions & 0 deletions website/src/data/components/scatterplot/props.js
Expand Up @@ -8,6 +8,7 @@
*/
import { ScatterPlotDefaultProps as defaults } from '@nivo/scatterplot'
import {
themeProperty,
axesProperties,
motionProperties,
getLegendsProps,
Expand Down Expand Up @@ -268,6 +269,7 @@ const props = [
controlType: 'margin',
group: 'Base',
},
themeProperty,
{
key: 'colors',
group: 'Style',
Expand Down
2 changes: 2 additions & 0 deletions website/src/data/components/stream/props.js
Expand Up @@ -9,6 +9,7 @@
import { areaCurvePropKeys, stackOrderPropKeys, stackOffsetPropKeys } from '@nivo/core'
import { StreamDefaultProps as defaults } from '@nivo/stream'
import {
themeProperty,
axesProperties,
motionProperties,
defsProperties,
Expand Down Expand Up @@ -109,6 +110,7 @@ const props = [
controlType: 'margin',
group: 'Base',
},
themeProperty,
{
key: 'colors',
help: 'Defines how to compute line color.',
Expand Down
9 changes: 7 additions & 2 deletions website/src/data/components/swarmplot/props.js
Expand Up @@ -7,7 +7,12 @@
* file that was distributed with this source code.
*/
import { SwarmPlotDefaultProps } from '@nivo/swarmplot'
import { motionProperties, axesProperties, groupProperties } from '../../../lib/componentProperties'
import {
themeProperty,
motionProperties,
axesProperties,
groupProperties,
} from '../../../lib/componentProperties'

const defaults = SwarmPlotDefaultProps

Expand Down Expand Up @@ -245,6 +250,7 @@ const props = [
max: 100,
},
},
themeProperty,
{
key: 'colors',
help: 'Defines how to compute node color.',
Expand Down Expand Up @@ -302,7 +308,6 @@ const props = [
required: false,
defaultValue: defaults.colorBy,
controlType: 'choices',
group: 'Style',
controlOptions: {
choices: ['group', 'id'].map(key => ({
label: key,
Expand Down

0 comments on commit f967380

Please sign in to comment.