Skip to content

Commit

Permalink
Merge pull request pyecharts#2349 from pyecharts/dev
Browse files Browse the repository at this point in the history
Prepare for version v2.0.6
  • Loading branch information
sunhailin-Leo authored Jun 20, 2024
2 parents 57b575b + ed3f194 commit ad6e9b7
Show file tree
Hide file tree
Showing 89 changed files with 5,733 additions and 5,120 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@ on: [push, pull_request]
jobs:
build:
strategy:
# Allows for matrix sub-jobs to fail without canceling the rest
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
exclude: # Python < v3.8 does not support Apple Silicon ARM64.
- python-version: "3.7"
os: macos-latest
include: # So run those legacy versions on Intel CPUs.
- python-version: "3.7"
os: macos-13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ At the discretion of the development team, version 0.5.x will no longer be maint

### V1

> Python 3.6+ only
> Python 3.7+ only
The new version series will start with v1.0.0, documented at [pyecharts.org](https://pyecharts.org); examples at [gallery.pyecharts.org](https://gallery.pyecharts.org)

### V2

> Python 3.6+ only
> Python 3.7+ only
The new version is based on Echarts 5.4.1+ for rendering, and the documentation and examples are in the same location as V1.

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ v0.5.x 和 V1 间不兼容,V1 是一个全新的版本,详见 [ISSUE#892](ht

### V0.5.x

> 支持 Python2.7,3.4+
> 支持 Python 2.7,3.4+
经开发团队决定,0.5.x 版本将不再进行维护,0.5.x 版本代码位于 *05x* 分支,文档位于 [05x-docs.pyecharts.org](http://05x-docs.pyecharts.org)

### V1

> 仅支持 Python3.6+
> 仅支持 Python 3.7+
新版本系列将从 v1.0.0 开始,文档位于 [pyecharts.org](https://pyecharts.org);示例位于 [gallery.pyecharts.org](https://gallery.pyecharts.org)

### V2

> 仅支持 Python3.6+
> 仅支持 Python 3.7+
新版本基于 Echarts 5.4.1+ 进行渲染, 文档和示例位置与 V1 相同

Expand Down
2 changes: 1 addition & 1 deletion pyecharts/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "2.0.5"
__version__ = "2.0.6"
__author__ = "chenjiandongx"
1 change: 1 addition & 0 deletions pyecharts/charts/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(
self.js_host: str = _opts.get("js_host") or CurrentConfig.ONLINE_HOST
self.js_functions: utils.OrderedSet = utils.OrderedSet()
self.js_dependencies: utils.OrderedSet = utils.OrderedSet("echarts")
self.js_events: utils.OrderedSet = utils.OrderedSet()
self.options.update(backgroundColor=self.bg_color)
if isinstance(_opts.get("animationOpts", AnimationOpts()), dict):
self.options.update(_opts.get("animationOpts", AnimationOpts().opts))
Expand Down
18 changes: 18 additions & 0 deletions pyecharts/charts/basic_charts/bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def add_yaxis(
*,
xaxis_index: types.Optional[types.Numeric] = None,
yaxis_index: types.Optional[types.Numeric] = None,
polar_index: types.Optional[types.Numeric] = None,
is_round_cap: types.Optional[bool] = None,
color_by: types.Optional[str] = None,
is_legend_hover_link: bool = True,
color: types.Optional[str] = None,
is_realtime_sort: bool = False,
Expand All @@ -36,6 +39,9 @@ def add_yaxis(
gap: types.Optional[str] = "30%",
is_large: bool = False,
large_threshold: types.Numeric = 400,
progressive: types.Optional[types.Numeric] = None,
progressive_threshold: types.Optional[types.Numeric] = None,
progressive_chunk_mode: types.Optional[str] = None,
dimensions: types.Union[types.Sequence, None] = None,
series_layout_by: str = "column",
dataset_index: types.Numeric = 0,
Expand All @@ -45,9 +51,12 @@ def add_yaxis(
label_opts: types.Label = opts.LabelOpts(),
markpoint_opts: types.MarkPoint = None,
markline_opts: types.MarkLine = None,
markarea_opts: types.MarkArea = None,
tooltip_opts: types.Tooltip = None,
itemstyle_opts: types.ItemStyle = None,
emphasis_opts: types.Emphasis = None,
blur_opts: types.Blur = None,
select_opts: types.Select = None,
encode: types.Union[types.JSFunc, dict, None] = None,
):
self._append_color(color)
Expand All @@ -62,6 +71,9 @@ def add_yaxis(
"name": series_name,
"xAxisIndex": xaxis_index,
"yAxisIndex": yaxis_index,
"polarIndex": polar_index,
"roundCap": is_round_cap,
"colorBy": color_by,
"legendHoverLink": is_legend_hover_link,
"data": y_axis,
"realtimeSort": is_realtime_sort,
Expand All @@ -79,6 +91,9 @@ def add_yaxis(
"barGap": gap,
"large": is_large,
"largeThreshold": large_threshold,
"progressive": progressive,
"progressiveThreshold": progressive_threshold,
"progressiveChunkMode": progressive_chunk_mode,
"dimensions": dimensions,
"seriesLayoutBy": series_layout_by,
"datasetIndex": dataset_index,
Expand All @@ -88,9 +103,12 @@ def add_yaxis(
"label": label_opts,
"markPoint": markpoint_opts,
"markLine": markline_opts,
"markArea": markarea_opts,
"tooltip": tooltip_opts,
"itemStyle": itemstyle_opts,
"emphasis": emphasis_opts,
"blur": blur_opts,
"select": select_opts,
"encode": encode,
}
)
Expand Down
24 changes: 23 additions & 1 deletion pyecharts/charts/basic_charts/boxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,25 @@ def add_yaxis(
xaxis_index: types.Optional[types.Numeric] = None,
yaxis_index: types.Optional[types.Numeric] = None,
dataset_index: types.Optional[types.Numeric] = None,
color_by: types.Optional[str] = None,
is_legend_hover_link: bool = True,
is_hover_animation: bool = True,
layout: types.Optional[str] = None,
box_width: types.Optional[types.Sequence] = None,
selected_mode: types.Union[bool, str] = False,
dimensions: types.Union[types.Sequence, None] = None,
label_opts: types.Label = opts.LabelOpts(),
markpoint_opts: types.MarkPoint = opts.MarkPointOpts(),
markline_opts: types.MarkLine = opts.MarkLineOpts(),
markarea_opts: types.MarkArea = None,
z_level: types.Numeric = 0,
z: types.Numeric = 2,
tooltip_opts: types.Tooltip = None,
itemstyle_opts: types.ItemStyle = None,
emphasis_opts: types.Emphasis = None,
blur_opts: types.Blur = None,
select_opts: types.Select = None,
encode: types.Union[types.JSFunc, dict, None] = None,
):
if box_width is None:
box_width = [7, 50]
Expand All @@ -44,15 +55,26 @@ def add_yaxis(
"xAxisIndex": xaxis_index,
"yAxisIndex": yaxis_index,
"datasetIndex": dataset_index,
"colorBy": color_by,
"legendHoverLink": is_legend_hover_link,
"hoverAnimation": is_hover_animation,
"layout": layout,
"boxWidth": box_width,
"selected_mode": selected_mode,
"selectedMode": selected_mode,
"dimensions": dimensions,
"data": y_axis,
"label": label_opts,
"markPoint": markpoint_opts,
"markLine": markline_opts,
"markArea": markarea_opts,
"zlevel": z_level,
"z": z,
"tooltip": tooltip_opts,
"itemStyle": itemstyle_opts,
"emphasis": emphasis_opts,
"blur": blur_opts,
"select": select_opts,
"encode": encode,
}
)
return self
Expand Down
2 changes: 1 addition & 1 deletion pyecharts/charts/basic_charts/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def add(
*,
color_by: str = "series",
is_legend_hover_link: bool = True,
coordinate_system: types.JSFunc = "cartesian2d",
coordinate_system: str = "cartesian2d",
x_axis_index: types.Numeric = 0,
y_axis_index: types.Numeric = 0,
polar_index: types.Numeric = 0,
Expand Down
29 changes: 28 additions & 1 deletion pyecharts/charts/basic_charts/effectscatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,29 @@ def add_yaxis(
*,
xaxis_index: types.Optional[types.Numeric] = None,
yaxis_index: types.Optional[types.Numeric] = None,
polar_index: types.Optional[types.Numeric] = None,
geo_index: types.Optional[types.Numeric] = None,
calendar_index: types.Optional[types.Numeric] = None,
dataset_index: types.Optional[types.Numeric] = None,
color: types.Optional[str] = None,
color_by: types.Optional[str] = None,
is_legend_hover_link: bool = True,
show_effect_on: str = "render",
coordinate_system: str = "cartesian2d",
symbol: types.Optional[str] = None,
symbol_size: types.Numeric = 10,
symbol_rotate: types.Optional[types.Numeric] = None,
selected_mode: types.Union[bool, str] = False,
label_opts: types.Label = opts.LabelOpts(),
effect_opts: types.Effect = opts.EffectOpts(),
tooltip_opts: types.Tooltip = None,
itemstyle_opts: types.ItemStyle = None,
emphasis_opts: types.Emphasis = None,
markpoint_opts: types.MarkPoint = None,
markline_opts: types.MarkLine = None,
markarea_opts: types.MarkArea = None,
z_level: types.Numeric = 0,
z: types.Numeric = 2,
encode: types.Union[types.JSFunc, dict, None] = None,
):
self._append_color(color)
Expand All @@ -43,16 +57,29 @@ def add_yaxis(
"name": series_name,
"xAxisIndex": xaxis_index,
"yAxisIndex": yaxis_index,
"showEffectOn": "render",
"polarIndex": polar_index,
"geoIndex": geo_index,
"calendarIndex": calendar_index,
"colorBy": color_by,
"legendHoverLink": is_legend_hover_link,
"showEffectOn": show_effect_on,
"rippleEffect": effect_opts,
"coordinateSystem": coordinate_system,
"datasetIndex": dataset_index,
"symbol": symbol,
"symbolSize": symbol_size,
"symbolRotate": symbol_rotate,
"selectedMode": selected_mode,
"data": y_axis,
"label": label_opts,
"tooltip": tooltip_opts,
"itemStyle": itemstyle_opts,
"emphasis": emphasis_opts,
"markPoint": markpoint_opts,
"markLine": markline_opts,
"markArea": markarea_opts,
"zlevel": z_level,
"z": z,
"encode": encode,
}
)
Expand Down
44 changes: 44 additions & 0 deletions pyecharts/charts/basic_charts/funnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,34 @@ def add(
data_pair: types.Sequence,
*,
color: types.Optional[str] = None,
color_by: types.Optional[str] = None,
min_: types.Numeric = 0,
max_: types.Numeric = 100,
min_size: types.Union[str, types.Numeric] = "0%",
max_size: types.Union[str, types.Numeric] = "100%",
orient: str = "vertical",
sort_: str = "descending",
gap: types.Numeric = 0,
is_legend_hover_link: bool = True,
funnel_align: str = "center",
label_opts: types.Label = opts.LabelOpts(),
tooltip_opts: types.Tooltip = None,
itemstyle_opts: types.ItemStyle = None,
emphasis_opts: types.Emphasis = None,
selected_mode: types.Union[bool, str] = False,
z_level: types.Numeric = 0,
z: types.Numeric = 2,
pos_top: types.Union[str, types.Numeric, None] = None,
pos_left: types.Union[str, types.Numeric, None] = None,
pos_bottom: types.Union[str, types.Numeric, None] = None,
pos_right: types.Union[str, types.Numeric, None] = None,
width: types.Union[str, types.Numeric, None] = None,
height: types.Union[str, types.Numeric, None] = None,
dataset_index: types.Optional[types.Numeric] = None,
encode: types.Union[types.JSFunc, dict, None] = None,
markpoint_opts: types.MarkPoint = None,
markline_opts: types.MarkLine = None,
markarea_opts: types.MarkArea = None,
):
self._append_color(color)
if all([isinstance(d, opts.FunnelItem) for d in data_pair]):
Expand All @@ -46,12 +68,34 @@ def add(
"type": ChartType.FUNNEL,
"name": series_name,
"data": data,
"colorBy": color_by,
"min": min_,
"max": max_,
"minSize": min_size,
"maxSize": max_size,
"orient": orient,
"sort": sort_,
"gap": gap,
"legendHoverLink": is_legend_hover_link,
"funnelAlign": funnel_align,
"label": label_opts,
"tooltip": tooltip_opts,
"itemStyle": itemstyle_opts,
"emphasis": emphasis_opts,
"selectedMode": selected_mode,
"zlevel": z_level,
"z": z,
"left": pos_left,
"right": pos_right,
"top": pos_top,
"bottom": pos_bottom,
"width": width,
"height": height,
"datasetIndex": dataset_index,
"encode": encode,
"markPoint": markpoint_opts,
"markLine": markline_opts,
"markArea": markarea_opts,
}
)
return self
2 changes: 1 addition & 1 deletion pyecharts/charts/basic_charts/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def add(
encode: types.Union[types.JsCode, dict] = None,
):
self._zlevel += 1
data = self._feed_data(data_pair, type_)
data = self._feed_data(data_pair, type_) if data_pair else data_pair

self._append_color(color)
self._append_legend(series_name)
Expand Down
Loading

0 comments on commit ad6e9b7

Please sign in to comment.