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

Copy initial value from svg to figure #2046

Merged
merged 1 commit into from Apr 8, 2024
Merged

Copy initial value from svg to figure #2046

merged 1 commit into from Apr 8, 2024

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Apr 8, 2024

closes #2045

@Fil Fil requested a review from mbostock April 8, 2024 06:34
@Fil Fil changed the title fix #2045 Copy initial value from svg to figure Apr 8, 2024
Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

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

Seems correct but I’m curious how the svg.value gets set erroneously in the first place, and what prevents it from subsequently getting set again in the wrong place? (I can investigate this myself by looking at the code, but if you’re willing it would be nice to summarize more of what the underlying cause is here.)

@Fil
Copy link
Contributor Author

Fil commented Apr 8, 2024

The pointer transform initializes svg.value:

return render(null);

it dispatches here before we actually have a figure:

if (!(i == null && facetState?.size > 1)) context.dispatchValue(i == null ? null : data[i]);

Once the figure has replaced the svg, the value is dispatched correctly.

Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

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

Thanks!

@Fil Fil merged commit 9435265 into main Apr 8, 2024
1 check passed
@Fil Fil deleted the fil/fix-2045 branch April 8, 2024 15:10
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.

The initial value of a plot with a title and a pointer transform is undefined
2 participants