Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable range on realtime (line) plots #156

Closed
Dav1dde opened this issue Feb 22, 2015 · 8 comments
Closed

Variable range on realtime (line) plots #156

Dav1dde opened this issue Feb 22, 2015 · 8 comments
Labels

Comments

@Dav1dde
Copy link
Contributor

Dav1dde commented Feb 22, 2015

E.g. I have this graph representing memory useage of a process:
screenshot from 2015-02-22 12 42 05

Now I can't set a fixed range from 0 to let's say 1GiB, because memory useage depends heavily on the circumstances, or in this example the memory useage doesn't change for the duration of the plot, as you can see, that really messes with Epoch, also triggering an exception (line 8, Uncaught TypeError: Cannot read property 'x' of undefined):

    Plot.prototype._updateTicks = function(newTime) {
      if (!(this.hasAxis('top') || this.hasAxis('bottom'))) {
        return;
      }
      if (!((++this._tickTimer) % this.options.ticks.time)) {
        this._pushTick(this.options.windowSize, newTime, true);
      }
      if (!(this._ticks[0].x - (this.w() / this.pixelRatio) >= 0)) {
        return this._ticks[0].exit = true;
      }
    };

I am not sure how to properly fix this, maybe replace the range option with an extent function (as called from the code)? Or an extent option which takes precedence over the range option.

@rsandor
Copy link
Collaborator

rsandor commented Feb 25, 2015

@Dav1dde - Can you provide me with some sample data so I can test on my end?

@cbdonohue
Copy link

I can confirm this. If the real time chart only receives the same value over and over it never draws the Y axis ticks or values.

@cbdonohue
Copy link

any idea how we can set a minimum Y axis scale to prevent this from happening?

@Dav1dde
Copy link
Contributor Author

Dav1dde commented May 14, 2015

I did patch this functionallity into epoch manually. You can check the last commits https://github.com/Dav1dde/epoch/commits/master - this is just a quick and dirty (not even fix) workaround which adds a range option to pick the min and max based on the current values shown.

@cbdonohue
Copy link

Thanks, @Dav1dde , I grabbed your changes. However, the scale is now always the same and doesn't expand like before. I wish there was some way to set a minimum value and still allow the graph to expand if necessary.

@Dav1dde
Copy link
Contributor Author

Dav1dde commented May 15, 2015

@cbdonohue This should work, use a function as range option. You can see it in action here: https://github.com/Dav1dde/mcw/blob/master/mcw/static/js/backend.js#L67-L73 (disclaimer the code is pretty messy, again ..)

@rsandor
Copy link
Collaborator

rsandor commented Oct 4, 2015

Looks like a fix for this exists, but hasn't been implemented as a PR on the repository. Any takers?

@rsandor rsandor added the bug label Oct 4, 2015
@rsandor
Copy link
Collaborator

rsandor commented Oct 17, 2015

@Dav1dde, @cbdonohue - Looking over this again I see that this ticket is actually reporting two problems that have been reported by others and are now fixed as of the latest version of epoch.

The first problem, an error being thrown with cannot property 'x' of undefined was fixed with #203. The second, variable extent-based axes for real-time charts, was fixed with the introduction of multi-axes in #198.

Seeing as the issues are now resolved, I am going to close this ticket. Feel free to ask questions here or continue the conversation.

@rsandor rsandor closed this as completed Oct 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants