Skip to content

Commit 49bc72e

Browse files
authored
return default values for text mark (#148)
1 parent d9a64e2 commit 49bc72e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • packages/sanddance/src/vega-deck.gl/marks

packages/sanddance/src/vega-deck.gl/marks/text.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ const markStager: MarkStager = (options: MarkStagerOptions, stage: Stage, scene:
5656
};
5757

5858
function convertAngle(vegaTextAngle: number) {
59-
return 360 - vegaTextAngle;
59+
if (vegaTextAngle && !isNaN(vegaTextAngle)) {
60+
return 360 - vegaTextAngle;
61+
}
62+
return 0;
6063
}
6164

6265
function convertAlignment(textAlign: SceneTextAlign): TextAnchor {
@@ -65,13 +68,14 @@ function convertAlignment(textAlign: SceneTextAlign): TextAnchor {
6568
case 'left': return 'start';
6669
case 'right': return 'end';
6770
}
71+
return 'start';
6872
}
6973

7074
function convertBaseline(baseline: SceneTextBaseline): AlignmentBaseline {
7175
switch (baseline) {
7276
case 'middle': return 'center';
7377
}
74-
return baseline;
78+
return baseline || 'bottom';
7579
}
7680

7781
export default markStager;

0 commit comments

Comments
 (0)