observablehq / stdlib

The Observable standard library.
https://observablehq.com/@observablehq/standard-library
ISC License
966 stars 83 forks source link

add attributes to image() as options #267

Closed CobusT closed 2 years ago

CobusT commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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