Skip to content

Commit

Permalink
Merge pull request #116 from offirgolan/og-abrams
Browse files Browse the repository at this point in the history
Ember 2.x Glimmer 2 Support
  • Loading branch information
ebryn authored Jul 24, 2017
2 parents 5178234 + 632270c commit 49f06d4
Show file tree
Hide file tree
Showing 161 changed files with 11,532 additions and 5,208 deletions.
15 changes: 1 addition & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,8 @@ insert_final_newline = true
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.hbs]
indent_style = space
indent_size = 2

[*.css]
indent_style = space
indent_size = 2

[*.html]
indent_style = space
indent_size = 2
insert_final_newline = false

[*.{diff,md}]
trim_trailing_whitespace = false
17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 6,
sourceType: 'module'
},
extends: 'eslint:recommended',
env: {
browser: true
},
globals: {
d3: true,
Rx: true
},
rules: {
}
};
16 changes: 16 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/bower_components
/config/ember-try.js
/dist
/tests
/tmp
**/.gitkeep
.bowerrc
.editorconfig
.ember-cli
.gitignore
.eslintrc.js
.watchmanconfig
.travis.yml
bower.json
ember-cli-build.js
testem.js
26 changes: 17 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
---
language: node_js
node_js:
- "0.12"
- "6"

sudo: false

cache:
directories:
- $HOME/.npm
- $HOME/.cache # includes bowers cache

env:
- EMBER_TRY_SCENARIO=default
# we recommend testing LTS's and latest stable release (bonus points to beta/canary)
- 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
- EMBER_TRY_SCENARIO=ember-default

matrix:
fast_finish: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary

before_install:
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
- "npm config set spin false"
- "npm install -g npm@^2"
- npm config set spin false
- npm install -g bower phantomjs-prebuilt
- bower --version
- phantomjs --version

install:
- npm install -g bower
- npm install
- bower install

script:
- ember try $EMBER_TRY_SCENARIO test
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup
3 changes: 3 additions & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["tmp", "dist"]
}
23 changes: 0 additions & 23 deletions Brocfile.js

This file was deleted.

1 change: 1 addition & 0 deletions addon/components/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
107 changes: 107 additions & 0 deletions addon/components/nf-area-stack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import Ember from 'ember';
import layout from 'ember-nf-graph/templates/components/nf-area-stack';
import computed from 'ember-new-computed';

/**
A component for grouping and stacking `nf-area` components in an `nf-graph`.
This component looks at the order of the `nf-area` components underneath it
and uses the ydata of the next sibling `nf-area` component to determine the bottom
of each `nf-area` components path to be drawn.
### Example
{{#nf-graph width=300 height=100}}
{{#nf-graph-content}}
{{#nf-area-stack}}
{{nf-area data=myData xprop="time" yprop="high"}}
{{nf-area data=myData xprop="time" yprop="med"}}
{{nf-area data=myData xprop="time" yprop="low"}}
{{/nf-area-stack}}
{{/nf-graph-content}}
{{/nf-graph}}
@namespace components
@class nf-area-stack
*/
export default Ember.Component.extend({
layout,
tagName: 'g',

/**
The parent graph for a component.
@property graph
@type components.nf-graph
@default null
*/
graph: null,

/**
Whether or not to add the values together to create the stacked area
@property aggregate
@type {boolean}
@default false
*/
aggregate: computed({
get() {
Ember.warn('nf-area-stack.aggregate must be set. Currently defaulting to `false` but will default to `true` in the future.');
return this._aggregate = false;
},
set(key, value) {
return this._aggregate = value;
}
}),

/**
The collection of `nf-area` components under this stack.
@property areas
@type Array
@readonly
*/
areas: computed(function(){
return Ember.A();
}),

/**
Registers an area component with this stack. Also links areas to one
another by setting `nextArea` on each area component.
@method registerArea
@param area {Ember.Component} The area component to register.
*/
registerArea: function(area) {
let areas = this.get('areas');
let prev = areas[areas.length - 1];

Ember.run.schedule('afterRender', () => {
if(prev) {
prev.set('nextArea', area);
area.set('prevArea', prev);
}

areas.pushObject(area);
});
},

/**
Unregisters an area component from this stack. Also updates next
and previous links.
@method unregisterArea
@param area {Ember.Component} the area to unregister
*/
unregisterArea: function(area) {
let prev = area.get('prevArea');
let next = area.get('nextArea');

Ember.run.schedule('afterRender', () => {
if(next) {
next.set('prevArea', prev);
}

if(prev) {
prev.set('nextArea', next);
}

this.get('areas').removeObject(area);
});
},
});
Loading

0 comments on commit 49f06d4

Please sign in to comment.