waveform-analysis 0.1.43 → 0.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +163 -161
- package/dist/style.css +1 -1
- package/dist/types/components/core/constants.d.ts +2 -2
- package/dist/types/components/core/types.d.ts +2 -1
- package/dist/types/components/core/yAxisConstants.d.ts +2 -2
- package/dist/types/components/interaction/WaveformTooltip.vue.d.ts +1 -1
- package/package.json +1 -1
- package/src/App.test.ts +2 -7
- package/src/components/WaveformChart.css +1 -1
- package/src/components/core/constants.ts +3 -3
- package/src/components/core/layout.test.ts +3 -3
- package/src/components/core/layout.ts +2 -2
- package/src/components/core/trackLayoutBuilder.ts +2 -2
- package/src/components/core/types.ts +2 -1
- package/src/components/core/useWaveformChartController.ts +1 -0
- package/src/components/core/yAxisConstants.ts +2 -2
- package/src/components/interaction/WaveformHoverHost.vue +3 -1
- package/src/components/interaction/WaveformTooltip.test.ts +23 -0
- package/src/components/interaction/WaveformTooltip.vue +9 -6
- package/src/components/interaction/useWaveformHover.ts +19 -14
- package/src/components/rendering/WaveformHoverLayer.vue +5 -11
- package/src/components/rendering/WaveformTrackAxes.vue +5 -4
- package/src/components/waveformChartCases/dataLifecycle.test.ts +1 -1
- package/src/components/waveformChartCases/frameGridAndFormatting.test.ts +10 -0
- package/src/components/waveformChartCases/incompleteDataHover.test.ts +67 -0
- package/src/components/waveformChartCases/layoutAndDomains.test.ts +5 -5
- package/src/components/waveformChartCases/legendVisibility.test.ts +1 -1
- package/src/components/waveformChartCases/multiAxisAndPagination.test.ts +1 -1
- package/src/data/simulatedWaveforms.test.ts +7 -2
- package/src/data/simulatedWaveforms.ts +12 -7
|
@@ -21,8 +21,13 @@ describe('simulated waveform data', () => {
|
|
|
21
21
|
first.series.forEach((series) => {
|
|
22
22
|
expect(series.data.kind).toBe('points')
|
|
23
23
|
if (series.data.kind !== 'points') return
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
if (series.id === 'simulated-step') {
|
|
25
|
+
expect(series.data.points).toHaveLength(500)
|
|
26
|
+
expect(series.data.points.every((point) => point.x >= 0)).toBe(true)
|
|
27
|
+
} else {
|
|
28
|
+
expect(series.data.points).toHaveLength(1_000)
|
|
29
|
+
expect(series.data.points[0]?.x).toBe(-5)
|
|
30
|
+
}
|
|
26
31
|
expect(series.data.points.at(-1)?.x).toBe(5)
|
|
27
32
|
series.data.points.forEach((point) => {
|
|
28
33
|
expect(Number.isFinite(point.x)).toBe(true)
|
|
@@ -17,6 +17,7 @@ interface SimulatedSeriesDefinition extends Pick<
|
|
|
17
17
|
> {
|
|
18
18
|
signal: SignalGenerator
|
|
19
19
|
errors?: ErrorGenerator
|
|
20
|
+
minimumX?: number
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
function createSeededNoise(seed: number) {
|
|
@@ -100,6 +101,7 @@ const seriesDefinitions: SimulatedSeriesDefinition[] = [
|
|
|
100
101
|
unit: 'V',
|
|
101
102
|
lineType: 'linear',
|
|
102
103
|
pointType: 'none',
|
|
104
|
+
minimumX: 0,
|
|
103
105
|
signal: (time) => (time < 0 ? 0 : 1 - Math.exp(-time * 2.4)),
|
|
104
106
|
},
|
|
105
107
|
{
|
|
@@ -128,12 +130,15 @@ export function createSimulatedWaveformData(): WaveformData {
|
|
|
128
130
|
const noise = createSeededNoise(0x5eed1234)
|
|
129
131
|
return {
|
|
130
132
|
kind: 'series',
|
|
131
|
-
series: seriesDefinitions.map(({ signal, errors, ...series }) =>
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
series: seriesDefinitions.map(({ signal, errors, minimumX, ...series }) => {
|
|
134
|
+
const points = createPoints(signal, noise, errors)
|
|
135
|
+
return {
|
|
136
|
+
...series,
|
|
137
|
+
data: {
|
|
138
|
+
kind: 'points' as const,
|
|
139
|
+
points: minimumX === undefined ? points : points.filter((point) => point.x >= minimumX),
|
|
140
|
+
},
|
|
141
|
+
}
|
|
142
|
+
}),
|
|
138
143
|
}
|
|
139
144
|
}
|