diff --git a/config/plugins/visualizations/tiffviewer/config/tiffviewer.xml b/config/plugins/visualizations/tiffviewer/config/tiffviewer.xml index 99763daa554f..84d14366f62c 100644 --- a/config/plugins/visualizations/tiffviewer/config/tiffviewer.xml +++ b/config/plugins/visualizations/tiffviewer/config/tiffviewer.xml @@ -1,18 +1,16 @@ - Basic Tiff Image visualization + Tiff Image Viewer HistoryDatasetAssociation - images.Tiff - dataset_id dataset_id - + \ No newline at end of file diff --git a/config/plugins/visualizations/tiffviewer/src/script.js b/config/plugins/visualizations/tiffviewer/src/script.js index a16a82253d1a..f97bf19d255a 100644 --- a/config/plugins/visualizations/tiffviewer/src/script.js +++ b/config/plugins/visualizations/tiffviewer/src/script.js @@ -8,22 +8,15 @@ const App = (props) => { return ; }; -/* This will be part of the charts/viz standard lib in 23.1 */ -const slashCleanup = /(\/)+/g; -function prefixedDownloadUrl(root, path) { - return `${root}/${path}`.replace(slashCleanup, "/"); -} +const { root, visualization_config } = JSON.parse(document.getElementById("app").dataset.incoming); -window.bundleEntries = window.bundleEntries || {}; -window.bundleEntries.load = function (options) { - const dataset = options.dataset; - const url = prefixedDownloadUrl(options.root, dataset.download_url); - const root = createRoot(document.getElementById(options.target)); - root.render( - - - - ); - options.chart.state("ok", "Done."); - options.process.resolve(); -}; +const datasetId = visualization_config.dataset_id; + +const url = window.location.origin + root + "api/datasets/" + datasetId + "/display"; + +const rootElement = createRoot(document.getElementById("app")); +rootElement.render( + + + +);