From 49cd2fedfb7262920a905067133318ca93f3eb8a Mon Sep 17 00:00:00 2001 From: Kim Truong <47833996+khtruong@users.noreply.github.com> Date: Mon, 11 Mar 2019 19:02:50 -0700 Subject: [PATCH] feat: add properties for font sizing (#10) * feat: add properties for font sizing * revert package.json changes * refactor: rename bigNum to header * chore: empty commit to kick off travis --- .../src/BigNumber/BigNumber.jsx | 20 ++++++++++--------- .../src/BigNumber/transformProps.js | 4 ++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-legacy-preset-chart-big-number/src/BigNumber/BigNumber.jsx b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-legacy-preset-chart-big-number/src/BigNumber/BigNumber.jsx index fd00513a49227..23a9a33608c78 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-legacy-preset-chart-big-number/src/BigNumber/BigNumber.jsx +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-legacy-preset-chart-big-number/src/BigNumber/BigNumber.jsx @@ -35,10 +35,8 @@ const CHART_MARGIN = { }; const PROPORTION = { - HEADER: 0.4, - SUBHEADER: 0.14, - HEADER_WITH_TRENDLINE: 0.3, - SUBHEADER_WITH_TRENDLINE: 0.125, + HEADER: 0.3, + SUBHEADER: 0.125, TRENDLINE: 0.3, }; @@ -78,7 +76,9 @@ const propTypes = { height: PropTypes.number.isRequired, bigNumber: PropTypes.number.isRequired, formatBigNumber: PropTypes.func, + headerFontSize: PropTypes.number, subheader: PropTypes.string, + subheaderFontSize: PropTypes.number, showTrendLine: PropTypes.bool, startYAxisAtZero: PropTypes.bool, trendLineData: PropTypes.array, @@ -88,7 +88,9 @@ const propTypes = { const defaultProps = { className: '', formatBigNumber: identity, + headerFontSize: PROPORTION.HEADER, subheader: '', + subheaderFontSize: PROPORTION.SUBHEADER, showTrendLine: false, startYAxisAtZero: true, trendLineData: null, @@ -217,7 +219,7 @@ class BigNumberVis extends React.PureComponent { } render() { - const { showTrendLine, height } = this.props; + const { showTrendLine, height, headerFontSize, subheaderFontSize } = this.props; const className = this.getClassName(); if (showTrendLine) { @@ -227,8 +229,8 @@ class BigNumberVis extends React.PureComponent { return (