Closed jaraco closed 8 years ago
Originally reported by: Oronis (Bitbucket: Oronis, GitHub: Oronis)
Add a config property for setting where to include the width and height declaration items in svg.charts.graph.start_svg().
A very simple patch (because I'm too lazy to look up etree) would be to include a class attribute explicit_size = false then in the start_svg section:
#!python if self.explicit_size: self.root = etree.Element(SVG+"svg", attrib={ 'width': str(self.width), 'height': str(self.height), 'viewBox': '0 0 %s %s' % (self.width, self.height), '{http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/}scriptImplementation': 'Adobe', }, nsmap=NSMAP) else: self.root = etree.Element(SVG+"svg", attrib={ 'viewBox': '0 0 %s %s' % (self.width, self.height), '{http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/}scriptImplementation': 'Adobe', }, nsmap=NSMAP)
Original comment by Jason R. Coombs (Bitbucket: jaraco, GitHub: jaraco):
Add a hook to allow customization of attributes added to the root SVG element. Fixes #4
Oh. I see now the code does include those attributes. You want a way to suppress them.
Is there any reason not to include always the size attributes?
Originally reported by: Oronis (Bitbucket: Oronis, GitHub: Oronis)
Add a config property for setting where to include the width and height declaration items in svg.charts.graph.start_svg().
A very simple patch (because I'm too lazy to look up etree) would be to include a class attribute explicit_size = false then in the start_svg section: