From 7ec17dc0c9c86e18ba11fed6e0b61a2ed8d558ad Mon Sep 17 00:00:00 2001 From: mbucknell <mbucknell@usgs.gov> Date: Thu, 7 May 2020 11:05:01 -0500 Subject: [PATCH] Needed to convert initial time series id to an integer when setting the value. --- assets/src/scripts/components/hydrograph/cursor.js | 1 - assets/src/scripts/components/hydrograph/drawing-data.js | 5 ++++- assets/src/scripts/components/hydrograph/index.js | 7 +++++-- graph-server/src/index.js | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/assets/src/scripts/components/hydrograph/cursor.js b/assets/src/scripts/components/hydrograph/cursor.js index 41f22a6d6..d1b76fb94 100644 --- a/assets/src/scripts/components/hydrograph/cursor.js +++ b/assets/src/scripts/components/hydrograph/cursor.js @@ -1,7 +1,6 @@ import memoize from 'fast-memoize'; import {createSelector} from 'reselect'; -import config from '../../config'; import {getCurrentMethodID} from '../../selectors/time-series-selector'; import {getNearestTime} from '../../utils'; diff --git a/assets/src/scripts/components/hydrograph/drawing-data.js b/assets/src/scripts/components/hydrograph/drawing-data.js index dc5eb23e2..b6026a9f3 100644 --- a/assets/src/scripts/components/hydrograph/drawing-data.js +++ b/assets/src/scripts/components/hydrograph/drawing-data.js @@ -5,7 +5,6 @@ import {DateTime} from 'luxon'; import {createSelector} from 'reselect'; import {format} from 'd3-format'; -import config from '../../config'; import {getCurrentVariableMedianStatistics} from '../../selectors/median-statistics-selector'; import {getVariables, getCurrentMethodID, getTimeSeries, getCurrentVariableTimeSeries, getTimeSeriesForTsKey, getTsRequestKey, getRequestTimeRange} from '../../selectors/time-series-selector'; @@ -279,9 +278,13 @@ export const lineSegmentsSelector = memoize((tsKey, period) => createSelector( pointsByTsKeySelector(tsKey, period), getCurrentMethodID, (tsPoints, currentMethodID) => { + console.log('In lineSegementsSelector current method id is ' + currentMethodID); let seriesLines = {}; Object.keys(tsPoints).forEach((tsId) => { const methodID = tsId.split(':')[0]; + if (tsPoints[tsId].length) { + console.log('Drawing points for methodID ' + methodID); + } const points = tsPoints[tsId]; let lines = []; diff --git a/assets/src/scripts/components/hydrograph/index.js b/assets/src/scripts/components/hydrograph/index.js index 9a81abeff..6985e04d0 100644 --- a/assets/src/scripts/components/hydrograph/index.js +++ b/assets/src/scripts/components/hydrograph/index.js @@ -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 * 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, node, @@ -52,7 +55,7 @@ export const attachToNode = function (store, period, startDT, endDT, - timeSeriesId, + timeSeriesId, // This must be converted to an integer showOnlyGraph = false, showMLName = false } = {}) { @@ -118,7 +121,7 @@ export const attachToNode = function (store, store.dispatch(ivTimeSeriesStateActions.setIVTimeSeriesVisibility('compare', true)); } 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 // Set up rendering functions for the graph-container diff --git a/graph-server/src/index.js b/graph-server/src/index.js index 8b9343bfc..a223552d2 100644 --- a/graph-server/src/index.js +++ b/graph-server/src/index.js @@ -86,7 +86,7 @@ app.use(`${PATH_CONTEXT}/api-docs`, swaggerUi.serve, swaggerUi.setup(swaggerDocu * in: query * description: represents an IV timeSeriesId valid for parameterCode * schema: - * type: string + * type: integer * responses: * 200: * description: PNG image of the IV data for the siteID and parameterCode -- GitLab