Vega-expressions undefined functions
See original GitHub issueSome documented vega functions seem to not work inside of vega-expressions. Functions like toDate
and timeParse
are throwing: Error: Unrecognized function: timeParse
.
I see that, unlike other functions, they are not tested here: https://github.com/vega/vega/blob/master/packages/vega-expression/test/codegen-test.js.
Functions that do not seem to be tested are:
- Type Checking functions
- Type Coercion functions
- Formatting functions
- Color functions
- Scale functions
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Expressions | Vega
Returns true if value is not null , undefined , or NaN , false otherwise. Back to Top. Type Coercion Functions. Functions for...
Read more >Undefined data set name: "source_1" in Vega-Lite interactive ...
It looks like there's some issue with specifying the same data URL in multiple places in the chart. If you move the data...
Read more >Leaflet-vega / Andy Reagan | Observable
Rather than define vegaLayer and vega functions as methods on L object, ... bindingsContainer: undefined, ... expression parsing in Vega is global,.
Read more >VegaLite - elm-vegalite 5.3.0 - Elm Packages
Create Vega-Lite visualization specifications in Elm. This package allows you to ... Provide an expression to a map projection property function requiring a ......
Read more >Vega Reference - data Property - docs
The following properties are required: expr : An expression string to be evaluated. Expressions currently support these operators and functions. as : A...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks a lot for your answers! 😃 I will look at vega-parser and vega-runtime more closely.
That looks like it is close to what we do in Vega. However, instead of passing the external function implementations as a parameter, we bind it to the
this
context of each parsed expression. This happens in the vega-runtime package (which is invoked by the vega-view code I shared earlier). The vega-parser runs the expression parser to generate the JavaScript code; generated expression code is included within the fully parsed representation of an input Vega JSON specification, which the parser outputs. The vega-runtime library takes the code generated by the expression parser and uses the Function constructor to generate a callable function for each parsed expression.Here’s the code we use for that: https://github.com/vega/vega/blob/master/packages/vega-runtime/src/expression.js
Note that different parsed expressions may take different input arguments based on the context in which they are used in Vega (e.g., within data transforms, signal updates, encodings, etc). Common arguments include a
datum
object and the values of signals that the expression depends on (denoted as the_
object). I do not know if these more detailed concerns affect you or not…