(function () {
var feature = {"geometry": {"type": "Point", "coordinates": [-81.2134708, 38.13774032]}, "_id": "3a16205e5e1010810f4bd35a3da89c59", "type": "Feature", "properties": {"metrics": {"gage_height": [{"timestamp": "2026-10-25T03:45:00.000-04:00", "value": 3.29}, {"timestamp": "2026-10-26T04:00:00.000-04:00", "value": 3.18}, {"timestamp": "2026-10-27T03:45:00.000-04:00", "value": 3.13}, {"timestamp": "2026-10-28T03:45:00.000-04:00", "value": 3.11}, {"timestamp": "2026-10-29T04:00:00.000-04:00", "value": 3.03}, {"timestamp": "2026-10-30T03:45:00.000-04:00", "value": 4.4}, {"timestamp": "2026-10-31T03:45:00.000-04:00", "value": 4.31}, {"timestamp": "2026-11-01T03:00:00.000-05:00", "value": 2.85}, {"timestamp": "2026-11-02T03:00:00.000-05:00", "value": 2.8}, {"timestamp": "2026-11-03T02:45:00.000-05:00", "value": 3.36}], "streamflow": [{"timestamp": "2026-11-02T03:00:00.000-05:00", "value": 2900}, {"timestamp": "2026-11-03T02:45:00.000-05:00", "value": 4150}], "elevation": 622, "huc": [{"code": "h05050006", "type": "hydrologic unit", "name": "Upper Kanawha"}, {"code": "h050500", "type": "hydrologic accounting unit", "name": "Kanawha"}, {"code": "h0505", "type": "hydrologic subregion", "name": "Kanawha"}, {"code": "h05", "type": "hydrologic region", "name": "Ohio"}], "water_temp": [{"timestamp": "2026-10-25T03:45:00.000-04:00", "value": 15.3}, {"timestamp": "2026-10-26T04:00:00.000-04:00", "value": 15}, {"timestamp": "2026-10-27T03:45:00.000-04:00", "value": 14.8}, {"timestamp": "2026-10-28T03:45:00.000-04:00", "value": 14.7}, {"timestamp": "2026-10-29T04:00:00.000-04:00", "value": 14.6}, {"timestamp": "2026-10-30T03:45:00.000-04:00", "value": 15.4}, {"timestamp": "2026-10-31T03:45:00.000-04:00", "value": 15.4}, {"timestamp": "2026-11-01T03:00:00.000-05:00", "value": 15.2}, {"timestamp": "2026-11-02T03:00:00.000-05:00", "value": 15.3}, {"timestamp": "2026-11-03T02:45:00.000-05:00", "value": 15.4}], "max": 111000, "average": 12514.616083598365, "min": 1230, "primary": "streamflow", "forecast": {"hourly": {"24": null, "120": null, "72": null}, "discussion": "", "last": "2026-11-03", "daily": [{"details": "Mostly clear, with a low around 49. Southeast wind around 8 mph. ", "summary": "Mostly Clear", "day": "Today", "temp": "49", "icon": "https://forecast.weather.gov/newimages/medium/nfew.png"}, {"details": "Sunny, with a high near 73. Southeast wind around 6 mph. ", "summary": "Sunny", "day": "Tuesday", "temp": "73", "icon": "https://forecast.weather.gov/newimages/medium/few.png"}, {"details": "A chance of rain before 2pm, then a chance of rain after 5pm. Partly sunny, with a high near 71. South wind 11 to 15 mph, with gusts as high as 25 mph. Chance of precipitation is 40%.", "summary": "Mostly Sunny then Chance Rain", "day": "Wednesday", "temp": "71", "icon": "https://forecast.weather.gov/DualImage.php?i=sct&j=ra&jp=40"}, {"details": "A 40 percent chance of rain, mainly before 1pm. Mostly cloudy, with a high near 69.", "summary": "Chance Rain", "day": "Thursday", "temp": "69", "icon": "https://forecast.weather.gov/newimages/medium/ra40.png"}, {"details": "A 40 percent chance of rain. Partly sunny, with a high near 67.", "summary": "Chance Rain", "day": "Friday", "temp": "67", "icon": "https://forecast.weather.gov/newimages/medium/ra40.png"}, {"details": "Partly sunny, with a high near 58.", "summary": "Partly Sunny", "day": "Saturday", "temp": "58", "icon": "https://forecast.weather.gov/newimages/medium/bkn.png"}], "discussion_loc": "RLX"}, "std_dev": 13456.110045781405}, "state": "WV", "site_id": "03193000", "title": "KANAWHA RIVER AT KANAWHA FALLS, WV"}};
var data = feature.properties.metrics;
var label_size = "18px";
if ("comparison" == "conditions"){
var instant_data = [];
var mycol = instant_data;
var col_data = []
for (var x = 1; x < mycol.length; x++){
col_data.push([Date.parse(mycol[x][0]), parseFloat(mycol[x][1]) ])
}
$('#snoflo_chart').highcharts({
exporting: {
enabled: true
},
exporting: {
buttons: {
contextButton: {
symbol: 'menu',
symbolStrokeWidth: 1,
symbolFill: '#a4edba',
symbolStroke: '#330033'
}
},
enabled: true,
chartOptions:{
subtitle: {
text:'KANAWHA RIVER AT KANAWHA FALLS, WV | USGS 03193000'
},
credits: {
text:'Provided by snoflo.org',
text:'Provided by snoflo.org',
href: 'http://snoflo.org',
style: {
fontSize:'12px',
color: '#1779ba',
},
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
borderRadius: 5,
backgroundColor: 'rgba(252, 255, 197, 0.7)',
borderWidth: 1,
borderColor: '#AAA',
y: -6
},
}
},
}
},
global: {
timezoneOffset: -280
},
title: {
text: 'Seasonal Comparison | Kanawha River At Kanawha Falls',
style: {
fontSize:'18px',
fontWeight: 'bold',
},
},
subtitle: {
style: {
fontSize:'16px',
fontWeight: 'bold',
},
text: 'Streamflow',
},
xAxis: {
crosshair: true,
type: 'datetime',
dateTimeLabelFormats: {
day: '%b %e'
}
},
yAxis: {
title: {
style: {
fontSize:'16px',
fontWeight: 'bold',
},
text: 'Streamflow (cfs)',
}
},
legend: {
enabled: true
},
plotOptions: {
areaspline:{
fillColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, '#1779ba'],
[1, 'white'],
]
},
marker: {
radius: 0
},
lineWidth: 2,
states: {
hover: {
lineWidth: 3
}
},
threshold: null
}
},
credits: {
text:'Provided by snoflo.org',
href: 'http://snoflo.org',
style: {
fontSize:'12px',
color: '#1779ba',
},
},
series: [{
color: '#1779ba',
name: 'Streamflow',
type: 'areaspline',
data: col_data
}]
});
}
if ("comparison" == "history"){
try{
if (data.snow_report.length > 90){
var historical_days = 90;
} else {
var historical_days = 0;
}
var high_series = [{
name: 'Snowpack',
type: 'areaspline',
yAxis: 1,
lineWidth: 2,
data: [],
tooltip: {
valueSuffix: '"'
},
color: Highcharts.getOptions().colors[0],
marker: {
enabled: false,
states: {
hover: {
enabled: true
}
}
},
zIndex: 3,
}, {
name: 'Recent Snowfall',
type: 'column',
yAxis: 1,
data: [],
tooltip: {
valueSuffix: '"'
},
zIndex: 3,
color: Highcharts.getOptions().colors[0]
},{
name: 'Snow Water Equivalent',
type: 'spline',
yAxis: 2,
data: [],
tooltip: {
valueSuffix: '%'
},
zIndex: 1,
lineWidth: 2,
marker: {
enabled: false,
states: {
hover: {
enabled: true
}
}
},
color: Highcharts.getOptions().colors[5]
}, {
name: 'Temperature',
type: 'spline',
dashStyle: 'shortdot',
yAxis: 0,
data: [],
tooltip: {
valueSuffix: ' °F'
},
lineWidth: 2,
marker: {
enabled: false,
states: {
hover: {
enabled: true
}
}
},
zIndex: 2,
color: Highcharts.getOptions().colors[3]
}]
var high_dates = []
for (var x = data.snow_report.length - 90; x < data.snow_report.length; x++){
var current_snowfall = data.snow_report[x].snowfall;
if (current_snowfall < 0){
current_snowfall = 0;
}
var current_base = data.snow_report[x].base;
var current_swe = data.snow_report[x].swe;
try{
var formula = ((parseFloat(current_swe) / parseFloat(current_base)) * 100).toFixed(2);
current_swe = formula;
} catch(err){
current_swe = 0
}
var current_at = Math.round(data.snow_report[x].air_temp);
var current_date = Date.parse(data.snow_report[x].date);
if (parseFloat(current_swe) <= 100 && parseFloat(current_snowfall) >= 0 && parseFloat(current_snowfall) < 30 && current_date && parseFloat(current_base) > 0 && parseFloat(current_at) >= 0 && parseFloat(current_swe) >= 0 ){
high_series[0].data.push([current_date, parseFloat(current_base)])
high_series[1].data.push([current_date, parseFloat(current_snowfall)])
high_series[2].data.push([current_date, parseFloat(current_swe)])
high_series[3].data.push([current_date, parseFloat(current_at)])
high_dates.push(current_date)
}
}
var snow_history = $('#snoflo_chart').highcharts({
exporting: {
buttons: {
contextButton: {
symbol: 'menu',
symbolStrokeWidth: 1,
symbolFill: '#a4edba',
symbolStroke: '#330033'
}
},
enabled: true,
chartOptions:{
subtitle: {
text:'KANAWHA RIVER AT KANAWHA FALLS, WV | USGS 03193000'
},
credits: {
text:'provided by snoflo.org',
text:'Provided by snoflo.org',
href: 'http://snoflo.org',
style: {
fontSize:'12px',
color: '#1779ba',
},
},
rangeSelector: {
enabled: false,
},
}
},
chart: {
zoomType: 'x',
events: {
load: function() {
// this.renderer.image('http://snoflo.org/static/images/logo_snoflo_hydroanalytics.png', 80, 70, 40, 40)
// .add();
}
},
},
rangeSelector: {
allButtonsEnabled: true,
selected: 0,
enabled: true,
},
title: {
text: "Seasonal Comparison | Kanawha River At Kanawha Falls",
align: 'center',
style: {
color: '',
}
},
subtitle: {
align: 'left',
style: {
color: 'lightgrey',
},
text: ''
},
global: {
useUTC: false
},
credits: {
text: '',
//href: 'http://snoflo.org',
href: 'http://snoflo.org',
text:'Provided by snoflo.org',
href: 'http://snoflo.org',
style: {
fontSize:'12px',
color: '#1779ba',
},
},
xAxis: [{
crosshair: true,
type: 'datetime',
labels: {
enabled: true,
style: {fontSize: "14px",
color: 'grey',
weight: 'bold',},
},
dateTimeLabelFormats: {
day: '%b %e'
}
//categories: high_dates
}],
plotOptions: {
areaspline: {
fillColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, Highcharts.getOptions().colors[0]],
[1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
]
},
marker: {
radius: 2
},
lineWidth: 1,
states: {
hover: {
lineWidth: 1
}
},
threshold: null
}
},
yAxis: [{ // Primary yAxis
labels: {
format: '{value}°F',
style: {
color: Highcharts.getOptions().colors[3]
}
},
title: {
text: '',
style: {
fontSize: label_size,
color: 'grey',
weight: 'bold',
color: Highcharts.getOptions().colors[3]
}
},
opposite: true
}, { // Secondary yAxis
gridLineWidth: 0,
title: {
text: 'Flow',
style: {
fontSize: label_size,
color: 'grey',
weight: 'bold',
color: Highcharts.getOptions().colors[0]
}
},
labels: {
format: '{value} "',
style: {
color: Highcharts.getOptions().colors[0]
}
}
}, { // Tertiary yAxis
gridLineWidth: 0,
title: {
text: '',
style: {
fontSize: label_size,
color: 'grey',
weight: 'bold',
color: Highcharts.getOptions().colors[5]
}
},
labels: {
format: '{value}% swe',
style: {
color: Highcharts.getOptions().colors[5]
}
},
opposite: true
}],
tooltip: {
shared: true
},
legend: {
enabled: true,
},
series: high_series,
});
var d = new Date();
} catch (err){
var historical_days = 0;
var high_series = [{
name: 'Streamflow',
type: 'areaspline',
yAxis: 1,
data: [],
tooltip: {
valueSuffix: 'cfs'
},
color: Highcharts.getOptions().colors[0],
marker: {
enabled: false,
states: {
hover: {
enabled: true
}
}
},
zIndex: 3,
}, {
name: 'Gage Height',
type: 'spline',
yAxis: 2,
data: [],
tooltip: {
valueSuffix: 'ft'
},
marker: {
enabled: false,
states: {
hover: {
enabled: true
}
}
},
zIndex: 1,
color: Highcharts.getOptions().colors[5]
},{
name: 'Water Temp',
type: 'spline',
dashStyle: 'shortdot',
yAxis: 0,
data: [],
tooltip: {
valueSuffix: ' °C'
},
marker: {
enabled: false,
states: {
hover: {
enabled: true
}
}
},
zIndex: 2,
color: Highcharts.getOptions().colors[3]
}]
var high_dates = []
var historical_days = 0;
for (var x = data.streamflow.length - 90; x < data.streamflow.length; x++){
var current_snowfall = data.streamflow[x].value;
if (current_snowfall < 0){
current_snowfall = 0;
}
var current_date = Date.parse(data.streamflow[x].timestamp);
if (current_snowfall >=0 && current_snowfall < 1000000){
high_series[0].data.push([current_date, parseFloat(current_snowfall)])
}
}
var historical_days = 0;
for (var x = historical_days; x < data.gage_height.length; x++){
var current_snowfall = data.gage_height[x].value;
if (current_snowfall < 0){
current_snowfall = 0;
}
if (current_snowfall >=0){
var current_date = Date.parse((data.gage_height[x].timestamp));
high_series[1].data.push([current_date, parseFloat(current_snowfall)])
}
}
var historical_days = 0;
for (var x = historical_days; x < data.water_temp.length; x++){
var current_snowfall = data.water_temp[x].value;
if (current_snowfall < 0){
current_snowfall = 0;
}
if (current_snowfall >=0){
var current_date = Date.parse((data.water_temp[x].timestamp));
high_series[2].data.push([current_date, parseFloat(current_snowfall)])
}
}
var flow_history = $('#snoflo_chart').highcharts({
exporting: {
enabled: true,
buttons: {
contextButton: {
symbol: 'menu',
symbolStrokeWidth: 1,
symbolFill: '#a4edba',
symbolStroke: '#330033'
}
},
chartOptions:{
subtitle: {
text:'Kanawha River At Kanawha Falls, Wv | USGS 03193000'
},
credits: {
text:'provided by snoflo.org',
text:'Provided by snoflo.org',
href: 'http://snoflo.org',
style: {
fontSize:'12px',
color: '#1779ba',
},
},
rangeSelector: {
enabled: false,
},
}
},
chart: {
zoomType: 'x'
},
rangeSelector: {
allButtonsEnabled: true,
selected: 0,
enabled: true,
},
title: {
text: "Seasonal Comparison | Kanawha River At Kanawha Falls",
align: '',
style: {
color: '',
}
},
subtitle: {
align: 'left',
style: {
color: 'lightgrey',
},
text: ''
},
credits: {
text: '',
//href: 'http://snoflo.org',
href: 'http://snoflo.org',
text:'Provided by snoflo.org',
href: 'http://snoflo.org',
style: {
fontSize:'12px',
color: '#1779ba',
},
},
xAxis: [{
crosshair: true,
type: 'datetime',
labels: {
enabled: true,
style: {
fontSize:'14px',
fontWeight: 'bold',
},
},
dateTimeLabelFormats: {
day: '%b %e'
}
//categories: high_dates
}],
plotOptions: {
areaspline: {
fillColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, Highcharts.getOptions().colors[0]],
[1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
]
},
marker: {
radius: 2
},
lineWidth: 1,
states: {
hover: {
lineWidth: 1
}
},
threshold: null
}
},
yAxis: [{ // Primary yAxis
labels: {
format: '{value}°C',
style: {
color: Highcharts.getOptions().colors[3]
}
},
title: {
text: '',
style: {
fontSize:'16px',
fontWeight: 'bold',
color: Highcharts.getOptions().colors[3]
}
},
opposite: true
}, { // Secondary yAxis
gridLineWidth: 1,
title: {
text: 'Streamflow',
style: {
fontSize:'16px',
fontWeight: 'bold',
color: Highcharts.getOptions().colors[0]
}
},
type: 'logarithmic',
labels: {
format: '{value} cfs',
align: 'left',
x: 3,
y: -2,
style: {
color: Highcharts.getOptions().colors[0]
}
}
}, { // Tertiary yAxis
gridLineWidth: 0,
title: {
text: '',
style: {
fontSize:'16px',
fontWeight: 'bold',
color: Highcharts.getOptions().colors[5]
}
},
labels: {
format: '{value} ft',
style: {
color: Highcharts.getOptions().colors[5]
}
},
opposite: true
}],
tooltip: {
shared: true
},
legend: {
enabled: true,
},
series: high_series,
});
}
}
if ("comparison" == "forecast"){
function Meteogram(xml, container) {
this.symbols = [];
this.symbolNames = [];
this.precipitations = [];
this.windDirections = [];
this.windDirectionNames = [];
this.windSpeeds = [];
this.windSpeedNames = [];
this.temperatures = [];
this.pressures = [];
// Initialize
this.xml = xml;
this.container = container;
// Run
this.parseYrData();
}
Meteogram.prototype.getSymbolSprites = function (symbolSize) {
return {
'01d': {
x: 0,
y: 0
},
'01n': {
x: symbolSize,
y: 0
},
'16': {
x: 2 * symbolSize,
y: 0
},
'02d': {
x: 0,
y: symbolSize
},
'02n': {
x: symbolSize,
y: symbolSize
},
'03d': {
x: 0,
y: 2 * symbolSize
},
'03n': {
x: symbolSize,
y: 2 * symbolSize
},
'17': {
x: 2 * symbolSize,
y: 2 * symbolSize
},
'04': {
x: 0,
y: 3 * symbolSize
},
'05d': {
x: 0,
y: 4 * symbolSize
},
'05n': {
x: symbolSize,
y: 4 * symbolSize
},
'18': {
x: 2 * symbolSize,
y: 4 * symbolSize
},
'06d': {
x: 0,
y: 5 * symbolSize
},
'06n': {
x: symbolSize,
y: 5 * symbolSize
},
'07d': {
x: 0,
y: 6 * symbolSize
},
'07n': {
x: symbolSize,
y: 6 * symbolSize
},
'08d': {
x: 0,
y: 7 * symbolSize
},
'08n': {
x: symbolSize,
y: 7 * symbolSize
},
'19': {
x: 2 * symbolSize,
y: 7 * symbolSize
},
'09': {
x: 0,
y: 8 * symbolSize
},
'10': {
x: 0,
y: 9 * symbolSize
},
'11': {
x: 0,
y: 10 * symbolSize
},
'12': {
x: 0,
y: 11 * symbolSize
},
'13': {
x: 0,
y: 12 * symbolSize
},
'14': {
x: 0,
y: 13 * symbolSize
},
'15': {
x: 0,
y: 14 * symbolSize
},
'20d': {
x: 0,
y: 15 * symbolSize
},
'20n': {
x: symbolSize,
y: 15 * symbolSize
},
'20m': {
x: 2 * symbolSize,
y: 15 * symbolSize
},
'21d': {
x: 0,
y: 16 * symbolSize
},
'21n': {
x: symbolSize,
y: 16 * symbolSize
},
'21m': {
x: 2 * symbolSize,
y: 16 * symbolSize
},
'22': {
x: 0,
y: 17 * symbolSize
},
'23': {
x: 0,
y: 18 * symbolSize
}
};
};
/**
* Function to smooth the temperature line. The original data provides only whole degrees,
* which makes the line graph look jagged. So we apply a running mean on it, but preserve
* the unaltered value in the tooltip.
*/
Meteogram.prototype.smoothLine = function (data) {
var i = data.length,
sum,
value;
while (i--) {
data[i].value = value = data[i].y; // preserve value for tooltip
// Set the smoothed value to the average of the closest points, but don't allow
// it to differ more than 0.5 degrees from the given value
sum = (data[i - 1] || data[i]).y + value + (data[i + 1] || data[i]).y;
data[i].y = Math.max(value - 0.5, Math.min(sum / 3, value + 0.5));
}
};
/**
* Callback function that is called from Highcharts on hovering each point and returns
* HTML for the tooltip.
*/
Meteogram.prototype.tooltipFormatter = function (tooltip) {
// Create the header with reference to the time interval
var index = tooltip.points[0].point.index,
ret = '' + Highcharts.dateFormat('%A, %b %e, %H:%M', tooltip.x) + '-' +
Highcharts.dateFormat('%H:%M', tooltip.points[0].point.to) + '
';
// Symbol text
ret += '' + this.symbolNames[index] + '';
ret += '
| \u25CF ' + series.name + ': | ' + Highcharts.pick(point.point.value, point.y) + series.options.tooltip.valueSuffix + ' |
| \u25CF Wind | ' + this.windDirectionNames[index] +
'° ' + this.windSpeedNames[index] + ' (' + Highcharts.numberFormat(this.windSpeeds[index], 1) + ' mph) |