KEMBAR78
line chart: support manual extent changes by stephanwlee · Pull Request #4711 · tensorflow/tensorboard · GitHub
Skip to content

Conversation

@stephanwlee
Copy link
Contributor

@stephanwlee stephanwlee commented Feb 25, 2021

One of the requested feature in the scalars chart is being able to
change the axis extent manually. For example, when plotting a
probability, you want to see the chart from [0, 1] since there is
absolutely no reason to look beyond that. This change gives a UI
affordance to do so.

Clicking on an axis, you will see a popover with controls that allows
you to manually set the extents.

Future UX tweaks (including how the UI control is presented) will
follow.

image
image

Something to be improved (in a follow up): when the dropdown is visible, maybe make the edit button still visible.

@google-cla google-cla bot added the cla: yes label Feb 25, 2021
@stephanwlee
Copy link
Contributor Author

FYI @atishagarwala

@stephanwlee stephanwlee requested a review from psybuzz February 25, 2021 23:50
@stephanwlee
Copy link
Contributor Author

Relevant GitHub issues:
#77, #1557,

Copy link
Contributor

@psybuzz psybuzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pleasantly excited to see this PR!

(keydown)="keydownPreventClose($event)"
>
<label>min</label>
<input #minInput tabindex="1" type="number" [value]="axisExtent[0]" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Panning the graph via alt+drag seems to set the value to extremely high precision, and by default the beginning of the number is not visible. Can we round values when the form is hydrated?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can optimize those UX consideration in a follow up. Depending on a value, rounding can be quite janky thus is not a simple one or two line change.

@stephanwlee stephanwlee requested a review from psybuzz March 1, 2021 23:29
One of the requested feature in the scalars chart is being able to
change the axis extent manually. For example, when plotting a
probability, you want to see the chart from [0, 1] since there is
absolutely no reason to look beyond that. This change gives a UI
affordance to do so.

Clicking on an axis, you will see a popover with controls that allows
you to manually set the extents.
@stephanwlee
Copy link
Contributor Author

@psybuzz updated the PR and description according to the offline discussion.

Copy link
Contributor

@psybuzz psybuzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the feedback! Only minor comments.

With the style encapsulation, what does that really achieve?

True, there actually isn't much real risk. A quick search shows only 3 components explicitly using ViewEncapsulation.None, but since we prefer encapsulation by default, no need to worry.

.extent-edit-button {
background-color: mat-color($mat-gray, 200);
display: none;
font-size: 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This element has no text, and line-height is fixed. Checking: can font-size be dropped?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot fathom internals of mat-icon-button but without font-size, it pushes the mat-icon down to near ~line-height which makes me think that there is some invisible whitespace in the template causing the UI jank.

@stephanwlee stephanwlee merged commit 3815616 into tensorflow:master Mar 3, 2021
@stephanwlee stephanwlee deleted the lc_axis_change branch March 3, 2021 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants