Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
colorPropertyAccessorPropType,
inheritedColorPropType,
} from '@nivo/colors'
import BubbleNode from './BubbleNode'
import BubbleHtmlNode from './BubbleHtmlNode'
const commonPropTypes = {
// data
// `root` managed by `withHierarchy()` HOC
identity: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
// dimensions managed by `withDimensions()` HOC
// theme managed by `withTheme()` HOC
colors: ordinalColorsPropType.isRequired,
colorBy: colorPropertyAccessorPropType.isRequired,
leavesOnly: PropTypes.bool.isRequired,
padding: PropTypes.number.isRequired,
borderWidth: PropTypes.number.isRequired,
borderColor: inheritedColorPropType.isRequired,
enableLabel: PropTypes.bool.isRequired,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
labelFormat: PropTypes.string,
labelTextColor: inheritedColorPropType.isRequired,
labelSkipRadius: PropTypes.number.isRequired,
isInteractive: PropTypes.bool.isRequired,
onClick: PropTypes.func.isRequired,
isZoomable: PropTypes.bool.isRequired,
inheritedColorPropType,
} from '@nivo/colors'
import TreeMapNode from './TreeMapNode'
import TreeMapHtmlNode from './TreeMapHtmlNode'
const commonPropTypes = {
// data
// `root` managed by `withHierarchy()` HOC
identity: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
// dimensions managed by `withDimensions()` HOC
// styling
// theme managed by `withTheme()` HOC
colors: ordinalColorsPropType.isRequired,
colorBy: colorPropertyAccessorPropType.isRequired,
leavesOnly: PropTypes.bool.isRequired,
tile: treeMapTilePropType.isRequired,
innerPadding: PropTypes.number.isRequired,
outerPadding: PropTypes.number.isRequired,
enableLabel: PropTypes.bool.isRequired,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
labelFormat: PropTypes.string,
labelSkipSize: PropTypes.number.isRequired,
labelTextColor: inheritedColorPropType.isRequired,
orientLabel: PropTypes.bool.isRequired,
borderWidth: PropTypes.number.isRequired,
borderColor: inheritedColorPropType.isRequired,
barComponent: PropTypes.func.isRequired,
enableLabel: PropTypes.bool.isRequired,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
labelFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
getLabel: PropTypes.func.isRequired, // computed
labelSkipWidth: PropTypes.number.isRequired,
labelSkipHeight: PropTypes.number.isRequired,
labelTextColor: inheritedColorPropType.isRequired,
getLabelTextColor: PropTypes.func.isRequired, // computed
labelLinkColor: inheritedColorPropType.isRequired,
getLabelLinkColor: PropTypes.func.isRequired, // computed
colors: ordinalColorsPropType.isRequired,
colorBy: colorPropertyAccessorPropType.isRequired,
borderRadius: PropTypes.number.isRequired,
getColor: PropTypes.func.isRequired, // computed
...defsPropTypes,
borderWidth: PropTypes.number.isRequired,
borderColor: inheritedColorPropType.isRequired,
getBorderColor: PropTypes.func.isRequired,
isInteractive: PropTypes.bool,
onClick: PropTypes.func.isRequired,
onMouseEnter: PropTypes.func.isRequired,
onMouseLeave: PropTypes.func.isRequired,
tooltipLabel: PropTypes.func,
getTooltipLabel: PropTypes.func.isRequired,
tooltipFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
tooltip: PropTypes.func,
layout: PropTypes.oneOf(['horizontal', 'vertical']).isRequired,
gap: PropTypes.number.isRequired,
forceStrength: PropTypes.number.isRequired,
simulationIterations: PropTypes.number.isRequired,
layers: PropTypes.arrayOf(
PropTypes.oneOfType([
PropTypes.oneOf(['grid', 'axes', 'nodes', 'mesh', 'annotations']),
PropTypes.func,
])
).isRequired,
renderNode: PropTypes.func.isRequired,
colors: ordinalColorsPropType.isRequired,
colorBy: colorPropertyAccessorPropType.isRequired,
borderWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
borderColor: inheritedColorPropType.isRequired,
enableGridX: PropTypes.bool.isRequired,
gridXValues: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
enableGridY: PropTypes.bool.isRequired,
gridYValues: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
axisTop: axisPropType,
axisRight: axisPropType,
axisBottom: axisPropType,
axisLeft: axisPropType,
annotations: PropTypes.arrayOf(annotationSpecPropType).isRequired,
isInteractive: PropTypes.bool.isRequired,