ideaconsult / Toxtree.js

http://ideaconsult.github.io/Toxtree.js/
2 stars 3 forks source link

Option to select data from "datasets" into the working matrix #122

Closed vedina closed 9 years ago

vedina commented 9 years ago

Show data from the dataset storage (e.g. 'no substance data') in the matrix

vedina commented 9 years ago

implemented in ambit SVN r6653

note the new API option /substance?type=related&compound_udi=..&addDummySubstance=true http://ideaconsult.github.io/examples-ambit/apidocs/#!/substance_1

and in u-matrix.js

function onDetailedRow(row, data, event) {
  var el = $('.jtox-details-composition', row)[0];
  if (!el)
    return;
  var uri = this.settings.baseUrl + '/substance?type=related&addDummySubstance=true&compound_uri=' + encodeURIComponent(data.compound.URI);
  el = $(el).parents('table')[0];
  el = el.parentNode;
  $(el).empty();
  $(el).addClass('paddingless');
  var div = document.createElement('div');
  el.appendChild(div);
  new jToxSubstance(div, $.extend(true, {}, this.settings, {crossDomain: true, selectionHandler: null, substanceUri: uri, showControls: false, onLoaded: null, onDetails: function (root, data, element) {
    new jToxStudy(root, $.extend({}, this.settings, {substanceUri: data.URI}));
  } } ) );
}
function preDetailedRow(index, cell) {

  var self = this;
  var data = this.dataset.dataEntry[index];
  var uri = this.settings.baseUrl + '/substance?type=related&addDummySubstance=true&compound_uri=' + encodeURIComponent(data.compound.URI) + '&filterbybundle=' + encodeURIComponent(this.settings.bUri) + '&bundle_uri=' + encodeURIComponent(this.settings.bUri);
vedina commented 9 years ago

Please add &addDummySubstance=true for the query retrieving substances per compound

/substance?type=related&compound_uri='

Ideally, in the Endpoint data used / Search substance tab only

gonzomir commented 9 years ago

The query param is added to the query and also small tweak to show empty reference substance UUID instead of null.

vedina commented 9 years ago

Please also fix the display in case Substance UUID is null

vedina commented 9 years ago

Server side support for merging endpoint values coming from datasets r6711

ui-matrix.js should use /bundle/{id}/dataset?mergeDatasets=true or even better, introduce a checkbox (in the endpoints selection tab?) to control mergeDatasets=true|false