docs/_snippets/histogram-story.md
import type { Meta, StoryObj } from '@storybook/angular';
import { HistogramComponent } from './histogram.component';
const meta: Meta<HistogramComponent> = {
component: HistogramComponent,
};
export default meta;
type Story = StoryObj<HistogramComponent>;
export const Basic: Story = {
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
import preview from '../.storybook/preview';
import { HistogramComponent } from './histogram.component';
const meta = preview.meta({
component: HistogramComponent,
});
export const Basic = meta.story({
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
});
import { createHistogram } from './Histogram';
export default {
/* ๐ The title prop is optional.
* See https://storybook.js.org/docs/configure/#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Histogram',
};
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic = {
render: (args) => createHistogram(args),
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
import type { Meta, StoryObj } from '@storybook/html';
import { createHistogram, HistogramProps } from './Histogram';
const meta: Meta<HistogramProps> = {
/* ๐ The title prop is optional.
* See https://storybook.js.org/docs/configure/#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Histogram',
};
export default meta;
type Story = StoryObj<HistogramProps>;
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic: Story = {
render: (args) => createHistogram(args),
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
/** @jsx h */
import { h } from 'preact';
import { Histogram } from './Histogram';
export default {
component: Histogram,
};
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic = {
render: (args) => <Histogram {...args} />,
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
import { Histogram } from './Histogram';
export default {
component: Histogram,
};
export const Basic = {
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, nextjs-vite, etc.
import type { Meta, StoryObj } from '@storybook/your-framework';
import { Histogram } from './Histogram';
const meta = {
component: Histogram,
} satisfies Meta<typeof Histogram>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Basic: Story = {
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
import { Histogram } from './Histogram';
export default {
component: Histogram,
};
export const Basic = {
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
import type { Meta, StoryObj } from 'storybook-solidjs-vite';
import { Histogram } from './Histogram';
const meta = {
component: Histogram,
} satisfies Meta<typeof Histogram>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Basic: Story = {
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
<script module>
import { defineMeta } from '@storybook/addon-svelte-csf';
import Histogram from './Histogram.svelte';
const { Story } = defineMeta({
component: Histogram,
});
</script>
<Story
name="Default"
args={{
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
}}
/>
import Histogram from './Histogram.svelte';
export default {
component: Histogram,
};
export const Basic = {
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
<script module>
import { defineMeta } from '@storybook/addon-svelte-csf';
import Histogram from './Histogram.svelte';
const { Story } = defineMeta({
component: Histogram,
});
</script>
<Story
name="Default"
args={{
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
}}
/>
// Replace your-framework with svelte-vite or sveltekit
import type { Meta, StoryObj } from '@storybook/your-framework';
import Histogram from './Histogram.svelte';
const meta = {
component: Histogram,
} satisfies Meta<typeof Histogram>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Basic: Story = {
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
import Histogram from './Histogram.vue';
export default {
component: Histogram,
};
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic = {
render: (args) => ({
components: { Histogram },
setup() {
return { args };
},
template: '<Histogram v-bind="args" />',
}),
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
import type { Meta, StoryObj } from '@storybook/vue3-vite';
import Histogram from './Histogram.vue';
const meta = {
component: Histogram,
} satisfies Meta<typeof Histogram>;
export default meta;
type Story = StoryObj<typeof meta>;
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic: Story = {
render: (args) => ({
components: { Histogram },
setup() {
return { args };
},
template: '<Histogram v-bind="args" />',
}),
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
export default {
component: 'histogram-component',
};
export const Basic = {
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
import type { Meta, StoryObj } from '@storybook/web-components-vite';
const meta: Meta = {
component: 'histogram-component',
};
export default meta;
type Story = StoryObj;
export const Basic: Story = {
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
import preview from '../.storybook/preview';
const meta = preview.meta({
component: 'histogram-component',
});
export const Basic = meta.story({
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
});
import preview from '../.storybook/preview';
const meta = preview.meta({
component: 'histogram-component',
});
export const Basic = meta.story({
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
});
import preview from '../.storybook/preview';
import Histogram from './Histogram.vue';
const meta = preview.meta({
component: Histogram,
});
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic = meta.story({
render: (args) => ({
components: { Histogram },
setup() {
return { args };
},
template: '<Histogram v-bind="args" />',
}),
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
});
import preview from '../.storybook/preview';
import Histogram from './Histogram.vue';
const meta = preview.meta({
component: Histogram,
});
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic = meta.story({
render: (args) => ({
components: { Histogram },
setup() {
return { args };
},
template: '<Histogram v-bind="args" />',
}),
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
});
import preview from '../.storybook/preview';
import { Histogram } from './Histogram';
const meta = preview.meta({
component: Histogram,
});
export const Basic = meta.story({
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
});
import preview from '../.storybook/preview';
import { Histogram } from './Histogram';
const meta = preview.meta({
component: Histogram,
});
export const Basic = meta.story({
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
});