Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
y: props.polar ? Helpers.getPolarRange(props, "y") : Helpers.getRange(props, "y")
};
const baseScale = {
x: Scale.getScaleFromProps(props, "x") ||
axisComponents.x && axisComponents.x.type.getScale(axisComponents.x.props) ||
Scale.getDefaultScale(),
y: Scale.getScaleFromProps(props, "y") ||
axisComponents.y && axisComponents.y.type.getScale(axisComponents.y.props) ||
Scale.getDefaultScale()
};
const scale = {
x: baseScale.x.domain(domain.x).range(range.x),
y: baseScale.y.domain(domain.y).range(range.y)
};
const origin = props.polar ? Helpers.getPolarOrigin(props) : Axis.getOrigin(domain);
const originSign = {
x: Axis.getOriginSign(origin.x, domain.x),
y: Axis.getOriginSign(origin.y, domain.y)
};
// 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)
};
x: Helpers.getRange(props, "x"),
y: Helpers.getRange(props, "y")
};
const domain = {
x: Domain.getDomain(props, "x"),
y: Domain.getDomain(props, "y")
};
const scale = {
x: Scale.getBaseScale(props, "x")
.domain(domain.x)
.range(props.horizontal ? range.y : range.x),
y: Scale.getBaseScale(props, "y")
.domain(domain.y)
.range(props.horizontal ? range.x: range.y)
};
const origin = props.polar ? props.origin || Helpers.getPolarOrigin(props) : undefined;
const z = props.bubbleProperty || "z";
return { domain, data, scale, style, origin, z };
};
x: Helpers.getRange(props, "x"),
y: Helpers.getRange(props, "y")
};
const domain = {
x: Domain.getDomainWithZero(props, "x"),
y: Domain.getDomainWithZero(props, "y")
};
const scale = {
x: Scale.getBaseScale(props, "x")
.domain(domain.x)
.range(props.horizontal ? range.y : range.x),
y: Scale.getBaseScale(props, "y")
.domain(domain.y)
.range(props.horizontal ? range.x: range.y)
};
const origin = polar ? props.origin || Helpers.getPolarOrigin(props) : undefined;
return { style, data, scale, domain, origin };
};
renderGroup(props, children) {
const { groupComponent } = props;
const groupComponentProps = groupComponent.props || {};
const origin = Helpers.getPolarOrigin(props);
const transform = groupComponentProps.transform || `translate(${origin.x}, ${origin.y})`;
return React.cloneElement(groupComponent, { transform }, children);
}
renderGroup(props, children) {
const { groupComponent } = props;
const groupComponentProps = groupComponent.props || {};
const origin = Helpers.getPolarOrigin(props);
const transform = groupComponentProps.transform || `translate(${origin.x}, ${origin.y})`;
return React.cloneElement(groupComponent, { transform }, children);
}
x: Helpers.getRange(props, "x"),
y: Helpers.getRange(props, "y")
};
const domain = {
x: Domain.getDomainWithZero(props, "x"),
y: Domain.getDomainWithZero(props, "y")
};
const scale = {
x: Scale.getBaseScale(props, "x")
.domain(domain.x)
.range(props.horizontal ? range.y : range.x),
y: Scale.getBaseScale(props, "y")
.domain(domain.y)
.range(props.horizontal ? range.x: range.y)
};
const origin = polar ? props.origin || Helpers.getPolarOrigin(props) : undefined;
const data = getDataWithBaseline(props, scale);
return { style, data, scale, domain, origin };
};
};
const baseScale = {
x: Scale.getScaleFromProps(modifiedProps, "x") || Scale.getDefaultScale(),
y: Scale.getScaleFromProps(modifiedProps, "y") || Scale.getDefaultScale()
};
const xScale = baseScale.x.domain(domain.x).range(range.x);
const yScale = baseScale.y.domain(domain.y).range(range.y);
const scale = {
x: horizontal ? yScale : xScale,
y: horizontal ? xScale : yScale
};
const categories = {
x: Wrapper.getCategories(modifiedProps, "x"),
y: Wrapper.getCategories(modifiedProps, "y")
};
const origin = polar ? props.origin : Helpers.getPolarOrigin(modifiedProps);
const padding = Helpers.getPadding(props);
return {
datasets, categories, range, domain, horizontal,
scale, style, colorScale, color, offset, origin, padding
};
}
x: Helpers.getRange(props, "x"),
y: Helpers.getRange(props, "y")
};
const domain = {
x: getDomain(props, "x"),
y: getDomain(props, "y")
};
const scale = {
x: Scale.getBaseScale(props, "x")
.domain(domain.x)
.range(props.horizontal ? range.y : range.x),
y: Scale.getBaseScale(props, "y")
.domain(domain.y)
.range(props.horizontal ? range.x : range.y)
};
const origin = props.polar ? props.origin || Helpers.getPolarOrigin(props) : undefined;
return { domain, data, scale, style, origin };
};