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 callable_node"})

        ###

        node_rect = self.top_rectsman.copy()
        node_rect.height = self.rect.height

        outline_deflation = NODE_OUTLINE_THICKNESS * 2

        node_rect = node_rect.inflate(
            -outline_deflation,
            -outline_deflation,
        )

        x, y, width, height = node_rect

        ###
        color_identifier = self.get_color_identifier()

        ###

        ### node fill

        node_g.append(
            Element(
                "rect",
                {
                    "x": str(x),
                    "y": str(y),
                    "width": str(width),
                    "height": str(height),
                    "rx": CORNER_RADIUS_X_STR,
                    "ry": CORNER_RADIUS_Y_STR,
                    "class": (
                        "commented_out_fill"
                        if self.data.get("commented_out", False)
                        else "normal_fill"
                    ),
                },
            )
        )

        ### node header

        ## fill

        title_rect = self.title_text_obj.rect

        path_directives = (
            f"M{node_rect.x} {title_rect.move(0, 3).bottom}"
            f" l{node_rect.w} 0"
            f" l0 -{title_rect.h-4}"
            " q0 -8 -8 -8"
            f" l-{node_rect.w-16} 0"
            " q-8 0 -8 8"
            f" l0 {title_rect.h-4}"
            " Z"
        )

        header_fill_class_name = f"header_fill_{color_identifier}"

        node_g.append(
            Element(
                "path",
                {
                    "d": path_directives,
                    "class": header_fill_class_name,
                },
            )
        )

        ## outline

        node_g.append(
            Element(
                "path",
                {
                    "d": path_directives,
                    "class": "header_outline",
                },
            )
        )

        ### id bg rect

        id_text_rect = self.id_text_obj.rect

        id_bg_rect_class_name = f"id_bg_rect_{color_identifier}"

        node_g.append(
            Element(
                "rect",
                {
                    "x": str(id_text_rect.x),
                    "y": str(id_text_rect.y),
                    "width": str(id_text_rect.width),
                    "height": str(id_text_rect.height),
                    "class": id_bg_rect_class_name,
                },
            )
        )

        ### node's id

        idx_str, idy_str = map(
            str,
            id_text_rect.move(0, -4).midbottom,
        )

        id_text = Element(
            "text",
            {
                "x": idx_str,
                "y": idy_str,
                "text-anchor": "middle",
                "class": "id_text",
            },
        )

        id_text.text = str(self.id)

        node_g.append(id_text)

        ### node outline

        node_g.append(
            Element(
                "rect",
                {
                    "x": str(x),
                    "y": str(y),
                    "width": str(width),
                    "height": str(height),
                    "rx": CORNER_RADIUS_X_STR,
                    "ry": CORNER_RADIUS_Y_STR,
                    "class": "outline",
                },
            )
        )

        ###
        self.mode_dependent_elements_svg_repr(node_g)

        ### node's title

        tx_str, ty_str = map(
            str,
            title_rect.move(0, -3).midbottom,
        )

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

        title.text = self.title_text

        node_g.append(title)

        ###
        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/callablenode/export.py