# Simple interactive elements example

**URL:** <https://forum.anaconda.com/t/simple-interactive-elements-example/20257>\
**Category:** PyScript\
**Created:** [May 1, 2022, 5:56am UTC](https://forum.anaconda.com/t/simple-interactive-elements-example/20257 "2022-05-01T05:56:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tirthajyoti](https://avatars.discourse-cdn.com/v4/letter/t/db6015/32.png) [@tirthajyoti](https://forum.anaconda.com/u/tirthajyoti)\
**Post date:** [May 1, 2022, 5:56am UTC](https://forum.anaconda.com/t/simple-interactive-elements-example/20257/1 "2022-05-01T05:56:29Z")

</div>

Can some examples be put that show simple HTML button interaction to create charts and tables, etc? This is for standard data science users.

For example, generate some random numbers for a given distribution type. A simple dropdown (HTML) of 3-4 distributions and a button (HTML) and when clicked, shows the generated random variates using `NumPy`. Can even show plots using `Matplotlib`.

I noticed some widgets examples using `Panel`, but can we not use HTML elements as widgets? From the concept of the project, this will be most straightforward.

---

<div class="post-metadata">

**Author:** ![tirthajyoti](https://avatars.discourse-cdn.com/v4/letter/t/db6015/32.png) [@tirthajyoti](https://forum.anaconda.com/u/tirthajyoti)\
**Post date:** [May 1, 2022, 10:15am UTC](https://forum.anaconda.com/t/simple-interactive-elements-example/20257/2 "2022-05-01T10:15:02Z")

</div>

Actually, I explored and kind of figured out some of these. Here is my basic random number generation script running nicely on Github static page 🙂

[https://tirthajyoti.github.io/pyscript\_random\_gen.html](https://tirthajyoti.github.io/pyscript_random_gen.html)

---

<div class="post-metadata">

**Author:** ![riuunderscoreofficia](https://avatars.discourse-cdn.com/v4/letter/r/c2df01/32.png) [@riuunderscoreofficia](https://forum.anaconda.com/u/riuunderscoreofficia)\
**Post date:** [May 2, 2022, 12:49pm UTC](https://forum.anaconda.com/t/simple-interactive-elements-example/20257/3 "2022-05-02T12:49:10Z")

</div>

Can you provide the github source link for reference?

---

<div class="post-metadata">

**Author:** ![tanner.wride](https://avatars.discourse-cdn.com/v4/letter/t/0075a9/32.png) [@tanner.wride](https://forum.anaconda.com/u/tanner.wride)\
**Post date:** [May 2, 2022, 3:55pm UTC](https://forum.anaconda.com/t/simple-interactive-elements-example/20257/4 "2022-05-02T15:55:27Z")

</div>

Very cool! Thanks for sharing

---

<div class="post-metadata">

**Author:** ![ricardoprins](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/ricardoprins/32/1199_2.png) [@ricardoprins](https://forum.anaconda.com/u/ricardoprins)\
**Post date:** [May 2, 2022, 4:46pm UTC](https://forum.anaconda.com/t/simple-interactive-elements-example/20257/5 "2022-05-02T16:46:58Z")

</div>

> <https://github.com/tirthajyoti/PyScript-examples/blob/main/examples/pyscript_random_gen.html>

---

<div class="post-metadata">

**Author:** ![Brian\_Kustra](https://avatars.discourse-cdn.com/v4/letter/b/db6015/32.png) [@Brian\_Kustra](https://forum.anaconda.com/u/Brian_Kustra)\
**Post date:** [May 2, 2022, 5:17pm UTC](https://forum.anaconda.com/t/simple-interactive-elements-example/20257/6 "2022-05-02T17:17:58Z")

</div>

This is really cool! 🙂 Has a notebook feel.

---

<div class="post-metadata">

**Author:** ![steakfrite](https://avatars.discourse-cdn.com/v4/letter/s/00a5b5/32.png) [@steakfrite](https://forum.anaconda.com/u/steakfrite)\
**Post date:** [May 5, 2022, 9:11am UTC](https://forum.anaconda.com/t/simple-interactive-elements-example/20257/7 "2022-05-05T09:11:47Z")

</div>

Thanks! I have been through your code and could you please guide us on how pys-onClick works in your button? I couldn’t find anything on Google about it.

---

<div class="post-metadata">

**Author:** ![dios-c](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/dios-c/32/1217_2.png) [@dios-c](https://forum.anaconda.com/u/dios-c)\
**Post date:** [May 5, 2022, 9:54am UTC](https://forum.anaconda.com/t/simple-interactive-elements-example/20257/8 "2022-05-05T09:54:32Z")

</div>

thank you~ your script explained a lot for me.
