diff --git a/.travis.yml b/.travis.yml
index ad29b51..a7d7dbe 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,42 +1,35 @@
---
language: node_js
node_js:
- - "4"
+ - "stable"
-dist: trusty
-sudo: required
+sudo: false
cache:
directories:
- - node_modules
-
-addons:
- apt:
- sources:
- - google-chrome
- packages:
- - google-chrome-stable
+ - $HOME/.npm
+ - $HOME/.cache # includes bowers cache
env:
# we recommend testing LTS's and latest stable release (bonus points to beta/canary)
- - EMBER_TRY_SCENARIO=default
+ - EMBER_TRY_SCENARIO=ember-lts-2.4
+ - EMBER_TRY_SCENARIO=ember-lts-2.8
- EMBER_TRY_SCENARIO=ember-release
-
+ - EMBER_TRY_SCENARIO=ember-beta
+ - EMBER_TRY_SCENARIO=ember-canary
matrix:
fast_finish: true
allow_failures:
- - env:
- - EMBER_TRY_SCENARIO=ember-beta
- - EMBER_TRY_SCENARIO=ember-canary
+ - env: EMBER_TRY_SCENARIO=ember-lts-2.4
+ - env: EMBER_TRY_SCENARIO=ember-canary
before_install:
- - if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi
- - export DISPLAY=:99.0
- - sh -e /etc/init.d/xvfb start
- npm config set spin false
- npm install -g bower
- bower --version
+ - npm install phantomjs-prebuilt
+ - node_modules/phantomjs-prebuilt/bin/phantomjs --version
install:
- npm install
@@ -45,4 +38,4 @@ install:
script:
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- - ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup
\ No newline at end of file
+ - ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup
diff --git a/LICENSE.md b/LICENSE.md
index 02000b5..0d5e3ef 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2016
+Copyright (c) 2017
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
diff --git a/README.md b/README.md
index 11a1971..a8a9b33 100644
--- a/README.md
+++ b/README.md
@@ -45,7 +45,7 @@ This addon includes an `{{ember-sparkles}}`, which renders a responsive SVG cont
input-key='ts'
output-key='value'
- x-scale-type='band'
+ scale-type='band'
y-scale-type='linear'
x-domain=(map (r/get 'ts') data)
y-domain=(append 0 outputMax)
@@ -73,13 +73,7 @@ This addon includes an `{{ember-sparkles}}`, which renders a responsive SVG cont
* `x-scale-type {String}` **optional**
- Type of D3 scale function to use for horizontal axis.
-
- _default:_ `linear`
-
-* `y-scale-type {String}` **optional**
-
- Type of D3 scale function to use for vertical axis.
+ Type of D3 scale function to use for horizontal axis (`linear`, `band`, or `time`).
_default:_ `linear`
diff --git a/addon/helpers/e-s/arc-translate.js b/addon/helpers/e-s/arc-translate.js
index a88ed2e..75a0dbc 100644
--- a/addon/helpers/e-s/arc-translate.js
+++ b/addon/helpers/e-s/arc-translate.js
@@ -1,6 +1,6 @@
import Ember from 'ember';
-export function emberSparklesArcTranslate([ centroid ], { height, width }) {
+export function emberSparklesArcTranslate([ { centroid } ], { height, width }) {
return function(d) {
let [x, y] = centroid(d)
return `translate(${x + width}, ${y + height})`;
diff --git a/addon/helpers/e-s/bandwidth.js b/addon/helpers/e-s/bandwidth.js
new file mode 100644
index 0000000..cb2df27
--- /dev/null
+++ b/addon/helpers/e-s/bandwidth.js
@@ -0,0 +1,7 @@
+import Ember from 'ember';
+
+export function eSBandwidth([ { bandwidth } ]) {
+ return bandwidth;
+}
+
+export default Ember.Helper.helper(eSBandwidth);
diff --git a/addon/helpers/e-s/pojo.js b/addon/helpers/e-s/pojo.js
new file mode 100644
index 0000000..cdea02f
--- /dev/null
+++ b/addon/helpers/e-s/pojo.js
@@ -0,0 +1,11 @@
+// for ember v2.10+, the hash helper returns an EmptyObject, by design: https://github.com/emberjs/ember.js/issues/14489
+// this ensures a POJO in the template, which many helpers expect
+
+import Ember from 'ember';
+const { keys } = Object;
+
+export function eSPojo(params, hash) {
+ return keys(hash).reduce((pojo, k) => ({ [k]: hash[k], ...pojo }), {});
+}
+
+export default Ember.Helper.helper(eSPojo);
diff --git a/addon/page-objects/grouped-bar-chart.js b/addon/page-objects/grouped-bar-chart.js
index cbcef16..0bd48b4 100644
--- a/addon/page-objects/grouped-bar-chart.js
+++ b/addon/page-objects/grouped-bar-chart.js
@@ -1,3 +1,10 @@
+let hex = (x) => (`0${parseInt(x, 10).toString(16)}`).slice(-2);
+let rgb2hex = (rgb) => {
+ if (/^#[0-9A-F]{6}$/i.test(rgb)) return rgb;
+ let matches = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
+ return `#${hex(matches[1])}${hex(matches[2])}${hex(matches[3])}`;
+}
+
export default class GroupedBarChart {
constructor(env) {
this.env = env;
@@ -17,4 +24,9 @@ export default class GroupedBarChart {
}
}
+// phantomJS + chrome return hex and rgb values, respectively. we convert all fills to hex
+ fills() {
+ return this.rect('css', 'fill').map(m => m.map(rgb2hex));
+ }
+
}
diff --git a/addon/templates/components/e-s/bar-chart.hbs b/addon/templates/components/e-s/bar-chart.hbs
index 7418412..12f41dd 100644
--- a/addon/templates/components/e-s/bar-chart.hbs
+++ b/addon/templates/components/e-s/bar-chart.hbs
@@ -1,11 +1,11 @@
-{{let updateRect (pipe
+{{#let (pipe
(if with-transition (d3-transition transition) (d3-noop))
- (d3-attr 'width' xScale.bandwidth)
+ (d3-attr 'width' (e-s/bandwidth xScale))
(d3-attr 'height' (pipe outputKey yScale (e-s/bar-height height)))
(d3-attr 'x' (pipe inputKey xScale))
(d3-attr 'y' (pipe outputKey yScale))
(d3-style 'opacity' 1)
-)}}
+) as |updateRect|}}
{{d3-graph (pipe
(d3-select-all 'rect')
@@ -32,3 +32,5 @@
))
classNames='ember-sparkles--bar-chart'
}}
+
+{{/let}}
diff --git a/addon/templates/components/e-s/grouped-bar-chart.hbs b/addon/templates/components/e-s/grouped-bar-chart.hbs
index 333b510..96225b9 100644
--- a/addon/templates/components/e-s/grouped-bar-chart.hbs
+++ b/addon/templates/components/e-s/grouped-bar-chart.hbs
@@ -1,31 +1,33 @@
-{{let enterRect (pipe
- (d3-append 'rect')
- (d3-attr 'width' 0)
- (d3-attr 'height' 0)
- (d3-attr 'x' (pipe groupKey groupScale))
- (d3-attr 'y' height)
- (d3-style 'fill' 'red')
- (d3-style 'opacity' 0)
-)}}
+{{#let
+ (pipe
+ (d3-append 'rect')
+ (d3-attr 'width' 0)
+ (d3-attr 'height' 0)
+ (d3-attr 'x' (pipe groupKey groupScale))
+ (d3-attr 'y' height)
+ (d3-style 'fill' 'red')
+ (d3-style 'opacity' 0)
+ )
-{{let updateRect (pipe
- (if with-transition (d3-transition transition) (d3-noop))
- (d3-attr 'width' groupScale.bandwidth)
- (d3-attr 'height' (pipe valueKey yScale (e-s/bar-height height)))
- (d3-attr 'x' (pipe groupKey groupScale))
- (d3-attr 'y' (pipe valueKey yScale))
- (d3-style 'fill' (pipe groupKey colorScale))
- (d3-style 'opacity' 1)
-)}}
+ (pipe
+ (if with-transition (d3-transition transition) (d3-noop))
+ (d3-attr 'width' (e-s/bandwidth groupScale))
+ (d3-attr 'height' (pipe valueKey yScale (e-s/bar-height height)))
+ (d3-attr 'x' (pipe groupKey groupScale))
+ (d3-attr 'y' (pipe valueKey yScale))
+ (d3-style 'fill' (pipe groupKey colorScale))
+ (d3-style 'opacity' 1)
+ )
-{{let exitRect (pipe
- (if with-transition (d3-transition transition) (d3-noop))
- (d3-attr 'y' height)
- (d3-attr 'height' 0)
- (d3-style 'fill' 'green')
- (d3-style 'opacity' 0)
- (d3-remove)
-)}}
+ (pipe
+ (if with-transition (d3-transition transition) (d3-noop))
+ (d3-attr 'y' height)
+ (d3-attr 'height' 0)
+ (d3-style 'fill' 'green')
+ (d3-style 'opacity' 0)
+ (d3-remove)
+ )
+as |enterRect updateRect exitRect|}}
{{d3-graph (pipe
(d3-select-all '.rect-group')
@@ -69,3 +71,5 @@
))
classNames='ember-sparkles--grouped-bar-chart'
}}
+
+{{/let}}
diff --git a/addon/templates/components/e-s/legend.hbs b/addon/templates/components/e-s/legend.hbs
index 378c717..be28280 100644
--- a/addon/templates/components/e-s/legend.hbs
+++ b/addon/templates/components/e-s/legend.hbs
@@ -1,26 +1,30 @@
{{#d3-graph classNames="ember-sparkles--legend" as |d3|}}
- {{let transform (d3-attr 'transform'
- (i 'translate(${coords})' coords=(concat dx ',' dy))
- )}}
- {{let shapePositionerOpt (compute
- (action shapePositioner
- (or direction 'vertical')
- (or shape-spacing 20)
- (hash x=dx y=dy)
- )
- )}}
- {{let addShape (get (hash
- rect=(pipe
- (d3-append 'rect')
- (d3-attr 'width' (or shape-size 14))
- (d3-attr 'height' (or shape-size 14))
- )
- circle=(pipe
- (d3-append 'circle')
- (d3-attr 'r' (or shape-size 8))
+ {{#let
+ (d3-attr 'transform'
+ (i 'translate(${coords})' coords=(concat dx ',' dy))
+ )
+
+ (compute
+ (action shapePositioner
+ (or direction 'vertical')
+ (or shape-spacing 20)
+ (e-s/pojo x=dx y=dy)
+ )
)
- ) shape)}}
+
+ (get (e-s/pojo
+ rect=(pipe
+ (d3-append 'rect')
+ (d3-attr 'width' (or shape-size 14))
+ (d3-attr 'height' (or shape-size 14))
+ )
+ circle=(pipe
+ (d3-append 'circle')
+ (d3-attr 'r' (or shape-size 8))
+ )
+ ) shape)
+ as |transform shapePositionerOpt addShape|}}
{{d3.graph (pipe
(d3-append 'g')
@@ -86,4 +90,6 @@
)
))}}
+ {{/let}}
+
{{/d3-graph}}
diff --git a/addon/templates/components/e-s/pie-chart.hbs b/addon/templates/components/e-s/pie-chart.hbs
index 9a55770..d5e6e69 100644
--- a/addon/templates/components/e-s/pie-chart.hbs
+++ b/addon/templates/components/e-s/pie-chart.hbs
@@ -1,60 +1,62 @@
{{#d3-graph classNames="ember-sparkles--pie-chart" as |d3|}}
+{{#let
+ (d3-arc outerRadius=(sub radius 10) innerRadius=0)
+ (compute (d3-pie valueFn=outputKey) data)
+ (div width 2)
+ (div height 2)
+as |arc pie centerWidth centerHeight|}}
- {{let arc (d3-arc outerRadius=(sub radius 10) innerRadius=0)}}
- {{let pie (compute (d3-pie valueFn=outputKey) data)}}
- {{let centerWidth (div width 2)}}
- {{let centerHeight (div height 2)}}
-
- {{d3.graph (pipe
- (d3-select-all 'path')
- (d3-data pie)
- (d3-join
- enter=(pipe
- (d3-append 'path')
- (d3-attr 'class' (pipe groupKey (r 'dasherize')))
- (d3-attr 'transform' (i 'translate(${w},${h})' h=centerHeight w=centerWidth))
- (if with-transition (d3-transition transition) (d3-noop))
- (d3-attr-tween 'd' (d3-arc-tween arc))
- (d3-style 'fill' (pipe groupKey colorScale))
- (d3-attr 'opacity' 1)
- )
- update=(pipe
- (if with-transition (d3-transition transition) (d3-noop))
- (d3-attr 'transform' (i 'translate(${w},${h})' h=centerHeight w=centerWidth))
- (d3-attr-tween 'd' (d3-arc-tween arc))
- (d3-style 'fill' (pipe groupKey colorScale))
- )
- exit=(pipe
- (if with-transition (d3-transition transition) (d3-noop))
- (d3-attr 'opacity' 0)
- (d3-remove)
- )
- ))}}
+ {{d3.graph (pipe
+ (d3-select-all 'path')
+ (d3-data pie)
+ (d3-join
+ enter=(pipe
+ (d3-append 'path')
+ (d3-attr 'class' (pipe groupKey (r 'dasherize')))
+ (d3-attr 'transform' (i 'translate(${w},${h})' h=centerHeight w=centerWidth))
+ (if with-transition (d3-transition transition) (d3-noop))
+ (d3-attr-tween 'd' (d3-arc-tween arc))
+ (d3-style 'fill' (pipe groupKey colorScale))
+ (d3-attr 'opacity' 1)
+ )
+ update=(pipe
+ (if with-transition (d3-transition transition) (d3-noop))
+ (d3-attr 'transform' (i 'translate(${w},${h})' h=centerHeight w=centerWidth))
+ (d3-attr-tween 'd' (d3-arc-tween arc))
+ (d3-style 'fill' (pipe groupKey colorScale))
+ )
+ exit=(pipe
+ (if with-transition (d3-transition transition) (d3-noop))
+ (d3-attr 'opacity' 0)
+ (d3-remove)
+ )
+))}}
- {{d3.graph (pipe
- (d3-select-all 'text')
- (d3-data pie)
- (d3-join
- enter=(pipe
- (d3-append 'text')
- (d3-attr 'class' (pipe groupKey (r 'dasherize')))
- (d3-attr 'opacity' 0)
- (if with-transition (d3-transition transition) (d3-noop))
- (d3-attr 'opacity' 1)
- (d3-attr 'transform' (e-s/arc-translate arc.centroid height=centerHeight width=centerWidth))
- (d3-text (r/get 'data.percentage'))
- )
- update=(pipe
- (if with-transition (d3-transition transition) (d3-noop))
- (d3-attr 'transform' (e-s/arc-translate arc.centroid height=centerHeight width=centerWidth))
- (d3-text (r/get 'data.percentage'))
- )
- exit=(pipe
- (if with-transition (d3-transition transition) (d3-noop))
- (d3-attr 'opacity' 0)
- (d3-remove)
- )
- ))}}
+{{d3.graph (pipe
+ (d3-select-all 'text')
+ (d3-data pie)
+ (d3-join
+ enter=(pipe
+ (d3-append 'text')
+ (d3-attr 'class' (pipe groupKey (r 'dasherize')))
+ (d3-attr 'opacity' 0)
+ (if with-transition (d3-transition transition) (d3-noop))
+ (d3-attr 'opacity' 1)
+ (d3-attr 'transform' (e-s/arc-translate arc height=centerHeight width=centerWidth))
+ (d3-text (r/get 'data.percentage'))
+ )
+ update=(pipe
+ (if with-transition (d3-transition transition) (d3-noop))
+ (d3-attr 'transform' (e-s/arc-translate arc height=centerHeight width=centerWidth))
+ (d3-text (r/get 'data.percentage'))
+ )
+ exit=(pipe
+ (if with-transition (d3-transition transition) (d3-noop))
+ (d3-attr 'opacity' 0)
+ (d3-remove)
+ )
+))}}
+{{/let}}
{{/d3-graph}}
diff --git a/addon/templates/components/ember-sparkles.hbs b/addon/templates/components/ember-sparkles.hbs
index f0fdc23..c85c193 100644
--- a/addon/templates/components/ember-sparkles.hbs
+++ b/addon/templates/components/ember-sparkles.hbs
@@ -1,32 +1,53 @@
- {{let x-scale (r (i '${t}-scale' t=(or x-scale-type 'linear'))
- x-domain
- (append 0 innerWidth)
- round=true
- padding=0.2
- )}}
- {{let y-scale (r (i '${t}-scale' t=(or y-scale-type 'linear'))
- y-domain
- (append innerHeight 0)
- )}}
- {{let color-scale (cat-color-scale
- (or color-scale-type '20b')
- domain=group-domain
- )}}
- {{let transition (e-s/transition
- duration=(or transition-duration 1000)
- data=data
- )}}
- {{let inputKey (r/get (or input-key 0))}}
- {{let outputKey (r/get (or output-key 1))}}
+ {{#let (e-s/pojo
+ linear=(linear-scale
+ x-domain
+ (append 0 innerWidth)
+ round=true
+ padding=0.2
+ )
+ band=(band-scale
+ x-domain
+ (append 0 innerWidth)
+ round=true
+ padding=0.2
+ )
+ time=(time-scale
+ x-domain
+ (append 0 innerWidth)
+ round=true
+ padding=0.2
+ )
+ ) as |scales|}}
+ {{#let
+ (get scales (or scale-type 'linear'))
+
+ (linear-scale
+ y-domain
+ (append innerHeight 0)
+ )
- {{yield (hash
- x-scale=(compute x-scale)
- y-scale=(compute y-scale)
+ (cat-color-scale
+ (or color-scale-type '20b')
+ domain=group-domain
+ )
+
+ (e-s/transition
+ duration=(or transition-duration 1000)
+ data=data
+ )
+
+ (r/get (or input-key 0))
+ (r/get (or output-key 1))
+ as |x-scale y-scale color-scale transition inputKey outputKey|}}
+
+ {{yield (e-s/pojo
+ x-scale=x-scale
+ y-scale=y-scale
x-axis=(component 'e-s/axis'
- scale=(compute x-scale)
+ scale=x-scale
position='bottom'
height=innerHeight
transition=transition
@@ -34,7 +55,7 @@
)
y-axis=(component 'e-s/axis'
- scale=(compute y-scale)
+ scale=y-scale
position='left'
width=innerWidth
transition=transition
@@ -43,8 +64,8 @@
bar-chart=(component 'e-s/bar-chart'
data=data
- xScale=(compute x-scale)
- yScale=(compute y-scale)
+ xScale=x-scale
+ yScale=y-scale
inputKey=inputKey
outputKey=outputKey
@@ -56,12 +77,12 @@
grouped-bar-chart=(component 'e-s/grouped-bar-chart'
data=data
- xScale=(compute x-scale)
- yScale=(compute y-scale)
+ xScale=x-scale
+ yScale=y-scale
colorScale=color-scale
groupScale=(band-scale
group-domain
- (append 0 (compute (get (compute x-scale) 'bandwidth')))
+ (append 0 (compute (e-s/bandwidth x-scale)))
padding=(or group-padding 0.05)
)
@@ -77,8 +98,8 @@
line-chart=(component 'e-s/line-chart'
data=data
- xScale=(compute x-scale)
- yScale=(compute y-scale)
+ xScale=x-scale
+ yScale=y-scale
colorScale=color-scale
inputKey=inputKey
@@ -119,4 +140,7 @@
transition=transition
)}}
+ {{/let}}
+ {{/let}}
+
diff --git a/app/helpers/e-s/bandwidth.js b/app/helpers/e-s/bandwidth.js
new file mode 100644
index 0000000..47c5815
--- /dev/null
+++ b/app/helpers/e-s/bandwidth.js
@@ -0,0 +1 @@
+export { default, eSBandwidth } from 'ember-sparkles/helpers/e-s/bandwidth';
diff --git a/app/helpers/e-s/pojo.js b/app/helpers/e-s/pojo.js
new file mode 100644
index 0000000..617315a
--- /dev/null
+++ b/app/helpers/e-s/pojo.js
@@ -0,0 +1 @@
+export { default, eSPojo } from 'ember-sparkles/helpers/e-s/pojo';
diff --git a/bower.json b/bower.json
index 4910356..76bae30 100644
--- a/bower.json
+++ b/bower.json
@@ -1,7 +1,7 @@
{
"name": "ember-sparkles",
"dependencies": {
- "ember": "~2.9.0",
+ "ember": "~2.10.0",
"ember-cli-shims": "0.1.3",
"moment-range": "^2.2.0"
}
diff --git a/config/ember-try.js b/config/ember-try.js
index be846e1..c58516b 100644
--- a/config/ember-try.js
+++ b/config/ember-try.js
@@ -2,9 +2,25 @@
module.exports = {
scenarios: [
{
- name: 'default',
+ name: 'ember-lts-2.4',
bower: {
- dependencies: { }
+ dependencies: {
+ 'ember': 'components/ember#lts-2-4'
+ },
+ resolutions: {
+ 'ember': 'lts-2-4'
+ }
+ }
+ },
+ {
+ name: 'ember-lts-2.8',
+ bower: {
+ dependencies: {
+ 'ember': 'components/ember#lts-2-8'
+ },
+ resolutions: {
+ 'ember': 'lts-2-8'
+ }
}
},
{
diff --git a/package.json b/package.json
index 0c22ab1..362d985 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,7 @@
},
"repository": "https://github.com/LocusEnergy/ember-sparkles",
"engines": {
- "node": ">= 0.10.0"
+ "node": ">= 0.12.0"
},
"author": "zigahertz , embersherpa ",
"license": "MIT",
@@ -22,13 +22,13 @@
"babel-eslint": "^6.1.2",
"broccoli-asset-rev": "^2.4.5",
"ember-ajax": "2.4.1",
- "ember-cli": "2.9.1",
+ "ember-cli": "2.10.0",
"ember-cli-app-version": "^2.0.0",
"ember-cli-dependency-checker": "^1.3.0",
"ember-cli-deploy": "0.5.1",
"ember-cli-eslint": "3.0.0",
"ember-cli-github-pages": "0.1.0",
- "ember-cli-htmlbars": "^1.0.3",
+ "ember-cli-htmlbars": "^1.0.10",
"ember-cli-htmlbars-inline-precompile": "^0.3.3",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-qunit": "^3.0.1",
@@ -40,10 +40,10 @@
"ember-code-snippet": "1.4.0",
"ember-computed-decorators": "0.2.2",
"ember-concurrency": "0.7.8",
- "ember-data": "^2.9.0",
+ "ember-data": "^2.10.0",
"ember-disable-prototype-extensions": "^1.1.0",
"ember-export-application-global": "^1.0.5",
- "ember-let": "0.4.0",
+ "ember-let": "0.5.4",
"ember-load-initializers": "^0.5.1",
"ember-resolver": "^2.0.3",
"loader.js": "^4.0.10"
@@ -57,15 +57,15 @@
"dependencies": {
"ember-cli-babel": "^5.1.7",
"ember-cli-htmlbars": "^1.0.10",
- "ember-composable-helpers": "1.0.0",
- "ember-d3": "^0.3.0",
- "ember-d3-helpers": "0.5.11",
+ "ember-composable-helpers": "2.0.0",
+ "ember-d3": "^0.3.2",
+ "ember-d3-helpers": "0.5.14",
"ember-interpolate-helper": "1.0.0",
"ember-lodash": "0.0.7",
- "ember-math-helpers": "1.2.2",
- "ember-reactive-helpers": "0.3.7",
+ "ember-math-helpers": "~2.0.5",
+ "ember-reactive-helpers": "0.4.0",
"ember-resize": "0.0.13",
- "ember-truth-helpers": "1.2.0"
+ "ember-truth-helpers": "1.3.0"
},
"ember-addon": {
"configPath": "tests/dummy/config",
diff --git a/testem.js b/testem.js
index a2295b3..26044b2 100644
--- a/testem.js
+++ b/testem.js
@@ -4,9 +4,10 @@ module.exports = {
"test_page": "tests/index.html?hidepassed",
"disable_watching": true,
"launch_in_ci": [
- "Chrome"
+ "PhantomJS"
],
"launch_in_dev": [
+ "PhantomJS",
"Chrome"
]
-};
\ No newline at end of file
+};
diff --git a/tests/dummy/app/templates/bar-chart.hbs b/tests/dummy/app/templates/bar-chart.hbs
index 4adc5f9..1a2269c 100644
--- a/tests/dummy/app/templates/bar-chart.hbs
+++ b/tests/dummy/app/templates/bar-chart.hbs
@@ -5,8 +5,7 @@
input-key='ts'
output-key='value'
- x-scale-type='band'
- y-scale-type='linear'
+ scale-type='band'
x-domain=(map (r/get 'ts') data)
y-domain=(append 0 outputMax)
diff --git a/tests/dummy/app/templates/grouped-bar-chart.hbs b/tests/dummy/app/templates/grouped-bar-chart.hbs
index b590c10..13dc694 100644
--- a/tests/dummy/app/templates/grouped-bar-chart.hbs
+++ b/tests/dummy/app/templates/grouped-bar-chart.hbs
@@ -7,8 +7,7 @@
group-key='name'
value-key='value'
- x-scale-type='band'
- y-scale-type='linear'
+ scale-type='band'
x-domain=(map (r/get 'ts') barData)
y-domain=(append 0 outputMax)
diff --git a/tests/dummy/app/templates/line-chart.hbs b/tests/dummy/app/templates/line-chart.hbs
index cb99816..579c680 100644
--- a/tests/dummy/app/templates/line-chart.hbs
+++ b/tests/dummy/app/templates/line-chart.hbs
@@ -7,8 +7,7 @@
output-key='Wh_sum'
group-key='series'
- x-scale-type='time'
- y-scale-type='linear'
+ scale-type='time'
x-domain=xDomain
y-domain=yDomain
group-domain=(map-by 'series' (sort-by 'series' timeseriesData))
diff --git a/tests/dummy/app/templates/sine-wave.hbs b/tests/dummy/app/templates/sine-wave.hbs
index e717a1e..b8154c1 100644
--- a/tests/dummy/app/templates/sine-wave.hbs
+++ b/tests/dummy/app/templates/sine-wave.hbs
@@ -17,7 +17,7 @@
as |mid radius|}}
{{#let
- (array (hash cx=(mult radius rotatorX) cy=(mult radius rotatorY)))
+ (array (e-s/pojo cx=(mult radius rotatorX) cy=(mult radius rotatorY)))
as |point|}}
@@ -81,7 +81,6 @@
{{#if labels}}
-
{{#let (d3-arc innerRadius=0 outerRadius=(div radius 2) startAngle=(mult theta -1) endAngle=0) as |arc|}}
{{d3-element
element-name='path'
@@ -97,7 +96,7 @@
{{d3-element
element-name='text'
selector='sine-text'
- data=(array (hash text=(concat 'sin(a) = ' (float (mult rotatorY -1) 2))))
+ data=(array (e-s/pojo text=(concat 'sin(a) = ' (float (mult rotatorY -1) 2))))
transition=chart.transition
on-enter=(pipe
(d3-attr 'x' (add radius 12))
@@ -130,7 +129,7 @@
{{chart.y-axis x-translate=chart.width ticks=4}}
- {{chart.line-chart}}
+ {{chart.line-chart data=(array)}}
{{/let}}
{{/let}}
diff --git a/tests/helpers/start-app.js b/tests/helpers/start-app.js
index e098f1d..54c33c1 100644
--- a/tests/helpers/start-app.js
+++ b/tests/helpers/start-app.js
@@ -5,8 +5,8 @@ import config from '../../config/environment';
export default function startApp(attrs) {
let application;
- let attributes = Ember.merge({}, config.APP);
- attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
+ // use defaults, but you can override
+ let attributes = Ember.assign({}, config.APP, attrs);
Ember.run(() => {
application = Application.create(attributes);
diff --git a/tests/index.html b/tests/index.html
index 0a0e793..6ce8312 100644
--- a/tests/index.html
+++ b/tests/index.html
@@ -10,8 +10,8 @@
{{content-for "head"}}
{{content-for "test-head"}}
-
-
+
+
{{content-for "head-footer"}}
diff --git a/tests/integration/components/e-s/axis-test.js b/tests/integration/components/e-s/axis-test.js
index 5e76d55..9021c42 100644
--- a/tests/integration/components/e-s/axis-test.js
+++ b/tests/integration/components/e-s/axis-test.js
@@ -1,12 +1,8 @@
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
-import LetHelperInitializer from 'ember-let/initializers/register-let-helper';
moduleForComponent('ember-sparkles/axis', 'Integration | Component | ember sparkles/axis', {
- integration: true,
- beforeEach() {
- LetHelperInitializer.initialize();
- },
+ integration: true
});
test('accepts a dynamic scale property', function(assert) {
diff --git a/tests/integration/components/e-s/grouped-bar-chart-test.js b/tests/integration/components/e-s/grouped-bar-chart-test.js
index c51a2c9..3c29fb2 100644
--- a/tests/integration/components/e-s/grouped-bar-chart-test.js
+++ b/tests/integration/components/e-s/grouped-bar-chart-test.js
@@ -2,13 +2,11 @@ import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import GroupedBarChart from 'ember-sparkles/page-objects/grouped-bar-chart';
import { scaleOrdinal } from 'd3-scale';
-import LetHelperInitializer from 'ember-let/initializers/register-let-helper';
moduleForComponent('ember-sparkles/grouped-bar-chart', 'Integration | Component | ember sparkles/grouped bar chart', {
integration: true,
beforeEach() {
this.chart = new GroupedBarChart(this);
- LetHelperInitializer.initialize();
},
});
@@ -20,6 +18,7 @@ test('it renders', function(assert) {