Skip to content

Commit

Permalink
Add optional specifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Feb 11, 2018
1 parent 1c30571 commit fd9ac30
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
9 changes: 9 additions & 0 deletions config/plugins/visualizations/nvd3bar/config/nvd3bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
<param type="dataset" var_name_in_template="hda" required="true">dataset_id</param>
</params>
<entry_point entry_point_type="chart" src="static/nvd3bar.js"></entry_point>
<specs>
<tag>svg</tag>
<use_panels>both</use_panels>
<exports>
<exports>png</exports>
<exports>svg</exports>
<exports>pdf</exports>
</exports>
</specs>
<groups>
<color>
<label>Pick a series color</label>
Expand Down
9 changes: 7 additions & 2 deletions lib/galaxy/visualization/plugins/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,17 @@ def parse_visualization(self, xml_tree):
returned['render_target'] = 'galaxy_main'
# consider unifying the above into its own element and parsing method

# load data group specifiers
# load optional custom configuration specifiers
specs_section = xml_tree.find('specs')
if specs_section:
returned['specs'] = DictParser(specs_section)

# load group specifiers
groups_section = xml_tree.find('groups')
if groups_section:
returned['groups'] = ListParser(groups_section)

# load data settings specifiers
# load settings specifiers
settings_section = xml_tree.find('settings')
if settings_section:
returned['settings'] = ListParser(settings_section)
Expand Down
5 changes: 3 additions & 2 deletions lib/galaxy/visualization/plugins/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ def to_dict(self):
'target' : self.config.get('render_target', 'galaxy_main'),
'embeddable' : self.config.get('embeddable', False),
'entry_point' : self.config.get('entry_point'),
'static_url' : '/'.join(['plugins', self.static_url]),
'settings' : self.config.get('settings'),
'groups' : self.config.get('groups')
'groups' : self.config.get('groups'),
'specs' : self.config.get('specs'),
'static_url' : '/'.join(['plugins', self.static_url])
}

def _get_saved_visualization_config(self, visualization, revision=None, **kwargs):
Expand Down

0 comments on commit fd9ac30

Please sign in to comment.