<commit_before>(function (HAF) {
    "use strict";

    APP.controller.SearchFiltering = HAF.Controller.extend({
        autoShowHide: true,
        autoLayout: true,
        lastDataSet: null,
        inject: function () {
            return {
                views: {
                    searchFiltering: new APP.view.SearchFiltering(),
                    visualFiltering: new APP.view.VisualFiltering(this.messageBus)
                }
            };
        },
        load: function() {
            this.messageBus.subscribe(this, "visual-filtering-filtered", onVisualFilter);
            this.messageBus.subscribe(this, "visual-filtering-layout-change", onVisualFilterLayoutChange);
        },
        updateFilter: function (data) {
            addRelatedNodesToGraph(data.id, data.related, this.lastDataSet.nodes, this.lastDataSet.edges);
        },
        update: function (data) {
            if (!this.lastDataSet) {
                this.lastDataSet = {
                    nodes: new vis.DataSet(),
                    edges: new vis.DataSet()
                }
            }
            this.views.visualFiltering.render(this.lastDataSet);
            addDataToGraph(this.lastDataSet, data);
        },
        hide: function() {
            this._super();
            this.lastDataSet.nodes.clear();
            this.lastDataSet.edges.clear();
        }
    });
<commit_msg>code fix<commit_after>(function (HAF) {
    "use strict";

    APP.controller.SearchFiltering = HAF.Controller.extend({
        autoShowHide: true,
        autoLayout: true,
        lastDataSet: null,
        inject: function () {
            return {
                views: {
                    searchFiltering: new APP.view.SearchFiltering(),
                    visualFiltering: new APP.view.VisualFiltering(this.messageBus)
                }
            };
        },
        load: function() {
            this.messageBus.subscribe(this, "visual-filtering-filtered", onVisualFilter);
            this.messageBus.subscribe(this, "visual-filtering-layout-change", onVisualFilterLayoutChange);
        },
        updateFilter: function (data) {
            addRelatedNodesToGraph(data.id, data.related, this.lastDataSet.nodes, this.lastDataSet.edges);
        },
        update: function (data) {
            if (!this.lastDataSet) {
                this.lastDataSet = {
                    nodes: new vis.DataSet(),
                    edges: new vis.DataSet()
                }
            }
            this.lastDataSet.nodes.clear();
            this.lastDataSet.edges.clear();
            this.views.visualFiltering.render(this.lastDataSet);
            addDataToGraph(this.lastDataSet, data);
        },
        hide: function() {
            this._super();
            if (this.lastDataSet) {
                this.lastDataSet.nodes.clear();
                this.lastDataSet.edges.clear();
            }
        }
    });

{'fraction_non_alphanumeric': 0.11194796302636084, 'fraction_numerical': 0.0, 'mean_word_length': 1.6066012488849242, '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': '3440820', 'n_tokens_mistral': 771, 'n_tokens_neox': 759, 'n_words': 119}