Stat: Disable wide layout (#75556)

update stat panel to disable the wide layout
This commit is contained in:
Nathan Marrs
2023-10-03 11:10:51 -07:00
committed by GitHub
parent 0ba5dad316
commit 35b48066ca
3 changed files with 7 additions and 1 deletions
@@ -74,6 +74,11 @@ export interface Props extends Themeable2 {
* Used by BigValueTextMode.Auto text mode.
*/
count?: number;
/**
* Disable the wide layout for the BigValue
*/
disableWideLayout?: boolean;
}
export class BigValue extends PureComponent<Props> {
@@ -445,7 +445,7 @@ export class StackedWithNoChartLayout extends BigValueLayout {
export function buildLayout(props: Props): BigValueLayout {
const { width, height, sparkline } = props;
const useWideLayout = width / height > 2.5;
const useWideLayout = width / height > 2.5 && !props.disableWideLayout;
if (useWideLayout) {
if (height > 50 && !!sparkline && sparkline.y.values.length > 1) {
@@ -48,6 +48,7 @@ export class StatPanel extends PureComponent<PanelProps<Options>> {
theme={config.theme2}
onClick={openMenu}
className={targetClassName}
disableWideLayout={true}
/>
);
};