Skip to content

Commit

Permalink
Expose the margins props (#1042)
Browse files Browse the repository at this point in the history
The margins property is exposed but not documented in the propTypes. It can be  used only for internal purposes until we have a the autosizing of margins.
  • Loading branch information
markov00 authored Jul 20, 2018
1 parent 8895722 commit eaec046
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ exports[`EuiAreaSeries all props are rendered 1`] = `
data-test-subj="test subject string"
enableSelectionBrush={false}
height={200}
margins={
Object {
"bottom": 40,
"left": 40,
"right": 10,
"top": 10,
}
}
orientation="vertical"
selectionBrushOrientation="horizontal"
showCrosshair={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ exports[`EuiLineSeries all props are rendered 1`] = `
animation={null}
enableSelectionBrush={false}
height={200}
margins={
Object {
"bottom": 40,
"left": 40,
"right": 10,
"top": 10,
}
}
orientation="vertical"
selectionBrushOrientation="horizontal"
showCrosshair={true}
Expand Down Expand Up @@ -4120,6 +4128,14 @@ exports[`EuiLineSeries is rendered 1`] = `
data-test-subj="test subject string"
enableSelectionBrush={false}
height={200}
margins={
Object {
"bottom": 40,
"left": 40,
"right": 10,
"top": 10,
}
}
orientation="vertical"
selectionBrushOrientation="horizontal"
showCrosshair={true}
Expand Down
4 changes: 3 additions & 1 deletion src/components/xy_chart/xy_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class XYChart extends PureComponent {
children,
width,
height,
margins,
xType,
yType,
stackBy,
Expand Down Expand Up @@ -134,7 +135,7 @@ class XYChart extends PureComponent {
width={width}
animation={animateData}
height={height}
margin={DEFAULT_MARGINS}
margin={margins}
xType={xType}
yType={yType}
xDomain={xDomain}
Expand Down Expand Up @@ -214,6 +215,7 @@ XYChart.defaultProps = {
showDefaultAxis: true,
enableSelectionBrush: false,
selectionBrushOrientation: HORIZONTAL,
margins: DEFAULT_MARGINS,
};

export const EuiXYChart = makeVisFlexible(XYChart);

0 comments on commit eaec046

Please sign in to comment.