#include <gvc++/GVRenderData.h>
SVGAnalyzer::SVGAnalyzer(char *text)
- : m_svg(SVG::SVGElement(SVG::SVGElementType::Svg)) {
+ : m_original_svg(text), m_svg(SVG::SVGElement(SVG::SVGElementType::Svg)) {
m_elements_in_process.push_back(&m_svg);
SvgppContext context{this};
traverseDocumentWithSvgpp(context, text);
return SVGAnalyzer{result.c_str()};
}
+std::string_view SVGAnalyzer::original_svg() const { return m_original_svg; }
+
void SVGAnalyzer::set_transform(double a, double b, double c, double d,
double e, double f) {
current_element().attributes.transform = {a, b, c, d, e, f};
std::size_t num_rects() const { return m_num_rects; };
std::size_t num_texts() const { return m_num_texts; };
std::size_t num_titles() const { return m_num_titles; };
+ /// Return a view of the original SVG
+ std::string_view original_svg() const;
void set_graphviz_version(std::string_view version);
void set_graphviz_build_date(std::string_view build_date);
std::string svg_string(std::size_t indent_size = 2) const;
std::size_t m_num_titles = 0;
/// A list of Graphviz recreated graphs
std::vector<GraphvizGraph> m_graphs;
+ /// The original SVG document
+ std::string m_original_svg;
/// The top level SVG `svg` element corresponding to the Graphviz graph
SVG::SVGElement m_svg;
};