bio-vis-expression-bar

0.9.1 • Public • Published

expression-bar

Build Status NPM version

Simple barchart to show expression levels across experiments

Getting Started

Install

Install the module with: npm install bio-vis-expression-bar or yarn add bio-vis-expression-bar

Integrate

HTML

<div class="wrapper" >

  <div  id="bar_expression_viewer"></div>    

</div>

Javascript

biovisexpressionbar = require("bio-vis-expression-bar");

var container_div="bar_expression_viewer";
var parentWidth = $("#bar_expression_viewer").parent().width();
var expressionBar =  new biovisexpressionbar.ExpressionBar({
  target: container_div,
  highlight: 'Traes_4AL_F9DCE24F4.1',
  data: [pass_the_data_in_json_format],
  renderProperty: 'tpm',    
  fontFamily:'Helvetica Neue, Helvetica, Arial, sans-serif',
  groupBy: ["High level stress-disease", "High level age","High level tissue","High level variety"],  
  height: avaHeight,    // *Important*: available height must be passed
  width: parentWidth    // Optional: passing the width available for charts
  plot:'Bar'    // Specifying the chart type (Bar | Heatmap | Ternary (Requires homologues))
}

Important resize function

This function needs to be provided in the javascript file to make the charts to be dynamic

// Resize function
var resizeTimer;
$(window).on('resize', function(e){
  clearTimeout(resizeTimer);  // Making sure that the reload doesn't happen if the window is resized within 1.5 seconds
  resizeTimer = setTimeout(function(){
    var avaHeight = [calculate_the_available_height_for_charts];
    expressionBar.resizeChart(avaHeight);
  }, 1500);
});

Demo

While developing

Run npm run watch or yarn run watch to keep watching for changes to javascipt while developing
Run npm run sniper or yarn run sniper in a different
Go to localhost:9090 in your browser
Navigate to snippets/ternary-plot ternminal

While not developing

Run npm run build-browser or yarn run build-browser to bundle the javascipt files
Run npm run sniper or yarn run sniper
Go to localhost:9090 in your browser
Navigate to snippets/ternary-plot

Contributing

Please submit all issues and pull requests to the homonecloco/biojs-vis-expression-bar repository!

Support

If you have any problem or suggestion please open an issue here.

License

The MIT License

Copyright (c) 2015, Ricardo H. Ramirez-Gonzalez

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package Sidebar

Install

npm i bio-vis-expression-bar

Weekly Downloads

10

Version

0.9.1

License

MIT

Unpacked Size

34.7 MB

Total Files

123

Last publish

Collaborators

  • homonecloco