<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Change a Point Symbol's Size by a Relative Amount in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-a-point-symbol-s-size-by-a-relative-amount/m-p/1706831#M88509</link>
    <description>&lt;P&gt;For CIMSymbol, check out the &lt;A href="https://developers.arcgis.com/javascript/latest/references/core/symbols/support/cimSymbolUtils/#scaleCIMSymbolTo" target="_blank"&gt;cimSymbolUtils&lt;/A&gt;&amp;nbsp;module - specifically the &lt;A href="https://developers.arcgis.com/javascript/latest/references/core/symbols/support/cimSymbolUtils/#getCIMSymbolSize" target="_blank"&gt;getCIMSymbolSize&lt;/A&gt; and &lt;A href="https://developers.arcgis.com/javascript/latest/references/core/symbols/support/cimSymbolUtils/#scaleCIMSymbolTo" target="_blank"&gt;scaleCIMSymbolTo&lt;/A&gt;&amp;nbsp;functions. Use these together to get the size of the symbol, then multiple the size by 1.5, and reapply it using scaleCIMSymbolTo.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jun 2026 13:08:50 GMT</pubDate>
    <dc:creator>AnneFitz</dc:creator>
    <dc:date>2026-06-08T13:08:50Z</dc:date>
    <item>
      <title>Change a Point Symbol's Size by a Relative Amount</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-a-point-symbol-s-size-by-a-relative-amount/m-p/1706687#M88507</link>
      <description>&lt;P&gt;I need to take the 2D symbol of an arbitrary point Graphic and multiply the size by 1.5. Is there a sensible way to do this for all potential symbol types? I have simple and picture markers down but I have no idea where to begin with CIM Symbols, and I assume the 3D symbols need shader stuff to scale properly. I have the option of shoving this symbol in a separate layer and applying the scaling there if that works better.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const scale = 1.5
let baseSize: number;
if (pointGraphic.symbol.size != null) {
  baseSize = pointGraphic.symbol.size * scale;
  pointGraphic.symbol.size = baseSize;
} else if ((pointGraphic.symbol as any)?.width != null) {
  const baseWidth = (pointGraphic.symbol as any).width * scale;
  const baseHeight = (pointGraphic.symbol as any).height * scale;
  baseSize = baseWidth &amp;gt; baseHeight ? baseWidth : baseHeight;
  (pointGraphic.symbol as any).width = baseWidth;
  (pointGraphic.symbol as any).height = baseHeight;
} else if ((pointGraphic.symbol as any)?.font != null) {
  baseSize = (pointGraphic.symbol as any).font.size * scale;
  (pointGraphic.symbol as any).font.size = baseSize;
} else {
  // TODO: Scale CIM point
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2026 22:31:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-a-point-symbol-s-size-by-a-relative-amount/m-p/1706687#M88507</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2026-06-05T22:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change a Point Symbol's Size by a Relative Amount</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-a-point-symbol-s-size-by-a-relative-amount/m-p/1706831#M88509</link>
      <description>&lt;P&gt;For CIMSymbol, check out the &lt;A href="https://developers.arcgis.com/javascript/latest/references/core/symbols/support/cimSymbolUtils/#scaleCIMSymbolTo" target="_blank"&gt;cimSymbolUtils&lt;/A&gt;&amp;nbsp;module - specifically the &lt;A href="https://developers.arcgis.com/javascript/latest/references/core/symbols/support/cimSymbolUtils/#getCIMSymbolSize" target="_blank"&gt;getCIMSymbolSize&lt;/A&gt; and &lt;A href="https://developers.arcgis.com/javascript/latest/references/core/symbols/support/cimSymbolUtils/#scaleCIMSymbolTo" target="_blank"&gt;scaleCIMSymbolTo&lt;/A&gt;&amp;nbsp;functions. Use these together to get the size of the symbol, then multiple the size by 1.5, and reapply it using scaleCIMSymbolTo.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2026 13:08:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-a-point-symbol-s-size-by-a-relative-amount/m-p/1706831#M88509</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2026-06-08T13:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Change a Point Symbol's Size by a Relative Amount</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-a-point-symbol-s-size-by-a-relative-amount/m-p/1706899#M88511</link>
      <description>&lt;P&gt;Ah, there's always something buried in the support code! I'll have to test this later but I think this does the trick:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/** Scale a point symbol and return the original and new sizes. */
export async function scalePointSymbol(point: Graphic, to?: number, by?: number): Promise&amp;lt;[number, number]&amp;gt; {
    if (!to &amp;amp;&amp;amp; !by) {
        throw new Error("Must provide at least one of \"to\" or \"by\"");
    }
    let prevSize: number;
    let newSize: number = to ?? undefined;
    switch (point.symbol.type) {
        case "simple-marker":
        case "point-3d":
            prevSize = point.symbol.size;
            newSize ||= prevSize * by;
            point.symbol.size = newSize;
            break;
        case "text":
            prevSize = point.symbol.font.size;
            newSize ||= prevSize * by;
            point.symbol.font.size = newSize;
            break;
        case "picture-marker":
            const w = point.symbol.width;
            const h = point.symbol.height;
            const isWider = w &amp;gt; h;
            prevSize = isWider ? w : h;
            if (newSize) {
                point.symbol.width = isWider ? newSize : newSize * (w / h);
                point.symbol.height = isWider ? newSize * (h / w) : newSize;
            } else {
                point.symbol.width *= by;
                point.symbol.height *= by;
                newSize = prevSize * by;
            }
            break;
        case "web-style":
            point.symbol = await point.symbol.fetchCIMSymbol();
        case "cim":
            prevSize = getCIMSymbolSize(point.symbol);
            newSize ||= prevSize * by;
            scaleCIMSymbolTo(point.symbol, newSize, { preserveOutlineWidth: false });
            break;
        default:
            throw new Error(`Graphic does not have a point symbol (${point.symbol.type})`);
    }
    return [prevSize, newSize]
}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 08 Jun 2026 15:46:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-a-point-symbol-s-size-by-a-relative-amount/m-p/1706899#M88511</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2026-06-08T15:46:36Z</dc:date>
    </item>
  </channel>
</rss>

