# Using 3rd party python SVG library

**URL:** <https://forum.inductiveautomation.com/t/using-3rd-party-python-svg-library/53462>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [November 25, 2021, 12:23pm UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-svg-library/53462 "2021-11-25T12:23:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![janne.p](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@janne.p](https://forum.inductiveautomation.com/u/janne.p)\
**Post date:** [November 25, 2021, 12:23pm UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-svg-library/53462/1 "2021-11-25T12:23:33Z")

</div>

I was trying to use 3rd party library for SVG drawing without success. The goal is to draw image based on values gathered from ignition and show it on view indicating progress and dynamic packaging.

The library in use was svgwrite. Is there anyone who has used SVG drawing libraries in python before

EDIT: I am using perspective. In my understandin when showing the actual SVG it should be on some kind of web server or accessible using url.

Ignition Webdev component would be one possibility.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [November 25, 2021, 3:47pm UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-svg-library/53462/2 "2021-11-25T15:47:48Z")

</div>

vision or perspective?

---

<div class="post-metadata">

**Author:** ![janne.p](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@janne.p](https://forum.inductiveautomation.com/u/janne.p)\
**Post date:** [November 25, 2021, 6:25pm UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-svg-library/53462/3 "2021-11-25T18:25:04Z")

</div>

Hi, edited my original post. I am using perspective at the moment

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 25, 2021, 8:48pm UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-svg-library/53462/4 "2021-11-25T20:48:35Z")

</div>

> [@Reading values from database and converting it using python](https://forum.inductiveautomation.com/t/reading-values-from-database-and-converting-it-using-python/44508/11):
>
> Easysvg is a nice little wrapper to make svg files. Unzip and put in the gateway’s user-lib/pylib/site-packages folder. [easysvg.zip](https://forum.inductiveautomation.com/uploads/short-url/wY51CE88Fu5FMMVecxJajTF2wx2.zip) (6.7 KB) View attached using the csv data posted. The SVG can be converted to base64 to display in an image component. [heatmap\_test.zip](https://forum.inductiveautomation.com/uploads/short-url/DNp1RjLC9yUNKbbFzdiZdg5LHc.zip) (76.0 KB) Script: import easysvg import base64 class heatPalette: ''' Calculate the RGB value of a point on a gradient. Usage: heatPalette(minval, maxval, [colors]) minval - minimun value to sca…

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 25, 2021, 8:50pm UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-svg-library/53462/5 "2021-11-25T20:50:21Z")

</div>

Different application using the same library

> [@Building a Dynagraph card In Perspective](https://forum.inductiveautomation.com/t/building-a-dynagraph-card-in-perspective/48870/2):
>
> Easysvg is a nice little wrapper to make svg files. Unzip and put in the gateway’s user-lib/pylib/site-packages folder. You may need to restart your designer afterwards. [easysvg.zip](https://forum.inductiveautomation.com/uploads/short-url/wY51CE88Fu5FMMVecxJajTF2wx2.zip) (6.7 KB) Sample view. [dynacard\_perspective\_2021-08-02\_0532.zip](https://forum.inductiveautomation.com/uploads/short-url/fwADeidZA79Hbo5OHltYBvZKxWD.zip) (51.0 KB) import ast, math, easysvg, base64 def roundup(value): ''' Round value up to next 100 ''' return int(math.ceil(float(value)/100) \* 100) dataIn = self.getSibling("Table").props.data xIn= dataIn.getColumnAsList(0) yI…

---

<div class="post-metadata">

**Author:** ![janne.p](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@janne.p](https://forum.inductiveautomation.com/u/janne.p)\
**Post date:** [November 26, 2021, 5:09am UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-svg-library/53462/6 "2021-11-26T05:09:43Z")

</div>

Thank you so much. I will test this and inform the results

---

<div class="post-metadata">

**Author:** ![janne.p](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@janne.p](https://forum.inductiveautomation.com/u/janne.p)\
**Post date:** [November 29, 2021, 7:26am UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-svg-library/53462/7 "2021-11-29T07:26:05Z")

</div>

This is working great.
