From ae95223ee8426eaf0293985eaad8ba843de416eb Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Thu, 27 Aug 2015 16:58:04 +0200 Subject: [PATCH] Fix map coloration --- demo/moulinrouge/tests.py | 33 +++++++++++++++++---------------- docs/changelog.rst | 6 ++++++ pygal/__init__.py | 2 +- pygal/css/style.css | 14 ++++---------- 4 files changed, 28 insertions(+), 27 deletions(-) diff --git a/demo/moulinrouge/tests.py b/demo/moulinrouge/tests.py index fe3fdde..26d7f6f 100644 --- a/demo/moulinrouge/tests.py +++ b/demo/moulinrouge/tests.py @@ -556,20 +556,21 @@ def get_test_routes(app): if fr is None: abort(404) fmap = fr.Departments(style=choice(list(styles.values()))) - for i in range(10): - fmap.add('s%d' % i, [ - (choice(list(fr.DEPARTMENTS.keys())), randint(0, 100)) - for _ in range(randint(1, 5))]) - - fmap.add('links', [{ - 'value': (69, 10), - 'label': '\o/', - 'xlink': 'http://google.com?q=69' - }, { - 'value': ('42', 20), - 'label': 'Y', - }]) - fmap.add('6th', [3, 5, 34, 12]) + fmap.add('', [(69, 2), (42, 7), (38, 3), (26, 0)]) + # for i in range(10): + # fmap.add('s%d' % i, [ + # (choice(list(fr.DEPARTMENTS.keys())), randint(0, 100)) + # for _ in range(randint(1, 5))]) + + # fmap.add('links', [{ + # 'value': (69, 10), + # 'label': '\o/', + # 'xlink': 'http://google.com?q=69' + # }, { + # 'value': ('42', 20), + # 'label': 'Y', + # }]) + # fmap.add('6th', [3, 5, 34, 12]) fmap.title = 'French map' return fmap.render_response() @@ -690,8 +691,8 @@ def get_test_routes(app): 'lolroflmao', '12345678901234567890' ] - # radar.x_label_rotation = 35 - # radar.y_label_rotation = 35 + radar.x_label_rotation = 35 + radar.y_label_rotation = 35 radar.y_labels = [{ 'label': '500', 'value': 10 diff --git a/docs/changelog.rst b/docs/changelog.rst index 358a4fc..b606681 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,6 +2,12 @@ Changelog ========= +2.0.4 +===== + +* Fix map coloration + + 2.0.3 ===== diff --git a/pygal/__init__.py b/pygal/__init__.py index 9dad8d7..eaac228 100644 --- a/pygal/__init__.py +++ b/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 sys diff --git a/pygal/css/style.css b/pygal/css/style.css index 4471b44..f7e9c69 100644 --- a/pygal/css/style.css +++ b/pygal/css/style.css @@ -96,7 +96,7 @@ {{ id }}.reactive.active, {{ id }}.active .reactive { - fill-opacity: {{ style.opacity_hover }}; + fill-opacity: {{ style.opacity_hover }}; stroke-width: 4; } @@ -140,18 +140,12 @@ } {{ id }}.map-element { - fill: {{ style.foreground }}; + fill: {{ style.plot_background }}; 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 { - opacity: 1; - stroke-width: 10; +{{ id }}.map-element .reactive { + fill-opacity: inherit; } {{ colors }}