Skip to content

Latest commit

 

History

History
1421 lines (906 loc) · 105 KB

CHANGELOG.md

File metadata and controls

1421 lines (906 loc) · 105 KB

4.2.8 (2022-09-19)

Chores
Documentation Changes
Bug Fixes

4.2.6 (2022-08-04)

Documentation Changes
Bug Fixes
  • label: label 可以配置 是否支持捕获 (#4064) (7ff3941)
  • toolitp: 增加 tooltip marker 回调,以和 point 的不同形状保持一致 (#4039) (7b16ce7)
  • annotation: 修复 annotation shape/regionFilter 在 geometries 没有动画没有渲染的问题 (#4035) (dcb8cf4)

4.2.5 (2022-07-06)

Documentation Changes
  • example: brush selection add the modification button example (#4004) (de7425af)
  • 优化拖拽点交互的 demo (466cf81b)
Bug Fixes
  • pie: 修复扇形 变化时 角度按照反方向变化的问题 (#4029) (5256a8a0)
  • crosshairs: crosshairs 删除在坐标轴外不能显示的配置 (#4008) (56ff97ba)
  • area-shape: fix marker fillOpacity (#4017) (97897428)
  • slider: 修改 slider 的最大值最小值 位置 计算数据方式 floor 为 round (#4015) (b923eb38)
  • backgroundName: 修复 柱形存在背景时添加 interval:click 触发两次的问题 (#3999) (a6341a02)

4.2.4 (2022-06-24)

Bug Fixes
  • axis-label: 修复 axis-label tooltip 移开没有 hide 的问题 (#4002) (a6dce615)
  • view: 修复 view 更新时, tooltip 依赖 coordinate 更新位置导致 crosshairs 位置错位 (#4001) (ce457851)
  • animate waveIn: 修复 waveIn 动画 最后没有给 element 附上更新后样式的问题 (#4000) (beb97663)

4.2.3 (2022-06-15)

New Features
  • axis: 更新 axis-description-tooltip 样式, 添加自定义 style 配置 (#3929) (27d35093)
Bug Fixes
  • sector-path: 修复扇形非常小的时候, 角度 diff 会被重置为 Math.PI * 2 (#3981) (dec20728)
  • interval: 修复同时存在坐标系转制和 y 镜像的时候 的 bakcground radius 的错误 (#3969) (36e97f44)
  • annotation typo (#3960) (e46fd837)

4.2.2 (2022-05-19)

New Features
  • axis: 更新 axis-description-tooltip 样式, 添加自定义 style 配置 (#3929) (27d35093)

4.2.1 (2022-05-10)

Bug Fixes

4.2.0 (2022-04-22)

Refactors

4.1.50 (2022-04-13)

Documentation Changes
  • axis API 文档中新增 title 字段的 description 配置 (#3863) (7e2493c8)
New Features
  • axis: 添加坐标轴标题详细说明 icon 交互事件 (#3863) (7e2493c8)

4.1.49 (2022-03-25)

Chores
  • ci actions 添加 pr 触发时机 (4cc0475f)
Bug Fixes

4.1.48 (2022-03-23)

Documentation Changes
  • 更新文档,将 chart.source 改为 chart.data (#3816) (ddda1f80)
New Features
  • theme: 主题支持完整样式表的自定义 (#3833) (97a5b419)
Bug Fixes
  • interval: 修复转置后的圆角条形图渲染多出一部分 (#3826) (b12dd0fe)

4.1.47 (2022-03-03)

New Features
  • 基于新版本注释规范调整 interface 文件代码注释 (#3817) (d3ebdba4)

4.1.46 (2022-02-11)

Documentation Changes
Bug Fixes
  • 修复 timeCat scale 没有当作 groupScale,导致对应场景的折线图绘制无法正常分组 (1861807e)
  • update actions/checkout version to avoid vulnerability (#3774) (781eb8c8)

4.1.45 (2022-02-09)

Bug Fixes
  • interval: 修复 interval color 通道没有 field,会导致 tooltip name 消失 (3e3d03fb)

4.1.44 (2022-02-08)

Chores
  • add pr-auto-labels & auto-release-generate (94146ea0)
Bug Fixes
  • charts: 修复 annotations 创建失败 (09cde2d1)

4.1.42 (2022-01-28)

Bug Fixes
  • slider: 修复 slider 过大挤压图形的问题 #2968 (#3794) (a3187617)
  • toolitp: 修复 limitInPlot 属性无法屏蔽一些后出现的状态 (#3792) (50e319dc)

4.1.41 (2022-01-25)

Bug Fixes
  • 修复 jitter 点图 adjust 后点位置不正确的问题 (#3790) (5ffcb7ac)
  • 修复获取分组 scale 错误 & tooltip 获取 value-scale 不忽略 color、shape 通道相关字段 (#3768) (ab893335)

4.1.40 (2022-01-18)

Documentation Changes
  • 添加对 scale 的值域说明,与 d3 值域用法相对比,防止误解。 (#3781) (3b07b921)
New Features
  • legend: 图例 radio 增加 tip 文案提示 (#3786) (6736def0)
Bug Fixes
  • legend: 修复 legend radio 设置样式不生效 (#3784) (fe554991)
Chores

4.1.39 (2022-01-14)

Chores
Bug Fixes
  • legend: 修复图例 radio focus 模式 & 增加 demo (#3779) (5295b78a)
  • remove node 12 to fix release action failed (#3720) (1358be9a)

4.1.38 (2022-01-12)

Bug Fixes
  • issue-3723: 修复 annotation 在筛选条件下,范围外的标注不需要展示 (#3775) (151f9152)
  • slider,scrollbar: 修复 slider 、scrollbar values 排序错误的问题 (#3773) (6e84c446)

4.1.37 (2022-01-04)

Bug Fixes
  • slider,scrollbar: 滚动条和缩略轴 在 xScale 为线性时筛选错误的问题 (#3767) (768eb3c3)

4.1.36 (2021-12-29)

New Features
Bug Fixes
  • scrollbar: Scale option tickMethod doesn't work when enable scrollbar (#3747) (cb3ad042)
Performance Improvements
  • 优化性能,由于 set-zindex 每次都会调用 sort,导致耗时为指数级别的 (#3758) (f2877bcf)

4.1.35 (2021-12-14)

Bug Fixes
  • bar: 修复条形图在 reflect y 时,绘制圆角错误 (#3745) (048a4920)
Documentation Changes

4.1.34 (2021-11-01)

Chores
Documentation Changes
New Features
Bug Fixes

4.1.33 (2021-10-28)

Documentation Changes
New Features
Bug Fixes

4.1.32 (2021-10-21)

Documentation Changes
New Features
  • element: element 图形元素按照 elementIndex 设置展示层级 (#3671) (4a536731)
Bug Fixes
  • 修复 element 设置层级 zIndex 的时候,需要考虑 zIndexReversed (#3685) (c3654776)
  • label: 修复 label 做坐标系镜像下,位置计算问题 (#3682) (71ee0d91)

4.1.31 (2021-10-13)

Documentation Changes
New Features
Bug Fixes

4.1.30 (2021-09-28)

Bug Fixes
  • state-style: 修复存在状态时,动画丢失 (2619645a)

4.1.29 (2021-09-26)

Bug Fixes
  • custom-content: 修复 custom-content undefined 无法变回 tooltip 模版的问题 (#3644) (2790c349)

4.1.28 (2021-09-24)

New Features
Bug Fixes
  • crash on safari 15 when fillText with unicode (#3640) (0516f6e3)
Reverts

4.1.26 (2021-09-15)

Documentation Changes
New Features
Bug Fixes
  • tooltip: 修复 clear + render 之后,tooltip dom 重复生成问题 (#3621) (eaacd502)
  • legend 自定义 items 添加 marker 回调 (#3591) (dc80db29)
  • scrollbar: 修复了由于 getYScales 方法中去重方法错误导致的 scrollbar 会在特定情况下失效(#3569) (#3570) (28280ee4)
  • annotation: 修复 annotation 添加 id 失败 (#3601) (7561b33d)
Refactors
  • annotation: annotation position 支持百分比混用 (#3615) (bcffa462)
  • facet: 添加了 spacing 属性,支持配置分面图之间的间距 (#3614) (d5588a0e)
  • funnel: annotation 位置添加 center,支持在漏斗图中正常显示 (#3611) (552500df)

4.1.25 (2021-08-25)

Documentation Changes
Bug Fixes
  • funnel: pyramid shape 最下面一层的 label 绘制不对齐 (#3585) (13a2e05d)

4.1.24 (2021-08-14)

Documentation Changes
New Features

4.1.23 (2021-08-06)

Documentation Changes
Bug Fixes
Code Style Changes

4.1.22 (2021-07-28)

New Features

4.1.21 (2021-07-21)

Chores
New Features
Bug Fixes
  • heatmap: 修复热力图 style shadowBlur 不生效 & color 使用回调会导致白屏 (#3532) (664cf1a7)
  • legend: 过滤连续图例的 value 参数,防止影响到 component legend 的 value 属性 导致交互问题 (#3527) (f30d700c)

4.1.20 (2021-07-06)

Documentation Changes
Bug Fixes
  • legend: 修复 legend marker 回调设置,spacing 不生效(#2671) (026f5eb)

4.1.18 (2021-06-22)

Documentation Changes
New Features
  • events: 暴露 brush 交互的生命周期,便于在 G2Plot 层可以监听 (#3485) (a8690cd9)
  • interaction/link-by-color: element-link 交互反馈增加参数配置 (#3483) (3ddbbd31)
Bug Fixes

4.1.18 (2021-06-07)

New Features
Bug Fixes
  • 修复 view 上没有正确的 scale 时,绘制 annotation 出错 (#3450) (d0af4095)
Other Changes
  • 修复 view.changeData 在重新渲染的时候 报 toFront 为 underfind 的错误 (#3438) (76e08d06)

4.1.17 (2021-05-26)

Chores
Documentation Changes
New Features

4.1.15 (2021-04-25)

New Features
Bug Fixes

4.1.14 (2021-04-12)

Chores
  • 解决本地开发控制台 warning & babel 解析 tsx、jsx 语法 (#3360) (e63fa397)
  • 添加 release create to trigger publish site (#3355) (857c5d06)
  • 修复 import type 导致网站无法启动,更新为 export type (#3350) (35e37bd1)
Continuous Integration
Documentation Changes
  • legend: 图例完善默认不选中以及点击选中交互的文档 & 增加 demo (#3351) (2841641a)
New Features
Bug Fixes
  • issue-3160: 修复饼图使用连续型图例,标签无法展示 (#3366) (a392a8b4)
  • 修复主题相关的错误拼写 (#3358) (804dbc69)

4.1.13 (2021-03-17)

Documentation Changes
New Features
Bug Fixes

4.1.12 (2021-02-19)

New Features
  • typings: 增强类型声明 (fd18579e)
  • scrollbar: 滚动条增加一个滚道激活样式配置 (#3291) (aed93a19)
  • legend: legend 增加 checked 单选交互 (#3289) (3a16db62)
  • animation: 动画添加重复执行参数 (#3290) (38585ac4)
  • life-circle: view 生命周期事件触发,携带事件内容 (#3288) (657eb978)
Bug Fixes
  • cr 建议修改,统一变量命名 (6b3f5b7b)

4.1.11 (2021-02-10)

Documentation Changes
New Features
  • active-region: 支持配置底色样式,全局统一注册一个 配置样式 (#3284) (48c5bd12)
  • scrollbar: 滚动条增加主题样式设置,允许设置滑道、滑块颜色 (#3286) (2c3e9d37)
  • interaction: 注册交互的时候,允许注册带上触发 action 的参数 (#3280) (89aa37fe)
Bug Fixes
  • event: 修复相同 type 事件触发两次 (#3282) (9d61410b)
  • pie: 饼图数据 NaN 导致页面崩溃数据边界处理(#2930) (#3248) (cabe1f0b)
  • pie 修复饼图在动画更新过程中如果宽度变为 0 导致的问题 (#3271) (9f561499)
  • rose: 修复 TooltipItem data 类型 (#3273) (8ed68854)
Other Changes
  • constants export constant varaibles of view-life-circle (#3281) (d0f96c48)

4.1.10 (2021-02-03)

Documentation Changes
New Features
  • tooltip: tooltip.shwoContent support function (#3261) (a26c0732)
  • 增加 getAction 的返回参数类型定义 (#3256) (024f9f9e)
Bug Fixes
  • 判断提前,预防 time 类型出现的错误 (#3258) (a143ef54)
  • 修复实心的 shape 设置空心的 marker,会导致 marker.style 设置不生效 (#3250) (88c45f88)
  • 提示增强 (#3259) (4ffac0b0)

4.1.8 (2021-01-27)

Feature
Performance Improvements
  • 优化鼠标事件在 path 上的拾取性能 (#3230) (71b0a2e)
Docs

4.1.7 (2021-01-13)

Documentation Changes
New Features
Tests

4.1.6 (2021-01-08)

Performance

4.1.5 (2021-01-07)

Documentation Changes
New Features
Bug Fixes
  • tooltip-tip: label tip max width 50%, and break word (#3177) (b7a86fec)
  • geometry: geometry.update should update scale when data is changed (#3174) (86f2c570)
  • correct label position for histogram (#3156) (0f6e7167)

4.1.4 (2020-12-22)

Documentation Changes
New Features
Bug Fixes
  • 修复路径错误 (#3148) (bd49fbe1)
  • fix line geometry fail to set dot or dash shape(#3144) (239e8a67)
  • 修复 element shape 进行 syncShapeStyle 时,可能存在空对象的情况 (#3110) (904202d1)
  • fix empty div container for annotation (#3112) (f3739657)
  • testcases: 增加单测,g 层修复 animate shape 在 changesize 的时候报错 (#3113) (28d235b0)

4.1.3 (2020-12-17)

Documentation Changes
Bug Fixes
  • testcases: 增加单测,g 层修复 animate shape 在 changesize 的时候报错 (#3113) (28d235b0)
  • fix empty div container for annotation (#3112) (f3739657)

4.1.2 (2020-12-11)

Chores
Documentation Changes
Bug Fixes
  • fix early create canvas context cause build error in server side (#3081) (773abdd9)
  • issue-3073: 修复数据存在 null 值,在 pie-outer 标签布局下报错 (#3074) (73708e93)

4.1.1 (2020-12-02)

Bug Fixes
  • issue-3073: 修复数据存在 null 值,在 pie-outer 标签布局下报错 (#3074) (73708e93)

4.1.0 (2020-12-01)

Chores
Documentation Changes
New Features
Bug Fixes
Refactors
  • theme: 主题重构,暴露 createTheme 方法 (#3018) (e7471d70)

4.1.0-beta.21 (2020-11-25)

Bug Fixes

4.1.0-beta.20 (2020-11-21)

Chores
Documentation Changes
New Features
Bug Fixes
Refactors
  • theme: 主题重构,暴露 createTheme 方法 (#3018) (e7471d70)

4.1.0-beta.19 (2020-11-19)

Chores
Documentation Changes
New Features
Bug Fixes

4.1.0-beta.17 (2020-11-10)

Chores
Documentation Changes
New Features
  • label: add adjust-position for path geometry and hide-overlap for interval (#2991) (b66f4005)
  • theme: 更新主题色,更新三个色值 (#2963) (b5a00425)
  • line-style: default use round style (#2953) (30b7655a)
  • G2 层支持 custom annotation html annotation (#2934) (6209203a)
  • annotation: add support for mean / median (#2922) (f8054857)
  • legend: set default maxItemWidth = 200 (#2889) (9e1b2585)
  • region-filter: add geometry life circle, after draw animate (#2879) (2738acb5)
Bug Fixes
Refactors

4.1.0-beta.16 (2020-11-04)

Chores
Documentation Changes
New Features
Bug Fixes
Refactors
  • legend: legend update and render with same logic (#2890) (10666c0c)

4.1.0-beta.14 (2020-10-22)

Documentation Changes
New Features
  • G2 层支持 custom annotation html annotation (#2934) (6209203a)
  • annotation: add support for mean / median (#2922) (f8054857)
  • legend: set default maxItemWidth = 200 (#2889) (9e1b2585)
  • region-filter: add geometry life circle, after draw animate (#2879) (2738acb5)
Bug Fixes
Refactors
  • legend: legend update and render with same logic (#2890) (10666c0c)

4.1.0-beta.11 (2020-10-09)

New Features
  • legend: set default maxItemWidth = 200 (#2889) (9e1b2585)
  • region-filter: add geometry life circle, after draw animate (#2879) (2738acb5)
Bug Fixes
Refactors
  • legend: legend update and render with same logic (#2890) (10666c0c)

4.1.0-beta.10 (2020-09-28)

Chores
Documentation Changes
New Features
Bug Fixes
Other Changes
Tests

4.1.0-beta.1 (2020-09-02)

Chores
Documentation Changes
New Features
Bug Fixes

4.0.15 (2020-08-14)

Documentation Changes
New Features
  • background: 使用 shape 来绘制 dark 的背景色 (#2745) (6adbdbf4)
  • annotation: text annotation 提供 content 回调,将图表 filteredData 作为回调参数 (#2735) (0e4d1f12)
  • Tooltip supported customContent (#2739) (5dc5a36e)
  • add api-extractor for extract typescript declare file (#2725) (22620898)
  • pie-label: add pie-outer label layout (#2726) (d94157da)
Bug Fixes
Refactors
  • axis: axis update 包含有 create 逻辑,删除容易的 create 逻辑,简化代码 (#2741) (757e21d6)

4.0.14 (2020-07-27)

New Features
  • Polygon 为 polygon 添加 square shape,用于绘制正方形矩阵块,同时支持 size 通道映射
  • Facet 分面标题支持格式化
  • Legend 图例新增 maxItemWidth 属性,超出自动省略
  • Annotation annotation 中文本绘制能力增强,可设置自动缩略以及背景框
Bug Fixes
  • 坐标轴 verticalLimitLength 的参照物是画布 (#2692) (85d94fca)
  • 修复 'top-right' 类型的图例位置主题默认 maxItemWidth 不生效的问题

4.0.13 (2020-07-20)

Chores
Documentation Changes
New Features
  • path line area 三类 Geometry 支持 showSinglePoint 属性,用于支持单点孤立数据点的绘制 (#2666) (3f37f287)
Bug Fixes
Refactors

4.0.12 (2020-06-24)

Chores
  • 添加 lint-staged 配置 (#2600) (a776ddd1)

  • 优化 pre-commit hooks,github ci 服务太慢并且做不到强行约束,信息很容易忽略掉

Bug Fixes
  • highlight-by-x Action toggle() 失效的问题

4.0.11 (2020-06-18)

Documentation Changes
Bug Fixes
  • 2570: 修复 appendPadding 设置后,图表更新不断缩小的问题 (#2577) (402e7b01)
  • legend: 修改 legend 布局的宽高限制 (#2587) (055043f1)
  • error if chart destroyed during resize (#2547) (2290ed38)

4.0.10 (2020-06-09)

New Features
Bug Fixes

4.0.9 (2020-05-28)

New Features
Bug Fixes

4.0.8 (2020-05-18)

Documentation Changes
New Features
  • slider: add formatMask property (aac56a86)
  • interaction: use get method (78e2c32f)
Bug Fixes
  • 2365: 修复极坐标系圆弧坐标轴文本不响应坐标系 rotate 的问题 (#2424) (5c2bc3ff)
  • 2371: 修复未判断 labels 为空导致的饼图图例过滤错误 (#2422) (a30eb71f)
  • 2377: registerTheme 时,需要和基础主题进行合并 (#2416) (0c220765)
  • 2412: 修复 axis title offset 设置不生效的问题,默认自动计算 (#2417) (a220df31)
  • fix min/max value map to color (#2442) (b3d41214)

4.0.7 (2020-04-17)

Bug Fixes
  • do not set tooltip position when follow is false (62f5e279)
  • delegation: mouse leave failed (d3a30ed2)
  • element: 修复获取 state style 报错的问题 (320e22f0)

4.0.6 (2020-04-10)

New Features
  • view 上添加手势事件支持 (e4f74a22)
Bug Fixes
  • geometry: geometry.clear() 以及 destroy() 时要清空、销毁内部变量 (c89ff974)
  • #2272: 当映射数据中不存在 x 和 y 时,不绘制 label (df60733e)
Performance Improvements
  • 性能优化,详见 MR
Documentation Changes
  • 添加 Gestrue 手势使用文档 (2c459853)

4.0.5 (2020-04-08)

Bug Fixes
  • #2261: 修复 tooltip 数据查找补全的问题 (4b29feab)
  • #2241: 修改图表更新过程中,tooltip 未及时消失而出现内容为空的问题 (0e9e65f5)

4.0.4 (2020-04-03)

New Features
  • event: 添加 plot:enter 和 plot:leave 事件 (1f9b96be)
  • interaction:
  • view:
    • 支持 plot 上的移动事件触发 (4a86b08a)
    • 添加一些方法的别名,以兼容 3.x,但是这些方法将会在 4.1 版本中移除 (6356363a)
  • force-fit: add forceFit api for chart (719b61b3)
Bug Fixes
  • theme:
    • 修复主题切换后,Geometry 样式未更新的问题 (7e75a543)
    • 修复在 chart 构造函数中设置 theme 对象不生效的问题. Closed #2258 (6863a69f)
    • 移除 label 的描边,会带来性能损耗 (99b799d9)
  • 移除 coord.getRadius() 的 ts-ignore 注释 (a02b7316)
  • geometry: 修复层叠点图上下区间点全部绘制的问题。Closed #2202 (d7edf5e6)
  • view: 修复 syncScale() 调用时机不当导致分面渲染性能直线下降的问题 (d492c0ea)
  • #2264: 修复 canvas 样式导致的 resize 问题, 修复容器层级 (10200851)
  • #2232: fix 当 legend item 点击的时候, 图例项变少 (19ca46ff)
  • #2173: fix legend overlap when in same direction (59db3b59)
  • #2212: fix when slider option has no start or end (36a3b5db)
  • #2222: fix scale pool memory leak (7f23a4c0)
  • #2215: fix chart min size = 100 (e49646d3)
  • #2195: fix autoFit 不生效 (92d607ec)
Refactors
  • use unpkg other than browser field in package.json (0185949b)
  • theme: 移除注册样式表机制,只提供根据样式表生成主题的方法 (9b0020ad)
  • geometry: 将获取 shape 默认属性时机从 Element 绘制提到 Geometry getDrawCfg() (cf9b2f4f)
  • sync-scale: use Map for perf (76813745)

4.0.3 (2020-03-23)

New Features
  • axis: 支持转置极坐标坐标轴的渲染, Closed #1744 (67a8beb0)
  • scale: 支持用户指定确定数据 id 的字段 (25caa91f)
  • tooltip:
    • position 属性新增 'auto' 值配置,并作为默认值 (8c3fda47)
    • tooltip 体验优化,当鼠标离开 tooltip 内容框时,非 locked 状态自动隐藏 (9f8fcad2)
    • 通过 pointer-events 属性来达到 tooltip 躲避鼠标的交互效果 (2e750aa4)(d5f1e21c)
  • event: 添加 element:statechange 事件 (de161f49)
  • interaction: 新增 legend, axis highlight actions (ab256905)
  • action:
    • export getActionClass, extend action (db635b7e)
    • 添加 throttledebounce 属性配置 (a7e9f18d)
  • export 所有的类型定义,生成对应的 API 文档 (219126ed)
Bug Fixes
  • label:
    • 修复极坐标下的第一个 label 对齐的问题 (8be4555d)
    • 修复漏斗图 label 问题:更新以及尖底漏斗图最后一个 label 的位置错误,Closed #1847 (cfd7c0a5)
    • 默认饼图 label 连接线颜色同图形元素颜色一致 (78323aae)
    • 修复 interval 类型 label 在转置直角坐标系下 position 计算错误问题 (39d02120)
  • tooltip:
    • 修复 tooltip markers 没有正确显示/隐藏的问题 (394dad27)
    • 修复 tooltip 数据为空时不隐藏的问题 (76edffdb)
    • 修复 tooltip 相同数据显示隐藏再显示时不展示的问题,Closed #2174, #2175 (c3357c1f)
  • Action:
    • active-region: 修复背景框计算错误的问题 (7b5f651b)
  • options: 修复 chart.updateOptions() 更新失败的问题 (b1dff91b)
  • event: 调整 afterpaint 的抛出时机 (f1f8206c)
  • geometry: 修复 element 打标策略导致的数据未被全部绘制的问题,Closed #2141 (071fa7c2)
  • data: 修复使用数据引用造成数据未更新的问题 (bb258fc6)
  • event 修复当鼠标在图表上页面无法滚动的问题,Closed #2111
Refactors
  • label:
    • 重构 GeometryLabel。将 labels 组件的生成渲染移入 GeomtryLabel 中 (4537b965)
    • 重构 Label 相关模块,将饼图 label 的布局调整到 LabelLayout 中 (402d6c52)
Chores
  • 更新图表演示实例,优化实现代码,同时新添加动态气泡图以及带坐标轴的极坐标下的层叠柱状图
2020-03-22 18-17-49.2020-03-22 18_20_32.gif image.png
Documentation Changes
  • 更新事件、交互以及 FAQ 文档

4.0.2 (2020-03-16)

New Features
  • 将 Util 在从 core.ts 移到 src/index.ts 下 (e8d05d16)
  • 添加一些矩阵变换相关的工具方法 (921a45f3)
  • interaction:
Bug Fixes
  • slider: when changeData, slider min max text should be update (b06c9ee3)
  • auto-fix: fix height when autoFit and container has padding (1102a4a7)
  • annotation: 修复 chart.annotation() 接口中 animateOption 属性不生效的问题,Closed #2146 (6a3ecba1)
  • scale: 修复日期正则表达式将 '20200229' 判断为 time 类型的问题, related #2115 (f31ccca7)

4.0.1 (2020-03-09)

Chores
New Features

4.0.0 正式发布 (2020-03-01)

作为图形语法(the Grammar of Graphics)的前端实现,G2 已经经历多个版本的迭代。本次 G2 4.0 是一个新的起点,我们对底层架构做了大量的重构工作,G2 会更加关注于:图形语法,交互语法以及可视化组件体系的建设。我们希望 G2 4.0 会成为一个专业的、给用户带来更多可能性的可视化底层引擎,在满足传统型统计图表需求的基础上,能够更好地赋能于(但不限于):

  • 让开发者基于 G2 4.0 可以更快更好地封装上层图表库
  • 让交互式可视化更简单
  • 成为可视化领域的专业工具

虽然我们对 G2 内部进行了大规模的重构工作,包括数据处理流程(引入数据更新机制),图表组件,view 渲染更新逻辑以及事件、交互机制改造等,但是为了保障用户项目能够更平滑得升级,G2 4.0 保持了最大程度上的兼容,但是仍然有一部分 breaking change 需要注意。

变更说明

整体变化

  • 全面拥抱 TypeScript。
  • 全新的可视化组件:面向交互,体验优雅。
  • 强大的 View 模块:可单独使用,具备完备的可视化组件、事件,支持 View 嵌套以及自动布局。
  • 全新的交互语法。
  • 绘图引擎升级至 G 0.4 版本,支持双引擎切换。
  • 引入数据更新机制。
  • 动画机制改造,更细粒度,体验更好。
  • 模块化管理,提供更加灵活的扩展机制。

API 变更

G2 4.0 在功能上全面兼容 3.x 的功能,在 API 接口上,我们进行了一些优化,在最大程度兼容 3.x 语法的基础上,提供了对用户更加友好,更易理解的函数命名以及更合理的配置项结构,具体的变化记录如下:

不兼容改动
  • chart.source() 接口废弃,请使用 chart.data() 接口,同时列定义请通过 chart.scale()  接口进行定义。
  • chart.coord() 接口废弃,请使用 chart.coordinate()
  • chart.guide() 接口废弃,请使用 chart.annotation(),同时不再支持 chart.guide().html()
  • chart.view()  接口废弃,请使用 chart.createView()
  • chart.interact()  接口废弃,请使用 chart.interaction()
  • chart.repaint()  接口废弃,请使用 chart.render(update: boolean) 接口。
  • ❌ G2.Global 移除,默认的主题配置可以通过以下方式获取:
// 方式 1
import { getTheme } from '@antv/g2';
const defaultTheme = getTheme();

// 方式 2,通过 chart 示例获取当前主题
const theme = chart.getTheme();
  • geometry.active()  废弃,请使用 geometry.state() 接口。
  • geometry.select()  废弃,请使用 geometry.state() 接口。
  • geometry.opacity() 废弃,请使用 geometry.color()  中使用带透明度的颜色或者 geometry.style()  接口。
  • 以下语法糖不再支持:
    • pointJitter()  废弃,请使用 point().adjust('jitter')
    • pointDodge()  废弃,请使用 point().adjust('dodge')
    • ❌ intervalStack() 废弃,请使用 interval().adjust('stack')
    • ❌ intervalDodge() 废弃,请使用 interval().adjust('dodge')
    • ❌ intervalSymmetric() 废弃,请使用 interval().adjust('symmetric')
    • ❌ areaStack() 废弃,请使用 area().adjust('stack')
    • ❌ schemaDodge() 废弃,请使用  schema().adjust('stack')
  • Venn  以及 Violin  几何标记暂时移除,后续考虑以更好的方式支持。
  • ❌ 移除 Interval 几何标记以下两个 shape: 'top-line' 及  'liquid-fill-gauge',用户可以通过自定义 Shape 机制自己实现。
  • ❌ 移除 tail 类型的图例。
  • 内置常量重命名,一致使用小写 + '-' 命名规则,比如 shape('hollowCircle') 变更为 shape('hollow-circle')
配置项以及接口变更

我们在 4.0 中对以下接口以及一些接口中的属性进行了部分变更,在兼容 3.x 原有功能的基础上,让配置项更具语义,同时结构更加合理,具体请参考 API 文档。

  • new Chart(cfg)  接口属性更新(新老接口对比)

  • chart.data()  接口不再支持 DataView 格式数据,只支持标准 JSON 数组,所以在使用 DataSet 时,要取最后的 JSON 数组结果传入 G2: chart.data(dv.rows);

  • 所有同绘图相关的配置全部定义在 style 属性中:

chart.axis('value', {
  label: {
    style: {
      textAlign: 'center',
    }, // 设置坐标轴文本样式
  },
  line: {
    style: {
      stroke: '#E9E9E9',
      lineDash: [3, 3],
    }, // 设置坐标轴线样式
  },
  grid: {
    line: {
      style: {
        lineDash: [3, 3],
      },
    }, // 设置坐标系栅格样式
  },
});
  • chart.tooltip() 配置项更新,同时将 G2 3.x 版本中一些针对特定图表的内置规则删除,需要用户自己通过提供的配置项进行配置,具体配置属性详见 API
  • chart.legend()  配置项更新,详见 API
  • chart.axis()  配置项更新,详见 API
  • chart.annotation()  各个类型的 annotation 配置项更新,详见 API
  • geometry().style() 方法的回调函数写法变更,不再支持一个配置属性一个回调的方式,而是使用一个回调:
style('a', (aVal) => {
  if (a === 1) return { fill: 'red' };
  return { fill: 'blue' };
});

详见 API

  • geometry.label() 接口更新,不再支持 html 类型的 label,详见 API