Leverage node data
Context
Model Explorer allow to apply node data by specifying a node id: https://github.com/google-ai-edge/model-explorer/wiki/4.-API-Guide#custom-node-data
However when we are manipulating our model we are not sure on what the id of nodes will be.
Furthermore, if we want to style our graph based on meta data computed by add_attributes
or add_metadata
they are available only when converting the graphview to the model explorer IR.
Solutions
Use attributes
We could store the informations inside of the Aidge node via the Attribute system.
However, this solution will not work for attribute added with add_attributes
.
Register callable
I know, I know, when we have a hammer everything looks like a nail ...
This solution is to register callables that will return the node data based on the node.