def serialize_template(template: layout.Template) -> dict:
        """Serialize a plotly template.

        Args:
            template: The template to serialize.

        Returns:
            The serialized template.
        """
        return {
            "data": json.loads(str(to_json(template.data))),
            "layout": json.loads(str(to_json(template.layout))),
        }
Serialize a plotly template.

        Args:
            template: The template to serialize.

        Returns:
            The serialized template.
        
reflex/utils/serializers.py