Browse Source

Fix map coloration

pull/264/head 2.0.4
Florian Mounier 9 years ago
parent
commit
ae95223ee8
  1. 33
      demo/moulinrouge/tests.py
  2. 6
      docs/changelog.rst
  3. 2
      pygal/__init__.py
  4. 14
      pygal/css/style.css

33
demo/moulinrouge/tests.py

@ -556,20 +556,21 @@ def get_test_routes(app):
if fr is None: if fr is None:
abort(404) abort(404)
fmap = fr.Departments(style=choice(list(styles.values()))) fmap = fr.Departments(style=choice(list(styles.values())))
for i in range(10): fmap.add('', [(69, 2), (42, 7), (38, 3), (26, 0)])
fmap.add('s%d' % i, [ # for i in range(10):
(choice(list(fr.DEPARTMENTS.keys())), randint(0, 100)) # fmap.add('s%d' % i, [
for _ in range(randint(1, 5))]) # (choice(list(fr.DEPARTMENTS.keys())), randint(0, 100))
# for _ in range(randint(1, 5))])
fmap.add('links', [{
'value': (69, 10), # fmap.add('links', [{
'label': '\o/', # 'value': (69, 10),
'xlink': 'http://google.com?q=69' # 'label': '\o/',
}, { # 'xlink': 'http://google.com?q=69'
'value': ('42', 20), # }, {
'label': 'Y', # 'value': ('42', 20),
}]) # 'label': 'Y',
fmap.add('6th', [3, 5, 34, 12]) # }])
# fmap.add('6th', [3, 5, 34, 12])
fmap.title = 'French map' fmap.title = 'French map'
return fmap.render_response() return fmap.render_response()
@ -690,8 +691,8 @@ def get_test_routes(app):
'lolroflmao', 'lolroflmao',
'12345678901234567890' '12345678901234567890'
] ]
# radar.x_label_rotation = 35 radar.x_label_rotation = 35
# radar.y_label_rotation = 35 radar.y_label_rotation = 35
radar.y_labels = [{ radar.y_labels = [{
'label': '500', 'label': '500',
'value': 10 'value': 10

6
docs/changelog.rst

@ -2,6 +2,12 @@
Changelog Changelog
========= =========
2.0.4
=====
* Fix map coloration
2.0.3 2.0.3
===== =====

2
pygal/__init__.py

@ -24,7 +24,7 @@ and the maps extensions namespace module.
""" """
__version__ = '2.0.3' __version__ = '2.0.4'
import pkg_resources import pkg_resources
import sys import sys

14
pygal/css/style.css

@ -96,7 +96,7 @@
{{ id }}.reactive.active, {{ id }}.reactive.active,
{{ id }}.active .reactive { {{ id }}.active .reactive {
fill-opacity: {{ style.opacity_hover }}; fill-opacity: {{ style.opacity_hover }};
stroke-width: 4; stroke-width: 4;
} }
@ -140,18 +140,12 @@
} }
{{ id }}.map-element { {{ id }}.map-element {
fill: {{ style.foreground }}; fill: {{ style.plot_background }};
stroke: {{ style.foreground_subtle }} !important; stroke: {{ style.foreground_subtle }} !important;
opacity: .9;
stroke-width: 3;
-webkit-transition: opacity {{ style.transition }};
-moz-transition: opacity {{ style.transition }};
transition: opacity {{ style.transition }};
} }
{{ id }}.map-element:hover { {{ id }}.map-element .reactive {
opacity: 1; fill-opacity: inherit;
stroke-width: 10;
} }
{{ colors }} {{ colors }}

Loading…
Cancel
Save