-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
specify types for defaultProps in PathMarkerLayer #2655
specify types for defaultProps in PathMarkerLayer #2655
Conversation
@@ -22,18 +22,21 @@ const defaultProps = Object.assign({}, PathOutlineLayer.defaultProps, { | |||
MarkerLayer: DEFAULT_MARKER_LAYER, | |||
markerLayerProps: DEFAULT_MARKER_LAYER_PROPS, | |||
|
|||
sizeScale: 100, | |||
sizeScale: {type: 'number', value: 100, min: 1}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is min
1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be 0.
getMarkerPercentages: (object, {lineLength}) => | ||
lineLength > DISTANCE_FOR_MULTI_ARROWS ? [0.25, 0.5, 0.75] : [0.5] | ||
getPath: {type: 'accessor', value: x => x.path}, | ||
getColor: {type: 'accessor', value: x => x.color}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this prop used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it is used in createPathMarkers
.
https://github.com/uber/deck.gl/blob/master/modules/experimental-layers/src/path-marker-layer/create-path-markers.js#L28
in lines 28, 46 and 58.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not used. I removed it
getPath: {type: 'accessor', value: x => x.path}, | ||
getColor: {type: 'accessor', value: x => x.color}, | ||
getMarkerColor: {type: 'accessor', value: [0, 0, 0, 255]}, | ||
getDirection: {type: 'accessor', value: x => x.direction}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this have to be a function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's changed to a const
0510130
to
4251e35
Compare
getMarkerPercentages = x => [0.5], | ||
getDirection = DEFAULT_DIRECTION, | ||
getColor = DEFAULT_COLOR, | ||
getMarkerPercentages = [0.5], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're using this as a function but the default value is a constant
For #2477
Background
In PathMarkerLayer, the defaultProps don't have types specified. We need to specify types for those props.
Change List
note: tested in layer browser