Skip to content

Commit

Permalink
fix: anomaly chart docs not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
corteggiano committed May 31, 2024
1 parent e83c94d commit 8e01a69
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ export const Standard: Story = {
</div>
),
args: {
data: [MOCK_DATA],
data: MOCK_DATA.data,
viewport: { duration: '30s' },
},
};

export const Error: Story = {
...Standard,
args: {
data: [MOCK_DATA_ERROR],
data: MOCK_DATA_ERROR.data,
},
};

export const Empty: Story = {
...Standard,
args: {
data: [],
data: [{state: 'success', value: {data: []}}],
},
};

export const Loading: Story = {
...Standard,
args: {
data: [MOCK_DATA_LOADING],
data: MOCK_DATA_LOADING.data,
},
};
2 changes: 1 addition & 1 deletion packages/doc-site/stories/components/anomalyChart/Data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as AnomalyChartStories from './AnomalyChart.stories';

# Anomaly Chart Data Structure

[Learn more about the Anomaly Chart](/docs/components-anomalychart-docs--docs).
[Learn more about the Anomaly Chart](/docs/components-anomalychart--docs).

The Anomaly provides a timeline view of anomaly predictions, visualizing the raw data in a specific format.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as AnomalyChartStories from './AnomalyChart.stories';

The Anomaly Chart is a powerful visualization tool that allows you to display anomaly predictions. This user guide will walk you through the process of specifying queries for the Anomaly Chart to request and visualize anomaly data.

[Learn more about the Anomaly Chart](/docs/components-anomalychart-docs--docs).
[Learn more about the Anomaly Chart](/docs/components-anomalychart--docs).

[Learn more about anomaly data query](/docs/data-sources-aws-iot-sitewise--docs).

Expand Down
34 changes: 27 additions & 7 deletions packages/doc-site/stories/components/anomalyChart/data.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type { AnomalyObjectDataSource } from '@iot-app-kit/react-components';
import type { AnomalyChartDataSourceOption } from '@iot-app-kit/react-components';

export const MOCK_DATA: AnomalyObjectDataSource = {
export const MOCK_DATA: AnomalyChartDataSourceOption = {data: [{
state: 'success',
value: {
data: [
{
timestamp: 1714909732438,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -35,6 +36,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714419170826,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -64,6 +66,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714578429305,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -93,6 +96,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714643198943,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -122,6 +126,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714480555677,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -151,6 +156,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714411937923,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -180,6 +186,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714627287904,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -209,6 +216,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714999072631,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -238,6 +246,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714628340330,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -267,6 +276,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714731287864,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -296,6 +306,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714822944244,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -325,6 +336,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714933880365,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -354,6 +366,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714632308567,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -383,6 +396,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714757072072,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -412,6 +426,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714455343258,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -441,6 +456,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714409979348,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -470,6 +486,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714459669203,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -499,6 +516,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714511393770,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -528,6 +546,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714464450991,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -557,6 +576,7 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
{
timestamp: 1714660199070,
prediction: 1,
diagnostics: [
{
name: 'Average Power',
Expand Down Expand Up @@ -586,14 +606,14 @@ export const MOCK_DATA: AnomalyObjectDataSource = {
},
],
},
};
}]};

export const MOCK_DATA_ERROR: AnomalyObjectDataSource = {
export const MOCK_DATA_ERROR: AnomalyChartDataSourceOption = {data: [{
state: 'error',
value: { data: [] },
};
}]};

export const MOCK_DATA_LOADING: AnomalyObjectDataSource = {
export const MOCK_DATA_LOADING: AnomalyChartDataSourceOption = {data: [{
state: 'loading',
value: { data: [] },
}
}]}

0 comments on commit 8e01a69

Please sign in to comment.