influxdata / influxdata/ui

Change graph view to match the times given for range()

Open
#6,893 0 comments 0 reactions 0 assignees View on GitHub
enhancement team/ui
Dominant language
TypeScript
Stars
117
Forks
51
Avg merge
2d 15h
Merged PRs (30d)
4

Description

Using InfluxDB v2.7.6
Local hosted.

**Proposal:**
When doing a query with a range that stops prior to now(), set the right end of the graph to that time rather than now().

**Current behavior:**
Any query, regardless of the stop time given, will try to show values from start to now().
As shown in the picture, I've got this little function that gives me the time of the last data point entered in the table.
And since the last point was given yesterday I get this comically shrunk and unusable graph display with over 90% of the graph view blank.
![Sem título](https://github.com/influxdata/ui/assets/8614893/a98db5b4-6939-4e50-80fc-34ed4c92cd0d)

**Desired behavior:**
Have the graph only show the data point returned from the query, like this:
![Sem título 2](https://github.com/influxdata/ui/assets/8614893/a9328bad-ddf2-4fe0-9c36-bb93340f473c)
That's from Grafana, however the way Grafana does things is also very undesirable, since it first needs for all data to be fully out of view before it gives me the "zoom to data" button.
Or at the very least, make the time range of the graph match the time given for the range() function.

**Alternatives considered:**
I'm working with Grafana as well, but I'm heavily questioning if it's really needed for the use case I'm currently working on. It's mainly this data vizualization problem where old data is incredibly difficult to put in full view for the user.

**Use case:**
University final project, trying to implement something similar to Weg's cloud solution with off the shelf hardware and a fraction of the budget.
Currently trying to review yesterday's readings so I can correctly show data when the user accesses the database from their phone.
It seems like I could do the entire project with just InfluxDB, but this data viewing issue is going to be a problem every time the collecting system is offline.
The collection system isn't expected to be running constantly.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing a graph query whose range() stop is before now(), then trace how the graph view determines its displayed time bounds. The issue is done when the graph's right edge matches the query's stop time instead of extending to now(), with the existing graph behavior preserved for ranges ending at now().

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.