diff --git a/website/src/data/components/bar/props.js b/website/src/data/components/bar/props.js index 43d066991..10ce53a26 100644 --- a/website/src/data/components/bar/props.js +++ b/website/src/data/components/bar/props.js @@ -102,6 +102,37 @@ const props = [ ], }, }, + { + key: 'indexedScale', + type: 'object', + group: 'Base', + help: `indexed scale configuration.`, + defaultValue: defaults.indexedScale, + controlType: 'object', + controlOptions: { + props: [ + { + key: 'type', + help: `Scale type.`, + type: 'string', + controlType: 'choices', + controlOptions: { + disabled: true, + choices: ['indexed'].map(v => ({ + label: v, + value: v, + })), + }, + }, + { + key: 'round', + help: 'Toggle indexed scale (for bar width) rounding.', + type: 'boolean', + controlType: 'switch', + }, + ], + }, + }, { key: 'reverse', help: diff --git a/website/src/pages/bar/api.js b/website/src/pages/bar/api.js index f1c76a8ea..3e9c2daca 100644 --- a/website/src/pages/bar/api.js +++ b/website/src/pages/bar/api.js @@ -60,6 +60,7 @@ const BarApi = () => { reverse: false, valueScale: { type: 'linear' }, + indexedScale: { type: 'indexed', round: false }, axisTop: { enable: false, diff --git a/website/src/pages/bar/canvas.js b/website/src/pages/bar/canvas.js index 167cb06a9..19bb7fc1b 100644 --- a/website/src/pages/bar/canvas.js +++ b/website/src/pages/bar/canvas.js @@ -41,6 +41,7 @@ const initialProperties = { reverse: false, valueScale: { type: 'linear' }, + indexedScale: { type: 'indexed', round: false }, colors: { scheme: 'red_blue' }, colorBy: 'id', diff --git a/website/src/pages/bar/index.js b/website/src/pages/bar/index.js index 2fa5786fe..0e26da52f 100644 --- a/website/src/pages/bar/index.js +++ b/website/src/pages/bar/index.js @@ -39,6 +39,7 @@ const initialProperties = { reverse: false, valueScale: { type: 'linear' }, + indexedScale: { type: 'indexed', round: false }, colors: { scheme: 'nivo' }, colorBy: 'id',