diff --git a/packages/doc-site/stories/components/gauge/Gauge.stories.tsx b/packages/doc-site/stories/components/gauge/Gauge.stories.tsx index 073156522..b15c0ce08 100644 --- a/packages/doc-site/stories/components/gauge/Gauge.stories.tsx +++ b/packages/doc-site/stories/components/gauge/Gauge.stories.tsx @@ -25,7 +25,7 @@ export const Standard: Story = { ), args: { - query: mockSinWaveDataWithQuality({ frequency: '5s' }), + query: mockSinWaveDataWithQuality({ frequency: '5s', positiveOnly: true }), settings: { gaugeThickness: 30, showUnit: true, @@ -46,7 +46,7 @@ export const StandardWithThresholds: Story = { ), args: { - query: mockSinWaveDataWithQuality({ frequency: '5s' }), + query: mockSinWaveDataWithQuality({ frequency: '5s', positiveOnly: true }), thresholds: [ { value: 30, @@ -87,7 +87,7 @@ export const BadDataQuality: Story = { ), args: { - query: mockSinWaveDataWithQuality({ frequency: '5s', quality: 'BAD' }), + query: mockSinWaveDataWithQuality({ frequency: '5s', quality: 'BAD', positiveOnly: true }), thresholds: [ { value: 30, @@ -131,6 +131,7 @@ export const UncertainDataQuality: Story = { query: mockSinWaveDataWithQuality({ frequency: '5s', quality: 'UNCERTAIN', + positiveOnly: true }), settings: { gaugeThickness: 30, diff --git a/packages/doc-site/stories/mockSinWaveData.ts b/packages/doc-site/stories/mockSinWaveData.ts index 13756962a..97daf570d 100644 --- a/packages/doc-site/stories/mockSinWaveData.ts +++ b/packages/doc-site/stories/mockSinWaveData.ts @@ -23,9 +23,11 @@ export const mockSinWaveData = (frequency?: string) => export const mockSinWaveDataWithQuality = ({ frequency, quality, + positiveOnly = false, }: { frequency?: string; quality?: Quality; + positiveOnly?: boolean; }) => mockTimeSeriesDataQueryLiveStream({ frequency: frequency || '0.25s', @@ -35,7 +37,7 @@ export const mockSinWaveDataWithQuality = ({ name: 'Windmill', createDataPoint: (date: Date) => ({ x: date.getTime(), - y: 100 * Math.sin(date.getTime() / 1000), + y: positiveOnly ? Math.abs(100 * Math.sin(date.getTime() / 1000)) : 100 * Math.sin(date.getTime() / 1000), quality, }), },