Skip to content
Snippets Groups Projects
Commit d7d14d0c authored by Yan, Andrew N.'s avatar Yan, Andrew N.
Browse files

use styling to control whether or not the graph appears

parent 54e65dd1
No related branches found
No related tags found
No related merge requests found
......@@ -289,9 +289,19 @@ const controlLastYearSelect = function(elem, {compareTimeseries}) {
}
};
const controlGraphDisplay = function (elem, {allTimeseries}) {
if (Object.keys(allTimeseries).length === 0) {
elem.attr('style', 'display: none;');
} else {
elem.attr('style', null);
}
};
const timeSeriesGraph = function (elem) {
elem.call(link(controlLastYearSelect, createStructuredSelector({
elem.call(link(controlGraphDisplay, createStructuredSelector({
allTimeseries: allTimeSeriesSelector
}))).call(link(controlLastYearSelect, createStructuredSelector({
compareTimeseries: currentVariableTimeSeriesSelector('compare')
}))).append('div')
.attr('class', 'hydrograph-container')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment