<commit_before>/* global cytoscape:true */
class CyGraphService {
    /*@ngInject*/
    constructor($mdDialog, workflowState, $filter) {
        this.$mdDialog = $mdDialog;
        this.workflowState = workflowState;
        this.$filter = $filter;
    }

    createGraph(elements, domId) {
        let cy = cytoscape({
            container: document.getElementById(domId),
            elements: elements,
            boxSelectionEnabled: true,
            style: [
                {
                    selector: 'node',
                    style: {
                        'content': 'data(name)',
                        'text-valign': 'center',
                        'text-halign': 'center',
                        'background-color': 'data(color)',
                        color: 'black',
                        'text-outline-color': (ele) => {
                            let c = ele.data('color');
                            return c ? c : '#fff';
                        },
                        'font-size': '18px',
                        'font-weight': 'bold',
                        'text-outline-width': '5px',
                        'text-outline-opacity': 1,
                        'border-width': '4px',
                        'border-color': (ele) => {
                            let highlight = ele.data('highlight');
                            return highlight ? highlight : '#fff';
                        },
                        shape: (ele) => {
                            let shape = ele.data('shape');
                            return shape ? shape : 'triangle';
                        },
                        width: '80px',
                        height: '80px'
                    }
                },
                {
                    selector: 'edge',
                    style: {
                        'width': 4,
                        'target-arrow-shape': 'triangle',
                        'curve-style': 'bezier',
                        'content': 'data(name)',
                        'font-weight': 'bold',
                        'text-outline-color': '#555',
                        'text-outline-width': '3px',
                        'color': '#fff'
                    }
                },
                {
                    selector: 'node:selected',
                    style: {
                        'border-width': '8px',
                        'border-color': '#2196f3',
                        color: '#2196f3'
                    }
                },
                {
                    selector: 'edge:selected',
                    style: {
                        'background-color': '#2196f3',
                        'text-outline-color': '#2196f3'
                    }
                }
            ]
        });

        this.setupQTips(cy);

        cy.layout({name: 'dagre', fit: true});
        cy.panzoom();

        return cy;
    }

    setupQTips(cy) {
        cy.elements().forEach((ele) => {
            if (ele && _.isFunction(ele.qtip)) {
                try {
                    let qtipAPI = ele.qtip('api');
                    qtipAPI.destroy();
                } catch (e) {
<commit_msg>Resolve build error<commit_after>/* global cytoscape:true */
class CyGraphService {
    /*@ngInject*/
    constructor($mdDialog, workflowState, $filter) {
        this.$mdDialog = $mdDialog;
        this.workflowState = workflowState;
        this.$filter = $filter;
    }

    createGraph(elements, domId) {
        let cy = cytoscape({
            container: document.getElementById(domId),
            elements: elements,
            boxSelectionEnabled: true,
            style: [
                {
                    selector: 'node',
                    style: {
                        'content': 'data(name)',
                        'text-valign': 'center',
                        'text-halign': 'center',
                        'background-color': 'data(color)',
                        color: 'black',
                        'text-outline-color': (ele) => {
                            let c = ele.data('color');
                            return c ? c : '#fff';
                        },
                        'font-size': '18px',
                        'font-weight': 'bold',
                        'text-outline-width': '5px',
                        'text-outline-opacity': 1,
                        'border-width': '4px',
                        'border-color': (ele) => {
                            let highlight = ele.data('highlight');
                            return highlight ? highlight : '#fff';
                        },
                        shape: (ele) => {
                            let shape = ele.data('shape');
                            return shape ? shape : 'triangle';
                        },
                        width: '80px',
                        height: '80px'
                    }
                },
                {
                    selector: 'edge',
                    style: {
                        'width': 4,
                        'target-arrow-shape': 'triangle',
                        'curve-style': 'bezier',
                        'content': 'data(name)',
                        'font-weight': 'bold',
                        'text-outline-color': '#555',
                        'text-outline-width': '3px',
                        'color': '#fff'
                    }
                },
                {
                    selector: 'node:selected',
                    style: {
                        'border-width': '8px',
                        'border-color': '#2196f3',
                        color: '#2196f3'
                    }
                },
                {
                    selector: 'edge:selected',
                    style: {
                        'background-color': '#2196f3',
                        'text-outline-color': '#2196f3'
                    }
                }
            ]
        });

        this.setupQTips(cy);

        cy.layout({name: 'dagre', fit: true});
        cy.panzoom();

        return cy;
    }

    setupQTips(cy) {
        cy.elements().forEach((ele) => {
            if (ele && _.isFunction(ele.qtip)) {
                try {
                    let qtipAPI = ele.qtip('api');
                    qtipAPI.destroy();
                } catch (e) {
                    //console.log(e);
{'fraction_non_alphanumeric': 0.12346827982007134, 'fraction_numerical': 0.010857763300760043, 'mean_word_length': 0.8071748878923767, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '145433', 'n_tokens_mistral': 1624, 'n_tokens_neox': 1455, 'n_words': 275}