gosling.js
gosling.js copied to clipboard
A request for the "Formula" data transform Genomespy have already provided
The "Formula" transform in Genomespy provides a flexible means to process data just-in-time, not beforehand. It can contains arithmetic and logarithmic operations. I just name a few operations here. It's very common for me to add values of two columns or add a number to values of one column. A json example from Genomespy is listed below:
{
"type": "formula",
"expr": "datum.x + datum.y",
"as": "z"
}
I suppose that Data transforms in Genomespy are a good reference to check: Data transforms in Genomespy
I think this can be a useful addition to the grammar. One limitation would be that the expression is expressed in a string format, so we cannot provide auto-completion and the debugging (e.g., typos) could be a bit challenging.
It looks Vega supports the expression, which is the one used by GenomeSpy, which we can use as well: https://github.com/vega/vega/tree/master/packages/vega-expression