<commit_before>import {HdpiCanvas} from "../canvas/hdpiCanvas";
import {Node} from "./node";
import {Path2D} from "./path2D";
import {Shape} from "./shape/shape";
import {Group} from "./group";

export class Scene {
    constructor(parent: HTMLElement, width = 800, height = 600) {
        this.hdpiCanvas = new HdpiCanvas(this._width = width, this._height = height);
        const canvas = this.hdpiCanvas.canvas;
        this.ctx = canvas.getContext('2d')!;
        parent.appendChild(canvas);
        this.setupListeners(canvas); // debug
    }

    remove() {
        this.hdpiCanvas.remove();
    }

    private static id = 1;
    private createId(): string {
        return (this.constructor as any).name + '-' + (Scene.id++);
    };<commit_msg>Scene: 'parent' property, remove 'parent' param from the constructor.<commit_after>import {HdpiCanvas} from "../canvas/hdpiCanvas";
import {Node} from "./node";
import {Path2D} from "./path2D";
import {Shape} from "./shape/shape";
import {Group} from "./group";

export class Scene {
    constructor(width = 800, height = 600) {
        this.hdpiCanvas = new HdpiCanvas(this._width = width, this._height = height);
        this.ctx = this.hdpiCanvas.context;
        this.setupListeners(this.hdpiCanvas.canvas); // debug
    }

    set parent(value: HTMLElement | null) {
        this.hdpiCanvas.parent = value;
    }
    get parent(): HTMLElement | null {
        return this.hdpiCanvas.parent;
    }

    private static id = 1;
    private createId(): string {
        return (this.constructor as any).name + '-' + (Scene.id++);
    };
{'fraction_non_alphanumeric': 0.14924433249370278, 'fraction_numerical': 0.011964735516372796, 'mean_word_length': 2.9331683168316833, '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': '6197942', 'n_tokens_mistral': 497, 'n_tokens_neox': 482, 'n_words': 126}