Skip to content

Commit 9aeffb6

Browse files
authored
Merge branch 'master' into feat-copy-data
2 parents 50f2609 + fc6c5a2 commit 9aeffb6

File tree

11 files changed

+339
-62
lines changed

11 files changed

+339
-62
lines changed

README.en-US.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,14 @@ yarn site:start
219219

220220
## 📧 Contact Us
221221

222-
<img style="width: 300px; height: auto" alt="S2" src="https://gw.alipayobjects.com/zos/antfincdn/2zjO70QLdp/7939a108-930c-42a9-a0d3-fbfdc2cc44cf.jpg">
222+
<p>
223+
<a>
224+
<img width="300" height="auto" alt="S2" src="https://gw.alipayobjects.com/zos/antfincdn/2zjO70QLdp/7939a108-930c-42a9-a0d3-fbfdc2cc44cf.jpg">
225+
</a>
226+
<a>
227+
<img width="300" height="auto" alt="S2" src="https://gw.alipayobjects.com/zos/antfincdn/v4TlwgORE/qq_qr_code.JPG">
228+
</a>
229+
</p>
223230

224231
## 👬 Contributors
225232

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,14 @@ yarn site:start
213213

214214
## 📧 联系我们
215215

216-
<img style="width: 300px; height: auto" alt="S2" src="https://gw.alipayobjects.com/zos/antfincdn/2zjO70QLdp/7939a108-930c-42a9-a0d3-fbfdc2cc44cf.jpg"></a>
216+
<p>
217+
<a>
218+
<img width="300" height="auto" alt="S2" src="https://gw.alipayobjects.com/zos/antfincdn/2zjO70QLdp/7939a108-930c-42a9-a0d3-fbfdc2cc44cf.jpg">
219+
</a>
220+
<a>
221+
<img width="300" height="auto" alt="S2" src="https://gw.alipayobjects.com/zos/antfincdn/v4TlwgORE/qq_qr_code.JPG">
222+
</a>
223+
</p>
217224

218225
## 👬 Contributors
219226

packages/s2-core/__tests__/unit/utils/text-spec.ts

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
isUpDataValue,
66
getCellWidth,
77
getEmptyPlaceholder,
8+
getContentAreaForMultiData,
89
} from '@/utils/text';
910

1011
const isHD = window.devicePixelRatio >= 2;
@@ -159,4 +160,110 @@ describe('Text Utils Tests', () => {
159160

160161
expect(placeholder).toEqual('test');
161162
});
163+
164+
test('should get correct content area for multiData without widthPercent', () => {
165+
const box = {
166+
x: 0,
167+
y: 0,
168+
width: 100,
169+
height: 100,
170+
};
171+
172+
const multiData = [
173+
[0, 1],
174+
[20, 30],
175+
];
176+
177+
const boxes = getContentAreaForMultiData(box, multiData);
178+
179+
expect(boxes).toEqual([
180+
[
181+
{
182+
x: 0,
183+
y: 0,
184+
width: 50,
185+
height: 50,
186+
},
187+
{
188+
x: 50,
189+
y: 0,
190+
width: 50,
191+
height: 50,
192+
},
193+
],
194+
[
195+
{
196+
x: 0,
197+
y: 50,
198+
width: 50,
199+
height: 50,
200+
},
201+
{
202+
x: 50,
203+
y: 50,
204+
width: 50,
205+
height: 50,
206+
},
207+
],
208+
]);
209+
});
210+
211+
test('should get correct content area for multiData with widthPercent', () => {
212+
const box = {
213+
x: 0,
214+
y: 0,
215+
width: 100,
216+
height: 100,
217+
};
218+
219+
const multiData = [
220+
[0, 1, 2],
221+
[20, 30, 40],
222+
];
223+
224+
const boxes = getContentAreaForMultiData(box, multiData, [0.4, 0.2, 0.4]);
225+
226+
expect(boxes).toEqual([
227+
[
228+
{
229+
x: 0,
230+
y: 0,
231+
width: 40,
232+
height: 50,
233+
},
234+
{
235+
x: 40,
236+
y: 0,
237+
width: 20,
238+
height: 50,
239+
},
240+
{
241+
x: 60,
242+
y: 0,
243+
width: 40,
244+
height: 50,
245+
},
246+
],
247+
[
248+
{
249+
x: 0,
250+
y: 50,
251+
width: 40,
252+
height: 50,
253+
},
254+
{
255+
x: 40,
256+
y: 50,
257+
width: 20,
258+
height: 50,
259+
},
260+
{
261+
x: 60,
262+
y: 50,
263+
width: 40,
264+
height: 50,
265+
},
266+
],
267+
]);
268+
});
162269
});

packages/s2-core/src/cell/data-cell.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import type {
1313
Condition,
1414
Conditions,
1515
FormatResult,
16-
Formatter,
1716
IconCfg,
1817
IconCondition,
1918
MappingResult,

0 commit comments

Comments
 (0)