h2oai / wave

Realtime Web Apps and Dashboards for Python and R
https://wave.h2o.ai
Apache License 2.0
3.97k stars 327 forks source link

Suggestions for Improving Tour.py #353

Closed mtanco closed 3 years ago

mtanco commented 3 years ago

Reoccuring feedback from new Wave Developers: There are too many examples in documentation (tour), and many of them are too niche or small in functionality to help me get up and coding fast.

Suggestions:

@lo5 as per our conversation I will let you, @mturoci, @VijithaEkanayake, and @dulajra actually make these changes. But this is what I would do if I were to take a stab at this project

@LenaRampula and @meganjkurka please review as I know you have thoughts on this too!

LenaRampula commented 3 years ago

TODO For Faker: Issue Tracker, Dashboard, and Stats. Stats will be updated after #370 will be merged.

Issue Tracker and Dashboard require some more thought.

geomodular commented 3 years ago

Related issues https://github.com/h2oai/wave/issues/280 https://github.com/h2oai/wave/issues/31

LenaRampula commented 3 years ago

@mtanco @lo5 I went through the third-party plots trying to put them all in one example. It becomes way too complicated. Each example has its own dependencies and the examples for each type are quite long.

I suggest we leave the third party plots for now. Maybe just renaming from "Plot / Library" for better readability.

We can merge the vegalite examples into one.

None of the third party examples use fake data. But the altair example uses vega_datasets. Maybe we could replace it with the data used for native plots.

Let me know what you think.

LenaRampula commented 3 years ago

@mtanco @lo5

Image.py and frame.py and frame_path.py can go away - actually I am feeling lazy to write them all, the small example x_card.py files can go away - people can find this in the ui api docs

I think we should keep those. frame.py and frame_path.py can be in one example. image.py needs a better explanation for the required format. I had to struggle a bit to get an existing png into the right form.

We could also combine all the text display examples into one: text, markdown, header, label, link, markup, separator.

lo5 commented 3 years ago

@mtanco @LenaRampula

I don't see any reason why multiple examples need to be combined into one.

The examples were separate for a reason: we don't want users to have to go through 200 lines of code just to figure out how to use a single component.

For example, the individual stats cards combined is similar to dashboard.py (which demonstrate how to use them together), but they each have their individual examples as well so that we can cover their nuances.

If the problem is that the examples themselves are poor, then we should try to fix the individual examples.

In general, we have to address this on three fronts:

  1. Tour - Demonstration of techniques: super-short examples that show a bit of code and what the end result looks like.
  2. Wave Apps: Demonstrate how to weave cards/components together to make complete apps.
  3. Kitchen Sink: We're working on this to be an exhaustive display of what is capable in Wave visually (e.g. all cards, all components, all kinds of layouts) - to demonstrate the breadth of capabilities in the front-end.
lo5 commented 3 years ago

@LenaRampula - Thanks for the PRs!

How do you think should we proceed with #387 #383 #381 and #374? I'll not be merging those PRs directly, mainly for the reason I stated above - they remove the short examples and replace them with larger examples.

Instead, it's preferable to:

In all cases, having several, short PRs that address specific concerns is preferable to those four - they'll get merged quickly.

LenaRampula commented 3 years ago

@lo5 Here is how I was thinking about it: We have about 180 examples. It's very difficult to orient in them. Some of the examples are complex and some are very simple with only one parameter differentiating one example from another. The short examples that specifically describe single components could be very helpful in the API reference (similar to Pandas docs). Those examples could be limited to the use of a single component without the whole app definition. In the examples sections, I would find it more useful to have a handful of more condense examples that solve a specific area: Text, Table, Plots, Navigation, etc. They don't need to cover everything that is available but to give a new user an idea of where they could start. They could copy the code and adjust it to their needs.

If you absolutely disagree that we need to decrease the number of examples we need at the very least:

lo5 commented 3 years ago

From your comments, PRs and the original issue above:

I don't understand the motivation behind "There are too many examples", "It's very difficult to orient in them." and "the 20+ is scary to people". I think we need more examples, not less, especially for data visualizations, where it's next to impossible to find a code snippet for what you need using the name or description of the example - it's way easier to scroll through a gallery of pictures of visualizations, find one, then tweak from there.

If anything, we need more examples. Our Q1/Q2 roadmap has an additional 150+ cards and components. We don't expect users to browse through the docs menu to find examples. If "there are too many examples" really means "it's too difficult to find/navigate examples", there are other ways to solve it (instead of merging examples into bigger files):

Search can also solve the problem of "how can I easily figure out how to do X".

I would find it more useful to have a handful of more condense examples that solve a specific area...

We'd be happy to accept PRs for new examples and tutorials. The current list of tutorials and examples is by no means complete, and we have to continue improving them over time.

Replace Faker and Synth with simple data frames

31 was already planned, and predates this issue. It takes time and effort to think of real-world datasets and variable names to suit each example.

I wrote synth.py to generate realistic-looking time-series data for demo'ing our realtime vis use cases. I'd love to see a counter-proposal that preserves that behavior. We can add new examples that show hard-coded data - PRs welcome.

Faker and metasyntactic variables are a quick way to push new examples out when we get asked by app authors "how do I do X". We know they're not ideal, and we do this with the understanding that we will improve them when we have time. If you have better ideas, we'd love to have PRs with improved examples.

Add comments in the code

So like I said above, PRs for improving our current examples (without merging/combining) are more than welcome.

Consider renaming the titles of the examples and introduce a hierarchy

Good suggestion.

Avoid using structures that may confuse an average python user (e.g. ${{intl qux minimum_fraction_digits=2 maximum_fraction_digits=2}}')

I'd love to see a counter proposal to the data-binding and internationalization API that will solve the same problem more elegantly.

LenaRampula commented 3 years ago

I don't understand the motivation behind "There are too many examples"

The feedback is mainly for the difficulty to get started. The list of examples doesn't help me understand how to use the components. Hierarchy and better naming could help. I guess the question is, can a new user find what they are looking for? Can they easily adopt the code? The gallery is nice but when you have 3 examples on Tabs, for example, it's hard to understand which one you should use.

I guess I got used to expecting the examples to follow the API reference. This way I can skim through the definition and see what is required, and then copy the code at the end of the reference.

We'd be happy to accept PRs for new examples and tutorials. The current list of tutorials and examples is by no means complete, and we have to continue improving them over time.

Would you like to add tutorials that go through the native plots, text options, navigation options, a selection of basic cards to start with (something like: "the first cards to master"). I think I could adapt the work done till now to put something together.

It takes time and effort to think of real-world datasets and variable names to suit each example.

I think it's more important for the user to understand the required data structure than having "real" data. It is preferable the examples could be used as-is (not depending on the examples directory for synth.py or on an external library like Faker). And a hard coded data frame cannot be huge. I can improve the data I used in native_plot.py to be more real-like and create new PRs for replacing those in each of the examples separately.

I'd love to see a counter proposal to the data-binding and internationalization API that will solve the same problem more elegantly.

I'm not sure what that means. I never saw this syntax before, and I'm not sure if there is a more pythonic way to do it. I would guess I'm not the only one who would not be familiar with it. If there is no other way to do it, it would be great to explain it in a comment.

I'll close my PRs, as they are not going to be merged. If you'll agree with the tutorial suggestions, I'll create new PRs for those. If you are ok with real looking small data frame to replace synth and faker, I can do this.

surenH2oai commented 3 years ago

@LenaRampula if you are looking for good starter sample/example wave applications you can find them here https://github.com/h2oai/wave-apps. You can also work with @mtanco and the wave sample application team to come up with more sample apps or ideas.

As per "examples"/tour, https://h2oai.github.io/wave/docs/examples The more the better for all possible UI Elements because the goal of these examples is for a python developer to easily understand how to use these components, not to teach them python nor teach them how to develop "client server web application", which is done through the sample OSS wave applications we have made available via "wave-apps" in a public repo.

The team has been working super hard to meet the Q4 deliverables both on WAVE SDK and WAVE Cloud side of things. There is lot to do but very limited time, the team is prioritizing most important features need to be delivered in the most efficient way possible.

For more concise feedbacks and to find the roadmap of WAVE, please feel free to setup quick sync with the team over zoom/slack is more efficient than via Github.

mtanco commented 3 years ago

Perhaps this will change with wave-apps (although some of these should probably be simplified some) and search, but almost every single person internally who has built their first wave app has been overwhelmed by the examples and did not know where to start or how to find what they needed or when to choose one of multiple options (like tabs for example where there are 3 different examples). There are many questions in #wave that say things like " I am copying tabs but how do I save the data" or people ask a question that is answered by and example and they say "oh I couldn't find that thanks!" or they explicitly say "There were a lot of examples and I didn't know how to find what I needed"

So this issue was specifically around: how do we make your first week Wave developing easier.

Would we agree that to start we could:

(and #31 which is already and issue).

lo5 commented 3 years ago

This discussion has too many fleeting generalizations. We need specifics.

Different people have different experiences getting started based on prior experience or skills, so attempting to represent the "average Python user" is not productive. We have 60+ apps already, and there's plenty of evidence that once you grok the mental model, your productivity skyrockets - we regularly see folks turning around with new apps in hours. We'll be producing video tutorials and walkthroughs in 2021 that will ease the getting started experience - we just haven't had time to do it.

Instead of continuing the discussion, let's do what we've always been doing:

  1. Identify one small aspect of the individual docs pages or examples that bothers you. If you can fix it, send us a PR, and we'll be happy to merge. If not, file an issue: "it's not clear to me why ", "how can I do ?", etc., and the team will happily address it.
  2. Repeat.

Thanks in advance!