Browse Source

New js

pull/242/head
Florian Mounier 10 years ago
parent
commit
4cf06087c3
  1. 3
      demo/cabaret/templates/_layout.jinja2
  2. 4
      demo/moulinrouge/__init__.py
  3. 3
      demo/moulinrouge/templates/raw_svgs.jinja2
  4. 6
      demo/moulinrouge/tests.py
  5. 3
      docs/documentation/other_customizations.rst
  6. 3
      docs/documentation/web.rst
  7. 3
      pygal/config.py
  8. 2
      pygal/svg.py

3
demo/cabaret/templates/_layout.jinja2

@ -4,8 +4,7 @@
<title>Cabaret - Online pygal graph generator</title>
<script type="text/javascript" src="{{ url_for('static', filename='components/jquery/jquery.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='components/bootstrap/docs/assets/js/bootstrap.min.js') }}"></script>
<script type="text/javascript" src="http://kozea.github.io/pygal.js/javascripts/svg.jquery.js"></script>
<script type="text/javascript" src="http://kozea.github.io/pygal.js/javascripts/pygal-tooltips.js"></script>
<script type="text/javascript" src="http://kozea.github.io/pygal.js/latest/pygal-tooltips.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js.js') }}"></script>
<link rel="stylesheet" href="{{ url_for('static', filename='components/bootstrap/docs/assets/css/bootstrap.css') }}" type="text/css" />
<link rel="stylesheet" href="{{ url_for('static', filename='css.css') }}" type="text/css" />

4
demo/moulinrouge/__init__.py

@ -293,9 +293,7 @@ def create_app():
chart.title = color
chart.disable_xml_declaration = True
chart.explicit_size = True
chart.js = [
'http://l:2343/svg.jquery.js',
'http://l:2343/pygal-tooltips.js']
chart.js = ['http://l:2343/2.0.x/pygal-tooltips.js']
for i in range(6):
chart.add(str(i), 2 ** i)
svgs.append(chart.render())

3
demo/moulinrouge/templates/raw_svgs.jinja2

@ -1,8 +1,7 @@
{% extends '_layout.jinja2' %}
{% block js %}
<script type="text/javascript" src="http://l:2343/svg.jquery.js"></script>
<script type="text/javascript" src="http://l:2343/pygal-tooltips.js"></script>
<script type="text/javascript" src="http://l:2343/2.0.x/pygal-tooltips.js"></script>
{% endblock js %}
{% block section %}

6
demo/moulinrouge/tests.py

@ -49,8 +49,7 @@ def get_test_routes(app):
@app.route('/test/bar_links')
def test_bar_links():
bar = Bar(style=styles['neon'])
bar.js = ('http://l:2343/svg.jquery.js',
'http://l:2343/pygal-tooltips.js')
bar.js = ('http://l:2343/2.0.x/pygal-tooltips.js',)
bar.add('1234', [
{'value': 10,
'label': 'Ten',
@ -382,8 +381,7 @@ def get_test_routes(app):
def test_config():
class LolConfig(Config):
js = ['http://l:2343/svg.jquery.js',
'http://l:2343/pygal-tooltips.js']
js = ['http://l:2343/2.0.x/pygal-tooltips.js']
stacked = StackedBar(LolConfig())
stacked.add('1', [1, 2, 3])

3
docs/documentation/other_customizations.rst

@ -35,8 +35,7 @@ Default:
css = ['style.css', 'graph.css']
js = [
'http://kozea.github.com/pygal.js/javascripts/svg.jquery.js',
'http://kozea.github.com/pygal.js/javascripts/pygal-tooltips.js'
'http://kozea.github.com/pygal.js/latest/pygal-tooltips.js'
]

3
docs/documentation/web.rst

@ -38,8 +38,7 @@ You have to put the javascript manually in you webpage, for instance:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://kozea.github.com/pygal.js/javascripts/svg.jquery.js"></script>
<script type="text/javascript" src="http://kozea.github.com/pygal.js/javascripts/pygal-tooltips.js"></script>
<script type="text/javascript" src="http://kozea.github.com/pygal.js/latest/pygal-tooltips.js"></script>
<!-- ... -->
</head>
<body>

3
pygal/config.py

@ -408,8 +408,7 @@ class Config(CommonConfig):
# Misc #
js = Key(
('http://kozea.github.io/pygal.js/javascripts/svg.jquery.js',
'http://kozea.github.io/pygal.js/javascripts/pygal-tooltips.js'),
('http://kozea.github.io/pygal.js/2.0.x/pygal-tooltips.min.js',),
list, "Misc", "List of js file",
"It can be a filepath or an external link",
str)

2
pygal/svg.py

@ -69,7 +69,7 @@ class Svg(object):
self.root.attrib['class'] = 'pygal-chart'
self.root.append(
etree.Comment(u(
'Generated with pygal %s (%s) ©Kozea 2011-2014 on %s' % (
'Generated with pygal %s (%s) ©Kozea 2011-2015 on %s' % (
__version__,
'lxml' if etree.lxml else 'etree',
date.today().isoformat()))))

Loading…
Cancel
Save