Skip to content

Commit

Permalink
Merge pull request #19003 from esg-epfl-apc/fits-graph-visualization-…
Browse files Browse the repository at this point in the history
…plugin-pr

FITS file table graph visualization plugin
  • Loading branch information
dannon authored Nov 19, 2024
2 parents 73f29a3 + 102b923 commit b635c7f
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const STATIC_PLUGIN_BUILD_IDS = [
"drawrna",
"editor",
"example",
"fits_graph_viewer",
"fits_image_viewer",
"h5web",
"heatmap/heatmap_default",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE visualization SYSTEM "../../visualization.dtd">
<visualization name="FITS Graph viewer" embeddable="false">
<description>Basic plugin for fits file table visualization</description>
<data_sources>
<data_source>
<model_class>HistoryDatasetAssociation</model_class>
<test type="isinstance" test_attr="datatype" result_type="datatype">binary.FITS</test>
<to_param param_attr="id">dataset_id</to_param>
</data_source>
</data_sources>
<params>
<param type="dataset" var_name_in_template="hda" required="true">dataset_id</param>
</params>
<entry_point entry_point_type="script" src="fits_graph_viewer.js"/>
</visualization>
21 changes: 21 additions & 0 deletions config/plugins/visualizations/fits_graph_viewer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "fits-graph-visualization",
"version": "1.0.0",
"keywords": [
"galaxy",
"visualization"
],
"main": "index.js",
"license": "AFL-3.0",
"dependencies": {
"astrovisjs": "0.9.92",
"webpack": "^5.94.0"
},
"devDependencies": {
"webpack-cli": "^5.1.4"
},
"scripts": {
"build": "npx webpack build --config webpack.prod.js --output-path=./static"
}
}

13 changes: 13 additions & 0 deletions config/plugins/visualizations/fits_graph_viewer/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {init} from 'astrovisjs/dist/astrovis/astrovis';

document.addEventListener('DOMContentLoaded', () => {

const {root, visualization_config} = JSON.parse(
document.getElementById("app")
.getAttribute("data-incoming") || "{}");

const dataset_id = visualization_config.dataset_id;
const file_url = root + "datasets/" + dataset_id + "/display"

init('app', file_url);
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const path = require('path');

module.exports = {
mode: 'production',
entry: './src/index.js',
output: {
filename: 'fits_graph_viewer.js'
},
};

0 comments on commit b635c7f

Please sign in to comment.