diff options
author | Dan Miller <danjm.com@gmail.com> | 2018-10-25 08:53:12 +0800 |
---|---|---|
committer | Dan Miller <danjm.com@gmail.com> | 2018-12-04 11:36:05 +0800 |
commit | 3ced3c9b2ab75038163f82eb77fbf97ea78d2342 (patch) | |
tree | b16818f06358ffdd4faee14ce6a1badea395ed9f /ui/app/components/gas-customization/gas-price-chart | |
parent | d14af8346af2517db2e50f142377948c9f2ae5e9 (diff) | |
download | tangerine-wallet-browser-3ced3c9b2ab75038163f82eb77fbf97ea78d2342.tar.gz tangerine-wallet-browser-3ced3c9b2ab75038163f82eb77fbf97ea78d2342.tar.zst tangerine-wallet-browser-3ced3c9b2ab75038163f82eb77fbf97ea78d2342.zip |
Clean up for mmui-i11-custom-gas-price-chart branch
Diffstat (limited to 'ui/app/components/gas-customization/gas-price-chart')
-rw-r--r-- | ui/app/components/gas-customization/gas-price-chart/gas-price-chart.utils.js | 13 | ||||
-rw-r--r-- | ui/app/components/gas-customization/gas-price-chart/index.scss | 6 |
2 files changed, 7 insertions, 12 deletions
diff --git a/ui/app/components/gas-customization/gas-price-chart/gas-price-chart.utils.js b/ui/app/components/gas-customization/gas-price-chart/gas-price-chart.utils.js index ffd8056b0..67508703f 100644 --- a/ui/app/components/gas-customization/gas-price-chart/gas-price-chart.utils.js +++ b/ui/app/components/gas-customization/gas-price-chart/gas-price-chart.utils.js @@ -133,8 +133,8 @@ export function setTickPosition (axis, n, newPosition, secondNewPosition) { export function appendOrUpdateCircle ({ data, itemIndex, cx, cy, cssId, appendOnly }) { const circle = this.main - .select('.' + 'c3-selected-circles' + this.getTargetSelectorSuffix(data.id)) - .selectAll('.' + 'c3-selected-circle' + '-' + itemIndex) + .select('.c3-selected-circles' + this.getTargetSelectorSuffix(data.id)) + .selectAll(`.c3-selected-circle-${itemIndex}`) if (appendOnly || circle.empty()) { circle.data([data]) @@ -175,6 +175,7 @@ export function setSelectedCircle ({ export function generateChart (gasPrices, estimatedTimes, gasPricesMax, estimatedTimesMax) { + const gasPricesMaxPadded = gasPricesMax + 1 const chart = c3.generate({ size: { height: 165, @@ -202,13 +203,13 @@ export function generateChart (gasPrices, estimatedTimes, gasPricesMax, estimate axis: { x: { min: gasPrices[0], - max: gasPricesMax, + max: gasPricesMaxPadded, tick: { - values: [Math.floor(gasPrices[0]), Math.ceil(gasPricesMax)], + values: [Math.floor(gasPrices[0]), Math.ceil(gasPricesMaxPadded)], outer: false, format: function (val) { return val + ' GWEI' }, }, - padding: {left: gasPricesMax / 50, right: gasPricesMax / 50}, + padding: {left: gasPricesMaxPadded / 50, right: gasPricesMaxPadded / 50}, label: { text: 'Gas Price ($)', position: 'outer-center', @@ -275,7 +276,7 @@ export function generateChart (gasPrices, estimatedTimes, gasPricesMax, estimate return { top: circleY - chartYStart - 19 + (flipTooltip ? circleWidth + 38 : 0), - left: circleX - chartXStart + circleWidth - (gasPricesMax / 50), + left: circleX - chartXStart + circleWidth - (gasPricesMaxPadded / 50), } }, show: true, diff --git a/ui/app/components/gas-customization/gas-price-chart/index.scss b/ui/app/components/gas-customization/gas-price-chart/index.scss index 4c4640b1f..0990d6abb 100644 --- a/ui/app/components/gas-customization/gas-price-chart/index.scss +++ b/ui/app/components/gas-customization/gas-price-chart/index.scss @@ -37,15 +37,11 @@ .tooltip-arrow { background: black; box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.5); - /* top: 15px; */ - /* left: 27px; */ -webkit-transform: rotate(45deg); transform: rotate(45deg); opacity: 1 !important; width: 9px; height: 9px; - /* position: absolute; */ - /* display: inline-block; */ margin-top: 4px; } @@ -126,8 +122,6 @@ } } -@import url(//fonts.googleapis.com/css?family=Roboto:400,700,300); - #chart { background: #F8F9FB } |