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> <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/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="{{ 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/latest/pygal-tooltips.js"></script>
<script type="text/javascript" src="http://kozea.github.io/pygal.js/javascripts/pygal-tooltips.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js.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='components/bootstrap/docs/assets/css/bootstrap.css') }}" type="text/css" />
<link rel="stylesheet" href="{{ url_for('static', filename='css.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.title = color
chart.disable_xml_declaration = True chart.disable_xml_declaration = True
chart.explicit_size = True chart.explicit_size = True
chart.js = [ chart.js = ['http://l:2343/2.0.x/pygal-tooltips.js']
'http://l:2343/svg.jquery.js',
'http://l:2343/pygal-tooltips.js']
for i in range(6): for i in range(6):
chart.add(str(i), 2 ** i) chart.add(str(i), 2 ** i)
svgs.append(chart.render()) svgs.append(chart.render())

3
demo/moulinrouge/templates/raw_svgs.jinja2

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

6
demo/moulinrouge/tests.py

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

3
docs/documentation/other_customizations.rst

@ -35,8 +35,7 @@ Default:
css = ['style.css', 'graph.css'] css = ['style.css', 'graph.css']
js = [ js = [
'http://kozea.github.com/pygal.js/javascripts/svg.jquery.js', 'http://kozea.github.com/pygal.js/latest/pygal-tooltips.js'
'http://kozea.github.com/pygal.js/javascripts/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> <!DOCTYPE html>
<html> <html>
<head> <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/latest/pygal-tooltips.js"></script>
<script type="text/javascript" src="http://kozea.github.com/pygal.js/javascripts/pygal-tooltips.js"></script>
<!-- ... --> <!-- ... -->
</head> </head>
<body> <body>

3
pygal/config.py

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

2
pygal/svg.py

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

Loading…
Cancel
Save