diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/index.js b/assets/src/scripts/monitoring-location/components/hydrograph/index.js index 03ccdee056602b391335847af08786f3c49d2662..941e134b66385364a87ab678276c43e95a65967b 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/index.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/index.js @@ -158,7 +158,7 @@ export const attachToNode = function(store, renderTimeSeriesUrlParams(store); nodeElem.select('#stats-container') .call(link(store, drawStatsTable, createStructuredSelector({ - state: (state) => state, + primaryIVData: (state) => state.hydrographData.primaryIVData, siteno: () => siteno }))); } diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/statistics.js b/assets/src/scripts/monitoring-location/components/hydrograph/statistics.js index af02326d552e0312ad2c9053e5fc7420140fcba1..83fd68b7a8c2d010527b5533548cbeeca649c7db 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/statistics.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/statistics.js @@ -52,9 +52,14 @@ const drawStats = function(elem, currentData, name) { .text(col => col); table.call(drawTableBody, currentData); } - -export const drawStatsTable = function(elem, {state, siteno}) { - var currentParameterCode = getSelectedParameterCode(state); +/* + * Create the hydrograph data daily statistics section + * @param {D3 selection} elem + * @param {Redux store subset} primaryIVData object from the Redux store + * @param {String} siteno + */ +export const drawStatsTable = function(elem, {primaryIVData, siteno}) { + var currentParameterCode = primaryIVData.parameter.parameterCode; fetchSitesStatisticsRDB({siteno, 'statType':'ALL', 'parameterCode': currentParameterCode}).then((result) => { var statsData = parseRDB(result); @@ -77,13 +82,10 @@ export const drawStatsTable = function(elem, {state, siteno}) { } return dayInYear; } - if (!('primaryIVData' in state.hydrographData)) { - return; - } - let currentIVDataValues = state.hydrographData.primaryIVData.values; + let currentIVDataValues = primaryIVData.values; let currentIVDataArray = currentIVDataValues[Object.keys(currentIVDataValues)[0]].points; let latestValue = currentIVDataArray[currentIVDataArray.length-1].value; - let parameterName = state.hydrographData.primaryIVData.parameter.name; + let parameterName = primaryIVData.parameter.name; elem.select('#daily-stats-container').remove(); elem.append('div') .attr('id', 'daily-stats-container') diff --git a/assets/src/styles/monitoring-location.scss b/assets/src/styles/monitoring-location.scss index c45594af0b4c1d9b821e7db5b4ba04beccb8aa55..3c53fbe3ebae33aed96840fa99e37b54de7c56a2 100644 --- a/assets/src/styles/monitoring-location.scss +++ b/assets/src/styles/monitoring-location.scss @@ -123,7 +123,8 @@ body { .wdfn-accordion { - @include uswds.u-margin-top(2); + //Override the default uswds margin for adjacent accordion components + margin-top: 1rem !important; .usa-accordion-content { overflow: visible; }