Browse Source

Fix non namespaced svg (without embed) javascript by adding uuid in config object. (config is in window.pygal now).

pull/264/head
Florian Mounier 9 years ago
parent
commit
ef95c1c085
  1. 5
      docs/changelog.rst
  2. 11
      pygal/svg.py

5
docs/changelog.rst

@ -2,11 +2,12 @@
Changelog
=========
2.0.2 UNRELEASED
=================
2.0.2
=====
* Fix view box differently to avoid getting a null height on huge numbers. (#254)
* Fix broken font_family default
* Fix non namespaced svg (without embed) javascript by adding uuid in config object. (config is in window.pygal now).
2.0.1
=====

11
pygal/svg.py

@ -147,9 +147,14 @@ class Svg(object):
l.get('title') if isinstance(l, dict) else l
for l in self.graph._legends + self.graph._secondary_legends]
common_script.text = " = ".join(
("window.config", json.dumps(
dct, default=json_default)))
common_js = 'window.pygal = window.pygal || {};'
common_js += 'window.pygal.config = window.pygal.config || {};'
if self.graph.no_prefix:
common_js += 'window.pygal.config = '
else:
common_js += 'window.pygal.config[%r] = ' % self.graph.uuid
common_script.text = common_js + json.dumps(dct, default=json_default)
for js in self.graph.js:
if js.startswith('file://'):

Loading…
Cancel
Save