# Dynamically changing SVG element stroke via scripting

**URL:** <https://forum.inductiveautomation.com/t/dynamically-changing-svg-element-stroke-via-scripting/72003>\
**Category:** Ignition\
**Created:** [April 4, 2023, 8:02am UTC](https://forum.inductiveautomation.com/t/dynamically-changing-svg-element-stroke-via-scripting/72003 "2023-04-04T08:02:16Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 11, 2023, 3:13am UTC](https://forum.inductiveautomation.com/t/dynamically-changing-svg-element-stroke-via-scripting/72003/6 "2023-04-11T03:13:16Z")

</div>

> [@paul-griffith](#):
>
> same risk as sql injection

Thanks, that makes sense. This script is back end and not affected by user input, but I am curious if there is a better way. However, to avoid dragging this thread too far off of topic, I've created a separate thread here to discuss this matter in more detail:

> [@Use of Eval to getComponents: Is there a better approach for assembling a dynamic component list?](https://forum.inductiveautomation.com/t/use-of-eval-to-getcomponents-is-there-a-better-approach-for-assembling-a-dynamic-component-list/72282):
>
> I'm in the process of refactoring an old script that uses a dataset to get components of various nested depths. The dataset is created at initialization, so it always precisely reflects the items that are in the Vision window. There are two problems with this that I want to fix: • The component list only goes three levels deep • Later when another function uses the data, the code is structured in a way that repeats itself. The sanitized code resembles this: if levelSelectData == "1": selec…

---

_[View the full topic](https://forum.inductiveautomation.com/t/dynamically-changing-svg-element-stroke-via-scripting/72003)._
