Skip to content
Snippets Groups Projects
Commit 7ec17dc0 authored by Bucknell, Mary S.'s avatar Bucknell, Mary S.
Browse files

Needed to convert initial time series id to an integer when setting the value.

parent ba8f795b
No related branches found
No related tags found
No related merge requests found
import memoize from 'fast-memoize'; import memoize from 'fast-memoize';
import {createSelector} from 'reselect'; import {createSelector} from 'reselect';
import config from '../../config';
import {getCurrentMethodID} from '../../selectors/time-series-selector'; import {getCurrentMethodID} from '../../selectors/time-series-selector';
import {getNearestTime} from '../../utils'; import {getNearestTime} from '../../utils';
......
...@@ -5,7 +5,6 @@ import {DateTime} from 'luxon'; ...@@ -5,7 +5,6 @@ import {DateTime} from 'luxon';
import {createSelector} from 'reselect'; import {createSelector} from 'reselect';
import {format} from 'd3-format'; import {format} from 'd3-format';
import config from '../../config';
import {getCurrentVariableMedianStatistics} from '../../selectors/median-statistics-selector'; import {getCurrentVariableMedianStatistics} from '../../selectors/median-statistics-selector';
import {getVariables, getCurrentMethodID, getTimeSeries, getCurrentVariableTimeSeries, getTimeSeriesForTsKey, import {getVariables, getCurrentMethodID, getTimeSeries, getCurrentVariableTimeSeries, getTimeSeriesForTsKey,
getTsRequestKey, getRequestTimeRange} from '../../selectors/time-series-selector'; getTsRequestKey, getRequestTimeRange} from '../../selectors/time-series-selector';
...@@ -279,9 +278,13 @@ export const lineSegmentsSelector = memoize((tsKey, period) => createSelector( ...@@ -279,9 +278,13 @@ export const lineSegmentsSelector = memoize((tsKey, period) => createSelector(
pointsByTsKeySelector(tsKey, period), pointsByTsKeySelector(tsKey, period),
getCurrentMethodID, getCurrentMethodID,
(tsPoints, currentMethodID) => { (tsPoints, currentMethodID) => {
console.log('In lineSegementsSelector current method id is ' + currentMethodID);
let seriesLines = {}; let seriesLines = {};
Object.keys(tsPoints).forEach((tsId) => { Object.keys(tsPoints).forEach((tsId) => {
const methodID = tsId.split(':')[0]; const methodID = tsId.split(':')[0];
if (tsPoints[tsId].length) {
console.log('Drawing points for methodID ' + methodID);
}
const points = tsPoints[tsId]; const points = tsPoints[tsId];
let lines = []; let lines = [];
......
...@@ -40,6 +40,9 @@ const controlDisplay = function(elem, showElem) { ...@@ -40,6 +40,9 @@ const controlDisplay = function(elem, showElem) {
/* /*
* Renders the hydrograph on the node element using the Redux store for state information. The siteno, latitude, and * Renders the hydrograph on the node element using the Redux store for state information. The siteno, latitude, and
* longitude are required parameters. All others are optional and are used to set the initial state of the hydrograph. * longitude are required parameters. All others are optional and are used to set the initial state of the hydrograph.
* @param {Redux store} store
* @param {DOM node} node
* @param {Object} - string properties to set initial state information. The property siteno is required
*/ */
export const attachToNode = function (store, export const attachToNode = function (store,
node, node,
...@@ -52,7 +55,7 @@ export const attachToNode = function (store, ...@@ -52,7 +55,7 @@ export const attachToNode = function (store,
period, period,
startDT, startDT,
endDT, endDT,
timeSeriesId, timeSeriesId, // This must be converted to an integer
showOnlyGraph = false, showOnlyGraph = false,
showMLName = false showMLName = false
} = {}) { } = {}) {
...@@ -118,7 +121,7 @@ export const attachToNode = function (store, ...@@ -118,7 +121,7 @@ export const attachToNode = function (store,
store.dispatch(ivTimeSeriesStateActions.setIVTimeSeriesVisibility('compare', true)); store.dispatch(ivTimeSeriesStateActions.setIVTimeSeriesVisibility('compare', true));
} }
if (timeSeriesId) { if (timeSeriesId) {
store.dispatch(ivTimeSeriesStateActions.setCurrentIVMethodID(timeSeriesId)); store.dispatch(ivTimeSeriesStateActions.setCurrentIVMethodID(parseInt(timeSeriesId)));
} }
// Initial data has been fetched and initial state set. We can render the hydrograph elements // Initial data has been fetched and initial state set. We can render the hydrograph elements
// Set up rendering functions for the graph-container // Set up rendering functions for the graph-container
......
...@@ -86,7 +86,7 @@ app.use(`${PATH_CONTEXT}/api-docs`, swaggerUi.serve, swaggerUi.setup(swaggerDocu ...@@ -86,7 +86,7 @@ app.use(`${PATH_CONTEXT}/api-docs`, swaggerUi.serve, swaggerUi.setup(swaggerDocu
* in: query * in: query
* description: represents an IV timeSeriesId valid for parameterCode * description: represents an IV timeSeriesId valid for parameterCode
* schema: * schema:
* type: string * type: integer
* responses: * responses:
* 200: * 200:
* description: PNG image of the IV data for the siteID and parameterCode * description: PNG image of the IV data for the siteID and parameterCode
......
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