File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -64,8 +64,10 @@ export class AxisX {
64
64
labelOffset,
65
65
line,
66
66
name,
67
+ ticks,
67
68
tickRotate
68
69
} = this ;
70
+ if ( ! x . interpolate && x . domain ( ) . length > 8 * ticks ) return ; // avoid a huge ordinal domain
69
71
const offset = name === "x" ? 0 : axis === "top" ? marginTop - facetMarginTop : marginBottom - facetMarginBottom ;
70
72
const offsetSign = axis === "top" ? - 1 : 1 ;
71
73
const ty = offsetSign * offset + ( axis === "top" ? marginTop : height - marginBottom ) ;
@@ -155,8 +157,10 @@ export class AxisY {
155
157
labelOffset,
156
158
line,
157
159
name,
160
+ ticks,
158
161
tickRotate
159
162
} = this ;
163
+ if ( ! y . interpolate && y . domain ( ) . length > 8 * ticks ) return ; // avoid a huge ordinal domain
160
164
const offset = name === "y" ? 0 : axis === "left" ? marginLeft - facetMarginLeft : marginRight - facetMarginRight ;
161
165
const offsetSign = axis === "left" ? - 1 : 1 ;
162
166
const tx = offsetSign * offset + ( axis === "right" ? width - marginRight : marginLeft ) ;
Original file line number Diff line number Diff line change @@ -129,8 +129,14 @@ export function plot(options = {}) {
129
129
const { fx, fy} = scales ;
130
130
const axisY = axes [ facets !== undefined && fy ? "fy" : "y" ] ;
131
131
const axisX = axes [ facets !== undefined && fx ? "fx" : "x" ] ;
132
- if ( axisY ) svg . appendChild ( axisY . render ( null , scales , dimensions ) ) ;
133
- if ( axisX ) svg . appendChild ( axisX . render ( null , scales , dimensions ) ) ;
132
+ if ( axisY ) {
133
+ const node = axisY . render ( null , scales , dimensions ) ;
134
+ if ( node ) svg . appendChild ( node ) ;
135
+ }
136
+ if ( axisX ) {
137
+ const node = axisX . render ( null , scales , dimensions ) ;
138
+ if ( node ) svg . appendChild ( node ) ;
139
+ }
134
140
135
141
// Render (possibly faceted) marks.
136
142
if ( facets !== undefined ) {
You can’t perform that action at this time.
0 commit comments