Skip to content

Commit

Permalink
add comments + update api
Browse files Browse the repository at this point in the history
  • Loading branch information
krkshitij committed Jan 27, 2025
1 parent 340db7a commit bf8d0ba
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
21 changes: 12 additions & 9 deletions packages/charts/react-charting/etc/react-charting.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1212,18 +1212,21 @@ export interface IRefArrayData {
refElement?: SVGGElement;
}

// @public (undocumented)
export interface IResponsiveContainerProps {
// @public
export interface IResponsiveChildProps {
// (undocumented)
children: React_2.ReactElement<{
width?: number;
height?: number;
}>;
height?: number;
// (undocumented)
height?: number | string;
shouldResize?: number;
// (undocumented)
width?: number;
}

// @public
export interface IResponsiveContainerProps {
children: React_2.ReactElement<IResponsiveChildProps>;
height?: number | string;
onResize?: (width: number, height: number) => void;
// (undocumented)
width?: number | string;
}

Expand Down Expand Up @@ -1652,7 +1655,7 @@ export enum NodesComposition {
// @public
export const PieChart: React_2.FunctionComponent<IPieChartProps>;

// @public (undocumented)
// @public
export const ResponsiveContainer: React_2.FC<IResponsiveContainerProps>;

// @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import { getStyles } from './ResponsiveContainer.styles';

const getClassNames = classNamesFunction<{}, IResponsiveContainerStyles>();

/**
* Responsive Container component
* {@docCategory ResponsiveContainer}
*/
export const ResponsiveContainer: React.FC<IResponsiveContainerProps> = props => {
const containerRef = React.useRef<HTMLDivElement>(null);
const onResizeRef = React.useRef<IResponsiveContainerProps['onResize']>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
import * as React from 'react';
import { IStyle } from '@fluentui/react/lib/Styling';

/**
* Responsive Child props
* {@docCategory ResponsiveContainer}
*/
export interface IResponsiveChildProps {
width?: number;
height?: number;
shouldResize?: number;
}

/**
* Responsive Container props
* {@docCategory ResponsiveContainer}
*/
export interface IResponsiveContainerProps {
/**
*
* Width of the container
*/
width?: number | string;

/**
*
* Height of the container
*/
height?: number | string;

/**
*
* Callback providing the updated chart width and height values when the container is resized
*/
onResize?: (width: number, height: number) => void;

/**
*
* Child component to be rendered within the container
*/
children: React.ReactElement<IResponsiveChildProps>;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/react-charting/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export type { IGaugeChartProps, IGaugeChartSegment, IGaugeChartStyleProps, IGaug
export { GaugeChart, GaugeChartVariant, GaugeValueFormat } from './GaugeChart';
export type { DeclarativeChartProps, Schema, IDeclarativeChart, IImageExportOptions } from './DeclarativeChart';
export { DeclarativeChart } from './DeclarativeChart';
export type { IResponsiveContainerProps } from './ResponsiveContainer';
export type { IResponsiveContainerProps, IResponsiveChildProps } from './ResponsiveContainer';
export { ResponsiveContainer } from './ResponsiveContainer';

import './version';

0 comments on commit bf8d0ba

Please sign in to comment.