{"size": 337, "ext": "js", "max_stars_repo_path": "src/components/scale/scales/quantize.js", "max_stars_repo_name": "AnikaNietzer/vue-data-components", "max_stars_repo_stars_event_min_datetime": "2019-01-19T20:49:33.000Z", "max_stars_repo_stars_event_max_datetime": "2020-11-21T19:42:09.000Z", "max_issues_repo_path": "src/components/scale/scales/quantize.js", "max_issues_repo_name": "AnikaNietzer/vue-data-components", "max_issues_repo_issues_event_min_datetime": "2019-01-21T11:51:17.000Z", "max_issues_repo_issues_event_max_datetime": "2019-01-22T15:16:02.000Z", "max_forks_repo_path": "src/components/scale/scales/quantize.js", "max_forks_repo_name": "AnikaNietzer/vue-data-components", "max_forks_repo_forks_event_min_datetime": "2019-01-21T11:45:38.000Z", "max_forks_repo_forks_event_max_datetime": "2019-05-07T20:20:43.000Z"}
{"max_stars_count": 7, "max_issues_count": 2, "max_forks_count": 3, "avg_line_length": 24.0714285714, "max_line_length": 72, "alphanum_fraction": 0.6913946588}
import { scaleQuantize } from 'd3-scale'

export default ({ range, domain, ticks, tickFormat, nice = false }) => {
  const scale = scaleQuantize()

  if (range) scale.range(range)
  if (domain) scale.domain(domain)
  if (nice) scale.nice()
  if (ticks) scale.ticks(ticks)
  if (tickFormat) scale.tickFormat(tickFormat)

  return scale
}
