Skip to content

Commit

Permalink
types: add some types to generateCategoricalChart
Browse files Browse the repository at this point in the history
  • Loading branch information
Coltin Kifer committed May 16, 2024
1 parent 85b29df commit 002217b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/chart/generateCategoricalChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ export const generateCategoricalChart = ({
const { numericAxisName, cateAxisName } = getAxisNameByLayout(layout);
const hasBar = hasGraphicalBarItem(graphicalItems);

const formattedItems = [] as any[];
const formattedItems: any[] = [];

graphicalItems.forEach((item: ReactElement, index: number) => {
const displayedData = getDisplayedData(props.data, { graphicalItems: [item], dataStartIndex, dataEndIndex });
Expand Down Expand Up @@ -968,7 +968,17 @@ export const generateCategoricalChart = ({
* @return {Object} state New state to set
*/
const updateStateOfAxisMapsOffsetAndStackGroups = (
{ props, dataStartIndex, dataEndIndex, updateId }: any,
{
props,
dataStartIndex,
dataEndIndex,
updateId,
}: {
props: CategoricalChartProps;
dataStartIndex?: number;
dataEndIndex?: number;
updateId: number;
},
prevState?: CategoricalChartState,
): any => {
if (!validateWidthHeight({ props })) {
Expand Down Expand Up @@ -1047,7 +1057,7 @@ export const generateCategoricalChart = ({
stackOffset: 'none',
barCategoryGap: '10%',
barGap: 4,
margin: { top: 5, right: 5, bottom: 5, left: 5 } as Margin,
margin: { top: 5, right: 5, bottom: 5, left: 5 },
reverseStackOrder: false,
syncMethod: 'index',
...defaultProps,
Expand Down

0 comments on commit 002217b

Please sign in to comment.