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

Migrate Funnel visualization to React #4267

Merged
merged 16 commits into from
Nov 14, 2019
Merged

Migrate Funnel visualization to React #4267

merged 16 commits into from
Nov 14, 2019

Conversation

kravets-levko
Copy link
Collaborator

@kravets-levko kravets-levko commented Oct 19, 2019

What type of PR is this? (check all applicable)

  • Refactor
  • Feature

Description

  • Convert component to React
    • Renderer
    • Editor
  • Refine and performance
    • Get rid of "Auto sort" option: replace with "Sort column" dropdown + "Sort reverse" switch
    • Add option for number format (currently hard-coded)
    • Add option to limit items count (currently hard-coded to 100)
    • Add options for percent values bounds (currently hardcoded to 0.01%..1000%)
    • Debounce inputs
  • Cleanup
    • Get rid of d3 dependency
  • Tests

Related Tickets & Documents

#3301 (Migrate Visualizations to React -> Funnel)

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

image
image

@kravets-levko kravets-levko added Frontend Visualizations Frontend: React Frontend codebase migration to React labels Oct 19, 2019
@kravets-levko kravets-levko self-assigned this Oct 19, 2019
@arikfr arikfr mentioned this pull request Oct 19, 2019
24 tasks
@kravets-levko kravets-levko marked this pull request as ready for review October 19, 2019 16:25
@kravets-levko
Copy link
Collaborator Author

Everything as usual - I need to add some tests, but the rest is ready for review 🙂

@kravets-levko kravets-levko changed the title Migrate Funnel visualization to React (WIP) Migrate Funnel visualization to React Oct 19, 2019
@kravets-levko kravets-levko force-pushed the migrate-funnel-to-react branch from 2950943 to 48694c6 Compare October 20, 2019 15:43
@kravets-levko kravets-levko force-pushed the migrate-funnel-to-react branch from 48694c6 to 4b244b8 Compare October 20, 2019 16:25
@kravets-levko kravets-levko changed the title (WIP) Migrate Funnel visualization to React Migrate Funnel visualization to React Oct 20, 2019
@arikfr
Copy link
Member

arikfr commented Oct 20, 2019

  • Get rid of "Auto sort" option: replace with "Sort column" dropdown + "Sort reverse" switch

Can you explain what you mean here?

@kravets-levko
Copy link
Collaborator Author

kravets-levko commented Oct 20, 2019

There was "Auto sort" option: when it was true, data was sorted by value descending, when false - user was able to specify a column that was used to sort data ascending only. I replaced this option with two: sort column and asc/desc switch (with code that maps old option to new ones). To achieve autoSort = true, user should sort data by column used for value, and choose reverse order. autoSort = false actually works as previously - user need to select a column for sorting, but now they can also select a direction.

Copy link
Contributor

@ranbena ranbena left a comment

Choose a reason for hiding this comment

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

A bug I found:

  1. Edit viz for https://deploy-preview-4267--redash-preview.netlify.com/queries/47#111
  2. Change Step Column Name to "count"
  3. Change back to "name"

Expected - all column names return to "name"
Actual - some column names remain "count"

(I presume this has to do with non-uniqueness of count values)

@kravets-levko
Copy link
Collaborator Author

@ranbena Column name options are not connected - you can choose them independently. So that's okay if you change one and others remains unchanged. But when trying to reproduce your bug, I found another one (in renderer), so anyway there is something to fix 🙂

Copy link
Contributor

@ranbena ranbena left a comment

Choose a reason for hiding this comment

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

👌

@arikfr
Copy link
Member

arikfr commented Nov 7, 2019

Are we sure people would ever want to sort funnel values in an ascending order?

If we decide to keep the extra option (sort order), we need to make sure that the current UX is kept, which is: when you pick the values column you get a sorted result by the values column in a descending order. At the moment, after picking the values column you need to manually pick sort column and change the the order.

@kravets-levko
Copy link
Collaborator Author

@arikfr While I think it's not a problem to change two more fields (Funnel does not have so much options as, say, Chart), but I got your point. What about compromise: when user select a value column, and sort column is not set or is the same as value column - change sort column as well and set reverse order. WDYT?

@arikfr
Copy link
Member

arikfr commented Nov 7, 2019

While I think it's not a problem to change two more fields (Funnel does not have so much options as, say, Chart)

We should strive for things to become simpler and not to complicated everything equally 😆

If 99% of the time people want some behavior we better provide it as the default.

What about compromise: when user select a value column, and sort column is not set or is the same as value column - change sort column as well and set reverse order. WDYT?

Yes this can work.

We need to change the name of the "Reverse order" setting. Because for humans, in the context of funnels, the descending order is the right order. We can change it "Descending Sort" and it will be on by default.

@kravets-levko
Copy link
Collaborator Author

Okay. Then I'll experiment with it later and will ping you 👍

@kravets-levko kravets-levko force-pushed the migrate-funnel-to-react branch from 4b0bf34 to cf43983 Compare November 13, 2019 16:31
@kravets-levko
Copy link
Collaborator Author

@arikfr I decided to bring back "Auto Sort" option, but renamed it to "Custom Sorting" (see screenshots/check preview), and added sort direction dropdown (wasn't available prior to this PR):

image
image

@arikfr arikfr merged commit b44fa51 into master Nov 14, 2019
@arikfr
Copy link
Member

arikfr commented Nov 14, 2019

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend: React Frontend codebase migration to React Frontend Visualizations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants