From 30c088f5b426514b248559771c873eb21de750ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Melan=C3=A7on?= Date: Thu, 29 Jul 2021 06:26:18 -0400 Subject: [PATCH] Add a basic adapter for public Tableau visualizations --- src/Adapters/Tableau.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/Adapters/Tableau.php diff --git a/src/Adapters/Tableau.php b/src/Adapters/Tableau.php new file mode 100644 index 00000000..3d6fffee --- /dev/null +++ b/src/Adapters/Tableau.php @@ -0,0 +1,38 @@ +isValid() && $response->getUrl()->match([ + '*.public.tableau.com/views/*/*', + ]); + } + + /** + * {@inheritdoc} + */ + public function getCode() + { + $this->width = '100%'; + $this->height = '60vh'; + + // $this->url ends up not being the same one Tableau offers when you + // copy the share link. + $embed_url = $this->response->getStartingUrl() . '&:showVizHome=no&:embed=true'; + + return Utils::iframe($embed_url); + } +}