Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
waterdataui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Water Mission Area
Internet of Water
waterdataui
Commits
961a2631
Commit
961a2631
authored
7 years ago
by
Yan, Andrew N.
Browse files
Options
Downloads
Patches
Plain Diff
hook select plot series table into the layout
parent
c6f062e5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
assets/src/scripts/components/hydrograph/index.js
+2
-1
2 additions, 1 deletion
assets/src/scripts/components/hydrograph/index.js
assets/src/scripts/components/hydrograph/parameters.js
+47
-27
47 additions, 27 deletions
assets/src/scripts/components/hydrograph/parameters.js
with
49 additions
and
28 deletions
assets/src/scripts/components/hydrograph/index.js
+
2
−
1
View file @
961a2631
...
...
@@ -231,7 +231,8 @@ const timeSeriesGraph = function (elem) {
})));
elem
.
call
(
link
(
plotSeriesSelectTable
,
createStructuredSelector
({
availableTimeseries
:
availableTimeseriesSelector
availableTimeseries
:
availableTimeseriesSelector
,
layout
:
layoutSelector
})));
elem
.
append
(
'
div
'
)
...
...
This diff is collapsed.
Click to expand it.
assets/src/scripts/components/hydrograph/parameters.js
+
47
−
27
View file @
961a2631
...
...
@@ -72,10 +72,21 @@ const addSparkLine = function(svgSelection, {tsData}) {
* a row changes the active parameter code.
* @param {Object} elem d3 selection
* @param {Object} availableTimeseries Timeseries metadata to display
* @param {Object} layout layout as retrieved from the redux store
*/
export
const
plotSeriesSelectTable
=
function
(
elem
,
{
availableTimeseries
})
{
export
const
plotSeriesSelectTable
=
function
(
elem
,
{
availableTimeseries
,
layout
})
{
elem
.
select
(
'
#select-timeseries
'
).
remove
();
const
smallScreenWidth
=
481
;
const
screenSizeCheck
=
layout
.
width
<=
smallScreenWidth
;
let
columnHeaders
;
if
(
screenSizeCheck
)
{
columnHeaders
=
[
'
Parameter Code
'
,
'
Description
'
,
'
Graph
'
];
}
else
{
columnHeaders
=
[
'
Parameter Code
'
,
'
Description
'
,
'
Now
'
,
'
Last Year
'
,
'
Median
'
];
}
const
table
=
elem
.
append
(
'
table
'
)
.
attr
(
'
id
'
,
'
select-timeseries
'
)
...
...
@@ -86,7 +97,7 @@ export const plotSeriesSelectTable = function (elem, {availableTimeseries}) {
table
.
append
(
'
thead
'
)
.
append
(
'
tr
'
)
.
selectAll
(
'
th
'
)
.
data
(
[
'
Parameter Code
'
,
'
Description
'
,
'
Graph
'
]
)
.
data
(
columnHeaders
)
.
enter
().
append
(
'
th
'
)
.
attr
(
'
scope
'
,
'
col
'
)
.
text
(
d
=>
d
);
...
...
@@ -112,39 +123,48 @@ export const plotSeriesSelectTable = function (elem, {availableTimeseries}) {
.
attr
(
'
class
'
,
'
tooltip-item
'
);
tr
.
append
(
'
td
'
)
.
text
(
parm
=>
parm
[
1
].
description
);
if
(
!
screenSizeCheck
)
{
tr
.
append
(
'
td
'
)
.
html
(
parm
=>
parm
[
1
].
currentYear
?
'
<i class="fa fa-check" aria-label="Current year data available"></i>
'
:
''
);
tr
.
append
(
'
td
'
)
.
html
(
parm
=>
parm
[
1
].
previousYear
?
'
<i class="fa fa-check" aria-label="Previous year data available"></i>
'
:
''
);
tr
.
append
(
'
td
'
)
.
html
(
parm
=>
parm
[
1
].
medianData
?
'
<i class="fa fa-check" aria-label="Median data available"></i>
'
:
''
);
}
tr
.
append
(
'
td
'
)
.
append
(
'
svg
'
)
.
attr
(
'
width
'
,
sparkLineDim
.
width
.
toString
())
.
attr
(
'
height
'
,
sparkLineDim
.
height
.
toString
());
});
if
(
screenSizeCheck
)
{
table
.
selectAll
(
'
div.tooltip-item
'
).
each
(
function
()
{
let
selection
=
select
(
this
);
selection
.
append
(
'
sup
'
)
.
append
(
'
i
'
)
.
attr
(
'
class
'
,
'
fa fa-info-circle
'
);
let
tooltipContent
=
selection
.
append
(
'
div
'
).
attr
(
'
class
'
,
'
tooltip
'
);
let
tooltipTable
=
tooltipContent
.
append
(
'
table
'
);
tooltipTable
.
append
(
'
caption
'
).
text
(
'
Available Data
'
);
tooltipTable
.
append
(
'
thead
'
)
.
append
(
'
tr
'
)
.
selectAll
(
'
th
'
)
.
data
([
'
Now
'
,
'
Last Year
'
,
'
Median
'
])
.
enter
()
.
append
(
'
th
'
)
.
attr
(
'
scope
'
,
'
col
'
)
.
text
(
d
=>
d
);
table
.
selectAll
(
'
div.tooltip-item
'
).
each
(
function
()
{
let
selection
=
select
(
this
);
selection
.
append
(
'
sup
'
)
.
append
(
'
i
'
)
.
attr
(
'
class
'
,
'
fa fa-info-circle
'
);
let
tooltipContent
=
selection
.
append
(
'
div
'
).
attr
(
'
class
'
,
'
tooltip
'
);
let
tooltipTable
=
tooltipContent
.
append
(
'
table
'
);
tooltipTable
.
append
(
'
caption
'
).
text
(
'
Available Data
'
);
tooltipTable
.
append
(
'
thead
'
)
.
append
(
'
tr
'
)
.
selectAll
(
'
th
'
)
.
data
([
'
Now
'
,
'
Last Year
'
,
'
Median
'
])
.
enter
()
.
append
(
'
th
'
)
.
attr
(
'
scope
'
,
'
col
'
)
.
text
(
d
=>
d
);
let
tableRow
=
tooltipTable
.
append
(
'
tr
'
);
tableRow
.
append
(
'
td
'
)
.
html
(
d
=>
d
[
1
].
currentYear
?
'
<i class="fa fa-check" aria-label="Current year data available"></i>
'
:
''
);
tableRow
.
append
(
'
td
'
)
.
html
(
d
=>
d
[
1
].
previousYear
?
'
<i class="fa fa-check" aria-label="Previous year data available"></i>
'
:
''
);
tableRow
.
append
(
'
td
'
)
.
html
(
d
=>
d
[
1
].
medianData
?
'
<i class="fa fa-check" aria-label="Median data available"></i>
'
:
''
);
let
tableRow
=
tooltipTable
.
append
(
'
tr
'
);
tableRow
.
append
(
'
td
'
)
.
html
(
d
=>
d
[
1
].
currentYear
?
'
<i class="fa fa-check" aria-label="Current year data available"></i>
'
:
''
);
tableRow
.
append
(
'
td
'
)
.
html
(
d
=>
d
[
1
].
previousYear
?
'
<i class="fa fa-check" aria-label="Previous year data available"></i>
'
:
''
);
tableRow
.
append
(
'
td
'
)
.
html
(
d
=>
d
[
1
].
medianData
?
'
<i class="fa fa-check" aria-label="Median data available"></i>
'
:
''
);
});
});
}
table
.
selectAll
(
'
tbody svg
'
).
each
(
function
(
d
)
{
let
selection
=
select
(
this
);
const
parmCd
=
d
[
0
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment