def svg_repr(self):
        """Return node as an svg group element.

        Used to represent the node and its elements when
        exporting the node graph to a .svg file.
        """
        ### group containing node subelements
        node_g = Element("g", {"class": "node operator_node"})

        ###

        outline_deflation = NODE_OUTLINE_THICKNESS * 2

        body_rect = self.body.rect.inflate(
            -outline_deflation,
            -outline_deflation,
        )

        x, y, width, height = body_rect

        ###

        is_commented_out = self.data.get("commented_out", False)

        ### body

        node_g.append(
            Element(
                "rect",
                {
                    "x": str(x),
                    "y": str(y),
                    "width": str(width),
                    "height": str(height),
                    "class": (
                        "commented_out_body" if is_commented_out else "normal_body"
                    ),
                },
            )
        )

        ### big chars

        mode_name = self.data.get('mode', 'expanded_signature')

        string = self.data["operation_id"]
        centerxs = CHAR_CENTERXS_MAP[(string, mode_name)]
        flags = CHAR_FILTERING_MAP[string]

        char_flag_pairs = [
            (char, flag) for char, flag in zip(string, flags) if char != " "
        ]

        left = self.rect.left + (12 if mode_name == 'expanded_signature' else 6)
        bottom = self.rect.bottom + -11

        state = "commented_out_big_" if is_commented_out else "normal_big_"

        for ((char, flag), centerx) in zip(char_flag_pairs, centerxs):

            class_name = state + ("ab_text" if flag else "op_text")

            tx_str, ty_str = map(str, (left+centerx, bottom))

            char_text = Element(
                "text",
                {
                    "x": tx_str,
                    "y": ty_str,
                    "text-anchor": "middle",
                    "class": class_name,
                },
            )

            char_text.text = char

            node_g.append(char_text)

        ### node's label

        tx_str, ty_str = map(
            str,
            self.label.rect.move(2, -4).midbottom,
        )

        label = Element(
            "text",
            {
                "x": tx_str,
                "y": ty_str,
                "text-anchor": "middle",
                "class": (
                    "commented_out_small_text"
                    if is_commented_out
                    else "normal_small_text"
                ),
            },
        )

        label.text = f"{self.id}"

        node_g.append(label)

        ### input sockets and param text

        for socket in self.input_sockets:

            node_g.append(socket.svg_repr())

            tx_str, ty_str = map(
                str,
                socket.rect.move(0, -3).bottomright,
            )

            param_text = Element(
                "text",
                {
                    "x": tx_str,
                    "y": ty_str,
                    "class": (
                        "commented_out_small_text"
                        if is_commented_out
                        else "normal_small_text"
                    ),
                },
            )

            param_text.text = socket.parameter_name

            node_g.append(param_text)

        ### output socket
        node_g.append(self.output_socket.svg_repr())

        ##
        return node_g
Return node as an svg group element.

        Used to represent the node and its elements when
        exporting the node graph to a .svg file.
        
nodezator/graphman/operatornode/export.py