Skip to content

Commit 43c5a59

Browse files
authored
fix(annotations): fix alignment at the edges (#641)
This commit fixed the alignment of rect and line annotations near the edge of a data domain. It aligns the x/y position specified by the `dataValues` of the annotation to the domain of the chart. BREAKING CHANGE: In the rectangular annotation, the y0 parameter of the coordinates now refers to the minimum value and the y1 value refers to the maximum value of the y domain. fix #586
1 parent f411771 commit 43c5a59

60 files changed

Lines changed: 1894 additions & 1161 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ test/failure-screenshots/**/*.png
77

88
reports/
99
tmp/
10+
.temp/
1011
dist/
1112
coverage/
1213
.out/

.playground/index.html

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,22 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<title>Charts Playground</title>
5+
<title>Elastic-Charts Playground</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
8-
<title>Document</title>
98
<style>
109
html,
1110
body {
1211
background: blanchedalmond !important;
13-
/*margin-left: 8px !important;*/
14-
/*padding: 8px !important;*/
15-
/*height: 100%;*/
16-
/*width: 2000px;
17-
}
18-
#root {
19-
position: absolute;
20-
/*
21-
top: 0;
22-
left: 0;
23-
*/
24-
/* width: 100%;
25-
height: 100%;*/
26-
/* overflow-x: hidden; */
2712
}
2813
.chart {
2914
background: white;
30-
/*display: inline-block;
31-
position: relative;
32-
*/
33-
width: 100%;
34-
height: 500px;
35-
overflow: auto;
15+
width: 800px;
16+
height: 300px;
17+
margin: 20px;
3618
}
37-
38-
.testing {
39-
background: aquamarine;
40-
position: relative;
41-
width: 100vw;
42-
overflow: auto;
19+
label {
20+
display: block;
4321
}
4422
</style>
4523
</head>

.playground/playground.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,9 @@
1717
* under the License. */
1818

1919
import React from 'react';
20-
import { XYChartElementEvent, PartitionElementEvent } from '../src';
2120
import { example } from '../stories/treemap/6_custom_style';
2221

2322
export class Playground extends React.Component {
24-
onElementClick = (elements: (XYChartElementEvent | PartitionElementEvent)[]) => {
25-
// eslint-disable-next-line no-console
26-
console.log(elements);
27-
};
2823
render() {
2924
return (
3025
<div className="testing">
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)