Skip to content

Change demand plot dynamically when changing user shares #190

@paulapreuss

Description

@paulapreuss

Currently, the demand plot on step 3 is loaded once as the page loads, but then remains static when the user changes the shares. This is something that did work originally in the tier-spatial-planning repository (although I can't find the exact code where it is handled), but when we changed to django there was so much change structurally that it was not implemented, since before most of the inteactions on the page were being handled through pure javascript instead of injecting data through the django context.

In any case, the code to update the graph dynamically was based on something I had put together a while ago for CP Nigeria, so this should be possible to use for inspo. Essentially, once the shares change, the new total household demand (for one week, since the plot does not need the full timeseries) should be calculated on the fly and updated in the graph. This can be done by keeping track of the traces in the plot and updating them.

Image

Metadata

Metadata

Assignees

Labels

bug 🐞Something isn't workingusability 🖱️Does not add functionality but improves user experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions