Skip to content

Commit

Permalink
[#1170] line Chart > select Series 관련하여 간혈적으로 에러로그 발생 (#1171)
Browse files Browse the repository at this point in the history
* [#1170] line Chart > select Series 관련하여 간혈적으로 에러로그 발생
- 배열 구조분해할당 전 배열이 맞는지 확인하는 로직 추가

* Update minor version (3.3.21 -> 3.3.22)

Co-authored-by: jinhee park <jinhee@ex-em.com>
  • Loading branch information
jhee564 and jhee564 authored May 18, 2022
1 parent cc93a1d commit ebf88d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "evui",
"version": "3.3.21",
"version": "3.3.22",
"description": "A EXEM Library project",
"author": "exem <dev_client@ex-em.com>",
"license": "MIT",
Expand Down
10 changes: 10 additions & 0 deletions src/components/chart/model/model.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,15 @@ const modules = {
vector: { start: position[dataIndex - 1], end: position[dataIndex] },
}));

const isEmptyVector = (arr => !arr || !Array.isArray(arr) || arr?.length !== 2);

// canvas 의 클릭 위치값은 제 4 사분면의 위치이므로 clickedY, y1, y2 의 값은 음수를 취한다.
if (isStackChart) {
hitSeries = vectorList.find(({ vector }) => {
if (isEmptyVector(vector?.start) && isEmptyVector(vector?.end)) {
return false;
}

const [x1, y1] = vector.start;
const [x2, y2] = vector.end;
const v1 = [x2 - x1, y1 - y2];
Expand All @@ -713,6 +719,10 @@ const modules = {
})?.sId;
} else {
hitSeries = vectorList.find(({ vector }) => {
if (isEmptyVector(vector?.start) && isEmptyVector(vector?.end)) {
return false;
}

const [x1, y1] = vector.start;
const [x2, y2] = vector.end;
const a = (y1 - y2) / (x2 - x1);
Expand Down

0 comments on commit ebf88d2

Please sign in to comment.