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

Fix funnels time to convert dashboard item height #5259

Merged
merged 5 commits into from
Jul 22, 2021

Conversation

alexkim205
Copy link
Contributor

Changes

Continues work on #5253

Screen Shot 2021-07-21 at 8 55 17 AM

Checklist

  • All querysets/queries filter by Organization, by Team, and by User
  • Django backend tests
  • Jest frontend tests
  • Cypress end-to-end tests
  • Migrations are safe to run at scale (e.g. PostHog Cloud) – present proof if not obvious
  • New/changed UI is decent on smartphones (viewport width around 360px)

@alexkim205 alexkim205 self-assigned this Jul 21, 2021
@timgl timgl temporarily deployed to posthog-pr-5259 July 21, 2021 16:05 Inactive
@alexkim205
Copy link
Contributor Author

Dashboard item still not rendering for me.

Found the bug - looks like it was due to a cachedResults not being passed down correctly from DashboardItem into funnelLogic for our time conversion results. Made the fix!

@timgl timgl temporarily deployed to posthog-pr-5259 July 21, 2021 17:09 Inactive
@alexkim205 alexkim205 requested a review from paolodamico July 21, 2021 17:09
Copy link
Contributor

@paolodamico paolodamico left a comment

Choose a reason for hiding this comment

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

Rendering better but not quite there yet, bar is not appearing (even after refreshing results, hard refreshing page, ...).

@alexkim205
Copy link
Contributor Author

alexkim205 commented Jul 21, 2021

Hmm strange, it seems to be working on my end. Can you chck the network request to make sure you're not getting null/empty time values?

@alexkim205
Copy link
Contributor Author

Can't seem to reproduce it :/

Screen.Recording.2021-07-21.at.11.13.29.AM.mov

@mariusandra
Copy link
Collaborator

mariusandra commented Jul 22, 2021

Can confirm I have the same issue @paolodamico reported. Will see what can be done.

2021-07-22 10 31 34

@mariusandra
Copy link
Collaborator

Weird stuff is happening, probably connected to D3 that I'm not able to immediately understand.

Even though the createRoundedRectPath gets called 4 times here and with legit params (height > 0), only three <path> elements end up on the screen.

Screenshot 2021-07-22 at 11 04 54

@mariusandra mariusandra temporarily deployed to posthog-pr-5259 July 22, 2021 09:29 Inactive
@mariusandra
Copy link
Collaborator

This works now. I had to:

  1. only show the graph if width/height are found for its container (setting the defaults even if just once resulted in weird aspect rations)
  2. completely re-render the entire component when data changes (here from [] to [actual data]), otherwise a path element is not updated.

I'll merge this now since the fix seems to work fine. @alexkim205 , for a proper fix though, try getting a funnel that has any value in the first bar and then seeing that on a dashboard.

@mariusandra mariusandra enabled auto-merge (squash) July 22, 2021 09:31
@mariusandra mariusandra merged commit e1a2420 into master Jul 22, 2021
@mariusandra mariusandra deleted the funnel-fixes-part-three branch July 22, 2021 09:47
@alexkim205
Copy link
Contributor Author

Weird stuff is happening, probably connected to D3 that I'm not able to immediately understand.

Even though the createRoundedRectPath gets called 4 times here and with legit params (height > 0), only three <path> elements end up on the screen.

Thanks for the details, this sounds like a problem with where D3 paints things. The three paths there seem to belong to the x-axis and I have it now so that the four bars should be painted in the root element. I'll put out a more permanent fix where I bring bar path elements into a separate canvas so that D3 knows exactly where to put them without overwriting/deleting anything (which I suspect is happening).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants