Skip to content

Instantly share code, notes, and snippets.

@sverhoeven
Created October 2, 2020 09:40
Show Gist options
  • Save sverhoeven/37befc5375162cb33235a9210ba525a4 to your computer and use it in GitHub Desktop.
Save sverhoeven/37befc5375162cb33235a9210ba525a4 to your computer and use it in GitHub Desktop.
run-cpp-on-web: vega
const equation_line = {
"data": {"sequence": {"start": -4, "stop": 4, "step": 0.1, "as": "x"}},
"transform": [
{
"calculate": "2 * datum.x * datum.x * datum.x - 4 * datum.x * datum.x + 6",
"as": "y"
}
],
"mark": "line",
"encoding": {
"x": {"type": "quantitative", "field": "x"},
"y": {"field": "y", "type": "quantitative"},
"color": {"value": "#f00"}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment