dcrdata icon indicating copy to clipboard operation
dcrdata copied to clipboard

Use human-readable time in the zoom URL parameter

Open xaur opened this issue 5 years ago • 1 comments

In the typical dcrdata chart URL like this:

https://explorer.dcrdata.org/charts?chart=stake-participation&zoom=k73pyxd6-k8jb5bvi&bin=block&axis=time

The zoom argument k73pyxd6-k8jb5bvi appears to be some encoding of the date range.

dcr.farm's Grafana instance uses two arguments from and to that (among other expressions) accept Unix milliseconds:

https://charts.dcr.farm/d/000000014/nodes?orgId=1&from=1580515200000&to=1583020800000

This allows me a a fun use case where I can generate the Unix timestamps I want (with e.g. date program) and use them in the URL parameters.

What would be even easier, is if I could specify the data range in (somewhat) human-readable format like this:

https://explorer.dcrdata.org/charts?chart=stake-participation&zoom=20200226193400-20200402220542&bin=block&axis=time

The use case is essentially "allow to set chart zoom via the URL without the need to use the zoom control at the bottom (that is less precise)".

I understand this is not a popular use case but I'd like to know if other people find it useful.

xaur avatar Apr 07 '20 12:04 xaur

I'd like to open a PR for this in the coming week, @chappjc what do you think?

ukane-philemon avatar Feb 10 '24 01:02 ukane-philemon