<commit_before>var   foaf = document.getElementById('foaf')
    , muto = document.getElementById('muto')
    , personasonto = document.getElementById('personasonto')
    , benchmarkonto = document.getElementById('benchmarkonto')
    , graphTag = document.getElementById('graph')
    , exportSvg = document.getElementById('exportSvg')
    , linkDistanceClassSlider
    , linkDistanceClassLabel
    , linkDistanceLiteralSlider
    , linkDistanceLiteralLabel
    , jsonURI = "foaf"
    , onLoadCalled = false;

var bindListners = function() {
    foaf.addEventListener('click', function () {
        refreshOntology("foaf");
    });
    muto.addEventListener('click', function () {
        refreshOntology("muto");
    });
    personasonto.addEventListener('click', function () {
        refreshOntology("persona");
    });
    benchmarkonto.addEventListener('click', function () {
        refreshOntology("benchmark");
    });
    exportSvg.addEventListener('click', function () { 
        exportSVGDrawing();
    });
}
// adding styles inline to the svg elements
var loadGraphStyle = function () { 
  
  d3.selectAll(".text")
    .style("font-size", "12px")
    .style("font-family", "Helvetica, Arial, sans-serif")
    .style("pointer-events", "none");
 
  d3.selectAll(".embedded")
    .style("pointer-events", "none");

  d3.selectAll(".subtext")
    .style("font-size", "9px");

  d3.selectAll(".cardinality")
    .style("font-size", "10px");

  d3.selectAll(".class")
    .style("stroke", "#000")
    .style("stroke-width", "2")
    .style("fill", "#acf");

  d3.selectAll("path")
    .style("stroke", "#000")
    .style("stroke-width", "2")
    .style("fill", "none");

  d3.selectAll(".nofill")
    .style("fill", "none");

  d3.selectAll(".nostroke")
    .style("stroke", "none");

  d3.selectAll(".special")
    .style("stroke-dasharray", "8");    

  d3.selectAll(".dotted")
    .style("stroke-dasharray", "3"); 

  d3.selectAll(".fineline")
    .style("stroke","#000")  
    .style("stroke-width", "1");

  d3.selectAll(".object, .disjoint")
    .style("fill", "#acf");

  d3.selectAll(".rdf")
    .style("fill", "#c9c");

  d3.selectAll(".external")
    .style("fill", "#36c");

  d3.selectAll(".deprecated")
    .style("fill", "#ccc");

  d3.selectAll(".label .datatype")
    .style("fill", "#9c6");

  d3.selectAll(".literal, .node .datatype")
    .style("fill", "#fc3");

  d3.selectAll(".symbol")
    .style("fill", "#69c"); 

  d3.selectAll(".arrowhead, marker path")
    .style("fill", "#000");

  d3.selectAll("marker path")
    .style("stroke-dasharray", "50");

  d3.selectAll(".white, .dottedMarker path")
    .style("fill", "#fff");

  d3.selectAll(".svgGraph .text tspan:only-child, .svgGraph .text:empty")
    .style("dominant-baseline", "central");

  d3.selectAll(".subclass")
    .style("fill", "#ecf0f1");        

  d3.selectAll(".focused")
    .style("stroke", "#f00");

  d3.selectAll("rect.focused, circle.focused")
    .style("stroke-width", "4px");

  d3.selectAll(".cardinality.focused, marker path.focused")
    .style("fill","#f00");
};
var removeStyles = function () { 
    d3.selectAll(".class, .text, .embedded, .subtext, .cardinality, path, .nofill, .nostroke, .special, .dotted, .fineline, .object, .rdf, .external, .deprecated, .label .datatype, .literal, .node .datatype, .symbol, .arrowhead, marker path, .white, .dottedMarker path, .svgGraph .text tspan:only-child, .svgGraph .text:empty, .subclass, .focused, . disjoint")
        .attr("style", null);
};

var exportSVGDrawing = function exportSVGDrawingFunct () {
    // Get the d3js SVG element
    var   graph = document.getElementById('graph')
        , svg = graph.getElementsByTagName('svg')[0]
        , svgsrc
        , svgXML;

    loadGraphStyle(); //load the graphic styles

    svgsrc = d3.select(svg)
        .attr("version", 1.1)
        .attr("xmlns", "http://www.w3.org/2000/svg")
        .node().parentNode.innerHTML;

    //btoa(); Creates a base-64 encoded ASCII string from a "string" of binary data.
    svgXML = 'data:image/svg+xml;base64,'+ btoa(svgsrc);
   
    d3.select(exportSvg)
        .attr("href", svgXML)
        .attr("download", jsonURI+".svg");

    removeStyles(); // remove graphic styles for interaction to go back to normal
};

var graphOptions = function graphOptionsFunct() {<commit_msg>small export issue<commit_after>var   foaf = document.getElementById('foaf')
    , muto = document.getElementById('muto')
    , personasonto = document.getElementById('personasonto')
    , benchmarkonto = document.getElementById('benchmarkonto')
    , graphTag = document.getElementById('graph')
    , exportSvg = document.getElementById('exportSvg')
    , linkDistanceClassSlider
    , linkDistanceClassLabel
    , linkDistanceLiteralSlider
    , linkDistanceLiteralLabel
    , jsonURI = "foaf"
    , onLoadCalled = false;

var bindListners = function() {
    foaf.addEventListener('click', function () {
        refreshOntology("foaf");
    });
    muto.addEventListener('click', function () {
        refreshOntology("muto");
    });
    personasonto.addEventListener('click', function () {
        refreshOntology("persona");
    });
    benchmarkonto.addEventListener('click', function () {
        refreshOntology("benchmark");
    });
    exportSvg.addEventListener('click', function () { 
        exportSVGDrawing();
    });
}
// adding styles inline to the svg elements
var loadGraphStyle = function () { 
  
  d3.selectAll(".text")
    .style("font-size", "12px")
    .style("font-family", "Helvetica, Arial, sans-serif")
    .style("pointer-events", "none");
 
  d3.selectAll(".embedded")
    .style("pointer-events", "none");

  d3.selectAll(".subtext")
    .style("font-size", "9px");

  d3.selectAll(".cardinality")
    .style("font-size", "10px");

  d3.selectAll(".class")
    .style("stroke", "#000")
    .style("stroke-width", "2")
    .style("fill", "#acf");

  d3.selectAll("path")
    .style("stroke", "#000")
    .style("stroke-width", "2")
    .style("fill", "none");

  d3.selectAll(".nofill")
    .style("fill", "none");

  d3.selectAll(".nostroke")
    .style("stroke", "none");

  d3.selectAll(".special")
    .style("stroke-dasharray", "8");    

  d3.selectAll(".dotted")
    .style("stroke-dasharray", "3"); 

  d3.selectAll(".fineline")
    .style("stroke","#000")  
    .style("stroke-width", "1");

  d3.selectAll(".object, .disjoint")
    .style("fill", "#acf");

  d3.selectAll(".rdf")
    .style("fill", "#c9c");

  d3.selectAll(".external")
    .style("fill", "#36c");

  d3.selectAll(".deprecated")
    .style("fill", "#ccc");

  d3.selectAll(".label .datatype")
    .style("fill", "#9c6");

  d3.selectAll(".literal, .node .datatype")
    .style("fill", "#fc3");

  d3.selectAll(".symbol")
    .style("fill", "#69c"); 

  d3.selectAll(".arrowhead, marker path")
    .style("fill", "#000");

  d3.selectAll("marker path")
    .style("stroke-dasharray", "50");

  d3.selectAll(".white, .dottedMarker path")
    .style("fill", "#fff");

  d3.selectAll(".svgGraph .text tspan:only-child, .svgGraph .text:empty")
    .style("dominant-baseline", "central");

  d3.selectAll(".subclass")
    .style("fill", "#ecf0f1");        

  d3.selectAll("rect.focused, circle.focused")
    .style("stroke-width", "4px");

  d3.selectAll(".cardinality.focused, marker path.focused")
    .style("fill","#f00");
};
var removeStyles = function () { 
    d3.selectAll(".class, .text, .embedded, .subtext, .cardinality, path, .nofill, .nostroke, .special, .dotted, .fineline, .object, .rdf, .external, .deprecated, .label .datatype, .literal, .node .datatype, .symbol, .arrowhead, marker path, .white, .dottedMarker path, .svgGraph .text tspan:only-child, .svgGraph .text:empty, .subclass, .disjoint")
        .attr("style", null);
};

var exportSVGDrawing = function exportSVGDrawingFunct () {
    // Get the d3js SVG element
    var   graph = document.getElementById('graph')
        , svg = graph.getElementsByTagName('svg')[0]
        , svgsrc
        , svgXML;

    loadGraphStyle(); //load the graphic styles

    svgsrc = d3.select(svg)
        .attr("version", 1.1)
        .attr("xmlns", "http://www.w3.org/2000/svg")
        .node().parentNode.innerHTML;

    //btoa(); Creates a base-64 encoded ASCII string from a "string" of binary data.
    svgXML = 'data:image/svg+xml;base64,'+ btoa(svgsrc);
   
    d3.select(exportSvg)
        .attr("href", svgXML)
        .attr("download", jsonURI+".svg");

    removeStyles(); // remove graphic styles for interaction to go back to normal
};

var graphOptions = function graphOptionsFunct() {
{'fraction_non_alphanumeric': 0.19240624272070814, 'fraction_numerical': 0.018518518518518517, 'mean_word_length': 3.3788883222845487, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6152658', 'n_tokens_mistral': 2949, 'n_tokens_neox': 2813, 'n_words': 520}