Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
};
// TODO: check
const categories = {
x: Wrapper.getCategories(props, "x", childComponents),
y: Wrapper.getCategories(props, "y", childComponents)
};
const stringMap = {
x: createStringMap(props, "x", childComponents),
y: createStringMap(props, "y", childComponents)
};
const defaultDomainPadding = getDefaultDomainPadding(childComponents, horizontal);
const padding = Helpers.getPadding(props);
return {
axisComponents, categories, domain, range, horizontal, scale, stringMap,
style, origin, originSign, defaultDomainPadding, padding
};
}
const getMaxRadius = () => {
const minPadding = Math.min(...values(Helpers.getPadding(props)));
return Math.max(minPadding, 5); // eslint-disable-line no-magic-numbers
};
const maxRadius = maxBubbleSize || getMaxRadius();
getCalculatedValues(props, fallbackProps) {
const defaultStyles = props.theme && props.theme.axis ? props.theme.axis : fallbackProps.style;
const style = this.getStyles(props, defaultStyles);
const padding = Helpers.getPadding(props);
const orientation = props.orientation || (props.dependentAxis ? "left" : "bottom");
const isVertical = Axis.isVertical(props);
const labelPadding = this.getLabelPadding(props, style);
const stringTicks = Axis.stringTicks(props);
const scale = this.getScale(props);
const ticks = this.getTicks(props, scale);
const tickFormat = this.getTickFormat(props, scale, ticks);
const anchors = this.getAnchors(orientation, isVertical);
return {
style, padding, orientation, isVertical, labelPadding, stringTicks,
anchors, scale, ticks, tickFormat
};
},
getDefaultRadius(props) {
const { left, right, top, bottom } = Helpers.getPadding(props);
const { width, height } = props;
return Math.min(width - left - right, height - top - bottom) / 2;
}
const getCalculatedValues = (props) => {
const { theme, colorScale } = props;
const styleObject = theme && theme.pie && theme.pie.style ? theme.pie.style : {};
const style = Helpers.getStyles(props.style, styleObject, "auto", "100%");
const colors = Array.isArray(colorScale) ? colorScale : Style.getColorScale(colorScale);
const padding = Helpers.getPadding(props);
const defaultRadius = getRadius(props, padding);
const origin = getOrigin(props, padding);
const data = Data.getData(props);
const slices = getSlices(props, data);
return assign({}, props, { style, colors, padding, defaultRadius, data, slices, origin });
};
getChildProps(props, calculatedProps) {
const { categories, domain, scale, horizontal } = calculatedProps;
return {
height: props.height,
width: props.width,
padding: Helpers.getPadding(props),
standalone: false,
theme: props.theme,
categories,
domain,
scale,
horizontal
};
}
getChildProps(props, calculatedProps) {
const { categories, domain, scale, horizontal } = calculatedProps;
return {
height: props.height,
width: props.width,
padding: Helpers.getPadding(props),
standalone: false,
categories,
domain,
scale,
horizontal
};
}
};
const baseScale = {
x: Scale.getScaleFromProps(props, "x") || Wrapper.getScale(props, "x"),
y: Scale.getScaleFromProps(props, "y") || Wrapper.getScale(props, "y")
};
const scale = {
x: baseScale.x
.domain(domain.x)
.range(props.horizontal ? range.y : range.x),
y: baseScale.y
.domain(domain.y)
.range(props.horizontal ? range.x: range.y)
};
const origin = polar ? props.origin : Helpers.getPolarOrigin(props);
const padding = Helpers.getPadding(props);
return {
datasets,
categories,
range,
domain,
horizontal,
scale,
style,
colorScale,
color,
offset,
origin,
padding
};
}