Skip to content

Commit

Permalink
fix(point): fix error when data has spaced name
Browse files Browse the repository at this point in the history
Convert id value using .getTargetSelectorSuffix() to prevent
node query selection error.

Fix #1739
  • Loading branch information
netil authored Oct 23, 2020
1 parent 84eaa6b commit 6ff9aec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/ChartInternal/shape/point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ export default {

return function(method, context, ...args) {
return function(d) {
const id: string = d.id || (d.data && d.data.id) || d;
const id: string = $$.getTargetSelectorSuffix(d.id || (d.data && d.data.id) || d);

const element = d3Select(this);

ids.indexOf(id) < 0 && ids.push(id);
Expand Down
2 changes: 1 addition & 1 deletion test/shape/point-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe("SHAPE POINT", () => {
data: {
columns: [
["data1", 30, 200, 100, 400, -150, 250],
["data2", 50, 20, 10, 40, 15, 25],
["data 2", 50, 20, 10, 40, 15, 25],
["data3", -150, 120, 110, 140, 115, 125]
]
},
Expand Down

0 comments on commit 6ff9aec

Please sign in to comment.