<commit_before>
import * as go from "gojs";
import { Parser } from "./parser";
import { stateMachineColor } from "./graphicColors";
import { NodeDataArrayTemplate, LinkDataArrayTemplate } from "./gojsTemplates";

export class DrawComponent {

    private $: any;
    private diagram: go.Diagram;

    draw(parser: Parser, divId: string): void {
        this.$ = go.GraphObject.make;
        this.diagram = this.createDiagram(divId);
        this.diagram.nodeTemplate = this.getNodeTemplate();
        this.diagram.nodeTemplateMap.add("LinkLabel", this.getLinkLabelTemplate());
        this.diagram.groupTemplate = this.getGroupTemplate();
        this.diagram.linkTemplate = this.getLinkTemplate();
        this.diagram.model = this.getModel(parser.getNodeDataArray(), parser.getLinkDataArray());
    }

    private createDiagram(divId: string): go.Diagram {
        const $ = this.$;
        const thisObject = this;
        const diagram =
            $(go.Diagram, divId,
                {
                    contentAlignment: go.Spot.Center,
                    InitialLayoutCompleted: (e) => { thisObject.loadControls(e.diagram); }
                });
        return diagram;
    }

    private loadControls(diagram): void {<commit_msg>Remove animation when switching to graphical view<commit_after>
import * as go from "gojs";
import { Parser } from "./parser";
import { stateMachineColor } from "./graphicColors";
import { NodeDataArrayTemplate, LinkDataArrayTemplate } from "./gojsTemplates";

export class DrawComponent {

    private $: any;
    private diagram: go.Diagram;

    draw(parser: Parser, divId: string): void {
        this.$ = go.GraphObject.make;
        this.diagram = this.createDiagram(divId);
        this.diagram.nodeTemplate = this.getNodeTemplate();
        this.diagram.nodeTemplateMap.add("LinkLabel", this.getLinkLabelTemplate());
        this.diagram.groupTemplate = this.getGroupTemplate();
        this.diagram.linkTemplate = this.getLinkTemplate();
        this.diagram.model = this.getModel(parser.getNodeDataArray(), parser.getLinkDataArray());
    }

    private createDiagram(divId: string): go.Diagram {
        const $ = this.$;
        const thisObject = this;
        const diagram =
            $(go.Diagram, divId,
                {
                    contentAlignment: go.Spot.Center,
                    "animationManager.isInitial": false,
                    InitialLayoutCompleted: (e) => { thisObject.loadControls(e.diagram); }
                });
        return diagram;
    }

    private loadControls(diagram): void {
{'fraction_non_alphanumeric': 0.11680248350795498, 'fraction_numerical': 0.0, 'mean_word_length': 2.630985915492958, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 5, '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': '787620', 'n_tokens_mistral': 712, 'n_tokens_neox': 697, 'n_words': 148}