Skip to content

Commit

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

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

- Line charts is TSVB will no again fit to the data and provide a padding when away from the zero baseline

* remove erroneous @elastic/apm-rum dependency
  • Loading branch information
nickofthyme committed Jan 10, 2020
1 parent 5bdf771 commit b57d6b7
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 @@ -111,7 +111,7 @@
"dependencies": {
"@babel/core": "^7.5.5",
"@babel/register": "^7.7.0",
"@elastic/charts": "^16.0.2",
"@elastic/charts": "^16.1.0",
"@elastic/datemath": "5.0.2",
"@elastic/ems-client": "1.0.5",
"@elastic/eui": "17.3.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 @@ -1869,10 +1869,10 @@
debug "^3.1.0"
lodash.once "^4.1.1"

"@elastic/charts@^16.0.2":
version "16.0.2"
resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-16.0.2.tgz#35068a08a19534da62e9bcad700cc7b2a15bc55a"
integrity sha512-0tVyltAmAPOAfiRU1iKYk3b9++4oTn6IXvyM4SSj7Ukh5Y90XXmOtGEUPnZTiRPmup9MJi4srrm9ra9k/Kq4UQ==
"@elastic/charts@^16.1.0":
version "16.1.0"
resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-16.1.0.tgz#67cf11625dcd7e1c2cf16ef53349e6a68a73f5b1"
integrity sha512-0jZ7thhGmYC0ZdEVkxfg6M66epCD7k7BfYIi12FnrmIK+mUD2IPhR8b2TJXvaojPryN4YTNreGRncQ9R58fOoQ==
dependencies:
"@types/d3-shape" "^1.3.1"
classnames "^2.2.6"
Expand Down

0 comments on commit b57d6b7

Please sign in to comment.