-
Notifications
You must be signed in to change notification settings - Fork 12
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
Attempt to clarify substitution example paragraph #18
Open
mars0i
wants to merge
2
commits into
jsa-aerial:master
Choose a base branch
from
mars0i:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
Hi, thanks for thinking about this. Some of what you write I believe would communicate the intent better. I think the links here may just distract and the parenthetical note is either redundant or actually a bit misleading (the first argument to hc/xform can be any collection, eg. a vector.
(hc/xform [:X :Y] :X 1 :Y "hi") => [1 "hi"]
). What might be better is to not use the ':field' example at all (bringing in too many orthogonal issues), but something totally artificial. So, maybe something likeIn a template we might have a field
foo
with value:BAR
, as in{... :foo :BAR ...}. When we apply
hc/xformto the template,
:foo's value
:BARwill be replaced by the value of
:BARin the current substitution map. The value of
:BARin the current substitution map could come from in line arguments, such as
(hc/xform {... :foo :BAR ...} :BAR "hi" ...)or from the default substitution map if
:BAR` is added there, or from template local defaults.Or something along those lines.
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.
Thanks @jsa-aerial. I'll think about all of that. There are often tradeoffs between introducing new ideas and being accurate. (When I'm teaching, I sometimes tell students "What I just said isn't exactly correct, but it's close enough for now. You can take the advanced course to find out more.") I don't want to mislead, and I want to try help someone who doesn't yet have the big picture to take a step into it.
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.
Hi @mars0i, that's a good point about introduction vs 'detail/accuracy'. Since this is basically the reference document, I wonder if a nice way of "threading this needle" would be to have a simple introductory text as well. Or probably even the thing a new person would reach for first. That does seem like something that would be very valuable. At the moment, I am drowning in some other things (including more documentation for something else), so I don't think I would be able to get to it soon. Many thanks for these helpful ideas!
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.
Actually, on the 'intro' front, have you seen Kira McClean's Visualizing Data with Hanami talk from re:Clojure? It is really good - better than any I've done :-/. Hmmm, now I think of it, I should put that in the README somewhere.
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 not in a position to write a full intro document. Even if I had time, I don't feel I understand enough yet--I think you've seen evidence of that already. I still think I can probably come up with a version of that substitution example paragraph that will help someone get in to the ballpark without misleading, though.
(I attended Kira McClean's talk, and yes, it was very helpful, and it got me started--though for me at that point it was a lot at once. I'd had no experience at all with hanami, Vega-Lite, or clerk--which one needed to run to follow along (or with any grammar of graphics lib--I use Lattice not ggplot with R--or any notebook!). I'm sure I'd learn more if I went back and watched the video now, though, with pauses if need be.)
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.
Yes, that would have been a lot to onboard all at once!