Skip to content
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 3 commits into from
Aug 28, 2018

Conversation

mistercrunch
Copy link
Member

improvements:

  • added autozoom support
  • support for metric & aggregations (only aggregates if metric is picked)
  • fixed stroke
  • fixed opacity
  • introduced a SliderControl

gb0fx9gddw
screen shot 2018-08-23 at 9 35 25 am

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl
if (!hex) {
return [0, 0, 0, alpha];
const scaler = d3.scale.linear().domain(points).range(colors).clamp(true);
if (outpoutRGBA) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops

@@ -525,6 +525,16 @@ export const spectrums = {
],
};

export function hexToRGB(hex, alpha = 255) {
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

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.

@codecov-io
Copy link

codecov-io commented Aug 27, 2018

Codecov Report

Merging #5712 into master will decrease coverage by <.01%.
The diff coverage is 54.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5712      +/-   ##
==========================================
- Coverage   63.38%   63.37%   -0.01%     
==========================================
  Files         361      364       +3     
  Lines       23000    23038      +38     
  Branches     2559     2564       +5     
==========================================
+ Hits        14579    14601      +22     
- Misses       8406     8422      +16     
  Partials       15       15
Impacted Files Coverage Δ
superset/assets/src/explore/visTypes.jsx 57.14% <ø> (ø) ⬆️
superset/assets/src/visualizations/word_cloud.js 0% <ø> (ø) ⬆️
superset/assets/src/explore/controls.jsx 46.26% <ø> (ø) ⬆️
superset/assets/src/visualizations/PlaySlider.jsx 0% <0%> (ø) ⬆️
...ssets/src/visualizations/deckgl/layers/polygon.jsx 0% <0%> (ø) ⬆️
.../assets/src/visualizations/deckgl/layers/common.js 0% <0%> (ø) ⬆️
...sets/src/visualizations/deckgl/DeckGLContainer.jsx 0% <0%> (ø) ⬆️
superset/assets/src/chart/Chart.jsx 57.69% <100%> (ø) ⬆️
...et/assets/src/explore/components/controls/index.js 100% <100%> (ø) ⬆️
superset/views/core.py 73.93% <100%> (ø) ⬆️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f83ea23...3e8d857. Read the comment docs.

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a few comments.

min: 0,
max: 100,
renderTrigger: true,
description: t('Opacity, expects values between 1 and 100'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "...between 0 and 100"

@@ -4,9 +4,7 @@ import { Row, Col } from 'react-bootstrap';

import Mousetrap from 'mousetrap';

import 'bootstrap-slider/dist/css/bootstrap-slider.min.css';
import ReactBootstrapSlider from 'react-bootstrap-slider';
import './PlaySlider.css';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import should still be here, since it has more styles than were moved to BootrapSliderWrapper.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@@ -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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this was annoying.

if (fd.js_tooltip) {
const jsTooltip = sandboxedEval(fd.js_tooltip);
tooltipContentGenerator = o => dompurify.sanitize(sandboxedEval(fd.js_tooltip)(o));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tooltipContentGenerator = dompurify.sanitize(sandboxedEval(fd.js_tooltip));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is right as is. We need to sanitize the output of sandboxedEval(fd.js_tooltip)(o). The line is heavy though. I can make it 2 lines if you think there's too much going on.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you're right. My bad.

@betodealmeida betodealmeida merged commit 60ecd72 into apache:master Aug 28, 2018
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 11, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 11, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 11, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 12, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 12, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 12, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Oct 29, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Nov 2, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Nov 2, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments

(cherry picked from commit 60ecd72)
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* [deck polygon] add support for geohash

+ improvements:
* added autozoom support
* support for metric & aggregations (only aggregates if metric is picked)
* fixed stroke
* fixed opacity
* introduced a SliderControl

* addressing comments, fixing build

* Addressing comments
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants