Skip to content

Commit

Permalink
feat: handle scale band
Browse files Browse the repository at this point in the history
  • Loading branch information
emileNetter committed Jul 21, 2023
1 parent 270c35c commit ee3a222
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/react-d3-plugin/lib/Chart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ const Chart = forwardRef(({
(a.max ?? d3.max(a.data)) * linearDomainMaxMargin,
]);
break;
case d3.scaleBand:
domain = a
.scale()
.domain(a.data.map(d => d[a.bandDomainKey]))
.paddingInner(0.2)
.paddingOuter(0.1);
break;
default:
domain = a.scale().domain([
a.min ?? d3.min(a.data),
Expand Down

0 comments on commit ee3a222

Please # to comment.