From cb685d671df219f1dbc4f6098c6dfbe74ceee1da Mon Sep 17 00:00:00 2001 From: mbucknell <mbucknell@usgs.gov> Date: Tue, 17 Nov 2020 16:09:10 -0600 Subject: [PATCH] Updated to relative imports for within directory imports for hydrograph. --- .../components/hydrograph/audible.js | 5 +-- .../components/hydrograph/audible.spec.js | 2 +- .../components/hydrograph/data-table.js | 2 +- .../components/hydrograph/data-table.spec.js | 2 +- .../components/hydrograph/date-controls.js | 3 +- .../hydrograph/date-controls.spec.js | 2 +- .../components/hydrograph/graph-brush.js | 21 +++++++----- .../components/hydrograph/graph-brush.spec.js | 2 +- .../components/hydrograph/graph-controls.js | 4 +-- .../hydrograph/graph-controls.spec.js | 3 +- .../hydrograph/hydrograph-utils.spec.js | 2 +- .../components/hydrograph/index.js | 33 ++++++++++--------- .../components/hydrograph/index.spec.js | 2 +- .../components/hydrograph/legend.js | 4 +-- .../components/hydrograph/legend.spec.js | 2 +- .../components/hydrograph/method-picker.js | 2 +- .../hydrograph/method-picker.spec.js | 2 +- .../components/hydrograph/parameters.js | 4 +-- .../components/hydrograph/parameters.spec.js | 3 +- .../hydrograph/selectors/audible-data.js | 4 +-- .../components/hydrograph/selectors/axes.js | 12 ++++--- .../components/hydrograph/selectors/cursor.js | 6 ++-- .../hydrograph/selectors/cursor.spec.js | 2 +- .../components/hydrograph/selectors/domain.js | 2 +- .../hydrograph/selectors/domain.spec.js | 2 +- .../hydrograph/selectors/drawing-data.spec.js | 2 +- .../components/hydrograph/selectors/layout.js | 4 +-- .../hydrograph/selectors/layout.spec.js | 2 +- .../hydrograph/selectors/legend-data.js | 2 +- .../hydrograph/selectors/legend-data.spec.js | 4 +-- .../selectors/parameter-data.spec.js | 2 +- .../components/hydrograph/selectors/scales.js | 11 ++++--- .../hydrograph/selectors/scales.spec.js | 2 +- .../selectors/time-series-data.spec.js | 2 +- .../hydrograph/time-series-graph.js | 23 +++++++------ .../hydrograph/time-series-graph.spec.js | 2 +- .../hydrograph/time-series-lines.js | 2 +- .../components/hydrograph/tooltip.js | 16 ++++----- .../components/hydrograph/tooltip.spec.js | 3 +- 39 files changed, 109 insertions(+), 96 deletions(-) diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/audible.js b/assets/src/scripts/monitoring-location/components/hydrograph/audible.js index 6f7688661..93845856e 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/audible.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/audible.js @@ -9,10 +9,11 @@ import {createStructuredSelector} from 'reselect'; import config from 'ui/config'; import {link} from 'ui/lib/d3-redux'; + import {Actions} from 'ml/store/instantaneous-value-time-series-state'; -import {isAudiblePlaying, getAudiblePoints} from 'ivhydrograph/selectors/audible-data'; -import {getMainXScale} from 'ivhydrograph/selectors/scales'; +import {isAudiblePlaying, getAudiblePoints} from './selectors/audible-data'; +import {getMainXScale} from './selectors/scales'; // Higher tones get lower volume diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/audible.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/audible.spec.js index 703bb8a0d..e83847fdc 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/audible.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/audible.spec.js @@ -2,7 +2,7 @@ import {select} from 'd3-selection'; import {configureStore} from 'ml/store'; -import {audibleUI} from 'ivhydrograph/audible'; +import {audibleUI} from './audible'; const TEST_STATE = { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/data-table.js b/assets/src/scripts/monitoring-location/components/hydrograph/data-table.js index 8e3410fc2..a31df8835 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/data-table.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/data-table.js @@ -3,7 +3,7 @@ import List from 'list.js'; import {link} from 'ui/lib/d3-redux'; -import {getCurrentPointData} from 'ivhydrograph/selectors/drawing-data'; +import {getCurrentPointData} from './selectors/drawing-data'; const COLUMN_HEADINGS = [ 'Parameter', diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/data-table.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/data-table.spec.js index b546b0594..186d5ed21 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/data-table.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/data-table.spec.js @@ -2,7 +2,7 @@ import {select} from 'd3-selection'; import {configureStore} from 'ml/store'; -import {drawDataTable} from 'ivhydrograph/data-table'; +import {drawDataTable} from './data-table'; const TEST_DATA = { ivTimeSeriesData: { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/date-controls.js b/assets/src/scripts/monitoring-location/components/hydrograph/date-controls.js index df5219435..eaf41ce07 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/date-controls.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/date-controls.js @@ -17,7 +17,8 @@ import { import {getIanaTimeZone} from 'ml/selectors/time-zone-selector'; import {Actions as ivTimeSeriesDataActions} from 'ml/store/instantaneous-value-time-series-data'; import {Actions as ivTimeSeriesStateActions} from 'ml/store/instantaneous-value-time-series-state'; -import {MAX_DIGITS_FOR_DAYS_FROM_TODAY} from 'ivhydrograph/hydrograph-utils'; + +import {MAX_DIGITS_FOR_DAYS_FROM_TODAY} from './hydrograph-utils'; export const drawDateRangeControls = function(elem, store, siteno) { const DATE_RANGE = [{ diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/date-controls.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/date-controls.spec.js index 470eb0f6a..92b2280ff 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/date-controls.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/date-controls.spec.js @@ -3,7 +3,7 @@ import {select} from 'd3-selection'; import {configureStore} from 'ml/store'; import {Actions as ivTimeSeriesDataActions} from 'ml/store/instantaneous-value-time-series-data'; -import {drawDateRangeControls} from 'ivhydrograph/date-controls'; +import {drawDateRangeControls} from './date-controls'; const TEST_STATE = { ivTimeSeriesData: { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/graph-brush.js b/assets/src/scripts/monitoring-location/components/hydrograph/graph-brush.js index e00bb9061..47764b735 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/graph-brush.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/graph-brush.js @@ -1,18 +1,21 @@ import {brushX} from 'd3-brush'; import {createStructuredSelector} from 'reselect'; -import {appendXAxis} from 'd3render//axes'; +import config from 'ui/config'; import {link} from 'ui/lib/d3-redux'; +import {mediaQuery} from 'ui/utils'; + +import {appendXAxis} from 'd3render/axes'; + import {Actions} from 'ml/store/instantaneous-value-time-series-state'; -import {getBrushXAxis} from 'ivhydrograph/selectors/axes'; -import {getCurrentVariableLineSegments} from 'ivhydrograph/selectors/drawing-data'; -import {getBrushLayout} from 'ivhydrograph/selectors/layout'; -import {getBrushXScale, getBrushYScale} from 'ivhydrograph/selectors/scales'; -import {isVisible} from 'ivhydrograph/selectors/time-series-data'; -import {drawDataLines} from 'ivhydrograph/time-series-lines'; -import {mediaQuery} from 'ui/utils'; -import config from 'ui/config'; +import {getBrushXAxis} from './selectors/axes'; +import {getCurrentVariableLineSegments} from './selectors/drawing-data'; +import {getBrushLayout} from './selectors/layout'; +import {getBrushXScale, getBrushYScale} from './selectors/scales'; +import {isVisible} from './selectors/time-series-data'; +import {drawDataLines} from './time-series-lines'; + /* * Renders a brush element within container for the main graph diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/graph-brush.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/graph-brush.spec.js index 81bf98e1f..8f3a500d8 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/graph-brush.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/graph-brush.spec.js @@ -2,7 +2,7 @@ import {select} from 'd3-selection'; import{configureStore} from 'ml/store'; -import {drawGraphBrush} from 'ivhydrograph/graph-brush'; +import {drawGraphBrush} from './graph-brush'; describe ('monitoring-location/components/hydrograph/graph-brush module', () => { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/graph-controls.js b/assets/src/scripts/monitoring-location/components/hydrograph/graph-controls.js index bf097c273..df6593442 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/graph-controls.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/graph-controls.js @@ -5,8 +5,8 @@ import {getCurrentVariableMedianStatistics} from 'ml/selectors/median-statistics import {getCurrentVariableTimeSeries} from 'ml/selectors/time-series-selector'; import {Actions} from 'ml/store/instantaneous-value-time-series-state'; -import {audibleUI} from 'ivhydrograph/audible'; -import {isVisible} from 'ivhydrograph/selectors/time-series-data'; +import {audibleUI} from './audible'; +import {isVisible} from './selectors/time-series-data'; /* * Create the show audible toggle, last year toggle, and median toggle for the time series graph. diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/graph-controls.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/graph-controls.spec.js index 3cc506250..978fb8ead 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/graph-controls.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/graph-controls.spec.js @@ -2,7 +2,8 @@ import {select} from 'd3-selection'; import {configureStore} from 'ml/store'; import {Actions} from 'ml/store/instantaneous-value-time-series-state'; -import {drawGraphControls} from 'ivhydrograph/graph-controls'; + +import {drawGraphControls} from './graph-controls'; // Tests for the graph-controls module describe('monitoring-location/components/hydrograph/graph-controls', () => { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/hydrograph-utils.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/hydrograph-utils.spec.js index e74fc3dde..434319028 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/hydrograph-utils.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/hydrograph-utils.spec.js @@ -1,4 +1,4 @@ -import {isPeriodWithinAcceptableRange, isPeriodCustom, parsePeriodCode} from 'ivhydrograph/hydrograph-utils'; +import {isPeriodWithinAcceptableRange, isPeriodCustom, parsePeriodCode} from './hydrograph-utils'; describe('isPeriodWithinAcceptableRange', () => { it('will return correct boolean value if the url parameters for time period a within an acceptable range', () => { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/index.js b/assets/src/scripts/monitoring-location/components/hydrograph/index.js index 805d64aff..a99f7fc13 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/index.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/index.js @@ -5,9 +5,10 @@ import {select} from 'd3-selection'; import {createStructuredSelector} from 'reselect'; import config from 'ui/config.js'; +import {link} from 'ui/lib/d3-redux'; + import {drawWarningAlert, drawInfoAlert} from 'd3render/alerts'; import {drawLoadingIndicator} from 'd3render/loading-indicator'; -import {link} from 'ui/lib/d3-redux'; import {hasAnyTimeSeries, getCurrentParmCd, getVariables} from 'ml/selectors/time-series-selector'; import {Actions as ivTimeSeriesDataActions} from 'ml/store/instantaneous-value-time-series-data'; @@ -17,20 +18,22 @@ import {Actions as timeZoneActions} from 'ml/store/time-zone'; import {Actions as floodDataActions} from 'ml/store/flood-inundation'; import {renderTimeSeriesUrlParams} from 'ml/url-params'; -import {drawDateRangeControls} from 'ivhydrograph/date-controls'; -import {drawDataTable} from 'ivhydrograph/data-table'; -import {drawGraphBrush} from 'ivhydrograph/graph-brush'; -import {drawGraphControls} from 'ivhydrograph/graph-controls'; -import {SPARK_LINE_DIM} from 'ivhydrograph/selectors/layout'; -import {drawTimeSeriesLegend} from 'ivhydrograph/legend'; -import {drawMethodPicker} from 'ivhydrograph/method-picker'; -import {plotSeriesSelectTable} from 'ivhydrograph/parameters'; -import {getLineSegmentsByParmCd} from 'ivhydrograph/selectors/drawing-data'; -import {getAvailableParameterCodes} from 'ivhydrograph/selectors/parameter-data'; -import {getTimeSeriesScalesByParmCd} from 'ivhydrograph/selectors/scales'; -import {drawTimeSeriesGraph} from 'ivhydrograph/time-series-graph'; -import {drawTooltipCursorSlider} from 'ivhydrograph/tooltip'; -import {isPeriodWithinAcceptableRange, isPeriodCustom} from 'ivhydrograph/hydrograph-utils'; +import {drawDateRangeControls} from './date-controls'; +import {drawDataTable} from './data-table'; +import {drawGraphBrush} from './graph-brush'; +import {drawGraphControls} from './graph-controls'; +import {isPeriodWithinAcceptableRange, isPeriodCustom} from './hydrograph-utils'; + +import {getLineSegmentsByParmCd} from './selectors/drawing-data'; +import {SPARK_LINE_DIM} from './selectors/layout'; +import {getAvailableParameterCodes} from './selectors/parameter-data'; +import {getTimeSeriesScalesByParmCd} from './selectors/scales'; + +import {drawTimeSeriesLegend} from './legend'; +import {drawMethodPicker} from './method-picker'; +import {plotSeriesSelectTable} from './parameters'; +import {drawTimeSeriesGraph} from './time-series-graph'; +import {drawTooltipCursorSlider} from './tooltip'; /** * Modify styling to hide or display the elem. diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/index.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/index.spec.js index 32332966e..2bc87fc69 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/index.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/index.spec.js @@ -6,7 +6,7 @@ import {Actions as statisticsDataActions} from 'ml/store/statistics-data'; import {Actions as timeZoneActions} from 'ml/store/time-zone'; import {Actions as floodDataActions} from 'ml/store/flood-inundation'; -import {attachToNode} from 'ivhydrograph/index'; +import {attachToNode} from './index'; const TEST_STATE = { ivTimeSeriesData: { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/legend.js b/assets/src/scripts/monitoring-location/components/hydrograph/legend.js index eb0157454..23c2b1ead 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/legend.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/legend.js @@ -3,8 +3,8 @@ import {createStructuredSelector} from 'reselect'; import {drawSimpleLegend} from 'd3render//legend'; import {link} from 'ui/lib/d3-redux'; -import {getMainLayout} from 'ivhydrograph/selectors/layout'; -import {getLegendMarkerRows} from 'ivhydrograph/selectors/legend-data'; +import {getMainLayout} from './selectors/layout'; +import {getLegendMarkerRows} from './selectors/legend-data'; export const drawTimeSeriesLegend = function(elem, store) { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/legend.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/legend.spec.js index 18bdcb3dd..2669be873 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/legend.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/legend.spec.js @@ -4,7 +4,7 @@ import {select, selectAll} from 'd3-selection'; import {configureStore} from 'ml/store'; import {Actions} from 'ml/store/instantaneous-value-time-series-state'; -import {drawTimeSeriesLegend} from 'ivhydrograph/legend'; +import {drawTimeSeriesLegend} from './legend'; describe('monitoring-location/components/hydrograph/legend module', () => { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/method-picker.js b/assets/src/scripts/monitoring-location/components/hydrograph/method-picker.js index 48f9bd47f..79582ac9c 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/method-picker.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/method-picker.js @@ -10,7 +10,7 @@ import{link} from 'ui/lib/d3-redux'; import {getCurrentMethodID, getAllMethodsForCurrentVariable} from 'ml/selectors/time-series-selector'; import {Actions} from 'ml/store/instantaneous-value-time-series-state'; -import { } from 'ivhydrograph/selectors/time-series-data'; +import { } from './selectors/time-series-data'; export const drawMethodPicker = function(elem, store) { const pickerContainer = elem.insert('div', ':nth-child(2)') diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/method-picker.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/method-picker.spec.js index e8524900d..da13835c4 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/method-picker.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/method-picker.spec.js @@ -2,7 +2,7 @@ import {select} from 'd3-selection'; import {configureStore} from 'ml/store'; -import {drawMethodPicker} from 'ivhydrograph/method-picker'; +import {drawMethodPicker} from './method-picker'; describe('monitoring-location/components/hydrograph/method-picker', () => { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/parameters.js b/assets/src/scripts/monitoring-location/components/hydrograph/parameters.js index 396668cfd..f951de61c 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/parameters.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/parameters.js @@ -7,8 +7,8 @@ import {appendTooltip} from 'd3render/tooltips'; import {Actions} from 'ml/store/instantaneous-value-time-series-data'; -import {MASK_DESC} from 'ivhydrograph/selectors/drawing-data'; -import {SPARK_LINE_DIM, CIRCLE_RADIUS_SINGLE_PT} from 'ivhydrograph/selectors/layout'; +import {MASK_DESC} from './selectors/drawing-data'; +import {SPARK_LINE_DIM, CIRCLE_RADIUS_SINGLE_PT} from './selectors/layout'; /** * Draw a sparkline in a selected SVG element diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/parameters.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/parameters.spec.js index 872cb2551..59e8d42a5 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/parameters.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/parameters.spec.js @@ -3,8 +3,7 @@ import {select} from 'd3-selection'; import {configureStore} from 'ml/store'; -import {addSparkLine, plotSeriesSelectTable} from 'ivhydrograph/parameters'; - +import {addSparkLine, plotSeriesSelectTable} from './parameters'; describe('monitoring-location/components/hydrograph/parameters module', () => { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/audible-data.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/audible-data.js index 1a41b4197..952cc36d1 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/audible-data.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/audible-data.js @@ -8,8 +8,8 @@ import {createSelector} from 'reselect'; import {getTimeSeries} from 'ml/selectors/time-series-selector'; -import {getTsCursorPoints} from 'ivhydrograph/selectors/cursor'; -import {getMainYScale} from 'ivhydrograph/selectors/scales'; +import {getTsCursorPoints} from './cursor'; +import {getMainYScale} from './scales'; /* * Returns a Redux selector function that returns true if the audible interface is playing. diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/axes.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/axes.js index 272cd82a6..4a1bc2ae5 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/axes.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/axes.js @@ -2,14 +2,16 @@ import {axisBottom, axisLeft, axisRight} from 'd3-axis'; import memoize from 'fast-memoize'; import {createSelector} from 'reselect'; +import {convertCelsiusToFahrenheit, convertFahrenheitToCelsius} from 'ui/utils'; + import {generateTimeTicks} from 'd3render/tick-marks'; + import {getCurrentDateRange, getCurrentParmCd} from 'ml/selectors/time-series-selector'; -import {convertCelsiusToFahrenheit, convertFahrenheitToCelsius} from 'ui/utils'; -import {getYTickDetails} from 'ivhydrograph/selectors/domain'; -import {getLayout} from 'ivhydrograph/selectors/layout'; -import {getXScale, getBrushXScale, getYScale, getSecondaryYScale} from 'ivhydrograph/selectors/scales'; -import {getYLabel, getSecondaryYLabel, getTsTimeZone, TEMPERATURE_PARAMETERS} from 'ivhydrograph/selectors/time-series-data'; +import {getYTickDetails} from './domain'; +import {getLayout} from './layout'; +import {getXScale, getBrushXScale, getYScale, getSecondaryYScale} from './scales'; +import {getYLabel, getSecondaryYLabel, getTsTimeZone, TEMPERATURE_PARAMETERS} from './time-series-data'; const createXAxis = function(xScale, ianaTimeZone) { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/cursor.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/cursor.js index 7931aaf50..12dff7632 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/cursor.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/cursor.js @@ -5,9 +5,9 @@ import {getNearestTime} from 'ui/utils'; import {getCurrentMethodID} from 'ml/selectors/time-series-selector'; -import {getCurrentVariablePointsByTsId} from 'ivhydrograph/selectors/drawing-data'; -import {getMainXScale, getMainYScale} from 'ivhydrograph/selectors/scales'; -import {isVisible} from 'ivhydrograph/selectors/time-series-data'; +import {getCurrentVariablePointsByTsId} from './drawing-data'; +import {getMainXScale, getMainYScale} from './scales'; +import {isVisible} from './time-series-data'; export const getCursorOffset = createSelector( diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/cursor.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/cursor.spec.js index 1889b3f35..04d8ca5a9 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/cursor.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/cursor.spec.js @@ -1,7 +1,7 @@ import {configureStore} from 'ml/store'; import {Actions} from 'ml/store/instantaneous-value-time-series-state'; -import {getTsCursorPoints, getCursorOffset, getTooltipPoints} from 'ivhydrograph/selectors/cursor'; +import {getTsCursorPoints, getCursorOffset, getTooltipPoints} from './cursor'; let DATA = [12, 13, 14, 15, 16].map(hour => { return { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/domain.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/domain.js index 636c1e917..463bca90c 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/domain.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/domain.js @@ -6,7 +6,7 @@ import config from 'ui/config'; import {mediaQuery} from 'ui/utils'; import {getCurrentParmCd} from 'ml/selectors/time-series-selector'; -import {getVisiblePoints} from 'ivhydrograph/selectors/drawing-data'; +import {getVisiblePoints} from './drawing-data'; const PADDING_RATIO = 0.2; diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/domain.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/domain.spec.js index 64130b313..623a7e83d 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/domain.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/domain.spec.js @@ -6,7 +6,7 @@ import { getLowestAbsoluteValueOfTickValues, getRoundedTickValues, generateNegativeTicks -} from 'ivhydrograph/selectors/domain'; +} from './domain'; describe('monitoring-location/components/hydrograph/selectors/domain module', () => { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/drawing-data.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/drawing-data.spec.js index 46de3b579..77452fc6d 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/drawing-data.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/drawing-data.spec.js @@ -14,7 +14,7 @@ import { getCurrentVariableMedianStatPoints, MAX_LINE_POINT_GAP, getCurrentPointData -} from 'ivhydrograph/selectors/drawing-data'; +} from './drawing-data'; const TEST_DATA = { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/layout.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/layout.js index 5fe68035c..5f747983d 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/layout.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/layout.js @@ -9,8 +9,8 @@ import {mediaQuery} from 'ui/utils'; import {getCurrentParmCd} from 'ml/selectors/time-series-selector'; -import {getYTickDetails} from 'ivhydrograph/selectors/domain'; -import {TEMPERATURE_PARAMETERS} from 'ivhydrograph/selectors/time-series-data'; +import {getYTickDetails} from './domain'; +import {TEMPERATURE_PARAMETERS} from './time-series-data'; export const ASPECT_RATIO = 1 / 2; diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/layout.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/layout.spec.js index 7b2b0f3f6..5ec98c1b2 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/layout.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/layout.spec.js @@ -1,6 +1,6 @@ import {format} from 'd3-format'; -import {getMainLayout, ASPECT_RATIO} from 'ivhydrograph/selectors/layout'; +import {getMainLayout, ASPECT_RATIO} from './layout'; describe('monitoring-location/components/hydrograph/layout module', () => { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/legend-data.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/legend-data.js index f5deab55c..afb011280 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/legend-data.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/legend-data.js @@ -6,7 +6,7 @@ import {defineLineMarker, defineRectangleMarker, defineTextOnlyMarker} from 'd3r import {getWaterwatchFloodLevels, isWaterwatchVisible} from 'ml/selectors/flood-data-selector'; import {getCurrentVariableMedianMetadata} from 'ml/selectors/median-statistics-selector'; -import {getCurrentVariableLineSegments, HASH_ID, MASK_DESC} from 'ivhydrograph/selectors/drawing-data'; +import {getCurrentVariableLineSegments, HASH_ID, MASK_DESC} from './drawing-data'; const TS_LABEL = { 'current': 'Current: ', diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/legend-data.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/legend-data.spec.js index 3a3a6f9c6..a5fab7b7d 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/legend-data.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/legend-data.spec.js @@ -1,6 +1,6 @@ -import {lineMarker, rectangleMarker, textOnlyMarker} from 'd3render//markers'; +import {lineMarker, rectangleMarker, textOnlyMarker} from 'd3render/markers'; -import {getLegendMarkerRows} from 'ivhydrograph/selectors/legend-data'; +import {getLegendMarkerRows} from './legend-data'; describe('monitoring-location/components/hydrograph/selectors/legend-data', () => { const TEST_DATA = { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/parameter-data.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/parameter-data.spec.js index 3300e9ee1..1ecc8e8e8 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/parameter-data.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/parameter-data.spec.js @@ -1,5 +1,5 @@ -import {getAvailableParameterCodes} from 'ivhydrograph/selectors/parameter-data'; +import {getAvailableParameterCodes} from './parameter-data'; describe('monitoring-location/components/hydrograph/selectors/parameter-data', () => { describe('getAvailableParameterCodes', () => { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/scales.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/scales.js index da246d230..01a06d554 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/scales.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/scales.js @@ -2,13 +2,14 @@ import {scaleLinear, scaleSymlog} from 'd3-scale'; import memoize from 'fast-memoize'; import {createSelector} from 'reselect'; -import {getVariables, getCurrentParmCd, getRequestTimeRange, getTimeSeriesForTsKey} from 'ml/selectors/time-series-selector'; import {convertCelsiusToFahrenheit, convertFahrenheitToCelsius} from 'ui/utils'; -import {getYDomain, getYDomainForVisiblePoints, SYMLOG_PARMS} from 'ivhydrograph/selectors/domain'; -import {getPointsByTsKey} from 'ivhydrograph/selectors/drawing-data'; -import {getLayout} from 'ivhydrograph/selectors/layout'; -import {TEMPERATURE_PARAMETERS} from 'ivhydrograph/selectors/time-series-data'; +import {getVariables, getCurrentParmCd, getRequestTimeRange, getTimeSeriesForTsKey} from 'ml/selectors/time-series-selector'; + +import {getYDomain, getYDomainForVisiblePoints, SYMLOG_PARMS} from './domain'; +import {getPointsByTsKey} from './drawing-data'; +import {getLayout} from './layout'; +import {TEMPERATURE_PARAMETERS} from ',/time-series-data'; const REVERSE_AXIS_PARMS = [ '72019', diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/scales.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/scales.spec.js index aa6d88a9f..71a077835 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/scales.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/scales.spec.js @@ -1,7 +1,7 @@ import {extent} from 'd3-array'; import {DateTime} from 'luxon'; -import {createXScale, createYScale, getMainYScale, getBrushYScale, getSecondaryYScale} from 'ivhydrograph/selectors/scales'; +import {createXScale, createYScale, getMainYScale, getBrushYScale, getSecondaryYScale} from './scales'; describe('monitoring-location/components/hydrograph/scales', () => { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.spec.js index edf232b2c..dd7a6d29d 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.spec.js @@ -1,6 +1,6 @@ import { isVisible, getYLabel, getTitle, - getDescription, getTsTimeZone, getSecondaryYLabel} from 'ivhydrograph/selectors/time-series-data'; + getDescription, getTsTimeZone, getSecondaryYLabel} from './time-series-data'; const TEST_DATA = { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/time-series-graph.js b/assets/src/scripts/monitoring-location/components/hydrograph/time-series-graph.js index 29e1a6531..62f72f316 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/time-series-graph.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/time-series-graph.js @@ -2,26 +2,29 @@ import {line as d3Line, curveStepAfter} from 'd3-shape'; import {createStructuredSelector} from 'reselect'; import config from 'ui/config'; +import {link} from 'ui/lib/d3-redux'; +import {mediaQuery} from 'ui/utils'; + import {addSVGAccessibility} from 'd3render/accessibility'; import {appendAxes} from 'd3render/axes'; import {renderMaskDefs} from 'd3render/data-masks'; -import {link} from 'ui/lib/d3-redux'; -import {mediaQuery} from 'ui/utils'; + import {getAgencyCode, getMonitoringLocationName} from 'ml/selectors/time-series-selector'; import {isWaterwatchVisible, getWaterwatchFloodLevels} from 'ml/selectors/flood-data-selector'; -import {getAxes} from 'ivhydrograph/selectors/axes'; +import {getAxes} from './selectors/axes'; import { getCurrentVariableLineSegments, getCurrentVariableMedianStatPoints, HASH_ID -} from 'ivhydrograph/selectors/drawing-data'; -import {getMainLayout} from 'ivhydrograph/selectors/layout'; -import {getMainXScale, getMainYScale, getBrushXScale} from 'ivhydrograph/selectors/scales'; -import {getDescription, isVisible, getTitle} from 'ivhydrograph/selectors/time-series-data'; -import {drawDataLines} from 'ivhydrograph/time-series-lines'; -import {drawTooltipFocus, drawTooltipText} from 'ivhydrograph/tooltip'; +} from './selectors/drawing-data'; +import {getMainLayout} from './selectors/layout'; +import {getMainXScale, getMainYScale, getBrushXScale} from './selectors/scales'; +import {getDescription, isVisible, getTitle} from './selectors/time-series-data'; + +import {drawDataLines} from './time-series-lines'; +import {drawTooltipFocus, drawTooltipText} from './tooltip'; const addDefsPatterns = function(elem) { const patterns = [{ @@ -100,7 +103,7 @@ const plotFloodLevelPoints = function(elem, {xscale, yscale, points, classes}) { .x(function(_,i) { return xscale(xscale.domain()[i]); }) - .y(function (d) { + .y(function(d) { return yscale(d); }); const floodLevelGrp = elem.append('g'); diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/time-series-graph.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/time-series-graph.spec.js index f1b52f559..7a24fc590 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/time-series-graph.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/time-series-graph.spec.js @@ -3,7 +3,7 @@ import {select, selectAll} from 'd3-selection'; import {configureStore} from 'ml/store'; import {Actions} from 'ml/store/instantaneous-value-time-series-state'; -import {drawTimeSeriesGraph} from 'ivhydrograph/time-series-graph'; +import {drawTimeSeriesGraph} from './time-series-graph'; const TEST_STATE = { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/time-series-lines.js b/assets/src/scripts/monitoring-location/components/hydrograph/time-series-lines.js index 239cc6465..2204404a1 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/time-series-lines.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/time-series-lines.js @@ -1,7 +1,7 @@ import {extent} from 'd3-array'; import {line as d3Line} from 'd3-shape'; -import {HASH_ID, MASK_DESC} from 'ivhydrograph/selectors/drawing-data'; +import {HASH_ID, MASK_DESC} from './selectors/drawing-data'; const CIRCLE_RADIUS_SINGLE_PT = 1; /* diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/tooltip.js b/assets/src/scripts/monitoring-location/components/hydrograph/tooltip.js index 7d8d9cabf..e82e963b0 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/tooltip.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/tooltip.js @@ -4,20 +4,20 @@ import {DateTime} from 'luxon'; import {createSelector, createStructuredSelector} from 'reselect'; import config from 'ui/config'; -import {drawCursorSlider} from 'd3render/cursor-slider'; -import {drawFocusOverlay, drawFocusCircles, drawFocusLine} from 'd3render/graph-tooltip'; import {link} from 'ui/lib/d3-redux'; import {mediaQuery, convertCelsiusToFahrenheit, convertFahrenheitToCelsius} from 'ui/utils'; +import {drawCursorSlider} from 'd3render/cursor-slider'; +import {drawFocusOverlay, drawFocusCircles, drawFocusLine} from 'd3render/graph-tooltip'; + import {getCurrentParmCd} from 'ml/selectors/time-series-selector'; import {Actions} from 'ml/store/instantaneous-value-time-series-state'; -import {getCursorTime, getTsCursorPoints, getTooltipPoints} from 'ivhydrograph/selectors/cursor'; -import {classesForPoint, MASK_DESC} from 'ivhydrograph/selectors/drawing-data'; -import {getMainLayout} from 'ivhydrograph/selectors/layout'; -import {getMainXScale, getMainYScale} from 'ivhydrograph/selectors/scales'; -import {getTsTimeZone, getQualifiers, getCurrentVariableUnitCode, TEMPERATURE_PARAMETERS} from 'ivhydrograph/selectors/time-series-data'; - +import {getCursorTime, getTsCursorPoints, getTooltipPoints} from './selectors/cursor'; +import {classesForPoint, MASK_DESC} from './selectors/drawing-data'; +import {getMainLayout} from './selectors/layout'; +import {getMainXScale, getMainYScale} from './selectors/scales'; +import {getTsTimeZone, getQualifiers, getCurrentVariableUnitCode, TEMPERATURE_PARAMETERS} from './selectors/time-series-data'; const getTooltipText = function(datum, qualifiers, unitCode, ianaTimeZone, currentParmCd) { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/tooltip.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/tooltip.spec.js index 66db37028..9c2f1cc2b 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/tooltip.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/tooltip.spec.js @@ -3,8 +3,7 @@ import {select} from 'd3-selection'; import {configureStore} from 'ml/store'; import {Actions} from 'ml/store/instantaneous-value-time-series-state'; -import {drawTooltipText, drawTooltipFocus, drawTooltipCursorSlider} from 'ivhydrograph/tooltip'; - +import {drawTooltipText, drawTooltipFocus, drawTooltipCursorSlider} from './tooltip'; describe('monitoring-location/components/hydrograph/tooltip module', () => { -- GitLab