-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
[deck polygon] add support for geohash #5712
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.BootstrapSliderWrapper .slider-selection { | ||
background: #efefef; | ||
} | ||
|
||
.BootstrapSliderWrapper .slider-handle { | ||
background: #b3b3b3; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import ReactBootstrapSlider from 'react-bootstrap-slider'; | ||
import 'bootstrap-slider/dist/css/bootstrap-slider.min.css'; | ||
import './BootstrapSliderWrapper.css'; | ||
|
||
export default function BootstrapSliderWrapper(props) { | ||
return ( | ||
<span className="BootstrapSliderWrapper"> | ||
<ReactBootstrapSlider {...props} /> | ||
</span> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
superset/assets/src/explore/components/controls/SliderControl.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import BootstrapSliderWrapper from '../../../components/BootstrapSliderWrapper'; | ||
import ControlHeader from '../ControlHeader'; | ||
|
||
const propTypes = { | ||
onChange: PropTypes.func, | ||
value: PropTypes.oneOfType([ | ||
PropTypes.string, | ||
PropTypes.number, | ||
]), | ||
}; | ||
|
||
const defaultProps = { | ||
onChange: () => {}, | ||
}; | ||
|
||
export default function SliderControl(props) { | ||
// This wouldn't be necessary but might as well | ||
return ( | ||
<div> | ||
<ControlHeader {...props} /> | ||
<BootstrapSliderWrapper | ||
{...props} | ||
change={(obj) => { | ||
props.onChange(obj.target.value); | ||
}} | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
SliderControl.propTypes = propTypes; | ||
SliderControl.defaultProps = defaultProps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,15 @@ import 'mapbox-gl/dist/mapbox-gl.css'; | |
const propTypes = { | ||
viewport: PropTypes.object.isRequired, | ||
layers: PropTypes.array.isRequired, | ||
setControlValue: PropTypes.func.isRequired, | ||
setControlValue: PropTypes.func, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, this was annoying. |
||
mapStyle: PropTypes.string, | ||
mapboxApiAccessToken: PropTypes.string.isRequired, | ||
onViewportChange: PropTypes.func, | ||
}; | ||
const defaultProps = { | ||
mapStyle: 'light', | ||
onViewportChange: () => {}, | ||
setControlValue: () => {}, | ||
}; | ||
|
||
export default class DeckGLContainer extends React.Component { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@hughhhh already imports
d3-colors
. Perhaps can use that?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.
Oh ere I only move the code from lower in the file since my linter was complaining about "referenced before defined". Though I don't want to sign up for it in the scope of this, PR, I totally agree that we should leverage d3-color as much as possible.
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.
Got it. I am fine with leaving it for later refactor outside of this PR.
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 actually I'm realizing that there's a need here for replacing whites with transparency for maps. That never was an issue with white backgrounds, but these maps would look better with transparency in place of whites. This calls for more of a refactor of these color gradients. We're also thinking about improving the control itself, allowing for user choosing colors and bounds, and maybe something about quantiles/ranking.