# ember-d3-scale

> A couple of Ember helpers around D3 Scales

Latest version **0.1.5** (published 2016-05-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install ember-d3-scale
pnpm add ember-d3-scale
yarn add ember-d3-scale
bun add ember-d3-scale
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2016-05-04 |
| First published | 2016-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | spencer516 |
| Keywords | ember-addon |

## Links

- npm: https://www.npmjs.com/package/ember-d3-scale
- Repository: https://github.com/spencer516/ember-d3-scale
- Homepage: https://github.com/spencer516/ember-d3-scale#readme
- Issues: https://github.com/spencer516/ember-d3-scale/issues
- npm.io page: https://npm.io/package/ember-d3-scale

## Dependencies (2)

- [ember-cli-babel](https://npm.io/package/ember-cli-babel.md) ^5.1.5
- [ember-cli-d3-shape](https://npm.io/package/ember-cli-d3-shape.md) 0.8.1

## Recent versions

- 0.1.5 (latest) — 2016-05-04
- 0.1.4 — 2016-04-18
- 0.1.3 — 2016-04-16
- 0.1.2 — 2016-04-16
- 0.1.1 — 2016-04-07
- 0.1.0 — 2016-04-07
- 0.0.2 — 2016-03-17
- 0.0.1 — 2016-03-17

## README

[![Build Status](https://travis-ci.org/spencer516/ember-d3-scale.svg?branch=master)](https://travis-ci.org/spencer516/ember-d3-scale)
[![Code Climate](https://codeclimate.com/github/spencer516/ember-d3-scale/badges/gpa.svg)](https://codeclimate.com/github/spencer516/ember-d3-scale)
[![Ember Observer Score](http://emberobserver.com/badges/ember-d3-scale.svg)](http://emberobserver.com/addons/ember-d3-scale)

# Ember-d3-scale

This library provides a suite of Ember helpers around the d3 scale library. Support for more features is ongoing.

## Configuration

Currently, there are no configuration options for this addon in `config/environment.js`. At the moment, this addon will add all the required `d3` dependencies.

## Live Examples

You can view a demo of a few ways to use these helpers [here](http://spencer516.github.io/ember-d3-scale)

## Available Helpers

* [Linear Scales](#linear-scales)
	- [`linear-scale`](#linear-scale)
	- [`time-scale`](#time-scale)
  - [`seq-color-scale`](#seq-color-scale)
* [Ordinal Scales](#ordinal-scales)
	- [`band-scale`](#band-scale)
	- [`point-scale`](#point-scale)
  - [`cat-color-scale`](#cat-color-scale)
* [Scale Derivatives](#scale-derivatives)
	- [`scale-tics`](#scale-ticks)
	- [`scale-value`](#scale-value)
* [Misc Helpers](#misc-helpers)
	- [`immut-array`](#immut-array)
	- [`time-interval`](#time-interval)

## Usage

### Linear scales

#### `linear-scale`
[D3 Linear Scale](https://github.com/d3/d3-scale#linear-scales)

```js
export default Ember.Component.extend({
  domain: [0, 10],
  range: [0, 100]
});
```

```hbs
{{#with (linear-scale domain range nice=true) as |scale|}}
  <span>I am {{scale-value scale 5}} 50 years old.</span>
{{/with}}
```

#### `time-scale`
[D3 Time Scale](https://github.com/d3/d3-scale#time-scales)

```js
export default Ember.Component.extend({
  domain: [
    new Date(2016, 2, 1),
    new Date(2016, 2, 31)
  ]
});
```

```hbs
{{#with (time-scale domain) as |scale|}}
  {{#each (scale-ticks scale (time-interval 'day')) as |date|}}
    <a>{{date}}</a>
  {{/each}}
{{/with}}
```
### `seq-color-scale`
Sequential color scale description.

### Ordinal scales

#### `band-scale`
Band scale description

#### `point-scale`
Point Scale description

#### `cat-color-scale`
Categorical color scale.

### Scale Derivatives

#### `scale-ticks`
Scale ticks

#### `scale-value`
Get the calculated value from a scale

### Misc Helpers

#### `immut-array`
Immutable array helper description

#### `time-interval`
A time interval helper.

## Installation

* `git clone` this repository
* `npm install`
* `bower install`

## Running

* `ember server`
* Visit your app at http://localhost:4200.

## Running Tests

* `npm test` (Runs `ember try:testall` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`

## Building

* `ember build`

For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).

---
_Source: https://npm.io/package/ember-d3-scale · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
