Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getCalculatedValues = (props) => {
const defaultStyles =
props.theme && props.theme.voronoi && props.theme.voronoi.style
? props.theme.voronoi.style
: {};
const style = Helpers.getStyles(props.style, defaultStyles);
const data = Data.getData(props);
const range = {
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 getCalculatedValues = (props) => {
const { theme, polar } = props;
const defaultStyles = theme && theme.bar && theme.bar.style ? theme.bar.style : {};
const style = Helpers.getStyles(props.style, defaultStyles);
const data = Data.getData(props);
const range = {
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)
};
getDataWithOffset(props, defaultDataset, offset) {
const dataset = props.data || props.y ? Data.getData(props) : defaultDataset;
const xOffset = offset || 0;
return dataset.map((datum) => {
const _x1 = datum._x instanceof Date
? new Date(datum._x.getTime() + xOffset)
: datum._x + xOffset;
return assign({}, datum, { _x1 });
});
}
const getData = (childProps) => {
const data = Data.getData(childProps);
return Array.isArray(data) && data.length > 0 ? data : undefined;
};
function getDataWithOffset(props, defaultDataset = [], offset) {
const dataset = props.data || props.y ? Data.getData(props) : defaultDataset;
const xOffset = offset || 0;
return dataset.map((datum) => {
const _x1 =
datum._x instanceof Date ? new Date(datum._x.getTime() + xOffset) : datum._x + xOffset;
return assign({}, datum, { _x1 });
});
}
const getData = (childProps) => {
const data = Data.getData(childProps);
return Array.isArray(data) && data.length > 0 ? data : undefined;
};
const getData = (childProps) => {
const data = Data.getData(childProps);
return Array.isArray(data) && data.length > 0 ? data : undefined;
};