@data-ui/histogram
Version:
React + d3 library for creating histograms
51 lines (50 loc) • 1.65 kB
JavaScript
import PropTypes from 'prop-types';
export var numericBinnedDatumShape = PropTypes.shape({
id: PropTypes.string.isRequired,
bin0: PropTypes.number.isRequired,
bin1: PropTypes.number.isRequired,
count: PropTypes.number.isRequired,
cumulative: PropTypes.number,
density: PropTypes.number,
cumulativeDensity: PropTypes.number
});
export var categoricalBinnedDatumShape = PropTypes.shape({
id: PropTypes.string.isRequired,
bin: PropTypes.string.isRequired,
count: PropTypes.number.isRequired,
cumulative: PropTypes.number,
density: PropTypes.number,
cumulativeDensity: PropTypes.number
});
export var binnedDataShape = PropTypes.arrayOf(PropTypes.oneOfType([numericBinnedDatumShape, categoricalBinnedDatumShape])); // styles ---------------------------------------------------------------------
export var axisStylesShape = PropTypes.shape({
stroke: PropTypes.string,
strokeWidth: PropTypes.number,
label: PropTypes.shape({
left: PropTypes.object,
right: PropTypes.object,
bottom: PropTypes.object,
top: PropTypes.object
})
});
export var tickStylesShape = PropTypes.shape({
stroke: PropTypes.string,
tickLength: PropTypes.number,
label: PropTypes.shape({
left: PropTypes.object,
right: PropTypes.object,
bottom: PropTypes.object,
top: PropTypes.object
})
});
export var gridStylesShape = PropTypes.shape({
stroke: PropTypes.string,
strokeWidth: PropTypes.number
});
export var themeShape = PropTypes.shape({
gridStyles: gridStylesShape,
xAxisStyles: axisStylesShape,
xTickStyles: tickStylesShape,
yAxisStyles: axisStylesShape,
yTickStyles: tickStylesShape
});