SmartCambridge / tfc_web

Web access to the TFC platform
MIT License
3 stars 2 forks source link

Add graphs of Pocket SmartPanel usage #334

Closed jw35 closed 5 years ago

jw35 commented 5 years ago

Add new pages /smartpanel/pocketlog/unique and /smartpanel/pocketlog/total showing graphs of 'unique clients per week' and 'total clients ever' for the Pocket Smartpanel (even if 'total clients' is an unhelpful metric)

The graph is drawn with D3 and uses CSV data from /smartpanel/pocketlog/pocketlog.csv which is managed by tfc_prod.

To support this work, this edit adds copies of moment.js and v5 of d3.js to the main tfc_web static directory.

jw35 commented 5 years ago

Examples of the graphs, using real data copied from tfc-app4 can be seen at

abrahammartin commented 5 years ago

Two comments only:

jw35 commented 5 years ago

In my defence I observe that all our other graphs have the same feature. I'll see if I can work out what's going on.

jw35 commented 5 years ago

Two comments only:

  • Graphs overflow to the right:

Fixed.

  • I think adding a js event when the windows is resize to call the draw function so that the graph is redrawn is a quick easy win to make it responsive.

Done.

Both changes on tfc-app1