From dd18f8791d3bddc9deb42b9b350852ad6dd494bd Mon Sep 17 00:00:00 2001 From: Emile Netter Date: Fri, 21 Jul 2023 14:05:04 +0200 Subject: [PATCH] feat: add ts props --- packages/react-d3-plugin/lib/Axis/index.d.ts | 3 ++- packages/react-d3-plugin/lib/Axis/index.js | 3 +++ packages/react-d3-plugin/lib/Chart/index.js | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/react-d3-plugin/lib/Axis/index.d.ts b/packages/react-d3-plugin/lib/Axis/index.d.ts index ad5a3b8f4..ac385eb7d 100644 --- a/packages/react-d3-plugin/lib/Axis/index.d.ts +++ b/packages/react-d3-plugin/lib/Axis/index.d.ts @@ -8,7 +8,8 @@ import * as d3 from 'd3'; export declare interface AxisObject { type: d3.Axis; scale: d3.ScaleLinear | - d3.ScaleTime; + d3.ScaleTime | + d3.ScaleBand; range: d3.ScaleContinuousNumeric | d3.ScaleTime; data: Array; diff --git a/packages/react-d3-plugin/lib/Axis/index.js b/packages/react-d3-plugin/lib/Axis/index.js index 94c7b5221..a608ca6a3 100644 --- a/packages/react-d3-plugin/lib/Axis/index.js +++ b/packages/react-d3-plugin/lib/Axis/index.js @@ -128,6 +128,7 @@ Axis.propTypes = { scale: PropTypes.oneOf([ d3.scaleTime, d3.scaleLinear, + d3.scaleBand, ]), range: PropTypes.func, data: PropTypes.arrayOf(PropTypes.any), @@ -137,6 +138,8 @@ Axis.propTypes = { ticks: PropTypes.number, tickSize: PropTypes.number, grid: PropTypes.bool, + bandDomainKey: PropTypes.string, + stackKeys: PropTypes.arrayOf(PropTypes.string), }).isRequired, }; diff --git a/packages/react-d3-plugin/lib/Chart/index.js b/packages/react-d3-plugin/lib/Chart/index.js index ce22db0db..1e0644da7 100644 --- a/packages/react-d3-plugin/lib/Chart/index.js +++ b/packages/react-d3-plugin/lib/Chart/index.js @@ -211,6 +211,7 @@ Chart.propTypes = { scale: PropTypes.oneOf([ d3.scaleTime, d3.scaleLinear, + d3.scaleBand, ]), range: PropTypes.func, data: PropTypes.arrayOf(PropTypes.any), @@ -221,6 +222,8 @@ Chart.propTypes = { ticks: PropTypes.number, tickSize: PropTypes.number, grid: PropTypes.bool, + bandDomainKey: PropTypes.string, + stackKeys: PropTypes.arrayOf(PropTypes.string), })).isRequired, linearDomainMaxMargin: PropTypes.number, };