Closed
Description
One of the things that makes applications hard a layouts. A simple thing like achieving responsiveness can be hard.
I can see that pyscript.write
does not provide me anyway to control the layout of the value
. I would like to have that including options for responsiveness
.
For example in the below example there should be an easy way for the matplotlib figure to just scale to 100% of its container height and width (the mpl
element).
<html>
<head>
<!-- The link to the pyscript files are to be replaced official files when they are available at a CDN -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/MarcSkovMadsen/awesome-pyscript@master/assets/pyscript/pyscript.css" />
<script defer src="https://cdn.jsdelivr.net/gh/MarcSkovMadsen/awesome-pyscript@master/assets/pyscript/pyscript.js"></script>
<py-env>
- numpy
- matplotlib
</py-env>
</head>
<body>
<h1>Let's plot random numbers</h1>
<div id="plot" style="height:400px;width:100%;background:whitesmoke">...loading</div>
<!-- output="plot" id="script-id" output-mode="replace" -->
<py-script>
import matplotlib.pyplot as plt
import numpy as np
x = np.random.randn(1000)
y = np.random.randn(1000)
fig, ax = plt.subplots()
ax.scatter(x, y)
pyscript.write('plot', fig)
</py-script>
</body>
</html>
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Closed