deephaven / deephaven-core

Deephaven Community Core
Other
254 stars 80 forks source link

`min`/`max` arguments in `x_axis` and `y_axis` methods not limiting scope of XY series plot #5212

Open jjbrosnan opened 8 months ago

jjbrosnan commented 8 months ago

Description

deephaven.plot.figure.Figure.x_axis and deephaven.plot.figure.Figure.y_axis have arguments, min and max, that should limit the span of the X/Y axes in a figure. They don't work as expected.

Steps to reproduce

from deephaven.plot.figure import Figure
from deephaven import empty_table

data = empty_table(1000).update(["X = 0.1 * ii", "Y = 25 * sin(X)"])

plot_xbounds = Figure().plot_xy(series_name="Sine wave", t=data, x="X", y="Y").x_axis(t=data, min=-20.0, max=-20.0).show()
plot_ybounds = Figure().plot_xy(series_name="Sine wave", t=data, x="X", y="Y").y_axis(t=data, min=-20.0, max=20.0).show()

Expected results

plot_xbounds to display X values from -20 to 20, or the minimum value in the table to 20. plot_ybounds to display Y values from -20 to 20, cutting the top and bottom of the waves out of view.

Actual results

Plots that look the same as if x_axis and y_axis weren't called at all.

A clear and concise description of what actually happened.

Additional details and attachments

If applicable, add any additional screenshots, logs, or other attachments to help explain your problem.

Versions

niloc132 commented 8 months ago

It looks like this is exposed via the JS API on the dh.plot.Axis instance as minRange and maxRange, but at a glance I can't confirm that the web UI is consuming those values. @mofojed can you confirm one way or the other?

mofojed commented 8 months ago

@niloc132 doesn't look like we read minRange or maxRange anywhere

niloc132 commented 2 months ago

@mofojed should we move this to web-client-ui, or is there a reason to keep it here (or a dup)?