From 7d125ecce603599a902ff0436a017547323a0ced Mon Sep 17 00:00:00 2001 From: Allison Bailey Date: Sat, 7 Apr 2018 14:06:31 -0700 Subject: [PATCH] Add Econ metrics for selected polys to Polygons tab --- index.html | 54 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index 5424177..54f3e7e 100644 --- a/index.html +++ b/index.html @@ -316,6 +316,7 @@

How to Use this Tool

  • View the count of selected polygons out of the total polygons for each EFHCA alternative next to its name
  • View summary metrics for all selected EFHCA polygons in the Summary Tab
  • View and download a table of individual metrics for selected polygons in the Polygons Tab
  • +
  • '**' indicate confidential economic data
  • To avoid double-counting in the summary metrics, if you select a polygon that overlaps a current selection, the overlapped polygon will be removed from the selection.

    For the best experience, use the Chrome browser. Other browsers have not been thoroughly tested.

    @@ -1295,9 +1296,13 @@

    How to Use this Tool

    } // Format proportion as percent - function prop2pct(val){ + function prop2pct(val, digits){ + if (val == 0){ + digits = 0 + } return val.toLocaleString(undefined, { - style: 'percent' + style: 'percent', + minimumFractionDigits: digits, }); } @@ -1328,7 +1333,8 @@

    How to Use this Tool

    return dollars(val); } else if (type == 'landings'){ return rnd(val,0) - } + } else if (type == 'percent') + return prop2pct(val, 4) } } @@ -1570,6 +1576,14 @@

    How to Use this Tool

    'Coral Bycatch (.5 km cells)' + 'Sponge Bycatch (.5 km cells)' + 'Sea Pen Bycatch (0.5 km cells)' + + 'Landings, non-RCA (lbs)' + + 'Landings, non-RCA (% coastwide)' + + 'Landings, in RCA (lbs)' + + 'Landings, in RCA (% coastwide)' + + 'Ex-Vessel Revenue non-RCA (dollars)' + + 'Ex-Vessel Revenue non-RCA (% coastwide)' + + 'Ex-Vessel Revenue in RCA (dollars)' + + 'Ex-Vessel Revenue in RCA (% coastwide)' + '' // update the html of the table @@ -1604,7 +1618,15 @@

    How to Use this Tool

    'Coral Bycatch (.5 km cells)' + 'Sponge Bycatch (.5 km cells)' + 'Sea Pen Bycatch (.5 km cells)' + - '' + 'Landings, non-RCA (lbs)' + + 'Landings, non-RCA (% coastwide)' + + 'Landings, in RCA (lbs)' + + 'Landings, in RCA (% coastwide)' + + 'Ex-Vessel Revenue non-RCA (dollars)' + + 'Ex-Vessel Revenue non-RCA (% coastwide)' + + 'Ex-Vessel Revenue in RCA (dollars)' + + 'Ex-Vessel Revenue in RCA (% coastwide)' + + '' // loop through all the selected features for ( var i in selectedSet ){ @@ -1612,14 +1634,14 @@

    How to Use this Tool

    var selection = selectedSet[i]; var data = selection.feature.properties; - // Tow Length filter (< 3 vessels in an area) - var towLen; - if (data.VesCount >= 3 || data.VesCount == 0) { - towLen = m2mi(data.TowLenM); - - } else { - towLen = "**"; - } +// // Tow Length filter (< 3 vessels in an area) +// var towLen; +// if (data.VesCount >= 3 || data.VesCount == 0) { +// towLen = m2mi(data.TowLenM); +// +// } else { +// towLen = "**"; +// } rows += '' + '' + data.RegAction + '' + @@ -1638,6 +1660,14 @@

    How to Use this Tool

    '' + data.coralthreshold_count + '' + '' + data.spongethreshold_count + '' + '' + data.pennthreshold_count + '' + + '' + cfd4table(data.LWlb_outRCA, 'landings') + '' + + '' + cfd4table(data.LWprop_outRCA, 'percent') + '' + + '' + cfd4table(data.LWlb_inRCA, 'landings') + '' + + '' + cfd4table(data.LWprop_inRCA, 'percent') + '' + + '' + cfd4table(data.Rev_outRCA, 'dollars') + '' + + '' + cfd4table(data.Revprop_outRCA, 'percent') + '' + + '' + cfd4table(data.Rev_inRCA, 'dollars') + '' + + '' + cfd4table(data.Revprop_inRCA, 'percent') + '' + '' // rows += ''