lucid-ui
Version:
A UI component library from AppNexus.
36 lines • 1.25 kB
JavaScript
import React from 'react';
import createClass from 'create-react-class';
import { Axis, d3Scale, d3Time } from '../../../index';
var margin = {
right: 10,
left: 30
};
var width = 400;
var height = 200;
var innerWidth = width - margin.right - margin.left;
var x = d3Scale.scaleTime().domain([new Date('2015-01-01'), new Date('2017-02-01')]).range([0, innerWidth]);
export default createClass({
render: function render() {
return /*#__PURE__*/React.createElement("svg", {
width: width,
height: height
}, /*#__PURE__*/React.createElement("g", {
transform: "translate(".concat(margin.left, ", 1)")
}, /*#__PURE__*/React.createElement(Axis, {
orient: "bottom",
scale: x
})), /*#__PURE__*/React.createElement("g", {
transform: "translate(".concat(margin.left, ", ").concat(height / 3 * 1, ")")
}, /*#__PURE__*/React.createElement(Axis, {
orient: "bottom",
scale: x,
ticks: x.ticks(d3Time.timeMonth, 6)
})), /*#__PURE__*/React.createElement("g", {
transform: "translate(".concat(margin.left, ", ").concat(height / 3 * 2, ")")
}, /*#__PURE__*/React.createElement(Axis, {
orient: "bottom",
scale: x,
ticks: x.ticks(d3Time.timeYear, 1)
})));
}
});