Last active
November 18, 2023 03:23
-
-
Save MichaelDrogalis/6ad081ba3abcc428a74df7b32ff2a052 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"generators": [ | |
{ | |
"table": "sensors", | |
"vars": { | |
"id": { | |
"_gen": "oneOf", | |
"choices": ["sensor-1", "sensor-2", "sensor-3", "sensor-4", "sensor-5"] | |
} | |
}, | |
"row": { | |
"sensorId": { | |
"_gen": "var", "var": "id" | |
}, | |
"timestamp": { | |
"_gen": "formatDateTime", | |
"ms": { | |
"_gen": "now" | |
} | |
} | |
}, | |
"stateMachine": { | |
"_gen": "stateMachine", | |
"for": { | |
"_gen": "var", | |
"var": "id" | |
}, | |
"initial": "start", | |
"transitions": { | |
"start": "update", | |
"update": "update" | |
}, | |
"states": { | |
"start": { | |
"row": { | |
"value": { | |
"_gen": "normalDistribution", | |
"mean": 50, | |
"sd": 5 | |
} | |
} | |
}, | |
"update": { | |
"row": { | |
"value": { | |
"_gen": "add", | |
"args": [ | |
{ | |
"_gen": "uniformDistribution", | |
"bounds": [-1, 1] | |
}, | |
{ | |
"_gen": "previousEvent", | |
"path": [ "row", "value" ] | |
} | |
] | |
} | |
} | |
} | |
} | |
}, | |
"localConfigs": { | |
"throttle": { | |
"ms": 1000 | |
} | |
} | |
} | |
], | |
"connections": { | |
"pg": { | |
"kind": "postgres", | |
"connectionConfigs": { | |
"host": "localhost", | |
"port": 5432, | |
"db": "mydb" | |
} | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!vd -p | |
{"longname": "open-file", "input": "data.json", "keystrokes": "o"} | |
{"sheet": "data", "col": "row", "row": "", "longname": "expand-col", "input": "", "keystrokes": "(", "comment": "expand current column of containers one level"} | |
{"sheet": "data", "col": "table", "row": "", "longname": "hide-col", "input": "", "keystrokes": "-", "comment": "Hide current column"} | |
{"sheet": "data", "col": "row.timestamp", "row": "", "longname": "type-date", "input": "", "keystrokes": "@", "comment": "set type of current column to date"} | |
{"sheet": "data", "col": "row.timestamp", "row": "", "longname": "key-col", "input": "", "keystrokes": "!", "comment": "toggle current column as a key column"} | |
{"sheet": "data", "col": "row.sensorId", "row": "", "longname": "key-col", "input": "", "keystrokes": "!", "comment": "toggle current column as a key column"} | |
{"sheet": "data", "col": "row.value", "row": "", "longname": "plot-column", "input": "", "keystrokes": ".", "comment": "plot current numeric column vs key columns; numeric key column is used for x-axis, while categorical key columns determine color"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment