Skip to content

Commit 6319d56

Browse files
authored
Update Ordinal.ts
1 parent bfa8c92 commit 6319d56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scale/Ordinal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class OrdinalScale extends Scale<OrdinalScaleSetting> {
143143
contain(rank: OrdinalRawValue | OrdinalNumber): boolean {
144144
rank = this.parse(rank);
145145
return scaleHelper.contain(rank, this._extent)
146-
&& this._ordinalMeta.categories.hasOwnProperty(rank);
146+
&& rank >= 0 && rank < this._ordinalMeta.categories.length;
147147
}
148148

149149
/**

0 commit comments

Comments
 (0)