Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
withPropsOnChange(['nodes', 'defs', 'fill'], ({ nodes, defs, fill }) => {
return {
defs: bindDefs(defs, nodes, fill, { targetKey: 'fill' }),
}
}),
]
withPropsOnChange(['nodes', 'defs', 'fill'], ({ nodes, defs, fill }) => {
return {
defs: bindDefs(defs, nodes, fill, { targetKey: 'fill' }),
}
}),
]
}
const willEnter = layout === 'vertical' ? barWillEnterVertical : barWillEnterHorizontal
const willLeave =
layout === 'vertical'
? barWillLeaveVertical(springConfig)
: barWillLeaveHorizontal(springConfig)
const shouldRenderLabel = ({ width, height }) => {
if (!enableLabel) return false
if (labelSkipWidth > 0 && width < labelSkipWidth) return false
if (labelSkipHeight > 0 && height < labelSkipHeight) return false
return true
}
const boundDefs = bindDefs(defs, result.bars, fill, {
dataKey: 'data',
targetKey: 'data.fill',
})
return (
{({ showTooltip, hideTooltip }) => {
const commonProps = {
borderRadius,
borderWidth,
({ computedData, defs, fill }) => ({
defs: bindDefs(defs, computedData, fill, { targetKey: 'fill' }),
})
),
withPropsOnChange(['nodes', 'defs', 'fill'], ({ nodes, defs, fill }) => {
return {
defs: bindDefs(defs, nodes, fill, { targetKey: 'fill' }),
}
}),
]
})
const slices = range(data.length).map(i => ({
index: i,
x: enhancedLayers[0].layer[i].x,
stack: sortBy(
enhancedLayers.map(layer => ({
id: layer.id,
color: layer.color,
...layer.layer[i],
})),
'y2'
),
}))
const boundDefs = bindDefs(defs, enhancedLayers, fill)
return (
{({ showTooltip, hideTooltip }) => (
enhancedLayers.map(layer => ({
id: layer.id,
color: layer.color,
...layer.layer[i],
})),
'y2'
),
}))
const motionProps = {
animate,
motionDamping,
motionStiffness,
}
const boundDefs = bindDefs(defs, enhancedLayers, fill)
return (
{({ showTooltip, hideTooltip }) => (
{({ centerX, centerY, radius, innerRadius, arcs, arcGenerator }) => {
const boundDefs = bindDefs(defs, arcs, fill, {
dataKey: 'data',
})
return (
{({ showTooltip, hideTooltip }) => (