-
Notifications
You must be signed in to change notification settings - Fork 133
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
How to support signals in dl.template #33
Comments
Collecting the properties accessed is straightforward, so that's not problem. The API I am thinking of is to pass a hash as an additional optional argument to I agree that running An alternative might be to "wrap" the signals and datum in a shared object that you can reuse (no new object allocations): In any case, how were you planning to differentiate data variable names from signal names? We must use some form of name spacing otherwise collisions might occur. |
So, following up our discussion yesterday of handlebar syntax to support dl.template.source("{{datum[signalA.foo]}}", "hello", props={})
props = { 'datum[signalA.foo]': 1 }; // should be {'datum': 1, 'signalA': 1} Alright, so CSS doesn't have parent selectors but proposals have coalesced around two options:
And of course, they can be chained like so: |
Right now, the function produced by
dl.template.source
take a single argument for the data object to parse the handlebars against. In Vega, signals are not namespaced, and I'm wondering how best we should support them withtemplate
. Some ideas:dl.extend
to passdl.template
an object containing bothitem.datum
properties andsignals
.dl.template
function to take vargs, and iterate through them until the property is found.I prefer the second option, as running
dl.extend
on every tuple every time an encoder is overly expensive.In either case, I also need to know which signals are being used within a template expression, in order to compile the signal values and send them into the encoder. i.e., I need from
dl.template
a list of the handlebar strings used.The text was updated successfully, but these errors were encountered: