Vega Transform Timestamp to date

In vega-lite I can transform timestamp into time type after reading it from index as follows:

transform: [{calculate: "toDate(datum._source['measure_date_time'])", as: "time"} ]

what is the equivalent for this in vega? I couldn't find any documentation on transform to timestamp as time in vega docs.

When converting between the two types, I usually use the online Vega editor and export my vega-lite spec into Vega.

In this case, you probably need to replace this with the Vega "formula": https://vega.github.io/vega/docs/transforms/formula/

Transforms in Vega go into the data section, which is different from Vega-lite: https://vega.github.io/vega/docs/transforms/

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.