From e9a5b52d1815e44fada36e046140a2c14ad16ab9 Mon Sep 17 00:00:00 2001
From: mbucknell <mbucknell@usgs.gov>
Date: Tue, 17 Dec 2019 15:21:42 -0600
Subject: [PATCH] Fixed issue where masked data was not showing in the image
 server

---
 assets/src/scripts/components/hydrograph/index.js | 9 +++++++--
 graph-server/src/renderer/index.js                | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/assets/src/scripts/components/hydrograph/index.js b/assets/src/scripts/components/hydrograph/index.js
index 63bf9c358..24b499981 100644
--- a/assets/src/scripts/components/hydrograph/index.js
+++ b/assets/src/scripts/components/hydrograph/index.js
@@ -52,6 +52,8 @@ const plotDataLine = function(elem, {visible, lines, tsKey, xScale, yScale}) {
         return;
     }
 
+    const tsKeyClass = `ts-${tsKey}`
+
     for (let line of lines) {
         if (line.classes.dataMask === null) {
             // If this is a single point line, then represent it as a circle.
@@ -63,6 +65,7 @@ const plotDataLine = function(elem, {visible, lines, tsKey, xScale, yScale}) {
                     .classed('approved', line.classes.approved)
                     .classed('estimated', line.classes.estimated)
                     .classed('not-current-method', !line.classes.currentMethod)
+                    .classed(tsKeyClass, true)
                     .attr('r', CIRCLE_RADIUS_SINGLE_PT)
                     .attr('cx', d => xScale(d.dateTime))
                     .attr('cy', d => yScale(d.value));
@@ -94,7 +97,9 @@ const plotDataLine = function(elem, {visible, lines, tsKey, xScale, yScale}) {
                 .attr('y', yScale(yRangeEnd))
                 .attr('width', rectWidth)
                 .attr('height', Math.abs(yScale(yRangeEnd) - yScale(yRangeStart)))
-                .attr('class', `mask ${maskDisplayName}-mask`);
+                .attr('class', `mask ${maskDisplayName}-mask`)
+                .classed(`ts-${tsKey}`, true);
+
 
             const patternId = HASH_ID[tsKey] ? `url(#${HASH_ID[tsKey]})` : '';
 
@@ -502,7 +507,7 @@ const noDataAlert = function(elem, tsCollectionIds) {
 };
 
 export const attachToNode =
-    function (store, node, {siteno, parameter, compare, period = 'P20M', cursorOffset, showOnlyGraph = false} = {}) {
+    function (store, node, {siteno, parameter, compare, period, cursorOffset, showOnlyGraph = false} = {}) {
     if (!siteno) {
         select(node).call(drawMessage, 'No data is available.');
         return;
diff --git a/graph-server/src/renderer/index.js b/graph-server/src/renderer/index.js
index 101242aff..8c9c1ae55 100644
--- a/graph-server/src/renderer/index.js
+++ b/graph-server/src/renderer/index.js
@@ -12,7 +12,7 @@ const renderToRespone = function (res, {siteID, parameterCode, compare, period})
         compare: compare,
         period: period,
         cursorOffset: false,
-        interactive: false
+        showOnlyGraph : true
     };
     renderPNG({
         pageURL: 'http://wdfn-graph-server',
-- 
GitLab