mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Charts: Connect data points with template url
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -98,6 +98,13 @@ return $.extend(true, {}, config_default, {
|
||||
value : 'wysiwyg'
|
||||
}
|
||||
]
|
||||
},
|
||||
url_template: {
|
||||
title : 'Url template',
|
||||
info : 'Enter a url to link the labels with external sources. Use __LABEL__ as placeholder.',
|
||||
type : 'text',
|
||||
init : '',
|
||||
placeholder : 'http://someurl.com?id=__LABEL__'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -206,6 +206,16 @@ return Backbone.View.extend({
|
||||
|
||||
// add tooltip events
|
||||
boxes.selectAll('rect')
|
||||
.on('dblclick', function(d) {
|
||||
d3.event.stopPropagation();
|
||||
var xLabel = self.categories.array.x[d.x];
|
||||
var yLabel = self.categories.array.y[d.y];
|
||||
var url = self.chart.settings.get('url_template').trim();
|
||||
if (url) {
|
||||
window.open(url.replace('__LABEL__', xLabel));
|
||||
window.open(url.replace('__LABEL__', yLabel));
|
||||
}
|
||||
})
|
||||
.on('mouseover', function(d) {
|
||||
self.tooltip.style('opacity', 0.9);
|
||||
self.tooltip .html(self._templateTooltip(d))
|
||||
|
||||
Reference in New Issue
Block a user