feat: adding first version of Image component

This commit is contained in:
Mose Müller
2023-08-09 17:47:55 +02:00
parent 4d66b6b27c
commit 8d55f3b853
10 changed files with 87 additions and 10 deletions

View File

@@ -27,6 +27,10 @@ print(my_service.voltage.value) # Output: 5
```
"""
from pydase.components.image import Image
from pydase.components.number_slider import NumberSlider
__all__ = ["NumberSlider"]
__all__ = [
"NumberSlider",
"Image",
]

View File

@@ -0,0 +1,18 @@
from typing import Any
from pydase.data_service.data_service import DataService
class Image(DataService):
def __init__(
self,
value: bytes | str = "",
) -> None:
self.value = value
super().__init__()
def __setattr__(self, __name: str, __value: Any) -> None:
if __name == "value":
if isinstance(__value, bytes):
__value = __value.decode()
return super().__setattr__(__name, __value)

View File

@@ -1,13 +1,13 @@
{
"files": {
"main.css": "/static/css/main.398bc7f8.css",
"main.js": "/static/js/main.fe08055a.js",
"main.js": "/static/js/main.44c6c71b.js",
"index.html": "/index.html",
"main.398bc7f8.css.map": "/static/css/main.398bc7f8.css.map",
"main.fe08055a.js.map": "/static/js/main.fe08055a.js.map"
"main.44c6c71b.js.map": "/static/js/main.44c6c71b.js.map"
},
"entrypoints": [
"static/css/main.398bc7f8.css",
"static/js/main.fe08055a.js"
"static/js/main.44c6c71b.js"
]
}

View File

@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site displaying a pydase UI."/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>pydase App</title><script defer="defer" src="/static/js/main.fe08055a.js"></script><link href="/static/css/main.398bc7f8.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site displaying a pydase UI."/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>pydase App</title><script defer="defer" src="/static/js/main.44c6c71b.js"></script><link href="/static/css/main.398bc7f8.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long