-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 修复开启自定义指标层级后, 角头数值文本未对齐 close #2957
- Loading branch information
卿珂
committed
Nov 8, 2024
1 parent
e759891
commit 0f4ce09
Showing
6 changed files
with
181 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* @description spec for issue #2957 | ||
* https://github.com/antvis/S2/issues/2957 | ||
*/ | ||
import { PivotSheet } from '@/sheet-type'; | ||
import type { S2Options } from '../../src'; | ||
import { getContainer } from '../util/helpers'; | ||
|
||
const s2Options: S2Options = { | ||
width: 800, | ||
height: 600, | ||
}; | ||
|
||
describe('Corner Measure Text Tests', () => { | ||
test('should get correctly theme config with customValueOrder', async () => { | ||
const s2 = new PivotSheet( | ||
getContainer(), | ||
{ | ||
data: [ | ||
{ | ||
'4rweiwt7aneo': '上海市', | ||
'4w8pyhsbkkjk': '①正常库存', | ||
'4vynudxz28sg': '457', | ||
styleKey: 1, | ||
}, | ||
], | ||
fields: { | ||
valueInCols: true, | ||
rows: ['4rweiwt7aneo'], | ||
columns: ['4w8pyhsbkkjk'], | ||
values: ['4vynudxz28sg'], | ||
customValueOrder: 0, | ||
}, | ||
}, | ||
s2Options, | ||
); | ||
|
||
s2.setTheme({ | ||
cornerCell: { | ||
measureText: { | ||
fill: 'blue', | ||
textAlign: 'center', | ||
fontSize: 12, | ||
}, | ||
}, | ||
}); | ||
await s2.render(); | ||
|
||
const extraFieldText = s2.facet.getCornerCells()[1].getTextShape(); | ||
|
||
expect(extraFieldText.parsedStyle.textBaseline).toEqual('middle'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters