DOI-ONRR / doi-extractives-data

Information on the extractive industries in the U.S. from federal data.
https://revenuedata.doi.gov/
Other
77 stars 41 forks source link

[Maps] SVG stroke-width scales in IE #1478

Closed shawnbot closed 7 years ago

shawnbot commented 8 years ago

Expected Behavior

The SVG vector-effect property prevents browsers from scaling stroke widths on scaled elements, so that the stroke widths are consistent regardless of scale. The maps use this property to ensure that strokes are the same for different maps, because each has a different scale depending on its zoom region.

Actual Behavior

All of the maps that scale with an SVG viewBox have scaled stroke widths in IE. Even Edge doesn't support it yet, which suggests that we need to find a general-purpose solution for IE.

Potential Fixes

It's easy to detect support for vector-effect, but polyfilling this could be tricky because of the external content. One solution might be to force svg4everybody to insert copies of the elements on all versions of IE (with polyfill: true in the options), then determine the scale of each element that has a stroke-width and adjust accordingly. There aren't any hooks to listen for the insertion in svg4everybody, but since we're maintaining our own fork we could add them. One alternative would be to use mutation observers, which are only supported on IE11 and later.

meiqimichelle commented 8 years ago

@shawnbot is this still relevant?

shawnbot commented 8 years ago

Yep, still relevant.

coreycaitlin commented 7 years ago

Closing this out — @shawnbot and I just looked at the maps in IE11, and they look pretty good.