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

fix: cancel the maxHeight type and format the code style #3

Merged
merged 1 commit into from
Nov 7, 2023
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
28 changes: 14 additions & 14 deletions __tests__/plots/static/alphanbet-interval-min-height-transposed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ export function alphabetIntervalMinHeightTransposed(): G2Spec {
{ genre: 'Shooter', sold: 350 },
{ genre: 'Other', sold: 150 },
],
encode: {
x: "genre",
y: "sold",
color: "genre"
},
axis: {
x: { animate: false },
y: { animate: false }
},
style: {
draggable: true,
droppable: true,
minHeight: 50
}
encode: {
x: 'genre',
y: 'sold',
color: 'genre',
},
axis: {
x: { animate: false },
y: { animate: false },
},
style: {
draggable: true,
droppable: true,
minHeight: 50,
},
};
}
28 changes: 14 additions & 14 deletions __tests__/plots/static/alphanbet-interval-min-height.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ export function alphabetIntervalMinHeight(): G2Spec {
{ genre: 'Shooter', sold: 350 },
{ genre: 'Other', sold: 150 },
],
encode: {
x: "genre",
y: "sold",
color: "genre"
},
axis: {
x: { animate: false },
y: { animate: false }
},
style: {
draggable: true,
droppable: true,
minHeight: 50
}
encode: {
x: 'genre',
y: 'sold',
color: 'genre',
},
axis: {
x: { animate: false },
y: { animate: false },
},
style: {
draggable: true,
droppable: true,
minHeight: 50,
},
};
}
4 changes: 2 additions & 2 deletions __tests__/plots/static/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export { alphabetIntervalMaxWidth } from './alphabet-interval-max-width';
export { alphabetIntervalMinWidth } from './alphabet-interval-min-width';
export { alphabetIntervalMaxWidthTransposed } from './alphabet-interval-max-width-transposed';
export { alphabetIntervalMinWidthTransposed } from './alphabet-interval-min-width-transposed';
export { alphabetIntervalMinHeight } from './alphanbet-interval-min-height'
export { alphabetIntervalMinHeightTransposed } from './alphanbet-interval-min-height-transposed'
export { alphabetIntervalMinHeight } from './alphanbet-interval-min-height';
export { alphabetIntervalMinHeightTransposed } from './alphanbet-interval-min-height-transposed';
export { alphabetIntervalTitle } from './alphabet-interval-title';
export { alphabetIntervalLabelOverflowHide } from './alphabet-interval-label-overflow-hide';
export { alphabetIntervalLabelContrastReverse } from './alphabet-interval-label-contrast-reverse';
Expand Down
6 changes: 4 additions & 2 deletions src/shape/interval/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export function rect(
? clamp(finalHeight, minWidth, maxWidth)
: clamp(finalHeight, minHeight, Infinity);
const clampX = tpShape ? finalX : finalX - (clampWidth - finalWidth) / 2;
const clampY = tpShape ? finalY - (clampHeight - finalHeight ) / 2 : finalY - (clampHeight - finalHeight);
const clampY = tpShape
? finalY - (clampHeight - finalHeight) / 2
: finalY - (clampHeight - finalHeight);

return select(document.createElement('rect', {}))
.style('x', clampX)
Expand Down Expand Up @@ -188,7 +190,7 @@ export const Color: SC<ColorOptions> = (options, context) => {
insetTop,
minWidth,
maxWidth,
minHeight
minHeight,
};

return (
Expand Down
5 changes: 0 additions & 5 deletions src/shape/interval/rect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ export type RectOptions = {
* Minimum height of each interval.
*/
minHeight?: number;

/**
* Minimum height of each interval.
*/
maxHeight?: number;
};

/**
Expand Down