Skip to content

Don’t promote string channel values to functions. - #453

Merged
Fil merged 1 commit into
mainfrom
mbostock/string-value
Jul 13, 2021
Merged

Fil merged 1 commit into
mainfrom
mbostock/string-value

Conversation

@mbostock

Copy link
Copy Markdown
Member

Instead, leave them as-is, and let valueof (and labelof) do the work. Broken out of #451.

@mbostock
mbostock requested a review from Fil July 12, 2021 13:47
@Fil

Fil commented Jul 12, 2021 •

Copy link
Copy Markdown
Contributor

Yes. We still keep field() for shorthand? Is this what we want in d3 too? In that case should field check its argument x and return d=>d[x] iff x is a string (or, not a function)?

@mbostock

Copy link
Copy Markdown
Member Author

I only kept it to avoid repeating d => d[name] twice. It’s not exposed externally, and we only call it given a string name, so it doesn’t need to check that the argument is a string.

@Fil
Fil merged commit c1ba415 into main Jul 13, 2021
@Fil
Fil deleted the mbostock/string-value branch July 13, 2021 10:15
@Fil Fil mentioned this pull request Jul 13, 2021
@mbostock mbostock modified the milestone: 0.2 Jul 31, 2021
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.

2 participants