-
Notifications
You must be signed in to change notification settings - Fork 21
Add documentation on building custom components for apps and distributing as packages #46
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
Conversation
|
It's not critical but some of the stuff in the article would benefit by posit-dev/py-shiny#874 being merged so that the templates the users would get when "playing along" match the article code more closely. |
wch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm only partway through, but I'm submitting this now to get some comments out.
Co-authored-by: Winston Chang <[email protected]>
7641bde to
274d587
Compare
docs/custom-component-one-off.qmd
Outdated
|
|
||
| `_fn` is the function that is being decorated. Aka the function that goes below the `@render_tabulator()` in your app's server code. In this case we are expecting that that function returns either a pandas dataframe or `None`. | ||
|
|
||
| In the code above we use types so that we can get some type checking in our IDE, but these are not required. Also note that the decorated function is an async function, so we need to use the `await` keyword when we call it for `resolve_value_fn()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the sudden talk about async might confuse people or scare them here. We should tell people if the function must be async, or if it is just optionally async.
If it must be async, we should tell people that, and also say they can just write their code in a way that ignores that.
If it is optional whether the function is async, then I think it would be better if example was not async, and then mention in a sentence or a callout that it can be async.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved some stuff around and added a callout about the async-ness. It's a bit awkward because it's required to allow the user to be uninhibited with their function return type, but in this article, we are the user so in theory that flexibility is not needed.
Co-authored-by: Winston Chang <[email protected]>
d682150 to
2535972
Compare
gshotwell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I submitted these earlier, so feel free to ignore them if the draft has moved past them. The main suggestion is to use the templating flag shiny create -t js-react to get people right to the template.
Co-authored-by: Gordon Shotwell <[email protected]>
Co-authored-by: Gordon Shotwell <[email protected]>
…option handles choices for user.
No description provided.