From 4977031ff8a377548ba9233fe073962730ee6075 Mon Sep 17 00:00:00 2001 From: MiniPear Date: Sun, 25 Jun 2023 18:51:39 +0800 Subject: [PATCH] fix(area): one missing point (#5229) --- .../snapshots/static/mockAreaMissingData.png | Bin 0 -> 11011 bytes __tests__/plots/static/index.ts | 1 + .../plots/static/mock-area-missing-data.ts | 19 ++++++++++++++++++ src/shape/area/curve.ts | 2 +- 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 __tests__/integration/snapshots/static/mockAreaMissingData.png create mode 100644 __tests__/plots/static/mock-area-missing-data.ts diff --git a/__tests__/integration/snapshots/static/mockAreaMissingData.png b/__tests__/integration/snapshots/static/mockAreaMissingData.png new file mode 100644 index 0000000000000000000000000000000000000000..5608e78adea79d860375b84ae298191e544b8cb6 GIT binary patch literal 11011 zcmeHtXH-*J`)^1n(h+GQMKCl$P^nTKdZ-$ZB3;_hB!V=l8EFbqLK6_M1T;!#K$I3y ziXfmEdJ7_;)Yu4}yH953z4QLpy~rgag%LZ8APWozV@Db5 zqhT<391KQBKEwz{ls`;<27ef@m>TKB4xpd=EswKcu;Vb4{%_Xd_g1GO!#zUW4!%*t zyl^cFa#RK$F07~R+9BtRlb60RI=}XkWc^fX*E_%X=+YJ;f!Bd>{CG9`J^G|SE}*<+ z*FRu+z{YROZHMQwV}W_Q{7KH~Cmk&1#H+Zi{e87Mi8n3Cd{nDq@O0JUIm?B6>-qTu zW8TaqT8mNM=W$5X|M@rj!kLgbK3muZlOgt-k9OGMY8Ey6L&U5*cT@sQu`S&}r{JBx z@417;8W&B3?{^fjMR9#W?E4B1L<(06Zpu)UFai`V%#rGl_823071OY?_=?DN#N(mq zw(~ZOu`ov_%`*v$>tF9KAQll_Bc1DX``pRwnv5tM-kvH(W+77_f4esqrvp#RuMUu@ z&Mh~Cudv@^aAb{oxRz}deApg4@c^;O^Ikb&(PI9tJiR;<2U0dk74AKJ#14n-GZPDm zE8}v%`>HM%=d{+$pmr#H-(tg_t~qM3Avms$&Q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Z9LAexb9p|H8wN8bk3Db7n?aabRl`0*j5I(4OL-u7> zhY4{mzg#n0vzAk3ZkEbf3YhJQ3yDf3?+zJOEw*RR)GP1kjB z@#<5?LO>X!S#KPsw9+2`GPsZOGxTSjQm|nNBZMVlhQ1Y0!`mowhAUt+DOTiktmtDl za19_wKg}$}q{+O?9CK&2+(FL$ zowv8iHAGQ(5$ec1(b*%GoCK4~;wAD+nj;B0_u%D4)z0*5unkk3A^O=@*f643(qAL9 zyzt$vW@orILpT!!6EIe+l7{E|*~^^X<+ser?U_lsyzz8zwU$cw9z zX!7_W72b1c@Taim>^E-L!<0IG@O?pU7xv_Uv+^M#Q(S2e$EWNnbZ)3uQ*fsSxQkn`*XW@sr<6M~1;35F{_|pvRzqRl`lv2>W|M|zV z5=g*7%NDNd<8!uI(HhBM()g%&@t%60EH>+iS0>&^ri|k_%6yHBeD*$*+Tl^SCUX>5 zqiFaMj39=M0lR&jq%gHvRwQWWuF%{Ue7^3L2Se2fTl^4ulut&ZpsMg z;3^l*tX!|H zi^Y+kdgxET9ay@#-3-U%^Q6T|^H9|0dDo*9;);G2J|C1VgOz*y7}$Wt#;9ocfk^QW z;o3-sfhSrU->dLt(6znOF?a*qFOHwC?N#u=p|$Ee{(O|P `${d.province}+${d.categories}`, + }, + }; +} diff --git a/src/shape/area/curve.ts b/src/shape/area/curve.ts index f61136e256..84826ce191 100644 --- a/src/shape/area/curve.ts +++ b/src/shape/area/curve.ts @@ -107,7 +107,7 @@ export const Curve: SC = (options, context) => { const getPathNode = (path) => { return select(document.createElement('path', {})) - .style('d', path) + .style('d', path || '') .call(applyStyle, finalStyle) .node(); };