UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

32 lines (31 loc) 1.93 kB
import React from 'react'; import createClass from 'create-react-class'; import { AxisLabel, chartConstants } from '../../../index'; const width = 1000; 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; export default createClass({ render() { 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, { orient: 'left', width: margin.left, height: height, label: 'Left' })), React.createElement("g", { transform: `translate(${margin.left + innerWidth}, 0)` }, React.createElement(AxisLabel, { 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, { orient: 'bottom', color: chartConstants.COLOR_1, width: width, height: margin.bottom, label: 'Bottom' })), React.createElement("g", { transform: 'translate(0, 0)' }, React.createElement(AxisLabel, { orient: 'top', color: chartConstants.COLOR_2, width: width, height: margin.top, label: 'Top' })))); }, });