Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
change .@each to .[] to remove deprecations.
Browse files Browse the repository at this point in the history
 -some cleaning up of newlines polluting the diff...
  • Loading branch information
iezer committed Aug 25, 2015
1 parent 4d08c84 commit 5dac002
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 78 deletions.
32 changes: 16 additions & 16 deletions addon/mixins/graph-data-graphic.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var noop = function(){};
with the graph. Includes methods for extracting, sorting and scrubbing data
for use in graphing components.
Requires {{#crossLink "mixins.graph-registered-graphic"}}{{/crossLink}} and
Requires {{#crossLink "mixins.graph-registered-graphic"}}{{/crossLink}} and
{{#crossLink "mixins.graph-has-graph-parent"}}{{/crossLink}}
@namespace mixins
Expand All @@ -31,7 +31,7 @@ export default Ember.Mixin.create({
*/
data: null,

mappedData: computed('data.@each', {
mappedData: computed('data.[]', {
get() {
var yPropFn = this.get('yPropFn');
var xPropFn = this.get('xPropFn');
Expand All @@ -48,7 +48,7 @@ export default Ember.Mixin.create({
}
}),

_triggerHasData: on('init', observer('data.@each', function(){
_triggerHasData: on('init', observer('data.[]', function(){
Ember.run.once(this, this._sendTriggerHasData);
})),

Expand All @@ -57,7 +57,7 @@ export default Ember.Mixin.create({
},

/**
The path of the property on each object in
The path of the property on each object in
{{#crossLink "mixins.graph-data-graphic/data:property"}}{{/crossLink}}
to use as x data to plot on the graph.
Expand All @@ -68,7 +68,7 @@ export default Ember.Mixin.create({
xprop: 'x',

/**
The path of the property on each object in
The path of the property on each object in
{{#crossLink "mixins.graph-data-graphic/data:property"}}{{/crossLink}}
to use as y data to plot on the graph.
Expand All @@ -79,7 +79,7 @@ export default Ember.Mixin.create({
yprop: 'y',

/**
The function to get the x value from each
The function to get the x value from each
{{#crossLink "mixins.graph-data-graphic/data:property"}}{{/crossLink}} object
@property xPropFn
Expand All @@ -94,7 +94,7 @@ export default Ember.Mixin.create({
}),

/**
The function to get the y value from each
The function to get the y value from each
{{#crossLink "mixins.graph-data-graphic/data:property"}}{{/crossLink}} object
@property yPropFn
Expand All @@ -116,7 +116,7 @@ export default Ember.Mixin.create({
@readonly
*/
renderedData: computed(
'mappedData.@each',
'mappedData.[]',
'graph.xScaleType',
'graph.xMin',
'graph.xMax',
Expand Down Expand Up @@ -156,7 +156,7 @@ export default Ember.Mixin.create({
@type {Object}
@readonly
*/
firstVisibleData: computed('renderedData.@each', 'xMin', {
firstVisibleData: computed('renderedData.[]', 'xMin', {
get() {
var { renderedData, xPropFn, yPropFn, xMin } = this.getProperties('renderedData', 'xPropFn', 'yPropFn', 'xMin');

Expand All @@ -183,7 +183,7 @@ export default Ember.Mixin.create({
@type {Object}
@readonly
*/
lastVisibleData: computed('renderedData.@each', 'yPropFn', 'xPropFn', 'xMax', {
lastVisibleData: computed('renderedData.[]', 'yPropFn', 'xPropFn', 'xMax', {
get() {
var { renderedData, xPropFn, yPropFn, xMax } = this.getProperties('renderedData', 'xPropFn', 'yPropFn', 'xMax');
var last = renderedData[renderedData.length - 1];
Expand Down Expand Up @@ -220,10 +220,10 @@ export default Ember.Mixin.create({
getDataNearXRange(rangeX) {
var rendered = this._getRenderedDataNearXRange(rangeX);

if(!rendered) {
if(!rendered) {
return null;
}

var renderX = rendered[0];
var renderY = rendered[1];
var data = rendered.data;
Expand All @@ -232,13 +232,13 @@ export default Ember.Mixin.create({
return { renderX, renderY, data, x, y };
},

/**
/**
Gets the actual data at a rendered tracking point passed to it.
This is overridden in nf-area to account for stacking of data.
@method getActualTrackData
@param renderX {number} the x domain value the data is rendered at
@param renderY {number} the y domain value the data is rendered at
@param data {Object} the raw data from the point
@param renderY {number} the y domain value the data is rendered at
@param data {Object} the raw data from the point
@return {Object} simple x, y point structure
*/
getActualTrackData(renderX, renderY, data) {
Expand All @@ -259,4 +259,4 @@ export default Ember.Mixin.create({

function between(x, a, b) {
return a <= x && x <= b;
}
}
12 changes: 6 additions & 6 deletions app/components/nf-area.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import LineUtils from 'ember-nf-graph/mixins/graph-line-utils';

/**
Adds an area graph to an `nf-graph` component.
Optionally, if it's located within an `nf-area-stack` component, it will work with
sibling `nf-area` components to create a stacked graph.
@namespace components
Expand All @@ -24,11 +24,11 @@ import LineUtils from 'ember-nf-graph/mixins/graph-line-utils';
@uses mixins.graph-graphic-with-tracking-dot
@uses mixins.graph-requires-scale-source
*/
export default Ember.Component.extend(HasGraphParent, RegisteredGraphic, DataGraphic,
Selectable, AreaUtils, GraphicWithTrackingDot, RequireScaleSource, LineUtils, {
export default Ember.Component.extend(HasGraphParent, RegisteredGraphic, DataGraphic,
Selectable, AreaUtils, GraphicWithTrackingDot, RequireScaleSource, LineUtils, {

tagName: 'g',

classNameBindings: [':nf-area', 'selected', 'selectable'],

/**
Expand Down Expand Up @@ -90,7 +90,7 @@ export default Ember.Component.extend(HasGraphParent, RegisteredGraphic, DataGra
@type Array
@readonly
*/
nextYData: Ember.computed('data.length', 'nextArea.data.@each', function(){
nextYData: Ember.computed('data.length', 'nextArea.data.[]', function(){
var data = this.get('data');
if(!Array.isArray(data)) {
return [];
Expand All @@ -105,7 +105,7 @@ export default Ember.Component.extend(HasGraphParent, RegisteredGraphic, DataGra
@type Array
@readonly
*/
mappedData: Ember.computed('data.[]', 'xPropFn', 'yPropFn', 'nextYData.@each', 'stack.aggregate', function() {
mappedData: Ember.computed('data.[]', 'xPropFn', 'yPropFn', 'nextYData.[]', 'stack.aggregate', function() {
var { data, xPropFn, yPropFn, nextYData } = this.getProperties('data', 'xPropFn', 'yPropFn', 'nextYData');
var aggregate = this.get('stack.aggregate');
if(Array.isArray(data)) {
Expand Down
6 changes: 3 additions & 3 deletions app/components/nf-bars.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ export default Ember.Component.extend(HasGraphParent, RegisteredGraphic, DataGra
bars: Ember.computed(
'xScale',
'yScale',
'renderedData.@each',
'renderedData.[]',
'graphHeight',
'getBarClass',
'barWidth',
'groupOffsetX',
function(){
var { renderedData, xScale, yScale, barWidth, graphHeight, getBarClass, groupOffsetX } =
var { renderedData, xScale, yScale, barWidth, graphHeight, getBarClass, groupOffsetX } =
this.getProperties('renderedData', 'xScale', 'yScale', 'graphHeight', 'getBarClass', 'groupOffsetX', 'barWidth');

var getRectPath = this._getRectPath;
Expand Down Expand Up @@ -172,4 +172,4 @@ export default Ember.Component.extend(HasGraphParent, RegisteredGraphic, DataGra
}
}

});
});
Loading

0 comments on commit 5dac002

Please sign in to comment.