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

Compare View Revamp: Loading States #2226

Merged
merged 3 commits into from
Sep 13, 2017

Conversation

rajadain
Copy link
Member

@rajadain rajadain commented Sep 6, 2017

Overview

Adds loading states to indicate that the models are being run. All results are faded, and a spinner is added at the top-right corner. Interactivity is not impacted at all. See commit messages for details.

Connects #2134

Demo

2017-09-06 17 15 28

Testing Instructions

  • Check out this branch and bundle
  • Open a project with many scenarios. Open the Compare Window.
  • Ensure that the results start out faded, and saturate once all of them stop polling.
  • Try changing the precipitation value. Ensure that the spinner behaves accordingly.

@kellyi
Copy link
Contributor

kellyi commented Sep 7, 2017

Taking a look at this.

@kellyi
Copy link
Contributor

kellyi commented Sep 7, 2017

Working well in Chrome, FF, and Safari! In IE 11 I don't see the loading spinner -- and the stacked bar chart's not showing up.

I think the latter's a known issue, so depending on whether we want to address the loading spinner icon here or not, this looks good to me.

@kellyi
Copy link
Contributor

kellyi commented Sep 7, 2017

I did notice once quirk with the compare view slider which probably merits another issue if it's not the intended behavior: viz, it looks like the slider button allows you to move the scenario columns once even if they all fit into the viewport:

screen shot 2017-09-07 at 10 20 18 am

->

screen shot 2017-09-07 at 10 20 23 am

If this isn't intentional, we should make another issue to fix it.

return scenario.get('results').pluck('polling');
},
scenarios = this.get('scenarios'),
polling = _.flatten(scenarios.map(getPolling)).some(_.identity);
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably fine to leave but this could also use the lodash/underscore version of some?

@ajrobbins
Copy link

@jfrankl I'm concerned that the loading spinner itself is too subtle - I didn't even notice it for a minute in the GIF on this PR. I think the lightening of the rest of the panel is helpful, but the spinner is very small and subtle. Perhaps we could consider doing something larger, potentially positioned over the greyed-out area?

@rajadain
Copy link
Member Author

rajadain commented Sep 7, 2017

it looks like the slider button allows you to move the scenario columns once even if they all fit into the viewport

In #2195 I added a MIN_VISIBLE_SCENARIOS constant, which controls what is the smallest number of scenarios for which navigation will work. Currently it is set to 3. I think the Compare View can show around 6 on a large screen. We can test on multiple screens and come up with a better default, or even think about calculating it on the fly. I'll make a card for it.

@kellyi
Copy link
Contributor

kellyi commented Sep 7, 2017

Going to pull the new commit down and run this again before approving.

Copy link
Contributor

@kellyi kellyi left a comment

Choose a reason for hiding this comment

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

+1 from me. I tested this out again and it still works well after adding lodash some.

Probably worth waiting on @ajrobbins and @jfrankl to +1 the loading indicator appearance, too, but functionally this is working well.

@kellyi kellyi assigned rajadain and unassigned kellyi Sep 7, 2017
@rajadain
Copy link
Member Author

rajadain commented Sep 7, 2017

Created #2236 for the sliding issue described above.

@jfrankl
Copy link
Contributor

jfrankl commented Sep 12, 2017

Two suggestions that I think will improve the visibility of the spinner.

  1. Move the spinner to the center of the header
  2. Switch the spinner style to the style recommended in Improve styling for "model running" #1848 (comment) (message me for CSS)

kb1eclfcq4

Also, please make the following changes so the application matches the specifications in #2134 (comment):

  1. Only the bars in the bar graphs or numbers inside the table should change opacity. Axis labels, headings, etc. should not change opacity.
  2. Please remove the transition on the opacity change. It should feel like it's "snapping back" into place.

@rajadain
Copy link
Member Author

I think we should use the new spinner, and later add it to the modeling sidebar. Since this is a new component, I'm more confident about including a new visual element here. With the new wave spinner, should it also be centered?

I'll await the wave spinner CSS on Slack, will implement the rest now.

@jfrankl
Copy link
Contributor

jfrankl commented Sep 12, 2017

Yes, I think it should also be centered.

@rajadain
Copy link
Member Author

Pushed up some fixups. This is what it looks like now:

2017-09-12 16 01 51

I was unable to remove the opacity transition from the bar charts, because we also use it for hiding them as they slide. But they look pretty snappy to me ...

@ajrobbins
Copy link

Looking good to me.

@rajadain
Copy link
Member Author

Great. I'll squash and merge once @jfrankl has had a chance to take a look.

@rajadain
Copy link
Member Author

Squashing and merging now.

We introduce a new `polling` boolean attribute on the Compare
Window model, false by default, which reflects whether the window
is currently in a state of polling or not. This is contingent on
any of the scenarios having any results that are polling.

To do this, we first collect all the `polling` attributes in each
of the result in each scenario, and then flatten it to a single
array. Then we use `Array.some` which takes a function and returns
true if it evaluates to a truthy value for any of the values.
Since the values are already boolean, we simply use `_.identity`
as the evaluating function.
When the Window Model has `polling` set to true, the sections
region containing charts or tables will appear faded. It will
come back into saturation once the polling stops. This change
is animated in the same manner as all other animations in the
Compare Window.

This does not impede user interactivity. They can still hover
over the charts and select text in tables.
Add a spinner on the top middle, left of the precipitation slider,
to be shown when the scenarios are polling.

This uses a new spinner which is sleeker and faster than the usual
fa-circle-o-notch used elsewhere in the app. Eventually, all of those
should be replaced with this.

squash! Add spinner on poll

The spinner is now in the middle of the screen, rather than the top-right.
@rajadain rajadain force-pushed the tt/compare-view-revamp-loading-states branch from b812122 to d1fc31f Compare September 13, 2017 15:31
@rajadain rajadain merged commit a4de7a3 into develop Sep 13, 2017
@rajadain rajadain deleted the tt/compare-view-revamp-loading-states branch September 13, 2017 15:32
@rajadain
Copy link
Member Author

Thanks for all the feedback and support!

@rajadain rajadain mentioned this pull request Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants