Skip to content

add attributes to image() as options #267

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

Merged
merged 8 commits into from
Oct 22, 2021

Conversation

CobusT
Copy link
Contributor

@CobusT CobusT commented Oct 18, 2021

Reference #231

This doesn't address all of the image options, but starts by addressing the most common requests... width, height, alt and title.

Example:

Screen Shot 2021-10-17 at 5 12 23 PM

@CobusT CobusT requested a review from mbostock October 18, 2021 00:09
@CobusT CobusT changed the title add width and height to image() as options add attributes to image() as options Oct 22, 2021
@CobusT CobusT requested a review from mbostock October 22, 2021 02:21
Copy link
Member

@mootari mootari left a comment

Choose a reason for hiding this comment

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

style should definitely be on the shortlist of attributes as well.

At this point, should we perhaps just accept and pass through any properties as attributes?

@CobusT
Copy link
Contributor Author

CobusT commented Oct 22, 2021

Ooh, yes, style is a good one. I am not sure we want to just pass through all properties, though. Would like to hear some thoughts from @mbostock on that.
Screen Shot 2021-10-22 at 9 11 42 AM

@mbostock
Copy link
Member

I agree we should make props an argument and then simply Object.assign(image, props).

@CobusT CobusT merged commit fdd8226 into main Oct 22, 2021
@CobusT CobusT deleted the cobus/add-width-and-height-to-image branch October 22, 2021 20:36
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.

3 participants