mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Visualizations framework: allow for saving and loading registry visualizations, allow better merging of kwargs, config, saved config, add config utilities to common/templates; Scatterplot: allow saving as visualization, more mvc-based, increase max zoom, refactor and cleanup; Charts, Scatterplot: remove visualization data_source
This commit is contained in:
@@ -1,18 +1,8 @@
|
||||
<%
|
||||
hda_dict = trans.security.encode_dict_ids( hda.to_dict() )
|
||||
|
||||
config = query_args
|
||||
title = "Scatterplot of '" + hda.name + "'"
|
||||
info = hda.info
|
||||
|
||||
visualization = context.get( 'visualization' )
|
||||
if visualization is not None:
|
||||
config = visualization.latest_revision.config
|
||||
config.update( query_args )
|
||||
title = visualization.title
|
||||
info = config.get( 'description', info )
|
||||
|
||||
config[ 'type' ] = 'scatterplot'
|
||||
default_title = "Scatterplot of '" + hda.name + "'"
|
||||
info = hda.name
|
||||
if hda.info:
|
||||
info += ' : ' + hda.info
|
||||
|
||||
# optionally bootstrap data from dprov
|
||||
##data = list( hda.datatype.dataset_column_dataprovider( hda, limit=10000 ) )
|
||||
@@ -23,7 +13,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>${hda.name} | ${visualization_name}</title>
|
||||
<title>${title or default_title} | ${visualization_display_name}</title>
|
||||
|
||||
## ----------------------------------------------------------------------------
|
||||
<link type="text/css" rel="Stylesheet" media="screen" href="/static/style/base.css">
|
||||
@@ -52,23 +42,29 @@
|
||||
%if not embedded:
|
||||
## dataset info: only show if on own page
|
||||
<div class="chart-header">
|
||||
<h2>${title}</h2>
|
||||
<h2>${title or default_title}</h2>
|
||||
<p>${info}</p>
|
||||
</div>
|
||||
|
||||
<div class="scatterplot-editor"></div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
var model = new ScatterplotModel( ${h.to_json_string( config )} ),
|
||||
hdaJson = ${h.to_json_string( hda_dict )},
|
||||
var model = new ScatterplotModel({
|
||||
id : ${h.to_json_string( visualization_id )} || undefined,
|
||||
title : "${title or default_title}",
|
||||
config : ${h.to_json_string( config, indent=2 )}
|
||||
}),
|
||||
hdaJson = ${h.to_json_string( trans.security.encode_dict_ids( hda.to_dict() ), indent=2 )},
|
||||
editor = new ScatterplotConfigEditor({
|
||||
el : $( '.scatterplot-editor' ).attr( 'id', 'scatterplot-editor-hda-' + hdaJson.id ),
|
||||
model : model,
|
||||
dataset : hdaJson
|
||||
}).render();
|
||||
window.editor = editor;
|
||||
// uncomment to auto render for development
|
||||
//$( '.render-button:visible' ).click();
|
||||
|
||||
model.on( 'change:title', function(){
|
||||
$( '.chart-header h2' ).text( model.get( 'title' ) );
|
||||
})
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user