mirror of
https://github.com/pyecharts/pyecharts.git
synced 2025-12-08 20:59:23 +00:00
🐛 fix echarts as dependency and remove potential unnecessary world, china for province only map
This commit is contained in:
parent
4e7deb43d6
commit
92cc86c0c2
@ -99,7 +99,7 @@ class Base(object):
|
||||
backgroundColor=background_color
|
||||
)
|
||||
self._jshost = constants.DEFAULT_HOST
|
||||
self._js_dependencies = set('echarts')
|
||||
self._js_dependencies = {'echarts'}
|
||||
self._chart_id = uuid.uuid4().hex
|
||||
|
||||
def add(self, angle_data=None,
|
||||
|
||||
@ -15,8 +15,6 @@ class Map(Base):
|
||||
"""
|
||||
def __init__(self, title="", subtitle="", **kwargs):
|
||||
super(Map, self).__init__(title, subtitle, **kwargs)
|
||||
self._js_dependencies.add('world')
|
||||
self._js_dependencies.add('china')
|
||||
|
||||
def add(self, *args, **kwargs):
|
||||
self.__add(*args, **kwargs)
|
||||
@ -59,9 +57,8 @@ class Map(Base):
|
||||
"data": _data,
|
||||
"roam": is_roam
|
||||
})
|
||||
name_in_pinyin = CITY_NAME_PINYIN_MAP.get(
|
||||
self._option.get('series')[0].get('mapType'))
|
||||
if name_in_pinyin:
|
||||
self._js_dependencies.add(name_in_pinyin)
|
||||
map_type = self._option.get('series')[0].get('mapType')
|
||||
name_in_pinyin = CITY_NAME_PINYIN_MAP.get(map_type, map_type)
|
||||
self._js_dependencies.add(name_in_pinyin)
|
||||
|
||||
self._legend_visualmap_colorlst(**kwargs)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
# coding=utf-8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
DEFAULT_HOST = '/nbextensions/echarts'
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ from pyecharts import template
|
||||
from pyecharts.constants import DEFAULT_HOST
|
||||
from pyecharts.template import produce_require_configuration
|
||||
|
||||
|
||||
class Page(object):
|
||||
|
||||
def __init__(self):
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit af7184bf8400ccc24370e3818ce7d0b41ebd0c04
|
||||
Subproject commit bb8794976463592889a1bb52d7d6fc179a50d5cb
|
||||
@ -60,6 +60,7 @@ def test_page_embed():
|
||||
def test_page_in_notebook():
|
||||
page = create_three()
|
||||
html = page._repr_html_()
|
||||
|
||||
assert 'echartsgl' in html
|
||||
assert 'echarts' in html
|
||||
assert 'guangdong' in html
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user