Some code for generating graphs from unit tests runs or other contexts where you want to visualize the dynamic behavior of an XState machine.
node src/address-book.js config |
unflatten |
dot -Gsize=15,15\! -Gdpi=100 -Tpng > graph.pngIf you load this in emacs and open a file with a JSON buffer, the command M-x fwoar/dive will let you type a key
and replace the contents of the buffer with either the value of the corresponding key (if the JSON value of the buffer
is an object) or an array of the corresponding value for each object in an array (if the JSON value of the buffer is an
array). M-x fwoar/return will pop the most recently used key off the stack and replace the buffer contents with the
corresponding contents of the original JSON object.
This is mainly a prototype, but it's already useful for quickly zooming in on large JSON documents.
Testing
Seeing if this is still a thing
| (defclass backwards-compatible-class (standard-class) | |
| ()) | |
| (defmethod sb-mop:validate-superclass ((class backwards-compatible-class) | |
| (superclass standard-class)) | |
| t) | |
| (defmethod initialize-instance :before ((instance backwards-compatible-class) | |
| &key (direct-slots)) | |
| (:printv :initialize direct-slots)) |
| { | |
| lib, | |
| config, | |
| pkgs, | |
| emacs-pkgs, | |
| fwoar-pkgs, | |
| ... | |
| }: { | |
| home.packages = [ | |
| pkgs.crawlTiles |