Simplify if block

pull/740/head
Andrew Watkins 2017-01-10 10:47:53 -08:00
parent 86835125b3
commit 3e476352fe
1 changed files with 8 additions and 10 deletions

View File

@ -101,17 +101,15 @@ export default function timeSeriesToDygraph(raw = [], activeQueryIndex, isInData
const {light, heavy} = STROKE_WIDTH;
// only want to set multiple axes for precanned dashboards
if (isInDataExplorer) {
dygraphSeries[effectiveFieldName] = {
strokeWidth: queryIndex === activeQueryIndex ? heavy : light,
};
} else {
dygraphSeries[effectiveFieldName] = {
axis: queryIndex === 0 ? 'y' : 'y2',
strokeWidth: queryIndex === activeQueryIndex ? heavy : light,
};
const dygraphSeriesStyles = {
strokeWidth: queryIndex === activeQueryIndex ? heavy : light,
};
if (!isInDataExplorer) {
dygraphSeriesStyles.axis = queryIndex === 0 ? 'y' : 'y2';
}
dygraphSeries[effectiveFieldName] = dygraphSeriesStyles;
});
(series.values || []).forEach(parseRow);