Skip to content

Copy initial value from svg to figure#2046

Merged
Fil merged 1 commit into
mainfrom
fil/fix-2045
Apr 8, 2024
Merged

Copy initial value from svg to figure#2046
Fil merged 1 commit into
mainfrom
fil/fix-2045

Conversation

@Fil

@Fil Fil commented Apr 8, 2024

Copy link
Copy Markdown
Contributor

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

@mbostock mbostock left a comment

Copy link
Copy Markdown
Member

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

Fil commented Apr 8, 2024

Copy link
Copy Markdown
Contributor Author

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.

@mbostock mbostock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

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