Skip to content

Commit

Permalink
Merge pull request #19206 from guerler/plotly
Browse files Browse the repository at this point in the history
Add plotly.js
  • Loading branch information
guerler authored Nov 27, 2024
2 parents 40388b4 + 0e97596 commit 4fd6535
Show file tree
Hide file tree
Showing 7 changed files with 415 additions and 1 deletion.
12 changes: 11 additions & 1 deletion client/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@ const STATIC_PLUGIN_BUILD_IDS = [
"tiffviewer",
"ts_visjs",
];
const INSTALL_PLUGIN_BUILD_IDS = ["cytoscape", "heatmap", "ngl", "msa", "openlayers", "phylocanvas", "venn", "vizarr"]; // todo: derive from XML
const INSTALL_PLUGIN_BUILD_IDS = [
"cytoscape",
"heatmap",
"ngl",
"msa",
"openlayers",
"phylocanvas",
"plotly",
"venn",
"vizarr",
]; // todo: derive from XML
const DIST_PLUGIN_BUILD_IDS = ["new_user"];
const PLUGIN_BUILD_IDS = Array.prototype.concat(DIST_PLUGIN_BUILD_IDS, STATIC_PLUGIN_BUILD_IDS);

Expand Down
99 changes: 99 additions & 0 deletions config/plugins/visualizations/plotly/config/plotly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE visualization SYSTEM "../../visualization.dtd">
<visualization name="Bar, Line and Scatter (plotly.js)">
<description>Basic Diagrams from Plotly Graphing Library.</description>
<data_sources>
<data_source>
<model_class>HistoryDatasetAssociation</model_class>
<test type="isinstance" test_attr="datatype" result_type="datatype">tabular.Tabular</test>
<test type="isinstance" test_attr="datatype" result_type="datatype">tabular.CSV</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>
<requirements>
<requirement type="npm" version="0.0.0" package="@galaxyproject/plotly"/>
</requirements>
<entry_point entry_point_type="script" src="dist/index.js" css="dist/index.css" />
<settings>
<input>
<name>stack_bar</name>
<label>Stack Bars</label>
<help>Would you like to stack bars?</help>
<type>boolean</type>
<value>false</value>
</input>
<input>
<name>stack_lines</name>
<label>Stack Lines</label>
<help>Would you like to stack lines and fill the area under the curve?</help>
<type>boolean</type>
<value>false</value>
</input>
<input>
<name>x_axis_label</name>
<label>X-Axis label</label>
<help>Provide a label for the axis.</help>
<type>text</type>
<value>X-axis</value>
<placeholder>Axis label</placeholder>
</input>
<input>
<name>y_axis_label</name>
<label>Y-Axis label</label>
<help>Provide a label for the axis.</help>
<type>text</type>
<value>Y-axis</value>
<placeholder>Axis label</placeholder>
</input>
</settings>
<tracks>
<input>
<label>Pick a series color</label>
<name>color</name>
<type>color</type>
</input>
<input>
<name>type</name>
<label>Select type</label>
<type>select</type>
<value>bar</value>
<help>Choose the chart type.</help>
<data>
<data>
<label>Bar</label>
<value>bar</value>
</data>
<data>
<label>Lines</label>
<value>lines</value>
</data>
<data>
<label>Scatter</label>
<value>scatter</value>
</data>
</data>
</input>
<input>
<label>Provide a label</label>
<name>name</name>
<type>text</type>
<placeholder>Data label</placeholder>
<value>Data label</value>
</input>
<input>
<name>x</name>
<label>Column of x-axis values</label>
<type>data_column</type>
<is_auto>true</is_auto>
</input>
<input>
<name>y</name>
<label>Column of y-axis values</label>
<type>data_column</type>
<is_number>true</is_number>
</input>
</tracks>
</visualization>
63 changes: 63 additions & 0 deletions config/plugins/visualizations/plotly/static/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions config/plugins/visualizations/plotly_box/config/plotly_box.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE visualization SYSTEM "../../visualization.dtd">
<visualization name="Box Plot (plotly.js)">
<description>Box Plot from Plotly Graphing Library.</description>
<data_sources>
<data_source>
<model_class>HistoryDatasetAssociation</model_class>
<test type="isinstance" test_attr="datatype" result_type="datatype">tabular.Tabular</test>
<test type="isinstance" test_attr="datatype" result_type="datatype">tabular.CSV</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="../../plotly/static/dist/index.js" css="../../plotly/static/dist/index.css" />
<specs>
<variant>box</variant>
</specs>
<settings>
<input>
<name>x_axis_label</name>
<label>X-Axis label</label>
<help>Provide a label for the axis.</help>
<type>text</type>
<value>X-axis</value>
<placeholder>Axis label</placeholder>
</input>
<input>
<name>y_axis_label</name>
<label>Y-Axis label</label>
<help>Provide a label for the axis.</help>
<type>text</type>
<value>Y-axis</value>
<placeholder>Axis label</placeholder>
</input>
</settings>
<tracks>
<input>
<label>Pick a series color</label>
<name>color</name>
<type>color</type>
</input>
<input>
<label>Provide a label</label>
<name>name</name>
<type>text</type>
<placeholder>Data label</placeholder>
<value>Data label</value>
</input>
<input>
<name>y</name>
<label>Column of y-axis values</label>
<type>data_column</type>
<is_number>true</is_number>
</input>
</tracks>
</visualization>
63 changes: 63 additions & 0 deletions config/plugins/visualizations/plotly_box/static/logo.svg
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,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE visualization SYSTEM "../../visualization.dtd">
<visualization name="Histogram (plotly.js)">
<description>Histogram from Plotly Graphing Library.</description>
<data_sources>
<data_source>
<model_class>HistoryDatasetAssociation</model_class>
<test type="isinstance" test_attr="datatype" result_type="datatype">tabular.Tabular</test>
<test type="isinstance" test_attr="datatype" result_type="datatype">tabular.CSV</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="../../plotly/static/dist/index.js" css="../../plotly/static/dist/index.css" />
<specs>
<variant>histogram</variant>
</specs>
<settings>
<input>
<name>x_axis_label</name>
<label>X-Axis label</label>
<help>Provide a label for the axis.</help>
<type>text</type>
<value>X-axis</value>
<placeholder>Axis label</placeholder>
</input>
<input>
<name>y_axis_label</name>
<label>Y-Axis label</label>
<help>Provide a label for the axis.</help>
<type>text</type>
<value>Y-axis</value>
<placeholder>Axis label</placeholder>
</input>
</settings>
<tracks>
<input>
<label>Pick a series color</label>
<name>color</name>
<type>color</type>
</input>
<input>
<label>Provide a label</label>
<name>name</name>
<type>text</type>
<placeholder>Data label</placeholder>
<value>Data label</value>
</input>
<input>
<name>x</name>
<label>Column of x-axis values</label>
<type>data_column</type>
<is_number>true</is_number>
</input>
</tracks>
</visualization>
Loading

0 comments on commit 4fd6535

Please sign in to comment.