Plotly graph configuration

This commit is contained in:
Magnus Åhall 2024-06-27 19:07:35 +02:00
parent ff402b8fcb
commit 0494d553d0

View File

@ -17,6 +17,7 @@ class Graph {
const values = [{
x: this.dataset.xValues(),
y: this.dataset.yValues(),
mode: 'scatter',
}]
this.layout = {
@ -26,7 +27,11 @@ class Graph {
},
}
Plotly.react(this.graphValues, values, this.layout);
this.config = {
displayModeBar: true,
}
Plotly.react(this.graphValues, values, this.layout, this.config);
this.graphValues.on('plotly_relayout', attr => this.relayoutHandler(attr))
}
@ -39,6 +44,7 @@ class Graph {
const values = [{
x: this.dataset.xValues(),
y: this.dataset.yValues(),
mode: 'scatter',
}]
Plotly.react(this.graphValues, values, this.layout)
})