<commit_before>import "import-jquery";
import "jquery-ui-bundle";
import "jquery-ui-bundle/jquery-ui.css";
import draw2d from "draw2d";
import PubSub from 'pubsub-js'
import { random } from '../common/utils'
import Node from './Node'
import Serializer from './serializer'
import { store } from "./store";
import { timing } from "../common/timing";
import CanvasEx from "./CanvasEx";
import { Item } from "../common/ContextMenu";
import CanvasStack from "./CanvasStack";
import { zoomAndMoveShowTotalDiagram } from "./showTotalDiagram";
import { addDefaultInnerDiagram, addDefaultNewDiagram, addFigureToCanvas } from "./addDefault";
import { CanvasInner } from "./CanvasInner";


export default class Canvas {
    static defaultWidth = 100000
    static defaultHeight = 100000

    canvasStack = null
    serializer = null
    store = store
    inner = null

    canvas = null;
    callbacks = null

    constructor(canvasId, callbacks) {
        this.callbacks = callbacks
        this.canvas = new CanvasEx(canvasId, this.onEditMode, Canvas.defaultWidth, Canvas.defaultHeight)
        this.canvas.canvas = this
        this.serializer = new Serializer(this.canvas)
        this.canvasStack = new CanvasStack(this.canvas)
        this.inner = new CanvasInner(this.canvas, this.canvasStack, this.store, this.serializer)
    }

    init() {
        if (!this.load(this.canvas.name)) {
            addDefaultNewDiagram(this.canvas)
        }

        this.handleDoubleClick(this.canvas)
        this.handleEditChanges(this.canvas)<commit_msg>Clean<commit_after>import "import-jquery";
import "jquery-ui-bundle";
import "jquery-ui-bundle/jquery-ui.css";
import draw2d from "draw2d";
import PubSub from 'pubsub-js'
import { random } from '../common/utils'
import Node from './Node'
import Serializer from './serializer'
import { store } from "./store";
import CanvasEx from "./CanvasEx";
import { Item } from "../common/ContextMenu";
import CanvasStack from "./CanvasStack";
import { zoomAndMoveShowTotalDiagram } from "./showTotalDiagram";
import { addDefaultNewDiagram, addFigureToCanvas } from "./addDefault";
import { CanvasInner } from "./CanvasInner";


export default class Canvas {
    static defaultWidth = 100000
    static defaultHeight = 100000

    canvasStack = null
    serializer = null
    store = store
    inner = null

    canvas = null;
    callbacks = null

    constructor(canvasId, callbacks) {
        this.callbacks = callbacks
        this.canvas = new CanvasEx(canvasId, this.onEditMode, Canvas.defaultWidth, Canvas.defaultHeight)
        this.canvas.canvas = this
        this.serializer = new Serializer(this.canvas)
        this.canvasStack = new CanvasStack(this.canvas)
        this.inner = new CanvasInner(this.canvas, this.canvasStack, this.store, this.serializer)
    }

    init() {
        if (!this.load(this.canvas.name)) {
            addDefaultNewDiagram(this.canvas)
        }

        this.handleDoubleClick(this.canvas)
        this.handleEditChanges(this.canvas)
{'fraction_non_alphanumeric': 0.11322011322011322, 'fraction_numerical': 0.009324009324009324, 'mean_word_length': 3.366279069767442, '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': '3678601', 'n_tokens_mistral': 887, 'n_tokens_neox': 849, 'n_words': 218}