From a91f1b18a29d6154eb0fcae7af0997e12dd7bfea Mon Sep 17 00:00:00 2001 From: xuying <33517362+tangying1027@users.noreply.github.com> Date: Fri, 22 Nov 2024 11:53:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=87=AA=E5=AE=9A=E4=B9=89marker=20(#20?= =?UTF-8?q?21)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 兵人 --- .../f2/src/components/legend/legendView.tsx | 2 +- ...6\232\344\271\211-items-marker-1-snap.png" | Bin 0 -> 4098 bytes .../f2/test/components/legend/legend.test.tsx | 43 ++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 "packages/f2/test/components/legend/__image_snapshots__/legend-test-tsx-\345\233\276\344\276\213-\345\233\276\344\276\213\346\240\267\345\274\217-\350\207\252\345\256\232\344\271\211-items-marker-1-snap.png" diff --git a/packages/f2/src/components/legend/legendView.tsx b/packages/f2/src/components/legend/legendView.tsx index f98c59717..e8f8c0840 100644 --- a/packages/f2/src/components/legend/legendView.tsx +++ b/packages/f2/src/components/legend/legendView.tsx @@ -88,7 +88,7 @@ export default (props) => { data-item={item} onClick={onClick} > - {Marker({ color: filtered ? '#bfbfbf' : color, type: marker })} + {Marker({ color: filtered ? '#bfbfbf' : color, type: item?.marker || marker })} {/* */} (MR62cxt~+;!d)|Jn7zV-fVKxb7HPl(2{oWKIn-tsD|ZS zl`#|$sCM(vnaYJ>V$G6EFP(bb_mh#X-_S87l{U+68!l6wl_N)4NE69Ek@P87W+9LbStN7 zC|vBVouWy09=|U$`i5=!PtFVi|FRG>+}h4rCi?^U7H+-40?vHQ%>*qjRY*4Z#;M8# zmD^{MBC~#sB%HRKNc$?a!kR%iopMM3r`zeavK4t6E$}~KMz^x{;{S_LDniHl3Z_aO5X1m zg&yoDB`2q(l%+S`bl$$ z&mhY(G%=glV-5)PFKT9^O>t_F6X4NsC!>K0S@8A9C9`|9WYf$5;Lqq6w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uP4suUfU(qsHGA!5dfzVvfv5<*BKXTByH~%TYkm98j6sFr+wl7a9m^jCa+11HCmzNS!MbpPJI>eXovhe zWO_iPZ*9aKO_FwzqV4X=rKhEl-IXVRsV4C1;59S3x@#pc&>#ET|8l(H%{eFjd#e(u zBu}}I2|&G~;!p9*vHA6KA9uKhMYsWkyTI_IP~lf|2mAfB-PL8N#si_bo+=Z=r7F1yIyc++daz1J6TUJ)q_~%|_&vCD8gGe@tgudkBbKT(MKYO<( zR`*71H*ashFEA?*9!Dd1({pJ%pDCZbr&L6iq<)q>!?@Jyc3pAHKbMOJkJ44FrD!d$wwgqk^0bCJo9v9j3gtNr7- zgnpY(ll`x&`PvV#dJ5_dWo4UeMOI~tQ56WOax3NtNU=4?B3p|mtv2w}#ZRvR6G`0W zO#h)xw}ifb2bp|nR6_5(M)Eu(u2ty%s#y_2N}fNoog;ug)ZO zM-Viy2!#lfPEe#YKzbNqhH=t~J8 zi->LFK(&$w<%!FgE1L)^+B1-;9M4)ni~!9HBWO-Xf?CxhP7X`H)pH06*_FRQ*=tX0 zm-+>onh3}mIy0LfI)Q?AuIsE81e7r<$O{l^Fo<0LIiGyqR@DEq)afB(T-oKGl8$K5 O?E!rh8d<9281_H++O;(R literal 0 HcmV?d00001 diff --git a/packages/f2/test/components/legend/legend.test.tsx b/packages/f2/test/components/legend/legend.test.tsx index 61503b41e..b092b4d6b 100644 --- a/packages/f2/test/components/legend/legend.test.tsx +++ b/packages/f2/test/components/legend/legend.test.tsx @@ -317,6 +317,49 @@ describe('图例', () => { await delay(1000); expect(context).toMatchImageSnapshot(); }); + + + it('自定义 items Marker', async () => { + const context = createContext('自定义 items Marker', { + height: '70px', + }); + const { props } = ( + + + + + + + ); + const canvas = new Canvas(props); + await canvas.render(); + + await delay(1000); + expect(context).toMatchImageSnapshot(); + }); }); describe('点击交互', () => {