Skip to content

Commit

Permalink
add check for undefined data
Browse files Browse the repository at this point in the history
  • Loading branch information
dvchristianbors committed Jun 14, 2024
1 parent 9700a12 commit 0aa2f96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vis/general/layoutUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function beautifyLayout(
tickfont: {
size: sharedAxisTraces.length > 1 ? VIS_TICK_LABEL_SIZE_SMALL : VIS_TICK_LABEL_SIZE,
},
type: typeof t.data.x[0] === 'string' ? 'category' : null,
type: typeof t.data.x?.[0] === 'string' ? 'category' : null,
ticks: 'none',
text: t.xTicks,
showspikes: false,
Expand Down Expand Up @@ -137,7 +137,7 @@ export function beautifyLayout(
tickfont: {
size: sharedAxisTraces.length > 1 ? VIS_TICK_LABEL_SIZE_SMALL : VIS_TICK_LABEL_SIZE,
},
type: typeof t.data.y[0] === 'string' ? 'category' : null,
type: typeof t.data.y?.[0] === 'string' ? 'category' : null,
ticks: 'none',
text: t.yTicks,
showspikes: false,
Expand Down

0 comments on commit 0aa2f96

Please sign in to comment.