<commit_before>### define
underscore : _
backbone.marionette : marionette
worker!libs/viz.js : VizWorker
libs/pan_zoom_svg  : PanZoomSVG
###

class TaskOverviewView extends Backbone.Marionette.View

  ui :
    "graphData" : "#graphData"
    "userData" : "#userData"
    "graph" : ".graph"


  initialize : ->

    @bindUIElements() #Backbone.Marionette internal method

    graphSource = @ui.graphData.html().replace( /"[^"]+"/gm, (a) -> a.replace(" "," ") )
    userData = JSON.parse(@ui.userData.html())

    VizWorker.send(
      source : graphSource
      format : "svg"
      layoutEngine : "neato"
    ).then(
      (svgResult) =>

        #remove error messages
        startIndex = svgResult.indexOf("<?xml")
        svgResult = svgResult.slice(startIndex, svgResult.length - 1)

        @ui.graph.html(svgResult)

        userData.map (user) ->
          $("#" + user.id + " > text").popover(
            title: user.name,
            html: true,
            trigger: "hover",
            content: user.tooltip
          )

        #reset some attributes before invoking panZoom plugin
        $svg = @$(".graph.well").find("svg")
        $svg[0].removeAttribute("viewBox") #get rid of the troublemaker. messes up transformations
        $svg[0].setAttribute("width", "#{$(window).width() - 100}px")
        $svg[0].setAttribute("height", "#{$(window).height() - 50 - $svg.offset().top}px" )
        $svg.css("max-width", "100%")

        new PanZoomSVG($svg)

      (error) =>
        @ui.graph.html("<i class=\"fa fa-warning-sign\"></i>#{error.replace(/\n/g,"<br>")}")
    )<commit_msg>fix hidden popovers in tasks overview<commit_after>### define
underscore : _
backbone.marionette : marionette
worker!libs/viz.js : VizWorker
libs/pan_zoom_svg  : PanZoomSVG
###

class TaskOverviewView extends Backbone.Marionette.View

  ui :
    "graphData" : "#graphData"
    "userData" : "#userData"
    "graph" : ".graph"


  initialize : ->

    @bindUIElements() #Backbone.Marionette internal method

    graphSource = @ui.graphData.html().replace( /"[^"]+"/gm, (a) -> a.replace(" "," ") )
    userData = JSON.parse(@ui.userData.html())

    VizWorker.send(
      source : graphSource
      format : "svg"
      layoutEngine : "neato"
    ).then(
      (svgResult) =>

        #remove error messages
        startIndex = svgResult.indexOf("<?xml")
        svgResult = svgResult.slice(startIndex, svgResult.length - 1)

        @ui.graph.html(svgResult)

        userData.map (user) ->
          $("#" + user.id + " > text").popover(
            title: user.name,
            html: true,
            trigger: "hover",
            content: user.tooltip,
            container: 'body'
          )

        #reset some attributes before invoking panZoom plugin
        $svg = @$(".graph.well").find("svg")
        $svg[0].removeAttribute("viewBox") #get rid of the troublemaker. messes up transformations
        $svg[0].setAttribute("width", "#{$(window).width() - 100}px")
        $svg[0].setAttribute("height", "#{$(window).height() - 50 - $svg.offset().top}px" )
        $svg.css("max-width", "100%")

        new PanZoomSVG($svg)

      (error) =>
        @ui.graph.html("<i class=\"fa fa-warning-sign\"></i>#{error.replace(/\n/g,"<br>")}")
    )
{'fraction_non_alphanumeric': 0.1742074484456756, 'fraction_numerical': 0.007386888273314866, 'mean_word_length': 2.532608695652174, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7659887', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1037, 'n_words': 199}