def test_supranational(): wmap = world.SupranationalWorld(style=choice(list(styles.values()))) v = [ ("europe", 0), ("oceania", 2), ("antartica", 4), ("south_america", 5), ("africa", 6), ("north_america", 7), ("asia", 8), ] wmap.add( "Serie with metadata", [ v[0], {"value": v[1]}, {"value": v[2], "label": "Three"}, {"value": v[3], "xlink": "http://4.example.com/"}, {"value": v[4], "xlink": "http://5.example.com/", "label": "Five"}, {"value": v[5], "xlink": {"href": "http://6.example.com/"}, "label": "Six"}, {"value": v[6], "xlink": {"href": "http://7.example.com/", "target": "_blank"}, "label": "Seven"}, ], ) # wmap.add('Asia', [('asia', 1)]) # wmap.add('Europe', [('europe', 1)]) # wmap.add('Africa', [('africa', 1)]) # wmap.add('North america', [('north_america', 1)]) # wmap.add('South america', [('south_america', 1)]) # wmap.add('Oceania', [('oceania', 1)]) # wmap.add('Antartica', [('antartica', 1)]) wmap.title = "Supra World Map !!" return wmap.render_response()
def test_worldmap(): wmap = world.World(print_values=True, style=choice(list(styles.values()))) wmap.add('1st', [('fr', 100), { 'value': ('us', 10), 'node': {'style': 'fill: red'} } ]) wmap.add('2nd', [('jp', 1), ('ru', 7), ('uk', 0)]) wmap.add('3rd', ['ch', 'cz', 'ca', 'cn']) wmap.add('4th', {'br': 12, 'bo': 1, 'bu': 23, 'fr': 34}) wmap.add('5th', [{ 'value': ('tw', 10), 'label': 'First label', 'xlink': 'http://google.com?q=tw', }, { 'value': ('bw', 20), 'label': 'Second one', 'xlink': 'http://google.com?q=bw', 'node': {'style': 'fill: blue'} }, { 'value': ('mw', 40), 'label': 'Last' }]) wmap.title = 'World Map !!' wmap.value_formatter = lambda x: '%d%%' % x return wmap.render_response()
def test_supranational(): wmap = world.SupranationalWorld(style=choice(list(styles.values()))) v = [ ('europe', 0), ('oceania', 2), ('antartica', 4), ('south_america', 5), ('africa', 6), ('north_america', 7), ('asia', 8) ] wmap.add('Serie with metadata', [ v[0], {'value': v[1]}, {'value': v[2], 'label': 'Three'}, {'value': v[3], 'xlink': 'http://4.example.com/'}, {'value': v[4], 'xlink': 'http://5.example.com/', 'label': 'Five'}, {'value': v[5], 'xlink': { 'href': 'http://6.example.com/'}, 'label': 'Six'}, {'value': v[6], 'xlink': { 'href': 'http://7.example.com/', 'target': '_blank'}, 'label': 'Seven'} ]) # wmap.add('Asia', [('asia', 1)]) # wmap.add('Europe', [('europe', 1)]) # wmap.add('Africa', [('africa', 1)]) # wmap.add('North america', [('north_america', 1)]) # wmap.add('South america', [('south_america', 1)]) # wmap.add('Oceania', [('oceania', 1)]) # wmap.add('Antartica', [('antartica', 1)]) wmap.title = 'Supra World Map !!' return wmap.render_response()
def test_worldmap(): wmap = world.World(print_values=True, style=choice(list(styles.values()))) # wmap.js = ('http://l:2343/2.0.x/pygal-tooltips.js',) # wmap.add('1st', [('fr', 100), { # 'value': ('us', 10), # 'node': {'style': 'fill: red'} # } # ]) # wmap.add('2nd', [('jp', 1), ('ru', 7), ('uk', 0)]) # wmap.add('3rd', ['ch', 'cz', 'ca', 'cn']) # wmap.add('4th', {'jp': 12, 'bo': 1, 'bu': 23, 'fr': 34}) # wmap.add('5th', [{ # 'value': ('tw', 10), # 'label': 'First label', # 'xlink': 'http://google.com?q=tw', # }, { # 'value': ('bw', 20), # 'label': 'Second one', # 'xlink': 'http://google.com?q=bw', # 'node': {'style': 'fill: blue'} # }, { # 'value': ('mw', 40), # 'label': 'Last' # }]) wmap.add('_', {'us': 1}) wmap.add('-', {'us': 2}) wmap.add('.', {'us': 3}) wmap.title = 'World Map !!' wmap.value_formatter = lambda x: '%d%%' % x return wmap.render_response()
def test_worldmap(): wmap = world.World( print_values=True, style=choice(list(styles.values())) ) # wmap.js = ('http://l:2343/2.0.x/pygal-tooltips.js',) # wmap.add('1st', [('fr', 100), { # 'value': ('us', 10), # 'node': {'style': 'fill: red'} # } # ]) # wmap.add('2nd', [('jp', 1), ('ru', 7), ('uk', 0)]) # wmap.add('3rd', ['ch', 'cz', 'ca', 'cn']) # wmap.add('4th', {'jp': 12, 'bo': 1, 'bu': 23, 'fr': 34}) # wmap.add('5th', [{ # 'value': ('tw', 10), # 'label': 'First label', # 'xlink': 'http://google.com?q=tw', # }, { # 'value': ('bw', 20), # 'label': 'Second one', # 'xlink': 'http://google.com?q=bw', # 'node': {'style': 'fill: blue'} # }, { # 'value': ('mw', 40), # 'label': 'Last' # }]) wmap.add('_', {'us': 1}) wmap.add('-', {'us': 2}) wmap.add('.', {'us': 3}) wmap.title = 'World Map !!' wmap.value_formatter = lambda x: '%d%%' % x return wmap.render_response()
def test_frenchmapdepartments(): if fr is None: abort(404) fmap = fr.Departments(style=choice(list(styles.values()))) fmap.add('', [(i, i) for i in range(1, 100)]) fmap.add('', [(970 + i, i) for i in range(1, 7)]) fmap.add('', [('2A', 1), ('2B', 2)]) fmap.title = 'French map' return fmap.render_response()
def test_supranational(): wmap = world.SupranationalWorld(style=choice(list(styles.values()))) wmap.add('Asia', [('asia', 1)]) wmap.add('Europe', [('europe', 1)]) wmap.add('Africa', [('africa', 1)]) wmap.add('North america', [('north_america', 1)]) wmap.add('South america', [('south_america', 1)]) wmap.add('Oceania', [('oceania', 1)]) wmap.add('Antartica', [('antartica', 1)]) wmap.title = 'Supra World Map !!' return wmap.render_response()
def test_frenchmapdepartments(): fmap = FrenchMap_Departments(style=choice(list(styles.values()))) for i in range(10): fmap.add("s%d" % i, [(choice(list(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()
def test_swissmap(): smap = ch.Cantons(style=choice(list(styles.values()))) for i in range(10): smap.add("s%d" % i, [(choice(list(ch.CANTONS.keys())), randint(0, 100)) for _ in range(randint(1, 5))]) smap.add( "links", [ {"value": ("kt-vs", 10), "label": "\o/", "xlink": "http://google.com?q=69"}, {"value": ("bt", 20), "label": "Y"}, ], ) smap.add("6th", [3, 5, 34, 12]) smap.title = "Swiss map" return smap.render_response()
def test_frenchmapregions(): fmap = FrenchMap_Regions(style=choice(list(styles.values()))) for i in range(10): fmap.add("s%d" % i, [(choice(list(REGIONS.keys())), randint(0, 100)) for _ in range(randint(1, 5))]) fmap.add( "links", [ {"value": ("02", 10), "label": "\o/", "xlink": "http://google.com?q=69"}, {"value": ("72", 20), "label": "Y"}, ], ) fmap.add("6th", [91, 2, 41]) fmap.title = "French map" return fmap.render_response()
def test_frenchmapdepartments(): fmap = FrenchMap_Departments(style=choice(list(styles.values()))) for i in range(10): fmap.add('s%d' % i, [ (choice(list(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()
def test_frenchmapregions(): fmap = FrenchMap_Regions(style=choice(list(styles.values()))) for i in range(10): fmap.add('s%d' % i, [ (choice(list(REGIONS.keys())), randint(0, 100)) for _ in range(randint(1, 5))]) fmap.add('links', [{ 'value': ('02', 10), 'label': '\o/', 'xlink': 'http://google.com?q=69' }, { 'value': ('72', 20), 'label': 'Y', }]) fmap.add('6th', [91, 2, 41]) fmap.title = 'French map' return fmap.render_response()
def test_swissmap(): smap = ch.Cantons(style=choice(list(styles.values()))) for i in range(10): smap.add('s%d' % i, [ (choice(list(ch.CANTONS.keys())), randint(0, 100)) for _ in range(randint(1, 5))]) smap.add('links', [{ 'value': ('kt-vs', 10), 'label': '\o/', 'xlink': 'http://google.com?q=69' }, { 'value': ('bt', 20), 'label': 'Y', }]) smap.add('6th', [3, 5, 34, 12]) smap.title = 'Swiss map' return smap.render_response()
def test_worldmap(): wmap = Worldmap(style=choice(list(styles.values()))) wmap.add("1st", [("fr", 100), ("us", 10)]) wmap.add("2nd", [("jp", 1), ("ru", 7), ("uk", 0)]) wmap.add("3rd", ["ch", "cz", "ca", "cn"]) wmap.add("4th", {"br": 12, "bo": 1, "bu": 23, "fr": 34}) wmap.add( "5th", [ {"value": ("tw", 10), "label": "First label", "xlink": "http://google.com?q=tw"}, {"value": ("bw", 20), "label": "Second one", "xlink": "http://google.com?q=bw"}, {"value": ("mw", 40), "label": "Last"}, ], ) wmap.add("6th", [3, 5, 34, 12]) wmap.title = "World Map !!" return wmap.render_response()
def test_frenchmapregions(): fmap = FrenchMap_Regions(style=choice(list(styles.values()))) for i in range(10): fmap.add('s%d' % i, [(choice(list(REGIONS.keys())), randint(0, 100)) for _ in range(randint(1, 5))]) fmap.add('links', [{ 'value': ('02', 10), 'label': '\o/', 'xlink': 'http://google.com?q=69' }, { 'value': ('72', 20), 'label': 'Y', }]) fmap.add('6th', [91, 2, 41]) fmap.title = 'French map' return fmap.render_response()
def test_frenchmapdepartments(): fmap = FrenchMap_Departments(style=choice(list(styles.values()))) for i in range(10): fmap.add('s%d' % i, [(choice(list(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()
def test_swissmap(): smap = ch.Cantons(style=choice(list(styles.values()))) for i in range(10): smap.add('s%d' % i, [(choice(list(ch.CANTONS.keys())), randint(0, 100)) for _ in range(randint(1, 5))]) smap.add('links', [{ 'value': ('kt-vs', 10), 'label': '\o/', 'xlink': 'http://google.com?q=69' }, { 'value': ('bt', 20), 'label': 'Y', }]) smap.add('6th', [3, 5, 34, 12]) smap.title = 'Swiss map' return smap.render_response()
def test_worldmap(): wmap = world.World(style=choice(list(styles.values()))) wmap.add('1st', [('fr', 100), ('us', 10)]) wmap.add('2nd', [('jp', 1), ('ru', 7), ('uk', 0)]) wmap.add('3rd', ['ch', 'cz', 'ca', 'cn']) wmap.add('4th', {'br': 12, 'bo': 1, 'bu': 23, 'fr': 34}) wmap.add('5th', [{ 'value': ('tw', 10), 'label': 'First label', 'xlink': 'http://google.com?q=tw' }, { 'value': ('bw', 20), 'label': 'Second one', 'xlink': 'http://google.com?q=bw' }, { 'value': ('mw', 40), 'label': 'Last' }]) wmap.title = 'World Map !!' return wmap.render_response()
def test_frenchmapdepartments(): if fr is None: abort(404) fmap = fr.Departments(style=choice(list(styles.values()))) 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()
def test_frenchmapdepartments(): if fr is None: abort(404) fmap = fr.Departments(style=choice(list(styles.values()))) 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()
def test_worldmap(): wmap = Worldmap(style=choice(list(styles.values()))) wmap.add('1st', [('fr', 100), ('us', 10)]) wmap.add('2nd', [('jp', 1), ('ru', 7), ('uk', 0)]) wmap.add('3rd', ['ch', 'cz', 'ca', 'cn']) wmap.add('4th', {'br': 12, 'bo': 1, 'bu': 23, 'fr': 34}) wmap.add('5th', [{ 'value': ('tw', 10), 'label': 'First label', 'xlink': 'http://google.com?q=tw' }, { 'value': ('bw', 20), 'label': 'Second one', 'xlink': 'http://google.com?q=bw' }, { 'value': ('mw', 40), 'label': 'Last' }]) wmap.add('6th', [3, 5, 34, 12]) wmap.title = 'World Map !!' return wmap.render_response()