Select to view content in your preferred language

SVG built from dataURI in PictureMarkerSymbol different between esri 3 and 4

284
0
02-01-2024 11:45 AM
JacksonQiu
New Contributor II

Hello,

We have an algorithm in our product that generates a pie chart in the form of an SVG data URI. This can be viewed on the browser to ensure the image is generated correctly.

In esri 3, the only adjustment needed to the SVG was to translate it by half the width and height of the intended graphic, agnostic across all browsers.

In esri 4, the same URI produces a graphic that is cut off, shrunken, and also taller than it is wide. This seems to be related to the window.devicePixelRatio but I am not able to debug further what else it is related to.

I have attached two codePens. Does anyone have insight into how we would have to adjust our SVG or the graphic settings to achieve the same result?

https://codepen.io/jacksonqiu/pen/NWJYzLv?editors=1000 (esri 3)
https://codepen.io/jacksonqiu/pen/yLwKqXZ (esri 4)

0 Kudos
0 Replies