[TSVB] Add domain fit option to 0 opacity tsvb line charts (#54314) (#54517)

- Line charts is TSVB will no again fit to the data and provide a padding when away from the zero baseline
This commit is contained in:
Nick Partridge 2020-01-11 12:18:37 -06:00 committed by GitHub
parent 3164fa3413
commit e3c2f31ea7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View file

@ -106,7 +106,7 @@
"dependencies": {
"@babel/core": "^7.5.5",
"@babel/register": "^7.7.0",
"@elastic/charts": "^13.5.12",
"@elastic/charts": "~13.5.13",
"@elastic/datemath": "5.0.2",
"@elastic/ems-client": "1.0.5",
"@elastic/eui": "14.5.1",

View file

@ -79,10 +79,14 @@ export class TimeseriesVisualization extends Component {
static getYAxisDomain = model => {
const axisMin = get(model, 'axis_min', '').toString();
const axisMax = get(model, 'axis_max', '').toString();
const fit = model.series
? model.series.filter(({ hidden }) => !hidden).every(({ fill }) => fill === '0')
: model.fill === '0';
return {
min: axisMin.length ? Number(axisMin) : undefined,
max: axisMax.length ? Number(axisMax) : undefined,
fit,
};
};

View file

@ -1070,10 +1070,10 @@
debug "^3.1.0"
lodash.once "^4.1.1"
"@elastic/charts@^13.5.12":
version "13.5.12"
resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-13.5.12.tgz#95bd92389ec5fb411debfa5979091b6da2e4b123"
integrity sha512-MMNuebZ5jmzXkUJZr/mSvmtWNIR0gWGBtbqpZBfq3T9WRQPvnEHeE/N1WmXw2BSvwN86fy1i0gr52izh/nfzjQ==
"@elastic/charts@~13.5.13":
version "13.5.13"
resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-13.5.13.tgz#332455af6f990f196a7544af14fabd123b81892e"
integrity sha512-TlzIwmBIlXsxdD27Ltfl+BuIWqTh7OtKQMVAbARYsWsrBhf+GphxoVT7spWyBPIrUuMLegP4T6I5mC1XhkqNgA==
dependencies:
"@types/d3-shape" "^1.3.1"
classnames "^2.2.6"