Skip to content
This repository has been archived by the owner on Feb 14, 2019. It is now read-only.

Commit

Permalink
Final Custom Item API Changes: array in ICustomDataRow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
poltavets.pavel committed Apr 28, 2017
1 parent 9494d0b commit 0544102
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions dist/funnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,12 @@ var funnelD3Item = (function(_base) {
this.iterateData(function(dataRow) {
var values = dataRow.getValue('Values');
var valueStr = dataRow.getDisplayText('Values');
var color = dataRow.getColor('Values');
if(_this._hasArguments()) {
var labelText = dataRow.getDisplayText('Arguments').join(' - ') + ': ' + valueStr, color = dataRow.getColor('Values', 0); //0 - 'layer' index
data.push([{ data: dataRow, text: labelText, color: color }].concat(values));
var labelText = dataRow.getDisplayText('Arguments').join(' - ') + ': ' + valueStr;
data.push([{ data: dataRow, text: labelText, color: color[0] }].concat(values));//0 - 'layer' index for color value
} else {
data = values.map(function (value, index) { return [{ text: bindingValues[index].displayName() + ': ' + valueStr[index], color: dataRow.getColor('Values', index) }, value]; });
data = values.map(function(value, index) { return [{ text: bindingValues[index].displayName() + ': ' + valueStr[index], color: color[index] }, value]; });
}
});
return data.length > 0 ? data : undefined;
Expand Down
2 changes: 1 addition & 1 deletion dist/funnel.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/funnel-d3-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ var funnelD3Item = (function(_base) {
this.iterateData(function(dataRow) {
var values = dataRow.getValue('Values');
var valueStr = dataRow.getDisplayText('Values');
var color = dataRow.getColor('Values');
if(_this._hasArguments()) {
var labelText = dataRow.getDisplayText('Arguments').join(' - ') + ': ' + valueStr, color = dataRow.getColor('Values', 0); //0 - 'layer' index
data.push([{ data: dataRow, text: labelText, color: color }].concat(values));
var labelText = dataRow.getDisplayText('Arguments').join(' - ') + ': ' + valueStr;
data.push([{ data: dataRow, text: labelText, color: color[0] }].concat(values));//0 - 'layer' index for color value
} else {
data = values.map(function (value, index) { return [{ text: bindingValues[index].displayName() + ': ' + valueStr[index], color: dataRow.getColor('Values', index) }, value]; });
data = values.map(function(value, index) { return [{ text: bindingValues[index].displayName() + ': ' + valueStr[index], color: color[index] }, value]; });
}
});
return data.length > 0 ? data : undefined;
Expand Down

0 comments on commit 0544102

Please sign in to comment.