/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ import * as React from 'react'; import styles from './ChartNode.css'; type Props = { color: string, height: number, isDimmed?: boolean, label: string, onClick: (event: SyntheticMouseEvent) => mixed, onDoubleClick?: (event: SyntheticMouseEvent) => mixed, onMouseEnter: (event: SyntheticMouseEvent) => mixed, onMouseLeave: (event: SyntheticMouseEvent) => mixed, placeLabelAboveNode?: boolean, textStyle?: Object, width: number, x: number, y: number, }; const minWidthToDisplay = 35; export default function ChartNode({ color, height, isDimmed = false, label, onClick, onMouseEnter, onMouseLeave, onDoubleClick, textStyle, width, x, y, }: Props): React.Node { return ( {width >= minWidthToDisplay && (
{label}
)}
); }