You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2019/08/29 21:05:53 UTC
[incubator-echarts-doc] branch release updated (c7b7105 -> 48bcb51)
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a change to branch release
in repository https://gitbox.apache.org/repos/asf/incubator-echarts-doc.git.
from c7b7105 changelog of 4.3.0
new cd92e45 enhance config
new 48bcb51 rebuild
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
README.md | 17 +-
build.js | 38 +-
config.js => config/env.asf.js | 0
configdev.js => config/env.dev.js | 0
config/env.echartsjs.js | 9 +
configgithub.js => config/env.github.js | 0
configen.js | 9 -
package.json | 3 +-
public/404.html | 7 +-
public/about.html | 7 +-
public/api.html | 7 +-
public/builder.html | 7 +-
public/builder3.html | 7 +-
public/changelog.html | 7 +-
public/cheat-sheet.html | 6 +
public/cn/documents/cn/api.json | 2 +-
public/cn/documents/cn/changelog.html | 169 +
public/cn/documents/cn/option.json | 2 +-
public/cn/documents/cn/tutorial.json | 2 +-
public/coding-standard.html | 7 +-
public/committer.html | 7 +-
public/demo.html | 7 +-
public/download-extension.html | 7 +-
public/download-map.html | 7 +-
public/download-theme.html | 7 +-
public/download.html | 7 +-
public/download3.html | 7 +-
public/en/404.html | 20 +
public/en/api.html | 28 +-
public/en/builder.html | 27 +-
public/en/builder/echarts.html | 2 +-
.../src/echarts/action/createDataSelectAction.js | 3 +-
public/en/builder/src/echarts/chart/bar.js | 5 +-
public/en/builder/src/echarts/chart/bar/BarView.js | 59 +-
public/en/builder/src/echarts/chart/custom.js | 41 +-
.../builder/src/echarts/chart/funnel/FunnelView.js | 21 +-
.../src/echarts/chart/funnel/funnelLayout.js | 54 +-
.../builder/src/echarts/chart/gauge/GaugeView.js | 3 +-
public/en/builder/src/echarts/chart/graph.js | 2 +-
.../builder/src/echarts/chart/graph/GraphView.js | 54 +-
.../builder/src/echarts/chart/graph/adjustEdge.js | 12 +-
.../src/echarts/chart/graph/categoryVisual.js | 17 +-
.../src/echarts/chart/graph/circularLayout.js | 2 +-
.../echarts/chart/graph/circularLayoutHelper.js | 87 +-
.../builder/src/echarts/chart/graph/forceLayout.js | 2 +-
.../{config.js => chart/graph/graphHelper.js} | 33 +-
public/en/builder/src/echarts/chart/helper/Line.js | 15 +-
.../builder/src/echarts/chart/helper/LinePath.js | 13 +-
.../en/builder/src/echarts/chart/helper/Symbol.js | 56 +-
.../en/builder/src/echarts/chart/pie/PieSeries.js | 3 +
public/en/builder/src/echarts/chart/pie/PieView.js | 76 +-
.../builder/src/echarts/chart/pie/labelLayout.js | 19 +-
.../builder/src/echarts/chart/radar/RadarView.js | 16 +-
.../builder/src/echarts/chart/radar/radarLayout.js | 37 +-
.../src/echarts/chart/sankey/SankeySeries.js | 50 +-
.../builder/src/echarts/chart/sankey/SankeyView.js | 11 +-
.../src/echarts/chart/sankey/sankeyLayout.js | 315 +-
.../src/echarts/chart/sankey/sankeyVisual.js | 10 +-
.../src/echarts/chart/sunburst/SunburstPiece.js | 2 +-
.../echarts/chart/themeRiver/ThemeRiverSeries.js | 3 +-
.../src/echarts/chart/treemap/TreemapSeries.js | 2 +-
.../src/echarts/component/axis/AngleAxisView.js | 14 +-
.../src/echarts/component/axis/AxisBuilder.js | 44 +-
.../echarts/component/axis/CartesianAxisView.js | 5 +-
.../src/echarts/component/axis/SingleAxisView.js | 5 +-
.../component/axisPointer/BaseAxisPointer.js | 2 +-
.../component/axisPointer/CartesianAxisPointer.js | 12 +-
.../component/axisPointer/SingleAxisPointer.js | 12 +-
.../echarts/component/axisPointer/viewHelper.js | 3 +
.../en/builder/src/echarts/component/dataZoom.js | 16 +-
.../src/echarts/component/dataZoom/AxisProxy.js | 98 +-
.../echarts/component/dataZoom/InsideZoomView.js | 2 +-
.../echarts/component/dataZoom/SliderZoomView.js | 5 +-
.../src/echarts/component/dataZoomInside.js | 4 -
.../src/echarts/component/dataZoomSelect.js | 3 +-
.../component/{dataZoom.js => dataZoomSlider.js} | 6 -
.../src/echarts/component/helper/MapDraw.js | 8 +-
.../src/echarts/component/helper/sliderMove.js | 16 +-
.../component/legend/ScrollableLegendView.js | 17 +-
.../src/echarts/component/marker/MarkLineView.js | 9 +-
.../src/echarts/component/marker/MarkPointView.js | 22 +-
public/en/builder/src/echarts/component/title.js | 24 +-
.../src/echarts/component/toolbox/ToolboxModel.js | 9 +-
.../src/echarts/component/toolbox/ToolboxView.js | 30 +-
.../component/toolbox/feature/SaveAsImage.js | 12 +-
.../echarts/component/tooltip/TooltipContent.js | 13 +-
.../component/tooltip/TooltipRichContent.js | 11 +-
.../src/echarts/component/tooltip/TooltipView.js | 2 +-
.../echarts/component/visualMap/ContinuousView.js | 6 +-
.../echarts/component/visualMap/PiecewiseModel.js | 4 +-
.../echarts/component/visualMap/PiecewiseView.js | 2 +-
.../src/echarts/component/visualMap/helper.js | 10 +-
.../src/echarts/coord/axisTickLabelBuilder.js | 2 +-
.../en/builder/src/echarts/coord/cartesian/Grid.js | 14 +-
.../builder/src/echarts/coord/single/AxisModel.js | 4 +-
public/en/builder/src/echarts/data/Graph.js | 2 +-
public/en/builder/src/echarts/data/List.js | 47 +-
.../src/echarts/data/helper/completeDimensions.js | 2 +-
.../src/echarts/data/helper/dimensionHelper.js | 40 +-
public/en/builder/src/echarts/echarts.js | 56 +-
public/en/builder/src/echarts/langEN.js | 32 +
.../langEN.js => en/builder/src/echarts/langES.js} | 32 +-
public/en/builder/src/echarts/layout/barGrid.js | 20 +-
public/en/builder/src/echarts/layout/barPolar.js | 17 +-
public/en/builder/src/echarts/model/Global.js | 2 +-
.../en/builder/src/echarts/model/OptionManager.js | 2 +-
.../builder/src/echarts/model/mixin/dataFormat.js | 7 +-
.../builder/src/echarts/model/mixin/lineStyle.js | 14 +-
.../src/echarts/preprocessor/backwardCompat.js | 2 +-
public/en/builder/src/echarts/util/graphic.js | 332 +-
public/en/builder/src/echarts/util/number.js | 8 +
public/en/builder/src/echarts/util/symbol.js | 20 +-
public/en/builder/src/echarts/view/Chart.js | 28 +-
public/en/builder/src/echarts/visual/symbol.js | 28 +-
.../echarts3/component/visualMap/PiecewiseModel.js | 2 +-
public/en/builder/src/zrender/Painter.js | 13 +-
public/en/builder/src/zrender/contain/text.js | 40 +-
public/en/builder/src/zrender/core/PathProxy.js | 8 +-
public/en/builder/src/zrender/core/event.js | 160 +-
.../src/zrender/core/fourPointsTransform.js | 90 +
.../en/builder/src/zrender/graphic/CompoundPath.js | 2 +-
.../en/builder/src/zrender/graphic/Displayable.js | 27 +-
public/en/builder/src/zrender/graphic/Path.js | 6 +-
public/en/builder/src/zrender/graphic/Style.js | 7 +-
.../en/builder/src/zrender/graphic/helper/text.js | 22 +-
public/en/builder/src/zrender/svg/graphic.js | 56 +-
.../src/zrender/svg/helper/ClippathManager.js | 4 +-
public/en/builder/src/zrender/vml/graphic.js | 10 +-
public/en/builder/src/zrender/zrender.js | 11 +-
public/en/changelog.html | 183 +-
public/en/cheat-sheet.html | 21 +
public/en/coding-standard.html | 14 +-
public/en/committers.html | 12 +-
public/en/css/main.css | 2 +-
public/en/dependencies.html | 12 +-
public/en/dist/echarts-en.common.js | 2537 +-
public/en/dist/echarts-en.common.min.js | 2 +-
public/en/dist/echarts-en.js | 33022 ++++++++++---------
public/en/dist/echarts-en.js.map | 2 +-
public/en/dist/echarts-en.min.js | 2 +-
public/en/dist/echarts-en.simple.js | 1559 +-
public/en/dist/echarts-en.simple.min.js | 2 +-
public/en/dist/echarts.common.js | 2505 +-
public/en/dist/echarts.common.min.js | 2 +-
public/en/dist/echarts.js | 32990 +++++++++---------
public/en/dist/echarts.js.map | 2 +-
public/en/dist/echarts.min.js | 2 +-
public/en/dist/echarts.simple.js | 1527 +-
public/en/dist/echarts.simple.min.js | 2 +-
public/en/dist/extension/bmap.min.js | 2 +-
public/en/dist/extension/dataTool.js | 72 +-
public/en/dist/extension/dataTool.js.map | 2 +-
public/en/dist/extension/dataTool.min.js | 2 +-
public/en/documents/en/api.json | 2 +-
public/en/documents/en/changelog.html | 169 +
public/en/documents/en/option.json | 2 +-
public/en/documents/en/tutorial.json | 2 +-
public/en/documents/zh/api.json | 2 +-
public/en/documents/zh/changelog.html | 169 +
public/en/documents/zh/option.json | 2 +-
public/en/documents/zh/tutorial.json | 2 +-
public/en/download-extension.html | 12 +-
public/en/download-map.html | 14 +-
public/en/download-theme.html | 21 +-
public/en/download.html | 16 +-
public/en/faq.html | 14 +-
public/en/feature.html | 12 +-
public/en/images/404.png | Bin 72998 -> 71950 bytes
public/en/images/about/1.png | Bin 36618 -> 35765 bytes
public/en/images/about/2.png | Bin 77291 -> 76438 bytes
public/en/images/about/3.png | Bin 114969 -> 114116 bytes
public/en/images/about/4.png | Bin 67588 -> 66735 bytes
public/en/images/about/5.png | Bin 140731 -> 139878 bytes
public/en/images/about/6.png | Bin 56879 -> 56026 bytes
public/en/images/about/7.png | Bin 102847 -> 101994 bytes
public/en/images/about/8.png | Bin 17302 -> 17237 bytes
public/en/images/about/xiaomi.png | Bin 12462 -> 12397 bytes
public/en/images/banners/2017-03-23-ife.png | Bin 30268 -> 30255 bytes
public/en/images/banners/2017-09-12-zhibo.png | Bin 93489 -> 60788 bytes
public/en/images/bg.png | Bin 55761 -> 8242 bytes
public/en/images/bg2.png | Bin 17932 -> 3966 bytes
public/en/images/btn-arrow.png | Bin 448 -> 435 bytes
public/en/images/btn-download.png | Bin 775 -> 762 bytes
public/en/images/btn-email.png | Bin 1226 -> 1213 bytes
public/en/images/btn-github.png | Bin 1178 -> 1165 bytes
public/en/images/btn-weibo.png | Bin 1661 -> 1648 bytes
public/en/images/btn-weixin.png | Bin 1383 -> 1370 bytes
public/en/images/builder/checked.png | Bin 1069 -> 216 bytes
public/en/images/chart-icon.png | Bin 13805 -> 7543 bytes
public/en/images/company/company1.png | Bin 40660 -> 34074 bytes
public/en/images/company/company10.png | Bin 21174 -> 17340 bytes
public/en/images/company/company11.png | Bin 41458 -> 33932 bytes
public/en/images/company/company12.png | Bin 29268 -> 22972 bytes
public/en/images/company/company13.png | Bin 24944 -> 18234 bytes
public/en/images/company/company14.png | Bin 24571 -> 18684 bytes
public/en/images/company/company15.png | Bin 42695 -> 33241 bytes
public/en/images/company/company16.png | Bin 9453 -> 6234 bytes
public/en/images/company/company17.png | Bin 51321 -> 37432 bytes
public/en/images/company/company18.png | Bin 52342 -> 40871 bytes
public/en/images/company/company19.png | Bin 17617 -> 12456 bytes
public/en/images/company/company2.png | Bin 59543 -> 46597 bytes
public/en/images/company/company20.png | Bin 30413 -> 21384 bytes
public/en/images/company/company21.png | Bin 37470 -> 26625 bytes
public/en/images/company/company22.png | Bin 31626 -> 24520 bytes
public/en/images/company/company23.png | Bin 13831 -> 9483 bytes
public/en/images/company/company24.png | Bin 24348 -> 21163 bytes
public/en/images/company/company3.png | Bin 43341 -> 35425 bytes
public/en/images/company/company4.png | Bin 28632 -> 22664 bytes
public/en/images/company/company5.png | Bin 9430 -> 5722 bytes
public/en/images/company/company6.png | Bin 21655 -> 16583 bytes
public/en/images/company/company7.png | Bin 33797 -> 25376 bytes
public/en/images/company/company8.png | Bin 9260 -> 6290 bytes
public/en/images/company/company9.png | Bin 49281 -> 38098 bytes
public/en/images/echarts-footer-logo.png | Bin 7564 -> 7551 bytes
public/en/images/echarts-footer-text.png | Bin 1272 -> 1259 bytes
public/en/images/extensions/default-extension.png | Bin 2028 -> 2015 bytes
public/en/images/favicon.png | Bin 1592 -> 1534 bytes
public/en/images/feature-1.png | Bin 116562 -> 18916 bytes
public/en/images/features/capetown-taxi.png | Bin 1501879 -> 1192562 bytes
public/en/images/features/population.png | Bin 580827 -> 447886 bytes
public/en/images/features/scatterGL.png | Bin 643166 -> 386820 bytes
public/en/images/features/scatterGL2.png | Bin 2009491 -> 1113942 bytes
public/en/images/features/scatterGL3.png | Bin 1272747 -> 714079 bytes
public/en/images/features/scatterGL4.png | Bin 953836 -> 218103 bytes
public/en/images/forie.png | Bin 171716 -> 170668 bytes
public/en/images/github.png | Bin 2330 -> 1477 bytes
public/en/images/gongzhonghao.png | Bin 36677 -> 26811 bytes
public/en/images/icon-email.png | Bin 807 -> 794 bytes
public/en/images/icon-github.png | Bin 936 -> 923 bytes
public/en/images/icon-twitter.png | Bin 667 -> 654 bytes
public/en/images/icon-weibo.png | Bin 1334 -> 1321 bytes
public/en/images/index-bg.png | Bin 353465 -> 55632 bytes
public/en/images/index-chart/handle.png | Bin 1252 -> 941 bytes
public/en/images/index-chart/handle2.png | Bin 567 -> 343 bytes
public/en/images/index-chart/iphone.png | Bin 98448 -> 40811 bytes
public/en/images/index-feature.png | Bin 64514 -> 49915 bytes
public/en/images/index/1.png | Bin 38600 -> 37747 bytes
public/en/images/index/2.png | Bin 80174 -> 79321 bytes
public/en/images/index/3.png | Bin 114969 -> 114116 bytes
public/en/images/index/4.png | Bin 67588 -> 66735 bytes
public/en/images/index/5.png | Bin 140731 -> 139878 bytes
public/en/images/index/6.png | Bin 56760 -> 55907 bytes
public/en/images/index/7.png | Bin 104606 -> 103753 bytes
public/en/images/index/device.png | Bin 85318 -> 84466 bytes
public/en/images/index/device1.png | Bin 87517 -> 84803 bytes
public/en/images/index/earth.png | Bin 79622 -> 79564 bytes
public/en/images/index/echarts.png | Bin 33008 -> 32076 bytes
public/en/images/index/file.png | Bin 5035 -> 4977 bytes
public/en/images/index/footer.png | Bin 4333 -> 3280 bytes
public/en/images/index/header.png | Bin 6172 -> 5119 bytes
public/en/images/index/line.png | Bin 32795 -> 31863 bytes
public/en/images/index/shadow.png | Bin 5919 -> 5861 bytes
public/en/images/liquid-fill.png | Bin 31358 -> 31345 bytes
public/en/images/logo.png | Bin 3765 -> 3707 bytes
public/en/images/map.png | Bin 283943 -> 213619 bytes
public/en/images/no-map.png | Bin 8135 -> 5421 bytes
public/en/images/people/JB.png | Bin 87295 -> 87282 bytes
public/en/images/people/erik.png | Bin 70060 -> 70047 bytes
public/en/images/people/weizhi.png | Bin 1284 -> 1271 bytes
.../en/images/people/\345\221\250\346\211\254.png" | Bin 92607 -> 92594 bytes
.../en/images/people/\345\221\250\347\216\211.png" | Bin 97601 -> 97588 bytes
.../en/images/people/\345\244\247\344\275\233.png" | Bin 111561 -> 84050 bytes
.../\345\250\204\345\220\214\345\205\265.png" | Bin 20118 -> 20105 bytes
.../en/images/people/\345\256\277\347\210\275.png" | Bin 76678 -> 76665 bytes
.../en/images/people/\345\260\217\347\272\242.png" | Bin 97862 -> 97849 bytes
.../en/images/people/\345\276\267\346\270\205.png" | Bin 70273 -> 67559 bytes
.../en/images/people/\346\235\216\346\271\233.png" | Bin 67163 -> 67150 bytes
.../en/images/people/\346\235\250\351\252\245.png" | Bin 80366 -> 80353 bytes
.../en/images/people/\346\236\227\345\263\260.png" | Bin 62803 -> 47308 bytes
.../\346\241\221\346\226\207\351\224\213.png" | Bin 77118 -> 77105 bytes
.../en/images/people/\346\262\210\346\257\205.png" | Bin 66512 -> 66499 bytes
.../en/images/people/\346\262\210\346\265\251.png" | Bin 65255 -> 65242 bytes
.../\347\216\213\344\277\212\345\251\267.png" | Bin 106485 -> 81510 bytes
.../en/images/people/\347\216\213\347\220\274.png" | Bin 68308 -> 68295 bytes
.../en/images/people/\347\224\260\345\275\247.png" | Bin 46656 -> 43879 bytes
.../en/images/people/\347\245\226\346\230\216.png" | Bin 70285 -> 70272 bytes
.../en/images/people/\347\272\242\350\226\257.png" | Bin 63205 -> 63192 bytes
.../en/images/people/\347\276\241\350\276\231.png" | Bin 71775 -> 69060 bytes
.../\350\213\217\346\200\235\346\226\207.png" | Bin 97740 -> 94259 bytes
.../\350\242\201\346\231\223\345\246\202.png" | Bin 81879 -> 81866 bytes
.../\350\260\242\347\233\212\350\276\211.png" | Bin 84370 -> 84357 bytes
.../en/images/people/\350\265\265\351\233\267.png" | Bin 68260 -> 68247 bytes
.../en/images/people/\351\230\277\346\226\207.png" | Bin 80273 -> 80260 bytes
.../en/images/people/\351\231\210\344\270\272.png" | Bin 52648 -> 52635 bytes
.../\351\241\276\350\275\266\347\201\265.png" | Bin 139414 -> 110953 bytes
.../\351\255\217\345\244\252\344\272\221.png" | Bin 48970 -> 48957 bytes
.../\351\273\204\345\277\227\346\225\217.png" | Bin 90020 -> 90007 bytes
.../en/images/people/\351\273\204\346\202\246.png" | Bin 81118 -> 81105 bytes
public/en/images/pipeline.png | Bin 220187 -> 141946 bytes
public/en/images/yinhao.png | Bin 2898 -> 1371 bytes
public/en/index.html | 17 +-
public/en/js/cheat-sheet-en.js | 1 +
public/en/js/cheat-sheet.js | 1 +
public/en/js/common.js | 2 +-
public/en/js/docTool/main.js | 16 +-
public/en/js/download.js | 2 +-
public/en/maillist.html | 12 +-
public/en/nav.html | 2 +-
public/en/option-gl.html | 28 +-
public/en/option.html | 28 +-
public/en/option3.html | 74 +-
public/en/tutorial.html | 28 +-
public/en/vendors/echarts/echarts-20190709.min.js | 22 +
public/en/video/feature-1.jpg | Bin 167910 -> 52108 bytes
public/en/video/feature-2.jpg | Bin 165749 -> 46538 bytes
public/en/video/index-4.jpg | Bin 463029 -> 72013 bytes
public/en/video/index.jpg | Bin 97216 -> 27348 bytes
public/examples.html | 2 +-
public/faq.html | 7 +-
public/feature.html | 7 +-
public/index.html | 7 +-
public/maillist.html | 7 +-
public/option-gl.html | 7 +-
public/option.html | 7 +-
public/option3.html | 7 +-
public/spreadsheet.html | 7 +-
public/tutorial.html | 7 +-
public/zh/404.html | 12 +-
public/zh/api.html | 28 +-
public/zh/builder.html | 27 +-
public/zh/builder/echarts.html | 2 +-
.../src/echarts/action/createDataSelectAction.js | 3 +-
public/zh/builder/src/echarts/chart/bar.js | 5 +-
public/zh/builder/src/echarts/chart/bar/BarView.js | 59 +-
public/zh/builder/src/echarts/chart/custom.js | 41 +-
.../builder/src/echarts/chart/funnel/FunnelView.js | 21 +-
.../src/echarts/chart/funnel/funnelLayout.js | 54 +-
.../builder/src/echarts/chart/gauge/GaugeView.js | 3 +-
public/zh/builder/src/echarts/chart/graph.js | 2 +-
.../builder/src/echarts/chart/graph/GraphView.js | 54 +-
.../builder/src/echarts/chart/graph/adjustEdge.js | 12 +-
.../src/echarts/chart/graph/categoryVisual.js | 17 +-
.../src/echarts/chart/graph/circularLayout.js | 2 +-
.../echarts/chart/graph/circularLayoutHelper.js | 87 +-
.../builder/src/echarts/chart/graph/forceLayout.js | 2 +-
.../src/echarts/chart/graph/graphHelper.js} | 33 +-
public/zh/builder/src/echarts/chart/helper/Line.js | 15 +-
.../builder/src/echarts/chart/helper/LinePath.js | 13 +-
.../zh/builder/src/echarts/chart/helper/Symbol.js | 56 +-
.../zh/builder/src/echarts/chart/pie/PieSeries.js | 3 +
public/zh/builder/src/echarts/chart/pie/PieView.js | 76 +-
.../builder/src/echarts/chart/pie/labelLayout.js | 19 +-
.../builder/src/echarts/chart/radar/RadarView.js | 16 +-
.../builder/src/echarts/chart/radar/radarLayout.js | 37 +-
.../src/echarts/chart/sankey/SankeySeries.js | 50 +-
.../builder/src/echarts/chart/sankey/SankeyView.js | 11 +-
.../src/echarts/chart/sankey/sankeyLayout.js | 315 +-
.../src/echarts/chart/sankey/sankeyVisual.js | 10 +-
.../src/echarts/chart/sunburst/SunburstPiece.js | 2 +-
.../echarts/chart/themeRiver/ThemeRiverSeries.js | 3 +-
.../src/echarts/chart/treemap/TreemapSeries.js | 2 +-
.../src/echarts/component/axis/AngleAxisView.js | 14 +-
.../src/echarts/component/axis/AxisBuilder.js | 44 +-
.../echarts/component/axis/CartesianAxisView.js | 5 +-
.../src/echarts/component/axis/SingleAxisView.js | 5 +-
.../component/axisPointer/BaseAxisPointer.js | 2 +-
.../component/axisPointer/CartesianAxisPointer.js | 12 +-
.../component/axisPointer/SingleAxisPointer.js | 12 +-
.../echarts/component/axisPointer/viewHelper.js | 3 +
.../zh/builder/src/echarts/component/dataZoom.js | 16 +-
.../src/echarts/component/dataZoom/AxisProxy.js | 98 +-
.../echarts/component/dataZoom/InsideZoomView.js | 2 +-
.../echarts/component/dataZoom/SliderZoomView.js | 5 +-
.../src/echarts/component/dataZoomInside.js | 4 -
.../src/echarts/component/dataZoomSelect.js | 3 +-
.../src/echarts/component/dataZoomSlider.js} | 6 -
.../src/echarts/component/helper/MapDraw.js | 8 +-
.../src/echarts/component/helper/sliderMove.js | 16 +-
.../component/legend/ScrollableLegendView.js | 17 +-
.../src/echarts/component/marker/MarkLineView.js | 9 +-
.../src/echarts/component/marker/MarkPointView.js | 22 +-
public/zh/builder/src/echarts/component/title.js | 24 +-
.../src/echarts/component/toolbox/ToolboxModel.js | 9 +-
.../src/echarts/component/toolbox/ToolboxView.js | 30 +-
.../component/toolbox/feature/SaveAsImage.js | 12 +-
.../echarts/component/tooltip/TooltipContent.js | 13 +-
.../component/tooltip/TooltipContentManager.js | 0
.../component/tooltip/TooltipRichContent.js | 11 +-
.../src/echarts/component/tooltip/TooltipView.js | 2 +-
.../echarts/component/visualMap/ContinuousView.js | 6 +-
.../echarts/component/visualMap/PiecewiseModel.js | 2 +-
.../echarts/component/visualMap/PiecewiseView.js | 2 +-
.../src/echarts/component/visualMap/helper.js | 10 +-
.../src/echarts/coord/axisTickLabelBuilder.js | 2 +-
.../zh/builder/src/echarts/coord/cartesian/Grid.js | 14 +-
.../builder/src/echarts/coord/single/AxisModel.js | 4 +-
public/zh/builder/src/echarts/data/Graph.js | 2 +-
public/zh/builder/src/echarts/data/List.js | 47 +-
.../src/echarts/data/helper/completeDimensions.js | 2 +-
.../src/echarts/data/helper/dimensionHelper.js | 40 +-
public/zh/builder/src/echarts/echarts.js | 56 +-
public/zh/builder/src/echarts/langEN.js | 32 +
.../builder/src/echarts/{langEN.js => langES.js} | 32 +-
public/zh/builder/src/echarts/layout/barGrid.js | 20 +-
public/zh/builder/src/echarts/layout/barPolar.js | 17 +-
public/zh/builder/src/echarts/model/Global.js | 2 +-
.../zh/builder/src/echarts/model/OptionManager.js | 2 +-
.../builder/src/echarts/model/mixin/dataFormat.js | 7 +-
.../builder/src/echarts/model/mixin/lineStyle.js | 14 +-
.../src/echarts/preprocessor/backwardCompat.js | 2 +-
public/zh/builder/src/echarts/util/graphic.js | 332 +-
public/zh/builder/src/echarts/util/number.js | 8 +
public/zh/builder/src/echarts/util/symbol.js | 20 +-
public/zh/builder/src/echarts/view/Chart.js | 28 +-
public/zh/builder/src/echarts/visual/symbol.js | 28 +-
public/zh/builder/src/zrender/Painter.js | 13 +-
.../builder/src/zrender/animation/track.js | 0
public/zh/builder/src/zrender/contain/text.js | 40 +-
public/zh/builder/src/zrender/core/PathProxy.js | 8 +-
public/zh/builder/src/zrender/core/event.js | 160 +-
.../src/zrender/core/fourPointsTransform.js | 90 +
.../zh/builder/src/zrender/graphic/CompoundPath.js | 2 +-
.../zh/builder/src/zrender/graphic/Displayable.js | 27 +-
public/zh/builder/src/zrender/graphic/Path.js | 6 +-
public/zh/builder/src/zrender/graphic/Style.js | 7 +-
.../zh/builder/src/zrender/graphic/helper/text.js | 22 +-
public/zh/builder/src/zrender/svg/graphic.js | 56 +-
.../src/zrender/svg/helper/ClippathManager.js | 4 +-
public/zh/builder/src/zrender/vml/graphic.js | 10 +-
public/zh/builder/src/zrender/zrender.js | 11 +-
public/zh/builder3.html | 25 +-
public/zh/changelog.html | 183 +-
public/zh/cheat-sheet.html | 21 +
public/zh/coding-standard.html | 14 +-
public/zh/committers.html | 14 +-
public/zh/css/main.css | 2 +-
public/zh/demo.html | 14 +-
public/zh/dependencies.html | 12 +-
public/zh/dist/echarts-en.common.js | 2537 +-
public/zh/dist/echarts-en.common.min.js | 2 +-
public/zh/dist/echarts-en.js | 33022 ++++++++++---------
public/zh/dist/echarts-en.js.map | 2 +-
public/zh/dist/echarts-en.min.js | 2 +-
public/zh/dist/echarts-en.simple.js | 1559 +-
public/zh/dist/echarts-en.simple.min.js | 2 +-
public/zh/dist/echarts.common.js | 2505 +-
public/zh/dist/echarts.common.min.js | 2 +-
public/zh/dist/echarts.js | 32990 +++++++++---------
public/zh/dist/echarts.js.map | 2 +-
public/zh/dist/echarts.min.js | 2 +-
public/zh/dist/echarts.simple.js | 1527 +-
public/zh/dist/echarts.simple.min.js | 2 +-
public/zh/dist/extension/bmap.min.js | 2 +-
public/zh/dist/extension/dataTool.js | 72 +-
public/zh/dist/extension/dataTool.js.map | 2 +-
public/zh/dist/extension/dataTool.min.js | 2 +-
public/zh/documents/en/api.json | 2 +-
public/zh/documents/en/changelog.html | 169 +
public/zh/documents/en/option.json | 2 +-
public/zh/documents/en/tutorial.json | 2 +-
public/zh/documents/zh/api.json | 2 +-
public/zh/documents/zh/changelog.html | 169 +
public/zh/documents/zh/option.json | 2 +-
public/zh/documents/zh/tutorial.json | 2 +-
public/zh/download-extension.html | 12 +-
public/zh/download-map.html | 14 +-
public/zh/download-theme.html | 21 +-
public/zh/download.html | 29 +-
public/zh/download3.html | 29 +-
public/zh/examples.html | 14 +-
public/zh/faq.html | 14 +-
public/zh/feature.html | 12 +-
public/zh/images/404.png | Bin 72998 -> 71950 bytes
public/zh/images/about/1.png | Bin 36618 -> 35765 bytes
public/zh/images/about/2.png | Bin 77291 -> 76438 bytes
public/zh/images/about/3.png | Bin 114969 -> 114116 bytes
public/zh/images/about/4.png | Bin 67588 -> 66735 bytes
public/zh/images/about/5.png | Bin 140731 -> 139878 bytes
public/zh/images/about/6.png | Bin 56879 -> 56026 bytes
public/zh/images/about/7.png | Bin 102847 -> 101994 bytes
public/zh/images/about/8.png | Bin 17302 -> 17237 bytes
public/zh/images/about/xiaomi.png | Bin 12462 -> 12397 bytes
public/zh/images/banners/2017-03-23-ife.png | Bin 30268 -> 30255 bytes
public/zh/images/banners/2017-09-12-zhibo.png | Bin 93489 -> 60788 bytes
public/zh/images/bg.png | Bin 55761 -> 8242 bytes
public/zh/images/bg2.png | Bin 17932 -> 3966 bytes
public/zh/images/btn-arrow.png | Bin 448 -> 435 bytes
public/zh/images/btn-download.png | Bin 775 -> 762 bytes
public/zh/images/btn-email.png | Bin 1226 -> 1213 bytes
public/zh/images/btn-github.png | Bin 1178 -> 1165 bytes
public/zh/images/btn-weibo.png | Bin 1661 -> 1648 bytes
public/zh/images/btn-weixin.png | Bin 1383 -> 1370 bytes
public/zh/images/builder/checked.png | Bin 1069 -> 216 bytes
public/zh/images/chart-icon.png | Bin 13805 -> 7543 bytes
public/zh/images/company/company1.png | Bin 40660 -> 34074 bytes
public/zh/images/company/company10.png | Bin 21174 -> 17340 bytes
public/zh/images/company/company11.png | Bin 41458 -> 33932 bytes
public/zh/images/company/company12.png | Bin 29268 -> 22972 bytes
public/zh/images/company/company13.png | Bin 24944 -> 18234 bytes
public/zh/images/company/company14.png | Bin 24571 -> 18684 bytes
public/zh/images/company/company15.png | Bin 42695 -> 33241 bytes
public/zh/images/company/company16.png | Bin 9453 -> 6234 bytes
public/zh/images/company/company17.png | Bin 51321 -> 37432 bytes
public/zh/images/company/company18.png | Bin 52342 -> 40871 bytes
public/zh/images/company/company19.png | Bin 17617 -> 12456 bytes
public/zh/images/company/company2.png | Bin 59543 -> 46597 bytes
public/zh/images/company/company20.png | Bin 30413 -> 21384 bytes
public/zh/images/company/company21.png | Bin 37470 -> 26625 bytes
public/zh/images/company/company22.png | Bin 31626 -> 24520 bytes
public/zh/images/company/company23.png | Bin 13831 -> 9483 bytes
public/zh/images/company/company24.png | Bin 24348 -> 21163 bytes
public/zh/images/company/company3.png | Bin 43341 -> 35425 bytes
public/zh/images/company/company4.png | Bin 28632 -> 22664 bytes
public/zh/images/company/company5.png | Bin 9430 -> 5722 bytes
public/zh/images/company/company6.png | Bin 21655 -> 16583 bytes
public/zh/images/company/company7.png | Bin 33797 -> 25376 bytes
public/zh/images/company/company8.png | Bin 9260 -> 6290 bytes
public/zh/images/company/company9.png | Bin 49281 -> 38098 bytes
public/zh/images/echarts-footer-logo.png | Bin 7564 -> 7551 bytes
public/zh/images/echarts-footer-text.png | Bin 1272 -> 1259 bytes
public/zh/images/extensions/default-extension.png | Bin 2028 -> 2015 bytes
public/zh/images/favicon.png | Bin 1592 -> 1534 bytes
public/zh/images/feature-1.png | Bin 116562 -> 18916 bytes
public/zh/images/features/capetown-taxi.png | Bin 1501879 -> 1192562 bytes
public/zh/images/features/population.png | Bin 580827 -> 447886 bytes
public/zh/images/features/scatterGL.png | Bin 643166 -> 386820 bytes
public/zh/images/features/scatterGL2.png | Bin 2009491 -> 1113942 bytes
public/zh/images/features/scatterGL3.png | Bin 1272747 -> 714079 bytes
public/zh/images/features/scatterGL4.png | Bin 953836 -> 218103 bytes
public/zh/images/forie.png | Bin 171716 -> 170668 bytes
public/zh/images/github.png | Bin 2330 -> 1477 bytes
public/zh/images/gongzhonghao.png | Bin 36677 -> 26811 bytes
public/zh/images/icon-email.png | Bin 807 -> 794 bytes
public/zh/images/icon-github.png | Bin 936 -> 923 bytes
public/zh/images/icon-twitter.png | Bin 667 -> 654 bytes
public/zh/images/icon-weibo.png | Bin 1334 -> 1321 bytes
public/zh/images/index-bg.png | Bin 353465 -> 55632 bytes
public/zh/images/index-chart/handle.png | Bin 1252 -> 941 bytes
public/zh/images/index-chart/handle2.png | Bin 567 -> 343 bytes
public/zh/images/index-chart/iphone.png | Bin 98448 -> 40811 bytes
public/zh/images/index-feature.png | Bin 64514 -> 49915 bytes
public/zh/images/index/1.png | Bin 38600 -> 37747 bytes
public/zh/images/index/2.png | Bin 80174 -> 79321 bytes
public/zh/images/index/3.png | Bin 114969 -> 114116 bytes
public/zh/images/index/4.png | Bin 67588 -> 66735 bytes
public/zh/images/index/5.png | Bin 140731 -> 139878 bytes
public/zh/images/index/6.png | Bin 56760 -> 55907 bytes
public/zh/images/index/7.png | Bin 104606 -> 103753 bytes
public/zh/images/index/device.png | Bin 85318 -> 84466 bytes
public/zh/images/index/device1.png | Bin 87517 -> 84803 bytes
public/zh/images/index/earth.png | Bin 79622 -> 79564 bytes
public/zh/images/index/echarts.png | Bin 33008 -> 32076 bytes
public/zh/images/index/file.png | Bin 5035 -> 4977 bytes
public/zh/images/index/footer.png | Bin 4333 -> 3280 bytes
public/zh/images/index/header.png | Bin 6172 -> 5119 bytes
public/zh/images/index/line.png | Bin 32795 -> 31863 bytes
public/zh/images/index/shadow.png | Bin 5919 -> 5861 bytes
public/zh/images/liquid-fill.png | Bin 31358 -> 31345 bytes
public/zh/images/logo.png | Bin 3765 -> 3707 bytes
public/zh/images/map.png | Bin 283943 -> 213619 bytes
public/zh/images/no-map.png | Bin 8135 -> 5421 bytes
public/zh/images/people/JB.png | Bin 87295 -> 87282 bytes
public/zh/images/people/erik.png | Bin 70060 -> 70047 bytes
public/zh/images/people/weizhi.png | Bin 1284 -> 1271 bytes
.../zh/images/people/\345\221\250\346\211\254.png" | Bin 92607 -> 92594 bytes
.../zh/images/people/\345\221\250\347\216\211.png" | Bin 97601 -> 97588 bytes
.../zh/images/people/\345\244\247\344\275\233.png" | Bin 111561 -> 84050 bytes
.../\345\250\204\345\220\214\345\205\265.png" | Bin 20118 -> 20105 bytes
.../zh/images/people/\345\256\277\347\210\275.png" | Bin 76678 -> 76665 bytes
.../zh/images/people/\345\260\217\347\272\242.png" | Bin 97862 -> 97849 bytes
.../zh/images/people/\345\276\267\346\270\205.png" | Bin 70273 -> 67559 bytes
.../zh/images/people/\346\235\216\346\271\233.png" | Bin 67163 -> 67150 bytes
.../zh/images/people/\346\235\250\351\252\245.png" | Bin 80366 -> 80353 bytes
.../zh/images/people/\346\236\227\345\263\260.png" | Bin 62803 -> 47308 bytes
.../\346\241\221\346\226\207\351\224\213.png" | Bin 77118 -> 77105 bytes
.../zh/images/people/\346\262\210\346\257\205.png" | Bin 66512 -> 66499 bytes
.../zh/images/people/\346\262\210\346\265\251.png" | Bin 65255 -> 65242 bytes
.../\347\216\213\344\277\212\345\251\267.png" | Bin 106485 -> 81510 bytes
.../zh/images/people/\347\216\213\347\220\274.png" | Bin 68308 -> 68295 bytes
.../zh/images/people/\347\224\260\345\275\247.png" | Bin 46656 -> 43879 bytes
.../zh/images/people/\347\245\226\346\230\216.png" | Bin 70285 -> 70272 bytes
.../zh/images/people/\347\272\242\350\226\257.png" | Bin 63205 -> 63192 bytes
.../zh/images/people/\347\276\241\350\276\231.png" | Bin 71775 -> 69060 bytes
.../\350\213\217\346\200\235\346\226\207.png" | Bin 97740 -> 94259 bytes
.../\350\242\201\346\231\223\345\246\202.png" | Bin 81879 -> 81866 bytes
.../\350\260\242\347\233\212\350\276\211.png" | Bin 84370 -> 84357 bytes
.../zh/images/people/\350\265\265\351\233\267.png" | Bin 68260 -> 68247 bytes
.../zh/images/people/\351\230\277\346\226\207.png" | Bin 80273 -> 80260 bytes
.../zh/images/people/\351\231\210\344\270\272.png" | Bin 52648 -> 52635 bytes
.../\351\241\276\350\275\266\347\201\265.png" | Bin 139414 -> 110953 bytes
.../\351\255\217\345\244\252\344\272\221.png" | Bin 48970 -> 48957 bytes
.../\351\273\204\345\277\227\346\225\217.png" | Bin 90020 -> 90007 bytes
.../zh/images/people/\351\273\204\346\202\246.png" | Bin 81118 -> 81105 bytes
public/zh/images/pipeline.png | Bin 220187 -> 141946 bytes
public/zh/images/yinhao.png | Bin 2898 -> 1371 bytes
public/zh/index.html | 46 +-
public/zh/js/cheat-sheet-en.js | 1 +
public/zh/js/cheat-sheet.js | 1 +
public/zh/js/common.js | 2 +-
public/zh/js/docTool/main.js | 16 +-
public/zh/js/download.js | 2 +-
public/zh/maillist.html | 12 +-
public/zh/option-gl.html | 28 +-
public/zh/option.html | 28 +-
public/zh/option3.html | 28 +-
public/zh/spreadsheet.html | 28 +-
public/zh/tutorial.html | 28 +-
public/zh/video/feature-1.jpg | Bin 167910 -> 52108 bytes
public/zh/video/feature-2.jpg | Bin 165749 -> 46538 bytes
public/zh/video/index-4.jpg | Bin 463029 -> 72013 bytes
public/zh/video/index.jpg | Bin 97216 -> 27348 bytes
release.sh | 32 +-
602 files changed, 83844 insertions(+), 72370 deletions(-)
rename config.js => config/env.asf.js (100%)
rename configdev.js => config/env.dev.js (100%)
create mode 100644 config/env.echartsjs.js
rename configgithub.js => config/env.github.js (100%)
delete mode 100644 configen.js
create mode 100644 public/cheat-sheet.html
create mode 100644 public/en/404.html
copy public/en/builder/src/echarts/{config.js => chart/graph/graphHelper.js} (55%)
copy public/en/builder/src/echarts/component/{dataZoom.js => dataZoomSlider.js} (87%)
copy public/{zh/builder/src/echarts/langEN.js => en/builder/src/echarts/langES.js} (63%)
create mode 100644 public/en/builder/src/zrender/core/fourPointsTransform.js
create mode 100644 public/en/cheat-sheet.html
create mode 100644 public/en/js/cheat-sheet-en.js
create mode 100644 public/en/js/cheat-sheet.js
create mode 100644 public/en/vendors/echarts/echarts-20190709.min.js
copy public/{en/builder/src/echarts/config.js => zh/builder/src/echarts/chart/graph/graphHelper.js} (55%)
copy public/{en/builder/src/echarts/component/dataZoom.js => zh/builder/src/echarts/component/dataZoomSlider.js} (87%)
copy public/{en => zh}/builder/src/echarts/component/tooltip/TooltipContentManager.js (100%)
copy public/zh/builder/src/echarts/{langEN.js => langES.js} (63%)
copy public/{en => zh}/builder/src/zrender/animation/track.js (100%)
create mode 100644 public/zh/builder/src/zrender/core/fourPointsTransform.js
create mode 100644 public/zh/cheat-sheet.html
create mode 100644 public/zh/js/cheat-sheet-en.js
create mode 100644 public/zh/js/cheat-sheet.js
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[incubator-echarts-doc] 01/02: enhance config
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch release
in repository https://gitbox.apache.org/repos/asf/incubator-echarts-doc.git
commit cd92e454458e05879827e626c89191e14605ffa1
Author: sushuang <su...@gmail.com>
AuthorDate: Fri Aug 30 05:02:52 2019 +0800
enhance config
---
README.md | 17 ++++++---------
build.js | 38 ++++++++++++++++++++++++++++-----
config.js => config/env.asf.js | 0
configdev.js => config/env.dev.js | 0
config/env.echartsjs.js | 9 ++++++++
configgithub.js => config/env.github.js | 0
configen.js | 9 --------
package.json | 3 ++-
release.sh | 32 +++++++++++++++++++++------
9 files changed, 77 insertions(+), 31 deletions(-)
diff --git a/README.md b/README.md
index a3563be..3af035f 100644
--- a/README.md
+++ b/README.md
@@ -17,21 +17,18 @@
## Build and Run Locally
-```shell
-# Install depedencies
-npm install
-# Build
-node build.js (github)
-# Run a static server
-node server.js
-```
-
Dev:
```shell
-node watch.js dev
# should put <https://github.com/ecomfe/echarts-examples> on the same folder with echarts-doc
+node watch.js dev
+# or
+node build.js dev
```
+Release:
+Check `incubator-echarts-website/README.md` please.
+
+
## Build Dash Docset
1. `cd public/documents`
diff --git a/build.js b/build.js
index fa210d4..5752f13 100644
--- a/build.js
+++ b/build.js
@@ -2,15 +2,43 @@ var md2json = require('./tool/md2json');
var fs = require('fs');
var marked = require('marked');
var copydir = require('copy-dir');
-var MarkDownTOCRenderer = require('./tool/MarkDownTOCRenderer');
+// var MarkDownTOCRenderer = require('./tool/MarkDownTOCRenderer');
+var argv = require('yargs').argv;
-var languages = ['cn', 'en'];
+/**
+ * ------------------------------------------------------------------------
+ * Usage:
+ *
+ * ```shell
+ * ./nodule_modules/.bin/gulp release --env asf
+ * ./nodule_modules/.bin/gulp release --env echartsjs
+ * ./nodule_modules/.bin/gulp release --env dev # the same as "debug"
+ * # Check `./config` to see the available env
+ * ```
+ * ------------------------------------------------------------------------
+ */
-var env = process.argv[2] || '';
+function initEnv() {
+ var envType = argv.env;
+ var isDev = argv.dev != null || argv.debug != null || envType === 'debug';
-var configName = './config' + env;
+ if (isDev) {
+ console.warn('=============================');
+ console.warn('!!! THIS IS IN DEV MODE !!!');
+ console.warn('=============================');
+ envType = 'dev';
+ }
-var config = require(configName);
+ if (!envType) {
+ throw new Error('--env MUST be specified');
+ }
+
+ return require('./config/env.' + envType);
+}
+
+var config = initEnv();
+
+var languages = ['cn', 'en'];
config.gl = config.gl || {};
for (var key in config) {
diff --git a/config.js b/config/env.asf.js
similarity index 100%
rename from config.js
rename to config/env.asf.js
diff --git a/configdev.js b/config/env.dev.js
similarity index 100%
rename from configdev.js
rename to config/env.dev.js
diff --git a/config/env.echartsjs.js b/config/env.echartsjs.js
new file mode 100644
index 0000000..c96a649
--- /dev/null
+++ b/config/env.echartsjs.js
@@ -0,0 +1,9 @@
+module.exports = {
+ galleryViewPath: 'https://www.echartsjs.com/examples/en/view.html?c=',
+ galleryEditorPath: 'https://www.echartsjs.com/examples/en/editor.html?c=',
+ imagePath: 'asset/img/',
+
+ gl: {
+ imagePath: 'asset/gl/img/',
+ }
+};
diff --git a/configgithub.js b/config/env.github.js
similarity index 100%
rename from configgithub.js
rename to config/env.github.js
diff --git a/configen.js b/configen.js
deleted file mode 100644
index 7eec7a6..0000000
--- a/configen.js
+++ /dev/null
@@ -1,9 +0,0 @@
-module.exports = {
- galleryViewPath: 'https://echarts.apache.org/examples/en/view.html?c=',
- galleryEditorPath: 'https://echarts.apache.org/examples/en/editor.html?c=',
- imagePath: 'asset/img/',
-
- gl: {
- imagePath: 'asset/gl/img/',
- }
-};
diff --git a/package.json b/package.json
index 6a25250..7c9eb75 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,7 @@
"jsdom": "^9.8.3",
"marked": "^0.3.5",
"node-static": "^0.7.7",
- "open": "0.0.5"
+ "open": "0.0.5",
+ "yargs": "^14.0.0"
}
}
diff --git a/release.sh b/release.sh
index c0215f5..fde2d24 100644
--- a/release.sh
+++ b/release.sh
@@ -1,16 +1,36 @@
+#!/bin/bash
+
+# ------------------------------------------------------------------------
+# Usage:
+# sh release.sh --env asf
+# sh release.sh --env echartsjs
+# sh release.sh --env dev # the same as "debug"
+# # Check `./config` to see the available env
+# ------------------------------------------------------------------------
+
+while [[ $# -gt 0 ]]; do
+ case "$1" in
+ --env) envType="$2"; shift; shift ;;
+ --env=*) envType="${1#*=}"; shift ;;
+ *) shift ;;
+ esac
+done
+if [[ ! -n "${envType}" ]]; then
+ echo "--env must be specified."
+ exit 1;
+fi
+
basepath=$(cd `dirname $0`; pwd)
+currPath=$(pwd)
# Build cn doc for www.echartsjs.com.
-node ${basepath}/build.js
+cd ${basepath}
+node ./build.js --env ${envType}
+cd ${currPath}
# Do not rm, keep option3.json.
cp -R ${basepath}/public/cn/documents/cn/ ${basepath}/../echarts-www/documents/zh/
-cp -R ${basepath}/public/cn/documents/cn/ ${basepath}/../incubator-echarts-website/documents/zh/
-
-node ${basepath}/build.js en
cp -R ${basepath}/public/en/documents/en/ ${basepath}/../echarts-www/documents/en/
-cp -R ${basepath}/public/en/documents/en/ ${basepath}/../incubator-echarts-website/documents/en/
-
# Copy asset.
# Do not rm, keep option3.json
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[incubator-echarts-doc] 02/02: rebuild
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch release
in repository https://gitbox.apache.org/repos/asf/incubator-echarts-doc.git
commit 48bcb51c058426695d2c440f52fde4a6f67c4d27
Author: sushuang <su...@gmail.com>
AuthorDate: Fri Aug 30 05:03:37 2019 +0800
rebuild
---
public/404.html | 7 +-
public/about.html | 7 +-
public/api.html | 7 +-
public/builder.html | 7 +-
public/builder3.html | 7 +-
public/changelog.html | 7 +-
public/cheat-sheet.html | 6 +
public/cn/documents/cn/api.json | 2 +-
public/cn/documents/cn/changelog.html | 169 +
public/cn/documents/cn/option.json | 2 +-
public/cn/documents/cn/tutorial.json | 2 +-
public/coding-standard.html | 7 +-
public/committer.html | 7 +-
public/demo.html | 7 +-
public/download-extension.html | 7 +-
public/download-map.html | 7 +-
public/download-theme.html | 7 +-
public/download.html | 7 +-
public/download3.html | 7 +-
public/en/404.html | 20 +
public/en/api.html | 28 +-
public/en/builder.html | 27 +-
public/en/builder/echarts.html | 2 +-
.../src/echarts/action/createDataSelectAction.js | 3 +-
public/en/builder/src/echarts/chart/bar.js | 5 +-
public/en/builder/src/echarts/chart/bar/BarView.js | 59 +-
public/en/builder/src/echarts/chart/custom.js | 41 +-
.../builder/src/echarts/chart/funnel/FunnelView.js | 21 +-
.../src/echarts/chart/funnel/funnelLayout.js | 54 +-
.../builder/src/echarts/chart/gauge/GaugeView.js | 3 +-
public/en/builder/src/echarts/chart/graph.js | 2 +-
.../builder/src/echarts/chart/graph/GraphView.js | 54 +-
.../builder/src/echarts/chart/graph/adjustEdge.js | 12 +-
.../src/echarts/chart/graph/categoryVisual.js | 17 +-
.../src/echarts/chart/graph/circularLayout.js | 2 +-
.../echarts/chart/graph/circularLayoutHelper.js | 87 +-
.../builder/src/echarts/chart/graph/forceLayout.js | 2 +-
.../src/echarts/chart/graph/graphHelper.js} | 35 +-
public/en/builder/src/echarts/chart/helper/Line.js | 15 +-
.../builder/src/echarts/chart/helper/LinePath.js | 13 +-
.../en/builder/src/echarts/chart/helper/Symbol.js | 56 +-
.../en/builder/src/echarts/chart/pie/PieSeries.js | 3 +
public/en/builder/src/echarts/chart/pie/PieView.js | 76 +-
.../builder/src/echarts/chart/pie/labelLayout.js | 19 +-
.../builder/src/echarts/chart/radar/RadarView.js | 16 +-
.../builder/src/echarts/chart/radar/radarLayout.js | 37 +-
.../src/echarts/chart/sankey/SankeySeries.js | 50 +-
.../builder/src/echarts/chart/sankey/SankeyView.js | 11 +-
.../src/echarts/chart/sankey/sankeyLayout.js | 315 +-
.../src/echarts/chart/sankey/sankeyVisual.js | 10 +-
.../src/echarts/chart/sunburst/SunburstPiece.js | 2 +-
.../echarts/chart/themeRiver/ThemeRiverSeries.js | 3 +-
.../src/echarts/chart/treemap/TreemapSeries.js | 2 +-
.../src/echarts/component/axis/AngleAxisView.js | 14 +-
.../src/echarts/component/axis/AxisBuilder.js | 44 +-
.../echarts/component/axis/CartesianAxisView.js | 5 +-
.../src/echarts/component/axis/SingleAxisView.js | 5 +-
.../component/axisPointer/BaseAxisPointer.js | 2 +-
.../component/axisPointer/CartesianAxisPointer.js | 12 +-
.../component/axisPointer/SingleAxisPointer.js | 12 +-
.../echarts/component/axisPointer/viewHelper.js | 3 +
.../en/builder/src/echarts/component/dataZoom.js | 16 +-
.../src/echarts/component/dataZoom/AxisProxy.js | 98 +-
.../echarts/component/dataZoom/InsideZoomView.js | 2 +-
.../echarts/component/dataZoom/SliderZoomView.js | 5 +-
.../src/echarts/component/dataZoomInside.js | 4 -
.../src/echarts/component/dataZoomSelect.js | 3 +-
.../component/{dataZoom.js => dataZoomSlider.js} | 6 -
.../src/echarts/component/helper/MapDraw.js | 8 +-
.../src/echarts/component/helper/sliderMove.js | 16 +-
.../component/legend/ScrollableLegendView.js | 17 +-
.../src/echarts/component/marker/MarkLineView.js | 9 +-
.../src/echarts/component/marker/MarkPointView.js | 22 +-
public/en/builder/src/echarts/component/title.js | 24 +-
.../src/echarts/component/toolbox/ToolboxModel.js | 9 +-
.../src/echarts/component/toolbox/ToolboxView.js | 30 +-
.../component/toolbox/feature/SaveAsImage.js | 12 +-
.../echarts/component/tooltip/TooltipContent.js | 13 +-
.../component/tooltip/TooltipRichContent.js | 11 +-
.../src/echarts/component/tooltip/TooltipView.js | 2 +-
.../echarts/component/visualMap/ContinuousView.js | 6 +-
.../echarts/component/visualMap/PiecewiseModel.js | 4 +-
.../echarts/component/visualMap/PiecewiseView.js | 2 +-
.../src/echarts/component/visualMap/helper.js | 10 +-
.../src/echarts/coord/axisTickLabelBuilder.js | 2 +-
.../en/builder/src/echarts/coord/cartesian/Grid.js | 14 +-
.../builder/src/echarts/coord/single/AxisModel.js | 4 +-
public/en/builder/src/echarts/data/Graph.js | 2 +-
public/en/builder/src/echarts/data/List.js | 47 +-
.../src/echarts/data/helper/completeDimensions.js | 2 +-
.../src/echarts/data/helper/dimensionHelper.js | 40 +-
public/en/builder/src/echarts/echarts.js | 56 +-
public/en/builder/src/echarts/langEN.js | 32 +
.../langEN.js => en/builder/src/echarts/langES.js} | 32 +-
public/en/builder/src/echarts/layout/barGrid.js | 20 +-
public/en/builder/src/echarts/layout/barPolar.js | 17 +-
public/en/builder/src/echarts/model/Global.js | 2 +-
.../en/builder/src/echarts/model/OptionManager.js | 2 +-
.../builder/src/echarts/model/mixin/dataFormat.js | 7 +-
.../builder/src/echarts/model/mixin/lineStyle.js | 14 +-
.../src/echarts/preprocessor/backwardCompat.js | 2 +-
public/en/builder/src/echarts/util/graphic.js | 332 +-
public/en/builder/src/echarts/util/number.js | 8 +
public/en/builder/src/echarts/util/symbol.js | 20 +-
public/en/builder/src/echarts/view/Chart.js | 28 +-
public/en/builder/src/echarts/visual/symbol.js | 28 +-
.../echarts3/component/visualMap/PiecewiseModel.js | 2 +-
public/en/builder/src/zrender/Painter.js | 13 +-
public/en/builder/src/zrender/contain/text.js | 40 +-
public/en/builder/src/zrender/core/PathProxy.js | 8 +-
public/en/builder/src/zrender/core/event.js | 160 +-
.../src/zrender/core/fourPointsTransform.js | 90 +
.../en/builder/src/zrender/graphic/CompoundPath.js | 2 +-
.../en/builder/src/zrender/graphic/Displayable.js | 27 +-
public/en/builder/src/zrender/graphic/Path.js | 6 +-
public/en/builder/src/zrender/graphic/Style.js | 7 +-
.../en/builder/src/zrender/graphic/helper/text.js | 22 +-
public/en/builder/src/zrender/svg/graphic.js | 56 +-
.../src/zrender/svg/helper/ClippathManager.js | 4 +-
public/en/builder/src/zrender/vml/graphic.js | 10 +-
public/en/builder/src/zrender/zrender.js | 11 +-
public/en/changelog.html | 183 +-
public/en/cheat-sheet.html | 21 +
public/en/coding-standard.html | 14 +-
public/en/committers.html | 12 +-
public/en/css/main.css | 2 +-
public/en/dependencies.html | 12 +-
public/en/dist/echarts-en.common.js | 2537 +-
public/en/dist/echarts-en.common.min.js | 2 +-
public/en/dist/echarts-en.js | 33022 ++++++++++---------
public/en/dist/echarts-en.js.map | 2 +-
public/en/dist/echarts-en.min.js | 2 +-
public/en/dist/echarts-en.simple.js | 1559 +-
public/en/dist/echarts-en.simple.min.js | 2 +-
public/en/dist/echarts.common.js | 2505 +-
public/en/dist/echarts.common.min.js | 2 +-
public/en/dist/echarts.js | 32990 +++++++++---------
public/en/dist/echarts.js.map | 2 +-
public/en/dist/echarts.min.js | 2 +-
public/en/dist/echarts.simple.js | 1527 +-
public/en/dist/echarts.simple.min.js | 2 +-
public/en/dist/extension/bmap.min.js | 2 +-
public/en/dist/extension/dataTool.js | 72 +-
public/en/dist/extension/dataTool.js.map | 2 +-
public/en/dist/extension/dataTool.min.js | 2 +-
public/en/documents/en/api.json | 2 +-
public/en/documents/en/changelog.html | 169 +
public/en/documents/en/option.json | 2 +-
public/en/documents/en/tutorial.json | 2 +-
public/en/documents/zh/api.json | 2 +-
public/en/documents/zh/changelog.html | 169 +
public/en/documents/zh/option.json | 2 +-
public/en/documents/zh/tutorial.json | 2 +-
public/en/download-extension.html | 12 +-
public/en/download-map.html | 14 +-
public/en/download-theme.html | 21 +-
public/en/download.html | 16 +-
public/en/faq.html | 14 +-
public/en/feature.html | 12 +-
public/en/images/404.png | Bin 72998 -> 71950 bytes
public/en/images/about/1.png | Bin 36618 -> 35765 bytes
public/en/images/about/2.png | Bin 77291 -> 76438 bytes
public/en/images/about/3.png | Bin 114969 -> 114116 bytes
public/en/images/about/4.png | Bin 67588 -> 66735 bytes
public/en/images/about/5.png | Bin 140731 -> 139878 bytes
public/en/images/about/6.png | Bin 56879 -> 56026 bytes
public/en/images/about/7.png | Bin 102847 -> 101994 bytes
public/en/images/about/8.png | Bin 17302 -> 17237 bytes
public/en/images/about/xiaomi.png | Bin 12462 -> 12397 bytes
public/en/images/banners/2017-03-23-ife.png | Bin 30268 -> 30255 bytes
public/en/images/banners/2017-09-12-zhibo.png | Bin 93489 -> 60788 bytes
public/en/images/bg.png | Bin 55761 -> 8242 bytes
public/en/images/bg2.png | Bin 17932 -> 3966 bytes
public/en/images/btn-arrow.png | Bin 448 -> 435 bytes
public/en/images/btn-download.png | Bin 775 -> 762 bytes
public/en/images/btn-email.png | Bin 1226 -> 1213 bytes
public/en/images/btn-github.png | Bin 1178 -> 1165 bytes
public/en/images/btn-weibo.png | Bin 1661 -> 1648 bytes
public/en/images/btn-weixin.png | Bin 1383 -> 1370 bytes
public/en/images/builder/checked.png | Bin 1069 -> 216 bytes
public/en/images/chart-icon.png | Bin 13805 -> 7543 bytes
public/en/images/company/company1.png | Bin 40660 -> 34074 bytes
public/en/images/company/company10.png | Bin 21174 -> 17340 bytes
public/en/images/company/company11.png | Bin 41458 -> 33932 bytes
public/en/images/company/company12.png | Bin 29268 -> 22972 bytes
public/en/images/company/company13.png | Bin 24944 -> 18234 bytes
public/en/images/company/company14.png | Bin 24571 -> 18684 bytes
public/en/images/company/company15.png | Bin 42695 -> 33241 bytes
public/en/images/company/company16.png | Bin 9453 -> 6234 bytes
public/en/images/company/company17.png | Bin 51321 -> 37432 bytes
public/en/images/company/company18.png | Bin 52342 -> 40871 bytes
public/en/images/company/company19.png | Bin 17617 -> 12456 bytes
public/en/images/company/company2.png | Bin 59543 -> 46597 bytes
public/en/images/company/company20.png | Bin 30413 -> 21384 bytes
public/en/images/company/company21.png | Bin 37470 -> 26625 bytes
public/en/images/company/company22.png | Bin 31626 -> 24520 bytes
public/en/images/company/company23.png | Bin 13831 -> 9483 bytes
public/en/images/company/company24.png | Bin 24348 -> 21163 bytes
public/en/images/company/company3.png | Bin 43341 -> 35425 bytes
public/en/images/company/company4.png | Bin 28632 -> 22664 bytes
public/en/images/company/company5.png | Bin 9430 -> 5722 bytes
public/en/images/company/company6.png | Bin 21655 -> 16583 bytes
public/en/images/company/company7.png | Bin 33797 -> 25376 bytes
public/en/images/company/company8.png | Bin 9260 -> 6290 bytes
public/en/images/company/company9.png | Bin 49281 -> 38098 bytes
public/en/images/echarts-footer-logo.png | Bin 7564 -> 7551 bytes
public/en/images/echarts-footer-text.png | Bin 1272 -> 1259 bytes
public/en/images/extensions/default-extension.png | Bin 2028 -> 2015 bytes
public/en/images/favicon.png | Bin 1592 -> 1534 bytes
public/en/images/feature-1.png | Bin 116562 -> 18916 bytes
public/en/images/features/capetown-taxi.png | Bin 1501879 -> 1192562 bytes
public/en/images/features/population.png | Bin 580827 -> 447886 bytes
public/en/images/features/scatterGL.png | Bin 643166 -> 386820 bytes
public/en/images/features/scatterGL2.png | Bin 2009491 -> 1113942 bytes
public/en/images/features/scatterGL3.png | Bin 1272747 -> 714079 bytes
public/en/images/features/scatterGL4.png | Bin 953836 -> 218103 bytes
public/en/images/forie.png | Bin 171716 -> 170668 bytes
public/en/images/github.png | Bin 2330 -> 1477 bytes
public/en/images/gongzhonghao.png | Bin 36677 -> 26811 bytes
public/en/images/icon-email.png | Bin 807 -> 794 bytes
public/en/images/icon-github.png | Bin 936 -> 923 bytes
public/en/images/icon-twitter.png | Bin 667 -> 654 bytes
public/en/images/icon-weibo.png | Bin 1334 -> 1321 bytes
public/en/images/index-bg.png | Bin 353465 -> 55632 bytes
public/en/images/index-chart/handle.png | Bin 1252 -> 941 bytes
public/en/images/index-chart/handle2.png | Bin 567 -> 343 bytes
public/en/images/index-chart/iphone.png | Bin 98448 -> 40811 bytes
public/en/images/index-feature.png | Bin 64514 -> 49915 bytes
public/en/images/index/1.png | Bin 38600 -> 37747 bytes
public/en/images/index/2.png | Bin 80174 -> 79321 bytes
public/en/images/index/3.png | Bin 114969 -> 114116 bytes
public/en/images/index/4.png | Bin 67588 -> 66735 bytes
public/en/images/index/5.png | Bin 140731 -> 139878 bytes
public/en/images/index/6.png | Bin 56760 -> 55907 bytes
public/en/images/index/7.png | Bin 104606 -> 103753 bytes
public/en/images/index/device.png | Bin 85318 -> 84466 bytes
public/en/images/index/device1.png | Bin 87517 -> 84803 bytes
public/en/images/index/earth.png | Bin 79622 -> 79564 bytes
public/en/images/index/echarts.png | Bin 33008 -> 32076 bytes
public/en/images/index/file.png | Bin 5035 -> 4977 bytes
public/en/images/index/footer.png | Bin 4333 -> 3280 bytes
public/en/images/index/header.png | Bin 6172 -> 5119 bytes
public/en/images/index/line.png | Bin 32795 -> 31863 bytes
public/en/images/index/shadow.png | Bin 5919 -> 5861 bytes
public/en/images/liquid-fill.png | Bin 31358 -> 31345 bytes
public/en/images/logo.png | Bin 3765 -> 3707 bytes
public/en/images/map.png | Bin 283943 -> 213619 bytes
public/en/images/no-map.png | Bin 8135 -> 5421 bytes
public/en/images/people/JB.png | Bin 87295 -> 87282 bytes
public/en/images/people/erik.png | Bin 70060 -> 70047 bytes
public/en/images/people/weizhi.png | Bin 1284 -> 1271 bytes
.../en/images/people/\345\221\250\346\211\254.png" | Bin 92607 -> 92594 bytes
.../en/images/people/\345\221\250\347\216\211.png" | Bin 97601 -> 97588 bytes
.../en/images/people/\345\244\247\344\275\233.png" | Bin 111561 -> 84050 bytes
.../\345\250\204\345\220\214\345\205\265.png" | Bin 20118 -> 20105 bytes
.../en/images/people/\345\256\277\347\210\275.png" | Bin 76678 -> 76665 bytes
.../en/images/people/\345\260\217\347\272\242.png" | Bin 97862 -> 97849 bytes
.../en/images/people/\345\276\267\346\270\205.png" | Bin 70273 -> 67559 bytes
.../en/images/people/\346\235\216\346\271\233.png" | Bin 67163 -> 67150 bytes
.../en/images/people/\346\235\250\351\252\245.png" | Bin 80366 -> 80353 bytes
.../en/images/people/\346\236\227\345\263\260.png" | Bin 62803 -> 47308 bytes
.../\346\241\221\346\226\207\351\224\213.png" | Bin 77118 -> 77105 bytes
.../en/images/people/\346\262\210\346\257\205.png" | Bin 66512 -> 66499 bytes
.../en/images/people/\346\262\210\346\265\251.png" | Bin 65255 -> 65242 bytes
.../\347\216\213\344\277\212\345\251\267.png" | Bin 106485 -> 81510 bytes
.../en/images/people/\347\216\213\347\220\274.png" | Bin 68308 -> 68295 bytes
.../en/images/people/\347\224\260\345\275\247.png" | Bin 46656 -> 43879 bytes
.../en/images/people/\347\245\226\346\230\216.png" | Bin 70285 -> 70272 bytes
.../en/images/people/\347\272\242\350\226\257.png" | Bin 63205 -> 63192 bytes
.../en/images/people/\347\276\241\350\276\231.png" | Bin 71775 -> 69060 bytes
.../\350\213\217\346\200\235\346\226\207.png" | Bin 97740 -> 94259 bytes
.../\350\242\201\346\231\223\345\246\202.png" | Bin 81879 -> 81866 bytes
.../\350\260\242\347\233\212\350\276\211.png" | Bin 84370 -> 84357 bytes
.../en/images/people/\350\265\265\351\233\267.png" | Bin 68260 -> 68247 bytes
.../en/images/people/\351\230\277\346\226\207.png" | Bin 80273 -> 80260 bytes
.../en/images/people/\351\231\210\344\270\272.png" | Bin 52648 -> 52635 bytes
.../\351\241\276\350\275\266\347\201\265.png" | Bin 139414 -> 110953 bytes
.../\351\255\217\345\244\252\344\272\221.png" | Bin 48970 -> 48957 bytes
.../\351\273\204\345\277\227\346\225\217.png" | Bin 90020 -> 90007 bytes
.../en/images/people/\351\273\204\346\202\246.png" | Bin 81118 -> 81105 bytes
public/en/images/pipeline.png | Bin 220187 -> 141946 bytes
public/en/images/yinhao.png | Bin 2898 -> 1371 bytes
public/en/index.html | 17 +-
public/en/js/cheat-sheet-en.js | 1 +
public/en/js/cheat-sheet.js | 1 +
public/en/js/common.js | 2 +-
public/en/js/docTool/main.js | 16 +-
public/en/js/download.js | 2 +-
public/en/maillist.html | 12 +-
public/en/nav.html | 2 +-
public/en/option-gl.html | 28 +-
public/en/option.html | 28 +-
public/en/option3.html | 74 +-
public/en/tutorial.html | 28 +-
public/en/vendors/echarts/echarts-20190709.min.js | 22 +
public/en/video/feature-1.jpg | Bin 167910 -> 52108 bytes
public/en/video/feature-2.jpg | Bin 165749 -> 46538 bytes
public/en/video/index-4.jpg | Bin 463029 -> 72013 bytes
public/en/video/index.jpg | Bin 97216 -> 27348 bytes
public/examples.html | 2 +-
public/faq.html | 7 +-
public/feature.html | 7 +-
public/index.html | 7 +-
public/maillist.html | 7 +-
public/option-gl.html | 7 +-
public/option.html | 7 +-
public/option3.html | 7 +-
public/spreadsheet.html | 7 +-
public/tutorial.html | 7 +-
public/zh/404.html | 12 +-
public/zh/api.html | 28 +-
public/zh/builder.html | 27 +-
public/zh/builder/echarts.html | 2 +-
.../src/echarts/action/createDataSelectAction.js | 3 +-
public/zh/builder/src/echarts/chart/bar.js | 5 +-
public/zh/builder/src/echarts/chart/bar/BarView.js | 59 +-
public/zh/builder/src/echarts/chart/custom.js | 41 +-
.../builder/src/echarts/chart/funnel/FunnelView.js | 21 +-
.../src/echarts/chart/funnel/funnelLayout.js | 54 +-
.../builder/src/echarts/chart/gauge/GaugeView.js | 3 +-
public/zh/builder/src/echarts/chart/graph.js | 2 +-
.../builder/src/echarts/chart/graph/GraphView.js | 54 +-
.../builder/src/echarts/chart/graph/adjustEdge.js | 12 +-
.../src/echarts/chart/graph/categoryVisual.js | 17 +-
.../src/echarts/chart/graph/circularLayout.js | 2 +-
.../echarts/chart/graph/circularLayoutHelper.js | 87 +-
.../builder/src/echarts/chart/graph/forceLayout.js | 2 +-
.../dataZoom.js => chart/graph/graphHelper.js} | 35 +-
public/zh/builder/src/echarts/chart/helper/Line.js | 15 +-
.../builder/src/echarts/chart/helper/LinePath.js | 13 +-
.../zh/builder/src/echarts/chart/helper/Symbol.js | 56 +-
.../zh/builder/src/echarts/chart/pie/PieSeries.js | 3 +
public/zh/builder/src/echarts/chart/pie/PieView.js | 76 +-
.../builder/src/echarts/chart/pie/labelLayout.js | 19 +-
.../builder/src/echarts/chart/radar/RadarView.js | 16 +-
.../builder/src/echarts/chart/radar/radarLayout.js | 37 +-
.../src/echarts/chart/sankey/SankeySeries.js | 50 +-
.../builder/src/echarts/chart/sankey/SankeyView.js | 11 +-
.../src/echarts/chart/sankey/sankeyLayout.js | 315 +-
.../src/echarts/chart/sankey/sankeyVisual.js | 10 +-
.../src/echarts/chart/sunburst/SunburstPiece.js | 2 +-
.../echarts/chart/themeRiver/ThemeRiverSeries.js | 3 +-
.../src/echarts/chart/treemap/TreemapSeries.js | 2 +-
.../src/echarts/component/axis/AngleAxisView.js | 14 +-
.../src/echarts/component/axis/AxisBuilder.js | 44 +-
.../echarts/component/axis/CartesianAxisView.js | 5 +-
.../src/echarts/component/axis/SingleAxisView.js | 5 +-
.../component/axisPointer/BaseAxisPointer.js | 2 +-
.../component/axisPointer/CartesianAxisPointer.js | 12 +-
.../component/axisPointer/SingleAxisPointer.js | 12 +-
.../echarts/component/axisPointer/viewHelper.js | 3 +
.../zh/builder/src/echarts/component/dataZoom.js | 16 +-
.../src/echarts/component/dataZoom/AxisProxy.js | 98 +-
.../echarts/component/dataZoom/InsideZoomView.js | 2 +-
.../echarts/component/dataZoom/SliderZoomView.js | 5 +-
.../src/echarts/component/dataZoomInside.js | 4 -
.../src/echarts/component/dataZoomSelect.js | 3 +-
.../src/echarts/component/dataZoomSlider.js} | 6 -
.../src/echarts/component/helper/MapDraw.js | 8 +-
.../src/echarts/component/helper/sliderMove.js | 16 +-
.../component/legend/ScrollableLegendView.js | 17 +-
.../src/echarts/component/marker/MarkLineView.js | 9 +-
.../src/echarts/component/marker/MarkPointView.js | 22 +-
public/zh/builder/src/echarts/component/title.js | 24 +-
.../src/echarts/component/toolbox/ToolboxModel.js | 9 +-
.../src/echarts/component/toolbox/ToolboxView.js | 30 +-
.../component/toolbox/feature/SaveAsImage.js | 12 +-
.../echarts/component/tooltip/TooltipContent.js | 13 +-
.../component/tooltip/TooltipContentManager.js | 103 +
.../component/tooltip/TooltipRichContent.js | 11 +-
.../src/echarts/component/tooltip/TooltipView.js | 2 +-
.../echarts/component/visualMap/ContinuousView.js | 6 +-
.../echarts/component/visualMap/PiecewiseModel.js | 2 +-
.../echarts/component/visualMap/PiecewiseView.js | 2 +-
.../src/echarts/component/visualMap/helper.js | 10 +-
.../src/echarts/coord/axisTickLabelBuilder.js | 2 +-
.../zh/builder/src/echarts/coord/cartesian/Grid.js | 14 +-
.../builder/src/echarts/coord/single/AxisModel.js | 4 +-
public/zh/builder/src/echarts/data/Graph.js | 2 +-
public/zh/builder/src/echarts/data/List.js | 47 +-
.../src/echarts/data/helper/completeDimensions.js | 2 +-
.../src/echarts/data/helper/dimensionHelper.js | 40 +-
public/zh/builder/src/echarts/echarts.js | 56 +-
public/zh/builder/src/echarts/langEN.js | 32 +
.../builder/src/echarts/{langEN.js => langES.js} | 32 +-
public/zh/builder/src/echarts/layout/barGrid.js | 20 +-
public/zh/builder/src/echarts/layout/barPolar.js | 17 +-
public/zh/builder/src/echarts/model/Global.js | 2 +-
.../zh/builder/src/echarts/model/OptionManager.js | 2 +-
.../builder/src/echarts/model/mixin/dataFormat.js | 7 +-
.../builder/src/echarts/model/mixin/lineStyle.js | 14 +-
.../src/echarts/preprocessor/backwardCompat.js | 2 +-
public/zh/builder/src/echarts/util/graphic.js | 332 +-
public/zh/builder/src/echarts/util/number.js | 8 +
public/zh/builder/src/echarts/util/symbol.js | 20 +-
public/zh/builder/src/echarts/view/Chart.js | 28 +-
public/zh/builder/src/echarts/visual/symbol.js | 28 +-
public/zh/builder/src/zrender/Painter.js | 13 +-
public/zh/builder/src/zrender/animation/track.js | 424 +
public/zh/builder/src/zrender/contain/text.js | 40 +-
public/zh/builder/src/zrender/core/PathProxy.js | 8 +-
public/zh/builder/src/zrender/core/event.js | 160 +-
.../src/zrender/core/fourPointsTransform.js | 90 +
.../zh/builder/src/zrender/graphic/CompoundPath.js | 2 +-
.../zh/builder/src/zrender/graphic/Displayable.js | 27 +-
public/zh/builder/src/zrender/graphic/Path.js | 6 +-
public/zh/builder/src/zrender/graphic/Style.js | 7 +-
.../zh/builder/src/zrender/graphic/helper/text.js | 22 +-
public/zh/builder/src/zrender/svg/graphic.js | 56 +-
.../src/zrender/svg/helper/ClippathManager.js | 4 +-
public/zh/builder/src/zrender/vml/graphic.js | 10 +-
public/zh/builder/src/zrender/zrender.js | 11 +-
public/zh/builder3.html | 25 +-
public/zh/changelog.html | 183 +-
public/zh/cheat-sheet.html | 21 +
public/zh/coding-standard.html | 14 +-
public/zh/committers.html | 14 +-
public/zh/css/main.css | 2 +-
public/zh/demo.html | 14 +-
public/zh/dependencies.html | 12 +-
public/zh/dist/echarts-en.common.js | 2537 +-
public/zh/dist/echarts-en.common.min.js | 2 +-
public/zh/dist/echarts-en.js | 33022 ++++++++++---------
public/zh/dist/echarts-en.js.map | 2 +-
public/zh/dist/echarts-en.min.js | 2 +-
public/zh/dist/echarts-en.simple.js | 1559 +-
public/zh/dist/echarts-en.simple.min.js | 2 +-
public/zh/dist/echarts.common.js | 2505 +-
public/zh/dist/echarts.common.min.js | 2 +-
public/zh/dist/echarts.js | 32990 +++++++++---------
public/zh/dist/echarts.js.map | 2 +-
public/zh/dist/echarts.min.js | 2 +-
public/zh/dist/echarts.simple.js | 1527 +-
public/zh/dist/echarts.simple.min.js | 2 +-
public/zh/dist/extension/bmap.min.js | 2 +-
public/zh/dist/extension/dataTool.js | 72 +-
public/zh/dist/extension/dataTool.js.map | 2 +-
public/zh/dist/extension/dataTool.min.js | 2 +-
public/zh/documents/en/api.json | 2 +-
public/zh/documents/en/changelog.html | 169 +
public/zh/documents/en/option.json | 2 +-
public/zh/documents/en/tutorial.json | 2 +-
public/zh/documents/zh/api.json | 2 +-
public/zh/documents/zh/changelog.html | 169 +
public/zh/documents/zh/option.json | 2 +-
public/zh/documents/zh/tutorial.json | 2 +-
public/zh/download-extension.html | 12 +-
public/zh/download-map.html | 14 +-
public/zh/download-theme.html | 21 +-
public/zh/download.html | 29 +-
public/zh/download3.html | 29 +-
public/zh/examples.html | 14 +-
public/zh/faq.html | 14 +-
public/zh/feature.html | 12 +-
public/zh/images/404.png | Bin 72998 -> 71950 bytes
public/zh/images/about/1.png | Bin 36618 -> 35765 bytes
public/zh/images/about/2.png | Bin 77291 -> 76438 bytes
public/zh/images/about/3.png | Bin 114969 -> 114116 bytes
public/zh/images/about/4.png | Bin 67588 -> 66735 bytes
public/zh/images/about/5.png | Bin 140731 -> 139878 bytes
public/zh/images/about/6.png | Bin 56879 -> 56026 bytes
public/zh/images/about/7.png | Bin 102847 -> 101994 bytes
public/zh/images/about/8.png | Bin 17302 -> 17237 bytes
public/zh/images/about/xiaomi.png | Bin 12462 -> 12397 bytes
public/zh/images/banners/2017-03-23-ife.png | Bin 30268 -> 30255 bytes
public/zh/images/banners/2017-09-12-zhibo.png | Bin 93489 -> 60788 bytes
public/zh/images/bg.png | Bin 55761 -> 8242 bytes
public/zh/images/bg2.png | Bin 17932 -> 3966 bytes
public/zh/images/btn-arrow.png | Bin 448 -> 435 bytes
public/zh/images/btn-download.png | Bin 775 -> 762 bytes
public/zh/images/btn-email.png | Bin 1226 -> 1213 bytes
public/zh/images/btn-github.png | Bin 1178 -> 1165 bytes
public/zh/images/btn-weibo.png | Bin 1661 -> 1648 bytes
public/zh/images/btn-weixin.png | Bin 1383 -> 1370 bytes
public/zh/images/builder/checked.png | Bin 1069 -> 216 bytes
public/zh/images/chart-icon.png | Bin 13805 -> 7543 bytes
public/zh/images/company/company1.png | Bin 40660 -> 34074 bytes
public/zh/images/company/company10.png | Bin 21174 -> 17340 bytes
public/zh/images/company/company11.png | Bin 41458 -> 33932 bytes
public/zh/images/company/company12.png | Bin 29268 -> 22972 bytes
public/zh/images/company/company13.png | Bin 24944 -> 18234 bytes
public/zh/images/company/company14.png | Bin 24571 -> 18684 bytes
public/zh/images/company/company15.png | Bin 42695 -> 33241 bytes
public/zh/images/company/company16.png | Bin 9453 -> 6234 bytes
public/zh/images/company/company17.png | Bin 51321 -> 37432 bytes
public/zh/images/company/company18.png | Bin 52342 -> 40871 bytes
public/zh/images/company/company19.png | Bin 17617 -> 12456 bytes
public/zh/images/company/company2.png | Bin 59543 -> 46597 bytes
public/zh/images/company/company20.png | Bin 30413 -> 21384 bytes
public/zh/images/company/company21.png | Bin 37470 -> 26625 bytes
public/zh/images/company/company22.png | Bin 31626 -> 24520 bytes
public/zh/images/company/company23.png | Bin 13831 -> 9483 bytes
public/zh/images/company/company24.png | Bin 24348 -> 21163 bytes
public/zh/images/company/company3.png | Bin 43341 -> 35425 bytes
public/zh/images/company/company4.png | Bin 28632 -> 22664 bytes
public/zh/images/company/company5.png | Bin 9430 -> 5722 bytes
public/zh/images/company/company6.png | Bin 21655 -> 16583 bytes
public/zh/images/company/company7.png | Bin 33797 -> 25376 bytes
public/zh/images/company/company8.png | Bin 9260 -> 6290 bytes
public/zh/images/company/company9.png | Bin 49281 -> 38098 bytes
public/zh/images/echarts-footer-logo.png | Bin 7564 -> 7551 bytes
public/zh/images/echarts-footer-text.png | Bin 1272 -> 1259 bytes
public/zh/images/extensions/default-extension.png | Bin 2028 -> 2015 bytes
public/zh/images/favicon.png | Bin 1592 -> 1534 bytes
public/zh/images/feature-1.png | Bin 116562 -> 18916 bytes
public/zh/images/features/capetown-taxi.png | Bin 1501879 -> 1192562 bytes
public/zh/images/features/population.png | Bin 580827 -> 447886 bytes
public/zh/images/features/scatterGL.png | Bin 643166 -> 386820 bytes
public/zh/images/features/scatterGL2.png | Bin 2009491 -> 1113942 bytes
public/zh/images/features/scatterGL3.png | Bin 1272747 -> 714079 bytes
public/zh/images/features/scatterGL4.png | Bin 953836 -> 218103 bytes
public/zh/images/forie.png | Bin 171716 -> 170668 bytes
public/zh/images/github.png | Bin 2330 -> 1477 bytes
public/zh/images/gongzhonghao.png | Bin 36677 -> 26811 bytes
public/zh/images/icon-email.png | Bin 807 -> 794 bytes
public/zh/images/icon-github.png | Bin 936 -> 923 bytes
public/zh/images/icon-twitter.png | Bin 667 -> 654 bytes
public/zh/images/icon-weibo.png | Bin 1334 -> 1321 bytes
public/zh/images/index-bg.png | Bin 353465 -> 55632 bytes
public/zh/images/index-chart/handle.png | Bin 1252 -> 941 bytes
public/zh/images/index-chart/handle2.png | Bin 567 -> 343 bytes
public/zh/images/index-chart/iphone.png | Bin 98448 -> 40811 bytes
public/zh/images/index-feature.png | Bin 64514 -> 49915 bytes
public/zh/images/index/1.png | Bin 38600 -> 37747 bytes
public/zh/images/index/2.png | Bin 80174 -> 79321 bytes
public/zh/images/index/3.png | Bin 114969 -> 114116 bytes
public/zh/images/index/4.png | Bin 67588 -> 66735 bytes
public/zh/images/index/5.png | Bin 140731 -> 139878 bytes
public/zh/images/index/6.png | Bin 56760 -> 55907 bytes
public/zh/images/index/7.png | Bin 104606 -> 103753 bytes
public/zh/images/index/device.png | Bin 85318 -> 84466 bytes
public/zh/images/index/device1.png | Bin 87517 -> 84803 bytes
public/zh/images/index/earth.png | Bin 79622 -> 79564 bytes
public/zh/images/index/echarts.png | Bin 33008 -> 32076 bytes
public/zh/images/index/file.png | Bin 5035 -> 4977 bytes
public/zh/images/index/footer.png | Bin 4333 -> 3280 bytes
public/zh/images/index/header.png | Bin 6172 -> 5119 bytes
public/zh/images/index/line.png | Bin 32795 -> 31863 bytes
public/zh/images/index/shadow.png | Bin 5919 -> 5861 bytes
public/zh/images/liquid-fill.png | Bin 31358 -> 31345 bytes
public/zh/images/logo.png | Bin 3765 -> 3707 bytes
public/zh/images/map.png | Bin 283943 -> 213619 bytes
public/zh/images/no-map.png | Bin 8135 -> 5421 bytes
public/zh/images/people/JB.png | Bin 87295 -> 87282 bytes
public/zh/images/people/erik.png | Bin 70060 -> 70047 bytes
public/zh/images/people/weizhi.png | Bin 1284 -> 1271 bytes
.../zh/images/people/\345\221\250\346\211\254.png" | Bin 92607 -> 92594 bytes
.../zh/images/people/\345\221\250\347\216\211.png" | Bin 97601 -> 97588 bytes
.../zh/images/people/\345\244\247\344\275\233.png" | Bin 111561 -> 84050 bytes
.../\345\250\204\345\220\214\345\205\265.png" | Bin 20118 -> 20105 bytes
.../zh/images/people/\345\256\277\347\210\275.png" | Bin 76678 -> 76665 bytes
.../zh/images/people/\345\260\217\347\272\242.png" | Bin 97862 -> 97849 bytes
.../zh/images/people/\345\276\267\346\270\205.png" | Bin 70273 -> 67559 bytes
.../zh/images/people/\346\235\216\346\271\233.png" | Bin 67163 -> 67150 bytes
.../zh/images/people/\346\235\250\351\252\245.png" | Bin 80366 -> 80353 bytes
.../zh/images/people/\346\236\227\345\263\260.png" | Bin 62803 -> 47308 bytes
.../\346\241\221\346\226\207\351\224\213.png" | Bin 77118 -> 77105 bytes
.../zh/images/people/\346\262\210\346\257\205.png" | Bin 66512 -> 66499 bytes
.../zh/images/people/\346\262\210\346\265\251.png" | Bin 65255 -> 65242 bytes
.../\347\216\213\344\277\212\345\251\267.png" | Bin 106485 -> 81510 bytes
.../zh/images/people/\347\216\213\347\220\274.png" | Bin 68308 -> 68295 bytes
.../zh/images/people/\347\224\260\345\275\247.png" | Bin 46656 -> 43879 bytes
.../zh/images/people/\347\245\226\346\230\216.png" | Bin 70285 -> 70272 bytes
.../zh/images/people/\347\272\242\350\226\257.png" | Bin 63205 -> 63192 bytes
.../zh/images/people/\347\276\241\350\276\231.png" | Bin 71775 -> 69060 bytes
.../\350\213\217\346\200\235\346\226\207.png" | Bin 97740 -> 94259 bytes
.../\350\242\201\346\231\223\345\246\202.png" | Bin 81879 -> 81866 bytes
.../\350\260\242\347\233\212\350\276\211.png" | Bin 84370 -> 84357 bytes
.../zh/images/people/\350\265\265\351\233\267.png" | Bin 68260 -> 68247 bytes
.../zh/images/people/\351\230\277\346\226\207.png" | Bin 80273 -> 80260 bytes
.../zh/images/people/\351\231\210\344\270\272.png" | Bin 52648 -> 52635 bytes
.../\351\241\276\350\275\266\347\201\265.png" | Bin 139414 -> 110953 bytes
.../\351\255\217\345\244\252\344\272\221.png" | Bin 48970 -> 48957 bytes
.../\351\273\204\345\277\227\346\225\217.png" | Bin 90020 -> 90007 bytes
.../zh/images/people/\351\273\204\346\202\246.png" | Bin 81118 -> 81105 bytes
public/zh/images/pipeline.png | Bin 220187 -> 141946 bytes
public/zh/images/yinhao.png | Bin 2898 -> 1371 bytes
public/zh/index.html | 46 +-
public/zh/js/cheat-sheet-en.js | 1 +
public/zh/js/cheat-sheet.js | 1 +
public/zh/js/common.js | 2 +-
public/zh/js/docTool/main.js | 16 +-
public/zh/js/download.js | 2 +-
public/zh/maillist.html | 12 +-
public/zh/option-gl.html | 28 +-
public/zh/option.html | 28 +-
public/zh/option3.html | 28 +-
public/zh/spreadsheet.html | 28 +-
public/zh/tutorial.html | 28 +-
public/zh/video/feature-1.jpg | Bin 167910 -> 52108 bytes
public/zh/video/feature-2.jpg | Bin 165749 -> 46538 bytes
public/zh/video/index-4.jpg | Bin 463029 -> 72013 bytes
public/zh/video/index.jpg | Bin 97216 -> 27348 bytes
593 files changed, 84302 insertions(+), 72335 deletions(-)
diff --git a/public/404.html b/public/404.html
index 7ad350d..e5a8424 100644
--- a/public/404.html
+++ b/public/404.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/404.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/404.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/about.html b/public/about.html
index 6918b2f..e4b7064 100644
--- a/public/about.html
+++ b/public/about.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/committers.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/committers.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/api.html b/public/api.html
index f7e7cdc..79d3e1a 100644
--- a/public/api.html
+++ b/public/api.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/api.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/api.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/builder.html b/public/builder.html
index c9b1b31..a8935d3 100644
--- a/public/builder.html
+++ b/public/builder.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/builder.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/builder.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/builder3.html b/public/builder3.html
index 8d9057c..906b5d3 100644
--- a/public/builder3.html
+++ b/public/builder3.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/builder3.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/builder3.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/changelog.html b/public/changelog.html
index 9977c0c..03a9492 100644
--- a/public/changelog.html
+++ b/public/changelog.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/changelog.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/changelog.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/cheat-sheet.html b/public/cheat-sheet.html
new file mode 100644
index 0000000..f6316b2
--- /dev/null
+++ b/public/cheat-sheet.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
+lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
+location.href = 'https://www.echartsjs.com/' + lang + '/cheat-sheet.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/cn/documents/cn/api.json b/public/cn/documents/cn/api.json
index ea7235c..466504b 100644
--- a/public/cn/documents/cn/api.json
+++ b/public/cn/documents/cn/api.json
@@ -1 +1 @@
-{"$schema":"http://echarts.baidu.com/doc/json-schem","option":{"type":"Object","properties":{"echarts":{"type":["Object"],"description":"<p>全局 echarts 对象,在 script 标签引入 <code>echarts.js</code> 文件后获得,或者在 AMD 环境中通过 <code>require('echarts')</code> 获得。</p>\n","properties":{"init":{"type":["Function"],"description":"<pre><code class=\"lang-js\">(dom: HTMLDivElement|HTMLCanvasElement, theme?: Object|string, opts?: {\n devicePixelRatio?: number\n renderer?: string\n width?: numb [...]
\ No newline at end of file
+{"$schema":"http://echarts.baidu.com/doc/json-schem","option":{"type":"Object","properties":{"echarts":{"type":["Object"],"description":"<p>全局 echarts 对象,在 script 标签引入 <code>echarts.js</code> 文件后获得,或者在 AMD 环境中通过 <code>require('echarts')</code> 获得。</p>\n","properties":{"init":{"type":["Function"],"description":"<pre><code class=\"lang-js\">(dom: HTMLDivElement|HTMLCanvasElement, theme?: Object|string, opts?: {\n devicePixelRatio?: number\n renderer?: string\n width?: numb [...]
\ No newline at end of file
diff --git a/public/cn/documents/cn/changelog.html b/public/cn/documents/cn/changelog.html
index a030adb..36d2a5b 100644
--- a/public/cn/documents/cn/changelog.html
+++ b/public/cn/documents/cn/changelog.html
@@ -1,3 +1,172 @@
+<h2 id="v4-3-0-rc-1">v4.3.0-rc.1</h2>
+<div class="time">2019-08-27</div>
+
+<ul>
+<li><p>[Feature] Sankey diagram enhancement:
+Add left node align, right in sankey diagram.
+Support user to specify the depth of the node.
+Enhance sankey node tooltip formatter.
+Add depth layout info for each node.</p>
+</li>
+<li><p>[Feature] Support callback in <code>series.symbol</code>. Contributed by PR #9664 originally.</p>
+</li>
+<li><p>[Feature] Enhance Pie chart:
+Support <code>minShowLabelAngle</code>. Contributed by PR #8997 originally.
+Support label rotate in pie chart. Fix #10045.</p>
+</li>
+<li><p>[Feature] Support <code>backgroundColor</code> for connected charts in toolbox. <code>toolbox.feature.saveAsImage.connectedBackgroundColor</code> can be used to set the background color. Fix #10099.</p>
+</li>
+<li><p>[Feature] Enhance toolbox:
+Enable to set text style of toolbox.
+Support tooltip for toolbox. Fix #10202.</p>
+</li>
+<li><p>[Feature] Enhance dataZoom:
+Normalize illegal range setting and get accurate <code>start</code>/<code>end</code>/<code>startValue</code>/<code>endValue</code> in <code>'dataZoom'</code> event.</p>
+</li>
+<li><p>[Feature] Add <code>dimensionNames</code> and <code>encode</code> info to callback parameters of formatters. Fix #10248 and Close #10250.</p>
+</li>
+<li><p>[Feature] Funnel enhancement:
+<code>series.label.position</code> support to set <code>rightTop</code>, <code>rightBottom</code>, <code>leftTop</code>, <code>leftBottom</code>. And fix style in funnel text position.</p>
+</li>
+<li><p>[Fix] Support mouse event in iOS when css transform used. Fix #9434, #8326, #5009, #5921.</p>
+</li>
+<li><p>[Fix] Use a clearer warning message when initing dom without size. Fix #10478.</p>
+</li>
+<li><p>[Fix] Fix that the rgba opacity does not work in SVG renderer. Fix #9014</p>
+</li>
+<li><p>[Fix] Enhance funnel chart label display policy PR #8759</p>
+</li>
+<li><p>[Fix] Fix the highlight/downplay of pie graphic.</p>
+</li>
+<li><p>[Fix] Fix the mouse pointer in force graph. Fix #7764, contributed by PR #9134.</p>
+</li>
+<li><p>[Fix] Fix that <code>symbol</code> and <code>symbolSize</code> and <code>opacity</code> does not work in <code>series[i]-graph.categories[i]</code>. Fix #8009 and #5969, contributed by PR #9171.</p>
+</li>
+<li><p>[Fix] Fix that <code>axisLine.show</code> does not work in the gauge. Fix #9194, contributed by PR #9195.</p>
+</li>
+<li><p>[Fix] Fix a display error when the first data item is '-' in radar. Fix 8962.</p>
+</li>
+<li><p>[Fix] Fix polygon rendering bug when the first value is <code>NaN</code>. Fix #8962, contributed by PR #9162.</p>
+</li>
+<li><p>[Fix] Fix text truncate bug in treemap when using SVG renderer.</p>
+</li>
+<li><p>[Fix] Fix that <code>label.rotate</code> does not work in graph. Fix #9182, contributed by PR #9210.</p>
+</li>
+<li><p>[Fix] Fix the rich content hiding bug and confine bug in tooltip. Fix ecomfe/echarts-for-weixin#360, ecomfe/echarts-for-weixin#347.</p>
+</li>
+<li><p>[Fix] Fix that callback function params.color is incorrect in sunburst area. Fix #8952, contributed by PR #9238.</p>
+</li>
+<li><p>[Fix] Fix that when <code>axisLabel.interval</code> of a category axis is set as <code>0</code>, all labels are displayed regardless of overlap. Fix #9589.</p>
+</li>
+<li><p>[Fix] Fix sub-pixel in markLine. Move subPixelOptimize to zrender. Fix #9598.</p>
+</li>
+<li><p>[Fix] Fix that when doing clear on click handler error is thrown. Fix #9649.</p>
+</li>
+<li><p>[Fix] Fix that <code>false</code> value in data items effect subsequent items in <code>visualMap</code>. Fix #8799.</p>
+</li>
+<li><p>[Fix] Enhance <code>hoverStyle</code> and <code>highlight</code>/<code>downplay</code> API. Support keep highlighted when changing style (e.g., <code>setOption</code> or <code>hoverLink</code>). Fix the highlight conflict.</p>
+</li>
+<li><p>[Fix] Fix radar line disappear on hover when there is empty value in data.</p>
+</li>
+<li><p>[Fix] Fix that geo map panning not working on Edge browser. Fix #9479.</p>
+</li>
+<li><p>[Fix] Fix map label bugs:
+Fix map rich label missing when missing data.
+Fix map label miss to enter formatter when missing data.
+Fix #9682.</p>
+</li>
+<li><p>[Fix] Enable <code>triggerEvent</code> for label of <code>angleAxis</code>. Fix #9765.</p>
+</li>
+<li><p>[Fix] Fix that the hover style bugs of graph:
+Fix that the hover style is disabled by <code>focusNodeAdjacency</code> in graph.
+Fix that the line label can not be returned to its original opacity after <code>"focusNodeAdjacency"</code>.</p>
+</li>
+<li><p>[Fix] Lift the axis line arrow over splitLine and tick.</p>
+</li>
+<li><p>[Fix] Fix that the scrollable legend pager does not work when the target index is illegal. Fix #7568.</p>
+</li>
+<li><p>[Fix] Exclude padding from tooltip position, since it's included in clientWidth. Contributed by PR #9750.</p>
+</li>
+<li><p>[Fix] Fix <code>barWidth</code> calculation when stack on multiple polars. Fix #9626.</p>
+</li>
+<li><p>[Fix] Loop to find the first non-NaN angle for clipPath in pie.</p>
+</li>
+<li><p>[Fix] Fix line width in singleAxis. Fix #9965.</p>
+</li>
+<li><p>[Fix] Fix the label bounding rect calculation error when <code>rich</code> used (e.g., containLabel: true while axisLabel has rich).</p>
+</li>
+<li><p>[Fix] Part of emphasis in sunburst do not work. Fix #9563, constributed by PR #9993.</p>
+</li>
+<li><p>[Fix] Add <code>seriesId</code> in <code>pieselectchanged</code>. Fix #9830.</p>
+</li>
+<li><p>[Fix] Fix that axis name align does not work. Fix #9901.</p>
+</li>
+<li><p>[Fix] Fix taht the strange label position when the pie chart series data value is <code>null</code>. Fix #10088.</p>
+</li>
+<li><p>[Fix] Do not create an anchor element if you don't need to in <code>SaveAsImage</code>. Contributed by PR #10132.</p>
+</li>
+<li><p>[Fix] Fix that <code>axisLabel</code> dost not display correctly in radar. Fix #9282, contributed by PR #10036.</p>
+</li>
+<li><p>[Fix] Fix that bar chart is abnormal when <code>filterMode</code> of <code>dataZoom</code> is 'empty'. Fix #9882.</p>
+</li>
+<li><p>[Fix] Fix <code>series.label.formatter</code> callback bug. Fix #10248, contributed by PR #10250.</p>
+</li>
+<li><p>[Fix] Fix that the last axis labels are duplicated. Fix #10304.</p>
+</li>
+<li><p>[Fix] Fix that setting <code>emphasis.lineStyle.type</code> as <code>solid</code> dose not work. Fix #9704, close #10129.</p>
+</li>
+<li><p>[Fix] Fix that if some negetive numbers or strings existing in the dimensions array, the corresponding line will not show. Fix #10343.</p>
+</li>
+<li><p>[Fix] Fix that when <code>'0'</code> existing in dimentions the chart do not work. Make backward compat when dimention is a number-like string. Fix #9363, contributed by PR #9388.</p>
+</li>
+<li><p>[Fix] Fix hover style on <code>textStroke</code> bug in custom series.</p>
+</li>
+<li><p>[Fix] Fix graph bug when data is number typed. Fix #10485.</p>
+</li>
+<li><p>[Fix] Fix that <code>axisPointer</code> label padding does not work. Fix #10569.</p>
+</li>
+<li><p>[Fix] Add <code>dimIndex</code> for callback formatter in radar. Close #10403, #10180, contributed PR #10437.</p>
+</li>
+<li><p>[Fix] Prevent treamap from using hover layer by default. Fix #10521. Ref #10635.</p>
+</li>
+<li><p>[Fix] Update pointer when type is none. Fix #10570.</p>
+</li>
+<li><p>[Fix] Enhance circular layout: based on symbol size and fix overlap when some value are very smaller than the max value. Fix #10462, Close #10615.</p>
+</li>
+<li><p>[Fix] Support click and tooltip in bar large mode. Fix #10699.</p>
+</li>
+</ul>
+<h2 id="v4-2-1">v4.2.1</h2>
+<div class="time">2019-03-21</div>
+
+<ul>
+<li><p>[Fix] 修复了文本缓存的问题. 参见 <a href="https://github.com/apache/incubator-echarts/issues/9190">#9190</a>,<a href="https://github.com/apache/incubator-echarts/issues/9597">#9597</a>,<a href="https://github.com/apache/incubator-echarts/issues/9762">#9762</a>。</p>
+</li>
+<li><p>[Fix] 修复了在一些情况下事件处理器中重新 <code>setOption</code> 时抛异常的问题。参见 <a href="https://github.com/apache/incubator-echarts/issues/9649">#9649</a>。</p>
+</li>
+<li><p>[Fix] 修复了 geo 中 <code>showTip</code> 异常的问题。参见 <a href="https://github.com/apache/incubator-echarts/issues/9156">#9156</a>。</p>
+</li>
+<li><p>[Fix] 修复了一些情况下堆叠柱状图超出直角坐标系范围的问题。参见 <a href="https://github.com/apache/incubator-echarts/issues/9346">#9346</a>。</p>
+</li>
+<li><p>[Fix] 修复了图例组件(legend)当空间只够显示一项时不能翻页的问题。参见 <a href="https://github.com/apache/incubator-echarts/issues/6743">#6743</a>,<a href="https://github.com/apache/incubator-echarts/issues/8971">#8971</a>,<a href="https://github.com/apache/incubator-echarts/issues/9471">#9471</a>。</p>
+</li>
+<li><p>[Fix] 修复了饼图标签(label)定位在中心时,在一些角度下有便宜的问题。参见 <a href="https://github.com/apache/incubator-echarts/issues/9657">#9657</a>。</p>
+</li>
+<li><p>[Fix] 修复了地图坐标系(geo)在 MS Edge 下不能拖动的问题。参见 <a href="https://github.com/apache/incubator-echarts/issues/9479">#9479</a>。</p>
+</li>
+<li><p>[Fix] 修复了地图系列(series.type: 'map')标签不能显示的问题。参见 <a href="https://github.com/apache/incubator-echarts/issues/9682">#9682</a>。</p>
+</li>
+<li><p>[Fix] 修复了设置了 <code>visualMap: false</code> 的数据项影响其他数据项的问题。参见 <a href="https://github.com/apache/incubator-echarts/issues/8799">#8799</a>。</p>
+</li>
+<li><p>[Fix] 使得 <code>axis.type: 'category'</code> 且 <code>axisLabel.interval: 0</code> 时,所有标签(axisLabel)都能被显示。参见 <a href="https://github.com/apache/incubator-echarts/issues/9589">#9589</a>。</p>
+</li>
+<li><p>[Fix] 修复了 containLabel 和 axisLabel.rich 同时使用时,grid(cartesian) 不渲染的问题。</p>
+</li>
+<li><p>[Fix] 修复了 license 表述。</p>
+</li>
+<li><p>[Fix] 修复了 rich text boundingRect 问题。</p>
+</li>
+</ul>
<h2 id="v4-2-1-rc1">v4.2.1.rc1</h2>
<div class="time">2019-01-22</div>
diff --git a/public/cn/documents/cn/option.json b/public/cn/documents/cn/option.json
index ac5762c..5d27ada 100644
--- a/public/cn/documents/cn/option.json
+++ b/public/cn/documents/cn/option.json
@@ -1 +1 @@
-{"$schema":"http://echarts.baidu.com/doc/json-schem","option":{"type":"Object","properties":{"title":{"type":["Object"],"description":"<p>标题组件,包含主标题和副标题。</p>\n<p>在 ECharts 2.x 中单个 ECharts 实例最多只能拥有一个标题组件。但是在 ECharts 3 中可以存在任意多个标题组件,这在需要标题进行排版,或者单个实例中的多个图表都需要标题时会比较有用。</p>\n<p><strong>例如下面不同缓动函数效果的示例,每一个缓动效果图都带有一个标题组件:</strong></p>\n<iframe data-src=\"https://ecomfe.github.io/echarts-examples/public/view.html?c=line-easing&edit=1&reset=1\" width=\"700\" height=\"400\" ></iframe>\n\n\n\n","p [...]
\ No newline at end of file
+{"$schema":"http://echarts.baidu.com/doc/json-schem","option":{"type":"Object","properties":{"title":{"type":["Object"],"description":"<p>标题组件,包含主标题和副标题。</p>\n<p>在 ECharts 2.x 中单个 ECharts 实例最多只能拥有一个标题组件。但是在 ECharts 3 中可以存在任意多个标题组件,这在需要标题进行排版,或者单个实例中的多个图表都需要标题时会比较有用。</p>\n<p><strong>例如下面不同缓动函数效果的示例,每一个缓动效果图都带有一个标题组件:</strong></p>\n<iframe data-src=\"https://www.echartsjs.com/examples/en/view.html?c=line-easing&edit=1&reset=1\" width=\"700\" height=\"400\" ></iframe>\n\n\n\n","properties": [...]
\ No newline at end of file
diff --git a/public/cn/documents/cn/tutorial.json b/public/cn/documents/cn/tutorial.json
index a03a61f..f63d939 100644
--- a/public/cn/documents/cn/tutorial.json
+++ b/public/cn/documents/cn/tutorial.json
@@ -1 +1 @@
-{"$schema":"http://echarts.baidu.com/doc/json-schem","option":{"type":"Object","properties":{"5 分钟上手 ECharts":{"type":["*"],"description":"<h2 id=\"-echarts\">获取 ECharts</h2>\n<p>你可以通过以下几种方式获取 ECharts。</p>\n<ol>\n<li><p>从<a href=\"http://echarts.baidu.com/download.html\" target=\"_blank\">官网下载界面</a>选择你需要的版本下载,根据开发者功能和体积上的需求,我们提供了不同打包的下载,如果你在体积上没有要求,可以直接下载<a href=\"http://echarts.baidu.com/dist/echarts.min.js\" target=\"_blank\">完整版本</a>。开发环境建议下载<a href=\"http://echarts.baidu.com/dist/ech [...]
\ No newline at end of file
+{"$schema":"http://echarts.baidu.com/doc/json-schem","option":{"type":"Object","properties":{"5 分钟上手 ECharts":{"type":["*"],"description":"<h2 id=\"-echarts\">获取 ECharts</h2>\n<p>你可以通过以下几种方式获取 ECharts。</p>\n<ol>\n<li><p>从<a href=\"http://echarts.baidu.com/download.html\" target=\"_blank\">官网下载界面</a>选择你需要的版本下载,根据开发者功能和体积上的需求,我们提供了不同打包的下载,如果你在体积上没有要求,可以直接下载<a href=\"http://echarts.baidu.com/dist/echarts.min.js\" target=\"_blank\">完整版本</a>。开发环境建议下载<a href=\"http://echarts.baidu.com/dist/ech [...]
\ No newline at end of file
diff --git a/public/coding-standard.html b/public/coding-standard.html
index b2a1d94..38216df 100644
--- a/public/coding-standard.html
+++ b/public/coding-standard.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/coding-standard.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/coding-standard.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/committer.html b/public/committer.html
index 733dd5a..021b1cc 100644
--- a/public/committer.html
+++ b/public/committer.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/committer.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/committer.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/demo.html b/public/demo.html
index 0b2c63e..84c013f 100644
--- a/public/demo.html
+++ b/public/demo.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/demo.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/demo.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/download-extension.html b/public/download-extension.html
index 3de3aec..2befcdc 100644
--- a/public/download-extension.html
+++ b/public/download-extension.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/download-extension.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/download-extension.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/download-map.html b/public/download-map.html
index 7e3c154..57b0f13 100644
--- a/public/download-map.html
+++ b/public/download-map.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/download-map.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/download-map.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/download-theme.html b/public/download-theme.html
index 3649c12..662dd67 100644
--- a/public/download-theme.html
+++ b/public/download-theme.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/download-theme.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/download-theme.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/download.html b/public/download.html
index 5139d13..cd0b0bb 100644
--- a/public/download.html
+++ b/public/download.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/download.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/download.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/download3.html b/public/download3.html
index 17523dc..bfeb9ec 100644
--- a/public/download3.html
+++ b/public/download3.html
@@ -1,3 +1,6 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var lang = navigator.language || navigator.userLanguage;
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">var hash = (location.hash || '').replace('#', '');
+var search = (location.search || '').replace('?', '');
+var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
-location.href = 'https://echarts.apache.org/' + lang + '/download3.html';</script></head></html>
\ No newline at end of file
+location.href = 'https://www.echartsjs.com/' + lang + '/download3.html'
+ + (search ? '?' + search : '') + (hash ? '#' + hash : '');</script></head></html>
\ No newline at end of file
diff --git a/public/en/404.html b/public/en/404.html
new file mode 100644
index 0000000..059533d
--- /dev/null
+++ b/public/en/404.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
+</script><script type="text/javascript" src="./vendors/pace/pace.min.js"></script><script id="font-hack" type="text/javascript">if (/windows/i.test(navigator.userAgent)) {
+ var el = document.createElement('style');
+ el.innerHTML = ''
+ + '@font-face {font-family:"noto-thin";src:local("Microsoft Yahei");}'
+ + '@font-face {font-family:"noto-light";src:local("Microsoft Yahei");}';
+ document.head.insertBefore(el, document.getElementById('font-hack'));
+}
+</script><script type="text/javascript" src="./vendors/jquery/jquery.min.js"></script></head><!--[if lte IE 8]><body class="lower-ie"><div id="lowie-main"><img src="./images/forie.png" alt="ie tip"></div></body><![endif]-->
+<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="apache-banner"><div class="txt"><p>Apache ECharts 是一个正在由 Apache 孵化器赞助的 Apache 开源基金会孵化的项目。</p><p>我们正在处理将本站跳转到 <a href="https://echarts.apache.org" target="_blank">https://echarts.apache.org</a> 的迁移工作。您可以现在就前往我们的 Apache 官网。</p></div><a href="https://echarts.apache.org" target="_blank" onclick="logApache()" class="btn"><div>访问官网</div></a><a href="javascript:;" onclick="closeApacheBanner(true)" class="close-btn">x</ [...]
+(function() {
+var hm = document.createElement("script");
+hm.src = "https://hm.baidu.com/hm.js?54b918eee37cb8a7045f0fd0f0b24395";
+var s = document.getElementsByTagName("script")[0];
+s.parentNode.insertBefore(hm, s);
+})();
+</script><!-- Google Analytics--><script type="text/javascript" async src="https://www.googletagmanager.com/gtag/js?id=UA-141228404-1"></script><script type="text/javascript">window.dataLayer = window.dataLayer || [];
+function gtag(){dataLayer.push(arguments);}
+gtag('js', new Date());
+gtag('config', 'UA-141228404-1');</script></html>
\ No newline at end of file
diff --git a/public/en/api.html b/public/en/api.html
index e4dc732..d21e1ab 100644
--- a/public/en/api.html
+++ b/public/en/api.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html lang="en-US"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
+<!DOCTYPE html><html lang="en-US"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
</script><script type="text/javascript" src="./vendors/pace/pace.min.js"></script><script id="font-hack" type="text/javascript">if (/windows/i.test(navigator.userAgent)) {
var el = document.createElement('style');
el.innerHTML = ''
@@ -6,8 +6,8 @@
+ '@font-face {font-family:"noto-light";src:local("Microsoft Yahei");}';
document.head.insertBefore(el, document.getElementById('font-hack'));
}
-</script><title>ECharts Documentation</title><link rel="stylesheet" type="text/css" href="css/ecOption.css?_v_=1559123935727"><link rel="stylesheet" type="text/css" href="vendors/prettify/prettify.css"><link rel="stylesheet" type="text/css" href="vendors/perfect-scrollbar/0.6.8/css/perfect-scrollbar.min.css"><link rel="stylesheet" type="text/css" href="vendors/jquery-autocomplete/jquery.auto-complete.css"><link rel="stylesheet" type="text/css" href="vendors/twentytwenty/twentytwenty.css" [...]
-<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="main"><nav class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="https://echarts.a [...]
+</script><title>ECharts Documentation</title><link rel="stylesheet" type="text/css" href="css/ecOption.css?_v_=1567111921734"><link rel="stylesheet" type="text/css" href="vendors/prettify/prettify.css"><link rel="stylesheet" type="text/css" href="vendors/perfect-scrollbar/0.6.8/css/perfect-scrollbar.min.css"><link rel="stylesheet" type="text/css" href="vendors/jquery-autocomplete/jquery.auto-complete.css"><link rel="stylesheet" type="text/css" href="vendors/twentytwenty/twentytwenty.css" [...]
+<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="apache-banner"><div class="txt"><p>Apache ECharts is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator.</p><p>We are working on redirecting this Website to <a href="https://echarts.apache.org" target="_blank">https://echarts.apache.org</a>. You may visit our new official Website now.</p></div><a href="https://echarts.apache.org" target="_blank" onclick="lo [...]
pageName: 'api',
initHash: 'echarts',
hideTreeRoot: true,
@@ -28,7 +28,7 @@
var vendorPath = '../vendors';
define('globalArgs', extend({
- version: '1559123935727',
+ version: '1567111921734',
basePath: './',
// Schema url is added by each doc page
schemaUrl: '',
@@ -45,14 +45,6 @@ define('prettyPrint', function () {
return prettyPrint;
});
-define('ecLog', function () {
- // log maybe blocked
- if (typeof ecLog === 'undefined') {
- ecLog = function () {};
- }
- return ecLog;
-});
-
require.config({
baseUrl: './js',
paths: {
@@ -63,7 +55,7 @@ require.config({
hasher: vendorPath + '/hasher/1.2.0/hasher.min',
perfectScrollbar: vendorPath + '/perfect-scrollbar/0.6.8/js/perfect-scrollbar'
},
- urlArgs: '_v_=1559123935727'
+ urlArgs: '_v_=1567111921734'
});
require(['docTool/main'], function (main) {
@@ -77,10 +69,14 @@ function extend(tar, src) {
}
}
return tar;
-}</script><script type="text/javascript">var _hmt = _hmt || [];
+}</script><!-- Baidu Tongji--><script type="text/javascript">var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
-hm.src = "//hm.baidu.com/hm.js?4bad1df23f079e0d12bdbef5e65b072f";
+hm.src = "https://hm.baidu.com/hm.js?54b918eee37cb8a7045f0fd0f0b24395";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
-})();</script></html>
\ No newline at end of file
+})();
+</script><!-- Google Analytics--><script type="text/javascript" async src="https://www.googletagmanager.com/gtag/js?id=UA-141228404-1"></script><script type="text/javascript">window.dataLayer = window.dataLayer || [];
+function gtag(){dataLayer.push(arguments);}
+gtag('js', new Date());
+gtag('config', 'UA-141228404-1');</script></html>
\ No newline at end of file
diff --git a/public/en/builder.html b/public/en/builder.html
index 35037e8..1fc096e 100644
--- a/public/en/builder.html
+++ b/public/en/builder.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html lang="en-US"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
+<!DOCTYPE html><html lang="en-US"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
</script><script type="text/javascript" src="./vendors/pace/pace.min.js"></script><script id="font-hack" type="text/javascript">if (/windows/i.test(navigator.userAgent)) {
var el = document.createElement('style');
el.innerHTML = ''
@@ -7,12 +7,7 @@
document.head.insertBefore(el, document.getElementById('font-hack'));
}
</script><title>ECharts Online Builder</title><script type="text/javascript" src="./vendors/jquery/jquery.min.js"></script></head><!--[if lte IE 8]><body class="lower-ie"><div id="lowie-main"><img src="./images/forie.png" alt="ie tip"></div></body><![endif]-->
-<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="main"><nav class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="https://echarts.a [...]
- // Incase adblock block log.js
- ecLog = function () {};
-}
-
-function updateCheckbox() {
+<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="apache-banner"><div class="txt"><p>Apache ECharts is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator.</p><p>We are working on redirecting this Website to <a href="https://echarts.apache.org" target="_blank">https://echarts.apache.org</a>. You may visit our new official Website now.</p></div><a href="https://echarts.apache.org" target="_blank" onclick="lo [...]
$('#charts input, #components input, #coords input').each(function () {
$(this).attr('checked', $(this).parent().hasClass('checked'));
});
@@ -57,24 +52,24 @@ $("#build").click(function () {
}
parameters += '&version=4'
- + '&versionCode=4.2.1';
+ + '&versionCode=4.3.0';
var email = $('#email').val();
var log = parameters;
if (email) {
log += '&email=' + email;
}
- ecLog({
- 'page': 'builder',
- 'version': '4.2.1',
- 'build-parameters-3': log
- });
+ _hmt.push(['_trackEvent', 'builder', 'build', '4.3.0', log]);
window.open('builder/echarts.html?' + parameters);
-});</script><script type="text/javascript">var _hmt = _hmt || [];
+});</script><!-- Baidu Tongji--><script type="text/javascript">var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
-hm.src = "//hm.baidu.com/hm.js?4bad1df23f079e0d12bdbef5e65b072f";
+hm.src = "https://hm.baidu.com/hm.js?54b918eee37cb8a7045f0fd0f0b24395";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
-})();</script></html>
\ No newline at end of file
+})();
+</script><!-- Google Analytics--><script type="text/javascript" async src="https://www.googletagmanager.com/gtag/js?id=UA-141228404-1"></script><script type="text/javascript">window.dataLayer = window.dataLayer || [];
+function gtag(){dataLayer.push(arguments);}
+gtag('js', new Date());
+gtag('config', 'UA-141228404-1');</script></html>
\ No newline at end of file
diff --git a/public/en/builder/echarts.html b/public/en/builder/echarts.html
index 7c1851a..9d0678e 100644
--- a/public/en/builder/echarts.html
+++ b/public/en/builder/echarts.html
@@ -56,7 +56,7 @@
'esprima': 'lib/esprima',
'estraverse': 'lib/estraverse'
},
- urlArgs: 'v=4.2.1'
+ urlArgs: 'v=4.3.0'
});
require(['build']);
diff --git a/public/en/builder/src/echarts/action/createDataSelectAction.js b/public/en/builder/src/echarts/action/createDataSelectAction.js
index f636a46..7ed8578 100644
--- a/public/en/builder/src/echarts/action/createDataSelectAction.js
+++ b/public/en/builder/src/echarts/action/createDataSelectAction.js
@@ -47,7 +47,8 @@ export default function (seriesType, actionInfos) {
});
return {
name: payload.name,
- selected: selected
+ selected: selected,
+ seriesId: payload.seriesId
};
});
});
diff --git a/public/en/builder/src/echarts/chart/bar.js b/public/en/builder/src/echarts/chart/bar.js
index 3324318..16af134 100644
--- a/public/en/builder/src/echarts/chart/bar.js
+++ b/public/en/builder/src/echarts/chart/bar.js
@@ -24,9 +24,10 @@ import './bar/BarSeries';
import './bar/BarView'; // In case developer forget to include grid component
import '../component/gridSimple';
-echarts.registerLayout(zrUtil.curry(layout, 'bar')); // Should after normal bar layout, otherwise it is blocked by normal bar layout.
+echarts.registerLayout(echarts.PRIORITY.VISUAL.LAYOUT, zrUtil.curry(layout, 'bar')); // Use higher prority to avoid to be blocked by other overall layout, which do not
+// only exist in this module, but probably also exist in other modules, like `barPolar`.
-echarts.registerLayout(largeLayout);
+echarts.registerLayout(echarts.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, largeLayout);
echarts.registerVisual({
seriesType: 'bar',
reset: function (seriesModel) {
diff --git a/public/en/builder/src/echarts/chart/bar/BarView.js b/public/en/builder/src/echarts/chart/bar/BarView.js
index c682286..373db08 100644
--- a/public/en/builder/src/echarts/chart/bar/BarView.js
+++ b/public/en/builder/src/echarts/chart/bar/BarView.js
@@ -24,7 +24,9 @@ import { setLabel } from './helper';
import Model from '../../model/Model';
import barItemStyle from './barItemStyle';
import Path from 'zrender/src/graphic/Path';
-var BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'barBorderWidth']; // FIXME
+import { throttle } from '../../util/throttle';
+var BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'barBorderWidth'];
+var _eventPos = [0, 0]; // FIXME
// Just for compatible with ec2.
zrUtil.extend(Model.prototype, barItemStyle);
@@ -288,10 +290,10 @@ var LargePath = Path.extend({
// a whole line or drawing rects.
var points = shape.points;
var startPoint = this.__startPoint;
- var valueIdx = this.__valueIdx;
+ var baseDimIdx = this.__baseDimIdx;
for (var i = 0; i < points.length; i += 2) {
- startPoint[this.__valueIdx] = points[i + valueIdx];
+ startPoint[baseDimIdx] = points[i + baseDimIdx];
ctx.moveTo(startPoint[0], startPoint[1]);
ctx.lineTo(points[i], points[i + 1]);
}
@@ -302,18 +304,61 @@ function createLarge(seriesModel, group, incremental) {
// TODO support polar
var data = seriesModel.getData();
var startPoint = [];
- var valueIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;
- startPoint[1 - valueIdx] = data.getLayout('valueAxisStart');
+ var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;
+ startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart');
var el = new LargePath({
shape: {
points: data.getLayout('largePoints')
},
incremental: !!incremental,
__startPoint: startPoint,
- __valueIdx: valueIdx
+ __baseDimIdx: baseDimIdx,
+ __largeDataIndices: data.getLayout('largeDataIndices'),
+ __barWidth: data.getLayout('barWidth')
});
group.add(el);
- setLargeStyle(el, seriesModel, data);
+ setLargeStyle(el, seriesModel, data); // Enable tooltip and user mouse/touch event handlers.
+
+ el.seriesIndex = seriesModel.seriesIndex;
+
+ if (!seriesModel.get('silent')) {
+ el.on('mousedown', largePathUpdateDataIndex);
+ el.on('mousemove', largePathUpdateDataIndex);
+ }
+} // Use throttle to avoid frequently traverse to find dataIndex.
+
+
+var largePathUpdateDataIndex = throttle(function (event) {
+ var largePath = this;
+ var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);
+ largePath.dataIndex = dataIndex >= 0 ? dataIndex : null;
+}, 30, false);
+
+function largePathFindDataIndex(largePath, x, y) {
+ var baseDimIdx = largePath.__baseDimIdx;
+ var valueDimIdx = 1 - baseDimIdx;
+ var points = largePath.shape.points;
+ var largeDataIndices = largePath.__largeDataIndices;
+ var barWidthHalf = Math.abs(largePath.__barWidth / 2);
+ var startValueVal = largePath.__startPoint[valueDimIdx];
+ _eventPos[0] = x;
+ _eventPos[1] = y;
+ var pointerBaseVal = _eventPos[baseDimIdx];
+ var pointerValueVal = _eventPos[1 - baseDimIdx];
+ var baseLowerBound = pointerBaseVal - barWidthHalf;
+ var baseUpperBound = pointerBaseVal + barWidthHalf;
+
+ for (var i = 0, len = points.length / 2; i < len; i++) {
+ var ii = i * 2;
+ var barBaseVal = points[ii + baseDimIdx];
+ var barValueVal = points[ii + valueDimIdx];
+
+ if (barBaseVal >= baseLowerBound && barBaseVal <= baseUpperBound && (startValueVal <= barValueVal ? pointerValueVal >= startValueVal && pointerValueVal <= barValueVal : pointerValueVal >= barValueVal && pointerValueVal <= startValueVal)) {
+ return largeDataIndices[i];
+ }
+ }
+
+ return -1;
}
function setLargeStyle(el, seriesModel, data) {
diff --git a/public/en/builder/src/echarts/chart/custom.js b/public/en/builder/src/echarts/chart/custom.js
index 430aa6c..f49e30f 100644
--- a/public/en/builder/src/echarts/chart/custom.js
+++ b/public/en/builder/src/echarts/chart/custom.js
@@ -24,12 +24,14 @@ import createListFromArray from './helper/createListFromArray';
import { getLayoutOnAxis } from '../layout/barGrid';
import DataDiffer from '../data/DataDiffer';
import SeriesModel from '../model/Series';
+import Model from '../model/Model';
import ChartView from '../view/Chart';
import prepareCartesian2d from '../coord/cartesian/prepareCustom';
import prepareGeo from '../coord/geo/prepareCustom';
import prepareSingleAxis from '../coord/single/prepareCustom';
import preparePolar from '../coord/polar/prepareCustom';
import prepareCalendar from '../coord/calendar/prepareCustom';
+var CACHED_LABEL_STYLE_PROPERTIES = graphicUtil.CACHED_LABEL_STYLE_PROPERTIES;
var ITEM_STYLE_NORMAL_PATH = ['itemStyle'];
var ITEM_STYLE_EMPHASIS_PATH = ['emphasis', 'itemStyle'];
var LABEL_NORMAL = ['label'];
@@ -284,7 +286,9 @@ function updateEl(el, dataIndex, elOption, animatableModel, data, isInit, isRoot
el.__cusHasEmphStl = !disableStyleEmphasis;
}
- isRoot && graphicUtil.setAsHoverStyleTrigger(el, !disableStyleEmphasis);
+ if (isRoot) {
+ graphicUtil.setAsHighDownDispatcher(el, !disableStyleEmphasis);
+ }
}
function prepareStyleTransition(prop, targetStyle, elOptionStyle, oldElStyle, isInit) {
@@ -387,12 +391,13 @@ function makeRenderItem(customSeries, data, ecModel, api) {
currVisualColor != null && (itemStyle.fill = currVisualColor);
var opacity = data.getItemVisual(dataIndexInside, 'opacity');
opacity != null && (itemStyle.opacity = opacity);
- graphicUtil.setTextStyle(itemStyle, currLabelNormalModel, null, {
+ var labelModel = extra ? applyExtraBefore(extra, currLabelNormalModel) : currLabelNormalModel;
+ graphicUtil.setTextStyle(itemStyle, labelModel, null, {
autoColor: currVisualColor,
isRectText: true
});
- itemStyle.text = currLabelNormalModel.getShallow('show') ? zrUtil.retrieve2(customSeries.getFormattedLabel(dataIndexInside, 'normal'), getDefaultLabel(data, dataIndexInside)) : null;
- extra && zrUtil.extend(itemStyle, extra);
+ itemStyle.text = labelModel.getShallow('show') ? zrUtil.retrieve2(customSeries.getFormattedLabel(dataIndexInside, 'normal'), getDefaultLabel(data, dataIndexInside)) : null;
+ extra && applyExtraAfter(itemStyle, extra);
return itemStyle;
}
/**
@@ -406,11 +411,12 @@ function makeRenderItem(customSeries, data, ecModel, api) {
dataIndexInside == null && (dataIndexInside = currDataIndexInside);
updateCache(dataIndexInside);
var itemStyle = currItemModel.getModel(ITEM_STYLE_EMPHASIS_PATH).getItemStyle();
- graphicUtil.setTextStyle(itemStyle, currLabelEmphasisModel, null, {
+ var labelModel = extra ? applyExtraBefore(extra, currLabelEmphasisModel) : currLabelEmphasisModel;
+ graphicUtil.setTextStyle(itemStyle, labelModel, null, {
isRectText: true
}, true);
- itemStyle.text = currLabelEmphasisModel.getShallow('show') ? zrUtil.retrieve3(customSeries.getFormattedLabel(dataIndexInside, 'emphasis'), customSeries.getFormattedLabel(dataIndexInside, 'normal'), getDefaultLabel(data, dataIndexInside)) : null;
- extra && zrUtil.extend(itemStyle, extra);
+ itemStyle.text = labelModel.getShallow('show') ? zrUtil.retrieve3(customSeries.getFormattedLabel(dataIndexInside, 'emphasis'), customSeries.getFormattedLabel(dataIndexInside, 'normal'), getDefaultLabel(data, dataIndexInside)) : null;
+ extra && applyExtraAfter(itemStyle, extra);
return itemStyle;
}
/**
@@ -595,6 +601,27 @@ function processAddUpdate(newIndex, oldIndex) {
var childOption = newIndex != null ? context.newChildren[newIndex] : null;
var child = oldIndex != null ? context.oldChildren[oldIndex] : null;
doCreateOrUpdate(child, context.dataIndex, childOption, context.animatableModel, context.group, context.data);
+} // `graphic#applyDefaultTextStyle` will cache
+// textFill, textStroke, textStrokeWidth.
+// We have to do this trick.
+
+
+function applyExtraBefore(extra, model) {
+ var dummyModel = new Model({}, model);
+ zrUtil.each(CACHED_LABEL_STYLE_PROPERTIES, function (stylePropName, modelPropName) {
+ if (extra.hasOwnProperty(stylePropName)) {
+ dummyModel.option[modelPropName] = extra[stylePropName];
+ }
+ });
+ return dummyModel;
+}
+
+function applyExtraAfter(itemStyle, extra) {
+ for (var key in extra) {
+ if (extra.hasOwnProperty(key) || !CACHED_LABEL_STYLE_PROPERTIES.hasOwnProperty(key)) {
+ itemStyle[key] = extra[key];
+ }
+ }
}
function processRemove(oldIndex) {
diff --git a/public/en/builder/src/echarts/chart/funnel/FunnelView.js b/public/en/builder/src/echarts/chart/funnel/FunnelView.js
index 9345adf..5f0441d 100644
--- a/public/en/builder/src/echarts/chart/funnel/FunnelView.js
+++ b/public/en/builder/src/echarts/chart/funnel/FunnelView.js
@@ -33,19 +33,18 @@ function FunnelPiece(data, idx) {
this.add(polygon);
this.add(labelLine);
this.add(text);
- this.updateData(data, idx, true); // Hover to change label and labelLine
- function onEmphasis() {
- labelLine.ignore = labelLine.hoverIgnore;
- text.ignore = text.hoverIgnore;
- }
-
- function onNormal() {
- labelLine.ignore = labelLine.normalIgnore;
- text.ignore = text.normalIgnore;
- }
+ this.highDownOnUpdate = function (fromState, toState) {
+ if (toState === 'emphasis') {
+ labelLine.ignore = labelLine.hoverIgnore;
+ text.ignore = text.hoverIgnore;
+ } else {
+ labelLine.ignore = labelLine.normalIgnore;
+ text.ignore = text.normalIgnore;
+ }
+ };
- this.on('emphasis', onEmphasis).on('normal', onNormal).on('mouseover', onEmphasis).on('mouseout', onNormal);
+ this.updateData(data, idx, true);
}
var funnelPieceProto = FunnelPiece.prototype;
diff --git a/public/en/builder/src/echarts/chart/funnel/funnelLayout.js b/public/en/builder/src/echarts/chart/funnel/funnelLayout.js
index 41ca62d..d262702 100644
--- a/public/en/builder/src/echarts/chart/funnel/funnelLayout.js
+++ b/public/en/builder/src/echarts/chart/funnel/funnelLayout.js
@@ -58,16 +58,27 @@ function labelLayout(data) {
var labelLineModel = itemModel.getModel('labelLine');
var layout = data.getItemLayout(idx);
var points = layout.points;
- var isLabelInside = labelPosition === 'inner' || labelPosition === 'inside' || labelPosition === 'center';
+ var isLabelInside = labelPosition === 'inner' || labelPosition === 'inside' || labelPosition === 'center' || labelPosition === 'insideLeft' || labelPosition === 'insideRight';
var textAlign;
var textX;
var textY;
var linePoints;
if (isLabelInside) {
- textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;
- textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;
- textAlign = 'center';
+ if (labelPosition === 'insideLeft') {
+ textX = (points[0][0] + points[3][0]) / 2 + 5;
+ textY = (points[0][1] + points[3][1]) / 2;
+ textAlign = 'left';
+ } else if (labelPosition === 'insideRight') {
+ textX = (points[1][0] + points[2][0]) / 2 - 5;
+ textY = (points[1][1] + points[2][1]) / 2;
+ textAlign = 'right';
+ } else {
+ textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;
+ textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;
+ textAlign = 'center';
+ }
+
linePoints = [[textX, textY], [textX, textY]];
} else {
var x1;
@@ -82,6 +93,41 @@ function labelLayout(data) {
x2 = x1 - labelLineLen;
textX = x2 - 5;
textAlign = 'right';
+ } else if (labelPosition === 'right') {
+ // Right side
+ x1 = (points[1][0] + points[2][0]) / 2;
+ y1 = (points[1][1] + points[2][1]) / 2;
+ x2 = x1 + labelLineLen;
+ textX = x2 + 5;
+ textAlign = 'left';
+ } else if (labelPosition === 'rightTop') {
+ // RightTop side
+ x1 = points[1][0];
+ y1 = points[1][1];
+ x2 = x1 + labelLineLen;
+ textX = x2 + 5;
+ textAlign = 'top';
+ } else if (labelPosition === 'rightBottom') {
+ // RightBottom side
+ x1 = points[2][0];
+ y1 = points[2][1];
+ x2 = x1 + labelLineLen;
+ textX = x2 + 5;
+ textAlign = 'bottom';
+ } else if (labelPosition === 'leftTop') {
+ // LeftTop side
+ x1 = points[0][0];
+ y1 = points[1][1];
+ x2 = x1 - labelLineLen;
+ textX = x2 - 5;
+ textAlign = 'right';
+ } else if (labelPosition === 'leftBottom') {
+ // LeftBottom side
+ x1 = points[3][0];
+ y1 = points[2][1];
+ x2 = x1 - labelLineLen;
+ textX = x2 - 5;
+ textAlign = 'right';
} else {
// Right side
x1 = (points[1][0] + points[2][0]) / 2;
diff --git a/public/en/builder/src/echarts/chart/gauge/GaugeView.js b/public/en/builder/src/echarts/chart/gauge/GaugeView.js
index 877935e..40030c3 100644
--- a/public/en/builder/src/echarts/chart/gauge/GaugeView.js
+++ b/public/en/builder/src/echarts/chart/gauge/GaugeView.js
@@ -69,8 +69,9 @@ var GaugeView = ChartView.extend({
var angleRangeSpan = (endAngle - startAngle) % PI2;
var prevEndAngle = startAngle;
var axisLineWidth = lineStyleModel.get('width');
+ var showAxis = axisLineModel.get('show');
- for (var i = 0; i < colorList.length; i++) {
+ for (var i = 0; showAxis && i < colorList.length; i++) {
// Clamp
var percent = Math.min(Math.max(colorList[i][0], 0), 1);
var endAngle = startAngle + angleRangeSpan * percent;
diff --git a/public/en/builder/src/echarts/chart/graph.js b/public/en/builder/src/echarts/chart/graph.js
index bc1a77b..d44594c 100644
--- a/public/en/builder/src/echarts/chart/graph.js
+++ b/public/en/builder/src/echarts/chart/graph.js
@@ -33,7 +33,7 @@ echarts.registerVisual(visualSymbol('graph', 'circle', null));
echarts.registerVisual(categoryVisual);
echarts.registerVisual(edgeVisual);
echarts.registerLayout(simpleLayout);
-echarts.registerLayout(circularLayout);
+echarts.registerLayout(echarts.PRIORITY.VISUAL.POST_CHART_LAYOUT, circularLayout);
echarts.registerLayout(forceLayout); // Graph view coordinate system
echarts.registerCoordinateSystem('graphView', {
diff --git a/public/en/builder/src/echarts/chart/graph/GraphView.js b/public/en/builder/src/echarts/chart/graph/GraphView.js
index 64e0a2e..7cbc017 100644
--- a/public/en/builder/src/echarts/chart/graph/GraphView.js
+++ b/public/en/builder/src/echarts/chart/graph/GraphView.js
@@ -25,13 +25,15 @@ import * as roamHelper from '../../component/helper/roamHelper';
import { onIrrelevantElement } from '../../component/helper/cursorHelper';
import * as graphic from '../../util/graphic';
import adjustEdge from './adjustEdge';
+import { getNodeGlobalScale } from './graphHelper';
var FOCUS_ADJACENCY = '__focusNodeAdjacency';
var UNFOCUS_ADJACENCY = '__unfocusNodeAdjacency';
var nodeOpacityPath = ['itemStyle', 'opacity'];
var lineOpacityPath = ['lineStyle', 'opacity'];
function getItemOpacity(item, opacityPath) {
- return item.getVisual('opacity') || item.getModel().get(opacityPath);
+ var opacity = item.getVisual('opacity');
+ return opacity != null ? opacity : item.getModel().get(opacityPath);
}
function fadeOutItem(item, opacityPath, opacityRatio) {
@@ -45,7 +47,7 @@ function fadeOutItem(item, opacityPath, opacityRatio) {
el.downplay && el.downplay();
el.traverse(function (child) {
- if (child.type !== 'group') {
+ if (!child.isGroup) {
var opct = child.lineLabelOriginalOpacity;
if (opct == null || opacityRatio != null) {
@@ -59,13 +61,14 @@ function fadeOutItem(item, opacityPath, opacityRatio) {
function fadeInItem(item, opacityPath) {
var opacity = getItemOpacity(item, opacityPath);
- var el = item.getGraphicEl();
- el.highlight && el.highlight();
+ var el = item.getGraphicEl(); // Should go back to normal opacity first, consider hoverLayer,
+ // where current state is copied to elMirror, and support
+ // emphasis opacity here.
+
el.traverse(function (child) {
- if (child.type !== 'group') {
- child.setStyle('opacity', opacity);
- }
+ !child.isGroup && child.setStyle('opacity', opacity);
});
+ el.highlight && el.highlight();
}
export default echarts.extendChartView({
@@ -87,7 +90,6 @@ export default echarts.extendChartView({
render: function (seriesModel, ecModel, api) {
var coordSys = seriesModel.coordinateSystem;
this._model = seriesModel;
- this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');
var symbolDraw = this._symbolDraw;
var lineDraw = this._lineDraw;
var group = this.group;
@@ -106,7 +108,7 @@ export default echarts.extendChartView({
} // Fix edge contact point with node
- adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel));
+ adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));
var data = seriesModel.getData();
symbolDraw.updateData(data);
var edgeData = seriesModel.getEdgeData();
@@ -191,6 +193,8 @@ export default echarts.extendChartView({
var cx = data.getLayout('cx');
var cy = data.getLayout('cy');
data.eachItemGraphicEl(function (el, idx) {
+ var itemModel = data.getItemModel(idx);
+ var labelRotate = itemModel.get('label.rotate') || 0;
var symbolPath = el.getSymbolPath();
if (circularRotateLabel) {
@@ -208,15 +212,16 @@ export default echarts.extendChartView({
}
var textPosition = isLeft ? 'left' : 'right';
- symbolPath.setStyle({
+ graphic.modifyLabelStyle(symbolPath, {
textRotation: -rad,
textPosition: textPosition,
textOrigin: 'center'
+ }, {
+ textPosition: textPosition
});
- symbolPath.hoverStyle && (symbolPath.hoverStyle.textPosition = textPosition);
} else {
- symbolPath.setStyle({
- textRotation: 0
+ graphic.modifyLabelStyle(symbolPath, {
+ textRotation: labelRotate *= Math.PI / 180
});
}
});
@@ -323,7 +328,7 @@ export default echarts.extendChartView({
this._updateNodeAndLinkScale();
- adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel));
+ adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));
this._lineDraw.updateLayout();
}, this);
@@ -331,31 +336,14 @@ export default echarts.extendChartView({
_updateNodeAndLinkScale: function () {
var seriesModel = this._model;
var data = seriesModel.getData();
-
- var nodeScale = this._getNodeGlobalScale(seriesModel);
-
+ var nodeScale = getNodeGlobalScale(seriesModel);
var invScale = [nodeScale, nodeScale];
data.eachItemGraphicEl(function (el, idx) {
el.attr('scale', invScale);
});
},
- _getNodeGlobalScale: function (seriesModel) {
- var coordSys = seriesModel.coordinateSystem;
-
- if (coordSys.type !== 'view') {
- return 1;
- }
-
- var nodeScaleRatio = this._nodeScaleRatio;
- var groupScale = coordSys.scale;
- var groupZoom = groupScale && groupScale[0] || 1; // Scale node when zoom changes
-
- var roamZoom = coordSys.getZoom();
- var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;
- return nodeScale / groupZoom;
- },
updateLayout: function (seriesModel) {
- adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel));
+ adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));
this._symbolDraw.updateLayout();
diff --git a/public/en/builder/src/echarts/chart/graph/adjustEdge.js b/public/en/builder/src/echarts/chart/graph/adjustEdge.js
index 4550611..10ab767 100644
--- a/public/en/builder/src/echarts/chart/graph/adjustEdge.js
+++ b/public/en/builder/src/echarts/chart/graph/adjustEdge.js
@@ -18,6 +18,7 @@
*/
import * as curveTool from 'zrender/src/core/curve';
import * as vec2 from 'zrender/src/core/vector';
+import { getSymbolSize } from './graphHelper';
var v1 = [];
var v2 = [];
var v3 = [];
@@ -92,17 +93,6 @@ export default function (graph, scale) {
var pts2 = [[], []];
var v = [];
scale /= 2;
-
- function getSymbolSize(node) {
- var symbolSize = node.getVisual('symbolSize');
-
- if (symbolSize instanceof Array) {
- symbolSize = (symbolSize[0] + symbolSize[1]) / 2;
- }
-
- return symbolSize;
- }
-
graph.eachEdge(function (edge, idx) {
var linePoints = edge.getLayout();
var fromSymbol = edge.getVisual('fromSymbol');
diff --git a/public/en/builder/src/echarts/chart/graph/categoryVisual.js b/public/en/builder/src/echarts/chart/graph/categoryVisual.js
index 9e5e960..762a4d6 100644
--- a/public/en/builder/src/echarts/chart/graph/categoryVisual.js
+++ b/public/en/builder/src/echarts/chart/graph/categoryVisual.js
@@ -29,6 +29,15 @@ export default function (ecModel) {
var itemModel = categoriesData.getItemModel(idx);
var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(name, paletteScope);
categoriesData.setItemVisual(idx, 'color', color);
+ var itemStyleList = ['opacity', 'symbol', 'symbolSize', 'symbolKeepAspect'];
+
+ for (var i = 0; i < itemStyleList.length; i++) {
+ var itemStyle = itemModel.getShallow(itemStyleList[i], true);
+
+ if (itemStyle != null) {
+ categoriesData.setItemVisual(idx, itemStyleList[i], itemStyle);
+ }
+ }
}); // Assign category color to visual
if (categoriesData.count()) {
@@ -41,8 +50,12 @@ export default function (ecModel) {
category = categoryNameIdxMap['ec-' + category];
}
- if (!data.getItemVisual(idx, 'color', true)) {
- data.setItemVisual(idx, 'color', categoriesData.getItemVisual(category, 'color'));
+ var itemStyleList = ['color', 'opacity', 'symbol', 'symbolSize', 'symbolKeepAspect'];
+
+ for (var i = 0; i < itemStyleList.length; i++) {
+ if (data.getItemVisual(idx, itemStyleList[i], true) == null) {
+ data.setItemVisual(idx, itemStyleList[i], categoriesData.getItemVisual(category, itemStyleList[i]));
+ }
}
}
});
diff --git a/public/en/builder/src/echarts/chart/graph/circularLayout.js b/public/en/builder/src/echarts/chart/graph/circularLayout.js
index d5f4804..0b3747c 100644
--- a/public/en/builder/src/echarts/chart/graph/circularLayout.js
+++ b/public/en/builder/src/echarts/chart/graph/circularLayout.js
@@ -20,7 +20,7 @@ import { circularLayout } from './circularLayoutHelper';
export default function (ecModel) {
ecModel.eachSeriesByType('graph', function (seriesModel) {
if (seriesModel.get('layout') === 'circular') {
- circularLayout(seriesModel);
+ circularLayout(seriesModel, 'symbolSize');
}
});
}
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/chart/graph/circularLayoutHelper.js b/public/en/builder/src/echarts/chart/graph/circularLayoutHelper.js
index 01273b9..3a57efc 100644
--- a/public/en/builder/src/echarts/chart/graph/circularLayoutHelper.js
+++ b/public/en/builder/src/echarts/chart/graph/circularLayoutHelper.js
@@ -17,7 +17,33 @@
* under the License.
*/
import * as vec2 from 'zrender/src/core/vector';
-export function circularLayout(seriesModel) {
+import { getSymbolSize, getNodeGlobalScale } from './graphHelper';
+var PI = Math.PI;
+var _symbolRadiansHalf = [];
+/**
+ * `basedOn` can be:
+ * 'value':
+ * This layout is not accurate and have same bad case. For example,
+ * if the min value is very smaller than the max value, the nodes
+ * with the min value probably overlap even though there is enough
+ * space to layout them. So we only use this approach in the as the
+ * init layout of the force layout.
+ * FIXME
+ * Probably we do not need this method any more but use
+ * `basedOn: 'symbolSize'` in force layout if
+ * delay its init operations to GraphView.
+ * 'symbolSize':
+ * This approach work only if all of the symbol size calculated.
+ * That is, the progressive rendering is not applied to graph.
+ * FIXME
+ * If progressive rendering is applied to graph some day,
+ * probably we have to use `basedOn: 'value'`.
+ *
+ * @param {module:echarts/src/model/Series} seriesModel
+ * @param {string} basedOn 'value' or 'symbolSize'
+ */
+
+export function circularLayout(seriesModel, basedOn) {
var coordSys = seriesModel.coordinateSystem;
if (coordSys && coordSys.type !== 'view') {
@@ -27,22 +53,21 @@ export function circularLayout(seriesModel) {
var rect = coordSys.getBoundingRect();
var nodeData = seriesModel.getData();
var graph = nodeData.graph;
- var angle = 0;
- var sum = nodeData.getSum('value');
- var unitAngle = Math.PI * 2 / (sum || nodeData.count());
var cx = rect.width / 2 + rect.x;
var cy = rect.height / 2 + rect.y;
var r = Math.min(rect.width, rect.height) / 2;
- graph.eachNode(function (node) {
- var value = node.getValue('value');
- angle += unitAngle * (sum ? value : 1) / 2;
- node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);
- angle += unitAngle * (sum ? value : 1) / 2;
- });
+ var count = nodeData.count();
nodeData.setLayout({
cx: cx,
cy: cy
});
+
+ if (!count) {
+ return;
+ }
+
+ _layoutNodesBasedOn[basedOn](seriesModel, coordSys, graph, nodeData, r, cx, cy, count);
+
graph.eachEdge(function (edge) {
var curveness = edge.getModel().get('lineStyle.curveness') || 0;
var p1 = vec2.clone(edge.node1.getLayout());
@@ -58,4 +83,44 @@ export function circularLayout(seriesModel) {
edge.setLayout([p1, p2, cp1]);
});
-}
\ No newline at end of file
+}
+var _layoutNodesBasedOn = {
+ value: function (seriesModel, coordSys, graph, nodeData, r, cx, cy, count) {
+ var angle = 0;
+ var sum = nodeData.getSum('value');
+ var unitAngle = Math.PI * 2 / (sum || count);
+ graph.eachNode(function (node) {
+ var value = node.getValue('value');
+ var radianHalf = unitAngle * (sum ? value : 1) / 2;
+ angle += radianHalf;
+ node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);
+ angle += radianHalf;
+ });
+ },
+ symbolSize: function (seriesModel, coordSys, graph, nodeData, r, cx, cy, count) {
+ var sumRadian = 0;
+ _symbolRadiansHalf.length = count;
+ var nodeScale = getNodeGlobalScale(seriesModel);
+ graph.eachNode(function (node) {
+ var symbolSize = getSymbolSize(node); // Normally this case will not happen, but we still add
+ // some the defensive code (2px is an arbitrary value).
+
+ isNaN(symbolSize) && (symbolSize = 2);
+ symbolSize < 0 && (symbolSize = 0);
+ symbolSize *= nodeScale;
+ var symbolRadianHalf = Math.asin(symbolSize / 2 / r); // when `symbolSize / 2` is bigger than `r`.
+
+ isNaN(symbolRadianHalf) && (symbolRadianHalf = PI / 2);
+ _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;
+ sumRadian += symbolRadianHalf * 2;
+ });
+ var halfRemainRadian = (2 * PI - sumRadian) / count / 2;
+ var angle = 0;
+ graph.eachNode(function (node) {
+ var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];
+ angle += radianHalf;
+ node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);
+ angle += radianHalf;
+ });
+ }
+};
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/chart/graph/forceLayout.js b/public/en/builder/src/echarts/chart/graph/forceLayout.js
index ec20081..add95f4 100644
--- a/public/en/builder/src/echarts/chart/graph/forceLayout.js
+++ b/public/en/builder/src/echarts/chart/graph/forceLayout.js
@@ -46,7 +46,7 @@ export default function (ecModel) {
} else if (!initLayout || initLayout === 'none') {
simpleLayout(graphSeries);
} else if (initLayout === 'circular') {
- circularLayout(graphSeries);
+ circularLayout(graphSeries, 'value');
}
var nodeDataExtent = nodeData.getDataExtent('value');
diff --git a/public/zh/builder/src/echarts/component/dataZoom.js b/public/en/builder/src/echarts/chart/graph/graphHelper.js
similarity index 54%
copy from public/zh/builder/src/echarts/component/dataZoom.js
copy to public/en/builder/src/echarts/chart/graph/graphHelper.js
index 99810c6..0d5e3ba 100644
--- a/public/zh/builder/src/echarts/component/dataZoom.js
+++ b/public/en/builder/src/echarts/chart/graph/graphHelper.js
@@ -16,16 +16,27 @@
* specific language governing permissions and limitations
* under the License.
*/
+export function getNodeGlobalScale(seriesModel) {
+ var coordSys = seriesModel.coordinateSystem;
-/**
- * DataZoom component entry
- */
-import './dataZoom/typeDefaulter';
-import './dataZoom/DataZoomModel';
-import './dataZoom/DataZoomView';
-import './dataZoom/SliderZoomModel';
-import './dataZoom/SliderZoomView';
-import './dataZoom/InsideZoomModel';
-import './dataZoom/InsideZoomView';
-import './dataZoom/dataZoomProcessor';
-import './dataZoom/dataZoomAction';
\ No newline at end of file
+ if (coordSys.type !== 'view') {
+ return 1;
+ }
+
+ var nodeScaleRatio = seriesModel.option.nodeScaleRatio;
+ var groupScale = coordSys.scale;
+ var groupZoom = groupScale && groupScale[0] || 1; // Scale node when zoom changes
+
+ var roamZoom = coordSys.getZoom();
+ var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;
+ return nodeScale / groupZoom;
+}
+export function getSymbolSize(node) {
+ var symbolSize = node.getVisual('symbolSize');
+
+ if (symbolSize instanceof Array) {
+ symbolSize = (symbolSize[0] + symbolSize[1]) / 2;
+ }
+
+ return +symbolSize;
+}
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/chart/helper/Line.js b/public/en/builder/src/echarts/chart/helper/Line.js
index 437c806..1852a35 100644
--- a/public/en/builder/src/echarts/chart/helper/Line.js
+++ b/public/en/builder/src/echarts/chart/helper/Line.js
@@ -56,21 +56,20 @@ function createSymbol(name, lineData, idx) {
function createLine(points) {
var line = new LinePath({
- name: 'line'
+ name: 'line',
+ subPixelOptimize: true
});
setLinePoints(line.shape, points);
return line;
}
function setLinePoints(targetShape, points) {
- var p1 = points[0];
- var p2 = points[1];
- var cp1 = points[2];
- targetShape.x1 = p1[0];
- targetShape.y1 = p1[1];
- targetShape.x2 = p2[0];
- targetShape.y2 = p2[1];
+ targetShape.x1 = points[0][0];
+ targetShape.y1 = points[0][1];
+ targetShape.x2 = points[1][0];
+ targetShape.y2 = points[1][1];
targetShape.percent = 1;
+ var cp1 = points[2];
if (cp1) {
targetShape.cpx1 = cp1[0];
diff --git a/public/en/builder/src/echarts/chart/helper/LinePath.js b/public/en/builder/src/echarts/chart/helper/LinePath.js
index 8750832..42b9445 100644
--- a/public/en/builder/src/echarts/chart/helper/LinePath.js
+++ b/public/en/builder/src/echarts/chart/helper/LinePath.js
@@ -45,14 +45,19 @@ export default graphic.extendShape({
cpy1: null
},
buildPath: function (ctx, shape) {
- (isLine(shape) ? straightLineProto : bezierCurveProto).buildPath(ctx, shape);
+ this[isLine(shape) ? '_buildPathLine' : '_buildPathCurve'](ctx, shape);
},
+ _buildPathLine: straightLineProto.buildPath,
+ _buildPathCurve: bezierCurveProto.buildPath,
pointAt: function (t) {
- return isLine(this.shape) ? straightLineProto.pointAt.call(this, t) : bezierCurveProto.pointAt.call(this, t);
+ return this[isLine(this.shape) ? '_pointAtLine' : '_pointAtCurve'](t);
},
+ _pointAtLine: straightLineProto.pointAt,
+ _pointAtCurve: bezierCurveProto.pointAt,
tangentAt: function (t) {
var shape = this.shape;
- var p = isLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t);
+ var p = isLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : this._tangentAtCurve(t);
return vec2.normalize(p, p);
- }
+ },
+ _tangentAtCurve: bezierCurveProto.tangentAt
});
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/chart/helper/Symbol.js b/public/en/builder/src/echarts/chart/helper/Symbol.js
index e70f85c..5d49cd3 100644
--- a/public/en/builder/src/echarts/chart/helper/Symbol.js
+++ b/public/en/builder/src/echarts/chart/helper/Symbol.js
@@ -144,7 +144,7 @@ symbolProto.setZ = function (zlevel, z) {
symbolProto.setDraggable = function (draggable) {
var symbolPath = this.childAt(0);
symbolPath.draggable = draggable;
- symbolPath.cursor = draggable ? 'move' : 'pointer';
+ symbolPath.cursor = draggable ? 'move' : symbolPath.cursor;
};
/**
* Update symbol properties
@@ -294,51 +294,35 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) {
return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);
}
- symbolPath.off('mouseover').off('mouseout').off('emphasis').off('normal');
- symbolPath.hoverStyle = hoverItemStyle; // FIXME
- // Do not use symbol.trigger('emphasis'), but use symbol.highlight() instead.
-
- graphic.setHoverStyle(symbolPath);
symbolPath.__symbolOriginalScale = getScale(symbolSize);
-
- if (hoverAnimation && seriesModel.isAnimationEnabled()) {
- // Note: consider `off`, should use static function here.
- symbolPath.on('mouseover', onMouseOver).on('mouseout', onMouseOut).on('emphasis', onEmphasis).on('normal', onNormal);
- }
+ symbolPath.hoverStyle = hoverItemStyle;
+ symbolPath.highDownOnUpdate = hoverAnimation && seriesModel.isAnimationEnabled() ? highDownOnUpdate : null;
+ graphic.setHoverStyle(symbolPath);
};
-function onMouseOver() {
- // see comment in `graphic.isInEmphasis`
- !graphic.isInEmphasis(this) && onEmphasis.call(this);
-}
-
-function onMouseOut() {
- // see comment in `graphic.isInEmphasis`
- !graphic.isInEmphasis(this) && onNormal.call(this);
-}
-
-function onEmphasis() {
+function highDownOnUpdate(fromState, toState) {
// Do not support this hover animation util some scenario required.
// Animation can only be supported in hover layer when using `el.incremetal`.
if (this.incremental || this.useHoverLayer) {
return;
}
- var scale = this.__symbolOriginalScale;
- var ratio = scale[1] / scale[0];
- this.animateTo({
- scale: [Math.max(scale[0] * 1.1, scale[0] + 3), Math.max(scale[1] * 1.1, scale[1] + 3 * ratio)]
- }, 400, 'elasticOut');
-}
-
-function onNormal() {
- if (this.incremental || this.useHoverLayer) {
- return;
+ if (toState === 'emphasis') {
+ var scale = this.__symbolOriginalScale;
+ var ratio = scale[1] / scale[0];
+ var emphasisOpt = {
+ scale: [Math.max(scale[0] * 1.1, scale[0] + 3), Math.max(scale[1] * 1.1, scale[1] + 3 * ratio)]
+ }; // FIXME
+ // modify it after support stop specified animation.
+ // toState === fromState
+ // ? (this.stopAnimation(), this.attr(emphasisOpt))
+
+ this.animateTo(emphasisOpt, 400, 'elasticOut');
+ } else if (toState === 'normal') {
+ this.animateTo({
+ scale: this.__symbolOriginalScale
+ }, 400, 'elasticOut');
}
-
- this.animateTo({
- scale: this.__symbolOriginalScale
- }, 400, 'elasticOut');
}
/**
* @param {Function} cb
diff --git a/public/en/builder/src/echarts/chart/pie/PieSeries.js b/public/en/builder/src/echarts/chart/pie/PieSeries.js
index 8c741ad..a54c80e 100644
--- a/public/en/builder/src/echarts/chart/pie/PieSeries.js
+++ b/public/en/builder/src/echarts/chart/pie/PieSeries.js
@@ -96,6 +96,9 @@ var PieSeries = echarts.extendSeriesModel({
startAngle: 90,
// 最小角度改为0
minAngle: 0,
+ // If the angle of a sector less than `minShowLabelAngle`,
+ // the label will not be displayed.
+ minShowLabelAngle: 0,
// 选中时扇区偏移量
selectedOffset: 10,
// 高亮扇区偏移量
diff --git a/public/en/builder/src/echarts/chart/pie/PieView.js b/public/en/builder/src/echarts/chart/pie/PieView.js
index cfb3742..f2b9afb 100644
--- a/public/en/builder/src/echarts/chart/pie/PieView.js
+++ b/public/en/builder/src/echarts/chart/pie/PieView.js
@@ -78,25 +78,15 @@ function PiePiece(data, idx) {
this.add(sector);
this.add(polyline);
this.add(text);
- this.updateData(data, idx, true); // Hover to change label and labelLine
-
- function onEmphasis() {
- polyline.ignore = polyline.hoverIgnore;
- text.ignore = text.hoverIgnore;
- }
-
- function onNormal() {
- polyline.ignore = polyline.normalIgnore;
- text.ignore = text.normalIgnore;
- }
-
- this.on('emphasis', onEmphasis).on('normal', onNormal).on('mouseover', onEmphasis).on('mouseout', onNormal);
+ this.updateData(data, idx, true);
}
var piePieceProto = PiePiece.prototype;
piePieceProto.updateData = function (data, idx, firstCreate) {
var sector = this.childAt(0);
+ var labelLine = this.childAt(1);
+ var labelText = this.childAt(2);
var seriesModel = data.hostModel;
var itemModel = data.getItemModel(idx);
var layout = data.getItemLayout(idx);
@@ -141,34 +131,31 @@ piePieceProto.updateData = function (data, idx, firstCreate) {
toggleItemSelected(this, data.getItemLayout(idx), seriesModel.isSelected(null, idx), seriesModel.get('selectedOffset'), seriesModel.get('animation'));
- function onEmphasis() {
- // Sector may has animation of updating data. Force to move to the last frame
- // Or it may stopped on the wrong shape
- sector.stopAnimation(true);
- sector.animateTo({
- shape: {
- r: layout.r + seriesModel.get('hoverOffset')
- }
- }, 300, 'elasticOut');
- }
-
- function onNormal() {
- sector.stopAnimation(true);
- sector.animateTo({
- shape: {
- r: layout.r
- }
- }, 300, 'elasticOut');
- }
-
- sector.off('mouseover').off('mouseout').off('emphasis').off('normal');
-
- if (itemModel.get('hoverAnimation') && seriesModel.isAnimationEnabled()) {
- sector.on('mouseover', onEmphasis).on('mouseout', onNormal).on('emphasis', onEmphasis).on('normal', onNormal);
- }
-
this._updateLabel(data, idx);
+ this.highDownOnUpdate = itemModel.get('hoverAnimation') && seriesModel.isAnimationEnabled() ? function (fromState, toState) {
+ if (toState === 'emphasis') {
+ labelLine.ignore = labelLine.hoverIgnore;
+ labelText.ignore = labelText.hoverIgnore; // Sector may has animation of updating data. Force to move to the last frame
+ // Or it may stopped on the wrong shape
+
+ sector.stopAnimation(true);
+ sector.animateTo({
+ shape: {
+ r: layout.r + seriesModel.get('hoverOffset')
+ }
+ }, 300, 'elasticOut');
+ } else {
+ labelLine.ignore = labelLine.normalIgnore;
+ labelText.ignore = labelText.normalIgnore;
+ sector.stopAnimation(true);
+ sector.animateTo({
+ shape: {
+ r: layout.r
+ }
+ }, 300, 'elasticOut');
+ }
+ } : null;
graphic.setHoverStyle(this);
};
@@ -180,6 +167,12 @@ piePieceProto._updateLabel = function (data, idx) {
var layout = data.getItemLayout(idx);
var labelLayout = layout.label;
var visualColor = data.getItemVisual(idx, 'color');
+
+ if (!labelLayout || isNaN(labelLayout.x) || isNaN(labelLayout.y)) {
+ labelText.ignore = labelText.normalIgnore = labelText.hoverIgnore = labelLine.ignore = labelLine.normalIgnore = labelLine.hoverIgnore = true;
+ return;
+ }
+
graphic.updateProps(labelLine, {
shape: {
points: labelLayout.linePoints || [[labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y]]
@@ -282,6 +275,11 @@ var PieView = ChartView.extend({
if (hasAnimation && isFirstRender && data.count() > 0 // Default expansion animation
&& animationType !== 'scale') {
var shape = data.getItemLayout(0);
+
+ for (var s = 1; isNaN(shape.startAngle) && s < data.count(); ++s) {
+ shape = data.getItemLayout(s);
+ }
+
var r = Math.max(api.getWidth(), api.getHeight()) / 2;
var removeClipPath = zrUtil.bind(group.removeClipPath, group);
group.setClipPath(this._createClipPath(shape.cx, shape.cy, r, shape.startAngle, shape.clockwise, removeClipPath, seriesModel));
diff --git a/public/en/builder/src/echarts/chart/pie/labelLayout.js b/public/en/builder/src/echarts/chart/pie/labelLayout.js
index d6e9adc..02f64d6 100644
--- a/public/en/builder/src/echarts/chart/pie/labelLayout.js
+++ b/public/en/builder/src/echarts/chart/pie/labelLayout.js
@@ -18,6 +18,7 @@
*/
// FIXME emphasis label position is not same with normal label position
import * as textContain from 'zrender/src/contain/text';
+var RADIAN = Math.PI / 180;
function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) {
list.sort(function (a, b) {
@@ -154,12 +155,13 @@ function isPositionCenter(layout) {
return layout.position === 'center';
}
-export default function (seriesModel, r, viewWidth, viewHeight) {
+export default function (seriesModel, r, viewWidth, viewHeight, sum) {
var data = seriesModel.getData();
var labelLayoutList = [];
var cx;
var cy;
var hasLabelRotate = false;
+ var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;
data.each(function (idx) {
var layout = data.getItemLayout(idx);
var itemModel = data.getItemModel(idx);
@@ -169,6 +171,11 @@ export default function (seriesModel, r, viewWidth, viewHeight) {
var labelLineModel = itemModel.getModel('labelLine');
var labelLineLen = labelLineModel.get('length');
var labelLineLen2 = labelLineModel.get('length2');
+
+ if (layout.angle < minShowLabelRadian) {
+ return;
+ }
+
var midAngle = (layout.startAngle + layout.endAngle) / 2;
var dx = Math.cos(midAngle);
var dy = Math.sin(midAngle);
@@ -205,7 +212,15 @@ export default function (seriesModel, r, viewWidth, viewHeight) {
}
var font = labelModel.getFont();
- var labelRotate = labelModel.get('rotate') ? dx < 0 ? -midAngle + Math.PI : -midAngle : 0;
+ var labelRotate;
+ var rotate = labelModel.get('rotate');
+
+ if (typeof rotate === 'number') {
+ labelRotate = rotate * (Math.PI / 180);
+ } else {
+ labelRotate = rotate ? dx < 0 ? -midAngle + Math.PI : -midAngle : 0;
+ }
+
var text = seriesModel.getFormattedLabel(idx, 'normal') || data.getName(idx);
var textRect = textContain.getBoundingRect(text, font, textAlign, 'top');
hasLabelRotate = !!labelRotate;
diff --git a/public/en/builder/src/echarts/chart/radar/RadarView.js b/public/en/builder/src/echarts/chart/radar/RadarView.js
index b60c130..9c02b66 100644
--- a/public/en/builder/src/echarts/chart/radar/RadarView.js
+++ b/public/en/builder/src/echarts/chart/radar/RadarView.js
@@ -164,26 +164,22 @@ export default echarts.extendChartView({
symbolGroup.eachChild(function (symbolPath) {
symbolPath.setStyle(itemStyle);
symbolPath.hoverStyle = zrUtil.clone(itemHoverStyle);
+ var defaultText = data.get(data.dimensions[symbolPath.__dimIdx], idx);
+ (defaultText == null || isNaN(defaultText)) && (defaultText = '');
graphic.setLabelStyle(symbolPath.style, symbolPath.hoverStyle, labelModel, labelHoverModel, {
labelFetcher: data.hostModel,
labelDataIndex: idx,
labelDimIndex: symbolPath.__dimIdx,
- defaultText: data.get(data.dimensions[symbolPath.__dimIdx], idx),
+ defaultText: defaultText,
autoColor: color,
isRectText: true
});
});
- function onEmphasis() {
- polygon.attr('ignore', hoverPolygonIgnore);
- }
-
- function onNormal() {
- polygon.attr('ignore', polygonIgnore);
- }
+ itemGroup.highDownOnUpdate = function (fromState, toState) {
+ polygon.attr('ignore', toState === 'emphasis' ? hoverPolygonIgnore : polygonIgnore);
+ };
- itemGroup.off('mouseover').off('mouseout').off('normal').off('emphasis');
- itemGroup.on('emphasis', onEmphasis).on('mouseover', onEmphasis).on('normal', onNormal).on('mouseout', onNormal);
graphic.setHoverStyle(itemGroup);
});
this._data = data;
diff --git a/public/en/builder/src/echarts/chart/radar/radarLayout.js b/public/en/builder/src/echarts/chart/radar/radarLayout.js
index 9665875..de8be05 100644
--- a/public/en/builder/src/echarts/chart/radar/radarLayout.js
+++ b/public/en/builder/src/echarts/chart/radar/radarLayout.js
@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+import * as zrUtil from 'zrender/src/core/util';
export default function (ecModel) {
ecModel.eachSeriesByType('radar', function (seriesModel) {
var data = seriesModel.getData();
@@ -26,21 +27,35 @@ export default function (ecModel) {
return;
}
- function pointsConverter(val, idx) {
- points[idx] = points[idx] || [];
- points[idx][i] = coordSys.dataToPoint(val, i);
- }
-
var axes = coordSys.getIndicatorAxes();
-
- for (var i = 0; i < axes.length; i++) {
- data.each(data.mapDimension(axes[i].dim), pointsConverter);
- }
+ zrUtil.each(axes, function (axis, axisIndex) {
+ data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) {
+ points[dataIndex] = points[dataIndex] || [];
+ var point = coordSys.dataToPoint(val, axisIndex);
+ points[dataIndex][axisIndex] = isValidPoint(point) ? point : getValueMissingPoint(coordSys);
+ });
+ }); // Close polygon
data.each(function (idx) {
- // Close polygon
- points[idx][0] && points[idx].push(points[idx][0].slice());
+ // TODO
+ // Is it appropriate to connect to the next data when some data is missing?
+ // Or, should trade it like `connectNull` in line chart?
+ var firstPoint = zrUtil.find(points[idx], function (point) {
+ return isValidPoint(point);
+ }) || getValueMissingPoint(coordSys); // Copy the first actual point to the end of the array
+
+ points[idx].push(firstPoint.slice());
data.setItemLayout(idx, points[idx]);
});
});
+}
+
+function isValidPoint(point) {
+ return !isNaN(point[0]) && !isNaN(point[1]);
+}
+
+function getValueMissingPoint(coordSys) {
+ // It is error-prone to input [NaN, NaN] into polygon, polygon.
+ // (probably cause problem when refreshing or animating)
+ return [coordSys.cx, coordSys.cy];
}
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/chart/sankey/SankeySeries.js b/public/en/builder/src/echarts/chart/sankey/SankeySeries.js
index b640528..890c80c 100644
--- a/public/en/builder/src/echarts/chart/sankey/SankeySeries.js
+++ b/public/en/builder/src/echarts/chart/sankey/SankeySeries.js
@@ -24,9 +24,12 @@
import SeriesModel from '../../model/Series';
import createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge';
import { encodeHTML } from '../../util/format';
+import Model from '../../model/Model';
+import { __DEV__ } from '../../config';
var SankeySeries = SeriesModel.extend({
type: 'series.sankey',
layoutInfo: null,
+ levelModels: null,
/**
* Init a graph data structure from data in option series
@@ -34,14 +37,44 @@ var SankeySeries = SeriesModel.extend({
* @param {Object} option the object used to config echarts view
* @return {module:echarts/data/List} storage initial data
*/
- getInitialData: function (option) {
+ getInitialData: function (option, ecModel) {
var links = option.edges || option.links;
var nodes = option.data || option.nodes;
+ var levels = option.levels;
+ var levelModels = this.levelModels = {};
+
+ for (var i = 0; i < levels.length; i++) {
+ if (levels[i].depth != null && levels[i].depth >= 0) {
+ levelModels[levels[i].depth] = new Model(levels[i], this, ecModel);
+ } else {}
+ }
if (nodes && links) {
- var graph = createGraphFromNodeEdge(nodes, links, this, true);
+ var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink);
return graph.data;
}
+
+ function beforeLink(nodeData, edgeData) {
+ nodeData.wrapMethod('getItemModel', function (model, idx) {
+ model.customizeGetParent(function (path) {
+ var parentModel = this.parentModel;
+ var nodeDepth = parentModel.getData().getItemLayout(idx).depth;
+ var levelModel = parentModel.levelModels[nodeDepth];
+ return levelModel || this.parentModel;
+ });
+ return model;
+ });
+ edgeData.wrapMethod('getItemModel', function (model, idx) {
+ model.customizeGetParent(function (path) {
+ var parentModel = this.parentModel;
+ var edge = parentModel.getGraph().getEdgeByIndex(idx);
+ var depth = edge.node1.getLayout().depth;
+ var levelModel = parentModel.levelModels[depth];
+ return levelModel || this.parentModel;
+ });
+ return model;
+ });
+ }
},
setNodePosition: function (dataIndex, localPosition) {
var dataItem = this.option.data[dataIndex];
@@ -82,6 +115,16 @@ var SankeySeries = SeriesModel.extend({
}
return encodeHTML(html);
+ } else if (dataType === 'node') {
+ var node = this.getGraph().getNodeByIndex(dataIndex);
+ var value = node.getLayout().value;
+ var name = this.getDataParams(dataIndex, dataType).data.name;
+
+ if (value) {
+ var html = name + ' : ' + value;
+ }
+
+ return encodeHTML(html);
}
return SankeySeries.superCall(this, 'formatTooltip', dataIndex, multipleSeries);
@@ -121,6 +164,9 @@ var SankeySeries = SeriesModel.extend({
color: '#000',
fontSize: 12
},
+ levels: [],
+ // Value can be 'left' or 'right'
+ nodeAlign: 'justify',
itemStyle: {
borderWidth: 1,
borderColor: '#333'
diff --git a/public/en/builder/src/echarts/chart/sankey/SankeyView.js b/public/en/builder/src/echarts/chart/sankey/SankeyView.js
index e4cee73..a782499 100644
--- a/public/en/builder/src/echarts/chart/sankey/SankeyView.js
+++ b/public/en/builder/src/echarts/chart/sankey/SankeyView.js
@@ -18,7 +18,7 @@
*/
/**
- * @file The file used to draw sankey view
+ * @file The file used to draw sankey diagram.
* @author Deqing Li(annong035@gmail.com)
*/
import * as graphic from '../../util/graphic';
@@ -74,16 +74,13 @@ var SankeyShape = graphic.extendShape({
},
buildPath: function (ctx, shape) {
var extent = shape.extent;
- var orient = shape.orient;
+ ctx.moveTo(shape.x1, shape.y1);
+ ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);
- if (orient === 'vertical') {
- ctx.moveTo(shape.x1, shape.y1);
- ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);
+ if (shape.orient === 'vertical') {
ctx.lineTo(shape.x2 + extent, shape.y2);
ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1);
} else {
- ctx.moveTo(shape.x1, shape.y1);
- ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);
ctx.lineTo(shape.x2, shape.y2 + extent);
ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent);
}
diff --git a/public/en/builder/src/echarts/chart/sankey/sankeyLayout.js b/public/en/builder/src/echarts/chart/sankey/sankeyLayout.js
index b4ac602..a8bbde9 100644
--- a/public/en/builder/src/echarts/chart/sankey/sankeyLayout.js
+++ b/public/en/builder/src/echarts/chart/sankey/sankeyLayout.js
@@ -18,13 +18,12 @@
*/
/**
- * @file The layout algorithm of sankey view
+ * @file The layout algorithm of sankey diagram.
* @author Deqing Li(annong035@gmail.com)
*/
import * as layout from '../../util/layout';
import * as zrUtil from 'zrender/src/core/util';
import { groupData } from '../../util/model';
-import { __DEV__ } from '../../config';
export default function (ecModel, api, payload) {
ecModel.eachSeriesByType('sankey', function (seriesModel) {
var nodeWidth = seriesModel.get('nodeWidth');
@@ -42,7 +41,8 @@ export default function (ecModel, api, payload) {
});
var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations');
var orient = seriesModel.get('orient');
- layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient);
+ var nodeAlign = seriesModel.get('nodeAlign');
+ layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign);
});
}
/**
@@ -60,8 +60,8 @@ function getViewRect(seriesModel, api) {
});
}
-function layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient) {
- computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient);
+function layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) {
+ computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign);
computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient);
computeEdgeDepths(nodes, orient);
}
@@ -94,7 +94,7 @@ function computeNodeValues(nodes) {
*/
-function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient) {
+function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {
// Used to mark whether the edge is deleted. if it is deleted,
// the value is 0, otherwise it is 1.
var remainEdges = []; // Storage each node's indegree.
@@ -102,7 +102,7 @@ function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient) {
var indegreeArr = []; //Used to storage the node with indegree is equal to 0.
var zeroIndegrees = [];
- var nextNode = [];
+ var nextTargetNode = [];
var x = 0;
var kx = 0;
@@ -118,78 +118,121 @@ function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient) {
}
}
+ var maxNodeDepth = -1; // Traversing nodes using topological sorting to calculate the
+ // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical')
+ // position of the nodes.
+
while (zeroIndegrees.length) {
for (var idx = 0; idx < zeroIndegrees.length; idx++) {
var node = zeroIndegrees[idx];
+ var item = node.hostGraph.data.getRawDataItem(node.dataIndex);
+ var isItemDepth = item.depth != null && item.depth >= 0;
- if (orient === 'vertical') {
- node.setLayout({
- y: x
- }, true);
- node.setLayout({
- dy: nodeWidth
- }, true);
- } else {
- node.setLayout({
- x: x
- }, true);
- node.setLayout({
- dx: nodeWidth
- }, true);
+ if (isItemDepth && item.depth > maxNodeDepth) {
+ maxNodeDepth = item.depth;
}
- for (var oidx = 0; oidx < node.outEdges.length; oidx++) {
- var edge = node.outEdges[oidx];
+ node.setLayout({
+ depth: isItemDepth ? item.depth : x
+ }, true);
+ orient === 'vertical' ? node.setLayout({
+ dy: nodeWidth
+ }, true) : node.setLayout({
+ dx: nodeWidth
+ }, true);
+
+ for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {
+ var edge = node.outEdges[edgeIdx];
var indexEdge = edges.indexOf(edge);
remainEdges[indexEdge] = 0;
var targetNode = edge.node2;
var nodeIndex = nodes.indexOf(targetNode);
- if (--indegreeArr[nodeIndex] === 0) {
- nextNode.push(targetNode);
+ if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {
+ nextTargetNode.push(targetNode);
}
}
}
++x;
- zeroIndegrees = nextNode;
- nextNode = [];
+ zeroIndegrees = nextTargetNode;
+ nextTargetNode = [];
}
- for (i = 0; i < remainEdges.length; i++) {}
+ for (i = 0; i < remainEdges.length; i++) {
+ if (remainEdges[i] === 1) {
+ throw new Error('Sankey is a DAG, the original data has cycle!');
+ }
+ }
- moveSinksRight(nodes, x, orient);
+ var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1;
- if (orient === 'vertical') {
- kx = (height - nodeWidth) / (x - 1);
- } else {
- kx = (width - nodeWidth) / (x - 1);
+ if (nodeAlign && nodeAlign !== 'left') {
+ adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);
}
+ var kx = orient === 'vertical' ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth;
scaleNodeBreadths(nodes, kx, orient);
}
+
+function isNodeDepth(node) {
+ var item = node.hostGraph.data.getRawDataItem(node.dataIndex);
+ return item.depth != null && item.depth >= 0;
+}
+
+function adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) {
+ if (nodeAlign === 'right') {
+ var nextSourceNode = [];
+ var remainNodes = nodes;
+ var nodeHeight = 0;
+
+ while (remainNodes.length) {
+ for (var i = 0; i < remainNodes.length; i++) {
+ var node = remainNodes[i];
+ node.setLayout({
+ skNodeHeight: nodeHeight
+ }, true);
+
+ for (var j = 0; j < node.inEdges.length; j++) {
+ var edge = node.inEdges[j];
+
+ if (nextSourceNode.indexOf(edge.node1) < 0) {
+ nextSourceNode.push(edge.node1);
+ }
+ }
+ }
+
+ remainNodes = nextSourceNode;
+ nextSourceNode = [];
+ ++nodeHeight;
+ }
+
+ zrUtil.each(nodes, function (node) {
+ if (!isNodeDepth(node)) {
+ node.setLayout({
+ depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight)
+ }, true);
+ }
+ });
+ } else if (nodeAlign === 'justify') {
+ moveSinksRight(nodes, maxDepth);
+ }
+}
/**
* All the node without outEgdes are assigned maximum x-position and
* be aligned in the last column.
*
- * @param {module:echarts/data/Graph~Node} nodes node of sankey view
- * @param {number} x value (x-1) use to assign to node without outEdges
- * as x-position
+ * @param {module:echarts/data/Graph~Node} nodes. node of sankey view.
+ * @param {number} maxDepth. use to assign to node without outEdges as x-position.
*/
-function moveSinksRight(nodes, x, orient) {
+function moveSinksRight(nodes, maxDepth) {
zrUtil.each(nodes, function (node) {
- if (!node.outEdges.length) {
- if (orient === 'vertical') {
- node.setLayout({
- y: x - 1
- }, true);
- } else {
- node.setLayout({
- x: x - 1
- }, true);
- }
+ if (!isNodeDepth(node) && !node.outEdges.length) {
+ node.setLayout({
+ depth: maxDepth
+ }, true);
}
});
}
@@ -203,17 +246,12 @@ function moveSinksRight(nodes, x, orient) {
function scaleNodeBreadths(nodes, kx, orient) {
zrUtil.each(nodes, function (node) {
- if (orient === 'vertical') {
- var nodeY = node.getLayout().y * kx;
- node.setLayout({
- y: nodeY
- }, true);
- } else {
- var nodeX = node.getLayout().x * kx;
- node.setLayout({
- x: nodeX
- }, true);
- }
+ var nodeDepth = node.getLayout().depth * kx;
+ orient === 'vertical' ? node.setLayout({
+ y: nodeDepth
+ }, true) : node.setLayout({
+ x: nodeDepth
+ }, true);
});
}
/**
@@ -230,7 +268,7 @@ function scaleNodeBreadths(nodes, kx, orient) {
function computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) {
var nodesByBreadth = prepareNodesByBreadth(nodes, orient);
- initializeNodeDepth(nodes, nodesByBreadth, edges, height, width, nodeGap, orient);
+ initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient);
resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);
for (var alpha = 1; iterations > 0; iterations--) {
@@ -270,31 +308,23 @@ function prepareNodesByBreadth(nodes, orient) {
*/
-function initializeNodeDepth(nodes, nodesByBreadth, edges, height, width, nodeGap, orient) {
- var kyArray = [];
+function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {
+ var minKy = Infinity;
zrUtil.each(nodesByBreadth, function (nodes) {
var n = nodes.length;
var sum = 0;
- var ky = 0;
zrUtil.each(nodes, function (node) {
sum += node.getLayout().value;
});
+ var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum;
- if (orient === 'vertical') {
- ky = (width - (n - 1) * nodeGap) / sum;
- } else {
- ky = (height - (n - 1) * nodeGap) / sum;
+ if (ky < minKy) {
+ minKy = ky;
}
-
- kyArray.push(ky);
});
- kyArray.sort(function (a, b) {
- return a - b;
- });
- var ky0 = kyArray[0];
zrUtil.each(nodesByBreadth, function (nodes) {
zrUtil.each(nodes, function (node, i) {
- var nodeDy = node.getLayout().value * ky0;
+ var nodeDy = node.getLayout().value * minKy;
if (orient === 'vertical') {
node.setLayout({
@@ -314,7 +344,7 @@ function initializeNodeDepth(nodes, nodesByBreadth, edges, height, width, nodeGa
});
});
zrUtil.each(edges, function (edge) {
- var edgeDy = +edge.getValue() * ky0;
+ var edgeDy = +edge.getValue() * minKy;
edge.setLayout({
dy: edgeDy
}, true);
@@ -331,100 +361,61 @@ function initializeNodeDepth(nodes, nodesByBreadth, edges, height, width, nodeGa
function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {
+ var keyAttr = orient === 'vertical' ? 'x' : 'y';
zrUtil.each(nodesByBreadth, function (nodes) {
+ nodes.sort(function (a, b) {
+ return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];
+ });
+ var nodeX;
var node;
var dy;
var y0 = 0;
var n = nodes.length;
- var i;
+ var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';
- if (orient === 'vertical') {
- var nodeX;
- nodes.sort(function (a, b) {
- return a.getLayout().x - b.getLayout().x;
- });
-
- for (i = 0; i < n; i++) {
- node = nodes[i];
- dy = y0 - node.getLayout().x;
-
- if (dy > 0) {
- nodeX = node.getLayout().x + dy;
- node.setLayout({
- x: nodeX
- }, true);
- }
-
- y0 = node.getLayout().x + node.getLayout().dx + nodeGap;
- } // If the bottommost node goes outside the bounds, push it back up
-
-
- dy = y0 - nodeGap - width;
+ for (var i = 0; i < n; i++) {
+ node = nodes[i];
+ dy = y0 - node.getLayout()[keyAttr];
if (dy > 0) {
- nodeX = node.getLayout().x - dy;
- node.setLayout({
+ nodeX = node.getLayout()[keyAttr] + dy;
+ orient === 'vertical' ? node.setLayout({
x: nodeX
+ }, true) : node.setLayout({
+ y: nodeX
}, true);
- y0 = nodeX;
+ }
- for (i = n - 2; i >= 0; --i) {
- node = nodes[i];
- dy = node.getLayout().x + node.getLayout().dx + nodeGap - y0;
+ y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;
+ }
- if (dy > 0) {
- nodeX = node.getLayout().x - dy;
- node.setLayout({
- x: nodeX
- }, true);
- }
+ var viewWidth = orient === 'vertical' ? width : height; // If the bottommost node goes outside the bounds, push it back up
- y0 = node.getLayout().x;
- }
- }
- } else {
- var nodeY;
- nodes.sort(function (a, b) {
- return a.getLayout().y - b.getLayout().y;
- });
+ dy = y0 - nodeGap - viewWidth;
+
+ if (dy > 0) {
+ nodeX = node.getLayout()[keyAttr] - dy;
+ orient === 'vertical' ? node.setLayout({
+ x: nodeX
+ }, true) : node.setLayout({
+ y: nodeX
+ }, true);
+ y0 = nodeX;
- for (i = 0; i < n; i++) {
+ for (i = n - 2; i >= 0; --i) {
node = nodes[i];
- dy = y0 - node.getLayout().y;
+ dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;
if (dy > 0) {
- nodeY = node.getLayout().y + dy;
- node.setLayout({
- y: nodeY
+ nodeX = node.getLayout()[keyAttr] - dy;
+ orient === 'vertical' ? node.setLayout({
+ x: nodeX
+ }, true) : node.setLayout({
+ y: nodeX
}, true);
}
- y0 = node.getLayout().y + node.getLayout().dy + nodeGap;
- } // If the bottommost node goes outside the bounds, push it back up
-
-
- dy = y0 - nodeGap - height;
-
- if (dy > 0) {
- nodeY = node.getLayout().y - dy;
- node.setLayout({
- y: nodeY
- }, true);
- y0 = nodeY;
-
- for (i = n - 2; i >= 0; --i) {
- node = nodes[i];
- dy = node.getLayout().y + node.getLayout().dy + nodeGap - y0;
-
- if (dy > 0) {
- nodeY = node.getLayout().y - dy;
- node.setLayout({
- y: nodeY
- }, true);
- }
-
- y0 = node.getLayout().y;
- }
+ y0 = node.getLayout()[keyAttr];
}
}
});
@@ -469,11 +460,7 @@ function weightedSource(edge, orient) {
}
function center(node, orient) {
- if (orient === 'vertical') {
- return node.getLayout().x + node.getLayout().dx / 2;
- }
-
- return node.getLayout().y + node.getLayout().dy / 2;
+ return orient === 'vertical' ? node.getLayout().x + node.getLayout().dx / 2 : node.getLayout().y + node.getLayout().dy / 2;
}
function getEdgeValue(edge) {
@@ -533,22 +520,14 @@ function relaxLeftToRight(nodesByBreadth, alpha, orient) {
function computeEdgeDepths(nodes, orient) {
+ var keyAttr = orient === 'vertical' ? 'x' : 'y';
zrUtil.each(nodes, function (node) {
- if (orient === 'vertical') {
- node.outEdges.sort(function (a, b) {
- return a.node2.getLayout().x - b.node2.getLayout().x;
- });
- node.inEdges.sort(function (a, b) {
- return a.node1.getLayout().x - b.node1.getLayout().x;
- });
- } else {
- node.outEdges.sort(function (a, b) {
- return a.node2.getLayout().y - b.node2.getLayout().y;
- });
- node.inEdges.sort(function (a, b) {
- return a.node1.getLayout().y - b.node1.getLayout().y;
- });
- }
+ node.outEdges.sort(function (a, b) {
+ return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];
+ });
+ node.inEdges.sort(function (a, b) {
+ return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr];
+ });
});
zrUtil.each(nodes, function (node) {
var sy = 0;
diff --git a/public/en/builder/src/echarts/chart/sankey/sankeyVisual.js b/public/en/builder/src/echarts/chart/sankey/sankeyVisual.js
index 0a407fc..8bb4ccf 100644
--- a/public/en/builder/src/echarts/chart/sankey/sankeyVisual.js
+++ b/public/en/builder/src/echarts/chart/sankey/sankeyVisual.js
@@ -50,14 +50,8 @@ export default function (ecModel, payload) {
visual: seriesModel.get('color')
});
var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);
- node.setVisual('color', mapValueToColor); // If set itemStyle.normal.color
-
- var itemModel = node.getModel();
- var customColor = itemModel.get('itemStyle.color');
-
- if (customColor != null) {
- node.setVisual('color', customColor);
- }
+ var customColor = node.getModel().get('itemStyle.color');
+ customColor != null ? node.setVisual('color', customColor) : node.setVisual('color', mapValueToColor);
});
}
});
diff --git a/public/en/builder/src/echarts/chart/sunburst/SunburstPiece.js b/public/en/builder/src/echarts/chart/sunburst/SunburstPiece.js
index 4d7df30..5f0942b 100644
--- a/public/en/builder/src/echarts/chart/sunburst/SunburstPiece.js
+++ b/public/en/builder/src/echarts/chart/sunburst/SunburstPiece.js
@@ -165,7 +165,7 @@ SunburstPieceProto._updateLabel = function (seriesModel, visualColor, state) {
var normalModel = itemModel.getModel('label');
var labelModel = state === 'normal' || state === 'emphasis' ? normalModel : itemModel.getModel(state + '.label');
var labelHoverModel = itemModel.getModel('emphasis.label');
- var text = zrUtil.retrieve(seriesModel.getFormattedLabel(this.node.dataIndex, 'normal', null, null, 'label'), this.node.name);
+ var text = zrUtil.retrieve(seriesModel.getFormattedLabel(this.node.dataIndex, state, null, null, 'label'), this.node.name);
if (getLabelAttr('show') === false) {
text = '';
diff --git a/public/en/builder/src/echarts/chart/themeRiver/ThemeRiverSeries.js b/public/en/builder/src/echarts/chart/themeRiver/ThemeRiverSeries.js
index 11749d5..2dd16a5 100644
--- a/public/en/builder/src/echarts/chart/themeRiver/ThemeRiverSeries.js
+++ b/public/en/builder/src/echarts/chart/themeRiver/ThemeRiverSeries.js
@@ -209,8 +209,7 @@ var ThemeRiverSeries = SeriesModel.extend({
/**
* Get data indices for show tooltip content
- *
- * @param {Array.<string>|string} dim single coordinate dimension
+ * @param {Array.<string>|string} dim single coordinate dimension
* @param {number} value axis value
* @param {module:echarts/coord/single/SingleAxis} baseAxis single Axis used
* the themeRiver.
diff --git a/public/en/builder/src/echarts/chart/treemap/TreemapSeries.js b/public/en/builder/src/echarts/chart/treemap/TreemapSeries.js
index 208ed89..7cc6006 100644
--- a/public/en/builder/src/echarts/chart/treemap/TreemapSeries.js
+++ b/public/en/builder/src/echarts/chart/treemap/TreemapSeries.js
@@ -26,6 +26,7 @@ export default SeriesModel.extend({
type: 'series.treemap',
layoutMode: 'box',
dependencies: ['grid', 'polar'],
+ preventUsingHoverLayer: true,
/**
* @type {module:echarts/data/Tree~Node}
@@ -34,7 +35,6 @@ export default SeriesModel.extend({
defaultOption: {
// Disable progressive rendering
progressive: 0,
- hoverLayerThreshold: Infinity,
// center: ['50%', '50%'], // not supported in ec3.
// size: ['80%', '80%'], // deprecated, compatible with ec2.
left: 'center',
diff --git a/public/en/builder/src/echarts/component/axis/AngleAxisView.js b/public/en/builder/src/echarts/component/axis/AngleAxisView.js
index fde1574..45386f5 100644
--- a/public/en/builder/src/echarts/component/axis/AngleAxisView.js
+++ b/public/en/builder/src/echarts/component/axis/AngleAxisView.js
@@ -20,6 +20,7 @@ import * as zrUtil from 'zrender/src/core/util';
import * as graphic from '../../util/graphic';
import Model from '../../model/Model';
import AxisView from './AxisView';
+import AxisBuilder from './AxisBuilder';
var elementList = ['axisLine', 'axisLabel', 'axisTick', 'splitLine', 'splitArea'];
function getAxisLineShape(polar, rExtent, angle) {
@@ -121,7 +122,8 @@ export default AxisView.extend({
_axisLabel: function (angleAxisModel, polar, ticksAngles, radiusExtent, labels) {
var rawCategoryData = angleAxisModel.getCategories(true);
var commonLabelModel = angleAxisModel.getModel('axisLabel');
- var labelMargin = commonLabelModel.get('margin'); // Use length of ticksAngles because it may remove the last tick to avoid overlapping
+ var labelMargin = commonLabelModel.get('margin');
+ var triggerEvent = angleAxisModel.get('triggerEvent'); // Use length of ticksAngles because it may remove the last tick to avoid overlapping
zrUtil.each(labels, function (labelItem, idx) {
var labelModel = commonLabelModel;
@@ -138,7 +140,7 @@ export default AxisView.extend({
}
var textEl = new graphic.Text({
- silent: true
+ silent: AxisBuilder.isLabelSilent(angleAxisModel)
});
this.group.add(textEl);
graphic.setTextStyle(textEl.style, labelModel, {
@@ -148,7 +150,13 @@ export default AxisView.extend({
text: labelItem.formattedLabel,
textAlign: labelTextAlign,
textVerticalAlign: labelTextVerticalAlign
- });
+ }); // Pack data for mouse event
+
+ if (triggerEvent) {
+ textEl.eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel);
+ textEl.eventData.targetType = 'axisLabel';
+ textEl.eventData.value = labelItem.rawLabel;
+ }
}, this);
},
diff --git a/public/en/builder/src/echarts/component/axis/AxisBuilder.js b/public/en/builder/src/echarts/component/axis/AxisBuilder.js
index 03ee3d3..e57696d 100644
--- a/public/en/builder/src/echarts/component/axis/AxisBuilder.js
+++ b/public/en/builder/src/echarts/component/axis/AxisBuilder.js
@@ -26,15 +26,6 @@ import * as matrixUtil from 'zrender/src/core/matrix';
import { applyTransform as v2ApplyTransform } from 'zrender/src/core/vector';
import { shouldShowAllLabels } from '../../coord/axisHelper';
var PI = Math.PI;
-
-function makeAxisEventDataBase(axisModel) {
- var eventData = {
- componentType: axisModel.mainType,
- componentIndex: axisModel.componentIndex
- };
- eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;
- return eventData;
-}
/**
* A final axis is translated and rotated from a "standard axis".
* So opt.position and opt.rotation is required.
@@ -74,7 +65,6 @@ function makeAxisEventDataBase(axisModel) {
* @param {number} [opt.nameTruncateMaxWidth]
*/
-
var AxisBuilder = function (axisModel, opt) {
/**
* @readOnly
@@ -147,9 +137,10 @@ var builders = {
var lineStyle = extend({
lineCap: 'round'
}, axisModel.getModel('axisLine.lineStyle').getLineStyle());
- this.group.add(new graphic.Line(graphic.subPixelOptimizeLine({
+ this.group.add(new graphic.Line({
// Id for animation
anid: 'line',
+ subPixelOptimize: true,
shape: {
x1: pt1[0],
y1: pt1[1],
@@ -160,7 +151,7 @@ var builders = {
strokeContainThreshold: opt.strokeContainThreshold || 5,
silent: true,
z2: 1
- })));
+ }));
var arrows = axisModel.get('axisLine.symbol');
var arrowSize = axisModel.get('axisLine.symbolSize');
var arrowOffset = axisModel.get('axisLine.symbolOffset') || 0;
@@ -287,7 +278,7 @@ var builders = {
__truncatedText: truncatedText,
position: pos,
rotation: labelLayout.rotation,
- silent: isSilent(axisModel),
+ silent: isLabelSilent(axisModel),
z2: 1,
tooltip: tooltipOpt && tooltipOpt.show ? extend({
content: name,
@@ -301,8 +292,8 @@ var builders = {
text: truncatedText,
textFont: textFont,
textFill: textStyleModel.getTextColor() || axisModel.get('axisLine.lineStyle.color'),
- textAlign: labelLayout.textAlign,
- textVerticalAlign: labelLayout.textVerticalAlign
+ textAlign: textStyleModel.get('align') || labelLayout.textAlign,
+ textVerticalAlign: textStyleModel.get('verticalAlign') || labelLayout.textVerticalAlign
});
if (axisModel.get('triggerEvent')) {
@@ -319,6 +310,15 @@ var builders = {
textEl.decomposeTransform();
}
};
+
+var makeAxisEventDataBase = AxisBuilder.makeAxisEventDataBase = function (axisModel) {
+ var eventData = {
+ componentType: axisModel.mainType,
+ componentIndex: axisModel.componentIndex
+ };
+ eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;
+ return eventData;
+};
/**
* @public
* @static
@@ -333,6 +333,7 @@ var builders = {
* }
*/
+
var innerTextLayout = AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {
var rotationDiff = remRadian(textRotation - axisRotation);
var textAlign;
@@ -393,11 +394,11 @@ function endTextLayout(opt, textPosition, textRotate, extent) {
};
}
-function isSilent(axisModel) {
+var isLabelSilent = AxisBuilder.isLabelSilent = function (axisModel) {
var tooltipOpt = axisModel.get('tooltip');
return axisModel.get('silent') // Consider mouse cursor, add these restrictions.
|| !(axisModel.get('triggerEvent') || tooltipOpt && tooltipOpt.show);
-}
+};
function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {
if (shouldShowAllLabels(axisModel.axis)) {
@@ -504,9 +505,10 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
} // Tick line, Not use group transform to have better line draw
- var tickEl = new graphic.Line(graphic.subPixelOptimizeLine({
+ var tickEl = new graphic.Line({
// Id for animation
anid: 'tick_' + ticksCoords[i].tickValue,
+ subPixelOptimize: true,
shape: {
x1: pt1[0],
y1: pt1[1],
@@ -518,7 +520,7 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
}),
z2: 2,
silent: true
- }));
+ });
axisBuilder.group.add(tickEl);
tickEls.push(tickEl);
}
@@ -540,9 +542,9 @@ function buildAxisLabel(axisBuilder, axisModel, opt) {
var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI / 180;
var labelLayout = innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);
- var rawCategoryData = axisModel.getCategories(true);
+ var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);
var labelEls = [];
- var silent = isSilent(axisModel);
+ var silent = isLabelSilent(axisModel);
var triggerEvent = axisModel.get('triggerEvent');
each(labels, function (labelItem, index) {
var tickValue = labelItem.tickValue;
diff --git a/public/en/builder/src/echarts/component/axis/CartesianAxisView.js b/public/en/builder/src/echarts/component/axis/CartesianAxisView.js
index 8f9a38f..3de67f2 100644
--- a/public/en/builder/src/echarts/component/axis/CartesianAxisView.js
+++ b/public/en/builder/src/echarts/component/axis/CartesianAxisView.js
@@ -112,8 +112,9 @@ var CartesianAxisView = AxisView.extend({
var colorIndex = lineCount++ % lineColors.length;
var tickValue = ticksCoords[i].tickValue;
- this._axisGroup.add(new graphic.Line(graphic.subPixelOptimizeLine({
+ this._axisGroup.add(new graphic.Line({
anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,
+ subPixelOptimize: true,
shape: {
x1: p1[0],
y1: p1[1],
@@ -124,7 +125,7 @@ var CartesianAxisView = AxisView.extend({
stroke: lineColors[colorIndex]
}, lineStyle),
silent: true
- })));
+ }));
}
},
diff --git a/public/en/builder/src/echarts/component/axis/SingleAxisView.js b/public/en/builder/src/echarts/component/axis/SingleAxisView.js
index 1306095..98179f0 100644
--- a/public/en/builder/src/echarts/component/axis/SingleAxisView.js
+++ b/public/en/builder/src/echarts/component/axis/SingleAxisView.js
@@ -79,7 +79,8 @@ var SingleAxisView = AxisView.extend({
var colorIndex = lineCount++ % lineColors.length;
splitLines[colorIndex] = splitLines[colorIndex] || [];
- splitLines[colorIndex].push(new graphic.Line(graphic.subPixelOptimizeLine({
+ splitLines[colorIndex].push(new graphic.Line({
+ subPixelOptimize: true,
shape: {
x1: p1[0],
y1: p1[1],
@@ -90,7 +91,7 @@ var SingleAxisView = AxisView.extend({
lineWidth: lineWidth
},
silent: true
- })));
+ }));
}
for (var i = 0; i < splitLines.length; ++i) {
diff --git a/public/en/builder/src/echarts/component/axisPointer/BaseAxisPointer.js b/public/en/builder/src/echarts/component/axisPointer/BaseAxisPointer.js
index 9d4236e..25a5e68 100644
--- a/public/en/builder/src/echarts/component/axisPointer/BaseAxisPointer.js
+++ b/public/en/builder/src/echarts/component/axisPointer/BaseAxisPointer.js
@@ -223,7 +223,7 @@ BaseAxisPointer.prototype = {
updatePointerEl: function (group, elOption, updateProps) {
var pointerEl = inner(group).pointerEl;
- if (pointerEl) {
+ if (pointerEl && elOption.pointer) {
pointerEl.setStyle(elOption.pointer.style);
updateProps(pointerEl, {
shape: elOption.pointer.shape
diff --git a/public/en/builder/src/echarts/component/axisPointer/CartesianAxisPointer.js b/public/en/builder/src/echarts/component/axisPointer/CartesianAxisPointer.js
index 6d94226..eef3b3b 100644
--- a/public/en/builder/src/echarts/component/axisPointer/CartesianAxisPointer.js
+++ b/public/en/builder/src/echarts/component/axisPointer/CartesianAxisPointer.js
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-import * as graphic from '../../util/graphic';
import BaseAxisPointer from './BaseAxisPointer';
import * as viewHelper from './viewHelper';
import * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper';
@@ -34,7 +33,7 @@ var CartesianAxisPointer = BaseAxisPointer.extend({
if (axisPointerType && axisPointerType !== 'none') {
var elStyle = viewHelper.buildElStyle(axisPointerModel);
- var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent, elStyle);
+ var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);
pointerOption.style = elStyle;
elOption.graphicKey = pointerOption.type;
elOption.pointer = pointerOption;
@@ -96,18 +95,15 @@ function getCartesian(grid, axis) {
}
var pointerShapeBuilder = {
- line: function (axis, pixelValue, otherExtent, elStyle) {
+ line: function (axis, pixelValue, otherExtent) {
var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));
- graphic.subPixelOptimizeLine({
- shape: targetShape,
- style: elStyle
- });
return {
type: 'Line',
+ subPixelOptimize: true,
shape: targetShape
};
},
- shadow: function (axis, pixelValue, otherExtent, elStyle) {
+ shadow: function (axis, pixelValue, otherExtent) {
var bandWidth = Math.max(1, axis.getBandWidth());
var span = otherExtent[1] - otherExtent[0];
return {
diff --git a/public/en/builder/src/echarts/component/axisPointer/SingleAxisPointer.js b/public/en/builder/src/echarts/component/axisPointer/SingleAxisPointer.js
index b3b93a5..2852a2a 100644
--- a/public/en/builder/src/echarts/component/axisPointer/SingleAxisPointer.js
+++ b/public/en/builder/src/echarts/component/axisPointer/SingleAxisPointer.js
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-import * as graphic from '../../util/graphic';
import BaseAxisPointer from './BaseAxisPointer';
import * as viewHelper from './viewHelper';
import * as singleAxisHelper from '../../coord/single/singleAxisHelper';
@@ -36,7 +35,7 @@ var SingleAxisPointer = BaseAxisPointer.extend({
if (axisPointerType && axisPointerType !== 'none') {
var elStyle = viewHelper.buildElStyle(axisPointerModel);
- var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent, elStyle);
+ var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);
pointerOption.style = elStyle;
elOption.graphicKey = pointerOption.type;
elOption.pointer = pointerOption;
@@ -87,18 +86,15 @@ var SingleAxisPointer = BaseAxisPointer.extend({
}
});
var pointerShapeBuilder = {
- line: function (axis, pixelValue, otherExtent, elStyle) {
+ line: function (axis, pixelValue, otherExtent) {
var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));
- graphic.subPixelOptimizeLine({
- shape: targetShape,
- style: elStyle
- });
return {
type: 'Line',
+ subPixelOptimize: true,
shape: targetShape
};
},
- shadow: function (axis, pixelValue, otherExtent, elStyle) {
+ shadow: function (axis, pixelValue, otherExtent) {
var bandWidth = axis.getBandWidth();
var span = otherExtent[1] - otherExtent[0];
return {
diff --git a/public/en/builder/src/echarts/component/axisPointer/viewHelper.js b/public/en/builder/src/echarts/component/axisPointer/viewHelper.js
index 3de1dd9..650c507 100644
--- a/public/en/builder/src/echarts/component/axisPointer/viewHelper.js
+++ b/public/en/builder/src/echarts/component/axisPointer/viewHelper.js
@@ -89,6 +89,7 @@ export function buildLabelElOption(elOption, axisModel, axisPointerModel, api, l
textFont: font,
textFill: labelModel.getTextColor(),
textPosition: 'inside',
+ textPadding: paddings,
fill: bgColor,
stroke: labelModel.get('borderColor') || 'transparent',
lineWidth: labelModel.get('borderWidth') || 0,
@@ -133,6 +134,8 @@ export function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {
if (formatter) {
var params = {
value: axisHelper.getAxisRawValue(axis, value),
+ axisDimension: axis.dim,
+ axisIndex: axis.index,
seriesData: []
};
zrUtil.each(seriesDataIndices, function (idxItem) {
diff --git a/public/en/builder/src/echarts/component/dataZoom.js b/public/en/builder/src/echarts/component/dataZoom.js
index 99810c6..efa6481 100644
--- a/public/en/builder/src/echarts/component/dataZoom.js
+++ b/public/en/builder/src/echarts/component/dataZoom.js
@@ -16,16 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
-/**
- * DataZoom component entry
- */
-import './dataZoom/typeDefaulter';
-import './dataZoom/DataZoomModel';
-import './dataZoom/DataZoomView';
-import './dataZoom/SliderZoomModel';
-import './dataZoom/SliderZoomView';
-import './dataZoom/InsideZoomModel';
-import './dataZoom/InsideZoomView';
-import './dataZoom/dataZoomProcessor';
-import './dataZoom/dataZoomAction';
\ No newline at end of file
+import './dataZoomSlider';
+import './dataZoomInside'; // Do not include './dataZoomSelect',
+// since it only work for toolbox dataZoom.
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/component/dataZoom/AxisProxy.js b/public/en/builder/src/echarts/component/dataZoom/AxisProxy.js
index 6198773..09aa105 100644
--- a/public/en/builder/src/echarts/component/dataZoom/AxisProxy.js
+++ b/public/en/builder/src/echarts/component/dataZoom/AxisProxy.js
@@ -19,6 +19,7 @@
import * as zrUtil from 'zrender/src/core/util';
import * as numberUtil from '../../util/number';
import * as helper from './helper';
+import sliderMove from '../helper/sliderMove';
var each = zrUtil.each;
var asc = numberUtil.asc;
/**
@@ -185,38 +186,36 @@ AxisProxy.prototype = {
var rangePropMode = this._dataZoomModel.getRangePropMode();
var percentExtent = [0, 100];
- var percentWindow = [opt.start, opt.end];
+ var percentWindow = [];
var valueWindow = [];
- each(['startValue', 'endValue'], function (prop) {
- valueWindow.push(opt[prop] != null ? scale.parse(opt[prop]) : null);
- }); // Normalize bound.
-
- each([0, 1], function (idx) {
- var boundValue = valueWindow[idx];
- var boundPercent = percentWindow[idx]; // Notice: dataZoom is based either on `percentProp` ('start', 'end') or
- // on `valueProp` ('startValue', 'endValue'). The former one is suitable
- // for cases that a dataZoom component controls multiple axes with different
- // unit or extent, and the latter one is suitable for accurate zoom by pixel
- // (e.g., in dataZoomSelect). `valueProp` can be calculated from `percentProp`,
- // but it is awkward that `percentProp` can not be obtained from `valueProp`
- // accurately (because all of values that are overflow the `dataExtent` will
- // be calculated to percent '100%'). So we have to use
- // `dataZoom.getRangePropMode()` to mark which prop is used.
- // `rangePropMode` is updated only when setOption or dispatchAction, otherwise
- // it remains its original value.
+ var hasPropModeValue;
+ each(['start', 'end'], function (prop, idx) {
+ var boundPercent = opt[prop];
+ var boundValue = opt[prop + 'Value']; // Notice: dataZoom is based either on `percentProp` ('start', 'end') or
+ // on `valueProp` ('startValue', 'endValue'). (They are based on the data extent
+ // but not min/max of axis, which will be calculated by data window then).
+ // The former one is suitable for cases that a dataZoom component controls multiple
+ // axes with different unit or extent, and the latter one is suitable for accurate
+ // zoom by pixel (e.g., in dataZoomSelect).
+ // we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated
+ // only when setOption or dispatchAction, otherwise it remains its original value.
+ // (Why not only record `percentProp` and always map to `valueProp`? Because
+ // the map `valueProp` -> `percentProp` -> `valueProp` probably not the original
+ // `valueProp`. consider two axes constrolled by one dataZoom. They have different
+ // data extent. All of values that are overflow the `dataExtent` will be calculated
+ // to percent '100%').
if (rangePropMode[idx] === 'percent') {
- if (boundPercent == null) {
- boundPercent = percentExtent[idx];
- } // Use scale.parse to math round for category or time axis.
+ boundPercent == null && (boundPercent = percentExtent[idx]); // Use scale.parse to math round for category or time axis.
-
- boundValue = scale.parse(numberUtil.linearMap(boundPercent, percentExtent, dataExtent, true));
+ boundValue = scale.parse(numberUtil.linearMap(boundPercent, percentExtent, dataExtent));
} else {
- // Calculating `percent` from `value` may be not accurate, because
+ hasPropModeValue = true;
+ boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue); // Calculating `percent` from `value` may be not accurate, because
// This calculation can not be inversed, because all of values that
// are overflow the `dataExtent` will be calculated to percent '100%'
- boundPercent = numberUtil.linearMap(boundValue, dataExtent, percentExtent, true);
+
+ boundPercent = numberUtil.linearMap(boundValue, dataExtent, percentExtent);
} // valueWindow[idx] = round(boundValue);
// percentWindow[idx] = round(boundPercent);
@@ -224,9 +223,29 @@ AxisProxy.prototype = {
valueWindow[idx] = boundValue;
percentWindow[idx] = boundPercent;
});
+ asc(valueWindow);
+ asc(percentWindow); // The windows from user calling of `dispatchAction` might be out of the extent,
+ // or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we dont restrict window
+ // by `zoomLock` here, because we see `zoomLock` just as a interaction constraint,
+ // where API is able to initialize/modify the window size even though `zoomLock`
+ // specified.
+
+ var spans = this._minMaxSpan;
+ hasPropModeValue ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);
+
+ function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {
+ var suffix = toValue ? 'Span' : 'ValueSpan';
+ sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]);
+
+ for (var i = 0; i < 2; i++) {
+ toWindow[i] = numberUtil.linearMap(fromWindow[i], fromExtent, toExtent, true);
+ toValue && (toWindow[i] = scale.parse(toWindow[i]));
+ }
+ }
+
return {
- valueWindow: asc(valueWindow),
- percentWindow: asc(percentWindow)
+ valueWindow: valueWindow,
+ percentWindow: percentWindow
};
},
@@ -253,11 +272,12 @@ AxisProxy.prototype = {
// this.hasSeriesStacked = true;
// }
// }, this);
+ // `calculateDataWindow` uses min/maxSpan.
+ setMinMaxSpan(this);
var dataWindow = this.calculateDataWindow(dataZoomModel.option);
this._valueWindow = dataWindow.valueWindow;
- this._percentWindow = dataWindow.percentWindow;
- setMinMaxSpan(this); // Update axis setting then.
+ this._percentWindow = dataWindow.percentWindow; // Update axis setting then.
setAxisModel(this);
},
@@ -345,7 +365,7 @@ AxisProxy.prototype = {
} else {
each(dataDims, function (dim) {
if (filterMode === 'empty') {
- seriesModel.setData(seriesData.map(dim, function (value) {
+ seriesModel.setData(seriesData = seriesData.map(dim, function (value) {
return !isInWindow(value) ? NaN : value;
}));
} else {
@@ -453,20 +473,20 @@ function setAxisModel(axisProxy, isRestore) {
function setMinMaxSpan(axisProxy) {
var minMaxSpan = axisProxy._minMaxSpan = {};
var dataZoomModel = axisProxy._dataZoomModel;
+ var dataExtent = axisProxy._dataExtent;
each(['min', 'max'], function (minMax) {
- minMaxSpan[minMax + 'Span'] = dataZoomModel.get(minMax + 'Span'); // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan
-
+ var percentSpan = dataZoomModel.get(minMax + 'Span');
var valueSpan = dataZoomModel.get(minMax + 'ValueSpan');
+ valueSpan != null && (valueSpan = axisProxy.getAxisModel().axis.scale.parse(valueSpan)); // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan
if (valueSpan != null) {
- minMaxSpan[minMax + 'ValueSpan'] = valueSpan;
- valueSpan = axisProxy.getAxisModel().axis.scale.parse(valueSpan);
-
- if (valueSpan != null) {
- var dataExtent = axisProxy._dataExtent;
- minMaxSpan[minMax + 'Span'] = numberUtil.linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);
- }
+ percentSpan = numberUtil.linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);
+ } else if (percentSpan != null) {
+ valueSpan = numberUtil.linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];
}
+
+ minMaxSpan[minMax + 'Span'] = percentSpan;
+ minMaxSpan[minMax + 'ValueSpan'] = valueSpan;
});
}
diff --git a/public/en/builder/src/echarts/component/dataZoom/InsideZoomView.js b/public/en/builder/src/echarts/component/dataZoom/InsideZoomView.js
index ea9c0ff..4d128f2 100644
--- a/public/en/builder/src/echarts/component/dataZoom/InsideZoomView.js
+++ b/public/en/builder/src/echarts/component/dataZoom/InsideZoomView.js
@@ -41,7 +41,7 @@ var InsideZoomView = DataZoomView.extend({
* @override
*/
render: function (dataZoomModel, ecModel, api, payload) {
- InsideZoomView.superApply(this, 'render', arguments); // Hance the `throttle` util ensures to preserve command order,
+ InsideZoomView.superApply(this, 'render', arguments); // Hence the `throttle` util ensures to preserve command order,
// here simply updating range all the time will not cause missing
// any of the the roam change.
diff --git a/public/en/builder/src/echarts/component/dataZoom/SliderZoomView.js b/public/en/builder/src/echarts/component/dataZoom/SliderZoomView.js
index ec79146..7a74034 100644
--- a/public/en/builder/src/echarts/component/dataZoom/SliderZoomView.js
+++ b/public/en/builder/src/echarts/component/dataZoom/SliderZoomView.js
@@ -421,8 +421,9 @@ var SliderZoomView = DataZoomView.extend({
}
})); // Frame border.
- barGroup.add(new Rect(graphic.subPixelOptimizeRect({
+ barGroup.add(new Rect({
silent: true,
+ subPixelOptimize: true,
shape: {
x: 0,
y: 0,
@@ -434,7 +435,7 @@ var SliderZoomView = DataZoomView.extend({
lineWidth: DEFAULT_FRAME_BORDER_WIDTH,
fill: 'rgba(0,0,0,0)'
}
- })));
+ }));
each([0, 1], function (handleIndex) {
var path = graphic.createIcon(dataZoomModel.get('handleIcon'), {
cursor: getCursor(this._orient),
diff --git a/public/en/builder/src/echarts/component/dataZoomInside.js b/public/en/builder/src/echarts/component/dataZoomInside.js
index def2738..8c1cc1a 100644
--- a/public/en/builder/src/echarts/component/dataZoomInside.js
+++ b/public/en/builder/src/echarts/component/dataZoomInside.js
@@ -16,10 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
-/**
- * DataZoom component entry
- */
import './dataZoom/typeDefaulter';
import './dataZoom/DataZoomModel';
import './dataZoom/DataZoomView';
diff --git a/public/en/builder/src/echarts/component/dataZoomSelect.js b/public/en/builder/src/echarts/component/dataZoomSelect.js
index 61922e5..72171a0 100644
--- a/public/en/builder/src/echarts/component/dataZoomSelect.js
+++ b/public/en/builder/src/echarts/component/dataZoomSelect.js
@@ -18,7 +18,8 @@
*/
/**
- * DataZoom component entry
+ * Only work for toolbox dataZoom. User
+ * MUST NOT import this module directly.
*/
import './dataZoom/typeDefaulter';
import './dataZoom/DataZoomModel';
diff --git a/public/en/builder/src/echarts/component/dataZoom.js b/public/en/builder/src/echarts/component/dataZoomSlider.js
similarity index 87%
copy from public/en/builder/src/echarts/component/dataZoom.js
copy to public/en/builder/src/echarts/component/dataZoomSlider.js
index 99810c6..39769e6 100644
--- a/public/en/builder/src/echarts/component/dataZoom.js
+++ b/public/en/builder/src/echarts/component/dataZoomSlider.js
@@ -16,16 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
-
-/**
- * DataZoom component entry
- */
import './dataZoom/typeDefaulter';
import './dataZoom/DataZoomModel';
import './dataZoom/DataZoomView';
import './dataZoom/SliderZoomModel';
import './dataZoom/SliderZoomView';
-import './dataZoom/InsideZoomModel';
-import './dataZoom/InsideZoomView';
import './dataZoom/dataZoomProcessor';
import './dataZoom/dataZoomAction';
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/component/helper/MapDraw.js b/public/en/builder/src/echarts/component/helper/MapDraw.js
index ece3519..a8f90ab 100644
--- a/public/en/builder/src/echarts/component/helper/MapDraw.js
+++ b/public/en/builder/src/echarts/component/helper/MapDraw.js
@@ -202,6 +202,7 @@ MapDraw.prototype = {
// location calculation.
var regionGroup = nameMap.get(region.name) || nameMap.set(region.name, new graphic.Group());
var compoundPath = new graphic.CompoundPath({
+ segmentIgnoreThreshold: 1,
shape: {
paths: []
}
@@ -235,6 +236,7 @@ MapDraw.prototype = {
}
compoundPath.shape.paths.push(new graphic.Polygon({
+ segmentIgnoreThreshold: 1,
shape: {
points: geometry.exterior
}
@@ -242,6 +244,7 @@ MapDraw.prototype = {
for (var i = 0; i < (geometry.interiors ? geometry.interiors.length : 0); i++) {
compoundPath.shape.paths.push(new graphic.Polygon({
+ segmentIgnoreThreshold: 1,
shape: {
points: geometry.interiors[i]
}
@@ -308,9 +311,8 @@ MapDraw.prototype = {
var groupRegions = regionGroup.__regions || (regionGroup.__regions = []);
groupRegions.push(region);
- graphic.setHoverStyle(regionGroup, hoverItemStyle, {
- hoverSilentOnTouch: !!mapOrGeoModel.get('selectedMode')
- });
+ regionGroup.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode');
+ graphic.setHoverStyle(regionGroup, hoverItemStyle);
regionsGroup.add(regionGroup);
});
diff --git a/public/en/builder/src/echarts/component/helper/sliderMove.js b/public/en/builder/src/echarts/component/helper/sliderMove.js
index 38cbb97..305dbea 100644
--- a/public/en/builder/src/echarts/component/helper/sliderMove.js
+++ b/public/en/builder/src/echarts/component/helper/sliderMove.js
@@ -29,8 +29,7 @@
* handleEnds will be modified in this method.
* @param {Array.<number>} extent handleEnds is restricted by extent.
* extent[0] should less or equals than extent[1].
- * @param {number|string} handleIndex Can be 'all', means that both move the two handleEnds,
- * where the input minSpan and maxSpan will not work.
+ * @param {number|string} handleIndex Can be 'all', means that both move the two handleEnds.
* @param {number} [minSpan] The range of dataZoom can not be smaller than that.
* If not set, handle0 and cross handle1. If set as a non-negative
* number (including `0`), handles will push each other when reaching
@@ -39,9 +38,6 @@
* @return {Array.<number>} The input handleEnds.
*/
export default function (delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {
- // Normalize firstly.
- handleEnds[0] = restrict(handleEnds[0], extent);
- handleEnds[1] = restrict(handleEnds[1], extent);
delta = delta || 0;
var extentSpan = extent[1] - extent[0]; // Notice maxSpan and minSpan can be null/undefined.
@@ -54,10 +50,14 @@ export default function (delta, handleEnds, extent, handleIndex, minSpan, maxSpa
}
if (handleIndex === 'all') {
- minSpan = maxSpan = Math.abs(handleEnds[1] - handleEnds[0]);
+ var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);
+ handleSpan = restrict(handleSpan, [0, extentSpan]);
+ minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);
handleIndex = 0;
}
+ handleEnds[0] = restrict(handleEnds[0], extent);
+ handleEnds[1] = restrict(handleEnds[1], extent);
var originalDistSign = getSpanSign(handleEnds, handleIndex);
handleEnds[handleIndex] += delta; // Restrict in extent.
@@ -69,7 +69,7 @@ export default function (delta, handleEnds, extent, handleIndex, minSpan, maxSpa
var currDistSign = getSpanSign(handleEnds, handleIndex);
if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {
- // If minSpan exists, 'cross' is forbinden.
+ // If minSpan exists, 'cross' is forbidden.
handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;
} // Shrink span.
@@ -94,5 +94,5 @@ function getSpanSign(handleEnds, handleIndex) {
}
function restrict(value, extend) {
- return Math.min(extend[1], Math.max(extend[0], value));
+ return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value));
}
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/component/legend/ScrollableLegendView.js b/public/en/builder/src/echarts/component/legend/ScrollableLegendView.js
index ed83724..d82ccd7 100644
--- a/public/en/builder/src/echarts/component/legend/ScrollableLegendView.js
+++ b/public/en/builder/src/echarts/component/legend/ScrollableLegendView.js
@@ -366,18 +366,27 @@ var ScrollableLegendView = LegendView.extend({
_findTargetItemIndex: function (targetDataIndex) {
var index;
var contentGroup = this.getContentGroup();
+ var defaultIndex;
if (this._showController) {
contentGroup.eachChild(function (child, idx) {
- if (child.__legendDataIndex === targetDataIndex) {
+ var legendDataIdx = child.__legendDataIndex; // FIXME
+ // If the given targetDataIndex (from model) is illegal,
+ // we use defualtIndex. But the index on the legend model and
+ // action payload is still illegal. That case will not be
+ // changed until some scenario requires.
+
+ if (defaultIndex == null && legendDataIdx != null) {
+ defaultIndex = idx;
+ }
+
+ if (legendDataIdx === targetDataIndex) {
index = idx;
}
});
- } else {
- index = 0;
}
- return index;
+ return index != null ? index : defaultIndex;
}
});
export default ScrollableLegendView;
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/component/marker/MarkLineView.js b/public/en/builder/src/echarts/component/marker/MarkLineView.js
index 0b587d6..9962bf9 100644
--- a/public/en/builder/src/echarts/component/marker/MarkLineView.js
+++ b/public/en/builder/src/echarts/component/marker/MarkLineView.js
@@ -22,6 +22,7 @@ import * as numberUtil from '../../util/number';
import * as markerHelper from './markerHelper';
import LineDraw from '../../chart/helper/LineDraw';
import MarkerView from './MarkerView';
+import { getStackedDimension } from '../../data/helper/dataStackHelper';
var markLineTransform = function (seriesModel, coordSys, mlModel, item) {
var data = seriesModel.getData(); // Special type markLine like 'min', 'max', 'average', 'median'
@@ -34,21 +35,19 @@ var markLineTransform = function (seriesModel, coordSys, mlModel, item) {
// }]
|| item.xAxis != null || item.yAxis != null)) {
var valueAxis;
- var valueDataDim;
var value;
if (item.yAxis != null || item.xAxis != null) {
- valueDataDim = item.yAxis != null ? 'y' : 'x';
- valueAxis = coordSys.getAxis(valueDataDim);
+ valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');
value = zrUtil.retrieve(item.yAxis, item.xAxis);
} else {
var axisInfo = markerHelper.getAxisInfo(item, data, coordSys, seriesModel);
- valueDataDim = axisInfo.valueDataDim;
valueAxis = axisInfo.valueAxis;
+ var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);
value = markerHelper.numCalculate(data, valueDataDim, mlType);
}
- var valueIndex = valueDataDim === 'x' ? 0 : 1;
+ var valueIndex = valueAxis.dim === 'x' ? 0 : 1;
var baseIndex = 1 - valueIndex;
var mlFrom = zrUtil.clone(item);
var mlTo = {};
diff --git a/public/en/builder/src/echarts/component/marker/MarkPointView.js b/public/en/builder/src/echarts/component/marker/MarkPointView.js
index e5e66b3..8e7c18b 100644
--- a/public/en/builder/src/echarts/component/marker/MarkPointView.js
+++ b/public/en/builder/src/echarts/component/marker/MarkPointView.js
@@ -89,17 +89,29 @@ export default MarkerView.extend({
updateMarkerLayout(mpModel.getData(), seriesModel, api);
mpData.each(function (idx) {
var itemModel = mpData.getItemModel(idx);
+ var symbol = itemModel.getShallow('symbol');
var symbolSize = itemModel.getShallow('symbolSize');
+ var isFnSymbol = zrUtil.isFunction(symbol);
+ var isFnSymbolSize = zrUtil.isFunction(symbolSize);
- if (typeof symbolSize === 'function') {
- // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?
- symbolSize = symbolSize(mpModel.getRawValue(idx), mpModel.getDataParams(idx));
+ if (isFnSymbol || isFnSymbolSize) {
+ var rawIdx = mpModel.getRawValue(idx);
+ var dataParams = mpModel.getDataParams(idx);
+
+ if (isFnSymbol) {
+ symbol = symbol(rawIdx, dataParams);
+ }
+
+ if (isFnSymbolSize) {
+ // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?
+ symbolSize = symbolSize(rawIdx, dataParams);
+ }
}
mpData.setItemVisual(idx, {
+ symbol: symbol,
symbolSize: symbolSize,
- color: itemModel.get('itemStyle.color') || seriesData.getVisual('color'),
- symbol: itemModel.getShallow('symbol')
+ color: itemModel.get('itemStyle.color') || seriesData.getVisual('color')
});
}); // TODO Text are wrong
diff --git a/public/en/builder/src/echarts/component/title.js b/public/en/builder/src/echarts/component/title.js
index e7045b9..ef07247 100644
--- a/public/en/builder/src/echarts/component/title.js
+++ b/public/en/builder/src/echarts/component/title.js
@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+import * as zrUtil from 'zrender/src/core/util';
import * as echarts from '../echarts';
import * as graphic from '../util/graphic';
import { getLayoutRect } from '../util/layout'; // Model
@@ -56,7 +57,8 @@ echarts.extendComponentModel({
// 垂直对齐
// 'auto' | 'top' | 'bottom' | 'middle'
// 默认根据 top 位置判断是上对齐还是下对齐
- // textBaseline: null
+ // textVerticalAlign: null
+ // textBaseline: null // The same as textVerticalAlign.
backgroundColor: 'rgba(0,0,0,0)',
// 标题边框颜色
borderColor: '#ccc',
@@ -91,7 +93,7 @@ echarts.extendComponentView({
var textStyleModel = titleModel.getModel('textStyle');
var subtextStyleModel = titleModel.getModel('subtextStyle');
var textAlign = titleModel.get('textAlign');
- var textBaseline = titleModel.get('textBaseline');
+ var textVerticalAlign = zrUtil.retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign'));
var textEl = new graphic.Text({
style: graphic.setTextStyle({}, textStyleModel, {
text: titleModel.get('text'),
@@ -164,26 +166,26 @@ echarts.extendComponentView({
}
}
- if (!textBaseline) {
- textBaseline = titleModel.get('top') || titleModel.get('bottom');
+ if (!textVerticalAlign) {
+ textVerticalAlign = titleModel.get('top') || titleModel.get('bottom');
- if (textBaseline === 'center') {
- textBaseline = 'middle';
+ if (textVerticalAlign === 'center') {
+ textVerticalAlign = 'middle';
}
- if (textBaseline === 'bottom') {
+ if (textVerticalAlign === 'bottom') {
layoutRect.y += layoutRect.height;
- } else if (textBaseline === 'middle') {
+ } else if (textVerticalAlign === 'middle') {
layoutRect.y += layoutRect.height / 2;
}
- textBaseline = textBaseline || 'top';
+ textVerticalAlign = textVerticalAlign || 'top';
}
group.attr('position', [layoutRect.x, layoutRect.y]);
var alignStyle = {
textAlign: textAlign,
- textVerticalAlign: textBaseline
+ textVerticalAlign: textVerticalAlign
};
textEl.setStyle(alignStyle);
subTextEl.setStyle(alignStyle); // Render background
@@ -202,9 +204,9 @@ echarts.extendComponentView({
r: titleModel.get('borderRadius')
},
style: style,
+ subPixelOptimize: true,
silent: true
});
- graphic.subPixelOptimizeRect(rect);
group.add(rect);
}
});
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/component/toolbox/ToolboxModel.js b/public/en/builder/src/echarts/component/toolbox/ToolboxModel.js
index 4bc7a23..c3a099f 100644
--- a/public/en/builder/src/echarts/component/toolbox/ToolboxModel.js
+++ b/public/en/builder/src/echarts/component/toolbox/ToolboxModel.js
@@ -56,9 +56,12 @@ var ToolboxModel = echarts.extendComponentModel({
emphasis: {
iconStyle: {
borderColor: '#3E98C5'
- } // textStyle: {},
- // feature
-
+ }
+ },
+ // textStyle: {},
+ // feature
+ tooltip: {
+ show: false
}
}
});
diff --git a/public/en/builder/src/echarts/component/toolbox/ToolboxView.js b/public/en/builder/src/echarts/component/toolbox/ToolboxView.js
index bf2605c..6e210a8 100644
--- a/public/en/builder/src/echarts/component/toolbox/ToolboxView.js
+++ b/public/en/builder/src/echarts/component/toolbox/ToolboxView.js
@@ -145,6 +145,24 @@ export default echarts.extendComponentView({
});
path.setStyle(iconStyleModel.getItemStyle());
path.hoverStyle = iconStyleEmphasisModel.getItemStyle();
+ var tooltipModel = toolboxModel.getModel('tooltip');
+
+ if (tooltipModel && tooltipModel.get('show')) {
+ path.attr('tooltip', zrUtil.extend({
+ content: titles[iconName],
+ formatter: tooltipModel.get('formatter', true) || function () {
+ return titles[iconName];
+ },
+ formatterParams: {
+ componentType: 'toolbox',
+ name: iconName,
+ title: titles[iconName],
+ $vars: ['name', 'title']
+ },
+ position: tooltipModel.get('position', true) || 'bottom'
+ }, tooltipModel.option));
+ }
+
graphic.setHoverStyle(path);
if (toolboxModel.get('showTitle')) {
@@ -154,13 +172,17 @@ export default echarts.extendComponentView({
var hoverStyle = iconStyleEmphasisModel.getItemStyle();
path.setStyle({
text: titles[iconName],
- textPosition: hoverStyle.textPosition || 'bottom',
- textFill: hoverStyle.fill || hoverStyle.stroke || '#000',
- textAlign: hoverStyle.textAlign || 'center'
+ textPosition: iconStyleEmphasisModel.get('textPosition') || 'bottom',
+ textFill: iconStyleEmphasisModel.get('textFill') || hoverStyle.fill || hoverStyle.stroke || '#000',
+ textAlign: iconStyleEmphasisModel.get('textAlign') || 'center',
+ textBackgroundColor: iconStyleEmphasisModel.get('textBackgroundColor'),
+ textBorderRadius: iconStyleEmphasisModel.get('textBorderRadius'),
+ textPadding: iconStyleEmphasisModel.get('textPadding')
});
}).on('mouseout', function () {
path.setStyle({
- textFill: null
+ textFill: null,
+ textBackgroundColor: null
});
});
}
diff --git a/public/en/builder/src/echarts/component/toolbox/feature/SaveAsImage.js b/public/en/builder/src/echarts/component/toolbox/feature/SaveAsImage.js
index c6e51c4..e7389cc 100644
--- a/public/en/builder/src/echarts/component/toolbox/feature/SaveAsImage.js
+++ b/public/en/builder/src/echarts/component/toolbox/feature/SaveAsImage.js
@@ -34,6 +34,7 @@ SaveAsImage.defaultOption = {
type: 'png',
// Default use option.backgroundColor
// backgroundColor: '#fff',
+ connectedBackgroundColor: '#fff',
name: '',
excludeComponents: ['toolbox'],
pixelRatio: 1,
@@ -45,19 +46,20 @@ var proto = SaveAsImage.prototype;
proto.onclick = function (ecModel, api) {
var model = this.model;
var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';
- var $a = document.createElement('a');
var type = model.get('type', true) || 'png';
- $a.download = title + '.' + type;
- $a.target = '_blank';
var url = api.getConnectedDataURL({
type: type,
backgroundColor: model.get('backgroundColor', true) || ecModel.get('backgroundColor') || '#fff',
+ connectedBackgroundColor: model.get('connectedBackgroundColor'),
excludeComponents: model.get('excludeComponents'),
pixelRatio: model.get('pixelRatio')
- });
- $a.href = url; // Chrome and Firefox
+ }); // Chrome and Firefox
if (typeof MouseEvent === 'function' && !env.browser.ie && !env.browser.edge) {
+ var $a = document.createElement('a');
+ $a.download = title + '.' + type;
+ $a.target = '_blank';
+ $a.href = url;
var evt = new MouseEvent('click', {
view: window,
bubbles: true,
diff --git a/public/en/builder/src/echarts/component/tooltip/TooltipContent.js b/public/en/builder/src/echarts/component/tooltip/TooltipContent.js
index ef22fba..6758935 100644
--- a/public/en/builder/src/echarts/component/tooltip/TooltipContent.js
+++ b/public/en/builder/src/echarts/component/tooltip/TooltipContent.js
@@ -123,7 +123,10 @@ function TooltipContent(container, api) {
* @private
*/
- this._hideTimeout;
+ this._hideTimeout; // FIXME
+ // Is it needed to trigger zr event manually if
+ // the browser do not support `pointer-events: none`.
+
var self = this;
el.onmouseenter = function () {
@@ -140,6 +143,10 @@ function TooltipContent(container, api) {
e = e || window.event;
if (!self._enterable) {
+ // `pointer-events: none` is set to tooltip content div
+ // if `enterable` is set as `false`, and `el.onmousemove`
+ // can not be triggered. But in browser that do not
+ // support `pointer-events`, we need to do this:
// Try trigger zrender event to avoid mouse
// in and out shape too frequently
var handler = zr.handler;
@@ -255,8 +262,8 @@ TooltipContent.prototype = {
var stl = document.defaultView.getComputedStyle(this.el);
if (stl) {
- width += parseInt(stl.paddingLeft, 10) + parseInt(stl.paddingRight, 10) + parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10);
- height += parseInt(stl.paddingTop, 10) + parseInt(stl.paddingBottom, 10) + parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10);
+ width += parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10);
+ height += parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10);
}
}
diff --git a/public/en/builder/src/echarts/component/tooltip/TooltipRichContent.js b/public/en/builder/src/echarts/component/tooltip/TooltipRichContent.js
index 260087c..54c1d95 100644
--- a/public/en/builder/src/echarts/component/tooltip/TooltipRichContent.js
+++ b/public/en/builder/src/echarts/component/tooltip/TooltipRichContent.js
@@ -149,7 +149,10 @@ TooltipRichContent.prototype = {
}
},
hide: function () {
- this.el.hide();
+ if (this.el) {
+ this.el.hide();
+ }
+
this._show = false;
},
hideLater: function (time) {
@@ -168,7 +171,11 @@ TooltipRichContent.prototype = {
return this._show;
},
getOuterSize: function () {
- return this.getSize();
+ var size = this.getSize();
+ return {
+ width: size[0],
+ height: size[1]
+ };
}
};
export default TooltipRichContent;
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/component/tooltip/TooltipView.js b/public/en/builder/src/echarts/component/tooltip/TooltipView.js
index fc80e32..4ed5387 100644
--- a/public/en/builder/src/echarts/component/tooltip/TooltipView.js
+++ b/public/en/builder/src/echarts/component/tooltip/TooltipView.js
@@ -139,7 +139,7 @@ export default echarts.extendComponentView({
// Show tip next tick after other charts are rendered
// In case highlight action has wrong result
// FIXME
- self.manuallyShowTip(tooltipModel, ecModel, api, {
+ !api.isDisposed() && self.manuallyShowTip(tooltipModel, ecModel, api, {
x: self._lastX,
y: self._lastY
});
diff --git a/public/en/builder/src/echarts/component/visualMap/ContinuousView.js b/public/en/builder/src/echarts/component/visualMap/ContinuousView.js
index 99c221c..fb5cbd2 100644
--- a/public/en/builder/src/echarts/component/visualMap/ContinuousView.js
+++ b/public/en/builder/src/echarts/component/visualMap/ContinuousView.js
@@ -617,9 +617,9 @@ var ContinuousView = VisualMapView.extend({
var resultBatches = modelUtil.compressBatches(oldBatch, newBatch);
- this._dispatchHighDown('downplay', helper.convertDataIndex(resultBatches[0]));
+ this._dispatchHighDown('downplay', helper.makeHighDownBatch(resultBatches[0], visualMapModel));
- this._dispatchHighDown('highlight', helper.convertDataIndex(resultBatches[1]));
+ this._dispatchHighDown('highlight', helper.makeHighDownBatch(resultBatches[1], visualMapModel));
},
/**
@@ -664,7 +664,7 @@ var ContinuousView = VisualMapView.extend({
var indices = this._hoverLinkDataIndices;
- this._dispatchHighDown('downplay', helper.convertDataIndex(indices));
+ this._dispatchHighDown('downplay', helper.makeHighDownBatch(indices, this.visualMapModel));
indices.length = 0;
},
diff --git a/public/en/builder/src/echarts/component/visualMap/PiecewiseModel.js b/public/en/builder/src/echarts/component/visualMap/PiecewiseModel.js
index b4ccf0d..978b6a9 100644
--- a/public/en/builder/src/echarts/component/visualMap/PiecewiseModel.js
+++ b/public/en/builder/src/echarts/component/visualMap/PiecewiseModel.js
@@ -252,7 +252,7 @@ var PiecewiseModel = VisualMapModel.extend({
/**
* @public
* @params {number} pieceIndex piece index in visualMapModel.getPieceList()
- * @return {Array.<Object>} [{seriesId, dataIndices: <Array.<number>>}, ...]
+ * @return {Array.<Object>} [{seriesId, dataIndex: <Array.<number>>}, ...]
*/
findTargetDataIndices: function (pieceIndex) {
var result = [];
@@ -367,7 +367,7 @@ var PiecewiseModel = VisualMapModel.extend({
/**
* Key is this._mode
* @type {Object}
- * @this {module:echarts/component/visualMap/PiecewiseMode}
+ * @this {module:echarts/component/viusalMap/PiecewiseMode}
*/
var resetMethods = {
diff --git a/public/en/builder/src/echarts/component/visualMap/PiecewiseView.js b/public/en/builder/src/echarts/component/visualMap/PiecewiseView.js
index df985b7..8615707 100644
--- a/public/en/builder/src/echarts/component/visualMap/PiecewiseView.js
+++ b/public/en/builder/src/echarts/component/visualMap/PiecewiseView.js
@@ -94,7 +94,7 @@ var PiecewiseVisualMapView = VisualMapView.extend({
var visualMapModel = this.visualMapModel;
visualMapModel.option.hoverLink && this.api.dispatchAction({
type: method,
- batch: helper.convertDataIndex(visualMapModel.findTargetDataIndices(pieceIndex))
+ batch: helper.makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel)
});
}
},
diff --git a/public/en/builder/src/echarts/component/visualMap/helper.js b/public/en/builder/src/echarts/component/visualMap/helper.js
index 666f226..197d465 100644
--- a/public/en/builder/src/echarts/component/visualMap/helper.js
+++ b/public/en/builder/src/echarts/component/visualMap/helper.js
@@ -58,12 +58,14 @@ export function getItemAlign(visualMapModel, api, itemSize) {
* dataIndexInside means filtered index.
*/
-export function convertDataIndex(batch) {
+export function makeHighDownBatch(batch, visualMapModel) {
zrUtil.each(batch || [], function (batchItem) {
- if (batch.dataIndex != null) {
- batch.dataIndexInside = batch.dataIndex;
- batch.dataIndex = null;
+ if (batchItem.dataIndex != null) {
+ batchItem.dataIndexInside = batchItem.dataIndex;
+ batchItem.dataIndex = null;
}
+
+ batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : '');
});
return batch;
}
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/coord/axisTickLabelBuilder.js b/public/en/builder/src/echarts/coord/axisTickLabelBuilder.js
index 0b883b9..5092da2 100644
--- a/public/en/builder/src/echarts/coord/axisTickLabelBuilder.js
+++ b/public/en/builder/src/echarts/coord/axisTickLabelBuilder.js
@@ -293,7 +293,7 @@ function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {
addItem(tickValue);
}
- if (includeMaxLabel && tickValue !== ordinalExtent[1]) {
+ if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {
addItem(ordinalExtent[1]);
}
diff --git a/public/en/builder/src/echarts/coord/cartesian/Grid.js b/public/en/builder/src/echarts/coord/cartesian/Grid.js
index 3772f2c..86bc47e 100644
--- a/public/en/builder/src/echarts/coord/cartesian/Grid.js
+++ b/public/en/builder/src/echarts/coord/cartesian/Grid.js
@@ -54,7 +54,7 @@ function Grid(gridModel, ecModel, api) {
this._coordsList = [];
/**
- * @type {Object.<string, module:echarts/coord/cartesian/Axis2D>}
+ * @type {Object.<string, Array.<module:echarts/coord/cartesian/Axis2D>>}
* @private
*/
@@ -395,21 +395,13 @@ gridProto._initCartesian = function (gridModel, ecModel, api) {
// Fix position
if (axisPosition !== 'top' && axisPosition !== 'bottom') {
// Default bottom of X
- axisPosition = 'bottom';
-
- if (axisPositionUsed[axisPosition]) {
- axisPosition = axisPosition === 'top' ? 'bottom' : 'top';
- }
+ axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';
}
} else {
// Fix position
if (axisPosition !== 'left' && axisPosition !== 'right') {
// Default left of Y
- axisPosition = 'left';
-
- if (axisPositionUsed[axisPosition]) {
- axisPosition = axisPosition === 'left' ? 'right' : 'left';
- }
+ axisPosition = axisPositionUsed.left ? 'right' : 'left';
}
}
diff --git a/public/en/builder/src/echarts/coord/single/AxisModel.js b/public/en/builder/src/echarts/coord/single/AxisModel.js
index 57b631c..1ed84c5 100644
--- a/public/en/builder/src/echarts/coord/single/AxisModel.js
+++ b/public/en/builder/src/echarts/coord/single/AxisModel.js
@@ -52,7 +52,7 @@ var defaultOption = {
axisLine: {
show: true,
lineStyle: {
- width: 2,
+ width: 1,
type: 'solid'
}
},
@@ -66,7 +66,7 @@ var defaultOption = {
show: true,
length: 6,
lineStyle: {
- width: 2
+ width: 1
}
},
axisLabel: {
diff --git a/public/en/builder/src/echarts/data/Graph.js b/public/en/builder/src/echarts/data/Graph.js
index 3d63b04..4ca05ca 100644
--- a/public/en/builder/src/echarts/data/Graph.js
+++ b/public/en/builder/src/echarts/data/Graph.js
@@ -104,7 +104,7 @@ graphProto.isDirected = function () {
graphProto.addNode = function (id, dataIndex) {
- id = id || '' + dataIndex;
+ id = id == null ? '' + dataIndex : '' + id;
var nodesMap = this._nodesMap;
if (nodesMap[generateNodeKey(id)]) {
diff --git a/public/en/builder/src/echarts/data/List.js b/public/en/builder/src/echarts/data/List.js
index 2e151b0..c7364bf 100644
--- a/public/en/builder/src/echarts/data/List.js
+++ b/public/en/builder/src/echarts/data/List.js
@@ -285,6 +285,21 @@ var List = function (dimensions, hostModel) {
*/
this._calculationInfo = {};
+ /**
+ * User output info of this data.
+ * DO NOT use it in other places!
+ *
+ * When preparing user params for user callbacks, we have
+ * to clone these inner data structures to prevent users
+ * from modifying them to effect built-in logic. And for
+ * performance consideration we make this `userOutput` to
+ * avoid clone them too many times.
+ *
+ * @type {Object}
+ * @readOnly
+ */
+
+ this.userOutput = this._dimensionsSummary.userOutput;
};
var listProto = List.prototype;
@@ -296,16 +311,30 @@ listProto.type = 'list';
listProto.hasItemOption = true;
/**
+ * The meanings of the input parameter `dim`:
+ *
+ * + If dim is a number (e.g., `1`), it means the index of the dimension.
+ * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.
+ * + If dim is a number-like string (e.g., `"1"`):
+ * + If there is the same concrete dim name defined in `this.dimensions`, it means that concrete name.
+ * + If not, it will be converted to a number, which means the index of the dimension.
+ * (why? because of the backward compatbility. We have been tolerating number-like string in
+ * dimension setting, although now it seems that it is not a good idea.)
+ * For example, `visualMap[i].dimension: "1"` is the same meaning as `visualMap[i].dimension: 1`,
+ * if no dimension name is defined as `"1"`.
+ * + If dim is a not-number-like string, it means the concrete dim name.
+ * For example, it can be be default name `"x"`, `"y"`, `"z"`, `"lng"`, `"lat"`, `"angle"`, `"radius"`,
+ * or customized in `dimensions` property of option like `"age"`.
+ *
* Get dimension name
- * @param {string|number} dim
- * Dimension can be concrete names like x, y, z, lng, lat, angle, radius
- * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'
+ * @param {string|number} dim See above.
* @return {string} Concrete dim name.
*/
listProto.getDimension = function (dim) {
- if (!isNaN(dim)) {
- dim = this.dimensions[dim] || dim;
+ if (typeof dim === 'number' // If being a number-like string but not being defined a dimension name.
+ || !isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim)) {
+ dim = this.dimensions[dim];
}
return dim;
@@ -850,12 +879,12 @@ listProto.getValues = function (dimensions, idx
listProto.hasValue = function (idx) {
var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord;
- var dimensionInfos = this._dimensionInfos;
for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) {
- if ( // Ordinal type can be string or number
- dimensionInfos[dataDimsOnCoord[i]].type !== 'ordinal' // FIXME check ordinal when using index?
- && isNaN(this.get(dataDimsOnCoord[i], idx))) {
+ // Ordinal type originally can be string or number.
+ // But when an ordinal type is used on coord, it can
+ // not be string but only number. So we can also use isNaN.
+ if (isNaN(this.get(dataDimsOnCoord[i], idx))) {
return false;
}
}
diff --git a/public/en/builder/src/echarts/data/helper/completeDimensions.js b/public/en/builder/src/echarts/data/helper/completeDimensions.js
index cacb09e..94b5c8c 100644
--- a/public/en/builder/src/echarts/data/helper/completeDimensions.js
+++ b/public/en/builder/src/echarts/data/helper/completeDimensions.js
@@ -116,7 +116,7 @@ function completeDimensions(sysDims, source, opt) {
// `{encode: {x: -1, y: 1}}`. Should not filter anything in
// this case.
- if (dataDims.length === 1 && dataDims[0] < 0) {
+ if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {
encodeDef.set(coordDim, false);
return;
}
diff --git a/public/en/builder/src/echarts/data/helper/dimensionHelper.js b/public/en/builder/src/echarts/data/helper/dimensionHelper.js
index b6200e8..a1c8fc0 100644
--- a/public/en/builder/src/echarts/data/helper/dimensionHelper.js
+++ b/public/en/builder/src/echarts/data/helper/dimensionHelper.js
@@ -24,19 +24,19 @@ export function summarizeDimensions(data) {
var encode = summary.encode = {};
var notExtraCoordDimMap = createHashMap();
var defaultedLabel = [];
- var defaultedTooltip = [];
+ var defaultedTooltip = []; // See the comment of `List.js#userOutput`.
+
+ var userOutput = summary.userOutput = {
+ dimensionNames: data.dimensions.slice(),
+ encode: {}
+ };
each(data.dimensions, function (dimName) {
var dimItem = data.getDimensionInfo(dimName);
var coordDim = dimItem.coordDim;
if (coordDim) {
- var coordDimArr = encode[coordDim];
-
- if (!encode.hasOwnProperty(coordDim)) {
- coordDimArr = encode[coordDim] = [];
- }
-
- coordDimArr[dimItem.coordDimIndex] = dimName;
+ var coordDimIndex = dimItem.coordDimIndex;
+ getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;
if (!dimItem.isExtraCoord) {
notExtraCoordDimMap.set(coordDim, 1); // Use the last coord dim (and label friendly) as default label,
@@ -46,7 +46,11 @@ export function summarizeDimensions(data) {
if (mayLabelDimType(dimItem.type)) {
defaultedLabel[0] = dimName;
- }
+ } // User output encode do not contain generated coords.
+ // And it only has index. User can use index to retrieve value from the raw item array.
+
+
+ getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;
}
if (dimItem.defaultTooltip) {
@@ -55,16 +59,11 @@ export function summarizeDimensions(data) {
}
OTHER_DIMENSIONS.each(function (v, otherDim) {
- var otherDimArr = encode[otherDim];
-
- if (!encode.hasOwnProperty(otherDim)) {
- otherDimArr = encode[otherDim] = [];
- }
-
+ var encodeArr = getOrCreateEncodeArr(encode, otherDim);
var dimIndex = dimItem.otherDims[otherDim];
if (dimIndex != null && dimIndex !== false) {
- otherDimArr[dimIndex] = dimItem.name;
+ encodeArr[dimIndex] = dimItem.name;
}
});
});
@@ -101,6 +100,15 @@ export function summarizeDimensions(data) {
encode.defaultedTooltip = defaultedTooltip;
return summary;
}
+
+function getOrCreateEncodeArr(encode, dim) {
+ if (!encode.hasOwnProperty(dim)) {
+ encode[dim] = [];
+ }
+
+ return encode[dim];
+}
+
export function getDimensionTypeByAxis(axisType) {
return axisType === 'category' ? 'ordinal' : axisType === 'time' ? 'time' : 'float';
}
diff --git a/public/en/builder/src/echarts/echarts.js b/public/en/builder/src/echarts/echarts.js
index fdc29ca..6c9721a 100644
--- a/public/en/builder/src/echarts/echarts.js
+++ b/public/en/builder/src/echarts/echarts.js
@@ -49,16 +49,18 @@ var each = zrUtil.each;
var isFunction = zrUtil.isFunction;
var isObject = zrUtil.isObject;
var parseClassType = ComponentModel.parseClassType;
-export var version = '4.2.1';
+export var version = '4.3.0';
export var dependencies = {
- zrender: '4.0.6'
+ zrender: '4.1.0'
};
var TEST_FRAME_REMAIN_TIME = 1;
var PRIORITY_PROCESSOR_FILTER = 1000;
var PRIORITY_PROCESSOR_STATISTIC = 5000;
var PRIORITY_VISUAL_LAYOUT = 1000;
+var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;
var PRIORITY_VISUAL_GLOBAL = 2000;
var PRIORITY_VISUAL_CHART = 3000;
+var PRIORITY_VISUAL_POST_CHART_LAYOUT = 3500;
var PRIORITY_VISUAL_COMPONENT = 4000; // FIXME
// necessary?
@@ -70,8 +72,10 @@ export var PRIORITY = {
},
VISUAL: {
LAYOUT: PRIORITY_VISUAL_LAYOUT,
+ PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,
GLOBAL: PRIORITY_VISUAL_GLOBAL,
CHART: PRIORITY_VISUAL_CHART,
+ POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,
COMPONENT: PRIORITY_VISUAL_COMPONENT,
BRUSH: PRIORITY_VISUAL_BRUSH
}
@@ -146,7 +150,7 @@ function ECharts(dom, theme, opts) {
height: opts.height
});
/**
- * Expect 60 pfs.
+ * Expect 60 fps.
* @type {Function}
* @private
*/
@@ -325,7 +329,7 @@ echartsProto.setOption = function (option, notMerge, lazyUpdate) {
if (!this._model || notMerge) {
var optionManager = new OptionManager(this._api);
var theme = this._theme;
- var ecModel = this._model = new GlobalModel(null, null, theme, optionManager);
+ var ecModel = this._model = new GlobalModel();
ecModel.scheduler = this._scheduler;
ecModel.init(null, null, theme, optionManager);
}
@@ -526,7 +530,22 @@ echartsProto.getConnectedDataURL = function (opts) {
var targetCanvas = zrUtil.createCanvas();
targetCanvas.width = width;
targetCanvas.height = height;
- var zr = zrender.init(targetCanvas);
+ var zr = zrender.init(targetCanvas); // Background between the charts
+
+ if (opts.connectedBackgroundColor) {
+ zr.add(new graphic.Rect({
+ shape: {
+ x: 0,
+ y: 0,
+ width: width,
+ height: height
+ },
+ style: {
+ fill: opts.connectedBackgroundColor
+ }
+ }));
+ }
+
each(canvasList, function (item) {
var img = new graphic.Image({
style: {
@@ -1326,7 +1345,7 @@ function renderSeries(ecIns, ecModel, api, payload, dirtyMap) {
});
scheduler.unfinished |= unfinished; // If use hover layer
- updateHoverLayerStatus(ecIns._zr, ecModel); // Add aria
+ updateHoverLayerStatus(ecIns, ecModel); // Add aria
aria(ecIns._zr.dom, ecModel);
}
@@ -1455,20 +1474,27 @@ echartsProto.dispose = function () {
zrUtil.mixin(ECharts, Eventful);
-function updateHoverLayerStatus(zr, ecModel) {
+function updateHoverLayerStatus(ecIns, ecModel) {
+ var zr = ecIns._zr;
var storage = zr.storage;
var elCount = 0;
storage.traverse(function (el) {
- if (!el.isGroup) {
- elCount++;
- }
+ elCount++;
});
if (elCount > ecModel.get('hoverLayerThreshold') && !env.node) {
- storage.traverse(function (el) {
- if (!el.isGroup) {
- // Don't switch back.
- el.useHoverLayer = true;
+ ecModel.eachSeries(function (seriesModel) {
+ if (seriesModel.preventUsingHoverLayer) {
+ return;
+ }
+
+ var chartView = ecIns._chartsMap[seriesModel.__viewId];
+
+ if (chartView.__alive) {
+ chartView.group.traverse(function (el) {
+ // Don't switch back.
+ el.useHoverLayer = true;
+ });
}
});
}
@@ -1743,7 +1769,7 @@ function enableConnect(chart) {
* @param {Object} [theme]
* @param {Object} opts
* @param {number} [opts.devicePixelRatio] Use window.devicePixelRatio by default
- * @param {string} [opts.renderer] Currently only 'canvas' is supported.
+ * @param {string} [opts.renderer] Can choose 'canvas' or 'svg' to render the chart.
* @param {number} [opts.width] Use clientWidth of the input `dom` by default.
* Can be 'auto' (the same as null/undefined)
* @param {number} [opts.height] Use clientHeight of the input `dom` by default.
diff --git a/public/en/builder/src/echarts/langEN.js b/public/en/builder/src/echarts/langEN.js
index 3aaa958..4ebdcff 100644
--- a/public/en/builder/src/echarts/langEN.js
+++ b/public/en/builder/src/echarts/langEN.js
@@ -53,5 +53,37 @@ export default {
title: 'Save as Image',
lang: ['Right Click to Save Image']
}
+ },
+ aria: {
+ general: {
+ withTitle: 'This is a chart about "{title}"',
+ withoutTitle: 'This is a chart'
+ },
+ series: {
+ single: {
+ prefix: '',
+ withName: ' with type {seriesType} named {seriesName}.',
+ withoutName: ' with type {seriesType}.'
+ },
+ multiple: {
+ prefix: '. It consists of {seriesCount} series count.',
+ withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',
+ withoutName: ' The {seriesId} series is a {seriesType}.',
+ separator: {
+ middle: '',
+ end: ''
+ }
+ }
+ },
+ data: {
+ allData: 'The data is as follows: ',
+ partialData: 'The first {displayCnt} items are: ',
+ withName: 'the data for {name} is {value}',
+ withoutName: '{value}',
+ separator: {
+ middle: ',',
+ end: '.'
+ }
+ }
}
};
\ No newline at end of file
diff --git a/public/zh/builder/src/echarts/langEN.js b/public/en/builder/src/echarts/langES.js
similarity index 63%
copy from public/zh/builder/src/echarts/langEN.js
copy to public/en/builder/src/echarts/langES.js
index 3aaa958..4467942 100644
--- a/public/zh/builder/src/echarts/langEN.js
+++ b/public/en/builder/src/echarts/langES.js
@@ -20,38 +20,38 @@ export default {
toolbox: {
brush: {
title: {
- rect: 'Box Select',
- polygon: 'Lasso Select',
- lineX: 'Horizontally Select',
- lineY: 'Vertically Select',
- keep: 'Keep Selections',
- clear: 'Clear Selections'
+ rect: 'Selección de cuadro',
+ polygon: 'Selección de lazo',
+ lineX: 'Seleccionar horizontalmente',
+ lineY: 'Seleccionar verticalmente',
+ keep: 'Mantener selección',
+ clear: 'Despejar selecciones'
}
},
dataView: {
- title: 'Data View',
- lang: ['Data View', 'Close', 'Refresh']
+ title: 'Ver datos',
+ lang: ['Ver datos', 'Cerrar', 'Actualizar']
},
dataZoom: {
title: {
zoom: 'Zoom',
- back: 'Zoom Reset'
+ back: 'Restablecer zoom'
}
},
magicType: {
title: {
- line: 'Switch to Line Chart',
- bar: 'Switch to Bar Chart',
- stack: 'Stack',
- tiled: 'Tile'
+ line: 'Cambiar a gráfico de líneas',
+ bar: 'Cambiar a gráfico de barras',
+ stack: 'Pila',
+ tiled: 'Teja'
}
},
restore: {
- title: 'Restore'
+ title: 'Restaurar'
},
saveAsImage: {
- title: 'Save as Image',
- lang: ['Right Click to Save Image']
+ title: 'Guardar como imagen',
+ lang: ['Clic derecho para guardar imagen']
}
}
};
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/layout/barGrid.js b/public/en/builder/src/echarts/layout/barGrid.js
index 067429b..22bce74 100644
--- a/public/en/builder/src/echarts/layout/barGrid.js
+++ b/public/en/builder/src/echarts/layout/barGrid.js
@@ -269,9 +269,9 @@ export function layout(seriesType, ecModel) {
for (var idx = 0, len = data.count(); idx < len; idx++) {
var value = data.get(valueDim, idx);
- var baseValue = data.get(baseDim, idx);
+ var baseValue = data.get(baseDim, idx); // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy".
- if (isNaN(value)) {
+ if (isNaN(value) || isNaN(baseValue)) {
continue;
}
@@ -364,22 +364,28 @@ export var largeLayout = {
};
function progress(params, data) {
- var largePoints = new LargeArr(params.count * 2);
+ var count = params.count;
+ var largePoints = new LargeArr(count * 2);
+ var largeDataIndices = new LargeArr(count);
var dataIndex;
var coord = [];
var valuePair = [];
- var offset = 0;
+ var pointsOffset = 0;
+ var idxOffset = 0;
while ((dataIndex = params.next()) != null) {
valuePair[valueDimIdx] = data.get(valueDim, dataIndex);
valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex);
- coord = cartesian.dataToPoint(valuePair, null, coord);
- largePoints[offset++] = coord[0];
- largePoints[offset++] = coord[1];
+ coord = cartesian.dataToPoint(valuePair, null, coord); // Data index might not be in order, depends on `progressiveChunkMode`.
+
+ largePoints[pointsOffset++] = coord[0];
+ largePoints[pointsOffset++] = coord[1];
+ largeDataIndices[idxOffset++] = dataIndex;
}
data.setLayout({
largePoints: largePoints,
+ largeDataIndices: largeDataIndices,
barWidth: barWidth,
valueAxisStart: getValueAxisStart(baseAxis, valueAxis, false),
valueAxisHorizontal: valueAxisHorizontal
diff --git a/public/en/builder/src/echarts/layout/barPolar.js b/public/en/builder/src/echarts/layout/barPolar.js
index c35db7b..9afd0ee 100644
--- a/public/en/builder/src/echarts/layout/barPolar.js
+++ b/public/en/builder/src/echarts/layout/barPolar.js
@@ -24,8 +24,8 @@ function getSeriesStackId(seriesModel) {
return seriesModel.get('stack') || '__ec_stack_' + seriesModel.seriesIndex;
}
-function getAxisKey(axis) {
- return axis.dim;
+function getAxisKey(polar, axis) {
+ return axis.dim + polar.model.componentIndex;
}
/**
* @param {string} seriesType
@@ -35,11 +35,6 @@ function getAxisKey(axis) {
function barLayoutPolar(seriesType, ecModel, api) {
- // FIXME
- // Revert becuase it brings bar progressive bug.
- // The complete fix will be added in the next version.
- var width = api.getWidth();
- var height = api.getHeight();
var lastStackCoords = {};
var barWidthAndOffset = calRadialBar(zrUtil.filter(ecModel.getSeriesByType(seriesType), function (seriesModel) {
return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'polar';
@@ -53,8 +48,9 @@ function barLayoutPolar(seriesType, ecModel, api) {
var data = seriesModel.getData();
var polar = seriesModel.coordinateSystem;
var baseAxis = polar.getBaseAxis();
+ var axisKey = getAxisKey(polar, baseAxis);
var stackId = getSeriesStackId(seriesModel);
- var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];
+ var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];
var columnOffset = columnLayoutInfo.offset;
var columnWidth = columnLayoutInfo.width;
var valueAxis = polar.getOtherAxis(baseAxis);
@@ -167,9 +163,10 @@ function calRadialBar(barSeries, api) {
var data = seriesModel.getData();
var polar = seriesModel.coordinateSystem;
var baseAxis = polar.getBaseAxis();
+ var axisKey = getAxisKey(polar, baseAxis);
var axisExtent = baseAxis.getExtent();
var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();
- var columnsOnAxis = columnsMap[getAxisKey(baseAxis)] || {
+ var columnsOnAxis = columnsMap[axisKey] || {
bandWidth: bandWidth,
remainedWidth: bandWidth,
autoWidthCount: 0,
@@ -178,7 +175,7 @@ function calRadialBar(barSeries, api) {
stacks: {}
};
var stacks = columnsOnAxis.stacks;
- columnsMap[getAxisKey(baseAxis)] = columnsOnAxis;
+ columnsMap[axisKey] = columnsOnAxis;
var stackId = getSeriesStackId(seriesModel);
if (!stacks[stackId]) {
diff --git a/public/en/builder/src/echarts/model/Global.js b/public/en/builder/src/echarts/model/Global.js
index 6fa4478..48cb6ca 100644
--- a/public/en/builder/src/echarts/model/Global.js
+++ b/public/en/builder/src/echarts/model/Global.js
@@ -486,7 +486,7 @@ var GlobalModel = Model.extend({
* After filtering, series may be different.
* frome raw series.
*
- * @parma {string} subType
+ * @param {string} subType.
* @param {Function} cb
* @param {*} context
*/
diff --git a/public/en/builder/src/echarts/model/OptionManager.js b/public/en/builder/src/echarts/model/OptionManager.js
index 288db7d..d2caad6 100644
--- a/public/en/builder/src/echarts/model/OptionManager.js
+++ b/public/en/builder/src/echarts/model/OptionManager.js
@@ -161,7 +161,7 @@ OptionManager.prototype = {
// (create a new object when modify itself).
- rawOption = clone(rawOption, true); // FIXME
+ rawOption = clone(rawOption); // FIXME
// 如果 timeline options 或者 media 中设置了某个属性,而baseOption中没有设置,则进行警告。
var oldOptionBackup = this._optionBackup;
diff --git a/public/en/builder/src/echarts/model/mixin/dataFormat.js b/public/en/builder/src/echarts/model/mixin/dataFormat.js
index a00573b..cffd4f6 100644
--- a/public/en/builder/src/echarts/model/mixin/dataFormat.js
+++ b/public/en/builder/src/echarts/model/mixin/dataFormat.js
@@ -40,6 +40,7 @@ export default {
var renderMode = getTooltipRenderMode(renderModeOption);
var mainType = this.mainType;
var isSeries = mainType === 'series';
+ var userOutput = data.userOutput;
return {
componentType: mainType,
componentSubType: this.subType,
@@ -54,6 +55,8 @@ export default {
dataType: dataType,
value: rawValue,
color: color,
+ dimensionNames: userOutput ? userOutput.dimensionNames : null,
+ encode: userOutput ? userOutput.encode : null,
marker: getTooltipMarker({
color: color,
renderMode: renderMode
@@ -68,7 +71,8 @@ export default {
* @param {number} dataIndex
* @param {string} [status='normal'] 'normal' or 'emphasis'
* @param {string} [dataType]
- * @param {number} [dimIndex]
+ * @param {number} [dimIndex] Only used in some chart that
+ * use formatter in different dimensions, like radar.
* @param {string} [labelProp='label']
* @return {string} If not formatter, return null/undefined
*/
@@ -86,6 +90,7 @@ export default {
if (typeof formatter === 'function') {
params.status = status;
+ params.dimensionIndex = dimIndex;
return formatter(params);
} else if (typeof formatter === 'string') {
var str = formatTpl(formatter, params); // Support 'aaa{@[3]}bbb{@product}ccc'.
diff --git a/public/en/builder/src/echarts/model/mixin/lineStyle.js b/public/en/builder/src/echarts/model/mixin/lineStyle.js
index e768e17..17a5188 100644
--- a/public/en/builder/src/echarts/model/mixin/lineStyle.js
+++ b/public/en/builder/src/echarts/model/mixin/lineStyle.js
@@ -20,9 +20,10 @@ import makeStyleMapper from './makeStyleMapper';
var getLineStyle = makeStyleMapper([['lineWidth', 'width'], ['stroke', 'color'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor']]);
export default {
getLineStyle: function (excludes) {
- var style = getLineStyle(this, excludes);
- var lineDash = this.getLineDash(style.lineWidth);
- lineDash && (style.lineDash = lineDash);
+ var style = getLineStyle(this, excludes); // Always set lineDash whether dashed, otherwise we can not
+ // erase the previous style when assigning to el.style.
+
+ style.lineDash = this.getLineDash(style.lineWidth);
return style;
},
getLineDash: function (lineWidth) {
@@ -33,6 +34,11 @@ export default {
var lineType = this.get('type');
var dotSize = Math.max(lineWidth, 2);
var dashSize = lineWidth * 4;
- return lineType === 'solid' || lineType == null ? null : lineType === 'dashed' ? [dashSize, dashSize] : [dotSize, dotSize];
+ return lineType === 'solid' || lineType == null ? // Use `false` but not `null` for the solid line here, because `null` might be
+ // ignored when assigning to `el.style`. e.g., when setting `lineStyle.type` as
+ // `'dashed'` and `emphasis.lineStyle.type` as `'solid'` in graph series, the
+ // `lineDash` gotten form the latter one is not able to erase that from the former
+ // one if using `null` here according to the emhpsis strategy in `util/graphic.js`.
+ false : lineType === 'dashed' ? [dashSize, dashSize] : [dotSize, dotSize];
}
};
\ No newline at end of file
diff --git a/public/en/builder/src/echarts/preprocessor/backwardCompat.js b/public/en/builder/src/echarts/preprocessor/backwardCompat.js
index d2db33e..811fe3e 100644
--- a/public/en/builder/src/echarts/preprocessor/backwardCompat.js
+++ b/public/en/builder/src/echarts/preprocessor/backwardCompat.js
@@ -85,7 +85,7 @@ export default function (option, isTheme) {
if (seriesType === 'gauge') {
var pointerColor = get(seriesOpt, 'pointer.color');
- pointerColor != null && set(seriesOpt, 'itemStyle.normal.color', pointerColor);
+ pointerColor != null && set(seriesOpt, 'itemStyle.color', pointerColor);
}
compatLayoutProperties(seriesOpt);
diff --git a/public/en/builder/src/echarts/util/graphic.js b/public/en/builder/src/echarts/util/graphic.js
index 16ad7b3..83a7b4b 100644
--- a/public/en/builder/src/echarts/util/graphic.js
+++ b/public/en/builder/src/echarts/util/graphic.js
@@ -40,11 +40,22 @@ import LinearGradient from 'zrender/src/graphic/LinearGradient';
import RadialGradient from 'zrender/src/graphic/RadialGradient';
import BoundingRect from 'zrender/src/core/BoundingRect';
import IncrementalDisplayable from 'zrender/src/graphic/IncrementalDisplayable';
-var round = Math.round;
+import * as subPixelOptimizeUtil from 'zrender/src/graphic/helper/subPixelOptimize';
var mathMax = Math.max;
var mathMin = Math.min;
var EMPTY_OBJ = {};
-export var Z2_EMPHASIS_LIFT = 1;
+export var Z2_EMPHASIS_LIFT = 1; // key: label model property nane, value: style property name.
+
+export var CACHED_LABEL_STYLE_PROPERTIES = {
+ color: 'textFill',
+ textBorderColor: 'textStroke',
+ textBorderWidth: 'textStrokeWidth'
+};
+var EMPHASIS = 'emphasis';
+var NORMAL = 'normal'; // Reserve 0 as default.
+
+var _highlightNextDigit = 1;
+var _highlightKeyMap = {};
/**
* Extend shape with parameters
*/
@@ -171,17 +182,7 @@ export function resizePath(path, rect) {
*/
export function subPixelOptimizeLine(param) {
- var shape = param.shape;
- var lineWidth = param.style.lineWidth;
-
- if (round(shape.x1 * 2) === round(shape.x2 * 2)) {
- shape.x1 = shape.x2 = subPixelOptimize(shape.x1, lineWidth, true);
- }
-
- if (round(shape.y1 * 2) === round(shape.y2 * 2)) {
- shape.y1 = shape.y2 = subPixelOptimize(shape.y1, lineWidth, true);
- }
-
+ subPixelOptimizeUtil.subPixelOptimizeLine(param.shape, param.shape, param.style);
return param;
}
/**
@@ -199,16 +200,7 @@ export function subPixelOptimizeLine(param) {
*/
export function subPixelOptimizeRect(param) {
- var shape = param.shape;
- var lineWidth = param.style.lineWidth;
- var originX = shape.x;
- var originY = shape.y;
- var originWidth = shape.width;
- var originHeight = shape.height;
- shape.x = subPixelOptimize(shape.x, lineWidth, true);
- shape.y = subPixelOptimize(shape.y, lineWidth, true);
- shape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - shape.x, originWidth === 0 ? 0 : 1);
- shape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - shape.y, originHeight === 0 ? 0 : 1);
+ subPixelOptimizeUtil.subPixelOptimizeRect(param.shape, param.shape, param.style);
return param;
}
/**
@@ -220,12 +212,7 @@ export function subPixelOptimizeRect(param) {
* @return {number} Optimized position.
*/
-export function subPixelOptimize(position, lineWidth, positiveOrNegative) {
- // Assure that (position + lineWidth / 2) is near integer edge,
- // otherwise line will be fuzzy in canvas.
- var doubledPosition = round(position * 2);
- return (doubledPosition + round(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;
-}
+export var subPixelOptimize = subPixelOptimizeUtil.subPixelOptimize;
function hasFillOrStroke(fillOrStroke) {
return fillOrStroke != null && fillOrStroke !== 'none';
@@ -272,7 +259,7 @@ function cacheElementStl(el) {
var elStyle = el.style;
for (var name in hoverStyle) {
- // See comment in `doSingleEnterHover`.
+ // See comment in `singleEnterEmphasis`.
if (hoverStyle[name] != null) {
normalStyle[name] = elStyle[name];
}
@@ -283,7 +270,7 @@ function cacheElementStl(el) {
normalStyle.stroke = elStyle.stroke;
}
-function doSingleEnterHover(el) {
+function singleEnterEmphasis(el) {
var hoverStl = el.__hoverStl;
if (!hoverStl || el.__highlighted) {
@@ -294,7 +281,7 @@ function doSingleEnterHover(el) {
el.__highlighted = useHoverLayer ? 'layer' : 'plain';
var zr = el.__zr;
- if (!zr && useHoverLayer) {
+ if (el.isGroup || !zr && useHoverLayer) {
return;
}
@@ -326,9 +313,13 @@ function doSingleEnterHover(el) {
// where properties of `emphasis` may not appear in `normal`. We previously use
// module:echarts/util/model#defaultEmphasis to merge `normal` to `emphasis`.
// But consider rich text and setOption in merge mode, it is impossible to cover
- // all properties in merge. So we use merge mode when setting style here, where
- // only properties that is not `null/undefined` can be set. The disadventage:
- // null/undefined can not be used to remove style any more in `emphasis`.
+ // all properties in merge. So we use merge mode when setting style here.
+ // But we choose the merge strategy that only properties that is not `null/undefined`.
+ // Because when making a textStyle (espacially rich text), it is not easy to distinguish
+ // `hasOwnProperty` and `null/undefined` in code, so we trade them as the same for simplicity.
+ // But this strategy brings a trouble that `null/undefined` can not be used to remove
+ // style any more in `emphasis`. Users can both set properties directly on normal and
+ // emphasis to avoid this issue, or we might support `'none'` for this case if required.
targetStyle.extendFrom(hoverStl);
@@ -348,7 +339,7 @@ function setDefaultHoverFillStroke(targetStyle, hoverStyle, prop) {
}
}
-function doSingleLeaveHover(el) {
+function singleEnterNormal(el) {
var highlighted = el.__highlighted;
if (!highlighted) {
@@ -357,16 +348,18 @@ function doSingleLeaveHover(el) {
el.__highlighted = false;
+ if (el.isGroup) {
+ return;
+ }
+
if (highlighted === 'layer') {
el.__zr && el.__zr.removeHover(el);
- } else if (highlighted) {
+ } else {
var style = el.style;
var normalStl = el.__cachedNormalStl;
if (normalStl) {
- rollbackDefaultTextStyle(style); // Consider null/undefined value, should use
- // `setStyle` but not `extendFrom(stl, true)`.
-
+ rollbackDefaultTextStyle(style);
el.setStyle(normalStl);
applyDefaultTextStyle(style);
} // `__cachedNormalZ2` will not be reset if calling `setElementHoverStyle`
@@ -382,10 +375,19 @@ function doSingleLeaveHover(el) {
}
}
-function traverseCall(el, method) {
- el.isGroup ? el.traverse(function (child) {
- !child.isGroup && method(child);
- }) : method(el);
+function traverseUpdate(el, updater, commonParam) {
+ // If root is group, also enter updater for `highDownOnUpdate`.
+ var fromState = NORMAL;
+ var toState = NORMAL;
+ var trigger; // See the rule of `highDownOnUpdate` on `graphic.setAsHighDownDispatcher`.
+
+ el.__highlighted && (fromState = EMPHASIS, trigger = true);
+ updater(el, commonParam);
+ el.__highlighted && (toState = EMPHASIS, trigger = true);
+ el.isGroup && el.traverse(function (child) {
+ !child.isGroup && updater(child, commonParam);
+ });
+ trigger && el.__highDownOnUpdate && el.__highDownOnUpdate(fromState, toState);
}
/**
* Set hover style (namely "emphasis style") of element, based on the current
@@ -394,20 +396,21 @@ function traverseCall(el, method) {
* to the `el`. See the reason on `setHoverStyle`.
*
* @param {module:zrender/Element} el Should not be `zrender/container/Group`.
+ * @param {Object} [el.hoverStyle] Can be set on el or its descendants,
+ * e.g., `el.hoverStyle = ...; graphic.setHoverStyle(el); `.
+ * Often used when item group has a label element and it's hoverStyle is different.
* @param {Object|boolean} [hoverStl] The specified hover style.
* If set as `false`, disable the hover style.
* Similarly, The `el.hoverStyle` can alse be set
* as `false` to disable the hover style.
* Otherwise, use the default hover style if not provided.
- * @param {Object} [opt]
- * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`
*/
export function setElementHoverStyle(el, hoverStl) {
// For performance consideration, it might be better to make the "hover style" only the
// difference properties from the "normal style", but not a entire copy of all styles.
- hoverStl = el.__hoverStl = hoverStl !== false && (hoverStl || {});
+ hoverStl = el.__hoverStl = hoverStl !== false && (el.hoverStyle || hoverStl || {});
el.__hoverStlDirty = true; // FIXME
// It is not completely right to save "normal"/"emphasis" flag on elements.
// It probably should be saved on `data` of series. Consider the cases:
@@ -425,52 +428,32 @@ export function setElementHoverStyle(el, hoverStl) {
// to rollback. Of course, that would bring bug, but only in a rare case, see
// `doSingleLeaveHover` for details.
- doSingleLeaveHover(el);
- doSingleEnterHover(el);
+ singleEnterNormal(el);
+ singleEnterEmphasis(el);
}
}
-/**
- * Emphasis (called by API) has higher priority than `mouseover`.
- * When element has been called to be entered emphasis, mouse over
- * should not trigger the highlight effect (for example, animation
- * scale) again, and `mouseout` should not downplay the highlight
- * effect. So the listener of `mouseover` and `mouseout` should
- * check `isInEmphasis`.
- *
- * @param {module:zrender/Element} el
- * @return {boolean}
- */
-
-export function isInEmphasis(el) {
- return el && el.__isEmphasisEntered;
-}
function onElementMouseOver(e) {
- if (this.__hoverSilentOnTouch && e.zrByTouch) {
- return;
- } // Only if element is not in emphasis status
-
-
- !this.__isEmphasisEntered && traverseCall(this, doSingleEnterHover);
+ !shouldSilent(this, e) // "emphasis" event highlight has higher priority than mouse highlight.
+ && !this.__highByOuter && traverseUpdate(this, singleEnterEmphasis);
}
function onElementMouseOut(e) {
- if (this.__hoverSilentOnTouch && e.zrByTouch) {
- return;
- } // Only if element is not in emphasis status
-
+ !shouldSilent(this, e) // "emphasis" event highlight has higher priority than mouse highlight.
+ && !this.__highByOuter && traverseUpdate(this, singleEnterNormal);
+}
- !this.__isEmphasisEntered && traverseCall(this, doSingleLeaveHover);
+function onElementEmphasisEvent(highlightDigit) {
+ this.__highByOuter |= 1 << (highlightDigit || 0);
+ traverseUpdate(this, singleEnterEmphasis);
}
-function enterEmphasis() {
- this.__isEmphasisEntered = true;
- traverseCall(this, doSingleEnterHover);
+function onElementNormalEvent(highlightDigit) {
+ !(this.__highByOuter &= ~(1 << (highlightDigit || 0))) && traverseUpdate(this, singleEnterNormal);
}
-function leaveEmphasis() {
- this.__isEmphasisEntered = false;
- traverseCall(this, doSingleLeaveHover);
+function shouldSilent(el, e) {
+ return el.__highDownSilentOnTouch && e.zrByTouch;
}
/**
* Set hover style (namely "emphasis style") of element,
@@ -501,24 +484,43 @@ function leaveEmphasis() {
* root group, we can simply mount the style on `el.hoverStyle` for them, but should
* not call this method for them.
*
+ * (3) These input parameters can be set directly on `el`:
+ *
* @param {module:zrender/Element} el
+ * @param {Object} [el.hoverStyle] See `graphic.setElementHoverStyle`.
+ * @param {boolean} [el.highDownSilentOnTouch=false] See `graphic.setAsHighDownDispatcher`.
+ * @param {Function} [el.highDownOnUpdate] See `graphic.setAsHighDownDispatcher`.
* @param {Object|boolean} [hoverStyle] See `graphic.setElementHoverStyle`.
- * @param {Object} [opt]
- * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`.
*/
-export function setHoverStyle(el, hoverStyle, opt) {
- el.isGroup ? el.traverse(function (child) {
- // If element has sepcified hoverStyle, then use it instead of given hoverStyle
- // Often used when item group has a label element and it's hoverStyle is different
- !child.isGroup && setElementHoverStyle(child, child.hoverStyle || hoverStyle);
- }) : setElementHoverStyle(el, el.hoverStyle || hoverStyle);
- setAsHoverStyleTrigger(el, opt);
+export function setHoverStyle(el, hoverStyle) {
+ setAsHighDownDispatcher(el, true);
+ traverseUpdate(el, setElementHoverStyle, hoverStyle);
}
/**
- * @param {Object|boolean} [opt] If `false`, means disable trigger.
- * @param {boolean} [opt.hoverSilentOnTouch=false]
+ * @param {module:zrender/Element} el
+ * @param {Function} [el.highDownOnUpdate] Called when state updated.
+ * Since `setHoverStyle` has the constraint that it must be called after
+ * all of the normal style updated, `highDownOnUpdate` is not needed to
+ * trigger if both `fromState` and `toState` is 'normal', and needed to
+ * trigger if both `fromState` and `toState` is 'emphasis', which enables
+ * to sync outside style settings to "emphasis" state.
+ * @this {string} This dispatcher `el`.
+ * @param {string} fromState Can be "normal" or "emphasis".
+ * `fromState` might equal to `toState`,
+ * for example, when this method is called when `el` is
+ * on "emphasis" state.
+ * @param {string} toState Can be "normal" or "emphasis".
+ *
+ * FIXME
+ * CAUTION: Do not expose `highDownOnUpdate` outside echarts.
+ * Because it is not a complete solution. The update
+ * listener should not have been mount in element,
+ * and the normal/emphasis state should not have
+ * mantained on elements.
+ *
+ * @param {boolean} [el.highDownSilentOnTouch=false]
* In touch device, mouseover event will be trigger on touchstart event
* (see module:zrender/dom/HandlerProxy). By this mechanism, we can
* conveniently use hoverStyle when tap on touch screen without additional
@@ -526,25 +528,57 @@ export function setHoverStyle(el, hoverStyle, opt) {
* But if the chart/component has select feature, which usually also use
* hoverStyle, there might be conflict between 'select-highlight' and
* 'hover-highlight' especially when roam is enabled (see geo for example).
- * In this case, hoverSilentOnTouch should be used to disable hover-highlight
- * on touch device.
+ * In this case, `highDownSilentOnTouch` should be used to disable
+ * hover-highlight on touch device.
+ * @param {boolean} [asDispatcher=true] If `false`, do not set as "highDownDispatcher".
*/
-export function setAsHoverStyleTrigger(el, opt) {
- var disable = opt === false;
- el.__hoverSilentOnTouch = opt != null && opt.hoverSilentOnTouch; // Simple optimize, since this method might be
+export function setAsHighDownDispatcher(el, asDispatcher) {
+ var disable = asDispatcher === false; // Make `highDownSilentOnTouch` and `highDownOnUpdate` only work after
+ // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly.
+
+ el.__highDownSilentOnTouch = el.highDownSilentOnTouch;
+ el.__highDownOnUpdate = el.highDownOnUpdate; // Simple optimize, since this method might be
// called for each elements of a group in some cases.
- if (!disable || el.__hoverStyleTrigger) {
+ if (!disable || el.__highDownDispatcher) {
var method = disable ? 'off' : 'on'; // Duplicated function will be auto-ignored, see Eventful.js.
- el[method]('mouseover', onElementMouseOver)[method]('mouseout', onElementMouseOut); // Emphasis, normal can be triggered manually
+ el[method]('mouseover', onElementMouseOver)[method]('mouseout', onElementMouseOut); // Emphasis, normal can be triggered manually by API or other components like hover link.
- el[method]('emphasis', enterEmphasis)[method]('normal', leaveEmphasis);
- el.__hoverStyleTrigger = !disable;
+ el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent); // Also keep previous record.
+
+ el.__highByOuter = el.__highByOuter || 0;
+ el.__highDownDispatcher = !disable;
}
}
/**
+ * @param {module:zrender/src/Element} el
+ * @return {boolean}
+ */
+
+export function isHighDownDispatcher(el) {
+ return !!(el && el.__highDownDispatcher);
+}
+/**
+ * Support hightlight/downplay record on each elements.
+ * For the case: hover highlight/downplay (legend, visualMap, ...) and
+ * user triggerred hightlight/downplay should not conflict.
+ * Only all of the highlightDigit cleared, return to normal.
+ * @param {string} highlightKey
+ * @return {number} highlightDigit
+ */
+
+export function getHighlightDigit(highlightKey) {
+ var highlightDigit = _highlightKeyMap[highlightKey];
+
+ if (highlightDigit == null && _highlightNextDigit <= 32) {
+ highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;
+ }
+
+ return highlightDigit;
+}
+/**
* See more info in `setTextStyleCommon`.
* @param {Object|module:zrender/graphic/Style} normalStyle
* @param {Object} emphasisStyle
@@ -604,6 +638,32 @@ export function setLabelStyle(normalStyle, emphasisStyle, normalModel, emphasisM
emphasisStyle.text = emphasisStyleText;
}
/**
+ * Modify label style manually.
+ * Only works after `setLabelStyle` and `setElementHoverStyle` called.
+ *
+ * @param {module:zrender/src/Element} el
+ * @param {Object} [normalStyleProps] optional
+ * @param {Object} [emphasisStyleProps] optional
+ */
+
+export function modifyLabelStyle(el, normalStyleProps, emphasisStyleProps) {
+ var elStyle = el.style;
+
+ if (normalStyleProps) {
+ rollbackDefaultTextStyle(elStyle);
+ el.setStyle(normalStyleProps);
+ applyDefaultTextStyle(elStyle);
+ }
+
+ elStyle = el.__hoverStl;
+
+ if (emphasisStyleProps && elStyle) {
+ rollbackDefaultTextStyle(elStyle);
+ zrUtil.extend(elStyle, emphasisStyleProps);
+ applyDefaultTextStyle(elStyle);
+ }
+}
+/**
* Set basic textStyle properties.
* See more info in `setTextStyleCommon`.
* @param {Object|module:zrender/graphic/Style} textStyle
@@ -720,6 +780,10 @@ function setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis) {
if (richItemNames.hasOwnProperty(name)) {
// Cascade is supported in rich.
var richTextStyle = textStyleModel.getModel(['rich', name]); // In rich, never `disableBox`.
+ // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`,
+ // the default color `'blue'` will not be adopted if no color declared in `rich`.
+ // That might confuses users. So probably we should put `textStyleModel` as the
+ // root ancestor of the `richTextStyle`. But that would be a break change.
setTokenTextStyle(richResult[name] = {}, richTextStyle, globalTextStyle, opt, isEmphasis);
}
@@ -778,10 +842,7 @@ function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isEm
globalTextStyle = !isEmphasis && globalTextStyle || EMPTY_OBJ;
textStyle.textFill = getAutoColor(textStyleModel.getShallow('color'), opt) || globalTextStyle.color;
textStyle.textStroke = getAutoColor(textStyleModel.getShallow('textBorderColor'), opt) || globalTextStyle.textBorderColor;
- textStyle.textStrokeWidth = zrUtil.retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth); // Save original textPosition, because style.textPosition will be repalced by
- // real location (like [10, 30]) in zrender.
-
- textStyle.insideRawTextPosition = textStyle.textPosition;
+ textStyle.textStrokeWidth = zrUtil.retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);
if (!isEmphasis) {
if (isBlock) {
@@ -850,42 +911,42 @@ function getAutoColor(color, opt) {
function applyDefaultTextStyle(textStyle) {
- var opt = textStyle.insideRollbackOpt; // Only `insideRollbackOpt` created (in `setTextStyleCommon`),
- // applyDefaultTextStyle works.
+ var textPosition = textStyle.textPosition;
+ var opt = textStyle.insideRollbackOpt;
+ var insideRollback;
- if (!opt || textStyle.textFill != null) {
- return;
- }
+ if (opt && textStyle.textFill == null) {
+ var autoColor = opt.autoColor;
+ var isRectText = opt.isRectText;
+ var useInsideStyle = opt.useInsideStyle;
+ var useInsideStyleCache = useInsideStyle !== false && (useInsideStyle === true || isRectText && textPosition // textPosition can be [10, 30]
+ && typeof textPosition === 'string' && textPosition.indexOf('inside') >= 0);
+ var useAutoColorCache = !useInsideStyleCache && autoColor != null; // All of the props declared in `CACHED_LABEL_STYLE_PROPERTIES` are to be cached.
+
+ if (useInsideStyleCache || useAutoColorCache) {
+ insideRollback = {
+ textFill: textStyle.textFill,
+ textStroke: textStyle.textStroke,
+ textStrokeWidth: textStyle.textStrokeWidth
+ };
+ }
- var useInsideStyle = opt.useInsideStyle;
- var textPosition = textStyle.insideRawTextPosition;
- var insideRollback;
- var autoColor = opt.autoColor;
-
- if (useInsideStyle !== false && (useInsideStyle === true || opt.isRectText && textPosition // textPosition can be [10, 30]
- && typeof textPosition === 'string' && textPosition.indexOf('inside') >= 0)) {
- insideRollback = {
- textFill: null,
- textStroke: textStyle.textStroke,
- textStrokeWidth: textStyle.textStrokeWidth
- };
- textStyle.textFill = '#fff'; // Consider text with #fff overflow its container.
+ if (useInsideStyleCache) {
+ textStyle.textFill = '#fff'; // Consider text with #fff overflow its container.
- if (textStyle.textStroke == null) {
- textStyle.textStroke = autoColor;
- textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2);
+ if (textStyle.textStroke == null) {
+ textStyle.textStroke = autoColor;
+ textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2);
+ }
}
- } else if (autoColor != null) {
- insideRollback = {
- textFill: null
- };
- textStyle.textFill = autoColor;
- } // Always set `insideRollback`, for clearing previous.
+ if (useAutoColorCache) {
+ textStyle.textFill = autoColor;
+ }
+ } // Always set `insideRollback`, so that the previous one can be cleared.
- if (insideRollback) {
- textStyle.insideRollback = insideRollback;
- }
+
+ textStyle.insideRollback = insideRollback;
}
/**
* Consider the case: in a scatter,
@@ -903,6 +964,7 @@ function rollbackDefaultTextStyle(style) {
var insideRollback = style.insideRollback;
if (insideRollback) {
+ // Reset all of the props in `CACHED_LABEL_STYLE_PROPERTIES`.
style.textFill = insideRollback.textFill;
style.textStroke = insideRollback.textStroke;
style.textStrokeWidth = insideRollback.textStrokeWidth;
diff --git a/public/en/builder/src/echarts/util/number.js b/public/en/builder/src/echarts/util/number.js
index 0856ee1..2043b91 100644
--- a/public/en/builder/src/echarts/util/number.js
+++ b/public/en/builder/src/echarts/util/number.js
@@ -138,6 +138,14 @@ export function round(x, precision, returnStr) {
x = (+x).toFixed(precision);
return returnStr ? x : +x;
}
+/**
+ * asc sort arr.
+ * The input arr will be modified.
+ *
+ * @param {Array} arr
+ * @return {Array} The input arr.
+ */
+
export function asc(arr) {
arr.sort(function (a, b) {
return a - b;
diff --git a/public/en/builder/src/echarts/util/symbol.js b/public/en/builder/src/echarts/util/symbol.js
index 1b1818a..a7cb50c 100644
--- a/public/en/builder/src/echarts/util/symbol.js
+++ b/public/en/builder/src/echarts/util/symbol.js
@@ -20,6 +20,7 @@
import * as zrUtil from 'zrender/src/core/util';
import * as graphic from './graphic';
import BoundingRect from 'zrender/src/core/BoundingRect';
+import { calculateTextPosition } from 'zrender/src/contain/text';
/**
* Triangle shape
* @inner
@@ -222,21 +223,22 @@ var SymbolClz = graphic.extendShape({
width: 0,
height: 0
},
- beforeBrush: function () {
- var style = this.style;
- var shape = this.shape; // FIXME
+ calculateTextPosition: function (out, style, rect) {
+ var res = calculateTextPosition(out, style, rect);
+ var shape = this.shape;
- if (shape.symbolType === 'pin' && style.textPosition === 'inside') {
- style.textPosition = ['50%', '40%'];
- style.textAlign = 'center';
- style.textVerticalAlign = 'middle';
+ if (shape && shape.symbolType === 'pin' && style.textPosition === 'inside') {
+ res.y = rect.y + rect.height * 0.4;
}
+
+ return res;
},
buildPath: function (ctx, shape, inBundle) {
var symbolType = shape.symbolType;
- var proxySymbol = symbolBuildProxies[symbolType];
- if (shape.symbolType !== 'none') {
+ if (symbolType !== 'none') {
+ var proxySymbol = symbolBuildProxies[symbolType];
+
if (!proxySymbol) {
// Default rect
symbolType = 'rect';
diff --git a/public/en/builder/src/echarts/view/Chart.js b/public/en/builder/src/echarts/view/Chart.js
index 0f3753c..b5a60af 100644
--- a/public/en/builder/src/echarts/view/Chart.js
+++ b/public/en/builder/src/echarts/view/Chart.js
@@ -21,6 +21,7 @@ import Group from 'zrender/src/container/Group';
import * as componentUtil from '../util/component';
import * as clazzUtil from '../util/clazz';
import * as modelUtil from '../util/model';
+import * as graphicUtil from '../util/graphic';
import { createTask } from '../stream/task';
import createRenderPlanner from '../chart/helper/createRenderPlanner';
var inner = modelUtil.makeInner();
@@ -157,39 +158,42 @@ chartProto.updateView = chartProto.updateLayout = chartProto.updateVisual = func
};
/**
* Set state of single element
- * @param {module:zrender/Element} el
- * @param {string} state
+ * @param {module:zrender/Element} el
+ * @param {string} state 'normal'|'emphasis'
+ * @param {number} highlightDigit
*/
-function elSetState(el, state) {
+function elSetState(el, state, highlightDigit) {
if (el) {
- el.trigger(state);
+ el.trigger(state, highlightDigit);
- if (el.type === 'group') {
- for (var i = 0; i < el.childCount(); i++) {
- elSetState(el.childAt(i), state);
+ if (el.isGroup // Simple optimize.
+ && !graphicUtil.isHighDownDispatcher(el)) {
+ for (var i = 0, len = el.childCount(); i < len; i++) {
+ elSetState(el.childAt(i), state, highlightDigit);
}
}
}
}
/**
- * @param {module:echarts/data/List} data
- * @param {Object} payload
- * @param {string} state 'normal'|'emphasis'
+ * @param {module:echarts/data/List} data
+ * @param {Object} payload
+ * @param {string} state 'normal'|'emphasis'
*/
function toggleHighlight(data, payload, state) {
var dataIndex = modelUtil.queryDataIndex(data, payload);
+ var highlightDigit = payload && payload.highlightKey != null ? graphicUtil.getHighlightDigit(payload.highlightKey) : null;
if (dataIndex != null) {
each(modelUtil.normalizeToArray(dataIndex), function (dataIdx) {
- elSetState(data.getItemGraphicEl(dataIdx), state);
+ elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);
});
} else {
data.eachItemGraphicEl(function (el) {
- elSetState(el, state);
+ elSetState(el, state, highlightDigit);
});
}
} // Enable Chart.extend.
diff --git a/public/en/builder/src/echarts/visual/symbol.js b/public/en/builder/src/echarts/visual/symbol.js
index cf1e915..7e80956 100644
--- a/public/en/builder/src/echarts/visual/symbol.js
+++ b/public/en/builder/src/echarts/visual/symbol.js
@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+import { isFunction } from 'zrender/src/core/util';
export default function (seriesType, defaultSymbolType, legendSymbol) {
// Encoding visual for all series include which is filtered for legend drawing
return {
@@ -24,13 +25,22 @@ export default function (seriesType, defaultSymbolType, legendSymbol) {
performRawSeries: true,
reset: function (seriesModel, ecModel, api) {
var data = seriesModel.getData();
- var symbolType = seriesModel.get('symbol') || defaultSymbolType;
+ var symbolType = seriesModel.get('symbol');
var symbolSize = seriesModel.get('symbolSize');
var keepAspect = seriesModel.get('symbolKeepAspect');
+ var hasSymbolTypeCallback = isFunction(symbolType);
+ var hasSymbolSizeCallback = isFunction(symbolSize);
+ var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback;
+ var seriesSymbol = !hasSymbolTypeCallback && symbolType ? symbolType : defaultSymbolType;
+ var seriesSymbolSize = !hasSymbolSizeCallback ? symbolSize : null;
data.setVisual({
- legendSymbol: legendSymbol || symbolType,
- symbol: symbolType,
- symbolSize: symbolSize,
+ legendSymbol: legendSymbol || seriesSymbol,
+ // If seting callback functions on `symbol` or `symbolSize`, for simplicity and avoiding
+ // to bring trouble, we do not pick a reuslt from one of its calling on data item here,
+ // but just use the default value. Callback on `symbol` or `symbolSize` is convenient in
+ // some cases but generally it is not recommanded.
+ symbol: seriesSymbol,
+ symbolSize: seriesSymbolSize,
symbolKeepAspect: keepAspect
}); // Only visible series has each data be visual encoded
@@ -38,14 +48,12 @@ export default function (seriesType, defaultSymbolType, legendSymbol) {
return;
}
- var hasCallback = typeof symbolSize === 'function';
-
function dataEach(data, idx) {
- if (typeof symbolSize === 'function') {
- var rawValue = seriesModel.getRawValue(idx); // FIXME
-
+ if (hasCallback) {
+ var rawValue = seriesModel.getRawValue(idx);
var params = seriesModel.getDataParams(idx);
- data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));
+ hasSymbolTypeCallback && data.setItemVisual(idx, 'symbol', symbolType(rawValue, params));
+ hasSymbolSizeCallback && data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));
}
if (data.hasItemOption) {
diff --git a/public/en/builder/src/echarts3/component/visualMap/PiecewiseModel.js b/public/en/builder/src/echarts3/component/visualMap/PiecewiseModel.js
index 7222927..108f0fe 100644
--- a/public/en/builder/src/echarts3/component/visualMap/PiecewiseModel.js
+++ b/public/en/builder/src/echarts3/component/visualMap/PiecewiseModel.js
@@ -349,7 +349,7 @@ var PiecewiseModel = VisualMapModel.extend({
/**
* Key is this._mode
* @type {Object}
- * @this {module:echarts/component/visualMap/PiecewiseMode}
+ * @this {module:echarts/component/viusalMap/PiecewiseMode}
*/
var resetMethods = {
diff --git a/public/en/builder/src/zrender/Painter.js b/public/en/builder/src/zrender/Painter.js
index dbc81b6..061c95e 100644
--- a/public/en/builder/src/zrender/Painter.js
+++ b/public/en/builder/src/zrender/Painter.js
@@ -48,8 +48,8 @@ function isDisplayableCulled(el, width, height) {
}
function isClipPathChanged(clipPaths, prevClipPaths) {
+ // displayable.__clipPaths can only be `null`/`undefined` or an non-empty array.
if (clipPaths === prevClipPaths) {
- // Can both be null or undefined
return false;
}
@@ -62,6 +62,8 @@ function isClipPathChanged(clipPaths, prevClipPaths) {
return true;
}
}
+
+ return false;
}
function doClip(clipPaths, ctx) {
@@ -473,12 +475,13 @@ Painter.prototype = {
// And setTransform with scale 0 will cause set back transform failed.
&& !(m && !m[0] && !m[3]) // Ignore culled element
&& !(el.culling && isDisplayableCulled(el, this._width, this._height))) {
- var clipPaths = el.__clipPaths; // Optimize when clipping on group with several elements
+ var clipPaths = el.__clipPaths;
+ var prevElClipPaths = scope.prevElClipPaths; // Optimize when clipping on group with several elements
- if (!scope.prevElClipPaths || isClipPathChanged(clipPaths, scope.prevElClipPaths)) {
+ if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {
// If has previous clipping state, restore from it
- if (scope.prevElClipPaths) {
- currentLayer.ctx.restore();
+ if (prevElClipPaths) {
+ ctx.restore();
scope.prevElClipPaths = null; // Reset prevEl since context has been restored
scope.prevEl = null;
diff --git a/public/en/builder/src/zrender/contain/text.js b/public/en/builder/src/zrender/contain/text.js
index 056ac8f..15ff093 100644
--- a/public/en/builder/src/zrender/contain/text.js
+++ b/public/en/builder/src/zrender/contain/text.js
@@ -127,14 +127,17 @@ export function adjustTextY(y, height, textVerticalAlign) {
return y;
}
/**
+ * Follow same interface to `Displayable.prototype.calculateTextPosition`.
* @public
- * @param {stirng} textPosition
- * @param {Object} rect {x, y, width, height}
- * @param {number} distance
- * @return {Object} {x, y, textAlign, textVerticalAlign}
+ * @param {Obejct} [out] Prepared out object. If not input, auto created in the method.
+ * @param {module:zrender/graphic/Style} style where `textPosition` and `textDistance` are visited.
+ * @param {Object} rect {x, y, width, height} Rect of the host elment, according to which the text positioned.
+ * @return {Object} The input `out`. Set: {x, y, textAlign, textVerticalAlign}
*/
-export function adjustTextPositionOnRect(textPosition, rect, distance) {
+export function calculateTextPosition(out, style, rect) {
+ var textPosition = style.textPosition;
+ var distance = style.textDistance;
var x = rect.x;
var y = rect.y;
var height = rect.height;
@@ -228,12 +231,29 @@ export function adjustTextPositionOnRect(textPosition, rect, distance) {
break;
}
- return {
- x: x,
- y: y,
- textAlign: textAlign,
- textVerticalAlign: textVerticalAlign
+ out = out || {};
+ out.x = x;
+ out.y = y;
+ out.textAlign = textAlign;
+ out.textVerticalAlign = textVerticalAlign;
+ return out;
+}
+/**
+ * To be removed. But still do not remove in case that some one has imported it.
+ * @deprecated
+ * @public
+ * @param {stirng} textPosition
+ * @param {Object} rect {x, y, width, height}
+ * @param {number} distance
+ * @return {Object} {x, y, textAlign, textVerticalAlign}
+ */
+
+export function adjustTextPositionOnRect(textPosition, rect, distance) {
+ var dummyStyle = {
+ textPosition: textPosition,
+ textDistance: distance
};
+ return calculateTextPosition({}, dummyStyle, rect);
}
/**
* Show ellipsis if overflow.
diff --git a/public/en/builder/src/zrender/core/PathProxy.js b/public/en/builder/src/zrender/core/PathProxy.js
index 7374836..7c86a8b 100644
--- a/public/en/builder/src/zrender/core/PathProxy.js
+++ b/public/en/builder/src/zrender/core/PathProxy.js
@@ -83,9 +83,11 @@ PathProxy.prototype = {
/**
* @readOnly
*/
- setScale: function (sx, sy) {
- this._ux = mathAbs(1 / dpr / sx) || 0;
- this._uy = mathAbs(1 / dpr / sy) || 0;
+ setScale: function (sx, sy, segmentIgnoreThreshold) {
+ // Compat. Previously there is no segmentIgnoreThreshold.
+ segmentIgnoreThreshold = segmentIgnoreThreshold || 0;
+ this._ux = mathAbs(segmentIgnoreThreshold / dpr / sx) || 0;
+ this._uy = mathAbs(segmentIgnoreThreshold / dpr / sy) || 0;
},
getContext: function () {
return this._ctx;
diff --git a/public/en/builder/src/zrender/core/event.js b/public/en/builder/src/zrender/core/event.js
index 17ae6ed..c4e60bc 100644
--- a/public/en/builder/src/zrender/core/event.js
+++ b/public/en/builder/src/zrender/core/event.js
@@ -1,21 +1,36 @@
/**
- * 事件辅助类
- * @module zrender/core/event
- * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
+ * Utilities for mouse or touch events.
*/
import Eventful from '../mixin/Eventful';
import env from './env';
+import { buildTransformer } from './fourPointsTransform';
var isDomLevel2 = typeof window !== 'undefined' && !!window.addEventListener;
var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;
-
-function getBoundingClientRect(el) {
- // BlackBerry 5, iOS 3 (original iPhone) don't have getBoundingRect
- return el.getBoundingClientRect ? el.getBoundingClientRect() : {
- left: 0,
- top: 0
- };
-} // `calculate` is optional, default false
-
+var EVENT_SAVED_PROP = '___zrEVENTSAVED';
+var _calcOut = [];
+/**
+ * Get the `zrX` and `zrY`, which are relative to the top-left of
+ * the input `el`.
+ * CSS transform (2D & 3D) is supported.
+ *
+ * The strategy to fetch the coords:
+ * + If `calculate` is not set as `true`, users of this method should
+ * ensure that `el` is the same or the same size & location as `e.target`.
+ * Otherwise the result coords are probably not expected. Because we
+ * firstly try to get coords from e.offsetX/e.offsetY.
+ * + If `calculate` is set as `true`, the input `el` can be any element
+ * and we force to calculate the coords based on `el`.
+ * + The input `el` should be positionable (not position:static).
+ *
+ * The force `calculate` can be used in case like:
+ * When mousemove event triggered on ec tooltip, `e.target` is not `el`(zr painter.dom).
+ *
+ * @param {HTMLElement} el DOM element.
+ * @param {Event} e Mouse event or touch event.
+ * @param {Object} out Get `out.zrX` and `out.zrY` as the result.
+ * @param {boolean} [calculate=false] Whether to force calculate
+ * the coordinates but not use ones provided by browser.
+ */
export function clientToLocal(el, e, out, calculate) {
out = out || {}; // According to the W3C Working Draft, offsetX and offsetY should be relative
@@ -24,13 +39,9 @@ export function clientToLocal(el, e, out, calculate) {
// not support the properties.
// (see http://www.jacklmoore.com/notes/mouse-position/)
// In zr painter.dom, padding edge equals to border edge.
- // FIXME
- // When mousemove event triggered on ec tooltip, target is not zr painter.dom, and
- // offsetX/Y is relative to e.target, where the calculation of zrX/Y via offsetX/Y
- // is too complex. So css-transfrom dont support in this case temporarily.
if (calculate || !env.canvasSupported) {
- defaultGetZrXY(el, e, out);
+ calculateZrXY(el, e, out);
} // Caution: In FireFox, layerX/layerY Mouse position relative to the closest positioned
// ancestor element, so we should make sure el is positioned (e.g., not position:static).
// BTW1, Webkit don't return the same results as FF in non-simple cases (like add
@@ -47,21 +58,108 @@ export function clientToLocal(el, e, out, calculate) {
out.zrY = e.offsetY;
} // For some other device, e.g., IOS safari.
else {
- defaultGetZrXY(el, e, out);
+ calculateZrXY(el, e, out);
}
return out;
}
-function defaultGetZrXY(el, e, out) {
- // This well-known method below does not support css transform.
- var box = getBoundingClientRect(el);
- out.zrX = e.clientX - box.left;
- out.zrY = e.clientY - box.top;
+function calculateZrXY(el, e, out) {
+ // BlackBerry 5, iOS 3 (original iPhone) don't have getBoundingRect.
+ if (el.getBoundingClientRect && env.domSupported) {
+ var ex = e.clientX;
+ var ey = e.clientY;
+
+ if (el.nodeName.toUpperCase() === 'CANVAS') {
+ // Original approach, which do not support CSS transform.
+ // marker can not be locationed in a canvas container
+ // (getBoundingClientRect is always 0). We do not support
+ // that input a pre-created canvas to zr while using css
+ // transform in iOS.
+ var box = el.getBoundingClientRect();
+ out.zrX = ex - box.left;
+ out.zrY = ey - box.top;
+ return;
+ } else {
+ var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});
+ var transformer = preparePointerTransformer(prepareCoordMarkers(el, saved), saved);
+
+ if (transformer) {
+ transformer(_calcOut, ex, ey);
+ out.zrX = _calcOut[0];
+ out.zrY = _calcOut[1];
+ return;
+ }
+ }
+ }
+
+ out.zrX = out.zrY = 0;
+}
+
+function prepareCoordMarkers(el, saved) {
+ var markers = saved.markers;
+
+ if (markers) {
+ return markers;
+ }
+
+ markers = saved.markers = [];
+ var propLR = ['left', 'right'];
+ var propTB = ['top', 'bottom'];
+
+ for (var i = 0; i < 4; i++) {
+ var marker = document.createElement('div');
+ var stl = marker.style;
+ var idxLR = i % 2;
+ var idxTB = (i >> 1) % 2;
+ stl.cssText = ['position:absolute', 'visibility: hidden', 'padding: 0', 'margin: 0', 'border-width: 0', 'width:0', 'height:0', // 'width: 5px',
+ // 'height: 5px',
+ propLR[idxLR] + ':0', propTB[idxTB] + ':0', propLR[1 - idxLR] + ':auto', propTB[1 - idxTB] + ':auto', ''].join('!important;');
+ el.appendChild(marker);
+ markers.push(marker);
+ }
+
+ return markers;
+}
+
+function preparePointerTransformer(markers, saved) {
+ var transformer = saved.transformer;
+ var oldSrcCoords = saved.srcCoords;
+ var useOld = true;
+ var srcCoords = [];
+ var destCoords = [];
+
+ for (var i = 0; i < 4; i++) {
+ var rect = markers[i].getBoundingClientRect();
+ var ii = 2 * i;
+ var x = rect.left;
+ var y = rect.top;
+ srcCoords.push(x, y);
+ useOld &= oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];
+ destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);
+ } // Cache to avoid time consuming of `buildTransformer`.
+
+
+ return useOld ? transformer : (saved.srcCoords = srcCoords, saved.transformer = buildTransformer(srcCoords, destCoords));
}
/**
- * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标.
- * `calculate` is optional, default false.
+ * Normalize the coordinates of the input event.
+ *
+ * Get the `e.zrX` and `e.zrY`, which are relative to the top-left of
+ * the input `el`.
+ * Get `e.zrDelta` if using mouse wheel.
+ * Get `e.which`, see the comment inside this function.
+ *
+ * Do not calculate repeatly if `zrX` and `zrY` already exist.
+ *
+ * Notice: see comments in `clientToLocal`. check the relationship
+ * between the result coords and the parameters `el` and `calculate`.
+ *
+ * @param {HTMLElement} el DOM element.
+ * @param {Event} [e] Mouse event or touch event. For lagency IE,
+ * do not need to input it and `window.event` is used.
+ * @param {boolean} [calculate=false] Whether to force calculate
+ * the coordinates but not use ones provided by browser.
*/
@@ -83,7 +181,7 @@ export function normalizeEvent(el, e, calculate) {
touch && clientToLocal(el, touch, e, calculate);
} // Add which for click: 1 === left; 2 === middle; 3 === right; otherwise: 0;
// See jQuery: https://github.com/jquery/jquery/blob/master/src/event.js
- // If e.which has been defined, if may be readonly,
+ // If e.which has been defined, it may be readonly,
// see: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/which
@@ -141,12 +239,10 @@ export function removeEventListener(el, name, handler) {
}
/**
* preventDefault and stopPropagation.
- * Notice: do not do that in zrender. Upper application
- * do that if necessary.
+ * Notice: do not use this method in zrender. It can only be
+ * used by upper applications if necessary.
*
- * @memberOf module:zrender/core/event
- * @method
- * @param {Event} e : event对象
+ * @param {Event} e A mouse or touch event.
*/
export var stop = isDomLevel2 ? function (e) {
@@ -176,6 +272,6 @@ export function isMiddleOrRightButtonOnMouseUpDown(e) {
export function notLeftMouse(e) {
// If e.which is undefined, considered as left mouse event.
return e.which > 1;
-} // 做向上兼容
+} // For backward compatibility
export { Eventful as Dispatcher };
\ No newline at end of file
diff --git a/public/en/builder/src/zrender/core/fourPointsTransform.js b/public/en/builder/src/zrender/core/fourPointsTransform.js
new file mode 100644
index 0000000..fd8c03d
--- /dev/null
+++ b/public/en/builder/src/zrender/core/fourPointsTransform.js
@@ -0,0 +1,90 @@
+/**
+ * The algoritm is learnt from
+ * https://franklinta.com/2014/09/08/computing-css-matrix3d-transforms/
+ * And we made some optimization for matrix inversion.
+ * Other similar approaches:
+ * "cv::getPerspectiveTransform", "Direct Linear Transformation".
+ */
+var LN2 = Math.log(2);
+
+function determinant(rows, rank, rowStart, rowMask, colMask, detCache) {
+ var cacheKey = rowMask + '-' + colMask;
+ var fullRank = rows.length;
+
+ if (detCache.hasOwnProperty(cacheKey)) {
+ return detCache[cacheKey];
+ }
+
+ if (rank === 1) {
+ // In this case the colMask must be like: `11101111`. We can find the place of `0`.
+ var colStart = Math.round(Math.log((1 << fullRank) - 1 & ~colMask) / LN2);
+ return rows[rowStart][colStart];
+ }
+
+ var subRowMask = rowMask | 1 << rowStart;
+ var subRowStart = rowStart + 1;
+
+ while (rowMask & 1 << subRowStart) {
+ subRowStart++;
+ }
+
+ var sum = 0;
+
+ for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {
+ var colTag = 1 << j;
+
+ if (!(colTag & colMask)) {
+ sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j] // det(subMatrix(0, j))
+ * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);
+ colLocalIdx++;
+ }
+ }
+
+ detCache[cacheKey] = sum;
+ return sum;
+}
+/**
+ * Usage:
+ * ```js
+ * var transformer = buildTransformer(
+ * [10, 44, 100, 44, 100, 300, 10, 300],
+ * [50, 54, 130, 14, 140, 330, 14, 220]
+ * );
+ * var out = [];
+ * transformer && transformer([11, 33], out);
+ * ```
+ *
+ * Notice: `buildTransformer` may take more than 10ms in some Android device.
+ *
+ * @param {Array.<number>} src source four points, [x0, y0, x1, y1, x2, y2, x3, y3]
+ * @param {Array.<number>} dest destination four points, [x0, y0, x1, y1, x2, y2, x3, y3]
+ * @return {Function} transformer If fail, return null/undefined.
+ */
+
+
+export function buildTransformer(src, dest) {
+ var mA = [[src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]], [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]], [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]], [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]], [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]], [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]], [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]], [0, [...]
+ var detCache = {};
+ var det = determinant(mA, 8, 0, 0, 0, detCache);
+
+ if (det === 0) {
+ return;
+ } // `invert(mA) * dest`, that is, `adj(mA) / det * dest`.
+
+
+ var vh = [];
+
+ for (var i = 0; i < 8; i++) {
+ for (var j = 0; j < 8; j++) {
+ vh[j] == null && (vh[j] = 0);
+ vh[j] += ((i + j) % 2 ? -1 : 1) * // det(subMatrix(i, j))
+ determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache) / det * dest[i];
+ }
+ }
+
+ return function (out, srcPointX, srcPointY) {
+ var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;
+ out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;
+ out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;
+ };
+}
\ No newline at end of file
diff --git a/public/en/builder/src/zrender/graphic/CompoundPath.js b/public/en/builder/src/zrender/graphic/CompoundPath.js
index b610e63..f89333a 100644
--- a/public/en/builder/src/zrender/graphic/CompoundPath.js
+++ b/public/en/builder/src/zrender/graphic/CompoundPath.js
@@ -28,7 +28,7 @@ export default Path.extend({
paths[i].createPathProxy();
}
- paths[i].path.setScale(scale[0], scale[1]);
+ paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);
}
},
buildPath: function (ctx, shape) {
diff --git a/public/en/builder/src/zrender/graphic/Displayable.js b/public/en/builder/src/zrender/graphic/Displayable.js
index 78a96d8..33cd875 100644
--- a/public/en/builder/src/zrender/graphic/Displayable.js
+++ b/public/en/builder/src/zrender/graphic/Displayable.js
@@ -29,8 +29,10 @@ function Displayable(opts) {
this.style = new Style(opts.style, this);
this._rect = null; // Shapes for cascade clipping.
+ // Can only be `null`/`undefined` or an non-empty array, MUST NOT be an empty array.
+ // because it is easy to only using null to check whether clipPaths changed.
- this.__clipPaths = []; // FIXME Stateful must be mixined after style is setted
+ this.__clipPaths = null; // FIXME Stateful must be mixined after style is setted
// Stateful.call(this, opts);
}
@@ -247,7 +249,28 @@ Displayable.prototype = {
this.style = new Style(obj, this);
this.dirty(false);
return this;
- }
+ },
+
+ /**
+ * The string value of `textPosition` needs to be calculated to a real postion.
+ * For example, `'inside'` is calculated to `[rect.width/2, rect.height/2]`
+ * by default. See `contain/text.js#calculateTextPosition` for more details.
+ * But some coutom shapes like "pin", "flag" have center that is not exactly
+ * `[width/2, height/2]`. So we provide this hook to customize the calculation
+ * for those shapes. It will be called if the `style.textPosition` is a string.
+ * @param {Obejct} [out] Prepared out object. If not provided, this method should
+ * be responsible for creating one.
+ * @param {module:zrender/graphic/Style} style
+ * @param {Object} rect {x, y, width, height}
+ * @return {Obejct} out The same as the input out.
+ * {
+ * x: number. mandatory.
+ * y: number. mandatory.
+ * textAlign: string. optional. use style.textAlign by default.
+ * textVerticalAlign: string. optional. use style.textVerticalAlign by default.
+ * }
+ */
+ calculateTextPosition: null
};
zrUtil.inherits(Displayable, Element);
zrUtil.mixin(Displayable, RectText); // zrUtil.mixin(Displayable, Stateful);
diff --git a/public/en/builder/src/zrender/graphic/Path.js b/public/en/builder/src/zrender/graphic/Path.js
index f169d3d..bd98470 100644
--- a/public/en/builder/src/zrender/graphic/Path.js
+++ b/public/en/builder/src/zrender/graphic/Path.js
@@ -28,6 +28,10 @@ Path.prototype = {
type: 'path',
__dirtyPath: true,
strokeContainThreshold: 5,
+ // This item default to be false. But in map series in echarts,
+ // in order to improve performance, it should be set to true,
+ // so the shorty segment won't draw.
+ segmentIgnoreThreshold: 0,
/**
* See `module:zrender/src/graphic/helper/subPixelOptimize`.
@@ -81,7 +85,7 @@ Path.prototype = {
var ctxLineDash = !!ctx.setLineDash; // Update path sx, sy
var scale = this.getGlobalScale();
- path.setScale(scale[0], scale[1]); // Proxy context
+ path.setScale(scale[0], scale[1], this.segmentIgnoreThreshold); // Proxy context
// Rebuild path in following 2 cases
// 1. Path is dirty
// 2. Path needs javascript implemented lineDash stroking.
diff --git a/public/en/builder/src/zrender/graphic/Style.js b/public/en/builder/src/zrender/graphic/Style.js
index bd7301c..6f0e1eb 100644
--- a/public/en/builder/src/zrender/graphic/Style.js
+++ b/public/en/builder/src/zrender/graphic/Style.js
@@ -76,7 +76,12 @@ Style.prototype = {
strokeOpacity: null,
/**
- * @type {Array.<number>}
+ * `true` is not supported.
+ * `false`/`null`/`undefined` are the same.
+ * `false` is used to remove lineDash in some
+ * case that `null`/`undefined` can not be set.
+ * (e.g., emphasis.lineStyle in echarts)
+ * @type {Array.<number>|boolean}
*/
lineDash: null,
diff --git a/public/en/builder/src/zrender/graphic/helper/text.js b/public/en/builder/src/zrender/graphic/helper/text.js
index 4015342..44aced0 100644
--- a/public/en/builder/src/zrender/graphic/helper/text.js
+++ b/public/en/builder/src/zrender/graphic/helper/text.js
@@ -19,6 +19,8 @@ var VALID_TEXT_VERTICAL_ALIGN = {
// the default value of shadowColor is `'transparent'`.
var SHADOW_STYLE_COMMON_PROPS = [['textShadowBlur', 'shadowBlur', 0], ['textShadowOffsetX', 'shadowOffsetX', 0], ['textShadowOffsetY', 'shadowOffsetY', 0], ['textShadowColor', 'shadowColor', 'transparent']];
+var _tmpTextPositionResult = {};
+var _tmpBoxPositionResult = {};
/**
* @param {module:zrender/graphic/Style} style
* @return {module:zrender/graphic/Style} The input style.
@@ -122,7 +124,7 @@ function renderPlainText(hostEl, ctx, text, style, rect, prevEl) {
var outerHeight = contentBlock.outerHeight;
var textLines = contentBlock.lines;
var lineHeight = contentBlock.lineHeight;
- var boxPos = getBoxPosition(outerHeight, style, rect);
+ var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect);
var baseX = boxPos.baseX;
var baseY = boxPos.baseY;
var textAlign = boxPos.textAlign || 'left';
@@ -229,7 +231,7 @@ function drawRichText(hostEl, ctx, contentBlock, style, rect) {
var outerWidth = contentBlock.outerWidth;
var outerHeight = contentBlock.outerHeight;
var textPadding = style.textPadding;
- var boxPos = getBoxPosition(outerHeight, style, rect);
+ var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect);
var baseX = boxPos.baseX;
var baseY = boxPos.baseY;
var textAlign = boxPos.textAlign;
@@ -433,7 +435,7 @@ function onBgImageLoaded(image, textBackgroundColor) {
textBackgroundColor.image = image;
}
-function getBoxPosition(blockHeiht, style, rect) {
+function getBoxPosition(out, hostEl, style, rect) {
var baseX = style.x || 0;
var baseY = style.y || 0;
var textAlign = style.textAlign;
@@ -447,7 +449,7 @@ function getBoxPosition(blockHeiht, style, rect) {
baseX = rect.x + parsePercent(textPosition[0], rect.width);
baseY = rect.y + parsePercent(textPosition[1], rect.height);
} else {
- var res = textContain.adjustTextPositionOnRect(textPosition, rect, style.textDistance);
+ var res = hostEl && hostEl.calculateTextPosition ? hostEl.calculateTextPosition(_tmpTextPositionResult, style, rect) : textContain.calculateTextPosition(_tmpTextPositionResult, style, rect);
baseX = res.x;
baseY = res.y; // Default align and baseline when has textPosition
@@ -465,12 +467,12 @@ function getBoxPosition(blockHeiht, style, rect) {
}
}
- return {
- baseX: baseX,
- baseY: baseY,
- textAlign: textAlign,
- textVerticalAlign: textVerticalAlign
- };
+ out = out || {};
+ out.baseX = baseX;
+ out.baseY = baseY;
+ out.textAlign = textAlign;
+ out.textVerticalAlign = textVerticalAlign;
+ return out;
}
function setCtx(ctx, prop, value) {
diff --git a/public/en/builder/src/zrender/svg/graphic.js b/public/en/builder/src/zrender/svg/graphic.js
index b85ccaf..a907e67 100644
--- a/public/en/builder/src/zrender/svg/graphic.js
+++ b/public/en/builder/src/zrender/svg/graphic.js
@@ -58,26 +58,6 @@ function bindStyle(svgEl, style, isText, el) {
if (pathHasFill(style, isText)) {
var fill = isText ? style.textFill : style.fill;
fill = fill === 'transparent' ? NONE : fill;
- /**
- * FIXME:
- * This is a temporary fix for Chrome's clipping bug
- * that happens when a clip-path is referring another one.
- * This fix should be used before Chrome's bug is fixed.
- * For an element that has clip-path, and fill is none,
- * set it to be "rgba(0, 0, 0, 0.002)" will hide the element.
- * Otherwise, it will show black fill color.
- * 0.002 is used because this won't work for alpha values smaller
- * than 0.002.
- *
- * See
- * https://bugs.chromium.org/p/chromium/issues/detail?id=659790
- * for more information.
- */
-
- if (svgEl.getAttribute('clip-path') !== 'none' && fill === NONE) {
- fill = 'rgba(0, 0, 0, 0.002)';
- }
-
attr(svgEl, 'fill', fill);
attr(svgEl, 'fill-opacity', style.fillOpacity != null ? style.fillOpacity * style.opacity : style.opacity);
} else {
@@ -317,6 +297,7 @@ svgImage.brush = function (el) {
var svgText = {};
export { svgText as text };
var tmpRect = new BoundingRect();
+var tmpTextPositionResult = {};
var svgTextDrawRectText = function (el, rect, textRect) {
var style = el.style;
@@ -340,7 +321,6 @@ var svgTextDrawRectText = function (el, rect, textRect) {
var x;
var y;
var textPosition = style.textPosition;
- var distance = style.textDistance;
var align = style.textAlign || 'left';
if (typeof style.fontSize === 'number') {
@@ -348,7 +328,7 @@ var svgTextDrawRectText = function (el, rect, textRect) {
}
var font = style.font || [style.fontStyle || '', style.fontWeight || '', style.fontSize || '', style.fontFamily || ''].join(' ') || textContain.DEFAULT_FONT;
- var verticalAlign = getVerticalAlignForSvg(style.textVerticalAlign);
+ var verticalAlign = style.textVerticalAlign;
textRect = textContain.getBoundingRect(text, font, align, verticalAlign, style.textPadding, style.textLineHeight);
var lineHeight = textRect.lineHeight; // Text position represented by coord
@@ -356,14 +336,14 @@ var svgTextDrawRectText = function (el, rect, textRect) {
x = rect.x + textPosition[0];
y = rect.y + textPosition[1];
} else {
- var newPos = textContain.adjustTextPositionOnRect(textPosition, rect, distance);
+ var newPos = el.calculateTextPosition ? el.calculateTextPosition(tmpTextPositionResult, style, rect) : textContain.calculateTextPosition(tmpTextPositionResult, style, rect);
x = newPos.x;
y = newPos.y;
- verticalAlign = getVerticalAlignForSvg(newPos.textVerticalAlign);
+ verticalAlign = newPos.textVerticalAlign;
align = newPos.textAlign;
}
- attr(textSvgEl, 'alignment-baseline', verticalAlign);
+ setVerticalAlign(textSvgEl, verticalAlign);
if (font) {
textSvgEl.style.font = font;
@@ -427,7 +407,7 @@ var svgTextDrawRectText = function (el, rect, textRect) {
var dy = 0;
- if (verticalAlign === 'after-edge') {
+ if (verticalAlign === 'bottom') {
dy = -textRect.height + lineHeight;
textPadding && (dy -= textPadding[2]);
} else if (verticalAlign === 'middle') {
@@ -449,7 +429,7 @@ var svgTextDrawRectText = function (el, rect, textRect) {
if (!tspan) {
tspan = tspanList[i] = createElement('tspan');
textSvgEl.appendChild(tspan);
- attr(tspan, 'alignment-baseline', verticalAlign);
+ setVerticalAlign(tspan, verticalAlign);
attr(tspan, 'text-anchor', textAnchor);
} else {
tspan.innerHTML = '';
@@ -483,13 +463,21 @@ var svgTextDrawRectText = function (el, rect, textRect) {
}
};
-function getVerticalAlignForSvg(verticalAlign) {
- if (verticalAlign === 'middle') {
- return 'middle';
- } else if (verticalAlign === 'bottom') {
- return 'after-edge';
- } else {
- return 'hanging';
+function setVerticalAlign(textSvgEl, verticalAlign) {
+ switch (verticalAlign) {
+ case 'middle':
+ attr(textSvgEl, 'dominant-baseline', 'middle');
+ attr(textSvgEl, 'alignment-baseline', 'middle');
+ break;
+
+ case 'bottom':
+ attr(textSvgEl, 'dominant-baseline', 'ideographic');
+ attr(textSvgEl, 'alignment-baseline', 'ideographic');
+ break;
+
+ default:
+ attr(textSvgEl, 'dominant-baseline', 'hanging');
+ attr(textSvgEl, 'alignment-baseline', 'hanging');
}
}
diff --git a/public/en/builder/src/zrender/svg/helper/ClippathManager.js b/public/en/builder/src/zrender/svg/helper/ClippathManager.js
index adbff2b..379df09 100644
--- a/public/en/builder/src/zrender/svg/helper/ClippathManager.js
+++ b/public/en/builder/src/zrender/svg/helper/ClippathManager.js
@@ -134,9 +134,9 @@ ClippathManager.prototype.updateDom = function (parentEl, clipPaths, isText) {
ClippathManager.prototype.markUsed = function (displayable) {
- var that = this;
+ var that = this; // displayable.__clipPaths can only be `null`/`undefined` or an non-empty array.
- if (displayable.__clipPaths && displayable.__clipPaths.length > 0) {
+ if (displayable.__clipPaths) {
zrUtil.each(displayable.__clipPaths, function (clipPath) {
if (clipPath._dom) {
Definable.prototype.markUsed.call(that, clipPath._dom);
diff --git a/public/en/builder/src/zrender/vml/graphic.js b/public/en/builder/src/zrender/vml/graphic.js
index 7958c61..c3da25a 100644
--- a/public/en/builder/src/zrender/vml/graphic.js
+++ b/public/en/builder/src/zrender/vml/graphic.js
@@ -219,7 +219,7 @@ if (!env.canvasSupported) {
// if (style.lineCap != null) {
// el.endcap = style.lineCap;
// }
- if (style.lineDash != null) {
+ if (style.lineDash) {
el.dashstyle = style.lineDash.join(' ');
}
@@ -826,15 +826,14 @@ if (!env.canvasSupported) {
}
if (!fromTextEl) {
- var textPosition = style.textPosition;
- var distance = style.textDistance; // Text position represented by coord
+ var textPosition = style.textPosition; // Text position represented by coord
if (textPosition instanceof Array) {
x = rect.x + parsePercent(textPosition[0], rect.width);
y = rect.y + parsePercent(textPosition[1], rect.height);
align = align || 'left';
} else {
- var res = textContain.adjustTextPositionOnRect(textPosition, rect, distance);
+ var res = this.calculateTextPosition ? this.calculateTextPosition({}, style, rect) : textContain.calculateTextPosition({}, style, rect);
x = res.x;
y = res.y; // Default align and baseline when has textPosition
@@ -948,7 +947,8 @@ if (!env.canvasSupported) {
updateFillAndStroke(textVmlEl, 'stroke', {
stroke: style.textStroke,
opacity: style.opacity,
- lineDash: style.lineDash
+ lineDash: style.lineDash || null // style.lineDash can be `false`.
+
}, this);
textVmlEl.style.zIndex = getZIndex(this.zlevel, this.z, this.z2); // Attached to root
diff --git a/public/en/builder/src/zrender/zrender.js b/public/en/builder/src/zrender/zrender.js
index 2c6071e..ce775f4 100644
--- a/public/en/builder/src/zrender/zrender.js
+++ b/public/en/builder/src/zrender/zrender.js
@@ -25,7 +25,7 @@ var instances = {}; // ZRender实例map索引
* @type {string}
*/
-export var version = '4.0.7';
+export var version = '4.1.0';
/**
* Initializing a zrender instance
* @param {HTMLElement} dom
@@ -222,13 +222,10 @@ ZRender.prototype = {
// var start = new Date();
// Clear needsRefresh ahead to avoid something wrong happens in refresh
// Or it will cause zrender refreshes again and again.
- this._needsRefresh = false;
- this.painter.refresh();
- /**
- * Avoid trigger zr.refresh in Element#beforeUpdate hook
- */
+ this._needsRefresh = this._needsRefreshHover = false;
+ this.painter.refresh(); // Avoid trigger zr.refresh in Element#beforeUpdate hook
- this._needsRefresh = false; // var end = new Date();
+ this._needsRefresh = this._needsRefreshHover = false; // var end = new Date();
// var log = document.getElementById('log');
// if (log) {
// log.innerHTML = log.innerHTML + '<br>' + (end - start);
diff --git a/public/en/changelog.html b/public/en/changelog.html
index 28fbdc8..268fede 100644
--- a/public/en/changelog.html
+++ b/public/en/changelog.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html lang="en-US"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
+<!DOCTYPE html><html lang="en-US"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
</script><script type="text/javascript" src="./vendors/pace/pace.min.js"></script><script id="font-hack" type="text/javascript">if (/windows/i.test(navigator.userAgent)) {
var el = document.createElement('style');
el.innerHTML = ''
@@ -7,7 +7,176 @@
document.head.insertBefore(el, document.getElementById('font-hack'));
}
</script><title>ECharts Changelog</title><script type="text/javascript" src="./vendors/jquery/jquery.min.js"></script></head><!--[if lte IE 8]><body class="lower-ie"><div id="lowie-main"><img src="./images/forie.png" alt="ie tip"></div></body><![endif]-->
-<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="main"><nav class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="https://echarts.a [...]
+<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="apache-banner"><div class="txt"><p>Apache ECharts is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator.</p><p>We are working on redirecting this Website to <a href="https://echarts.apache.org" target="_blank">https://echarts.apache.org</a>. You may visit our new official Website now.</p></div><a href="https://echarts.apache.org" target="_blank" onclick="lo [...]
+<div class="time">2019-08-27</div>
+
+<ul>
+<li><p>[Feature] Sankey diagram enhancement:
+Add left/right node align, right in sankey diagram.
+Support user to specify the depth of the node.
+Enhance sankey node tooltip formatter.
+Add depth layout info for each node.</p>
+</li>
+<li><p>[Feature] Support callback in <code>series.symbol</code>. Contributed by PR #9664 originally.</p>
+</li>
+<li><p>[Feature] Enhance Pie chart:
+Support <code>minShowLabelAngle</code>. Contributed by PR #8997 originally.
+Support label rotate in pie chart. Fix #10045.</p>
+</li>
+<li><p>[Feature] Support <code>backgroundColor</code> for connected charts in toolbox. <code>toolbox.feature.saveAsImage.connectedBackgroundColor</code> can be used to set the background color. Fix #10099.</p>
+</li>
+<li><p>[Feature] Enhance toolbox:
+Enable to set text style of toolbox.
+Support tooltip for toolbox. Fix #10202.</p>
+</li>
+<li><p>[Feature] Enhance dataZoom:
+Normalize illegal range setting and get accurate <code>start</code>/<code>end</code>/<code>startValue</code>/<code>endValue</code> in <code>'dataZoom'</code> event.</p>
+</li>
+<li><p>[Feature] Add <code>dimensionNames</code> and <code>encode</code> info to callback parameters of formatters. Fix #10248 and Close #10250.</p>
+</li>
+<li><p>[Feature] Funnel enhancement:
+<code>series.label.position</code> support to set <code>rightTop</code>, <code>rightBottom</code>, <code>leftTop</code>, <code>leftBottom</code>. And fix style in funnel text position.</p>
+</li>
+<li><p>[Fix] Support mouse event in iOS when css transform used. Fix #9434, #8326, #5009, #5921.</p>
+</li>
+<li><p>[Fix] Use a clearer warning message when initing dom without size. Fix #10478.</p>
+</li>
+<li><p>[Fix] Fix that the rgba opacity does not work in SVG renderer. Fix #9014</p>
+</li>
+<li><p>[Fix] Enhance funnel chart label display policy PR #8759</p>
+</li>
+<li><p>[Fix] Fix the highlight/downplay of pie graphic.</p>
+</li>
+<li><p>[Fix] Fix the mouse pointer in force graph. Fix #7764, contributed by PR #9134.</p>
+</li>
+<li><p>[Fix] Fix that <code>symbol</code> and <code>symbolSize</code> and <code>opacity</code> does not work in <code>series[i]-graph.categories[i]</code>. Fix #8009 and #5969, contributed by PR #9171.</p>
+</li>
+<li><p>[Fix] Fix that <code>axisLine.show</code> does not work in the gauge. Fix #9194, contributed by PR #9195.</p>
+</li>
+<li><p>[Fix] Fix a display error when the first data item is '-' in radar. Fix 8962.</p>
+</li>
+<li><p>[Fix] Fix polygon rendering bug when the first value is <code>NaN</code>. Fix #8962, contributed by PR #9162.</p>
+</li>
+<li><p>[Fix] Fix text truncate bug in treemap when using SVG renderer.</p>
+</li>
+<li><p>[Fix] Fix that <code>label.rotate</code> does not work in graph. Fix #9182, contributed by PR #9210.</p>
+</li>
+<li><p>[Fix] Fix the rich content hiding bug and confine bug in tooltip. Fix ecomfe/echarts-for-weixin#360, ecomfe/echarts-for-weixin#347.</p>
+</li>
+<li><p>[Fix] Fix that callback function params.color is incorrect in sunburst area. Fix #8952, contributed by PR #9238.</p>
+</li>
+<li><p>[Fix] Fix that when <code>axisLabel.interval</code> of a category axis is set as <code>0</code>, all labels are displayed regardless of overlap. Fix #9589.</p>
+</li>
+<li><p>[Fix] Fix sub-pixel in markLine. Move subPixelOptimize to zrender. Fix #9598.</p>
+</li>
+<li><p>[Fix] Fix that when doing clear on click handler error is thrown. Fix #9649.</p>
+</li>
+<li><p>[Fix] Fix that <code>false</code> value in data items effect subsequent items in <code>visualMap</code>. Fix #8799.</p>
+</li>
+<li><p>[Fix] Enhance <code>hoverStyle</code> and <code>highlight</code>/<code>downplay</code> API. Support keep highlighted when changing style (e.g., <code>setOption</code> or <code>hoverLink</code>). Fix the highlight conflict.</p>
+</li>
+<li><p>[Fix] Fix radar line disappear on hover when there is empty value in data.</p>
+</li>
+<li><p>[Fix] Fix that geo map panning not working on Edge browser. Fix #9479.</p>
+</li>
+<li><p>[Fix] Fix map label bugs:
+Fix map rich label missing when missing data.
+Fix map label miss to enter formatter when missing data.
+Fix #9682.</p>
+</li>
+<li><p>[Fix] Enable <code>triggerEvent</code> for label of <code>angleAxis</code>. Fix #9765.</p>
+</li>
+<li><p>[Fix] Fix that the hover style bugs of graph:
+Fix that the hover style is disabled by <code>focusNodeAdjacency</code> in graph.
+Fix that the line label can not be returned to its original opacity after <code>"focusNodeAdjacency"</code>.</p>
+</li>
+<li><p>[Fix] Lift the axis line arrow over splitLine and tick.</p>
+</li>
+<li><p>[Fix] Fix that the scrollable legend pager does not work when the target index is illegal. Fix #7568.</p>
+</li>
+<li><p>[Fix] Exclude padding from tooltip position, since it's included in clientWidth. Contributed by PR #9750.</p>
+</li>
+<li><p>[Fix] Fix <code>barWidth</code> calculation when stack on multiple polars. Fix #9626.</p>
+</li>
+<li><p>[Fix] Loop to find the first non-NaN angle for clipPath in pie.</p>
+</li>
+<li><p>[Fix] Fix line width in singleAxis. Fix #9965.</p>
+</li>
+<li><p>[Fix] Fix the label bounding rect calculation error when <code>rich</code> used (e.g., containLabel: true while axisLabel has rich).</p>
+</li>
+<li><p>[Fix] Part of emphasis in sunburst do not work. Fix #9563, constributed by PR #9993.</p>
+</li>
+<li><p>[Fix] Add <code>seriesId</code> in <code>pieselectchanged</code>. Fix #9830.</p>
+</li>
+<li><p>[Fix] Fix that axis name align does not work. Fix #9901.</p>
+</li>
+<li><p>[Fix] Fix taht the strange label position when the pie chart series data value is <code>null</code>. Fix #10088.</p>
+</li>
+<li><p>[Fix] Do not create an anchor element if you don't need to in <code>SaveAsImage</code>. Contributed by PR #10132.</p>
+</li>
+<li><p>[Fix] Fix that <code>axisLabel</code> dost not display correctly in radar. Fix #9282, contributed by PR #10036.</p>
+</li>
+<li><p>[Fix] Fix that bar chart is abnormal when <code>filterMode</code> of <code>dataZoom</code> is 'empty'. Fix #9882.</p>
+</li>
+<li><p>[Fix] Fix <code>series.label.formatter</code> callback bug. Fix #10248, contributed by PR #10250.</p>
+</li>
+<li><p>[Fix] Fix that the last axis labels are duplicated. Fix #10304.</p>
+</li>
+<li><p>[Fix] Fix that setting <code>emphasis.lineStyle.type</code> as <code>solid</code> dose not work. Fix #9704, close #10129.</p>
+</li>
+<li><p>[Fix] Fix that if some negetive numbers or strings existing in the dimensions array, the corresponding line will not show. Fix #10343.</p>
+</li>
+<li><p>[Fix] Fix that when <code>'0'</code> existing in dimentions the chart do not work. Make backward compat when dimention is a number-like string. Fix #9363, contributed by PR #9388.</p>
+</li>
+<li><p>[Fix] Fix hover style on <code>textStroke</code> bug in custom series.</p>
+</li>
+<li><p>[Fix] Fix graph bug when data is number typed. Fix #10485.</p>
+</li>
+<li><p>[Fix] Fix that <code>axisPointer</code> label padding does not work. Fix #10569.</p>
+</li>
+<li><p>[Fix] Add <code>dimIndex</code> for callback formatter in radar. Close #10403, #10180, contributed PR #10437.</p>
+</li>
+<li><p>[Fix] Prevent treamap from using hover layer by default. Fix #10521. Ref #10635.</p>
+</li>
+<li><p>[Fix] Update pointer when type is none. Fix #10570.</p>
+</li>
+<li><p>[Fix] Enhance circular layout: based on symbol size and fix overlap when some value are very smaller than the max value. Fix #10462, Close #10615.</p>
+</li>
+<li><p>[Fix] Support click and tooltip in bar large mode. Fix #10699.</p>
+</li>
+</ul>
+<h2 id="v4-2-1">v4.2.1</h2>
+<div class="time">2019-03-21</div>
+
+<ul>
+<li><p>[Fix] Fix text cache problem. See <a href="https://github.com/apache/incubator-echarts/issues/9190">#9190</a>, <a href="https://github.com/apache/incubator-echarts/issues/9597">#9597</a>, <a href="https://github.com/apache/incubator-echarts/issues/9762">#9762</a>.</p>
+</li>
+<li><p>[Fix] Fix that in some case re-<code>setOption</code> in event handler throws error. See <a href="https://github.com/apache/incubator-echarts/issues/9649">#9649</a>.</p>
+</li>
+<li><p>[Fix] Fix that geo region problem causes <code>showTip</code> abnormal. See <a href="https://github.com/apache/incubator-echarts/issues/9156">#9156</a>.</p>
+</li>
+<li><p>[Fix] Fix that stacked bars are over cartesian in some cases. See <a href="https://github.com/apache/incubator-echarts/issues/9346">#9346</a>.</p>
+</li>
+<li><p>[Fix] Fix that legend is not able to scroll when the space is not enough to contain one item. See <a href="https://github.com/apache/incubator-echarts/issues/6743">#6743</a>, <a href="https://github.com/apache/incubator-echarts/issues/8971">#8971</a>, <a href="https://github.com/apache/incubator-echarts/issues/9471">#9471</a>.</p>
+</li>
+<li><p>[Fix] Fix that the centered pie label might has some bias on some angles. See <a href="https://github.com/apache/incubator-echarts/issues/9657">#9657</a>.</p>
+</li>
+<li><p>[Fix] Fix that Geo map panning is not working on MS Edge browser See <a href="https://github.com/apache/incubator-echarts/issues/9479">#9479</a>.</p>
+</li>
+<li><p>[Fix] Fix that label dispaly problem in map series. See <a href="https://github.com/apache/incubator-echarts/issues/9682">#9682</a>.</p>
+</li>
+<li><p>[Fix] Fix that <code>visualMap: false</code> set on data items makes subsequent items abnormal. See <a href="https://github.com/apache/incubator-echarts/issues/8799">#8799</a>.</p>
+</li>
+<li><p>[Fix] When <code>axisLabel.interval</code> of a category axis is set as <code>0</code>, all labels show regardless of overlap. See <a href="https://github.com/apache/incubator-echarts/issues/9589">#9589</a>.</p>
+</li>
+<li><p>[Fix] Fix grid(cartesian) did not render when both containLabel and axisLabel.rich used.</p>
+</li>
+<li><p>[Fix] Fix license statement.</p>
+</li>
+<li><p>[Fix] Fix rich text boundingRect bug.</p>
+</li>
+</ul>
+<h2 id="v4-2-1-rc1">v4.2.1.rc1</h2>
<div class="time">2019-01-22</div>
<ul>
@@ -942,10 +1111,14 @@
// Fix scroll position covered by nav
window.addEventListener('hashchange', function() {
scrollBy(0, -50);
-});</script><script type="text/javascript">var _hmt = _hmt || [];
+});</script><!-- Baidu Tongji--><script type="text/javascript">var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
-hm.src = "//hm.baidu.com/hm.js?4bad1df23f079e0d12bdbef5e65b072f";
+hm.src = "https://hm.baidu.com/hm.js?54b918eee37cb8a7045f0fd0f0b24395";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
-})();</script></html>
\ No newline at end of file
+})();
+</script><!-- Google Analytics--><script type="text/javascript" async src="https://www.googletagmanager.com/gtag/js?id=UA-141228404-1"></script><script type="text/javascript">window.dataLayer = window.dataLayer || [];
+function gtag(){dataLayer.push(arguments);}
+gtag('js', new Date());
+gtag('config', 'UA-141228404-1');</script></html>
\ No newline at end of file
diff --git a/public/en/cheat-sheet.html b/public/en/cheat-sheet.html
new file mode 100644
index 0000000..d7af037
--- /dev/null
+++ b/public/en/cheat-sheet.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html><html lang="en-US"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
+</script><script type="text/javascript" src="./vendors/pace/pace.min.js"></script><script id="font-hack" type="text/javascript">if (/windows/i.test(navigator.userAgent)) {
+ var el = document.createElement('style');
+ el.innerHTML = ''
+ + '@font-face {font-family:"noto-thin";src:local("Microsoft Yahei");}'
+ + '@font-face {font-family:"noto-light";src:local("Microsoft Yahei");}';
+ document.head.insertBefore(el, document.getElementById('font-hack'));
+}
+</script><title>ECharts Cheat Sheet</title><script type="text/javascript" src="./vendors/jquery/jquery.min.js"></script></head><!--[if lte IE 8]><body class="lower-ie"><div id="lowie-main"><img src="./images/forie.png" alt="ie tip"></div></body><![endif]-->
+<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="apache-banner"><div class="txt"><p>Apache ECharts is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator.</p><p>We are working on redirecting this Website to <a href="https://echarts.apache.org" target="_blank">https://echarts.apache.org</a>. You may visit our new official Website now.</p></div><a href="https://echarts.apache.org" target="_blank" onclick="lo [...]
+</script><script src="./vendors/echarts/echarts-20190709.min.js"></script><script src="./js/cheat-sheet-en.js"></script><!-- Baidu Tongji--><script type="text/javascript">var _hmt = _hmt || [];
+(function() {
+var hm = document.createElement("script");
+hm.src = "https://hm.baidu.com/hm.js?54b918eee37cb8a7045f0fd0f0b24395";
+var s = document.getElementsByTagName("script")[0];
+s.parentNode.insertBefore(hm, s);
+})();
+</script><!-- Google Analytics--><script type="text/javascript" async src="https://www.googletagmanager.com/gtag/js?id=UA-141228404-1"></script><script type="text/javascript">window.dataLayer = window.dataLayer || [];
+function gtag(){dataLayer.push(arguments);}
+gtag('js', new Date());
+gtag('config', 'UA-141228404-1');</script></html>
\ No newline at end of file
diff --git a/public/en/coding-standard.html b/public/en/coding-standard.html
index 4cf44c8..8b79988 100644
--- a/public/en/coding-standard.html
+++ b/public/en/coding-standard.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html lang="en-US"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
+<!DOCTYPE html><html lang="en-US"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
</script><script type="text/javascript" src="./vendors/pace/pace.min.js"></script><script id="font-hack" type="text/javascript">if (/windows/i.test(navigator.userAgent)) {
var el = document.createElement('style');
el.innerHTML = ''
@@ -7,7 +7,7 @@
document.head.insertBefore(el, document.getElementById('font-hack'));
}
</script><title>ECharts Coding Standard</title><link rel="stylesheet" type="text/css" href="./vendors/prettify/prettify.css"><script type="text/javascript" src="./vendors/prettify/prettify.js"></script><script type="text/javascript" src="./vendors/prettify/lang-css.js"></script><script type="text/javascript" src="./vendors/jquery/jquery.min.js"></script></head><!--[if lte IE 8]><body class="lower-ie"><div id="lowie-main"><img src="./images/forie.png" alt="ie tip"></div></body><![endif]-->
-<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="main"><nav class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="https://echarts.a [...]
+<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="apache-banner"><div class="txt"><p>Apache ECharts is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator.</p><p>We are working on redirecting this Website to <a href="https://echarts.apache.org" target="_blank">https://echarts.apache.org</a>. You may visit our new official Website now.</p></div><a href="https://echarts.apache.org" target="_blank" onclick="lo [...]
<h3 id="file">File</h3>
<p><strong>[MUST]</strong> JavaScript Source files must be encoded in UTF-8 without BOM.</p>
<h3 id="indentation">Indentation</h3>
@@ -605,10 +605,14 @@ window.addEventListener('hashchange', function() {
$('.page-detail pre code').each(function (index, el) {
$(el).addClass('prettyprint');
});
-prettyPrint();</script><script type="text/javascript">var _hmt = _hmt || [];
+prettyPrint();</script><!-- Baidu Tongji--><script type="text/javascript">var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
-hm.src = "//hm.baidu.com/hm.js?4bad1df23f079e0d12bdbef5e65b072f";
+hm.src = "https://hm.baidu.com/hm.js?54b918eee37cb8a7045f0fd0f0b24395";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
-})();</script></html>
\ No newline at end of file
+})();
+</script><!-- Google Analytics--><script type="text/javascript" async src="https://www.googletagmanager.com/gtag/js?id=UA-141228404-1"></script><script type="text/javascript">window.dataLayer = window.dataLayer || [];
+function gtag(){dataLayer.push(arguments);}
+gtag('js', new Date());
+gtag('config', 'UA-141228404-1');</script></html>
\ No newline at end of file
diff --git a/public/en/committers.html b/public/en/committers.html
index c7505fd..6547df5 100644
--- a/public/en/committers.html
+++ b/public/en/committers.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html lang="en-US"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
+<!DOCTYPE html><html lang="en-US"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
</script><script type="text/javascript" src="./vendors/pace/pace.min.js"></script><script id="font-hack" type="text/javascript">if (/windows/i.test(navigator.userAgent)) {
var el = document.createElement('style');
el.innerHTML = ''
@@ -7,10 +7,14 @@
document.head.insertBefore(el, document.getElementById('font-hack'));
}
</script><title>ECharts Committers</title><script type="text/javascript" src="./vendors/jquery/jquery.min.js"></script></head><!--[if lte IE 8]><body class="lower-ie"><div id="lowie-main"><img src="./images/forie.png" alt="ie tip"></div></body><![endif]-->
-<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="main"><nav class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="https://echarts.a [...]
+<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="apache-banner"><div class="txt"><p>Apache ECharts is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator.</p><p>We are working on redirecting this Website to <a href="https://echarts.apache.org" target="_blank">https://echarts.apache.org</a>. You may visit our new official Website now.</p></div><a href="https://echarts.apache.org" target="_blank" onclick="lo [...]
(function() {
var hm = document.createElement("script");
-hm.src = "//hm.baidu.com/hm.js?4bad1df23f079e0d12bdbef5e65b072f";
+hm.src = "https://hm.baidu.com/hm.js?54b918eee37cb8a7045f0fd0f0b24395";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
-})();</script></html>
\ No newline at end of file
+})();
+</script><!-- Google Analytics--><script type="text/javascript" async src="https://www.googletagmanager.com/gtag/js?id=UA-141228404-1"></script><script type="text/javascript">window.dataLayer = window.dataLayer || [];
+function gtag(){dataLayer.push(arguments);}
+gtag('js', new Date());
+gtag('config', 'UA-141228404-1');</script></html>
\ No newline at end of file
diff --git a/public/en/css/main.css b/public/en/css/main.css
index 81178e4..1aed9ee 100644
--- a/public/en/css/main.css
+++ b/public/en/css/main.css
@@ -1 +1 @@
-@font-face{font-family:'iconfont';src:url("font/iconfont.eot");src:url("font/iconfont.eot?#iefix") format("embedded-opentype"),url("font/iconfont.woff") format("woff"),url("font/iconfont.ttf") format("truetype"),url("font/iconfont.svg#iconfont") format("svg")}.iconfont{font-family:"iconfont" !important;speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}html{height:100%}body{height:10 [...]
+@font-face{font-family:'iconfont';src:url("font/iconfont.eot");src:url("font/iconfont.eot?#iefix") format("embedded-opentype"),url("font/iconfont.woff") format("woff"),url("font/iconfont.ttf") format("truetype"),url("font/iconfont.svg#iconfont") format("svg")}.iconfont{font-family:"iconfont" !important;speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}html{height:100%}body{height:10 [...]
diff --git a/public/en/dependencies.html b/public/en/dependencies.html
index c35cedd..b307575 100644
--- a/public/en/dependencies.html
+++ b/public/en/dependencies.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html lang="en-US"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
+<!DOCTYPE html><html lang="en-US"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no"><meta name="description" content="ECharts, a powerful, interactive charting and visualization library for browser"><link rel="shortcut icon" href="images/favicon.png"><link rel="stylesheet" type="text/css" href="vendors/bootstrap/css/bootstrap.min.css"><!-- HTML5 shim and Respond.js for IE [...]
</script><script type="text/javascript" src="./vendors/pace/pace.min.js"></script><script id="font-hack" type="text/javascript">if (/windows/i.test(navigator.userAgent)) {
var el = document.createElement('style');
el.innerHTML = ''
@@ -7,10 +7,14 @@
document.head.insertBefore(el, document.getElementById('font-hack'));
}
</script><title>ECharts Dependencies</title><script type="text/javascript" src="./vendors/jquery/jquery.min.js"></script></head><!--[if lte IE 8]><body class="lower-ie"><div id="lowie-main"><img src="./images/forie.png" alt="ie tip"></div></body><![endif]-->
-<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="main"><nav class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="https://echarts.a [...]
+<!--[if (gt IE 8)|!(IE)]><body class="undefined"></body><![endif]--><div id="apache-banner"><div class="txt"><p>Apache ECharts is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator.</p><p>We are working on redirecting this Website to <a href="https://echarts.apache.org" target="_blank">https://echarts.apache.org</a>. You may visit our new official Website now.</p></div><a href="https://echarts.apache.org" target="_blank" onclick="lo [...]
(function() {
var hm = document.createElement("script");
-hm.src = "//hm.baidu.com/hm.js?4bad1df23f079e0d12bdbef5e65b072f";
+hm.src = "https://hm.baidu.com/hm.js?54b918eee37cb8a7045f0fd0f0b24395";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
-})();</script></html>
\ No newline at end of file
+})();
+</script><!-- Google Analytics--><script type="text/javascript" async src="https://www.googletagmanager.com/gtag/js?id=UA-141228404-1"></script><script type="text/javascript">window.dataLayer = window.dataLayer || [];
+function gtag(){dataLayer.push(arguments);}
+gtag('js', new Date());
+gtag('config', 'UA-141228404-1');</script></html>
\ No newline at end of file
diff --git a/public/en/dist/echarts-en.common.js b/public/en/dist/echarts-en.common.js
index dcb4ab0..9605e93 100644
--- a/public/en/dist/echarts-en.common.js
+++ b/public/en/dist/echarts-en.common.js
@@ -1616,21 +1616,138 @@ function on(eventful, event, query, handler, context, isOnce) {
}
/**
- * 事件辅助类
- * @module zrender/core/event
- * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
+ * The algoritm is learnt from
+ * https://franklinta.com/2014/09/08/computing-css-matrix3d-transforms/
+ * And we made some optimization for matrix inversion.
+ * Other similar approaches:
+ * "cv::getPerspectiveTransform", "Direct Linear Transformation".
*/
-var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener;
+var LN2 = Math.log(2);
-var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;
+function determinant(rows, rank, rowStart, rowMask, colMask, detCache) {
+ var cacheKey = rowMask + '-' + colMask;
+ var fullRank = rows.length;
+
+ if (detCache.hasOwnProperty(cacheKey)) {
+ return detCache[cacheKey];
+ }
+
+ if (rank === 1) {
+ // In this case the colMask must be like: `11101111`. We can find the place of `0`.
+ var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);
+ return rows[rowStart][colStart];
+ }
+
+ var subRowMask = rowMask | (1 << rowStart);
+ var subRowStart = rowStart + 1;
+ while (rowMask & (1 << subRowStart)) {
+ subRowStart++;
+ }
-function getBoundingClientRect(el) {
- // BlackBerry 5, iOS 3 (original iPhone) don't have getBoundingRect
- return el.getBoundingClientRect ? el.getBoundingClientRect() : {left: 0, top: 0};
+ var sum = 0;
+ for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {
+ var colTag = 1 << j;
+ if (!(colTag & colMask)) {
+ sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]
+ // det(subMatrix(0, j))
+ * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);
+ colLocalIdx++;
+ }
+ }
+
+ detCache[cacheKey] = sum;
+
+ return sum;
}
-// `calculate` is optional, default false
+/**
+ * Usage:
+ * ```js
+ * var transformer = buildTransformer(
+ * [10, 44, 100, 44, 100, 300, 10, 300],
+ * [50, 54, 130, 14, 140, 330, 14, 220]
+ * );
+ * var out = [];
+ * transformer && transformer([11, 33], out);
+ * ```
+ *
+ * Notice: `buildTransformer` may take more than 10ms in some Android device.
+ *
+ * @param {Array.<number>} src source four points, [x0, y0, x1, y1, x2, y2, x3, y3]
+ * @param {Array.<number>} dest destination four points, [x0, y0, x1, y1, x2, y2, x3, y3]
+ * @return {Function} transformer If fail, return null/undefined.
+ */
+function buildTransformer(src, dest) {
+ var mA = [
+ [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],
+ [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],
+ [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],
+ [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],
+ [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],
+ [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],
+ [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],
+ [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]
+ ];
+
+ var detCache = {};
+ var det = determinant(mA, 8, 0, 0, 0, detCache);
+ if (det === 0) {
+ return;
+ }
+
+ // `invert(mA) * dest`, that is, `adj(mA) / det * dest`.
+ var vh = [];
+ for (var i = 0; i < 8; i++) {
+ for (var j = 0; j < 8; j++) {
+ vh[j] == null && (vh[j] = 0);
+ vh[j] += ((i + j) % 2 ? -1 : 1)
+ // det(subMatrix(i, j))
+ * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)
+ / det * dest[i];
+ }
+ }
+
+ return function (out, srcPointX, srcPointY) {
+ var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;
+ out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;
+ out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;
+ };
+}
+
+/**
+ * Utilities for mouse or touch events.
+ */
+
+var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener;
+
+var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;
+var EVENT_SAVED_PROP = '___zrEVENTSAVED';
+var _calcOut = [];
+
+/**
+ * Get the `zrX` and `zrY`, which are relative to the top-left of
+ * the input `el`.
+ * CSS transform (2D & 3D) is supported.
+ *
+ * The strategy to fetch the coords:
+ * + If `calculate` is not set as `true`, users of this method should
+ * ensure that `el` is the same or the same size & location as `e.target`.
+ * Otherwise the result coords are probably not expected. Because we
+ * firstly try to get coords from e.offsetX/e.offsetY.
+ * + If `calculate` is set as `true`, the input `el` can be any element
+ * and we force to calculate the coords based on `el`.
+ * + The input `el` should be positionable (not position:static).
+ *
+ * The force `calculate` can be used in case like:
+ * When mousemove event triggered on ec tooltip, `e.target` is not `el`(zr painter.dom).
+ *
+ * @param {HTMLElement} el DOM element.
+ * @param {Event} e Mouse event or touch event.
+ * @param {Object} out Get `out.zrX` and `out.zrY` as the result.
+ * @param {boolean} [calculate=false] Whether to force calculate
+ * the coordinates but not use ones provided by browser.
+ */
function clientToLocal(el, e, out, calculate) {
out = out || {};
@@ -1641,12 +1758,8 @@ function clientToLocal(el, e, out, calculate) {
// (see http://www.jacklmoore.com/notes/mouse-position/)
// In zr painter.dom, padding edge equals to border edge.
- // FIXME
- // When mousemove event triggered on ec tooltip, target is not zr painter.dom, and
- // offsetX/Y is relative to e.target, where the calculation of zrX/Y via offsetX/Y
- // is too complex. So css-transfrom dont support in this case temporarily.
if (calculate || !env$1.canvasSupported) {
- defaultGetZrXY(el, e, out);
+ calculateZrXY(el, e, out);
}
// Caution: In FireFox, layerX/layerY Mouse position relative to the closest positioned
// ancestor element, so we should make sure el is positioned (e.g., not position:static).
@@ -1666,22 +1779,125 @@ function clientToLocal(el, e, out, calculate) {
}
// For some other device, e.g., IOS safari.
else {
- defaultGetZrXY(el, e, out);
+ calculateZrXY(el, e, out);
}
return out;
}
-function defaultGetZrXY(el, e, out) {
- // This well-known method below does not support css transform.
- var box = getBoundingClientRect(el);
- out.zrX = e.clientX - box.left;
- out.zrY = e.clientY - box.top;
+function calculateZrXY(el, e, out) {
+ // BlackBerry 5, iOS 3 (original iPhone) don't have getBoundingRect.
+ if (el.getBoundingClientRect && env$1.domSupported) {
+ var ex = e.clientX;
+ var ey = e.clientY;
+
+ if (el.nodeName.toUpperCase() === 'CANVAS') {
+ // Original approach, which do not support CSS transform.
+ // marker can not be locationed in a canvas container
+ // (getBoundingClientRect is always 0). We do not support
+ // that input a pre-created canvas to zr while using css
+ // transform in iOS.
+ var box = el.getBoundingClientRect();
+ out.zrX = ex - box.left;
+ out.zrY = ey - box.top;
+ return;
+ }
+ else {
+ var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});
+ var transformer = preparePointerTransformer(prepareCoordMarkers(el, saved), saved);
+ if (transformer) {
+ transformer(_calcOut, ex, ey);
+ out.zrX = _calcOut[0];
+ out.zrY = _calcOut[1];
+ return;
+ }
+ }
+ }
+ out.zrX = out.zrY = 0;
+}
+
+function prepareCoordMarkers(el, saved) {
+ var markers = saved.markers;
+ if (markers) {
+ return markers;
+ }
+
+ markers = saved.markers = [];
+ var propLR = ['left', 'right'];
+ var propTB = ['top', 'bottom'];
+
+ for (var i = 0; i < 4; i++) {
+ var marker = document.createElement('div');
+ var stl = marker.style;
+ var idxLR = i % 2;
+ var idxTB = (i >> 1) % 2;
+ stl.cssText = [
+ 'position:absolute',
+ 'visibility: hidden',
+ 'padding: 0',
+ 'margin: 0',
+ 'border-width: 0',
+ 'width:0',
+ 'height:0',
+ // 'width: 5px',
+ // 'height: 5px',
+ propLR[idxLR] + ':0',
+ propTB[idxTB] + ':0',
+ propLR[1 - idxLR] + ':auto',
+ propTB[1 - idxTB] + ':auto',
+ ''
+ ].join('!important;');
+ el.appendChild(marker);
+ markers.push(marker);
+ }
+
+ return markers;
+}
+
+function preparePointerTransformer(markers, saved) {
+ var transformer = saved.transformer;
+ var oldSrcCoords = saved.srcCoords;
+ var useOld = true;
+ var srcCoords = [];
+ var destCoords = [];
+
+ for (var i = 0; i < 4; i++) {
+ var rect = markers[i].getBoundingClientRect();
+ var ii = 2 * i;
+ var x = rect.left;
+ var y = rect.top;
+ srcCoords.push(x, y);
+ useOld &= oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];
+ destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);
+ }
+
+ // Cache to avoid time consuming of `buildTransformer`.
+ return useOld
+ ? transformer
+ : (
+ saved.srcCoords = srcCoords,
+ saved.transformer = buildTransformer(srcCoords, destCoords)
+ );
}
/**
- * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标.
- * `calculate` is optional, default false.
+ * Normalize the coordinates of the input event.
+ *
+ * Get the `e.zrX` and `e.zrY`, which are relative to the top-left of
+ * the input `el`.
+ * Get `e.zrDelta` if using mouse wheel.
+ * Get `e.which`, see the comment inside this function.
+ *
+ * Do not calculate repeatly if `zrX` and `zrY` already exist.
+ *
+ * Notice: see comments in `clientToLocal`. check the relationship
+ * between the result coords and the parameters `el` and `calculate`.
+ *
+ * @param {HTMLElement} el DOM element.
+ * @param {Event} [e] Mouse event or touch event. For lagency IE,
+ * do not need to input it and `window.event` is used.
+ * @param {boolean} [calculate=false] Whether to force calculate
+ * the coordinates but not use ones provided by browser.
*/
function normalizeEvent(el, e, calculate) {
@@ -1707,7 +1923,7 @@ function normalizeEvent(el, e, calculate) {
// Add which for click: 1 === left; 2 === middle; 3 === right; otherwise: 0;
// See jQuery: https://github.com/jquery/jquery/blob/master/src/event.js
- // If e.which has been defined, if may be readonly,
+ // If e.which has been defined, it may be readonly,
// see: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/which
var button = e.button;
if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {
@@ -1767,12 +1983,10 @@ function removeEventListener(el, name, handler) {
/**
* preventDefault and stopPropagation.
- * Notice: do not do that in zrender. Upper application
- * do that if necessary.
+ * Notice: do not use this method in zrender. It can only be
+ * used by upper applications if necessary.
*
- * @memberOf module:zrender/core/event
- * @method
- * @param {Event} e : event对象
+ * @param {Event} e A mouse or touch event.
*/
var stop = isDomLevel2
? function (e) {
@@ -6705,7 +6919,12 @@ Style.prototype = {
strokeOpacity: null,
/**
- * @type {Array.<number>}
+ * `true` is not supported.
+ * `false`/`null`/`undefined` are the same.
+ * `false` is used to remove lineDash in some
+ * case that `null`/`undefined` can not be set.
+ * (e.g., emphasis.lineStyle in echarts)
+ * @type {Array.<number>|boolean}
*/
lineDash: null,
@@ -7510,7 +7729,7 @@ function getWidth(text, font) {
*/
function getBoundingRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) {
return rich
- ? getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, rich, textLineHeight, truncate)
+ ? getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate)
: getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, truncate);
}
@@ -7585,13 +7804,16 @@ function adjustTextY(y, height, textVerticalAlign) {
}
/**
+ * Follow same interface to `Displayable.prototype.calculateTextPosition`.
* @public
- * @param {stirng} textPosition
- * @param {Object} rect {x, y, width, height}
- * @param {number} distance
- * @return {Object} {x, y, textAlign, textVerticalAlign}
+ * @param {Obejct} [out] Prepared out object. If not input, auto created in the method.
+ * @param {module:zrender/graphic/Style} style where `textPosition` and `textDistance` are visited.
+ * @param {Object} rect {x, y, width, height} Rect of the host elment, according to which the text positioned.
+ * @return {Object} The input `out`. Set: {x, y, textAlign, textVerticalAlign}
*/
-function adjustTextPositionOnRect(textPosition, rect, distance) {
+function calculateTextPosition(out, style, rect) {
+ var textPosition = style.textPosition;
+ var distance = style.textDistance;
var x = rect.x;
var y = rect.y;
@@ -7676,15 +7898,27 @@ function adjustTextPositionOnRect(textPosition, rect, distance) {
break;
}
- return {
- x: x,
- y: y,
- textAlign: textAlign,
- textVerticalAlign: textVerticalAlign
- };
+ out = out || {};
+ out.x = x;
+ out.y = y;
+ out.textAlign = textAlign;
+ out.textVerticalAlign = textVerticalAlign;
+
+ return out;
}
/**
+ * To be removed. But still do not remove in case that some one has imported it.
+ * @deprecated
+ * @public
+ * @param {stirng} textPosition
+ * @param {Object} rect {x, y, width, height}
+ * @param {number} distance
+ * @return {Object} {x, y, textAlign, textVerticalAlign}
+ */
+
+
+/**
* Show ellipsis if overflow.
*
* @public
@@ -8227,6 +8461,8 @@ var SHADOW_STYLE_COMMON_PROPS = [
['textShadowOffsetY', 'shadowOffsetY', 0],
['textShadowColor', 'shadowColor', 'transparent']
];
+var _tmpTextPositionResult = {};
+var _tmpBoxPositionResult = {};
/**
* @param {module:zrender/graphic/Style} style
@@ -8345,7 +8581,7 @@ function renderPlainText(hostEl, ctx, text, style, rect, prevEl) {
var textLines = contentBlock.lines;
var lineHeight = contentBlock.lineHeight;
- var boxPos = getBoxPosition(outerHeight, style, rect);
+ var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect);
var baseX = boxPos.baseX;
var baseY = boxPos.baseY;
var textAlign = boxPos.textAlign || 'left';
@@ -8456,7 +8692,7 @@ function drawRichText(hostEl, ctx, contentBlock, style, rect) {
var outerHeight = contentBlock.outerHeight;
var textPadding = style.textPadding;
- var boxPos = getBoxPosition(outerHeight, style, rect);
+ var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect);
var baseX = boxPos.baseX;
var baseY = boxPos.baseY;
var textAlign = boxPos.textAlign;
@@ -8689,7 +8925,7 @@ function onBgImageLoaded(image, textBackgroundColor) {
textBackgroundColor.image = image;
}
-function getBoxPosition(blockHeiht, style, rect) {
+function getBoxPosition(out, hostEl, style, rect) {
var baseX = style.x || 0;
var baseY = style.y || 0;
var textAlign = style.textAlign;
@@ -8704,9 +8940,9 @@ function getBoxPosition(blockHeiht, style, rect) {
baseY = rect.y + parsePercent(textPosition[1], rect.height);
}
else {
- var res = adjustTextPositionOnRect(
- textPosition, rect, style.textDistance
- );
+ var res = (hostEl && hostEl.calculateTextPosition)
+ ? hostEl.calculateTextPosition(_tmpTextPositionResult, style, rect)
+ : calculateTextPosition(_tmpTextPositionResult, style, rect);
baseX = res.x;
baseY = res.y;
// Default align and baseline when has textPosition
@@ -8723,14 +8959,16 @@ function getBoxPosition(blockHeiht, style, rect) {
}
}
- return {
- baseX: baseX,
- baseY: baseY,
- textAlign: textAlign,
- textVerticalAlign: textVerticalAlign
- };
+ out = out || {};
+ out.baseX = baseX;
+ out.baseY = baseY;
+ out.textAlign = textAlign;
+ out.textVerticalAlign = textVerticalAlign;
+
+ return out;
}
+
function setCtx(ctx, prop, value) {
ctx[prop] = fixShadow(ctx, prop, value);
return ctx[prop];
@@ -8887,7 +9125,9 @@ function Displayable(opts) {
this._rect = null;
// Shapes for cascade clipping.
- this.__clipPaths = [];
+ // Can only be `null`/`undefined` or an non-empty array, MUST NOT be an empty array.
+ // because it is easy to only using null to check whether clipPaths changed.
+ this.__clipPaths = null;
// FIXME Stateful must be mixined after style is setted
// Stateful.call(this, opts);
@@ -9112,7 +9352,28 @@ Displayable.prototype = {
this.style = new Style(obj, this);
this.dirty(false);
return this;
- }
+ },
+
+ /**
+ * The string value of `textPosition` needs to be calculated to a real postion.
+ * For example, `'inside'` is calculated to `[rect.width/2, rect.height/2]`
+ * by default. See `contain/text.js#calculateTextPosition` for more details.
+ * But some coutom shapes like "pin", "flag" have center that is not exactly
+ * `[width/2, height/2]`. So we provide this hook to customize the calculation
+ * for those shapes. It will be called if the `style.textPosition` is a string.
+ * @param {Obejct} [out] Prepared out object. If not provided, this method should
+ * be responsible for creating one.
+ * @param {module:zrender/graphic/Style} style
+ * @param {Object} rect {x, y, width, height}
+ * @return {Obejct} out The same as the input out.
+ * {
+ * x: number. mandatory.
+ * y: number. mandatory.
+ * textAlign: string. optional. use style.textAlign by default.
+ * textVerticalAlign: string. optional. use style.textVerticalAlign by default.
+ * }
+ */
+ calculateTextPosition: null
};
inherits(Displayable, Element);
@@ -9267,10 +9528,10 @@ function isDisplayableCulled(el, width, height) {
}
function isClipPathChanged(clipPaths, prevClipPaths) {
- if (clipPaths === prevClipPaths) { // Can both be null or undefined
+ // displayable.__clipPaths can only be `null`/`undefined` or an non-empty array.
+ if (clipPaths === prevClipPaths) {
return false;
}
-
if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {
return true;
}
@@ -9279,6 +9540,7 @@ function isClipPathChanged(clipPaths, prevClipPaths) {
return true;
}
}
+ return false;
}
function doClip(clipPaths, ctx) {
@@ -9724,16 +9986,14 @@ Painter.prototype = {
) {
var clipPaths = el.__clipPaths;
+ var prevElClipPaths = scope.prevElClipPaths;
// Optimize when clipping on group with several elements
- if (!scope.prevElClipPaths
- || isClipPathChanged(clipPaths, scope.prevElClipPaths)
- ) {
+ if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {
// If has previous clipping state, restore from it
- if (scope.prevElClipPaths) {
- currentLayer.ctx.restore();
+ if (prevElClipPaths) {
+ ctx.restore();
scope.prevElClipPaths = null;
-
// Reset prevEl since context has been restored
scope.prevEl = null;
}
@@ -10880,7 +11140,7 @@ var instances$1 = {}; // ZRender实例map索引
/**
* @type {string}
*/
-var version$1 = '4.0.6';
+var version$1 = '4.1.0';
/**
* Initializing a zrender instance
@@ -11079,14 +11339,14 @@ ZRender.prototype = {
*/
refreshImmediately: function () {
// var start = new Date();
+
// Clear needsRefresh ahead to avoid something wrong happens in refresh
// Or it will cause zrender refreshes again and again.
- this._needsRefresh = false;
+ this._needsRefresh = this._needsRefreshHover = false;
this.painter.refresh();
- /**
- * Avoid trigger zr.refresh in Element#beforeUpdate hook
- */
- this._needsRefresh = false;
+ // Avoid trigger zr.refresh in Element#beforeUpdate hook
+ this._needsRefresh = this._needsRefreshHover = false;
+
// var end = new Date();
// var log = document.getElementById('log');
// if (log) {
@@ -11804,6 +12064,18 @@ function getTooltipRenderMode(renderModeOption) {
}
}
+/**
+ * Group a list by key.
+ *
+ * @param {Array} array
+ * @param {Function} getKey
+ * param {*} Array item
+ * return {string} key
+ * @return {Object} Result
+ * {Array}: keys,
+ * {module:zrender/core/util/HashMap} buckets: {key -> Array}
+ */
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -12138,8 +12410,9 @@ var getLineStyle = makeStyleMapper(
var lineStyleMixin = {
getLineStyle: function (excludes) {
var style = getLineStyle(this, excludes);
- var lineDash = this.getLineDash(style.lineWidth);
- lineDash && (style.lineDash = lineDash);
+ // Always set lineDash whether dashed, otherwise we can not
+ // erase the previous style when assigning to el.style.
+ style.lineDash = this.getLineDash(style.lineWidth);
return style;
},
@@ -12150,8 +12423,16 @@ var lineStyleMixin = {
var lineType = this.get('type');
var dotSize = Math.max(lineWidth, 2);
var dashSize = lineWidth * 4;
- return (lineType === 'solid' || lineType == null) ? null
- : (lineType === 'dashed' ? [dashSize, dashSize] : [dotSize, dotSize]);
+ return (lineType === 'solid' || lineType == null)
+ // Use `false` but not `null` for the solid line here, because `null` might be
+ // ignored when assigning to `el.style`. e.g., when setting `lineStyle.type` as
+ // `'dashed'` and `emphasis.lineStyle.type` as `'solid'` in graph series, the
+ // `lineDash` gotten form the latter one is not able to erase that from the former
+ // one if using `null` here according to the emhpsis strategy in `util/graphic.js`.
+ ? false
+ : lineType === 'dashed'
+ ? [dashSize, dashSize]
+ : [dotSize, dotSize];
}
};
@@ -13015,9 +13296,11 @@ PathProxy.prototype = {
/**
* @readOnly
*/
- setScale: function (sx, sy) {
- this._ux = mathAbs(1 / devicePixelRatio / sx) || 0;
- this._uy = mathAbs(1 / devicePixelRatio / sy) || 0;
+ setScale: function (sx, sy, segmentIgnoreThreshold) {
+ // Compat. Previously there is no segmentIgnoreThreshold.
+ segmentIgnoreThreshold = segmentIgnoreThreshold || 0;
+ this._ux = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sx) || 0;
+ this._uy = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sy) || 0;
},
getContext: function () {
@@ -14318,6 +14601,11 @@ Path.prototype = {
strokeContainThreshold: 5,
+ // This item default to be false. But in map series in echarts,
+ // in order to improve performance, it should be set to true,
+ // so the shorty segment won't draw.
+ segmentIgnoreThreshold: 0,
+
/**
* See `module:zrender/src/graphic/helper/subPixelOptimize`.
* @type {boolean}
@@ -14373,7 +14661,7 @@ Path.prototype = {
// Update path sx, sy
var scale = this.getGlobalScale();
- path.setScale(scale[0], scale[1]);
+ path.setScale(scale[0], scale[1], this.segmentIgnoreThreshold);
// Proxy context
// Rebuild path in following 2 cases
@@ -15260,6 +15548,7 @@ Text.prototype = {
style.textAlign,
style.textVerticalAlign,
style.textPadding,
+ style.textLineHeight,
style.rich
);
@@ -15720,7 +16009,7 @@ var Polyline = Path.extend({
* when rendering a thin vertical/horizontal line.
*/
-var round$1 = Math.round;
+var round = Math.round;
/**
* Sub pixel optimize line for canvas
@@ -15749,14 +16038,14 @@ function subPixelOptimizeLine$1(outputShape, inputShape, style) {
var y1 = inputShape.y1;
var y2 = inputShape.y2;
- if (round$1(x1 * 2) === round$1(x2 * 2)) {
+ if (round(x1 * 2) === round(x2 * 2)) {
outputShape.x1 = outputShape.x2 = subPixelOptimize$1(x1, lineWidth, true);
}
else {
outputShape.x1 = x1;
outputShape.x2 = x2;
}
- if (round$1(y1 * 2) === round$1(y2 * 2)) {
+ if (round(y1 * 2) === round(y2 * 2)) {
outputShape.y1 = outputShape.y2 = subPixelOptimize$1(y1, lineWidth, true);
}
else {
@@ -15815,8 +16104,8 @@ function subPixelOptimizeRect$1(outputShape, inputShape, style) {
function subPixelOptimize$1(position, lineWidth, positiveOrNegative) {
// Assure that (position + lineWidth / 2) is near integer edge,
// otherwise line will be fuzzy in canvas.
- var doubledPosition = round$1(position * 2);
- return (doubledPosition + round$1(lineWidth)) % 2 === 0
+ var doubledPosition = round(position * 2);
+ return (doubledPosition + round(lineWidth)) % 2 === 0
? doubledPosition / 2
: (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;
}
@@ -16161,7 +16450,7 @@ var CompoundPath = Path.extend({
if (!paths[i].path) {
paths[i].createPathProxy();
}
- paths[i].path.setScale(scale[0], scale[1]);
+ paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);
}
},
@@ -16433,7 +16722,6 @@ inherits(IncrementalDisplayble, Displayable);
* under the License.
*/
-var round = Math.round;
var mathMax$1 = Math.max;
var mathMin$1 = Math.min;
@@ -16441,6 +16729,21 @@ var EMPTY_OBJ = {};
var Z2_EMPHASIS_LIFT = 1;
+// key: label model property nane, value: style property name.
+var CACHED_LABEL_STYLE_PROPERTIES = {
+ color: 'textFill',
+ textBorderColor: 'textStroke',
+ textBorderWidth: 'textStrokeWidth'
+};
+
+var EMPHASIS = 'emphasis';
+var NORMAL = 'normal';
+
+// Reserve 0 as default.
+var _highlightNextDigit = 1;
+var _highlightKeyMap = {};
+
+
/**
* Extend shape with parameters
*/
@@ -16565,15 +16868,7 @@ function resizePath(path, rect) {
* @return {Object} Modified param
*/
function subPixelOptimizeLine(param) {
- var shape = param.shape;
- var lineWidth = param.style.lineWidth;
-
- if (round(shape.x1 * 2) === round(shape.x2 * 2)) {
- shape.x1 = shape.x2 = subPixelOptimize(shape.x1, lineWidth, true);
- }
- if (round(shape.y1 * 2) === round(shape.y2 * 2)) {
- shape.y1 = shape.y2 = subPixelOptimize(shape.y1, lineWidth, true);
- }
+ subPixelOptimizeLine$1(param.shape, param.shape, param.style);
return param;
}
@@ -16591,22 +16886,7 @@ function subPixelOptimizeLine(param) {
* @return {Object} Modified param
*/
function subPixelOptimizeRect(param) {
- var shape = param.shape;
- var lineWidth = param.style.lineWidth;
- var originX = shape.x;
- var originY = shape.y;
- var originWidth = shape.width;
- var originHeight = shape.height;
- shape.x = subPixelOptimize(shape.x, lineWidth, true);
- shape.y = subPixelOptimize(shape.y, lineWidth, true);
- shape.width = Math.max(
- subPixelOptimize(originX + originWidth, lineWidth, false) - shape.x,
- originWidth === 0 ? 0 : 1
- );
- shape.height = Math.max(
- subPixelOptimize(originY + originHeight, lineWidth, false) - shape.y,
- originHeight === 0 ? 0 : 1
- );
+ subPixelOptimizeRect$1(param.shape, param.shape, param.style);
return param;
}
@@ -16618,14 +16898,8 @@ function subPixelOptimizeRect(param) {
* @param {boolean=} positiveOrNegative Default false (negative).
* @return {number} Optimized position.
*/
-function subPixelOptimize(position, lineWidth, positiveOrNegative) {
- // Assure that (position + lineWidth / 2) is near integer edge,
- // otherwise line will be fuzzy in canvas.
- var doubledPosition = round(position * 2);
- return (doubledPosition + round(lineWidth)) % 2 === 0
- ? doubledPosition / 2
- : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;
-}
+var subPixelOptimize = subPixelOptimize$1;
+
function hasFillOrStroke(fillOrStroke) {
return fillOrStroke != null && fillOrStroke !== 'none';
@@ -16667,7 +16941,7 @@ function cacheElementStl(el) {
var elStyle = el.style;
for (var name in hoverStyle) {
- // See comment in `doSingleEnterHover`.
+ // See comment in `singleEnterEmphasis`.
if (hoverStyle[name] != null) {
normalStyle[name] = elStyle[name];
}
@@ -16678,7 +16952,7 @@ function cacheElementStl(el) {
normalStyle.stroke = elStyle.stroke;
}
-function doSingleEnterHover(el) {
+function singleEnterEmphasis(el) {
var hoverStl = el.__hoverStl;
if (!hoverStl || el.__highlighted) {
@@ -16689,7 +16963,7 @@ function doSingleEnterHover(el) {
el.__highlighted = useHoverLayer ? 'layer' : 'plain';
var zr = el.__zr;
- if (!zr && useHoverLayer) {
+ if (el.isGroup || (!zr && useHoverLayer)) {
return;
}
@@ -16723,9 +16997,13 @@ function doSingleEnterHover(el) {
// where properties of `emphasis` may not appear in `normal`. We previously use
// module:echarts/util/model#defaultEmphasis to merge `normal` to `emphasis`.
// But consider rich text and setOption in merge mode, it is impossible to cover
- // all properties in merge. So we use merge mode when setting style here, where
- // only properties that is not `null/undefined` can be set. The disadventage:
- // null/undefined can not be used to remove style any more in `emphasis`.
+ // all properties in merge. So we use merge mode when setting style here.
+ // But we choose the merge strategy that only properties that is not `null/undefined`.
+ // Because when making a textStyle (espacially rich text), it is not easy to distinguish
+ // `hasOwnProperty` and `null/undefined` in code, so we trade them as the same for simplicity.
+ // But this strategy brings a trouble that `null/undefined` can not be used to remove
+ // style any more in `emphasis`. Users can both set properties directly on normal and
+ // emphasis to avoid this issue, or we might support `'none'` for this case if required.
targetStyle.extendFrom(hoverStl);
setDefaultHoverFillStroke(targetStyle, hoverStl, 'fill');
@@ -16745,7 +17023,7 @@ function setDefaultHoverFillStroke(targetStyle, hoverStyle, prop) {
}
}
-function doSingleLeaveHover(el) {
+function singleEnterNormal(el) {
var highlighted = el.__highlighted;
if (!highlighted) {
@@ -16754,17 +17032,19 @@ function doSingleLeaveHover(el) {
el.__highlighted = false;
+ if (el.isGroup) {
+ return;
+ }
+
if (highlighted === 'layer') {
el.__zr && el.__zr.removeHover(el);
}
- else if (highlighted) {
+ else {
var style = el.style;
var normalStl = el.__cachedNormalStl;
if (normalStl) {
rollbackDefaultTextStyle(style);
- // Consider null/undefined value, should use
- // `setStyle` but not `extendFrom(stl, true)`.
el.setStyle(normalStl);
applyDefaultTextStyle(style);
}
@@ -16778,12 +17058,21 @@ function doSingleLeaveHover(el) {
}
}
-function traverseCall(el, method) {
- el.isGroup
- ? el.traverse(function (child) {
- !child.isGroup && method(child);
- })
- : method(el);
+function traverseUpdate(el, updater, commonParam) {
+ // If root is group, also enter updater for `highDownOnUpdate`.
+ var fromState = NORMAL;
+ var toState = NORMAL;
+ var trigger;
+ // See the rule of `highDownOnUpdate` on `graphic.setAsHighDownDispatcher`.
+ el.__highlighted && (fromState = EMPHASIS, trigger = true);
+ updater(el, commonParam);
+ el.__highlighted && (toState = EMPHASIS, trigger = true);
+
+ el.isGroup && el.traverse(function (child) {
+ !child.isGroup && updater(child, commonParam);
+ });
+
+ trigger && el.__highDownOnUpdate && el.__highDownOnUpdate(fromState, toState);
}
/**
@@ -16793,18 +17082,19 @@ function traverseCall(el, method) {
* to the `el`. See the reason on `setHoverStyle`.
*
* @param {module:zrender/Element} el Should not be `zrender/container/Group`.
+ * @param {Object} [el.hoverStyle] Can be set on el or its descendants,
+ * e.g., `el.hoverStyle = ...; graphic.setHoverStyle(el); `.
+ * Often used when item group has a label element and it's hoverStyle is different.
* @param {Object|boolean} [hoverStl] The specified hover style.
* If set as `false`, disable the hover style.
* Similarly, The `el.hoverStyle` can alse be set
* as `false` to disable the hover style.
* Otherwise, use the default hover style if not provided.
- * @param {Object} [opt]
- * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`
*/
function setElementHoverStyle(el, hoverStl) {
// For performance consideration, it might be better to make the "hover style" only the
// difference properties from the "normal style", but not a entire copy of all styles.
- hoverStl = el.__hoverStl = hoverStl !== false && (hoverStl || {});
+ hoverStl = el.__hoverStl = hoverStl !== false && (el.hoverStyle || hoverStl || {});
el.__hoverStlDirty = true;
// FIXME
@@ -16823,53 +17113,38 @@ function setElementHoverStyle(el, hoverStl) {
// of this method. In most cases, `z2` is not set and hover style should be able
// to rollback. Of course, that would bring bug, but only in a rare case, see
// `doSingleLeaveHover` for details.
- doSingleLeaveHover(el);
+ singleEnterNormal(el);
- doSingleEnterHover(el);
+ singleEnterEmphasis(el);
}
}
-/**
- * Emphasis (called by API) has higher priority than `mouseover`.
- * When element has been called to be entered emphasis, mouse over
- * should not trigger the highlight effect (for example, animation
- * scale) again, and `mouseout` should not downplay the highlight
- * effect. So the listener of `mouseover` and `mouseout` should
- * check `isInEmphasis`.
- *
- * @param {module:zrender/Element} el
- * @return {boolean}
- */
-function isInEmphasis(el) {
- return el && el.__isEmphasisEntered;
-}
-
function onElementMouseOver(e) {
- if (this.__hoverSilentOnTouch && e.zrByTouch) {
- return;
- }
-
- // Only if element is not in emphasis status
- !this.__isEmphasisEntered && traverseCall(this, doSingleEnterHover);
+ !shouldSilent(this, e)
+ // "emphasis" event highlight has higher priority than mouse highlight.
+ && !this.__highByOuter
+ && traverseUpdate(this, singleEnterEmphasis);
}
function onElementMouseOut(e) {
- if (this.__hoverSilentOnTouch && e.zrByTouch) {
- return;
- }
+ !shouldSilent(this, e)
+ // "emphasis" event highlight has higher priority than mouse highlight.
+ && !this.__highByOuter
+ && traverseUpdate(this, singleEnterNormal);
+}
- // Only if element is not in emphasis status
- !this.__isEmphasisEntered && traverseCall(this, doSingleLeaveHover);
+function onElementEmphasisEvent(highlightDigit) {
+ this.__highByOuter |= 1 << (highlightDigit || 0);
+ traverseUpdate(this, singleEnterEmphasis);
}
-function enterEmphasis() {
- this.__isEmphasisEntered = true;
- traverseCall(this, doSingleEnterHover);
+function onElementNormalEvent(highlightDigit) {
+ !(this.__highByOuter &= ~(1 << (highlightDigit || 0)))
+ && traverseUpdate(this, singleEnterNormal);
}
-function leaveEmphasis() {
- this.__isEmphasisEntered = false;
- traverseCall(this, doSingleLeaveHover);
+function shouldSilent(el, e) {
+ return el.__highDownSilentOnTouch && e.zrByTouch;
}
/**
@@ -16901,26 +17176,42 @@ function leaveEmphasis() {
* root group, we can simply mount the style on `el.hoverStyle` for them, but should
* not call this method for them.
*
+ * (3) These input parameters can be set directly on `el`:
+ *
* @param {module:zrender/Element} el
+ * @param {Object} [el.hoverStyle] See `graphic.setElementHoverStyle`.
+ * @param {boolean} [el.highDownSilentOnTouch=false] See `graphic.setAsHighDownDispatcher`.
+ * @param {Function} [el.highDownOnUpdate] See `graphic.setAsHighDownDispatcher`.
* @param {Object|boolean} [hoverStyle] See `graphic.setElementHoverStyle`.
- * @param {Object} [opt]
- * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`.
- */
-function setHoverStyle(el, hoverStyle, opt) {
- el.isGroup
- ? el.traverse(function (child) {
- // If element has sepcified hoverStyle, then use it instead of given hoverStyle
- // Often used when item group has a label element and it's hoverStyle is different
- !child.isGroup && setElementHoverStyle(child, child.hoverStyle || hoverStyle);
- })
- : setElementHoverStyle(el, el.hoverStyle || hoverStyle);
-
- setAsHoverStyleTrigger(el, opt);
+ */
+function setHoverStyle(el, hoverStyle) {
+ setAsHighDownDispatcher(el, true);
+ traverseUpdate(el, setElementHoverStyle, hoverStyle);
}
/**
- * @param {Object|boolean} [opt] If `false`, means disable trigger.
- * @param {boolean} [opt.hoverSilentOnTouch=false]
+ * @param {module:zrender/Element} el
+ * @param {Function} [el.highDownOnUpdate] Called when state updated.
+ * Since `setHoverStyle` has the constraint that it must be called after
+ * all of the normal style updated, `highDownOnUpdate` is not needed to
+ * trigger if both `fromState` and `toState` is 'normal', and needed to
+ * trigger if both `fromState` and `toState` is 'emphasis', which enables
+ * to sync outside style settings to "emphasis" state.
+ * @this {string} This dispatcher `el`.
+ * @param {string} fromState Can be "normal" or "emphasis".
+ * `fromState` might equal to `toState`,
+ * for example, when this method is called when `el` is
+ * on "emphasis" state.
+ * @param {string} toState Can be "normal" or "emphasis".
+ *
+ * FIXME
+ * CAUTION: Do not expose `highDownOnUpdate` outside echarts.
+ * Because it is not a complete solution. The update
+ * listener should not have been mount in element,
+ * and the normal/emphasis state should not have
+ * mantained on elements.
+ *
+ * @param {boolean} [el.highDownSilentOnTouch=false]
* In touch device, mouseover event will be trigger on touchstart event
* (see module:zrender/dom/HandlerProxy). By this mechanism, we can
* conveniently use hoverStyle when tap on touch screen without additional
@@ -16928,28 +17219,58 @@ function setHoverStyle(el, hoverStyle, opt) {
* But if the chart/component has select feature, which usually also use
* hoverStyle, there might be conflict between 'select-highlight' and
* 'hover-highlight' especially when roam is enabled (see geo for example).
- * In this case, hoverSilentOnTouch should be used to disable hover-highlight
- * on touch device.
+ * In this case, `highDownSilentOnTouch` should be used to disable
+ * hover-highlight on touch device.
+ * @param {boolean} [asDispatcher=true] If `false`, do not set as "highDownDispatcher".
*/
-function setAsHoverStyleTrigger(el, opt) {
- var disable = opt === false;
- el.__hoverSilentOnTouch = opt != null && opt.hoverSilentOnTouch;
+function setAsHighDownDispatcher(el, asDispatcher) {
+ var disable = asDispatcher === false;
+ // Make `highDownSilentOnTouch` and `highDownOnUpdate` only work after
+ // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly.
+ el.__highDownSilentOnTouch = el.highDownSilentOnTouch;
+ el.__highDownOnUpdate = el.highDownOnUpdate;
// Simple optimize, since this method might be
// called for each elements of a group in some cases.
- if (!disable || el.__hoverStyleTrigger) {
+ if (!disable || el.__highDownDispatcher) {
var method = disable ? 'off' : 'on';
// Duplicated function will be auto-ignored, see Eventful.js.
el[method]('mouseover', onElementMouseOver)[method]('mouseout', onElementMouseOut);
- // Emphasis, normal can be triggered manually
- el[method]('emphasis', enterEmphasis)[method]('normal', leaveEmphasis);
+ // Emphasis, normal can be triggered manually by API or other components like hover link.
+ el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent);
+ // Also keep previous record.
+ el.__highByOuter = el.__highByOuter || 0;
- el.__hoverStyleTrigger = !disable;
+ el.__highDownDispatcher = !disable;
}
}
/**
+ * @param {module:zrender/src/Element} el
+ * @return {boolean}
+ */
+function isHighDownDispatcher(el) {
+ return !!(el && el.__highDownDispatcher);
+}
+
+/**
+ * Support hightlight/downplay record on each elements.
+ * For the case: hover highlight/downplay (legend, visualMap, ...) and
+ * user triggerred hightlight/downplay should not conflict.
+ * Only all of the highlightDigit cleared, return to normal.
+ * @param {string} highlightKey
+ * @return {number} highlightDigit
+ */
+function getHighlightDigit(highlightKey) {
+ var highlightDigit = _highlightKeyMap[highlightKey];
+ if (highlightDigit == null && _highlightNextDigit <= 32) {
+ highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;
+ }
+ return highlightDigit;
+}
+
+/**
* See more info in `setTextStyleCommon`.
* @param {Object|module:zrender/graphic/Style} normalStyle
* @param {Object} emphasisStyle
@@ -17022,6 +17343,29 @@ function setLabelStyle(
}
/**
+ * Modify label style manually.
+ * Only works after `setLabelStyle` and `setElementHoverStyle` called.
+ *
+ * @param {module:zrender/src/Element} el
+ * @param {Object} [normalStyleProps] optional
+ * @param {Object} [emphasisStyleProps] optional
+ */
+function modifyLabelStyle(el, normalStyleProps, emphasisStyleProps) {
+ var elStyle = el.style;
+ if (normalStyleProps) {
+ rollbackDefaultTextStyle(elStyle);
+ el.setStyle(normalStyleProps);
+ applyDefaultTextStyle(elStyle);
+ }
+ elStyle = el.__hoverStl;
+ if (emphasisStyleProps && elStyle) {
+ rollbackDefaultTextStyle(elStyle);
+ extend(elStyle, emphasisStyleProps);
+ applyDefaultTextStyle(elStyle);
+ }
+}
+
+/**
* Set basic textStyle properties.
* See more info in `setTextStyleCommon`.
* @param {Object|module:zrender/graphic/Style} textStyle
@@ -17142,6 +17486,10 @@ function setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis) {
// Cascade is supported in rich.
var richTextStyle = textStyleModel.getModel(['rich', name]);
// In rich, never `disableBox`.
+ // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`,
+ // the default color `'blue'` will not be adopted if no color declared in `rich`.
+ // That might confuses users. So probably we should put `textStyleModel` as the
+ // root ancestor of the `richTextStyle`. But that would be a break change.
setTokenTextStyle(richResult[name] = {}, richTextStyle, globalTextStyle, opt, isEmphasis);
}
}
@@ -17202,10 +17550,6 @@ function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isEm
globalTextStyle.textBorderWidth
);
- // Save original textPosition, because style.textPosition will be repalced by
- // real location (like [10, 30]) in zrender.
- textStyle.insideRawTextPosition = textStyle.textPosition;
-
if (!isEmphasis) {
if (isBlock) {
textStyle.insideRollbackOpt = opt;
@@ -17280,50 +17624,49 @@ function getAutoColor(color, opt) {
* does, `rollbackDefaultTextStyle` is not needed to be called).
*/
function applyDefaultTextStyle(textStyle) {
+ var textPosition = textStyle.textPosition;
var opt = textStyle.insideRollbackOpt;
-
- // Only `insideRollbackOpt` created (in `setTextStyleCommon`),
- // applyDefaultTextStyle works.
- if (!opt || textStyle.textFill != null) {
- return;
- }
-
- var useInsideStyle = opt.useInsideStyle;
- var textPosition = textStyle.insideRawTextPosition;
var insideRollback;
- var autoColor = opt.autoColor;
-
- if (useInsideStyle !== false
- && (useInsideStyle === true
- || (opt.isRectText
- && textPosition
- // textPosition can be [10, 30]
- && typeof textPosition === 'string'
- && textPosition.indexOf('inside') >= 0
- )
- )
- ) {
- insideRollback = {
- textFill: null,
- textStroke: textStyle.textStroke,
- textStrokeWidth: textStyle.textStrokeWidth
- };
- textStyle.textFill = '#fff';
- // Consider text with #fff overflow its container.
- if (textStyle.textStroke == null) {
- textStyle.textStroke = autoColor;
- textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2);
+
+ if (opt && textStyle.textFill == null) {
+ var autoColor = opt.autoColor;
+ var isRectText = opt.isRectText;
+ var useInsideStyle = opt.useInsideStyle;
+
+ var useInsideStyleCache = useInsideStyle !== false
+ && (useInsideStyle === true
+ || (isRectText
+ && textPosition
+ // textPosition can be [10, 30]
+ && typeof textPosition === 'string'
+ && textPosition.indexOf('inside') >= 0
+ )
+ );
+ var useAutoColorCache = !useInsideStyleCache && autoColor != null;
+
+ // All of the props declared in `CACHED_LABEL_STYLE_PROPERTIES` are to be cached.
+ if (useInsideStyleCache || useAutoColorCache) {
+ insideRollback = {
+ textFill: textStyle.textFill,
+ textStroke: textStyle.textStroke,
+ textStrokeWidth: textStyle.textStrokeWidth
+ };
+ }
+ if (useInsideStyleCache) {
+ textStyle.textFill = '#fff';
+ // Consider text with #fff overflow its container.
+ if (textStyle.textStroke == null) {
+ textStyle.textStroke = autoColor;
+ textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2);
+ }
+ }
+ if (useAutoColorCache) {
+ textStyle.textFill = autoColor;
}
- }
- else if (autoColor != null) {
- insideRollback = {textFill: null};
- textStyle.textFill = autoColor;
}
- // Always set `insideRollback`, for clearing previous.
- if (insideRollback) {
- textStyle.insideRollback = insideRollback;
- }
+ // Always set `insideRollback`, so that the previous one can be cleared.
+ textStyle.insideRollback = insideRollback;
}
/**
@@ -17339,6 +17682,7 @@ function applyDefaultTextStyle(textStyle) {
function rollbackDefaultTextStyle(style) {
var insideRollback = style.insideRollback;
if (insideRollback) {
+ // Reset all of the props in `CACHED_LABEL_STYLE_PROPERTIES`.
style.textFill = insideRollback.textFill;
style.textStroke = insideRollback.textStroke;
style.textStrokeWidth = insideRollback.textStrokeWidth;
@@ -17627,6 +17971,7 @@ function createIcon(iconStr, opt, rect) {
var graphic = (Object.freeze || Object)({
Z2_EMPHASIS_LIFT: Z2_EMPHASIS_LIFT,
+ CACHED_LABEL_STYLE_PROPERTIES: CACHED_LABEL_STYLE_PROPERTIES,
extendShape: extendShape,
extendPath: extendPath,
makePath: makePath,
@@ -17637,10 +17982,12 @@ var graphic = (Object.freeze || Object)({
subPixelOptimizeRect: subPixelOptimizeRect,
subPixelOptimize: subPixelOptimize,
setElementHoverStyle: setElementHoverStyle,
- isInEmphasis: isInEmphasis,
setHoverStyle: setHoverStyle,
- setAsHoverStyleTrigger: setAsHoverStyleTrigger,
+ setAsHighDownDispatcher: setAsHighDownDispatcher,
+ isHighDownDispatcher: isHighDownDispatcher,
+ getHighlightDigit: getHighlightDigit,
setLabelStyle: setLabelStyle,
+ modifyLabelStyle: modifyLabelStyle,
setTextStyle: setTextStyle,
setText: setText,
getFont: getFont,
@@ -17727,6 +18074,7 @@ var textStyleMixin = {
this.getShallow('align'),
this.getShallow('verticalAlign') || this.getShallow('baseline'),
this.getShallow('padding'),
+ this.getShallow('lineHeight'),
this.getShallow('rich'),
this.getShallow('truncateText')
);
@@ -18197,6 +18545,15 @@ function enableTopologicalTravel(entity, dependencyGetter) {
* under the License.
*/
+/*
+* A third-party license is embeded for some of the code in this file:
+* The method "quantile" was copied from "d3.js".
+* (See more details in the comment of the method below.)
+* The use of the source code of this file is also subject to the terms
+* and consitions of the license of "d3.js" (BSD-3Clause, see
+* </licenses/LICENSE-d3>).
+*/
+
var RADIAN_EPSILON = 1e-4;
function _trim(str) {
@@ -18300,7 +18657,7 @@ function parsePercent$1(percent, all) {
* @param {boolean} [returnStr]
* @return {number|string}
*/
-function round$2(x, precision, returnStr) {
+function round$1(x, precision, returnStr) {
if (precision == null) {
precision = 10;
}
@@ -18310,6 +18667,13 @@ function round$2(x, precision, returnStr) {
return returnStr ? x : +x;
}
+/**
+ * asc sort arr.
+ * The input arr will be modified.
+ *
+ * @param {Array} arr
+ * @return {Array} The input arr.
+ */
function asc(arr) {
arr.sort(function (a, b) {
return a - b;
@@ -18610,39 +18974,9 @@ function nice(val, round) {
}
/**
- * BSD 3-Clause
- *
- * Copyright (c) 2010-2015, Michael Bostock
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * * The name Michael Bostock may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * @see <https://github.com/mbostock/d3/blob/master/src/arrays/quantile.js>
- * @see <http://en.wikipedia.org/wiki/Quantile>
+ * This code was copied from "d3.js"
+ * <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/arrays/quantile.js>.
+ * See the license statement at the head of this file.
* @param {Array.<number>} ascArr
*/
function quantile(ascArr, p) {
@@ -18733,7 +19067,7 @@ function isNumeric(v) {
var number = (Object.freeze || Object)({
linearMap: linearMap,
parsePercent: parsePercent$1,
- round: round$2,
+ round: round$1,
asc: asc,
getPrecision: getPrecision,
getPrecisionSafe: getPrecisionSafe,
@@ -18985,7 +19319,45 @@ function capitalFirst(str) {
var truncateText$1 = truncateText;
-var getTextRect = getBoundingRect;
+/**
+ * @public
+ * @param {Object} opt
+ * @param {string} opt.text
+ * @param {string} opt.font
+ * @param {string} [opt.textAlign='left']
+ * @param {string} [opt.textVerticalAlign='top']
+ * @param {Array.<number>} [opt.textPadding]
+ * @param {number} [opt.textLineHeight]
+ * @param {Object} [opt.rich]
+ * @param {Object} [opt.truncate]
+ * @return {Object} {x, y, width, height, lineHeight}
+ */
+function getTextBoundingRect(opt) {
+ return getBoundingRect(
+ opt.text,
+ opt.font,
+ opt.textAlign,
+ opt.textVerticalAlign,
+ opt.textPadding,
+ opt.textLineHeight,
+ opt.rich,
+ opt.truncate
+ );
+}
+
+/**
+ * @deprecated
+ * the `textLineHeight` was added later.
+ * For backward compatiblility, put it as the last parameter.
+ * But deprecated this interface. Please use `getTextBoundingRect` instead.
+ */
+function getTextRect(
+ text, font, textAlign, textVerticalAlign, textPadding, rich, truncate, textLineHeight
+) {
+ return getBoundingRect(
+ text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate
+ );
+}
var format = (Object.freeze || Object)({
@@ -18999,6 +19371,7 @@ var format = (Object.freeze || Object)({
formatTime: formatTime,
capitalFirst: capitalFirst,
truncateText: truncateText$1,
+ getTextBoundingRect: getTextBoundingRect,
getTextRect: getTextRect
});
@@ -21328,7 +21701,7 @@ var GlobalModel = Model.extend({
* After filtering, series may be different.
* frome raw series.
*
- * @parma {string} subType
+ * @param {string} subType.
* @param {Function} cb
* @param {*} context
*/
@@ -21806,7 +22179,7 @@ OptionManager.prototype = {
// Caution: some series modify option data, if do not clone,
// it should ensure that the repeat modify correctly
// (create a new object when modify itself).
- rawOption = clone$3(rawOption, true);
+ rawOption = clone$3(rawOption);
// FIXME
// 如果 timeline options 或者 media 中设置了某个属性,而baseOption中没有设置,则进行警告。
@@ -22178,6 +22551,7 @@ function convertNormalEmphasis(opt, optType, useExtend) {
}
}
}
+
function removeEC3NormalStatus(opt) {
convertNormalEmphasis(opt, 'itemStyle');
convertNormalEmphasis(opt, 'lineStyle');
@@ -22482,7 +22856,7 @@ var backwardCompat = function (option, isTheme) {
if (seriesType === 'gauge') {
var pointerColor = get(seriesOpt, 'pointer.color');
pointerColor != null
- && set$1(seriesOpt, 'itemStyle.normal.color', pointerColor);
+ && set$1(seriesOpt, 'itemStyle.color', pointerColor);
}
compatLayoutProperties(seriesOpt);
@@ -23046,6 +23420,7 @@ var dataFormatMixin = {
var renderMode = getTooltipRenderMode(renderModeOption);
var mainType = this.mainType;
var isSeries = mainType === 'series';
+ var userOutput = data.userOutput;
return {
componentType: mainType,
@@ -23061,6 +23436,8 @@ var dataFormatMixin = {
dataType: dataType,
value: rawValue,
color: color,
+ dimensionNames: userOutput ? userOutput.dimensionNames : null,
+ encode: userOutput ? userOutput.encode : null,
marker: getTooltipMarker({
color: color,
renderMode: renderMode
@@ -23076,7 +23453,8 @@ var dataFormatMixin = {
* @param {number} dataIndex
* @param {string} [status='normal'] 'normal' or 'emphasis'
* @param {string} [dataType]
- * @param {number} [dimIndex]
+ * @param {number} [dimIndex] Only used in some chart that
+ * use formatter in different dimensions, like radar.
* @param {string} [labelProp='label']
* @return {string} If not formatter, return null/undefined
*/
@@ -23098,6 +23476,7 @@ var dataFormatMixin = {
if (typeof formatter === 'function') {
params.status = status;
+ params.dimensionIndex = dimIndex;
return formatter(params);
}
else if (typeof formatter === 'string') {
@@ -24334,44 +24713,53 @@ Chart.prototype = {
};
var chartProto = Chart.prototype;
-chartProto.updateView
- = chartProto.updateLayout
- = chartProto.updateVisual
- = function (seriesModel, ecModel, api, payload) {
+chartProto.updateView =
+chartProto.updateLayout =
+chartProto.updateVisual =
+ function (seriesModel, ecModel, api, payload) {
this.render(seriesModel, ecModel, api, payload);
};
/**
* Set state of single element
- * @param {module:zrender/Element} el
- * @param {string} state
+ * @param {module:zrender/Element} el
+ * @param {string} state 'normal'|'emphasis'
+ * @param {number} highlightDigit
*/
-function elSetState(el, state) {
+function elSetState(el, state, highlightDigit) {
if (el) {
- el.trigger(state);
- if (el.type === 'group') {
- for (var i = 0; i < el.childCount(); i++) {
- elSetState(el.childAt(i), state);
+ el.trigger(state, highlightDigit);
+ if (el.isGroup
+ // Simple optimize.
+ && !isHighDownDispatcher(el)
+ ) {
+ for (var i = 0, len = el.childCount(); i < len; i++) {
+ elSetState(el.childAt(i), state, highlightDigit);
}
}
}
}
+
/**
- * @param {module:echarts/data/List} data
- * @param {Object} payload
- * @param {string} state 'normal'|'emphasis'
+ * @param {module:echarts/data/List} data
+ * @param {Object} payload
+ * @param {string} state 'normal'|'emphasis'
*/
function toggleHighlight(data, payload, state) {
var dataIndex = queryDataIndex(data, payload);
+ var highlightDigit = (payload && payload.highlightKey != null)
+ ? getHighlightDigit(payload.highlightKey)
+ : null;
+
if (dataIndex != null) {
each$1(normalizeToArray(dataIndex), function (dataIdx) {
- elSetState(data.getItemGraphicEl(dataIdx), state);
+ elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);
});
}
else {
data.eachItemGraphicEl(function (el) {
- elSetState(el, state);
+ elSetState(el, state, highlightDigit);
});
}
}
@@ -24727,6 +25115,38 @@ var lang = {
title: 'Save as Image',
lang: ['Right Click to Save Image']
}
+ },
+ aria: {
+ general: {
+ withTitle: 'This is a chart about "{title}"',
+ withoutTitle: 'This is a chart'
+ },
+ series: {
+ single: {
+ prefix: '',
+ withName: ' with type {seriesType} named {seriesName}.',
+ withoutName: ' with type {seriesType}.'
+ },
+ multiple: {
+ prefix: '. It consists of {seriesCount} series count.',
+ withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',
+ withoutName: ' The {seriesId} series is a {seriesType}.',
+ separator: {
+ middle: '',
+ end: ''
+ }
+ }
+ },
+ data: {
+ allData: 'The data is as follows: ',
+ partialData: 'The first {displayCnt} items are: ',
+ withName: 'the data for {name} is {value}',
+ withoutName: '{value}',
+ separator: {
+ middle: ',',
+ end: '.'
+ }
+ }
}
};
@@ -26635,10 +27055,10 @@ var isFunction = isFunction$1;
var isObject = isObject$1;
var parseClassType = ComponentModel.parseClassType;
-var version = '4.2.1';
+var version = '4.3.0';
var dependencies = {
- zrender: '4.0.6'
+ zrender: '4.1.0'
};
var TEST_FRAME_REMAIN_TIME = 1;
@@ -26647,8 +27067,10 @@ var PRIORITY_PROCESSOR_FILTER = 1000;
var PRIORITY_PROCESSOR_STATISTIC = 5000;
var PRIORITY_VISUAL_LAYOUT = 1000;
+var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;
var PRIORITY_VISUAL_GLOBAL = 2000;
var PRIORITY_VISUAL_CHART = 3000;
+var PRIORITY_VISUAL_POST_CHART_LAYOUT = 3500;
var PRIORITY_VISUAL_COMPONENT = 4000;
// FIXME
// necessary?
@@ -26661,8 +27083,10 @@ var PRIORITY = {
},
VISUAL: {
LAYOUT: PRIORITY_VISUAL_LAYOUT,
+ PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,
GLOBAL: PRIORITY_VISUAL_GLOBAL,
CHART: PRIORITY_VISUAL_CHART,
+ POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,
COMPONENT: PRIORITY_VISUAL_COMPONENT,
BRUSH: PRIORITY_VISUAL_BRUSH
}
@@ -26744,7 +27168,7 @@ function ECharts(dom, theme$$1, opts) {
});
/**
- * Expect 60 pfs.
+ * Expect 60 fps.
* @type {Function}
* @private
*/
@@ -26943,7 +27367,7 @@ echartsProto.setOption = function (option, notMerge, lazyUpdate) {
if (!this._model || notMerge) {
var optionManager = new OptionManager(this._api);
var theme$$1 = this._theme;
- var ecModel = this._model = new GlobalModel(null, null, theme$$1, optionManager);
+ var ecModel = this._model = new GlobalModel();
ecModel.scheduler = this._scheduler;
ecModel.init(null, null, theme$$1, optionManager);
}
@@ -27149,6 +27573,21 @@ echartsProto.getConnectedDataURL = function (opts) {
targetCanvas.height = height;
var zr = init$1(targetCanvas);
+ // Background between the charts
+ if (opts.connectedBackgroundColor) {
+ zr.add(new Rect({
+ shape: {
+ x: 0,
+ y: 0,
+ width: width,
+ height: height
+ },
+ style: {
+ fill: opts.connectedBackgroundColor
+ }
+ }));
+ }
+
each(canvasList, function (item) {
var img = new ZImage({
style: {
@@ -28067,7 +28506,7 @@ function renderSeries(ecIns, ecModel, api, payload, dirtyMap) {
scheduler.unfinished |= unfinished;
// If use hover layer
- updateHoverLayerStatus(ecIns._zr, ecModel);
+ updateHoverLayerStatus(ecIns, ecModel);
// Add aria
aria(ecIns._zr.dom, ecModel);
@@ -28222,19 +28661,26 @@ echartsProto.dispose = function () {
mixin(ECharts, Eventful);
-function updateHoverLayerStatus(zr, ecModel) {
+function updateHoverLayerStatus(ecIns, ecModel) {
+ var zr = ecIns._zr;
var storage = zr.storage;
var elCount = 0;
+
storage.traverse(function (el) {
- if (!el.isGroup) {
- elCount++;
- }
+ elCount++;
});
+
if (elCount > ecModel.get('hoverLayerThreshold') && !env$1.node) {
- storage.traverse(function (el) {
- if (!el.isGroup) {
- // Don't switch back.
- el.useHoverLayer = true;
+ ecModel.eachSeries(function (seriesModel) {
+ if (seriesModel.preventUsingHoverLayer) {
+ return;
+ }
+ var chartView = ecIns._chartsMap[seriesModel.__viewId];
+ if (chartView.__alive) {
+ chartView.group.traverse(function (el) {
+ // Don't switch back.
+ el.useHoverLayer = true;
+ });
}
});
}
@@ -28524,7 +28970,7 @@ function enableConnect(chart) {
* @param {Object} [theme]
* @param {Object} opts
* @param {number} [opts.devicePixelRatio] Use window.devicePixelRatio by default
- * @param {string} [opts.renderer] Currently only 'canvas' is supported.
+ * @param {string} [opts.renderer] Can choose 'canvas' or 'svg' to render the chart.
* @param {number} [opts.width] Use clientWidth of the input `dom` by default.
* Can be 'auto' (the same as null/undefined)
* @param {number} [opts.height] Use clientHeight of the input `dom` by default.
@@ -28563,7 +29009,10 @@ function init(dom, theme$$1, opts) {
|| (!dom.clientHeight && (!opts || opts.height == null))
)
) {
- console.warn('Can\'t get dom width or height');
+ console.warn('Can\'t get DOM width or height. Please check '
+ + 'dom.clientWidth and dom.clientHeight. They should not be 0.'
+ + 'For example, you may need to call this in the callback '
+ + 'of window.onload.');
}
}
@@ -29116,6 +29565,12 @@ function summarizeDimensions(data) {
var defaultedLabel = [];
var defaultedTooltip = [];
+ // See the comment of `List.js#userOutput`.
+ var userOutput = summary.userOutput = {
+ dimensionNames: data.dimensions.slice(),
+ encode: {}
+ };
+
each$1(data.dimensions, function (dimName) {
var dimItem = data.getDimensionInfo(dimName);
@@ -29124,11 +29579,9 @@ function summarizeDimensions(data) {
if (__DEV__) {
assert$1(OTHER_DIMENSIONS.get(coordDim) == null);
}
- var coordDimArr = encode[coordDim];
- if (!encode.hasOwnProperty(coordDim)) {
- coordDimArr = encode[coordDim] = [];
- }
- coordDimArr[dimItem.coordDimIndex] = dimName;
+
+ var coordDimIndex = dimItem.coordDimIndex;
+ getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;
if (!dimItem.isExtraCoord) {
notExtraCoordDimMap.set(coordDim, 1);
@@ -29140,6 +29593,10 @@ function summarizeDimensions(data) {
if (mayLabelDimType(dimItem.type)) {
defaultedLabel[0] = dimName;
}
+
+ // User output encode do not contain generated coords.
+ // And it only has index. User can use index to retrieve value from the raw item array.
+ getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;
}
if (dimItem.defaultTooltip) {
defaultedTooltip.push(dimName);
@@ -29147,14 +29604,11 @@ function summarizeDimensions(data) {
}
OTHER_DIMENSIONS.each(function (v, otherDim) {
- var otherDimArr = encode[otherDim];
- if (!encode.hasOwnProperty(otherDim)) {
- otherDimArr = encode[otherDim] = [];
- }
+ var encodeArr = getOrCreateEncodeArr(encode, otherDim);
var dimIndex = dimItem.otherDims[otherDim];
if (dimIndex != null && dimIndex !== false) {
- otherDimArr[dimIndex] = dimItem.name;
+ encodeArr[dimIndex] = dimItem.name;
}
});
});
@@ -29197,6 +29651,13 @@ function summarizeDimensions(data) {
return summary;
}
+function getOrCreateEncodeArr(encode, dim) {
+ if (!encode.hasOwnProperty(dim)) {
+ encode[dim] = [];
+ }
+ return encode[dim];
+}
+
function getDimensionTypeByAxis(axisType) {
return axisType === 'category'
? 'ordinal'
@@ -29522,6 +29983,21 @@ var List = function (dimensions, hostModel) {
* @private
*/
this._calculationInfo = {};
+
+ /**
+ * User output info of this data.
+ * DO NOT use it in other places!
+ *
+ * When preparing user params for user callbacks, we have
+ * to clone these inner data structures to prevent users
+ * from modifying them to effect built-in logic. And for
+ * performance consideration we make this `userOutput` to
+ * avoid clone them too many times.
+ *
+ * @type {Object}
+ * @readOnly
+ */
+ this.userOutput = this._dimensionsSummary.userOutput;
};
var listProto = List.prototype;
@@ -29535,15 +30011,31 @@ listProto.type = 'list';
listProto.hasItemOption = true;
/**
+ * The meanings of the input parameter `dim`:
+ *
+ * + If dim is a number (e.g., `1`), it means the index of the dimension.
+ * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.
+ * + If dim is a number-like string (e.g., `"1"`):
+ * + If there is the same concrete dim name defined in `this.dimensions`, it means that concrete name.
+ * + If not, it will be converted to a number, which means the index of the dimension.
+ * (why? because of the backward compatbility. We have been tolerating number-like string in
+ * dimension setting, although now it seems that it is not a good idea.)
+ * For example, `visualMap[i].dimension: "1"` is the same meaning as `visualMap[i].dimension: 1`,
+ * if no dimension name is defined as `"1"`.
+ * + If dim is a not-number-like string, it means the concrete dim name.
+ * For example, it can be be default name `"x"`, `"y"`, `"z"`, `"lng"`, `"lat"`, `"angle"`, `"radius"`,
+ * or customized in `dimensions` property of option like `"age"`.
+ *
* Get dimension name
- * @param {string|number} dim
- * Dimension can be concrete names like x, y, z, lng, lat, angle, radius
- * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'
+ * @param {string|number} dim See above.
* @return {string} Concrete dim name.
*/
listProto.getDimension = function (dim) {
- if (!isNaN(dim)) {
- dim = this.dimensions[dim] || dim;
+ if (typeof dim === 'number'
+ // If being a number-like string but not being defined a dimension name.
+ || (!isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim))
+ ) {
+ dim = this.dimensions[dim];
}
return dim;
};
@@ -30077,14 +30569,11 @@ listProto.getValues = function (dimensions, idx /*, stack */) {
*/
listProto.hasValue = function (idx) {
var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord;
- var dimensionInfos = this._dimensionInfos;
for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) {
- if (
- // Ordinal type can be string or number
- dimensionInfos[dataDimsOnCoord[i]].type !== 'ordinal'
- // FIXME check ordinal when using index?
- && isNaN(this.get(dataDimsOnCoord[i], idx))
- ) {
+ // Ordinal type originally can be string or number.
+ // But when an ordinal type is used on coord, it can
+ // not be string but only number. So we can also use isNaN.
+ if (isNaN(this.get(dataDimsOnCoord[i], idx))) {
return false;
}
}
@@ -31325,7 +31814,7 @@ function completeDimensions(sysDims, source, opt) {
// Note: It is allowed that `dataDims.length` is `0`, e.g., options is
// `{encode: {x: -1, y: 1}}`. Should not filter anything in
// this case.
- if (dataDims.length === 1 && dataDims[0] < 0) {
+ if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {
encodeDef.set(coordDim, false);
return;
}
@@ -32274,7 +32763,7 @@ OrdinalScale.create = function () {
* For testable.
*/
-var roundNumber$1 = round$2;
+var roundNumber$1 = round$1;
/**
* @param {Array.<number>} extent Both extent[0] and extent[1] should be valid number.
@@ -32395,7 +32884,7 @@ function intervalScaleGetTicks(interval, extent, niceTickExtent, intervalPrecisi
*/
-var roundNumber = round$2;
+var roundNumber = round$1;
/**
* @alias module:echarts/coord/scale/Interval
@@ -32837,7 +33326,8 @@ function layout(seriesType, ecModel) {
var value = data.get(valueDim, idx);
var baseValue = data.get(baseDim, idx);
- if (isNaN(value)) {
+ // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy".
+ if (isNaN(value) || isNaN(baseValue)) {
continue;
}
@@ -32931,23 +33421,29 @@ var largeLayout = {
return {progress: progress};
function progress(params, data) {
- var largePoints = new LargeArr(params.count * 2);
+ var count = params.count;
+ var largePoints = new LargeArr(count * 2);
+ var largeDataIndices = new LargeArr(count);
var dataIndex;
var coord = [];
var valuePair = [];
- var offset = 0;
+ var pointsOffset = 0;
+ var idxOffset = 0;
while ((dataIndex = params.next()) != null) {
valuePair[valueDimIdx] = data.get(valueDim, dataIndex);
valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex);
coord = cartesian.dataToPoint(valuePair, null, coord);
- largePoints[offset++] = coord[0];
- largePoints[offset++] = coord[1];
+ // Data index might not be in order, depends on `progressiveChunkMode`.
+ largePoints[pointsOffset++] = coord[0];
+ largePoints[pointsOffset++] = coord[1];
+ largeDataIndices[idxOffset++] = dataIndex;
}
data.setLayout({
largePoints: largePoints,
+ largeDataIndices: largeDataIndices,
barWidth: barWidth,
valueAxisStart: getValueAxisStart(baseAxis, valueAxis, false),
valueAxisHorizontal: valueAxisHorizontal
@@ -33005,11 +33501,16 @@ function getValueAxisStart(baseAxis, valueAxis, stacked) {
*/
/*
-* The `scaleLevels` references to d3.js. The use of the source
-* code of this file is also subject to the terms and consitions
-* of its license (BSD-3Clause, see <echarts/src/licenses/LICENSE-d3>).
+* A third-party license is embeded for some of the code in this file:
+* The "scaleLevels" was originally copied from "d3.js" with some
+* modifications made for this project.
+* (See more details in the comment on the definition of "scaleLevels" below.)
+* The use of the source code of this file is also subject to the terms
+* and consitions of the license of "d3.js" (BSD-3Clause, see
+* </licenses/LICENSE-d3>).
*/
+
// [About UTC and local time zone]:
// In most cases, `number.parseDate` will treat input data string as local time
// (except time zone is specified in time string). And `format.formateTime` returns
@@ -33085,10 +33586,10 @@ var TimeScale = IntervalScale.extend({
var interval = this._interval;
if (!opt.fixMin) {
- extent[0] = round$2(mathFloor(extent[0] / interval) * interval);
+ extent[0] = round$1(mathFloor(extent[0] / interval) * interval);
}
if (!opt.fixMax) {
- extent[1] = round$2(mathCeil(extent[1] / interval) * interval);
+ extent[1] = round$1(mathCeil(extent[1] / interval) * interval);
}
},
@@ -33152,7 +33653,12 @@ each$1(['contain', 'normalize'], function (methodName) {
};
});
-// Steps from d3, see the license statement at the top of this file.
+/**
+ * This implementation was originally copied from "d3.js"
+ * <https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/time/scale.js>
+ * with some modifications made for this program.
+ * See the license statement at the head of this file.
+ */
var scaleLevels = [
// Format interval
['hh:mm:ss', ONE_SECOND], // 1s
@@ -33229,7 +33735,7 @@ var scaleProto$1 = Scale.prototype;
var intervalScaleProto$1 = IntervalScale.prototype;
var getPrecisionSafe$1 = getPrecisionSafe;
-var roundingErrorFix = round$2;
+var roundingErrorFix = round$1;
var mathFloor$1 = Math.floor;
var mathCeil$1 = Math.ceil;
@@ -33257,7 +33763,7 @@ var LogScale = Scale.extend({
var originalExtent = originalScale.getExtent();
return map(intervalScaleProto$1.getTicks.call(this), function (val) {
- var powVal = round$2(mathPow$1(this.base, val));
+ var powVal = round$1(mathPow$1(this.base, val));
// Fix #4158
powVal = (val === extent[0] && originalScale.__fixMin)
@@ -33362,8 +33868,8 @@ var LogScale = Scale.extend({
}
var niceExtent = [
- round$2(mathCeil$1(extent[0] / interval) * interval),
- round$2(mathFloor$1(extent[1] / interval) * interval)
+ round$1(mathCeil$1(extent[0] / interval) * interval),
+ round$1(mathFloor$1(extent[1] / interval) * interval)
];
this._interval = interval;
@@ -34155,21 +34661,19 @@ var SymbolClz = extendShape({
height: 0
},
- beforeBrush: function () {
- var style = this.style;
+ calculateTextPosition: function (out, style, rect) {
+ var res = calculateTextPosition(out, style, rect);
var shape = this.shape;
- // FIXME
- if (shape.symbolType === 'pin' && style.textPosition === 'inside') {
- style.textPosition = ['50%', '40%'];
- style.textAlign = 'center';
- style.textVerticalAlign = 'middle';
+ if (shape && shape.symbolType === 'pin' && style.textPosition === 'inside') {
+ res.y = rect.y + rect.height * 0.4;
}
+ return res;
},
buildPath: function (ctx, shape, inBundle) {
var symbolType = shape.symbolType;
- var proxySymbol = symbolBuildProxies[symbolType];
- if (shape.symbolType !== 'none') {
+ if (symbolType !== 'none') {
+ var proxySymbol = symbolBuildProxies[symbolType];
if (!proxySymbol) {
// Default rect
symbolType = 'rect';
@@ -35005,7 +35509,7 @@ function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {
addItem(tickValue);
}
- if (includeMaxLabel && tickValue !== ordinalExtent[1]) {
+ if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {
addItem(ordinalExtent[1]);
}
@@ -35739,7 +36243,7 @@ symbolProto.setZ = function (zlevel, z) {
symbolProto.setDraggable = function (draggable) {
var symbolPath = this.childAt(0);
symbolPath.draggable = draggable;
- symbolPath.cursor = draggable ? 'move' : 'pointer';
+ symbolPath.cursor = draggable ? 'move' : symbolPath.cursor;
};
/**
@@ -35905,64 +36409,44 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) {
return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);
}
- symbolPath.off('mouseover')
- .off('mouseout')
- .off('emphasis')
- .off('normal');
-
+ symbolPath.__symbolOriginalScale = getScale(symbolSize);
symbolPath.hoverStyle = hoverItemStyle;
+ symbolPath.highDownOnUpdate = (
+ hoverAnimation && seriesModel.isAnimationEnabled()
+ ) ? highDownOnUpdate : null;
- // FIXME
- // Do not use symbol.trigger('emphasis'), but use symbol.highlight() instead.
setHoverStyle(symbolPath);
-
- symbolPath.__symbolOriginalScale = getScale(symbolSize);
-
- if (hoverAnimation && seriesModel.isAnimationEnabled()) {
- // Note: consider `off`, should use static function here.
- symbolPath.on('mouseover', onMouseOver)
- .on('mouseout', onMouseOut)
- .on('emphasis', onEmphasis)
- .on('normal', onNormal);
- }
};
-function onMouseOver() {
- // see comment in `graphic.isInEmphasis`
- !isInEmphasis(this) && onEmphasis.call(this);
-}
-
-function onMouseOut() {
- // see comment in `graphic.isInEmphasis`
- !isInEmphasis(this) && onNormal.call(this);
-}
-
-function onEmphasis() {
+function highDownOnUpdate(fromState, toState) {
// Do not support this hover animation util some scenario required.
// Animation can only be supported in hover layer when using `el.incremetal`.
if (this.incremental || this.useHoverLayer) {
return;
}
- var scale = this.__symbolOriginalScale;
- var ratio = scale[1] / scale[0];
- this.animateTo({
- scale: [
- Math.max(scale[0] * 1.1, scale[0] + 3),
- Math.max(scale[1] * 1.1, scale[1] + 3 * ratio)
- ]
- }, 400, 'elasticOut');
-}
-function onNormal() {
- if (this.incremental || this.useHoverLayer) {
- return;
+ if (toState === 'emphasis') {
+ var scale = this.__symbolOriginalScale;
+ var ratio = scale[1] / scale[0];
+ var emphasisOpt = {
+ scale: [
+ Math.max(scale[0] * 1.1, scale[0] + 3),
+ Math.max(scale[1] * 1.1, scale[1] + 3 * ratio)
+ ]
+ };
+ // FIXME
+ // modify it after support stop specified animation.
+ // toState === fromState
+ // ? (this.stopAnimation(), this.attr(emphasisOpt))
+ this.animateTo(emphasisOpt, 400, 'elasticOut');
+ }
+ else if (toState === 'normal') {
+ this.animateTo({
+ scale: this.__symbolOriginalScale
+ }, 400, 'elasticOut');
}
- this.animateTo({
- scale: this.__symbolOriginalScale
- }, 400, 'elasticOut');
}
-
/**
* @param {Function} cb
* @param {Object} [opt]
@@ -37036,10 +37520,10 @@ function createPolarClipShape(polar, hasAnimation, forSymbol, seriesModel) {
var clipPath = new Sector({
shape: {
- cx: round$2(polar.cx, 1),
- cy: round$2(polar.cy, 1),
- r0: round$2(radiusExtent[0], 1),
- r: round$2(radiusExtent[1], 1),
+ cx: round$1(polar.cx, 1),
+ cy: round$1(polar.cy, 1),
+ r0: round$1(radiusExtent[0], 1),
+ r: round$1(radiusExtent[1], 1),
startAngle: -angleExtent[0] * RADIAN,
endAngle: -angleExtent[1] * RADIAN,
clockwise: angleAxis.inverse
@@ -37699,7 +38183,6 @@ Chart.extend({
* under the License.
*/
-
var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) {
// Encoding visual for all series include which is filtered for legend drawing
return {
@@ -37711,14 +38194,24 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) {
reset: function (seriesModel, ecModel, api) {
var data = seriesModel.getData();
- var symbolType = seriesModel.get('symbol') || defaultSymbolType;
+ var symbolType = seriesModel.get('symbol');
var symbolSize = seriesModel.get('symbolSize');
var keepAspect = seriesModel.get('symbolKeepAspect');
+ var hasSymbolTypeCallback = isFunction$1(symbolType);
+ var hasSymbolSizeCallback = isFunction$1(symbolSize);
+ var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback;
+ var seriesSymbol = (!hasSymbolTypeCallback && symbolType) ? symbolType : defaultSymbolType;
+ var seriesSymbolSize = !hasSymbolSizeCallback ? symbolSize : null;
+
data.setVisual({
- legendSymbol: legendSymbol || symbolType,
- symbol: symbolType,
- symbolSize: symbolSize,
+ legendSymbol: legendSymbol || seriesSymbol,
+ // If seting callback functions on `symbol` or `symbolSize`, for simplicity and avoiding
+ // to bring trouble, we do not pick a reuslt from one of its calling on data item here,
+ // but just use the default value. Callback on `symbol` or `symbolSize` is convenient in
+ // some cases but generally it is not recommanded.
+ symbol: seriesSymbol,
+ symbolSize: seriesSymbolSize,
symbolKeepAspect: keepAspect
});
@@ -37727,23 +38220,19 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) {
return;
}
- var hasCallback = typeof symbolSize === 'function';
-
function dataEach(data, idx) {
- if (typeof symbolSize === 'function') {
+ if (hasCallback) {
var rawValue = seriesModel.getRawValue(idx);
- // FIXME
var params = seriesModel.getDataParams(idx);
- data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));
+ hasSymbolTypeCallback && data.setItemVisual(idx, 'symbol', symbolType(rawValue, params));
+ hasSymbolSizeCallback && data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));
}
if (data.hasItemOption) {
var itemModel = data.getItemModel(idx);
var itemSymbolType = itemModel.getShallow('symbol', true);
- var itemSymbolSize = itemModel.getShallow('symbolSize',
- true);
- var itemSymbolKeepAspect
- = itemModel.getShallow('symbolKeepAspect', true);
+ var itemSymbolSize = itemModel.getShallow('symbolSize', true);
+ var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true);
// If has item symbol
if (itemSymbolType != null) {
@@ -37754,8 +38243,7 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) {
data.setItemVisual(idx, 'symbolSize', itemSymbolSize);
}
if (itemSymbolKeepAspect != null) {
- data.setItemVisual(idx, 'symbolKeepAspect',
- itemSymbolKeepAspect);
+ data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect);
}
}
}
@@ -38822,7 +39310,7 @@ function Grid(gridModel, ecModel, api) {
this._coordsList = [];
/**
- * @type {Object.<string, module:echarts/coord/cartesian/Axis2D>}
+ * @type {Object.<string, Array.<module:echarts/coord/cartesian/Axis2D>>}
* @private
*/
this._axesMap = {};
@@ -39182,20 +39670,14 @@ gridProto._initCartesian = function (gridModel, ecModel, api) {
// Fix position
if (axisPosition !== 'top' && axisPosition !== 'bottom') {
// Default bottom of X
- axisPosition = 'bottom';
- if (axisPositionUsed[axisPosition]) {
- axisPosition = axisPosition === 'top' ? 'bottom' : 'top';
- }
+ axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';
}
}
else {
// Fix position
if (axisPosition !== 'left' && axisPosition !== 'right') {
// Default left of Y
- axisPosition = 'left';
- if (axisPositionUsed[axisPosition]) {
- axisPosition = axisPosition === 'left' ? 'right' : 'left';
- }
+ axisPosition = axisPositionUsed.left ? 'right' : 'left';
}
}
axisPositionUsed[axisPosition] = true;
@@ -39427,15 +39909,6 @@ CoordinateSystemManager.register('cartesian2d', Grid);
var PI$2 = Math.PI;
-function makeAxisEventDataBase(axisModel) {
- var eventData = {
- componentType: axisModel.mainType,
- componentIndex: axisModel.componentIndex
- };
- eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;
- return eventData;
-}
-
/**
* A final axis is translated and rotated from a "standard axis".
* So opt.position and opt.rotation is required.
@@ -39566,10 +40039,10 @@ var builders = {
axisModel.getModel('axisLine.lineStyle').getLineStyle()
);
- this.group.add(new Line(subPixelOptimizeLine({
+ this.group.add(new Line({
// Id for animation
anid: 'line',
-
+ subPixelOptimize: true,
shape: {
x1: pt1[0],
y1: pt1[1],
@@ -39580,7 +40053,7 @@ var builders = {
strokeContainThreshold: opt.strokeContainThreshold || 5,
silent: true,
z2: 1
- })));
+ }));
var arrows = axisModel.get('axisLine.symbol');
var arrowSize = axisModel.get('axisLine.symbolSize');
@@ -39752,7 +40225,7 @@ var builders = {
position: pos,
rotation: labelLayout.rotation,
- silent: isSilent(axisModel),
+ silent: isLabelSilent(axisModel),
z2: 1,
tooltip: (tooltipOpt && tooltipOpt.show)
? extend({
@@ -39770,8 +40243,10 @@ var builders = {
textFont: textFont,
textFill: textStyleModel.getTextColor()
|| axisModel.get('axisLine.lineStyle.color'),
- textAlign: labelLayout.textAlign,
- textVerticalAlign: labelLayout.textVerticalAlign
+ textAlign: textStyleModel.get('align')
+ || labelLayout.textAlign,
+ textVerticalAlign: textStyleModel.get('verticalAlign')
+ || labelLayout.textVerticalAlign
});
if (axisModel.get('triggerEvent')) {
@@ -39791,6 +40266,15 @@ var builders = {
};
+var makeAxisEventDataBase = AxisBuilder.makeAxisEventDataBase = function (axisModel) {
+ var eventData = {
+ componentType: axisModel.mainType,
+ componentIndex: axisModel.componentIndex
+ };
+ eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;
+ return eventData;
+};
+
/**
* @public
* @static
@@ -39868,14 +40352,14 @@ function endTextLayout(opt, textPosition, textRotate, extent) {
};
}
-function isSilent(axisModel) {
+var isLabelSilent = AxisBuilder.isLabelSilent = function (axisModel) {
var tooltipOpt = axisModel.get('tooltip');
return axisModel.get('silent')
// Consider mouse cursor, add these restrictions.
|| !(
axisModel.get('triggerEvent') || (tooltipOpt && tooltipOpt.show)
);
-}
+};
function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {
if (shouldShowAllLabels(axisModel.axis)) {
@@ -39996,10 +40480,10 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
applyTransform(pt2, pt2, matrix);
}
// Tick line, Not use group transform to have better line draw
- var tickEl = new Line(subPixelOptimizeLine({
+ var tickEl = new Line({
// Id for animation
anid: 'tick_' + ticksCoords[i].tickValue,
-
+ subPixelOptimize: true,
shape: {
x1: pt1[0],
y1: pt1[1],
@@ -40014,7 +40498,7 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
),
z2: 2,
silent: true
- }));
+ });
axisBuilder.group.add(tickEl);
tickEls.push(tickEl);
}
@@ -40040,10 +40524,10 @@ function buildAxisLabel(axisBuilder, axisModel, opt) {
) * PI$2 / 180;
var labelLayout = innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);
- var rawCategoryData = axisModel.getCategories(true);
+ var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);
var labelEls = [];
- var silent = isSilent(axisModel);
+ var silent = isLabelSilent(axisModel);
var triggerEvent = axisModel.get('triggerEvent');
each$1(labels, function (labelItem, index) {
@@ -40799,8 +41283,9 @@ var CartesianAxisView = AxisView.extend({
var colorIndex = (lineCount++) % lineColors.length;
var tickValue = ticksCoords[i].tickValue;
- this._axisGroup.add(new Line(subPixelOptimizeLine({
+ this._axisGroup.add(new Line({
anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,
+ subPixelOptimize: true,
shape: {
x1: p1[0],
y1: p1[1],
@@ -40811,7 +41296,7 @@ var CartesianAxisView = AxisView.extend({
stroke: lineColors[colorIndex]
}, lineStyle),
silent: true
- })));
+ }));
}
},
@@ -41254,6 +41739,7 @@ var barItemStyle = {
*/
var BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'barBorderWidth'];
+var _eventPos = [0, 0];
// FIXME
// Just for compatible with ec2.
@@ -41576,10 +42062,10 @@ var LargePath = Path.extend({
// a whole line or drawing rects.
var points = shape.points;
var startPoint = this.__startPoint;
- var valueIdx = this.__valueIdx;
+ var baseDimIdx = this.__baseDimIdx;
for (var i = 0; i < points.length; i += 2) {
- startPoint[this.__valueIdx] = points[i + valueIdx];
+ startPoint[baseDimIdx] = points[i + baseDimIdx];
ctx.moveTo(startPoint[0], startPoint[1]);
ctx.lineTo(points[i], points[i + 1]);
}
@@ -41590,17 +42076,68 @@ function createLarge(seriesModel, group, incremental) {
// TODO support polar
var data = seriesModel.getData();
var startPoint = [];
- var valueIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;
- startPoint[1 - valueIdx] = data.getLayout('valueAxisStart');
+ var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;
+ startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart');
var el = new LargePath({
shape: {points: data.getLayout('largePoints')},
incremental: !!incremental,
__startPoint: startPoint,
- __valueIdx: valueIdx
+ __baseDimIdx: baseDimIdx,
+ __largeDataIndices: data.getLayout('largeDataIndices'),
+ __barWidth: data.getLayout('barWidth')
});
group.add(el);
setLargeStyle(el, seriesModel, data);
+
+ // Enable tooltip and user mouse/touch event handlers.
+ el.seriesIndex = seriesModel.seriesIndex;
+
+ if (!seriesModel.get('silent')) {
+ el.on('mousedown', largePathUpdateDataIndex);
+ el.on('mousemove', largePathUpdateDataIndex);
+ }
+}
+
+// Use throttle to avoid frequently traverse to find dataIndex.
+var largePathUpdateDataIndex = throttle(function (event) {
+ var largePath = this;
+ var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);
+ largePath.dataIndex = dataIndex >= 0 ? dataIndex : null;
+}, 30, false);
+
+function largePathFindDataIndex(largePath, x, y) {
+ var baseDimIdx = largePath.__baseDimIdx;
+ var valueDimIdx = 1 - baseDimIdx;
+ var points = largePath.shape.points;
+ var largeDataIndices = largePath.__largeDataIndices;
+ var barWidthHalf = Math.abs(largePath.__barWidth / 2);
+ var startValueVal = largePath.__startPoint[valueDimIdx];
+
+ _eventPos[0] = x;
+ _eventPos[1] = y;
+ var pointerBaseVal = _eventPos[baseDimIdx];
+ var pointerValueVal = _eventPos[1 - baseDimIdx];
+ var baseLowerBound = pointerBaseVal - barWidthHalf;
+ var baseUpperBound = pointerBaseVal + barWidthHalf;
+
+ for (var i = 0, len = points.length / 2; i < len; i++) {
+ var ii = i * 2;
+ var barBaseVal = points[ii + baseDimIdx];
+ var barValueVal = points[ii + valueDimIdx];
+ if (
+ barBaseVal >= baseLowerBound && barBaseVal <= baseUpperBound
+ && (
+ startValueVal <= barValueVal
+ ? (pointerValueVal >= startValueVal && pointerValueVal <= barValueVal)
+ : (pointerValueVal >= barValueVal && pointerValueVal <= startValueVal)
+ )
+ ) {
+ return largeDataIndices[i];
+ }
+ }
+
+ return -1;
}
function setLargeStyle(el, seriesModel, data) {
@@ -41633,9 +42170,10 @@ function setLargeStyle(el, seriesModel, data) {
*/
// In case developer forget to include grid component
-registerLayout(curry(layout, 'bar'));
-// Should after normal bar layout, otherwise it is blocked by normal bar layout.
-registerLayout(largeLayout);
+registerLayout(PRIORITY.VISUAL.LAYOUT, curry(layout, 'bar'));
+// Use higher prority to avoid to be blocked by other overall layout, which do not
+// only exist in this module, but probably also exist in other modules, like `barPolar`.
+registerLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, largeLayout);
registerVisual({
seriesType: 'bar',
@@ -41915,6 +42453,11 @@ var PieSeries = extendSeriesModel({
startAngle: 90,
// 最小角度改为0
minAngle: 0,
+
+ // If the angle of a sector less than `minShowLabelAngle`,
+ // the label will not be displayed.
+ minShowLabelAngle: 0,
+
// 选中时扇区偏移量
selectedOffset: 10,
// 高亮扇区偏移量
@@ -42065,20 +42608,6 @@ function PiePiece(data, idx) {
this.add(text);
this.updateData(data, idx, true);
-
- // Hover to change label and labelLine
- function onEmphasis() {
- polyline.ignore = polyline.hoverIgnore;
- text.ignore = text.hoverIgnore;
- }
- function onNormal() {
- polyline.ignore = polyline.normalIgnore;
- text.ignore = text.normalIgnore;
- }
- this.on('emphasis', onEmphasis)
- .on('normal', onNormal)
- .on('mouseover', onEmphasis)
- .on('mouseout', onNormal);
}
var piePieceProto = PiePiece.prototype;
@@ -42086,6 +42615,8 @@ var piePieceProto = PiePiece.prototype;
piePieceProto.updateData = function (data, idx, firstCreate) {
var sector = this.childAt(0);
+ var labelLine = this.childAt(1);
+ var labelText = this.childAt(2);
var seriesModel = data.hostModel;
var itemModel = data.getItemModel(idx);
@@ -42148,34 +42679,36 @@ piePieceProto.updateData = function (data, idx, firstCreate) {
seriesModel.get('animation')
);
- function onEmphasis() {
- // Sector may has animation of updating data. Force to move to the last frame
- // Or it may stopped on the wrong shape
- sector.stopAnimation(true);
- sector.animateTo({
- shape: {
- r: layout.r + seriesModel.get('hoverOffset')
- }
- }, 300, 'elasticOut');
- }
- function onNormal() {
- sector.stopAnimation(true);
- sector.animateTo({
- shape: {
- r: layout.r
+ this._updateLabel(data, idx);
+
+ this.highDownOnUpdate = (itemModel.get('hoverAnimation') && seriesModel.isAnimationEnabled())
+ ? function (fromState, toState) {
+ if (toState === 'emphasis') {
+ labelLine.ignore = labelLine.hoverIgnore;
+ labelText.ignore = labelText.hoverIgnore;
+
+ // Sector may has animation of updating data. Force to move to the last frame
+ // Or it may stopped on the wrong shape
+ sector.stopAnimation(true);
+ sector.animateTo({
+ shape: {
+ r: layout.r + seriesModel.get('hoverOffset')
+ }
+ }, 300, 'elasticOut');
}
- }, 300, 'elasticOut');
- }
- sector.off('mouseover').off('mouseout').off('emphasis').off('normal');
- if (itemModel.get('hoverAnimation') && seriesModel.isAnimationEnabled()) {
- sector
- .on('mouseover', onEmphasis)
- .on('mouseout', onNormal)
- .on('emphasis', onEmphasis)
- .on('normal', onNormal);
- }
+ else {
+ labelLine.ignore = labelLine.normalIgnore;
+ labelText.ignore = labelText.normalIgnore;
- this._updateLabel(data, idx);
+ sector.stopAnimation(true);
+ sector.animateTo({
+ shape: {
+ r: layout.r
+ }
+ }, 300, 'elasticOut');
+ }
+ }
+ : null;
setHoverStyle(this);
};
@@ -42191,6 +42724,12 @@ piePieceProto._updateLabel = function (data, idx) {
var labelLayout = layout.label;
var visualColor = data.getItemVisual(idx, 'color');
+ if (!labelLayout || isNaN(labelLayout.x) || isNaN(labelLayout.y)) {
+ labelText.ignore = labelText.normalIgnore = labelText.hoverIgnore =
+ labelLine.ignore = labelLine.normalIgnore = labelLine.hoverIgnore = true;
+ return;
+ }
+
updateProps(labelLine, {
shape: {
points: labelLayout.linePoints || [
@@ -42288,7 +42827,6 @@ var PieView = Chart.extend({
);
var selectedMode = seriesModel.get('selectedMode');
-
data.diff(oldData)
.add(function (idx) {
var piePiece = new PiePiece(data, idx);
@@ -42327,6 +42865,10 @@ var PieView = Chart.extend({
&& animationType !== 'scale'
) {
var shape = data.getItemLayout(0);
+ for (var s = 1; isNaN(shape.startAngle) && s < data.count(); ++s) {
+ shape = data.getItemLayout(s);
+ }
+
var r = Math.max(api.getWidth(), api.getHeight()) / 2;
var removeClipPath = bind(group.removeClipPath, group);
@@ -42433,7 +42975,8 @@ var createDataSelectAction = function (seriesType, actionInfos) {
);
return {
name: payload.name,
- selected: selected
+ selected: selected,
+ seriesId: payload.seriesId
};
});
});
@@ -42539,6 +43082,8 @@ var dataColor = function (seriesType) {
// FIXME emphasis label position is not same with normal label position
+var RADIAN$1 = Math.PI / 180;
+
function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) {
list.sort(function (a, b) {
return a.y - b.y;
@@ -42672,12 +43217,13 @@ function isPositionCenter(layout) {
return layout.position === 'center';
}
-var labelLayout = function (seriesModel, r, viewWidth, viewHeight) {
+var labelLayout = function (seriesModel, r, viewWidth, viewHeight, sum) {
var data = seriesModel.getData();
var labelLayoutList = [];
var cx;
var cy;
var hasLabelRotate = false;
+ var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN$1;
data.each(function (idx) {
var layout = data.getItemLayout(idx);
@@ -42691,6 +43237,10 @@ var labelLayout = function (seriesModel, r, viewWidth, viewHeight) {
var labelLineLen = labelLineModel.get('length');
var labelLineLen2 = labelLineModel.get('length2');
+ if (layout.angle < minShowLabelRadian) {
+ return;
+ }
+
var midAngle = (layout.startAngle + layout.endAngle) / 2;
var dx = Math.cos(midAngle);
var dy = Math.sin(midAngle);
@@ -42732,8 +43282,16 @@ var labelLayout = function (seriesModel, r, viewWidth, viewHeight) {
}
var font = labelModel.getFont();
- var labelRotate = labelModel.get('rotate')
- ? (dx < 0 ? -midAngle + Math.PI : -midAngle) : 0;
+ var labelRotate;
+ var rotate = labelModel.get('rotate');
+ if (typeof rotate === 'number') {
+ labelRotate = rotate * (Math.PI / 180);
+ }
+ else {
+ labelRotate = rotate
+ ? (dx < 0 ? -midAngle + Math.PI : -midAngle)
+ : 0;
+ }
var text = seriesModel.getFormattedLabel(idx, 'normal')
|| data.getName(idx);
var textRect = getBoundingRect(
@@ -45082,7 +45640,7 @@ BaseAxisPointer.prototype = {
*/
updatePointerEl: function (group, elOption, updateProps$$1) {
var pointerEl = inner$9(group).pointerEl;
- if (pointerEl) {
+ if (pointerEl && elOption.pointer) {
pointerEl.setStyle(elOption.pointer.style);
updateProps$$1(pointerEl, {shape: elOption.pointer.shape});
}
@@ -45464,6 +46022,7 @@ function buildLabelElOption(
textFont: font,
textFill: labelModel.getTextColor(),
textPosition: 'inside',
+ textPadding: paddings,
fill: bgColor,
stroke: labelModel.get('borderColor') || 'transparent',
lineWidth: labelModel.get('borderWidth') || 0,
@@ -45508,6 +46067,8 @@ function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {
if (formatter) {
var params = {
value: getAxisRawValue(axis, value),
+ axisDimension: axis.dim,
+ axisIndex: axis.index,
seriesData: []
};
each$1(seriesDataIndices, function (idxItem) {
@@ -45625,7 +46186,7 @@ var CartesianAxisPointer = BaseAxisPointer.extend({
if (axisPointerType && axisPointerType !== 'none') {
var elStyle = buildElStyle(axisPointerModel);
var pointerOption = pointerShapeBuilder[axisPointerType](
- axis, pixelValue, otherExtent, elStyle
+ axis, pixelValue, otherExtent
);
pointerOption.style = elStyle;
elOption.graphicKey = pointerOption.type;
@@ -45692,23 +46253,20 @@ function getCartesian(grid, axis) {
var pointerShapeBuilder = {
- line: function (axis, pixelValue, otherExtent, elStyle) {
+ line: function (axis, pixelValue, otherExtent) {
var targetShape = makeLineShape(
[pixelValue, otherExtent[0]],
[pixelValue, otherExtent[1]],
getAxisDimIndex(axis)
);
- subPixelOptimizeLine({
- shape: targetShape,
- style: elStyle
- });
return {
type: 'Line',
+ subPixelOptimize: true,
shape: targetShape
};
},
- shadow: function (axis, pixelValue, otherExtent, elStyle) {
+ shadow: function (axis, pixelValue, otherExtent) {
var bandWidth = Math.max(1, axis.getBandWidth());
var span = otherExtent[1] - otherExtent[0];
return {
@@ -46054,6 +46612,10 @@ function TooltipContent(container, api) {
*/
this._hideTimeout;
+ // FIXME
+ // Is it needed to trigger zr event manually if
+ // the browser do not support `pointer-events: none`.
+
var self = this;
el.onmouseenter = function () {
// clear the timeout in hideLater and keep showing tooltip
@@ -46066,6 +46628,10 @@ function TooltipContent(container, api) {
el.onmousemove = function (e) {
e = e || window.event;
if (!self._enterable) {
+ // `pointer-events: none` is set to tooltip content div
+ // if `enterable` is set as `false`, and `el.onmousemove`
+ // can not be triggered. But in browser that do not
+ // support `pointer-events`, we need to do this:
// Try trigger zrender event to avoid mouse
// in and out shape too frequently
var handler = zr.handler;
@@ -46196,10 +46762,8 @@ TooltipContent.prototype = {
if (document.defaultView && document.defaultView.getComputedStyle) {
var stl = document.defaultView.getComputedStyle(this.el);
if (stl) {
- width += parseInt(stl.paddingLeft, 10) + parseInt(stl.paddingRight, 10)
- + parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10);
- height += parseInt(stl.paddingTop, 10) + parseInt(stl.paddingBottom, 10)
- + parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10);
+ width += parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10);
+ height += parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10);
}
}
@@ -46361,7 +46925,9 @@ TooltipRichContent.prototype = {
},
hide: function () {
- this.el.hide();
+ if (this.el) {
+ this.el.hide();
+ }
this._show = false;
},
@@ -46384,7 +46950,11 @@ TooltipRichContent.prototype = {
},
getOuterSize: function () {
- return this.getSize();
+ var size = this.getSize();
+ return {
+ width: size[0],
+ height: size[1]
+ };
}
};
@@ -46529,7 +47099,7 @@ extendComponentView({
// Show tip next tick after other charts are rendered
// In case highlight action has wrong result
// FIXME
- self.manuallyShowTip(tooltipModel, ecModel, api, {
+ !api.isDisposed() && self.manuallyShowTip(tooltipModel, ecModel, api, {
x: self._lastX,
y: self._lastY
});
@@ -48535,6 +49105,7 @@ var ScrollableLegendView = LegendView.extend({
var orientIdx = legendModel.getOrient().index;
var wh = WH[orientIdx];
var xy = XY[orientIdx];
+
var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);
var children = contentGroup.children();
var targetItem = children[targetItemIndex];
@@ -48646,17 +49217,26 @@ var ScrollableLegendView = LegendView.extend({
_findTargetItemIndex: function (targetDataIndex) {
var index;
var contentGroup = this.getContentGroup();
+ var defaultIndex;
+
if (this._showController) {
contentGroup.eachChild(function (child, idx) {
- if (child.__legendDataIndex === targetDataIndex) {
+ var legendDataIdx = child.__legendDataIndex;
+ // FIXME
+ // If the given targetDataIndex (from model) is illegal,
+ // we use defualtIndex. But the index on the legend model and
+ // action payload is still illegal. That case will not be
+ // changed until some scenario requires.
+ if (defaultIndex == null && legendDataIdx != null) {
+ defaultIndex = idx;
+ }
+ if (legendDataIdx === targetDataIndex) {
index = idx;
}
});
}
- else {
- index = 0;
- }
- return index;
+
+ return index != null ? index : defaultIndex;
}
});
@@ -48802,7 +49382,8 @@ extendComponentModel({
// 垂直对齐
// 'auto' | 'top' | 'bottom' | 'middle'
// 默认根据 top 位置判断是上对齐还是下对齐
- // textBaseline: null
+ // textVerticalAlign: null
+ // textBaseline: null // The same as textVerticalAlign.
backgroundColor: 'rgba(0,0,0,0)',
@@ -48847,7 +49428,9 @@ extendComponentView({
var subtextStyleModel = titleModel.getModel('subtextStyle');
var textAlign = titleModel.get('textAlign');
- var textBaseline = titleModel.get('textBaseline');
+ var textVerticalAlign = retrieve2(
+ titleModel.get('textBaseline'), titleModel.get('textVerticalAlign')
+ );
var textEl = new Text({
style: setTextStyle({}, textStyleModel, {
@@ -48924,25 +49507,25 @@ extendComponentView({
layoutRect.x += layoutRect.width / 2;
}
}
- if (!textBaseline) {
- textBaseline = titleModel.get('top') || titleModel.get('bottom');
- if (textBaseline === 'center') {
- textBaseline = 'middle';
+ if (!textVerticalAlign) {
+ textVerticalAlign = titleModel.get('top') || titleModel.get('bottom');
+ if (textVerticalAlign === 'center') {
+ textVerticalAlign = 'middle';
}
- if (textBaseline === 'bottom') {
+ if (textVerticalAlign === 'bottom') {
layoutRect.y += layoutRect.height;
}
- else if (textBaseline === 'middle') {
+ else if (textVerticalAlign === 'middle') {
layoutRect.y += layoutRect.height / 2;
}
- textBaseline = textBaseline || 'top';
+ textVerticalAlign = textVerticalAlign || 'top';
}
group.attr('position', [layoutRect.x, layoutRect.y]);
var alignStyle = {
textAlign: textAlign,
- textVerticalAlign: textBaseline
+ textVerticalAlign: textVerticalAlign
};
textEl.setStyle(alignStyle);
subTextEl.setStyle(alignStyle);
@@ -48962,9 +49545,9 @@ extendComponentView({
r: titleModel.get('borderRadius')
},
style: style,
+ subPixelOptimize: true,
silent: true
});
- subPixelOptimizeRect(rect);
group.add(rect);
}
@@ -49546,18 +50129,28 @@ MarkerView.extend({
mpData.each(function (idx) {
var itemModel = mpData.getItemModel(idx);
+ var symbol = itemModel.getShallow('symbol');
var symbolSize = itemModel.getShallow('symbolSize');
- if (typeof symbolSize === 'function') {
- // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?
- symbolSize = symbolSize(
- mpModel.getRawValue(idx), mpModel.getDataParams(idx)
- );
+ var isFnSymbol = isFunction$1(symbol);
+ var isFnSymbolSize = isFunction$1(symbolSize);
+
+ if (isFnSymbol || isFnSymbolSize) {
+ var rawIdx = mpModel.getRawValue(idx);
+ var dataParams = mpModel.getDataParams(idx);
+ if (isFnSymbol) {
+ symbol = symbol(rawIdx, dataParams);
+ }
+ if (isFnSymbolSize) {
+ // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?
+ symbolSize = symbolSize(rawIdx, dataParams);
+ }
}
+
mpData.setItemVisual(idx, {
+ symbol: symbol,
symbolSize: symbolSize,
color: itemModel.get('itemStyle.color')
- || seriesData.getVisual('color'),
- symbol: itemModel.getShallow('symbol')
+ || seriesData.getVisual('color')
});
});
@@ -49752,22 +50345,26 @@ var LinePath = extendShape({
},
buildPath: function (ctx, shape) {
- (isLine(shape) ? straightLineProto : bezierCurveProto).buildPath(ctx, shape);
+ this[isLine(shape) ? '_buildPathLine' : '_buildPathCurve'](ctx, shape);
},
+ _buildPathLine: straightLineProto.buildPath,
+ _buildPathCurve: bezierCurveProto.buildPath,
pointAt: function (t) {
- return isLine(this.shape)
- ? straightLineProto.pointAt.call(this, t)
- : bezierCurveProto.pointAt.call(this, t);
+ return this[isLine(this.shape) ? '_pointAtLine' : '_pointAtCurve'](t);
},
+ _pointAtLine: straightLineProto.pointAt,
+ _pointAtCurve: bezierCurveProto.pointAt,
tangentAt: function (t) {
var shape = this.shape;
var p = isLine(shape)
? [shape.x2 - shape.x1, shape.y2 - shape.y1]
- : bezierCurveProto.tangentAt.call(this, t);
+ : this._tangentAtCurve(t);
return normalize(p, p);
- }
+ },
+ _tangentAtCurve: bezierCurveProto.tangentAt
+
});
/*
@@ -49825,22 +50422,21 @@ function createSymbol$1(name, lineData, idx) {
function createLine(points) {
var line = new LinePath({
- name: 'line'
+ name: 'line',
+ subPixelOptimize: true
});
setLinePoints(line.shape, points);
return line;
}
function setLinePoints(targetShape, points) {
- var p1 = points[0];
- var p2 = points[1];
- var cp1 = points[2];
- targetShape.x1 = p1[0];
- targetShape.y1 = p1[1];
- targetShape.x2 = p2[0];
- targetShape.y2 = p2[1];
+ targetShape.x1 = points[0][0];
+ targetShape.y1 = points[0][1];
+ targetShape.x2 = points[1][0];
+ targetShape.y2 = points[1][1];
targetShape.percent = 1;
+ var cp1 = points[2];
if (cp1) {
targetShape.cpx1 = cp1[0];
targetShape.cpy1 = cp1[1];
@@ -49971,7 +50567,6 @@ lineProto.beforeUpdate = updateSymbolAndLabelBeforeLineUpdate;
lineProto._createLine = function (lineData, idx, seriesScope) {
var seriesModel = lineData.hostModel;
var linePoints = lineData.getItemLayout(idx);
-
var line = createLine(linePoints);
line.shape.percent = 0;
initProps(line, {
@@ -50011,6 +50606,7 @@ lineProto.updateData = function (lineData, idx, seriesScope) {
var target = {
shape: {}
};
+
setLinePoints(target.shape, linePoints);
updateProps(line, target, seriesModel, idx);
... 190393 lines suppressed ...
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org