Coder Social home page Coder Social logo

npct / pct-shiny Goto Github PK

View Code? Open in Web Editor NEW
22.0 9.0 14.0 155.82 MB

The Shiny map for Local Authorites

License: GNU Affero General Public License v3.0

R 0.49% HTML 99.07% JavaScript 0.29% Shell 0.05% CSS 0.08% Perl 0.03% Ruby 0.01%
shiny r transport geo-spatial

pct-shiny's Introduction

pct-shiny

Interactive map for prioritising funding for cycling.

Setup

To run the code in this repository you will need a few things, primarily a working version of R. Using RStudio will make your life easier.

To start:

git clone [email protected]:npct/pct-shiny.git
git clone [email protected]:npct/pct-outputs-regional-Rsmall.git 

so that pct-outputs-regional-Rsmall is in a sibling folder.

To create and modify pct-outputs-regional-Rsmall refer to pct-scripts, cloned with::

git clone [email protected]:npct/pct-scripts.git

The regions_www folder contains all the current starting regions which can be run as shiny apps.

pct-shiny's People

Contributors

annagoodman1 avatar audev avatar dependabot[bot] avatar github-actions[bot] avatar jdwoodcock avatar mem48 avatar nikolai-b avatar npmcdn-to-unpkg-bot avatar oobrien avatar rachelaldred avatar robinlovelace avatar usr110 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pct-shiny's Issues

Zone popup only shows baseline's variables irrespective of the underlying scenario

I don't know if it is intentional or not, but I was trying to compare the values of the legend with the zone popup and found an anomaly. It seems the zone popups only show the baseline zone attribute values - don't change according to the selected scenario.

You can see the code here:

https://github.com/npct/pct-shiny/blob/master/master/pct-shiny-funs.R#L59

This, of course, makes the legend having different values than the popup values.

tabs

please can we have

  1. a health drop down menu on right side but call it "Physical Activity Benefits - To be Completed"
  2. On the top can we have a tab saying - "View Results as a Table- To be Completed"

Robin - I think this what we agreed - please say if not

j.

Tool slows down when many people use it

In my experience when ~10 people connect to the tool at the same time it slows down.

Can we reproduce this? More importantly, can we monitor what is going on?

Hypothesis: it's a processor issue that is partly resolved by cb83e70

Each shiny instance seems to require ~100MB (please confirm @nikolai-b ) - I'll reduce this in data mkII.

Automatic reload for a new town

/pct-shiny/bolton/ is working locally and the data has been added.

But it's crashing on geo8 - try reproducing this.

@nikolai-b a reason to update the code to download the data I think.

Using git pull could be an alternative to downloading the whole zip - more efficient when we're uploading new cities one by one...

Bug in local version?

Getting this error in my local version - any ideas?

Warning in run(timeoutMs) :
  Unhandled error in observer: Geographical CRS Warning in run(timeoutMs) :
  Unhandled error in observer: Geographical CRS given to non-conformant data: -594.84375  590.62500
observe({
    LA <- findLA()
    dataDir <- file.path("..", "pct-data", LA)
    if (input$advanced) 
        updateSelectInput(session, "zone_attr", label = "Flow Attribute", 
            choices = attrsZone)
    else updateSelectInput(session, "zone_attr", label = "Attribute to display", 
        choices = attrsLine)
    if (!is.null(helper$scenarioWas)) {
        updateSelectInput(session, "scenario", selected = helper$scenarioWas)
        helper$scenarioWas <<- NULL
    }
    if (helper$dataDir != dataDir && !is.null(LA) && file.exists(dataDir)) {
        helper$dataDir <<- dataDir
        helper$scenarioWas <<- input$scenario
        helper <<- loadData(helper)
        if (input$freeze) 
            updateCheckboxInput(session, "freeze", value = F)
        if (input$scenario != "olc") 
            updateSelectInput(session, "scenario", selected = "olc")
        else updateSelectInput(s [... truncated]given to non-conformant data: -594.84375  590.62500
observe({
    LA <- findLA()
    dataDir <- file.path("..", "pct-data", LA)
    if (input$advanced) 
        updateSelectInput(session, "zone_attr", label = "Flow Attribute", 
            choices = attrsZone)
    else updateSelectInput(session, "zone_attr", label = "Attribute to display", 
        choices = attrsLine)
    if (!is.null(helper$scenarioWas)) {
        updateSelectInput(session, "scenario", selected = helper$scenarioWas)
        helper$scenarioWas <<- NULL
    }
    if (helper$dataDir != dataDir && !is.null(LA) && file.exists(dataDir)) {
        helper$dataDir <<- dataDir
        helper$scenarioWas <<- input$scenario
        helper <<- loadData(helper)
        if (input$freeze) 
            updateCheckboxInput(session, "freeze", value = F)
        if (input$scenario != "olc") 
            updateSelectInput(session, "scenario", selected = "olc")
        else updateSelectInput(s [... truncated]

Track users

Can we track how many people are using the tool? Server-side sys. admin job so may be off-topic.

Shiny reloads data after any user input

Currently the shiny, it seems, is requesting updated data every time the user interacts with the map (e.g. panning/zooming). This causes the map to temporarily go grey. It also places a load on the server, in terms of CPU, bandwidth and maybe RAM.

The solution may be to set up shiny so it only requests new data when new data is needed, i.e. when one of the dropdown menus on the right is used. This could help with #16.

route information

  •      It’s not clear where a route goes from and to – would it be possible when one clicks on a route (to see distance, increase in cycling etc.) to highlight the whole route so you can see where it goes from and to.
    

'No zones' option has disappeared

With the closure of #9 we've removed a superfluous option: to show LSOAs.

However it's also removed a useful option: to show no zones.

The plan was to re-add this option in the 'zone attribute' menu:

" Instead have option 'none' under zone attribute."

Should be an easy addition, that will enable people to focus on the map rather than the colourful zones.

Fastest and quietest routes

Rename 'fastest and quietest' as 'direct and quieter'.
Above 'direct and quieter' add 'direct'- this would just show the direct routes (previously fastest)

branding

We need some acknowledgements and branding on the interface- probably another tab.
It should acknowledge the DfT project, the NPCT academic team, & then specific work

zone information in popup

Zone information in popup – suggest including modelled level and increase. Could always bold the displayed attribute to remind the user what they have currently select.

Suggest stop using acronyms as we are spelling them out more than we are using the acronym.

user warning

As people are now accessing the tool there must be a danger someone starts thinking they can use the results. So I think we need a health warning that this is a prototype under development and not all the data is intended to be correct. Do not use!

Scale is wrong for SIC

The numbers on scale seem to be wrong for sic zone attributes at baseline - scale runs from -150 to 0, i.e. never positive:
selection_175

Change 'Route Information' popup on screen

The amount of clutter on the map should be kept to a minimum and I think the new popup information added by 155d276 . @usr110 is there a way to display the information more discretely, in a way that does not consume precious map space? I'm with Nikolai in thinking we need to keep the interface really clean. I would be happy if this were moved into the help.

Zone attribute

  •      Legend needs to be labelled as ‘Zone Attribute Legend’
    

Make the menu on the right moveable

It was made static because it moved problematically when the sliders were moved.

But sometimes it's useful to move it - can we do this?

Maybe more useful and easier: allow the user to move the scale bar.

Zone attribute/ type of zones

Remove type of zones. Instead have option 'none' under zone attribute.

Rename Zone attribute to 'Cycling metric' - it if it is a route based measure it is not actually a zone anyway.

Help Menu

  •     Pictures in help are wrong
    
  •      Need to update boxes on map in line with help text
    

o E.g. Remove acronyms from interface (e.g. ‘SLC’) as they always appear with explanatory text – we’ll only want them in technical appendix

Legend

The map needs a legend and brief description of use. @usr110 were you working on this? Please add the popup if so! Thanks.

greying out

No not my hair but when I leave it open for a minute or two it sort of greys out and you can see it but not so well. Could be my pc setting.

Also to remind people there is user testing tomorrow so please be careful not to break anything :)

DataDir doesn't change for more than once

I am not sure you guys are receiving this error or not. Once you start the application (say from the master folder), it shows you Manchester's map. Once you navigate to some other LA (say Sheffield), and its map gets loaded, after that you can't change LA any more. I receive this error:

Warning in run(timeoutMs) :
Unhandled error in observer: missing value where TRUE/FALSE needed
observe({
LA <- findLA()
dataDir <- file.path("..", "pct-data", LA)
if (session$dataDir != dataDir && !is.null(LA) && file.exists(dataDir)) {
session$dataDir <- dataDir
loadData(session)
updateSelectInput(session, "scenario", selected = "base")
}
session$dataDir
})

Does it appear on your end too?

pct-shiny down

@nikolai-b just about to test it and it's not working...

Any chance you could debug this.

Apologies.

Robin

please fix interface !

flows currently making it crash
even without flows it shows error message where legend was.

I need to show this to people at conference tomorrow so please fix asap.

Does it work for Coventry any better? I cant see Coventry only Manchester

suggest merge zone attribute & line attribute

I just stupidly wondered why lines not changing whilst playing with zone attribute- others may also be so stupid! I suggest we simplify and have only one set of options that covers both zones & lines- usually you would want to see both.
James

Please remove - additional features

These are not currently accurate and not necessarily the ones we would choose.
Perhaps we could have a dummy heading in labelled health benefits & carbon savings- as these will be needed?

Dropping off the bottom of the screen

When I select the 'lines' option, and get those extra options, I lose the ability to change the 'zone attributes' type to be 'extra cycling potential'.

A solution would be to remove the 'additional features' option and 'type of zone' options, and to add a 'none' option to the 'zone attributes' (i.e. equivalent to seeing no MSOA outcomes).

zone attribute

hi
i like the comments but for zone attribute it is too wordy and I think includes a superfluous word- "Alters to colours", should it just say "Alters colours"?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.