From 39a8ae90069f0e68faa6faa65139a9ca16bae3ac Mon Sep 17 00:00:00 2001 From: curio77 <> Date: Sun, 8 Mar 2020 17:54:42 +0100 Subject: [PATCH] Add config prop This way, a config object that might otherwise be passed to `Plotly.setPlotConfig()` or as the last argument to `Plotly.newPlot()`, can be passed to the `Plotly` Vue component. It is still possible to pass individial config props that get merged into the resulting config object, but using the new config prop allows for encapsulation of configuration as well as reuse and may help keep things tidier. --- src/components/Plotly.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/Plotly.vue b/src/components/Plotly.vue index ab9b337..3d9a6e5 100644 --- a/src/components/Plotly.vue +++ b/src/components/Plotly.vue @@ -22,6 +22,9 @@ export default { layout: { type: Object }, + config: { + type: Object + }, id: { type: String, required: false, @@ -69,6 +72,7 @@ export default { }, {}); return { responsive: false, + ...(this.config || {}), ...optionsFromAttrs }; }