storybook/docs/snippets/vue/histogram-story.ts-2.ts.mdx
2022-09-08 21:20:10 +01:00

35 lines
955 B
Plaintext

```ts
// Histogram.stories.ts
import type { Meta, Story } from '@storybook/vue';
import Histogram from './Histogram.vue';
export default {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/7.0/vue/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Histogram',
component: Histogram,
} as Meta<typeof Histogram>;
/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/7.0/vue/api/csf
* to learn how to use render functions.
*/
export const Default: Story = {
render: (args, { argTypes }) => ({
components: { Button },
props: Object.keys(argTypes),
template: '<Histogram v-bind="$props" v-on="$props" />',
}),
args: {
dataType: 'latency',
showHistogramLabels: true,
histogramAccentColor: '#1EA7FD',
label: 'Latency distribution',
},
};
```