lucid-ui
Version:
A UI component library from AppNexus.
218 lines • 24.5 kB
JavaScript
"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BarChart = void 0;
var lodash_1 = __importDefault(require("lodash"));
var react_1 = __importDefault(require("react"));
var prop_types_1 = __importDefault(require("react-peek/prop-types"));
var style_helpers_1 = require("../../util/style-helpers");
var component_types_1 = require("../../util/component-types");
var chart_helpers_1 = require("../../util/chart-helpers");
var d3Scale = __importStar(require("d3-scale"));
var chartConstants = __importStar(require("../../constants/charts"));
var Axis_1 = __importDefault(require("../Axis/Axis"));
var AxisLabel_1 = __importDefault(require("../AxisLabel/AxisLabel"));
var Bars_1 = __importDefault(require("../Bars/Bars"));
var ContextMenu_1 = __importDefault(require("../ContextMenu/ContextMenu"));
var Legend_1 = __importDefault(require("../Legend/Legend"));
var EmptyStateWrapper_1 = __importDefault(require("../EmptyStateWrapper/EmptyStateWrapper"));
var cx = style_helpers_1.lucidClassNames.bind('&-BarChart');
var arrayOf = prop_types_1.default.arrayOf, func = prop_types_1.default.func, number = prop_types_1.default.number, object = prop_types_1.default.object, shape = prop_types_1.default.shape, string = prop_types_1.default.string, array = prop_types_1.default.array, bool = prop_types_1.default.bool, oneOfType = prop_types_1.default.oneOfType, oneOf = prop_types_1.default.oneOf;
var defaultProps = {
height: 400,
width: 1000,
// duplicated because `statics` aren't available during getDefaultProps
margin: {
top: 10,
right: 20,
bottom: 50,
left: 80,
},
palette: chartConstants.PALETTE_7,
hasToolTips: true,
hasLegend: false,
renderTooltipBody: null,
xAxisField: 'x',
xAxisTickCount: null,
xAxisTitle: null,
xAxisTitleColor: '#000',
xAxisFormatter: lodash_1.default.identity,
xAxisTextOrientation: 'horizontal',
yAxisFields: ['y'],
yAxisTickCount: null,
yAxisIsStacked: false,
yAxisMin: 0,
yAxisTitle: null,
yAxisTitleColor: '#000',
yAxisTooltipFormatter: function (yField, yValueFormatted) {
return yField + ": " + yValueFormatted;
},
yAxisTextOrientation: 'horizontal',
};
var BarChart = function (props) {
var className = props.className, height = props.height, width = props.width, marginOriginal = props.margin, data = props.data, legend = props.legend, isLoading = props.isLoading, hasToolTips = props.hasToolTips, hasLegend = props.hasLegend, palette = props.palette, colorMap = props.colorMap, renderTooltipBody = props.renderTooltipBody, xAxisField = props.xAxisField, xAxisFormatter = props.xAxisFormatter, xAxisTitle = props.xAxisTitle, xAxisTitleColor = props.xAxisTitleColor, xAxisTickCount = props.xAxisTickCount, xAxisTextOrientation = props.xAxisTextOrientation, yAxisFields = props.yAxisFields, yAxisFormatter = props.yAxisFormatter, yAxisTitle = props.yAxisTitle, yAxisTitleColor = props.yAxisTitleColor, yAxisIsStacked = props.yAxisIsStacked, yAxisTickCount = props.yAxisTickCount, yAxisMin = props.yAxisMin, yAxisTooltipFormatter = props.yAxisTooltipFormatter, yAxisTooltipDataFormatter = props.yAxisTooltipDataFormatter, _a = props.yAxisMax, yAxisMax = _a === void 0 ? yAxisIsStacked
? chart_helpers_1.maxByFieldsStacked(data, yAxisFields)
: chart_helpers_1.maxByFields(data, yAxisFields) : _a, yAxisTextOrientation = props.yAxisTextOrientation, passThroughs = __rest(props, ["className", "height", "width", "margin", "data", "legend", "isLoading", "hasToolTips", "hasLegend", "palette", "colorMap", "renderTooltipBody", "xAxisField", "xAxisFormatter", "xAxisTitle", "xAxisTitleColor", "xAxisTickCount", "xAxisTextOrientation", "yAxisFields", "yAxisFormatter", "yAxisTitle", "yAxisTitleColor", "yAxisIsStacked", "yAxisTickCount", "yAxisMin", "yAxisTooltipFormatter", "yAxisTooltipDataFormatter", "yAxisMax", "yAxisTextOrientation"]);
var margin = __assign(__assign({}, exports.BarChart.MARGIN), marginOriginal);
var svgClasses = cx(className, '&');
var innerWidth = width - margin.left - margin.right;
var innerHeight = height - margin.top - margin.bottom;
// `paddingInner` determines the space between the bars or groups of bars
var paddingInner = yAxisFields.length > 1
? exports.BarChart.PADDING_GROUPED_OR_STACKED
: exports.BarChart.PADDING;
var xScale = d3Scale
.scaleBand()
.domain(lodash_1.default.map(data, xAxisField))
.range([0, innerWidth])
.paddingInner(paddingInner)
.paddingOuter(0.5);
var yScale = d3Scale
.scaleLinear()
.domain([yAxisMin, yAxisMax])
.range([innerHeight, 0]);
// @ts-ignore
var xAxisFinalFormatter = xAxisFormatter || xScale.tickFormat();
var yAxisFinalFormatter = yAxisFormatter || yScale.tickFormat();
var yFinalFormatter = yAxisTooltipDataFormatter
? yAxisTooltipDataFormatter
: yAxisFinalFormatter;
if (lodash_1.default.isEmpty(data) || width < 1 || height < 1 || isLoading) {
var emptyStateWrapper = component_types_1.getFirst(props, exports.BarChart.EmptyStateWrapper) || react_1.default.createElement(exports.BarChart.EmptyStateWrapper, { Title: 'You have no data.' });
return (react_1.default.createElement(EmptyStateWrapper_1.default, __assign({}, emptyStateWrapper.props, { isEmpty: lodash_1.default.isEmpty(data), isLoading: isLoading }),
emptyStateWrapper.props.children,
react_1.default.createElement("svg", __assign({}, component_types_1.omitProps(passThroughs, undefined, lodash_1.default.keys(exports.BarChart.propTypes)), { className: svgClasses, width: width, height: height }),
react_1.default.createElement("g", { transform: "translate(" + margin.left + ", " + (innerHeight + margin.top) + ")" },
react_1.default.createElement(Axis_1.default, { orient: 'bottom', scale: xScale, tickCount: xAxisTickCount })),
react_1.default.createElement("g", { transform: "translate(" + margin.left + ", " + margin.top + ")" },
react_1.default.createElement(Axis_1.default, { orient: 'left', scale: yScale, tickFormat: yFinalFormatter, tickCount: yAxisTickCount })))));
}
return (react_1.default.createElement("svg", __assign({}, component_types_1.omitProps(passThroughs, undefined, lodash_1.default.keys(exports.BarChart.propTypes)), { className: svgClasses, width: width, height: height }),
react_1.default.createElement("g", { transform: "translate(" + margin.left + ", " + (innerHeight + margin.top) + ")" },
react_1.default.createElement(Axis_1.default, { orient: 'bottom',
// @ts-ignore
scale: xScale, outerTickSize: 0, tickFormat: xAxisFinalFormatter, tickCount: xAxisTickCount, textOrientation: xAxisTextOrientation }),
hasLegend ? (react_1.default.createElement(ContextMenu_1.default, { direction: 'down', alignment: 'center', directonOffset: (margin.bottom / 2 + Legend_1.default.HEIGHT / 2) *
-1 /* should center the legend in the bottom margin */ },
react_1.default.createElement(ContextMenu_1.default.Target, { elementType: 'g' },
react_1.default.createElement("rect", { className: cx('&-invisible'), width: innerWidth, height: margin.bottom })),
react_1.default.createElement(ContextMenu_1.default.FlyOut, { className: cx('&-legend-container') },
react_1.default.createElement(Legend_1.default, { orient: 'horizontal' }, lodash_1.default.map(yAxisFields, function (field, index) { return (react_1.default.createElement(Legend_1.default.Item, { key: index, hasPoint: true, hasLine: false, color: lodash_1.default.get(colorMap, field, palette[index % palette.length]), pointKind: 1 }, lodash_1.default.get(legend, field, field))); }))))) : null),
xAxisTitle ? (react_1.default.createElement("g", { transform: "translate(" + margin.left + ", " + (margin.top + innerHeight) + ")" },
react_1.default.createElement(AxisLabel_1.default, { orient: 'bottom', width: innerWidth, height: margin.bottom, label: xAxisTitle, color: lodash_1.default.isString(xAxisTitleColor)
? xAxisTitleColor
: palette[xAxisTitleColor % palette.length] }))) : null,
react_1.default.createElement("g", { transform: "translate(" + margin.left + ", " + margin.top + ")" },
react_1.default.createElement(Axis_1.default, { orient: 'left', scale: yScale, tickFormat: yAxisFinalFormatter, tickCount: yAxisTickCount, textOrientation: yAxisTextOrientation })),
yAxisTitle ? (react_1.default.createElement("g", { transform: "translate(0, " + margin.top + ")" },
react_1.default.createElement(AxisLabel_1.default, { orient: 'left', width: margin.left, height: innerHeight, label: yAxisTitle, color: lodash_1.default.isString(yAxisTitleColor)
? yAxisTitleColor
: palette[yAxisTitleColor % palette.length] }))) : null,
react_1.default.createElement("g", { transform: "translate(" + margin.left + ", " + margin.top + ")" },
react_1.default.createElement(Bars_1.default, { xField: xAxisField, xScale: xScale, xFormatter: xAxisFormatter, yFields: yAxisFields, yScale: yScale,
// @ts-ignore
yFormatter: yFinalFormatter, yStackedMax: yAxisMax, data: data, isStacked: yAxisIsStacked, yTooltipFormatter: yAxisTooltipFormatter, hasToolTips: hasToolTips, legend: legend, palette: palette, colorMap: colorMap, renderTooltipBody: renderTooltipBody }))));
};
exports.BarChart = BarChart;
exports.BarChart.displayName = 'BarChart';
exports.BarChart.propTypes = {
className: string(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t\tAppended to the component-specific class names set on the root element.\n\t"], ["\n\t\tAppended to the component-specific class names set on the root element.\n\t"]))),
height: number(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\t\tHeight of the chart.\n\t"], ["\n\t\tHeight of the chart.\n\t"]))),
width: number(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\t\tWidth of the chart.\n\t"], ["\n\t\tWidth of the chart.\n\t"]))),
margin: shape({
top: number,
right: number,
bottom: number,
left: number,
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n\t\tAn object defining the margins of the chart. These margins typically\n\t\tcontain the axis and labels.\n\t"], ["\n\t\tAn object defining the margins of the chart. These margins typically\n\t\tcontain the axis and labels.\n\t"]))),
data: arrayOf(object)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n\t\tData for the chart. E.g.\n\n\t\t\t[\n\t\t\t\t{ x: 'Monday' , y: 1 } ,\n\t\t\t\t{ x: 'Tuesday' , y: 2 } ,\n\t\t\t\t{ x: 'Wednesday' , y: 3 } ,\n\t\t\t\t{ x: 'Thursday' , y: 2 } ,\n\t\t\t\t{ x: 'Friday' , y: 5 } ,\n\t\t\t]\n\t"], ["\n\t\tData for the chart. E.g.\n\n\t\t\t[\n\t\t\t\t{ x: 'Monday' , y: 1 } ,\n\t\t\t\t{ x: 'Tuesday' , y: 2 } ,\n\t\t\t\t{ x: 'Wednesday' , y: 3 } ,\n\t\t\t\t{ x: 'Thursday' , y: 2 } ,\n\t\t\t\t{ x: 'Friday' , y: 5 } ,\n\t\t\t]\n\t"]))),
legend: object(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n\t\tAn object with human readable names for fields that will be used for legends and tooltips. E.g:\n\n\t\t\t{\n\t\t\t\tx: 'Date',\n\t\t\t\ty: 'Impressions',\n\t\t\t}\n\t"], ["\n\t\tAn object with human readable names for fields that will be used for legends and tooltips. E.g:\n\n\t\t\t{\n\t\t\t\tx: 'Date',\n\t\t\t\ty: 'Impressions',\n\t\t\t}\n\t"]))),
isLoading: bool(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n\t\tControls the visibility of the `LoadingMessage`.\n\t"], ["\n\t\tControls the visibility of the \\`LoadingMessage\\`.\n\t"]))),
hasToolTips: bool(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n\t\tShow tool tips on hover.\n\t"], ["\n\t\tShow tool tips on hover.\n\t"]))),
hasLegend: bool(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n\t\tShow a legend at the bottom of the chart.\n\t"], ["\n\t\tShow a legend at the bottom of the chart.\n\t"]))),
palette: arrayOf(string)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n\t\tTakes one of the palettes exported from `lucid.chartConstants`. Available palettes:\n\n\t\t- `PALETTE_7` (default)\n\t\t- `PALETTE_30`\n\t\t- `PALETTE_MONOCHROME_0_5`\n\t\t- `PALETTE_MONOCHROME_1_5`\n\t\t- `PALETTE_MONOCHROME_2_5`\n\t\t- `PALETTE_MONOCHROME_3_5`\n\t\t- `PALETTE_MONOCHROME_4_5`\n\t\t- `PALETTE_MONOCHROME_5_5`\n\t\t- `PALETTE_MONOCHROME_6_5`\n\t"], ["\n\t\tTakes one of the palettes exported from \\`lucid.chartConstants\\`. Available palettes:\n\n\t\t- \\`PALETTE_7\\` (default)\n\t\t- \\`PALETTE_30\\`\n\t\t- \\`PALETTE_MONOCHROME_0_5\\`\n\t\t- \\`PALETTE_MONOCHROME_1_5\\`\n\t\t- \\`PALETTE_MONOCHROME_2_5\\`\n\t\t- \\`PALETTE_MONOCHROME_3_5\\`\n\t\t- \\`PALETTE_MONOCHROME_4_5\\`\n\t\t- \\`PALETTE_MONOCHROME_5_5\\`\n\t\t- \\`PALETTE_MONOCHROME_6_5\\`\n\t"]))),
colorMap: object(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n\t\tYou can pass in an object if you want to map x values to `lucid.chartConstants` or custom colors:\n\n\t\t\t{\n\t\t\t\t'imps': COLOR_0,\n\t\t\t\t'rev': COLOR_3,\n\t\t\t\t'clicks': '#abc123',\n\t\t\t}\n\t"], ["\n\t\tYou can pass in an object if you want to map x values to \\`lucid.chartConstants\\` or custom colors:\n\n\t\t\t{\n\t\t\t\t'imps': COLOR_0,\n\t\t\t\t'rev': COLOR_3,\n\t\t\t\t'clicks': '#abc123',\n\t\t\t}\n\t"]))),
xAxisField: string(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n\t\tThe field we should look up your x data by. Your actual x data must be\n\t\tstrings.\n\t"], ["\n\t\tThe field we should look up your x data by. Your actual x data must be\n\t\tstrings.\n\t"]))),
xAxisTickCount: number(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n\n\t\tThere are some cases where you need to only show a \"sampling\" of ticks on\n\t\tthe x axis. This number will control that.\n\t"], ["\n\n\t\tThere are some cases where you need to only show a \"sampling\" of ticks on\n\t\tthe x axis. This number will control that.\n\t"]))),
xAxisFormatter: func(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n\t\tAn optional function used to format your x axis data. If you don't\n\t\tprovide anything, we'll use an identity function.\n\t"], ["\n\t\tAn optional function used to format your x axis data. If you don't\n\t\tprovide anything, we'll use an identity function.\n\t"]))),
xAxisTitle: string(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n\t\tSet a title for the x axis.\n\t"], ["\n\t\tSet a title for the x axis.\n\t"]))),
xAxisTitleColor: oneOfType([number, string])(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n\t\tSet a color for the x axis title. Use the color constants exported off `lucid.chartConstants`. E.g.:\n\n\t\t- `COLOR_0`\n\t\t- `COLOR_GOOD`\n\t\t- `'#123abc'` // custom color hex\n\n\t\t`number` is supported only for backwards compatability.\n\t"], ["\n\t\tSet a color for the x axis title. Use the color constants exported off \\`lucid.chartConstants\\`. E.g.:\n\n\t\t- \\`COLOR_0\\`\n\t\t- \\`COLOR_GOOD\\`\n\t\t- \\`'#123abc'\\` // custom color hex\n\n\t\t\\`number\\` is supported only for backwards compatability.\n\t"]))),
yAxisFields: array(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n\t\tAn array of your y axis fields. Typically this will just be a single item\n\t\tunless you need to display grouped or stacked bars. The order of the\n\t\tarray determines the series order in the chart.\n\t"], ["\n\t\tAn array of your y axis fields. Typically this will just be a single item\n\t\tunless you need to display grouped or stacked bars. The order of the\n\t\tarray determines the series order in the chart.\n\t"]))),
yAxisMin: number(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n\t\tThe minimum number the y axis should display. Typically this should be be\n\t\t`0`.\n\t"], ["\n\t\tThe minimum number the y axis should display. Typically this should be be\n\t\t\\`0\\`.\n\t"]))),
yAxisMax: number(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n\t\tThe maximum number the y axis should display. This should almost always\n\t\tbe the largest number from your dataset.\n\t"], ["\n\t\tThe maximum number the y axis should display. This should almost always\n\t\tbe the largest number from your dataset.\n\t"]))),
yAxisFormatter: func(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n\t\tAn optional function used to format your y axis data. If you don't\n\t\tprovide anything, we use the default D3 number formatter.\n\t"], ["\n\t\tAn optional function used to format your y axis data. If you don't\n\t\tprovide anything, we use the default D3 number formatter.\n\t"]))),
yAxisIsStacked: bool(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n\t\tStack the y axis data instead of showing it as groups. This is only\n\t\tuseful if you have multiple `yAxisFields`. Stacking will cause the\n\t\tchart to be aggregated by sum.\n\t"], ["\n\t\tStack the y axis data instead of showing it as groups. This is only\n\t\tuseful if you have multiple \\`yAxisFields\\`. Stacking will cause the\n\t\tchart to be aggregated by sum.\n\t"]))),
yAxisTickCount: number(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n\t\tThere are some cases where you need to only show a \"sampling\" of ticks on\n\t\tthe y axis. This number will control that.\n\t"], ["\n\t\tThere are some cases where you need to only show a \"sampling\" of ticks on\n\t\tthe y axis. This number will control that.\n\t"]))),
yAxisTitle: string(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n\t\tSet a title for the y axis.\n\t"], ["\n\t\tSet a title for the y axis.\n\t"]))),
yAxisTitleColor: oneOfType([number, string])(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n\t\tSet a color for the y axis title. Use the color constants exported off `lucid.chartConstants`. E.g.:\n\n\t\t- `COLOR_0`\n\t\t- `COLOR_GOOD`\n\t\t- `'#123abc'` // custom color hex\n\n\t\t`number` is supported only for backwards compatability.\n\t"], ["\n\t\tSet a color for the y axis title. Use the color constants exported off \\`lucid.chartConstants\\`. E.g.:\n\n\t\t- \\`COLOR_0\\`\n\t\t- \\`COLOR_GOOD\\`\n\t\t- \\`'#123abc'\\` // custom color hex\n\n\t\t\\`number\\` is supported only for backwards compatability.\n\t"]))),
yAxisTooltipFormatter: func(templateObject_25 || (templateObject_25 = __makeTemplateObject(["\n\t\tAn optional function used to format your y axis titles and data in the\n\t\ttooltip legends. The first value is the name of your y field, the second value\n\t\tis your post-formatted y value, and the third value is your non-formatted\n\t\ty-value. Signature: `(yField, yValueFormatted, yValue) => {}`\n\t"], ["\n\t\tAn optional function used to format your y axis titles and data in the\n\t\ttooltip legends. The first value is the name of your y field, the second value\n\t\tis your post-formatted y value, and the third value is your non-formatted\n\t\ty-value. Signature: \\`(yField, yValueFormatted, yValue) => {}\\`\n\t"]))),
yAxisTooltipDataFormatter: func(templateObject_26 || (templateObject_26 = __makeTemplateObject(["\n\t\tAn optional function used to format y-values in the tooltip legends.\n\t"], ["\n\t\tAn optional function used to format y-values in the tooltip legends.\n\t"]))),
renderTooltipBody: func(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n\t\tAn optional function used to format the entire tooltip body. The only arg is\n\t\tthe associated data point. This formatter will over-ride yAxisTooltipFormatter\n\t\tand yAxisTooltipDataFormatter. Signature:\n\t\t`dataPoint => {}`\n\t"], ["\n\t\tAn optional function used to format the entire tooltip body. The only arg is\n\t\tthe associated data point. This formatter will over-ride yAxisTooltipFormatter\n\t\tand yAxisTooltipDataFormatter. Signature:\n\t\t\\`dataPoint => {}\\`\n\t"]))),
xAxisTextOrientation: oneOf(['vertical', 'horizontal', 'diagonal'])(templateObject_28 || (templateObject_28 = __makeTemplateObject(["\n\t\tDetermines the orientation of the tick text. This may override what the orient prop\n\t\ttries to determine.\n\t"], ["\n\t\tDetermines the orientation of the tick text. This may override what the orient prop\n\t\ttries to determine.\n\t"]))),
yAxisTextOrientation: oneOf(['vertical', 'horizontal', 'diagonal'])(templateObject_29 || (templateObject_29 = __makeTemplateObject(["\n\t\tDetermines the orientation of the tick text. This may override what the orient prop\n\t\ttries to determine.\n\t"], ["\n\t\tDetermines the orientation of the tick text. This may override what the orient prop\n\t\ttries to determine.\n\t"]))),
};
exports.BarChart.defaultProps = defaultProps;
exports.BarChart.peek = {
description: "\n\t\tBar charts are great for showing data that fits neatly in to \"buckets\".\n\t\tThe x axis data must be strings, and the y axis data must be numeric.\n\t",
categories: ['visualizations', 'charts'],
madeFrom: ['ContextMenu', 'ToolTip'],
};
exports.BarChart.EmptyStateWrapper = EmptyStateWrapper_1.default;
exports.BarChart.PADDING = 0.05;
exports.BarChart.PADDING_GROUPED_OR_STACKED = 0.3;
exports.BarChart.MARGIN = {
top: 10,
right: 20,
bottom: 50,
left: 80,
};
exports.default = exports.BarChart;
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29;
//# sourceMappingURL=BarChart.js.map