Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(shape): fix docs fror BarGroup, BarGroupHorizontal, and BarStack #1212

Merged
merged 1 commit into from
May 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/visx-shape/src/shapes/BarGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
AnyScaleBand,
AddSVGProps,
BaseBarGroupProps,
BarGroup,
BarGroup as BarGroupType,
GroupKey,
Accessor,
} from '../types';
Expand All @@ -32,7 +32,7 @@ export type BarGroupProps<
/** Total height of the y-axis. */
height: number;
/** Override render function which is passed the computed BarGroups. */
children?: (barGroups: BarGroup<Key>[]) => React.ReactNode;
children?: (barGroups: BarGroupType<Key>[]) => React.ReactNode;
};

/**
Expand Down Expand Up @@ -73,7 +73,7 @@ export type BarGroupProps<
*
* Example: [https://airbnb.io/visx/bargroup](https://airbnb.io/visx/bargroup)
*/
export default function BarGroupComponent<
export default function BarGroup<
Datum extends DatumObject,
Key extends GroupKey = GroupKey,
X0Scale extends AnyScaleBand = AnyScaleBand,
Expand All @@ -95,7 +95,7 @@ export default function BarGroupComponent<
}: AddSVGProps<BarGroupProps<Datum, Key, X0Scale, X1Scale>, SVGRectElement>) {
const barWidth = getBandwidth(x1Scale);

const barGroups: BarGroup<Key>[] = data.map((group, i) => ({
const barGroups: BarGroupType<Key>[] = data.map((group, i) => ({
index: i,
x0: x0Scale(x0(group))!,
bars: keys.map((key, j) => {
Expand Down
8 changes: 4 additions & 4 deletions packages/visx-shape/src/shapes/BarGroupHorizontal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
AnyScaleBand,
DatumObject,
AddSVGProps,
BarGroupHorizontal,
BarGroupHorizontal as BarGroupHorizontalType,
BaseBarGroupProps,
GroupKey,
Accessor,
Expand All @@ -34,10 +34,10 @@ export type BarGroupHorizontalProps<
/** Total width of the x-axis. */
width: number;
/** Override render function which is passed the computed Ba/rGroups. */
children?: (barGroups: BarGroupHorizontal<Key>[]) => React.ReactNode;
children?: (barGroups: BarGroupHorizontalType<Key>[]) => React.ReactNode;
};

export default function BarGroupHorizontalComponent<
export default function BarGroupHorizontal<
Datum extends DatumObject,
Key extends GroupKey = GroupKey,
Y0Scale extends AnyScaleBand = AnyScaleBand,
Expand All @@ -60,7 +60,7 @@ export default function BarGroupHorizontalComponent<
}: AddSVGProps<BarGroupHorizontalProps<Datum, Key, Y0Scale, Y1Scale>, SVGRectElement>) {
const barHeight = getBandwidth(y1Scale);

const barGroups: BarGroupHorizontal<Key>[] = data.map((group, i) => ({
const barGroups: BarGroupHorizontalType<Key>[] = data.map((group, i) => ({
index: i,
y0: y0Scale(y0(group)) || 0,
bars: keys.map((key, j) => {
Expand Down
6 changes: 3 additions & 3 deletions packages/visx-shape/src/shapes/BarStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ScaleInput } from '@visx/scale';
import {
PositionScale,
AddSVGProps,
BarStack,
BarStack as BarStackType,
BaseBarStackProps,
StackKey,
Accessor,
Expand All @@ -32,7 +32,7 @@ export type BarStackProps<
y1?: Accessor<SeriesPoint<Datum>, ScaleInput<YScale>>;
};

export default function BarStackComponent<
export default function BarStack<
Datum,
Key extends StackKey = StackKey,
XScale extends PositionScale = PositionScale,
Expand Down Expand Up @@ -64,7 +64,7 @@ export default function BarStackComponent<
const stacks = stack(data);
const barWidth = getBandwidth(xScale);

const barStacks: BarStack<Datum, Key>[] = stacks.map((barStack, i) => {
const barStacks: BarStackType<Datum, Key>[] = stacks.map((barStack, i) => {
const { key } = barStack;
return {
index: i,
Expand Down