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

Revision 0e8041afdfe0c717ae4e44119897038db7297eeb authored by Juliane Müller on 07 October 2020, 15:11:18 UTC, committed by GitHub on 07 October 2020, 15:11:18 UTC
Create README.md
1 parent 126bc27
  • Files
  • Changes
  • e9eb27c
  • /
  • templates
  • /
  • view
  • /
  • view_autocomplete_form.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.

  • revision
  • directory
  • content
revision badge
swh:1:rev:0e8041afdfe0c717ae4e44119897038db7297eeb
directory badge
swh:1:dir:033038e60894f76e0c7a9d49ad505b8121f41ed2
content badge
swh:1:cnt:062ea35faca9e84af743b286fbf8ab97d77f2896

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.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
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_autocomplete_form.js
function initialize_autocomplete(parent_div, autocomplete_options, select_multiple, functionality) {

    if (select_multiple) {
        let single_multi_select_class = "multi-select";

        parent_div
            .append('span')
            .attr('class', single_multi_select_class)
            .style('height', 20 + 'px');

        autocomplete_options = autocomplete_options.sort((a, b) => a.label < b.label ? -1 : 1);

        var multiple = new SelectPure(parent_div.select('.' + single_multi_select_class).node(), {
            options: autocomplete_options,
            multiple: select_multiple,
            autocomplete: true,
            value: [],
            icon: "fa fa-times",
            onChange: value => {

                //console.log(value);
            },
        });

    } else {
        let single_multi_select_class = "single-select";

        parent_div
            .append('span')
            .attr('class', single_multi_select_class)
            .style('height', 20 + 'px');

        autocomplete_options = autocomplete_options.sort((a, b) => a.label < b.label ? -1 : 1);

        for (let i = 0; i < autocomplete_options.length; i++) {
            let name = autocomplete_options[i].label;
            if (name.length > 22) {
                autocomplete_options[i].label = name.substring(0, 22) + "...";
            }
        }
        var single = new SelectPure(parent_div.select('.' + single_multi_select_class).node(), {
            options: autocomplete_options,
            multiple: select_multiple,
            autocomplete: true,
            onChange: value => {

                if (functionality === language_id_sort_by) {

                    sort_parallel_coordinates_by = value;

                    // remove duplicates from grouped columns
                    column_values_grouped = column_values_grouped.filter(x => !x.id.includes(id_duplicate_dimensions));//map(col => col[key_id]).search(id_duplicate_dimensions);
                    d3.selectAll('.' + id_drillup_dimension).attr('visibility', 'hidden');
                    d3.selectAll('.' + id_drilldown_dimension).attr('visibility', 'visible');

                    d3.selectAll('.' + id_shrink_dimensions).attr('visibility', 'hidden');
                    d3.selectAll('.' + id_expand_dimension).attr('visibility', 'visible');


                    // shrink expansion again :)
                    d3.selectAll('.' + id_class_dimension_expanded).each(function () {

                        let current_dimension = column_values_cleaned.filter(x => x.id === this.id)[0];

                        current_dimension.contributing_variables.forEach(function (contri) {
                            column_values_grouped.splice(column_values_grouped.map(col => col[key_id]).indexOf(contri.column_id), 1);
                        });

                        column_values_grouped.splice(0, 0, column_values_filtered.filter(x => x[key_id] === current_dimension.id)[0]);

                        d3.select('#' + current_dimension.id)
                            .remove();

                        Object.keys(y_scale_pcp_new).forEach(function (key) {
                            y_scale_pcp_new[key].scale.range([pcp_new_height, 0]);
                        });
                    });


                    // sort by applied filters to have them at first
                    column_values_filtered.sort((a, b) => a.descriptive_statistics[sort_parallel_coordinates_by] < b.descriptive_statistics[sort_parallel_coordinates_by] ? 1 : -1);
                    column_values_grouped.sort((a, b) => a.descriptive_statistics[sort_parallel_coordinates_by] < b.descriptive_statistics[sort_parallel_coordinates_by] ? 1 : -1);


                    allow_dragging.forEach(function (d) {
                        d.draggable = true;
                    });

                    selectedIndex = 0;
                    rotateCarousel(true);

                } else if (functionality === language_id_search) {
                    highlight_dimension(value);
                    highlight_circles(value);

                    parent_div.select('.select-pure__label').text(get_language_label_by_id(language_id_search));
                }
            },
        });

        if (functionality === language_id_search) {
            parent_div.select('.select-pure__label').text(get_language_label_by_id(language_id_search));
        }
    }
}

function update_search_for_dimensions(parent_div, autocomplete_options, select_multiple, functionality) {

    parent_div.selectAll('*').remove();

    let single_multi_select_class = "single-select";

    parent_div
        .append('span')
        .attr('class', single_multi_select_class)
        .style('height', 20 + 'px');

    autocomplete_options = autocomplete_options.sort((a, b) => a.label < b.label ? -1 : 1);

    for (let i = 0; i < autocomplete_options.length; i++) {
        let name = autocomplete_options[i].label;
        if (name.length > 22) {
            autocomplete_options[i].label = name.substring(0, 22) + "...";
        }
    }
    var single = new SelectPure(parent_div.select('.' + single_multi_select_class).node(), {
        options: autocomplete_options,
        multiple: select_multiple,
        autocomplete: true,
        onChange: value => {

            highlight_dimension(value);
            highlight_circles(value);
            parent_div.select('.select-pure__label').text(get_language_label_by_id(language_id_search));
        },
    });

    if (functionality === language_id_search) {
        parent_div.select('.select-pure__label').text(get_language_label_by_id(language_id_search));
    }
}
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2025, 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