From 7e1516b436be1c35caa5da81ca666cb39ff01563 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Thu, 15 Jun 2023 18:39:00 -0700 Subject: [PATCH] Standard usage story --- .../charts/recommendation-chart.stories.js | 70 ++++++++++++++++++- 1 file changed, 68 insertions(+), 2 deletions(-) diff --git a/ui/stories/charts/recommendation-chart.stories.js b/ui/stories/charts/recommendation-chart.stories.js index c3a42c7a8..33455a2d5 100644 --- a/ui/stories/charts/recommendation-chart.stories.js +++ b/ui/stories/charts/recommendation-chart.stories.js @@ -5,10 +5,15 @@ import hbs from 'htmlbars-inline-precompile'; import DelayedTruth from '../utils/delayed-truth'; -import { withKnobs, optionsKnob, number } from '@storybook/addon-knobs'; +import { + withKnobs, + optionsKnob, + number, + boolean, +} from '@storybook/addon-knobs'; export default { - title: 'Charts/Recomendation CHart', + title: 'Charts/Recomendation Chart', decorators: [withKnobs], }; @@ -22,6 +27,7 @@ export let Configurable = () => { @currentValue={{current}} @recommendedValue={{recommendedValue}} @stats={{stats}} + @disabled={{disabled}} /> {{/if}} `, @@ -29,6 +35,65 @@ export let Configurable = () => { }; }; +export let Standard = () => { + return { + template: hbs` + +
+ {{#if delayedTruth.complete}} + + +
+ + + {{/if}} +
+ `, + context: { + delayedTruth: DelayedTruth.create(), + cpu: { + current: 100, + recommendedValue: 600, + stats: { + mean: 300, + p99: 500, + max: 525, + }, + }, + mem: { + current: 2048, + recommendedValue: 256, + stats: { + mean: 140, + p99: 215, + max: 225, + }, + }, + }, + }; +}; + function contextFactory() { const numberConfig = { range: true, min: 0, max: 1000, step: 1 }; return { @@ -46,5 +111,6 @@ function contextFactory() { p99: number('Stat: p99', 600, numberConfig), max: number('Stat: max', 650, numberConfig), }, + disabled: boolean('Disabled', false), }; }