Skip to content

Commit

Permalink
feat(tooltip): allow postfix banded area series
Browse files Browse the repository at this point in the history
Allow user to set postfix for upper and lower bound of banded series to distinguish between values

closes elastic#162
  • Loading branch information
nickofthyme committed Sep 24, 2019
1 parent 6272cd1 commit 3f1c918
Show file tree
Hide file tree
Showing 11 changed files with 184 additions and 36 deletions.
18 changes: 18 additions & 0 deletions src/chart_types/xy_chart/rendering/rendering.areas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ describe('Rendering points - areas', () => {
x: 25,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 50,
Expand All @@ -165,6 +166,7 @@ describe('Rendering points - areas', () => {
x: 25,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -282,6 +284,7 @@ describe('Rendering points - areas', () => {
x: 25,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 50,
Expand All @@ -301,6 +304,7 @@ describe('Rendering points - areas', () => {
x: 25,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -328,6 +332,7 @@ describe('Rendering points - areas', () => {
x: 25,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 50,
Expand All @@ -347,6 +352,7 @@ describe('Rendering points - areas', () => {
x: 25,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -424,6 +430,7 @@ describe('Rendering points - areas', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 100,
Expand All @@ -443,6 +450,7 @@ describe('Rendering points - areas', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -559,6 +567,7 @@ describe('Rendering points - areas', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 100,
Expand All @@ -578,6 +587,7 @@ describe('Rendering points - areas', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -605,6 +615,7 @@ describe('Rendering points - areas', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 100,
Expand All @@ -624,6 +635,7 @@ describe('Rendering points - areas', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -701,6 +713,7 @@ describe('Rendering points - areas', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 100,
Expand All @@ -720,6 +733,7 @@ describe('Rendering points - areas', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -821,6 +835,7 @@ describe('Rendering points - areas', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 100,
Expand All @@ -840,6 +855,7 @@ describe('Rendering points - areas', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -867,6 +883,7 @@ describe('Rendering points - areas', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 100,
Expand All @@ -886,6 +903,7 @@ describe('Rendering points - areas', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down
10 changes: 10 additions & 0 deletions src/chart_types/xy_chart/rendering/rendering.bands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ describe('Rendering bands - areas', () => {
x: 25,
y: 0,
},
banded: true,
} as PointGeometry);

expect(points[1]).toEqual({
Expand All @@ -167,6 +168,7 @@ describe('Rendering bands - areas', () => {
x: 25,
y: 0,
},
banded: true,
} as PointGeometry);
expect(points[2]).toEqual({
x: 50,
Expand All @@ -186,6 +188,7 @@ describe('Rendering bands - areas', () => {
x: 25,
y: 0,
},
banded: true,
} as PointGeometry);
expect(points[3]).toEqual({
x: 50,
Expand All @@ -205,6 +208,7 @@ describe('Rendering bands - areas', () => {
x: 25,
y: 0,
},
banded: true,
} as PointGeometry);
});
});
Expand Down Expand Up @@ -289,6 +293,7 @@ describe('Rendering bands - areas', () => {
x: 25,
y: 0,
},
banded: true,
} as PointGeometry);

expect(points[1]).toEqual({
Expand All @@ -310,6 +315,7 @@ describe('Rendering bands - areas', () => {
x: 25,
y: 0,
},
banded: true,
} as PointGeometry);
expect(points[2]).toEqual({
x: 50,
Expand All @@ -329,6 +335,7 @@ describe('Rendering bands - areas', () => {
x: 25,
y: 0,
},
banded: true,
} as PointGeometry);
expect(points[3]).toEqual({
x: 50,
Expand All @@ -348,6 +355,7 @@ describe('Rendering bands - areas', () => {
x: 25,
y: 0,
},
banded: true,
} as PointGeometry);
expect(points[4]).toEqual({
x: 75,
Expand All @@ -367,6 +375,7 @@ describe('Rendering bands - areas', () => {
x: 25,
y: 0,
},
banded: true,
} as PointGeometry);
expect(points[5]).toEqual({
x: 75,
Expand All @@ -386,6 +395,7 @@ describe('Rendering bands - areas', () => {
x: 25,
y: 0,
},
banded: true,
} as PointGeometry);
});
});
Expand Down
18 changes: 18 additions & 0 deletions src/chart_types/xy_chart/rendering/rendering.lines.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ describe('Rendering points - line', () => {
x: 25,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 50,
Expand All @@ -155,6 +156,7 @@ describe('Rendering points - line', () => {
x: 25,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -270,6 +272,7 @@ describe('Rendering points - line', () => {
x: 25,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 50,
Expand All @@ -289,6 +292,7 @@ describe('Rendering points - line', () => {
x: 25,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -316,6 +320,7 @@ describe('Rendering points - line', () => {
x: 25,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 50,
Expand All @@ -335,6 +340,7 @@ describe('Rendering points - line', () => {
x: 25,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -411,6 +417,7 @@ describe('Rendering points - line', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 100,
Expand All @@ -430,6 +437,7 @@ describe('Rendering points - line', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -544,6 +552,7 @@ describe('Rendering points - line', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 100,
Expand All @@ -563,6 +572,7 @@ describe('Rendering points - line', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -590,6 +600,7 @@ describe('Rendering points - line', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 100,
Expand All @@ -609,6 +620,7 @@ describe('Rendering points - line', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -685,6 +697,7 @@ describe('Rendering points - line', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 100,
Expand All @@ -704,6 +717,7 @@ describe('Rendering points - line', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -805,6 +819,7 @@ describe('Rendering points - line', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 100,
Expand All @@ -824,6 +839,7 @@ describe('Rendering points - line', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down Expand Up @@ -851,6 +867,7 @@ describe('Rendering points - line', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(points[1]).toEqual({
x: 100,
Expand All @@ -870,6 +887,7 @@ describe('Rendering points - line', () => {
x: 0,
y: 0,
},
banded: false,
} as PointGeometry);
expect(indexedGeometries.size).toEqual(points.length);
});
Expand Down
1 change: 1 addition & 0 deletions src/chart_types/xy_chart/rendering/rendering.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ describe('Rendering utils', () => {
x: 0,
y: 0,
radius: 10,
banded: false,
};
expect(isPointOnGeometry(0, 0, geometry)).toBe(true);
expect(isPointOnGeometry(10, 10, geometry)).toBe(true);
Expand Down
Loading

0 comments on commit 3f1c918

Please sign in to comment.