[GH-ISSUE #63] There is a potential race between Options() and Draw() calls #46

Closed
opened 2026-03-03 16:21:55 +03:00 by kerem · 3 comments
Owner

Originally created by @mum4k on GitHub (Jan 13, 2019).
Original GitHub issue: https://github.com/mum4k/termdash/issues/63

This affects widgets that calculate their minimum size based on what data they currently have.

The following causes a race:

  1. infra calls Options()
  2. user changes values in the widget
  3. infra calls Draw(), potentially not respecting the min size.
Originally created by @mum4k on GitHub (Jan 13, 2019). Original GitHub issue: https://github.com/mum4k/termdash/issues/63 This affects widgets that calculate their minimum size based on what data they currently have. The following causes a race: 1. infra calls Options() 1. user changes values in the widget 1. infra calls Draw(), potentially not respecting the min size.
kerem 2026-03-03 16:21:55 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@activeshadow commented on GitHub (Jan 25, 2019):

Is this maybe the reason why a line chart with a min value > 0 still results in the Y Axis still being drawn all the way down to zero? I have a series that is in the range of 1600 - 1800, and my Y Axis is always from 0 to max instead of min to max.

<!-- gh-comment-id:457765320 --> @activeshadow commented on GitHub (Jan 25, 2019): Is this maybe the reason why a line chart with a min value > 0 still results in the Y Axis still being drawn all the way down to zero? I have a series that is in the range of 1600 - 1800, and my Y Axis is always from 0 to max instead of min to max.
Author
Owner

@mum4k commented on GitHub (Jan 25, 2019):

That looks unrelated, this is a bug that would trigger an error when a terminal resize event happens at a particular time between getting the widget's options and drawing the widget.

What you are describing is actually a design choice I made, quite possibly because I didn't understand all the use cases. Would you mind filing a separate issue where we can discuss the use case? Once we are on the same page, we can add a new feature to the LineChart so that the Y axis isn't always zero based.

<!-- gh-comment-id:457766293 --> @mum4k commented on GitHub (Jan 25, 2019): That looks unrelated, this is a bug that would trigger an error when a terminal resize event happens at a particular time between getting the widget's options and drawing the widget. What you are describing is actually a design choice I made, quite possibly because I didn't understand all the use cases. Would you mind filing a separate issue where we can discuss the use case? Once we are on the same page, we can add a new feature to the LineChart so that the Y axis isn't always zero based.
Author
Owner

@mum4k commented on GitHub (Jan 26, 2019):

@activeshadow fyi I had some time to test this and filed #92.

<!-- gh-comment-id:457806482 --> @mum4k commented on GitHub (Jan 26, 2019): @activeshadow fyi I had some time to test this and filed #92.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/termdash#46
No description provided.