diff --git a/components/package.json b/components/package.json index 0dfba42c..2b7596e4 100644 --- a/components/package.json +++ b/components/package.json @@ -35,7 +35,7 @@ "lint:lit-analyzer": "lit-analyzer", "generate-manifest": "npx custom-elements-manifest analyze --litelement --globs src/web-components/**", "generate-manifest:watch": "npm run generate-manifest -- --watch", - "format": "prettier \"**/*.{cjs,html,js,json,md,ts,tsx}\" --write", + "format": "prettier \"**/*.{cjs,html,js,json,md,ts,tsx,mdx}\" --write", "check-format": "prettier --check \"**/*.{ts,tsx,json,md,mdx,mjs,cjs}\"", "check-types": "tsc --noEmit", "check-dependencies": "depcheck", diff --git a/components/src/web-components/index.ts b/components/src/web-components/index.ts index 53ce4093..946e5945 100644 --- a/components/src/web-components/index.ts +++ b/components/src/web-components/index.ts @@ -1,3 +1,3 @@ export { App } from './app.js'; -export * from './display'; +export * from './visualization'; export * from './input'; diff --git a/components/src/web-components/display/aggregate-component.stories.ts b/components/src/web-components/visualization/aggregate-component.stories.ts similarity index 100% rename from components/src/web-components/display/aggregate-component.stories.ts rename to components/src/web-components/visualization/aggregate-component.stories.ts diff --git a/components/src/web-components/display/aggregate-component.tsx b/components/src/web-components/visualization/aggregate-component.tsx similarity index 100% rename from components/src/web-components/display/aggregate-component.tsx rename to components/src/web-components/visualization/aggregate-component.tsx diff --git a/components/src/web-components/visualization/data_visualization_statistical_analysis.mdx b/components/src/web-components/visualization/data_visualization_statistical_analysis.mdx new file mode 100644 index 00000000..817685f2 --- /dev/null +++ b/components/src/web-components/visualization/data_visualization_statistical_analysis.mdx @@ -0,0 +1,26 @@ +import { Meta } from '@storybook/blocks'; + + + +# Data Visualization and Statistical Analysis + +## Scales + +On most plots, users can select the y-axis scaling through a dropdown. +They can choose between linear, logarithmic and logistic scaling. +By default, it is set to a linear scale. + +In general, for each scale the displayed height of a value is by calculated applying the corresponding scale function. + +- Linear: `value` +- Logarithmic: `ln(value)` +- Logistic: `ln(value / (1 - value))` + +## Confindence Intervals + +On bar and line plots, users can choose to display confidence intervals. +For line plots, this is done by shading the area between the upper and lower bounds. +For bar plots, this is done by adding error bars to the top of each bar. + +Currently, only one method is available for calculating the confidence intervals: +the [wilson score interval](https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval#Wilson_score_interval) with a confidence level of 95%. diff --git a/components/src/web-components/display/index.ts b/components/src/web-components/visualization/index.ts similarity index 100% rename from components/src/web-components/display/index.ts rename to components/src/web-components/visualization/index.ts diff --git a/components/src/web-components/display/mutation-comparison-component.stories.ts b/components/src/web-components/visualization/mutation-comparison-component.stories.ts similarity index 100% rename from components/src/web-components/display/mutation-comparison-component.stories.ts rename to components/src/web-components/visualization/mutation-comparison-component.stories.ts diff --git a/components/src/web-components/display/mutation-comparison-component.tsx b/components/src/web-components/visualization/mutation-comparison-component.tsx similarity index 100% rename from components/src/web-components/display/mutation-comparison-component.tsx rename to components/src/web-components/visualization/mutation-comparison-component.tsx diff --git a/components/src/web-components/display/mutations-component.stories.ts b/components/src/web-components/visualization/mutations-component.stories.ts similarity index 100% rename from components/src/web-components/display/mutations-component.stories.ts rename to components/src/web-components/visualization/mutations-component.stories.ts diff --git a/components/src/web-components/display/mutations-component.tsx b/components/src/web-components/visualization/mutations-component.tsx similarity index 100% rename from components/src/web-components/display/mutations-component.tsx rename to components/src/web-components/visualization/mutations-component.tsx diff --git a/components/src/web-components/display/prevalence-over-time-component.stories.ts b/components/src/web-components/visualization/prevalence-over-time-component.stories.ts similarity index 100% rename from components/src/web-components/display/prevalence-over-time-component.stories.ts rename to components/src/web-components/visualization/prevalence-over-time-component.stories.ts diff --git a/components/src/web-components/display/prevalence-over-time-component.tsx b/components/src/web-components/visualization/prevalence-over-time-component.tsx similarity index 100% rename from components/src/web-components/display/prevalence-over-time-component.tsx rename to components/src/web-components/visualization/prevalence-over-time-component.tsx diff --git a/components/src/web-components/display/relative-growth-advantage-component.stories.ts b/components/src/web-components/visualization/relative-growth-advantage-component.stories.ts similarity index 100% rename from components/src/web-components/display/relative-growth-advantage-component.stories.ts rename to components/src/web-components/visualization/relative-growth-advantage-component.stories.ts diff --git a/components/src/web-components/display/relative-growth-advantage-component.tsx b/components/src/web-components/visualization/relative-growth-advantage-component.tsx similarity index 100% rename from components/src/web-components/display/relative-growth-advantage-component.tsx rename to components/src/web-components/visualization/relative-growth-advantage-component.tsx