Skip to content

Commit

Permalink
feat(bump): improve website documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Dec 29, 2021
1 parent ba2fca2 commit 235d85e
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions website/src/data/components/bump/props.ts
Expand Up @@ -15,24 +15,30 @@ const props: ChartProperty[] = [
{
key: 'data',
group: 'Base',
type: 'BumpSerie<Datum, ExtraProps>[]',
help: 'Chart data.',
flavors: allFlavors,
description: `
Chart data, which must conform to this structure:
\`\`\`
Array<{
{
id: string
data: Array<{
data: {
x: number | string
y: number | string
}>
}>
y: number | null
}[]
}[]
\`\`\`
This component assumes that every serie contains all
x values sorted the same way they should appear on the chart.
As this component is a TypeScript generic, it is possible to customize
the datum using the \`Datum\` arg, and it's also possible to add
some extra properties to the series by passing \`ExtraProps\`.
`,
required: true,
type: 'object[]',
},
...chartDimensions(allFlavors),
{
Expand Down Expand Up @@ -163,9 +169,9 @@ const props: ChartProperty[] = [
},
{
key: 'startLabel',
help: 'Start label.',
help: 'Start label, use a boolean to enable/disable, or a function to customize its text.',
group: 'Labels',
type: 'false | string | (serie: Serie) => string',
type: 'boolean | (serie: BumpSerie) => string',
defaultValue: defaults.startLabel,
flavors: ['svg'],
required: false,
Expand All @@ -186,8 +192,8 @@ const props: ChartProperty[] = [
},
{
key: 'startLabelTextColor',
help: 'Method to compute start label text color.',
type: 'string | object | Function',
help: 'Method to compute start label text color, or a function to customize its text.',
type: 'InheritedColorConfig<BumpComputedSerie>',
required: false,
flavors: ['svg'],
defaultValue: defaults.startLabelTextColor,
Expand All @@ -196,9 +202,9 @@ const props: ChartProperty[] = [
},
{
key: 'endLabel',
help: 'End label.',
help: 'End label, use a boolean to enable/disable.',
group: 'Labels',
type: 'false | string | (serie: Serie) => string',
type: 'boolean | (serie: BumpSerie) => string',
defaultValue: defaults.endLabel,
flavors: ['svg'],
required: false,
Expand All @@ -220,7 +226,7 @@ const props: ChartProperty[] = [
{
key: 'endLabelTextColor',
help: 'Method to compute end label text color.',
type: 'string | object | Function',
type: 'InheritedColorConfig<BumpComputedSerie>',
required: false,
defaultValue: defaults.endLabelTextColor,
flavors: ['svg'],
Expand Down Expand Up @@ -280,6 +286,7 @@ const props: ChartProperty[] = [
control: {
type: 'inheritedColor',
inheritableProperties: ['serie.color'],
defaultFrom: 'serie.color',
},
},
{
Expand Down Expand Up @@ -323,6 +330,7 @@ const props: ChartProperty[] = [
control: {
type: 'inheritedColor',
inheritableProperties: ['color', 'serie.color'],
defaultFrom: 'color',
},
},
...chartGrid({
Expand All @@ -338,31 +346,31 @@ const props: ChartProperty[] = [
{
key: 'onMouseEnter',
group: 'Interactivity',
type: '(serie, event) => void',
type: '(serie: BumpComputedSerie, event: MouseEvent) => void',
help: 'onMouseEnter handler.',
required: false,
flavors: ['svg'],
},
{
key: 'onMouseMove',
group: 'Interactivity',
type: '(serie, event) => void',
type: '(serie: BumpComputedSerie, event: MouseEvent) => void',
help: 'onMouseMove handler.',
required: false,
flavors: ['svg'],
},
{
key: 'onMouseLeave',
group: 'Interactivity',
type: '(serie, event) => void',
type: '(serie: BumpComputedSerie, event: MouseEvent) => void',
help: 'onMouseLeave handler.',
required: false,
flavors: ['svg'],
},
{
key: 'onClick',
group: 'Interactivity',
type: '(serie, event) => void',
type: '(serie: BumpComputedSerie, event: MouseEvent) => void',
help: 'onClick handler.',
required: false,
flavors: ['svg'],
Expand Down

0 comments on commit 235d85e

Please sign in to comment.