Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • a78cb8f
  • /
  • www
  • /
  • jvenn.js
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge
swh:1:cnt:3b892d2f59f85b66cb607e8ba3759bc7a5abcef8
directory badge
swh:1:dir:ec8f64eddac0275a2d374d52f654ab5a7b2d3024

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
jvenn.js
/***************************************************************
*  Copyright notice
*
*  (c) 2014 PF bioinformatique de Toulouse
*  All rights reserved
*
*
*  This script is an adaptation of the venny script developed by
*  Juan Carlos Oliveros, BioinfoGP, CNB-CSIC:
*  Oliveros, J.C. (2007) VENNY. An interactive tool for comparing
*  lists with Venn Diagrams.
*  http://bioinfogp.cnb.csic.es/tools/venny/index.html.
*  It is distributed under the terms of the GNU General Public
*  License as published by the Free Software Foundation; either
*  version 2 of the License, or (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

/***************************************************************
*
* Adapted to Shiny by Franck Soubès.
*
****************************************************************/

$(document).ready(function () {


      //$( "#jvenn-container-label1" ).draggable();
      //$('#jvenn-container-label1').addClass('draggable');
			var colorDefault = ["#FFA500", "#FFA500", "#FFA500", "#FFA500", "#FFA500", "#FFA500"],
				displayMode  = "classic",
				displayStat  = true,
				displaySwitch= true,
				shortNumber  = true,
				fontSize     = "12px",
				fontFamily   = "Arial",
        uploadSeries = new Array();



  function updateJvenn() {
    Shiny.addCustomMessageHandler("updatejvenn", function(Rjson) {
	    let seriesTable = Rjson; //jsonData;
      Shiny.addCustomMessageHandler("updatejcol", function(coljvenn) {

        let arraylen = (coljvenn.length/3);
        let R2jspal =new Array(arraylen);
        let mypalette = new Array(Math.ceil(coljvenn.length / 3)).fill("").map(function() { return this.splice(0, 3) }, coljvenn.slice());

        for (let i = 0 ; i< arraylen ; i++ ){
          R2jspal[i] = "rgb(".concat(mypalette[i]).concat(")");
        }

			  $("#jvenn-container").jvenn({
			  series: seriesTable,
			  colors : R2jspal,
			  fontSize:   fontSize,
			  fontFamily: fontFamily,
			  searchInput:  $("#search-field"),
			  searchStatus: $("#search-status"),
			  displayMode: displayMode,
			  displayStat: displayStat,
				displaySwitch:displaySwitch,

			  fnClickCallback: function() {
			    let value = "";
				  nameslis = [];
				  if (this.listnames.length == 1) {
				    value += "Elements only in ";
				  }
				  else {
					  value += "Common elements in ";
			    }
				  for (let name in this.listnames) {
				    nameslis.push(this.listnames[name]);
				  }
				  value += ":\n";
				  jvennlist =[];
				  for (let val in this.list) {
				    jvennlist.push( this.list[val]);
				  }
					console.log(jvennlist);
				  $("#names").val(value);
          Shiny.onInputChange("jvennlist",jvennlist);// renvoyer dans R
				  Shiny.onInputChange("together",nameslis.join(""));// renvoyer dans R
				  Shiny.onInputChange("selcontjv",nameslis);
				  return(jvennlist);
	        }
			  });
		  });

	  });
  }


      //$('.draggable').addClass('draggable');
      //$('.draggable').draggable();


      //$('#jvenn-container').addClass('parent');
      //$('.children').draggable({ containment: "parent" });

      //$('.children1').addClass('draggable');
      //$('.children1').draggable();

      //$("#jvenn-container" ).draggable();
      //$('#jvenn-container').addClass('draggable');

      //$("div#jvenn-container .test").addClass('draggable');
      //$("div#jvenn-container .test").draggable();

			$('.btn-group button').on('click', function(){
    	$(this).siblings().removeClass('active');
    	$(this).addClass('active');
			});


			$('[id^="clear"]').click(function() {
				let index = $(this).attr("id").split("_")[1];
				$("#area" + index).val("");
				$("#name" + index).val("List " + index);
				updateJvenn();
			});

			// update the view when any fields change
			$("[id^=name]").change(function() {
				updateJvenn();
			});
			$("[id^=area]").change(function() {
				updateJvenn();
			});

			$("#venn-type").change(function() {
				updateJvenn();
			});

				$("#ds_yes").click(function() {
				displayStat = true;
				Shiny.onInputChange("mystat",displayStat);
			});
			$("#ds_no").click(function() {
				displayStat = false;
				Shiny.onInputChange("mystat",displayStat);
			});

			$("#dsw_yes").click(function() {
				displaySwitch = true;
				Shiny.onInputChange("dispswitch",displaySwitch);
			});
			$("#dsw_no").click(function() {
				displaySwitch = false;
				Shiny.onInputChange("dispswitch",displaySwitch);
			});

			$("#dm_classic").click(function() {
				displayMode = "classic";
        Shiny.onInputChange("updamod",displayMode);
			});


			$("#dm_edwards").click(function() {
				displayMode = "edwards";
				Shiny.onInputChange("updamod",displayMode);
			});

			$('[id^="ff"]').click(function() {
				fontFamily = $(this).html();
				updateJvenn();
			});

			$('[id^="fs"]').click(function() {
				fontSize = $(this).html();
				Shiny.onInputChange("myfont",fontSize);
			});


			updateJvenn();

});

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API