graphspace_python.graphs.formatter package¶
Submodules¶
graphspace_python.graphs.formatter.json_formatter module¶
-
class
graphspace_python.graphs.formatter.json_formatter.
CyJSFormat
[source]¶ Bases:
object
-
static
clean_graph_json
(original_json_string)[source]¶ Converts original_json_string in CyJS format such that its compatible with Graphspace’s json format.
- Changes to node attributes:
- It will copy id value to the name attribute, even if the name attribute is provided by the user.
- If label is used in data attributes, it will copy label value to content attribute in style attributes.
- If content is missing, it will add default value of name of the node
- Convert all shape values to lower case.
- Convert shape value to default value of ellipse, if a wrong value is given.
- Changes to edge attributes:
- Add name attributes to edge data attributes.
- Add default target-arrow-shape value of none if not given by the user.
- Changes to graph attributes/metadata:
- If no name is provided change the name to “graph_{{current timestamp}}”
-
static