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

plot hover popup remains if mouse is moved slowly out of the plot through the right side of a plot #3282

Closed
santiontanon opened this issue Feb 22, 2020 · 2 comments · Fixed by #3347

Comments

@santiontanon
Copy link

Environment information (required)

Please run diagnose_tensorboard.py (link below) in the same
environment from which you normally run TensorFlow/TensorBoard, and
paste the output here:

Diagnostics

Diagnostics output
--- check: autoidentify
INFO: diagnose_tensorboard.py version d515ab103e2b1cfcea2b096187741a0eeb8822ef

--- check: general
INFO: sys.version_info: sys.version_info(major=2, minor=7, micro=17, releaselevel='final', serial=0)
INFO: os.name: posix
INFO: os.uname(): ('Linux', '[BLINDED]', '5.2.17-1rodete3-amd64', '#1 SMP Debian 5.2.17-1rodete3 (2019-10-21 > 2018)', 'x86_64')
INFO: sys.getwindowsversion(): N/A

--- check: package_management
INFO: has conda-meta: False
INFO: $VIRTUAL_ENV: None

--- check: installed_packages
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/dist-packages/pip/__main__.py", line 16, in <module>
    from pip._internal import main as _main  # isort:skip # noqa
  File "/usr/lib/python2.7/dist-packages/pip/_internal/__init__.py", line 40, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/lib/python2.7/dist-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/lib/python2.7/dist-packages/pip/_internal/cli/main_parser.py", line 12, in <module>
    from pip._internal.commands import (
  File "/usr/lib/python2.7/dist-packages/pip/_internal/commands/__init__.py", line 6, in <module>
    from pip._internal.commands.completion import CompletionCommand
  File "/usr/lib/python2.7/dist-packages/pip/_internal/commands/completion.py", line 6, in <module>
    from pip._internal.cli.base_command import Command
  File "/usr/lib/python2.7/dist-packages/pip/_internal/cli/base_command.py", line 18, in <module>
    from pip._internal.download import PipSession
  File "/usr/lib/python2.7/dist-packages/pip/_internal/download.py", line 15, in <module>
    from pip._vendor import requests, six, urllib3
ImportError: cannot import name requests
Traceback (most recent call last):
  File "experimental/users/santiontanon/sandbox/diagnose_tensorboard.py", line 470, in main
    suggestions.extend(check())
  File "experimental/users/santiontanon/sandbox/diagnose_tensorboard.py", line 180, in installed_packages
    freeze = pip(["freeze", "--all"]).decode("utf-8").splitlines()
  File "experimental/users/santiontanon/sandbox/diagnose_tensorboard.py", line 106, in pip
    return subprocess.check_output(command)
  File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['/usr/bin/python', '-m', 'pip', '--disable-pip-version-check', 'freeze', '--all']' returned non-zero exit status 1

--- check: tensorboard_python_version
INFO: tensorboard.version.VERSION: '1.12.0'

--- check: tensorflow_python_version
INFO: tensorflow.__version__: '1.12.0'
INFO: tensorflow.__git_version__: 'v1.12.0-0-ga6d8ffae09'

--- check: tensorboard_binary_path
INFO: which tensorboard: None

--- check: addrinfos
socket.has_ipv6 = True
socket.AF_UNSPEC = 0
socket.SOCK_STREAM = 1
socket.AI_ADDRCONFIG = 32
socket.AI_PASSIVE = 1
Loopback flags: 32
Loopback infos: [(10, 1, 6, '', ('::1', 0, 0, 0)), (2, 1, 6, '', ('127.0.0.1', 0))]
Wildcard flags: 1
Wildcard infos: [(2, 1, 6, '', ('0.0.0.0', 0)), (10, 1, 6, '', ('::', 0, 0, 0))]

--- check: readable_fqdn
INFO: socket.getfqdn(): 'santi.c.googlers.com'

--- check: stat_tensorboardinfo
INFO: directory: /tmp/.tensorboard-info
INFO: .tensorboard-info directory does not exist

--- check: source_trees_without_genfiles
INFO: tensorboard_roots (1): ['/usr/local/google/home/santiontanon/.local/lib/python2.7/site-packages']; bad_roots (1): ['/usr/local/google/home/santiontanon/.local/lib/python2.7/site-packages']

--- check: full_pip_freeze
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/dist-packages/pip/__main__.py", line 16, in <module>
    from pip._internal import main as _main  # isort:skip # noqa
  File "/usr/lib/python2.7/dist-packages/pip/_internal/__init__.py", line 40, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/lib/python2.7/dist-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/lib/python2.7/dist-packages/pip/_internal/cli/main_parser.py", line 12, in <module>
    from pip._internal.commands import (
  File "/usr/lib/python2.7/dist-packages/pip/_internal/commands/__init__.py", line 6, in <module>
    from pip._internal.commands.completion import CompletionCommand
  File "/usr/lib/python2.7/dist-packages/pip/_internal/commands/completion.py", line 6, in <module>
    from pip._internal.cli.base_command import Command
  File "/usr/lib/python2.7/dist-packages/pip/_internal/cli/base_command.py", line 18, in <module>
    from pip._internal.download import PipSession
  File "/usr/lib/python2.7/dist-packages/pip/_internal/download.py", line 15, in <module>
    from pip._vendor import requests, six, urllib3
ImportError: cannot import name requests
Traceback (most recent call last):
  File "experimental/users/santiontanon/sandbox/diagnose_tensorboard.py", line 470, in main
    suggestions.extend(check())
  File "experimental/users/santiontanon/sandbox/diagnose_tensorboard.py", line 78, in wrapper
    result = fn()
  File "experimental/users/santiontanon/sandbox/diagnose_tensorboard.py", line 437, in full_pip_freeze
    "pip freeze --all:\n%s", pip(["freeze", "--all"]).decode("utf-8")
  File "experimental/users/santiontanon/sandbox/diagnose_tensorboard.py", line 106, in pip
    return subprocess.check_output(command)
  File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['/usr/bin/python', '-m', 'pip', '--disable-pip-version-check', 'freeze', '--all']' returned non-zero exit status 1

Suggestion: Avoid tensorboard packages without genfiles

Your Python path contains a tensorboard package that does not
include generated files. This can happen if your current directory
includes the TensorBoard source tree (e.g., you are in the TensorBoard
Git repository). The following directories from your Python path may
be problematic:

  • '/usr/local/google/home/santiontanon/.local/lib/python2.7/site-packages'

Next steps

Please try each suggestion enumerated above to determine whether it
solves your problem. If none of these suggestions works, please copy
ALL of the above output, including the lines containing only
backticks, into your GitHub issue or comment. Be sure to redact any
sensitive information.

Issue description

Please describe the bug as clearly as possible. How can we reproduce the
problem without additional resources (including external data files and
proprietary Python modules)?

When seeing scalar plots on Tensorboard, you can hover over plots to get a popup with specific values. If you move your mouse slowly out of a plot from the right-hand side of the plot, the popup stays there, instead of disappearing as is the expected behavior. This does not happen if you move the mouse out of the plot from the left/down/up, or if you move the mouse out of the plot fast.

@rmothukuru rmothukuru self-assigned this Feb 24, 2020
@rmothukuru
Copy link

@santiontanon,
In order to expedite the trouble-shooting process, please provide a code snippet to reproduce the issue reported here. Also, please provide screenshots of the issue you are facing so that we can understand the issue exactly. Thanks!

@stephanwlee
Copy link
Contributor

Thanks for the report. The issue is reproducible on virtually all scalars plot. Did not do a debugging yet but we will address this promptly.

stephanwlee added a commit to stephanwlee/tensorboard that referenced this issue Mar 9, 2020
Fixes tensorflow#3282.

Repro: when tooltip is shown, slowly move the mouse to an edge of a chart.  We
expect the tooltip the disappear when the cursor is on the edge of the chart.

Cause:
1. For Polymer 2 and its Shadow DOM compatibility, TensorBoard opted out of the
event delegation of Plottable. Plottable, by default, attaches a set of event
listeners on document.body and invokes appropriate callbacks depending on the
circumstances. However, with the Shadow DOM, the event re-targetting broke
(harder to identify `event.target`), so TensorBoard, instead, attaches the
event listeners on every Plottable container, SVGs.

2. When mouse leaves (mouseout) the container, Plottable remaps the event as
mouse move and calculate whether the cursor is inside a component
(Interaction.prototype._isInsideComponent, specifically) to trigger appropriate
callback. The method, however is flawed since it returns, for a component that
is, for instance, at <0, 0> with size of <100, 100>, true when pointer is at
<100, 100>. It should only return true for [0, 100) for a given dimension,
instead.  As a result, the mouseout event occurred at <100, 100> was treated as
an event inside the component but all the subsequent mouse movements are not
captured since they are events that occurred outside of the event target. In
vanilla Plottable, this bug do not manifest since event delegation on the
entire document will eventually trigger mouse out when cursor is at, for
instance, <101, 100>.

Fix:
Overwrote the method, _isInsideComponent, with the correct implementation.
stephanwlee added a commit that referenced this issue Mar 10, 2020
Fixes #3282.

Repro: when tooltip is shown, slowly move the mouse to an edge of a chart.  We
expect the tooltip the disappear when the cursor is on the edge of the chart.

Cause:
1. For Polymer 2 and its Shadow DOM compatibility, TensorBoard opted out of the
event delegation of Plottable. Plottable, by default, attaches a set of event
listeners on document.body and invokes appropriate callbacks depending on the
circumstances. However, with the Shadow DOM, the event re-targetting broke
(harder to identify `event.target`), so TensorBoard, instead, attaches the
event listeners on every Plottable container, SVGs.

2. When mouse leaves (mouseout) the container, Plottable remaps the event as
mouse move and calculate whether the cursor is inside a component
(Interaction.prototype._isInsideComponent, specifically) to trigger appropriate
callback. The method, however is flawed since it returns, for a component that
is, for instance, at <0, 0> with size of <100, 100>, true when pointer is at
<100, 100>. It should only return true for [0, 100) for a given dimension,
instead.  As a result, the mouseout event occurred at <100, 100> was treated as
an event inside the component but all the subsequent mouse movements are not
captured since they are events that occurred outside of the event target. In
vanilla Plottable, this bug do not manifest since event delegation on the
entire document will eventually trigger mouse out when cursor is at, for
instance, <101, 100>.

Fix:
Overwrote the method, _isInsideComponent, with the correct implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants