Skip to content

Commit

Permalink
Merge pull request #2584 from ploxiln/encodeHeader_only_svg
Browse files Browse the repository at this point in the history
render: only encodeHeader() for svg output
  • Loading branch information
piotr1212 authored Apr 19, 2020
2 parents c262680 + 70a8a58 commit 910bdea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webapp/graphite/render/glyph.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,12 @@ def drawLegend(self, elements, unique=False): #elements is [ (name,color,rightSi
y += lineHeight

def encodeHeader(self,text):
"""
Puts some metadata in the generated svg xml that is not inside the frame.
This can be used to manipulate the svg later on with a framework like d3.
"""
if self.outputFormat != 'svg':
return
self.ctx.save()
self.setColor( self.backgroundColor )
self.ctx.move_to(-88,-88) # identifier
Expand Down

0 comments on commit 910bdea

Please sign in to comment.