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

  • cce21f8
  • /
  • templates
  • /
  • view
  • /
  • view_tooltip.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:3d01610ed601d9e0a212ef062cf804f24092c746
directory badge
swh:1:dir:033038e60894f76e0c7a9d49ad505b8121f41ed2

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 ...
view_tooltip.js

function append_tooltip_radar_chart_and_heading(parent_div_id, col, deviation) {

    let min_width = 300;

    // get the computed width of text
    if (BrowserText.getWidth(col[key_header], 11) + 30 > min_width) {
        //min_width = BrowserText.getWidth(col[key_header], 11) + 30;
    }

    let tippy_div;
    let tippy_div_width = Math.floor(min_width);

    if (d3.select('#' + col[key_id] + id_tooltip_div_ending).empty()) {
        tippy_div = d3.select('#' + parent_div_id).append('div')
            .attr('id', col[key_id] + id_tooltip_div_ending)
            .style('width', tippy_div_width + 'px')
            .style('height', 280 + 'px')
            .style('float', 'left')
            .style('display', 'block')
            .style('display', 'none');
    } else {
        tippy_div = d3.select('#' + col[key_id] + id_tooltip_div_ending);
        tippy_div.selectAll('*').remove();
    }

    tippy_div.style('width', tippy_div_width + 'px');


    let radar_chart_div = tippy_div.append('div')
        .attr('id', col[key_id]  + id_radarChartDiv_class)
        .style('height', 280 - 20 +'px')
        .style('width', tippy_div_width+'px');


    append_radar_chart_tooltip(radar_chart_div, col[key_data_type], col, deviation);


    tippy_div.append('div')
        .style('width', tippy_div_width + 'px')
        .style('height', 20 + 'px')
        .append('svg')
        .style('width', '100%')
        .style('height', '100%')
        .append('text')
        .text(function () {
            if (col[key_header].length > 52) {
                return col[key_header].substring(0, 52) + "...";
            } else return col[key_header];
        })
        .attr('fill', 'white')
        .attr('font-size', '0.8em')
        .attr('font-weight', 500)
        .attr('text-anchor', 'middle')
        .attr('transform', 'translate(' + tippy_div_width / 2 + ',' + 33 / 2 + ')');

    return tippy_div.node().innerHTML;
}



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