<commit_before>/* global d3: false */
/* global CoreStyle: false */
(function() {
  'use strict';
  let manager, currentMindmap, currentUpdate;
  Polymer({
    ready() {
      manager = document.querySelector('mindmap-manager');
    },
    attached() {
      manager.load(this.key).then(mindmap => {
        console.log(mindmap);
        currentMindmap = mindmap;
        window.mindmap = mindmap;
//comm a mettre debut

        var svg = d3.select(this.$.svg);

        var link = svg.selectAll('.link'),
            node = svg.selectAll('.node'),
            root;






        var {width, height} = this.$.svg.getBoundingClientRect();

        function tick() {
          node
            .attr('cx', d => d.x = Math.max(5, Math.min(width - 5, d.x)))
            .attr('cy', d => d.y = Math.max(5, Math.min(height - 5, d.y)));

          link
            .attr('x1', function(d) { return d.source.x; })
            .attr('y1', function(d) { return d.source.y; })
            .attr('x2', function(d) { return d.target.x; })
            .attr('y2', function(d) { return d.target.y; });

          node.attr('transform', d => `translate(${d.x}, ${d.y})`);
        }


        //var force = d3.layout.force()
        var force = d3.layout.force()
          .gravity(0.01)
          .charge(d => (d.children ? d.children.length + 1 : 1) * -300)
          .linkDistance(d => (d.children ? d.children.length + 1 : 1) * 3)
          .size([width, height])
          .on('tick', tick);



        // Color leaf nodes orange, and packages white or blue.
        function color(d) {
          let hue = CoreStyle.g.theme.hue;
          if (d.fixed) {
            //root
            return d3.hsl((hue + 106) % 256, 0.8, 0.4);
          }
          if (!d.children) {
            //leaf
            return d3.hsl((hue + 150) % 256, 0.5, 0.4);
          }
          if (d._children) {
            //node with hidden children
            return d3.hsl(hue, 0.5, 0.4);
          } else {
            //node with visible children
            return d3.hsl(hue, 0.8, 0.4);
          }
        }

        // Toggle children on click.
        function click(d) {
          if (!event.defaultPrevented) {
            if (d.children) {
              d._children = d.children;
              d.children = null;
              //d.meta = true;
            } else {
              d.children = d._children;
              d._children = null;
              //d.meta = false;
            }
            update();
          }
        }

        // Toggle open content on click.
        let supported = {<commit_msg>fixed color wheel related code<commit_after>/* global d3: false */
/* global CoreStyle: false */
(function() {
  'use strict';
  let manager, currentMindmap, currentUpdate;
  Polymer({
    ready() {
      manager = document.querySelector('mindmap-manager');
    },
    attached() {
      manager.load(this.key).then(mindmap => {
        console.log(mindmap);
        currentMindmap = mindmap;
        window.mindmap = mindmap;
//comm a mettre debut

        var svg = d3.select(this.$.svg);

        var link = svg.selectAll('.link'),
            node = svg.selectAll('.node'),
            root;






        var {width, height} = this.$.svg.getBoundingClientRect();

        function tick() {
          node
            .attr('cx', d => d.x = Math.max(5, Math.min(width - 5, d.x)))
            .attr('cy', d => d.y = Math.max(5, Math.min(height - 5, d.y)));

          link
            .attr('x1', function(d) { return d.source.x; })
            .attr('y1', function(d) { return d.source.y; })
            .attr('x2', function(d) { return d.target.x; })
            .attr('y2', function(d) { return d.target.y; });

          node.attr('transform', d => `translate(${d.x}, ${d.y})`);
        }


        //var force = d3.layout.force()
        var force = d3.layout.force()
          .gravity(0.01)
          .charge(d => (d.children ? d.children.length + 1 : 1) * -300)
          .linkDistance(d => (d.children ? d.children.length + 1 : 1) * 3)
          .size([width, height])
          .on('tick', tick);



        // Color leaf nodes orange, and packages white or blue.
        function color(d) {
          let hue = CoreStyle.g.theme.hue;
          if (d.fixed) {
            //root
            return d3.hsl((hue + 160) % 360, 0.8, 0.4);
          }
          if (!d.children) {
            //leaf
            return d3.hsl((hue + 200) % 360, 0.5, 0.4);
          }
          if (d._children) {
            //node with hidden children
            return d3.hsl(hue, 0.5, 0.4);
          } else {
            //node with visible children
            return d3.hsl(hue, 0.8, 0.4);
          }
        }

        // Toggle children on click.
        function click(d) {
          if (!event.defaultPrevented) {
            if (d.children) {
              d._children = d.children;
              d.children = null;
              //d.meta = true;
            } else {
              d.children = d._children;
              d._children = null;
              //d.meta = false;
            }
            update();
          }
        }

        // Toggle open content on click.
        let supported = {
{'fraction_non_alphanumeric': 0.1564245810055866, 'fraction_numerical': 0.02119052205740705, 'mean_word_length': 1.4048170449282076, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1554398', 'n_tokens_mistral': 1711, 'n_tokens_neox': 1612, 'n_words': 374}