Skip to content

Commit bc752d5

Browse files
committed
Add controls to website to preview fixedShape
1 parent 3595dc1 commit bc752d5

File tree

2 files changed

+47
-4
lines changed

2 files changed

+47
-4
lines changed

website/src/data/components/funnel/props.ts

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ const props: ChartProperty[] = [
2323
value: number
2424
}[]
2525
\`\`\`
26-
26+
2727
Datum is a generic and can be overriden, this can be useful
2828
to attach a color to each datum for example, and then use
29-
this for the \`colors\` property.
29+
this for the \`colors\` property.
3030
`,
3131
},
3232
...chartDimensions(allFlavors),
@@ -92,6 +92,46 @@ const props: ChartProperty[] = [
9292
step: 0.01,
9393
},
9494
},
95+
{
96+
key: 'fixedShape',
97+
group: 'Base',
98+
help: `Use a fixed shape. If true, spacing and shapeBlending are ignored.`,
99+
type: 'boolean',
100+
required: false,
101+
defaultValue: defaults.fixedShape,
102+
flavors: ['svg'],
103+
control: { type: 'switch' },
104+
},
105+
{
106+
key: 'neckHeightRatio',
107+
group: 'Base',
108+
help: 'Set the neck height ratio for a fixedShape funnel.',
109+
type: 'number',
110+
required: false,
111+
defaultValue: defaults.neckHeightRatio,
112+
flavors: ['svg'],
113+
control: {
114+
type: 'range',
115+
min: 0,
116+
max: 1,
117+
step: 0.01,
118+
},
119+
},
120+
{
121+
key: 'neckWidthRatio',
122+
group: 'Base',
123+
help: 'Set the neck width ratio for a fixedShape funnel.',
124+
type: 'number',
125+
required: false,
126+
defaultValue: defaults.neckWidthRatio,
127+
flavors: ['svg'],
128+
control: {
129+
type: 'range',
130+
min: 0,
131+
max: 1,
132+
step: 0.01,
133+
},
134+
},
95135
{
96136
key: 'valueFormat',
97137
group: 'Base',
@@ -287,7 +327,7 @@ const props: ChartProperty[] = [
287327
description: `
288328
You can also use this to insert extra layers
289329
to the chart, the extra layer must be a function.
290-
330+
291331
The layer function which will receive the chart's
292332
context & computed data and must return a valid SVG element.
293333
`,
@@ -305,7 +345,7 @@ const props: ChartProperty[] = [
305345
group: 'Interactivity',
306346
help: `
307347
Expand part size by this amount of pixels on each side
308-
when it's active
348+
when it's active
309349
`,
310350
required: false,
311351
defaultValue: defaults.currentPartSizeExtension,

website/src/pages/funnel/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ const initialProperties: UnmappedFunnelProps = {
2727
},
2828

2929
direction: svgDefaultProps.direction,
30+
fixedShape: svgDefaultProps.fixedShape,
31+
neckHeightRatio: svgDefaultProps.neckHeightRatio,
32+
neckWidthRatio: svgDefaultProps.neckWidthRatio,
3033
interpolation: svgDefaultProps.interpolation,
3134
shapeBlending: svgDefaultProps.shapeBlending,
3235
spacing: svgDefaultProps.spacing,

0 commit comments

Comments
 (0)