Hi,
This works and displays an empty plot + slider:
How to display a slider only and no plot ?
Motivation: I have a few different div
with some plots, but in one of the div
s, I need a block with just sliders.
ready-to-run code:
<script src="https://cdn.plot.ly/plotly-2.16.2.min.js"></script>
<style type="text/css">
#myDiv { background-color: yellow; touch-action: none; }
.js-plotly-plot .plotly .modebar{left: 5%}
* { touch-action: none; }
</style>
<div id="myDiv"></div>
<script>
var steps = [];
for (var i = 0; i < 100; i++) {
steps.push({
label: i,
method: "restyle",
args: ["line.color", "red"],
});
}
Plotly.newPlot(
"myDiv",
[],
{
sliders: [
{
pad: { t: 5 },
len: 1,
x: 0,
currentvalue: {
xanchor: "right",
prefix: "color: ",
font: {
color: "#888",
size: 20,
},
},
steps: steps,
},
],
},
{
modeBarButtonsToRemove: ["toImage", "lasso2d"],
displaylogo: false,
displayModeBar: true,
}
);
</script>