Skip to content

Commit

Permalink
feat(pie): document layers property
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Nov 4, 2020
1 parent a8f6468 commit b5ed2d4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 53 deletions.
53 changes: 0 additions & 53 deletions packages/pie/src/PieLayout.test.js

This file was deleted.

25 changes: 25 additions & 0 deletions website/src/data/components/pie/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,31 @@ const props = [
controlType: 'inheritedColor',
group: 'Slices labels',
},
{
key: 'layers',
group: 'Customization',
help: 'Defines the order of layers and add custom layers.',
description: `
You can also use this to insert extra layers
to the chart, the extra layer must be a function.
The layer function which will receive the chart's
context & computed data and must return a valid SVG element
for the \`Pie\` component.
When using the canvas implementation, the function
will receive the canvas 2d context as first argument
and the chart's context and computed data as second.
Please make sure to use \`context.save()\` and
\`context.restore()\` if you make some global
modifications to the 2d context inside this function
to avoid side effects.
`,
required: false,
type: 'Array<string | Function>',
defaultValue: defaults.layers,
},
{
key: 'isInteractive',
flavors: ['svg', 'canvas'],
Expand Down

0 comments on commit b5ed2d4

Please sign in to comment.