lucid-ui
Version:
A UI component library from Xandr.
42 lines • 2.17 kB
JavaScript
import React from 'react';
import * as chartConstants from '../../constants/charts';
import AxisLabel from './AxisLabel';
export default {
title: 'Visualizations/AxisLabel',
component: AxisLabel,
parameters: {
docs: {
description: {
component: AxisLabel.peek.description,
},
},
},
};
/* Basic */
export const Basic = (args) => {
const width = 800;
const height = 400;
const margin = { top: 50, right: 50, bottom: 50, left: 50 };
const innerWidth = width - margin.right - margin.left;
const innerHeight = height - margin.top - margin.bottom;
return (React.createElement("svg", { width: width, height: height },
React.createElement("rect", { x: 1, y: 1, width: width - 2, height: height - 2, style: {
strokeWidth: 1,
strokeDasharray: '2,2',
fill: 'none',
stroke: 'black',
} }),
React.createElement("g", { transform: `translate(${margin.left}, ${margin.top})` },
React.createElement("rect", { style: {
fill: 'lightgrey',
}, width: innerWidth, height: innerHeight })),
React.createElement("g", { transform: 'translate(0,0)' },
React.createElement(AxisLabel, { ...args, orient: 'left', width: margin.left, height: height, label: 'Left' })),
React.createElement("g", { transform: `translate(${margin.left + innerWidth}, 0)` },
React.createElement(AxisLabel, { ...args, orient: 'right', color: chartConstants.COLOR_0, width: margin.right, height: height, label: 'Right' })),
React.createElement("g", { transform: `translate(0, ${margin.top + innerHeight})` },
React.createElement(AxisLabel, { ...args, orient: 'bottom', color: chartConstants.COLOR_1, width: width, height: margin.bottom, label: 'Bottom' })),
React.createElement("g", { transform: 'translate(0, 0)' },
React.createElement(AxisLabel, { ...args, orient: 'top', color: chartConstants.COLOR_2, width: width, height: margin.top, label: 'Top' }))));
};
//# sourceMappingURL=AxisLabel.stories.js.map