Use a built/bundled version of iventure-jsviz.js#61
Open
Conversation
fsaad
reviewed
Jul 5, 2017
src/jsviz/jsviz.py
Outdated
| return Javascript(script.format(host=host, port=port)) | ||
|
|
||
|
|
||
| def whenReady(script): |
Collaborator
There was a problem hiding this comment.
No camelcase for function names in python, when_ready.
fsaad
reviewed
Jul 5, 2017
src/jsviz/jsviz.py
Outdated
|
|
||
|
|
||
| def whenReady(script): | ||
| """execute your JS script when iventure-jsviz is ready""" |
Collaborator
There was a problem hiding this comment.
Docsting should be punctuated as full sentence, and avoid vague references .e.g "your" (whose?)
"""Execute JS script when iventure-jsviz is ready."""
fsaad
reviewed
Jul 5, 2017
| return whenReady( | ||
| 'interactive_bar(cell, %s)' % ( | ||
| df.to_json(orient='split') | ||
| ) |
Collaborator
There was a problem hiding this comment.
For string formatting with a % sign and a single parameter, force the argument into a tuple using a trailing-comma (this behavior is needed mostly to handle python quirks):
return when_ready('interactive_bar(cell, %s)' % (df.to_json(orient='split'),))
Contributor
|
@gnarf: Can you write a README for how to use this? |
Contributor
Author
|
Sure, just hadn't quite gotten there yet
The questions asked by fsaad in slack were a good source for "what to write
in readme"
…On Thu, Jul 6, 2017 at 12:11 PM, riastradh-probcomp < ***@***.***> wrote:
@gnarf <https://github.com/gnarf>: Can you write a README for how to use
this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#61 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAhh69QQMk9KZsNcnYrbOCavaAiRuhHfks5sLQcUgaJpZM4OOpPH>
.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This uses the output from a
npm run buildfrom https://github.com/probcomp/iventure-jsviz/pull/5 which creates adist/iventure-jsviz.js