simpleTableChart.stories.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import SimpleTableChart from 'sentry/components/charts/simpleTableChart';
  2. export default {
  3. title: 'Components/Data Visualization/Charts/Simple Table Chart',
  4. component: SimpleTableChart,
  5. args: {
  6. title: '',
  7. },
  8. };
  9. export const _SimpleTableChart = ({title}) => {
  10. const organization = {slug: 'org-slug'};
  11. const fields = ['title', 'count()'];
  12. const metadata = {count: 'string', title: 'string'};
  13. const data = [
  14. {title: 'An error', count: 100},
  15. {title: 'An longer title that goes on a bit', count: 1000},
  16. ];
  17. return (
  18. <div className="section">
  19. <h2>Loading State</h2>
  20. <SimpleTableChart
  21. organization={organization}
  22. fields={fields}
  23. title={title}
  24. metadata={undefined}
  25. data={[]}
  26. loading
  27. />
  28. <h2>Filled State</h2>
  29. <SimpleTableChart
  30. organization={organization}
  31. fields={fields}
  32. title={title}
  33. metadata={metadata}
  34. data={data}
  35. />
  36. </div>
  37. );
  38. };
  39. _SimpleTableChart.parameters = {
  40. docs: {
  41. description: {
  42. story: 'A borderless table that can be used in charts/dashboards',
  43. },
  44. },
  45. };