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

[doc] Revise doc for GUI system. #4006

Merged
merged 7 commits into from
Jan 26, 2022
Merged

Conversation

Leonz5288
Copy link
Contributor

Shrunk GUI doc a lot. This is my first revision. What's everybody else's opinions?

@netlify
Copy link

netlify bot commented Jan 12, 2022

✔️ Deploy Preview for jovial-fermat-aa59dc ready!

🔨 Explore the source changes: fc67ab9

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/61dfc6c25ccd5b0007fe16fc

😎 Browse the preview: https://deploy-preview-4006--jovial-fermat-aa59dc.netlify.app

@Leonz5288 Leonz5288 marked this pull request as draft January 12, 2022 08:12
docs/lang/articles/misc/gui.md Outdated Show resolved Hide resolved
docs/lang/articles/misc/gui.md Outdated Show resolved Hide resolved
docs/lang/articles/misc/gui.md Outdated Show resolved Hide resolved
docs/lang/articles/misc/gui.md Outdated Show resolved Hide resolved
Copy link
Contributor

@writinwaters writinwaters left a comment

Choose a reason for hiding this comment

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

Minor editorial updates.

docs/lang/articles/misc/gui.md Outdated Show resolved Hide resolved
docs/lang/articles/misc/gui.md Outdated Show resolved Hide resolved
docs/lang/articles/misc/gui.md Outdated Show resolved Hide resolved
docs/lang/articles/misc/gui.md Outdated Show resolved Hide resolved
docs/lang/articles/misc/gui.md Outdated Show resolved Hide resolved
docs/lang/articles/misc/gui.md Outdated Show resolved Hide resolved
@vercel
Copy link

vercel bot commented Jan 14, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/taichi-api-docs-preview/taichi/A4xEdu4sxKgytuRiyAQN21UNvphA
✅ Preview: Canceled

[Deployment for 319a960 canceled]

@netlify
Copy link

netlify bot commented Jan 14, 2022

✔️ Deploy Preview for docsite-preview ready!

🔨 Explore the source changes: 319a960

🔍 Inspect the deploy log: https://app.netlify.com/sites/docsite-preview/deploys/61efc51715fbb40008a6b69e

😎 Browse the preview: https://deploy-preview-4006--docsite-preview.netlify.app

Copy link
Contributor

@erizmr erizmr left a comment

Choose a reason for hiding this comment

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

Just few nits.

can detect the keys you pressed. It must be used together with `gui.get_event`, or it won't be updated! For
example:
`gui.is_pressed(key, ...)` detects the keys you pressed. You must use it
together with `gui.get_event`. Otherwise, it is not updated. For example:
Copy link
Contributor

Choose a reason for hiding this comment

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

Will it won't be updated be more clear?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is simply a style issue. Avoid future tense and contraction in technical writing.

@@ -442,8 +247,8 @@ while gui.running:

## Image I/O

[`ti.imwrite(img, filename)`](https://api-docs.taichi.graphics/src/taichi.misc.html?highlight=imwrite#taichi.misc.image.imwrite)
can export a `np.ndarray` or Taichi field (`ti.Matrix.field`, `ti.Vector.field`, or `ti.field`) to a specified location `filename`.
`ti.imwrite(img, filename)` exports an `np.ndarray` or a Taichi field
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we don't need an an but an a for np.ndarray?

Copy link
Contributor

Choose a reason for hiding this comment

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

It ought to be "an" here. The pronunciation of np is /'en'pi:: /, which starts with a vowel.

Copy link
Contributor

@erizmr erizmr left a comment

Choose a reason for hiding this comment

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

LGTM!

@Leonz5288 Leonz5288 marked this pull request as ready for review January 19, 2022 06:56
@neozhaoliang
Copy link
Contributor

neozhaoliang commented Jan 21, 2022

Hi, thanks for this update. Could you add the following topics to the content?

  • The coordinate system used by GUI (e.g. get_cursor_pos())
  • How can I display a numpy.ndarry in GUI?
  • How can I display a taichi.field in matplotlib?
  • How can I get/set fps of the gui?
  • Add a simple example for catching various mouse events? like this shadertoy demo
  • How to set attributes like position, color, callback functions of the buttons/sliders?
  • How can I set the start-up window location of the GUI?
  • How to resize the GUI using mouse drag?

@Leonz5288
Copy link
Contributor Author

I have addressed numpy and fps part in the latest commit.
For the rest of the comments, some are mentioned in the examples, others are too detailed to me. We also discussed about this in the meeting, we thought original doc for GUI is way too specific and therefore deleted a lot. For detailed APIs, referring to API doc is better than listing them in GUI doc.

@Leonz5288
Copy link
Contributor Author

/format

@Leonz5288 Leonz5288 requested a review from k-ye January 24, 2022 03:02
Copy link
Contributor

@erizmr erizmr left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@writinwaters writinwaters left a comment

Choose a reason for hiding this comment

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

LGTM!

@neozhaoliang
Copy link
Contributor

The subsection Display a window is really talking about saving to images files, with no hints on what img is?

Also, shall we expand the subsection paint on window to two parts like paint Taichi fields/NumPy arrays and paint geometry primitive shapes?

Copy link
Contributor

@lin-hitonami lin-hitonami left a comment

Choose a reason for hiding this comment

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

LGTM!

@Leonz5288 Leonz5288 merged commit 6c528f7 into taichi-dev:master Jan 26, 2022
@Leonz5288 Leonz5288 deleted the gui_doc branch January 26, 2022 06:38
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

6 participants