Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Improvement/named exports #380

Merged
merged 25 commits into from
Jun 5, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor getDomain
  • Loading branch information
boygirl committed May 25, 2018
commit b700d538e06e55ce9b025f2a067583a02bb34f5e
15 changes: 7 additions & 8 deletions src/victory-util/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ export default {
const propsDomain = this.getDomainFromProps(props, axis);
const minDomain = this.getMinFromProps(props, axis);
const maxDomain = this.getMaxFromProps(props, axis);
if (propsDomain || minDomain !== undefined && maxDomain !== undefined) {
const domain = propsDomain || this.getDomainFromMinMax(minDomain, maxDomain);
const formatDomain = (domain) => {
return this.cleanDomain(this.padDomain(domain, props, axis), props, axis);
};
if (propsDomain || minDomain !== undefined && maxDomain !== undefined) {
return formatDomain(propsDomain || this.getDomainFromMinMax(minDomain, maxDomain));
}
let domain;
const categories = Data.getCategories(props, axis);
if (categories) {
domain = this.getDomainFromCategories(props, axis, categories);
} else {
const dataset = Data.getData(props);
domain = this.getDomainFromData(props, axis, dataset);
return formatDomain(this.getDomainFromCategories(props, axis, categories));
}
return this.cleanDomain(this.padDomain(domain, props, axis), props, axis);
const dataset = Data.getData(props);
return formatDomain(this.getDomainFromData(props, axis, dataset));
},

/**
Expand Down