Skip to content

Commit

Permalink
[TSVB] Add domain fit option to 0 opacity tsvb line charts (#54314) (#…
Browse files Browse the repository at this point in the history
…54517)

- Line charts is TSVB will no again fit to the data and provide a padding when away from the zero baseline
  • Loading branch information
nickofthyme authored Jan 11, 2020
1 parent 3164fa3 commit e3c2f31
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
};

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit e3c2f31

Please sign in to comment.