<commit_before>'use strict';

angular.module('dgc.lineage').controller('LineageController', ['$element', '$scope', '$stateParams', 'LineageResource', 'd3',
    function($element, $scope, $stateParams, LineageResource, d3) {

        function render(nodes) {
            var links = d3.layout.tree().links(nodes);
            // Restart the force layout.
            force.nodes(nodes)
                .links(links)
                .start();

            // Update links.
            link = link.data(links, function(d) {
                return d.target.__id;
            });

            link.exit().remove();

            link.enter().insert('line', '.node')
                .attr('class', 'link');

            // Update nodes.
            node = node.data(nodes, function(d) {
                return d.__id;
            });

            node.exit().remove();

            var nodeEnter = node.enter().append('g')
                .attr('class', 'node')
                //.on('click', click)
                .call(force.drag);

            nodeEnter.append('circle')
                .attr('class', function(d) {
                    return d.children ? '' : 'empty';
                }).attr('r', 9);

            nodeEnter.append('text')
                .attr('dy', '2em')
                .text(function(d) {
                    //return d.name;
                    return d.__name || d.__key;
                });

            /*node.select('circle')
             .style('fill', color);*/
        }

        function tick() {
            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', function(d) {
                return 'translate(' + d.x + ',' + d.y + ')';
            });
        }

        var width = Math.max($element[0].offsetWidth, 960),
            height = Math.max($element[0].offsetHeight, 350);

        var force = d3.layout.force()<commit_msg>Added drill down from lineage graph<commit_after>'use strict';

angular.module('dgc.lineage').controller('LineageController', ['$element', '$scope', '$state', '$stateParams', 'LineageResource', 'd3',
    function($element, $scope, $state, $stateParams, LineageResource, d3) {

        function render(nodes) {
            var links = d3.layout.tree().links(nodes);
            // Restart the force layout.
            force.nodes(nodes)
                .links(links)
                .start();

            // Update links.
            link = link.data(links, function(d) {
                return d.target.__id;
            });

            link.exit().remove();

            link.enter().insert('line', '.node')
                .attr('class', 'link');

            // Update nodes.
            node = node.data(nodes, function(d) {
                return d.__id;
            });

            node.exit().remove();

            var nodeEnter = node.enter().append('g')
                .attr('class', 'node')
                .on('click', click)
                .call(force.drag);

            nodeEnter.append('circle')
                .attr('class', function(d) {
                    return d.children ? '' : 'empty';
                }).attr('r', 9);

            nodeEnter.append('text')
                .attr('dy', '2em')
                .text(function(d) {
                    //return d.name;
                    return d.__name || d.__key;
                });

            /*node.select('circle')
             .style('fill', color);*/
        }

        function click(node) {
            $state.go('details', {
                id: node.guid
            }, {
                location: 'replace'
            });
        }

        function tick() {
            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', function(d) {
                return 'translate(' + d.x + ',' + d.y + ')';
            });
        }

        var width = Math.max($element[0].offsetWidth, 960),
            height = Math.max($element[0].offsetHeight, 350);

        var force = d3.layout.force()
{'fraction_non_alphanumeric': 0.16187527642636002, 'fraction_numerical': 0.00796107916850951, 'mean_word_length': 1.2843434343434343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2639925', 'n_tokens_mistral': 1280, 'n_tokens_neox': 1192, 'n_words': 227}