feat(坐标轴): 支持显示纵轴单位
All checks were successful
Package component / package (push) Successful in 4m18s
All checks were successful
Package component / package (push) Successful in 4m18s
This commit is contained in:
@@ -158,6 +158,12 @@ describe('WaveformChart', () => {
|
||||
expect(paths[0].attributes('data-series-name')).toBe('BT2_2M')
|
||||
const yAxisLabels = wrapper.findAll('.waveform-chart__y-axis-label')
|
||||
expect(yAxisLabels.map((label) => label.text())).toEqual(['BT2_2M', 'BT1_2M'])
|
||||
expect(
|
||||
wrapper
|
||||
.findAll('.waveform-chart__axis--y .tick text')
|
||||
.map((label) => label.text())
|
||||
.some((label) => label.includes('(T)')),
|
||||
).toBe(true)
|
||||
expect(yAxisLabels.map((label) => label.attributes('fill'))).toEqual(['#0960bd', '#ff7f0e'])
|
||||
const labelX = Number(
|
||||
yAxisLabels[0].attributes('transform')?.match(/^translate\(([-\d.]+),/)?.[1],
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('WaveformChart', () => {
|
||||
{
|
||||
trackId: 'shared-frame',
|
||||
name: '普通量程',
|
||||
unit: 'V',
|
||||
data: {
|
||||
kind: 'points',
|
||||
points: [
|
||||
@@ -26,6 +27,7 @@ describe('WaveformChart', () => {
|
||||
{
|
||||
trackId: 'shared-frame',
|
||||
name: '大量程',
|
||||
unit: 'A',
|
||||
data: {
|
||||
kind: 'points',
|
||||
points: [
|
||||
@@ -37,6 +39,7 @@ describe('WaveformChart', () => {
|
||||
{
|
||||
trackId: 'shared-frame',
|
||||
name: '小量程',
|
||||
unit: 'T',
|
||||
data: {
|
||||
kind: 'points',
|
||||
points: [
|
||||
@@ -57,7 +60,11 @@ describe('WaveformChart', () => {
|
||||
.map((label) => label.text())
|
||||
.filter((label) => label.startsWith('E')),
|
||||
),
|
||||
).toEqual([[], [expect.stringMatching(/^E\+03 /)], [expect.stringMatching(/^E-04 /)]])
|
||||
).toEqual([
|
||||
[],
|
||||
[expect.stringMatching(/^E\+03 \(A\) /)],
|
||||
[expect.stringMatching(/^E-04 \(T\) /)],
|
||||
])
|
||||
})
|
||||
|
||||
it('reprojects annotations with the Y axis assigned to their series', async () => {
|
||||
|
||||
Reference in New Issue
Block a user