<commit_before>import { Group } from "../scene/group";
import { Arc } from "../scene/shape/arc";
import { Text } from "../scene/shape/text";

export class MarkerLabel extends Group {

    private static defaults = {
        padding: 8,
        markerSize: 14
    };

    private markerNode = new Arc();
    private labelNode = new Text();

    constructor() {
        super();

        const markerNode = this.markerNode;
        const labelNode = this.labelNode;

        this.markerSize = MarkerLabel.defaults.markerSize;

        labelNode.textBaseline = 'middle';
        labelNode.textAlign = 'start';

        this.padding = MarkerLabel.defaults.padding;

        this.append([markerNode, labelNode]);
    }

    set label(value: string) {
        this.labelNode.text = value;
    }
    get label(): string {
        return this.labelNode.text;
    }

    set labelFont(value: string) {
        this.labelNode.font = value;
    }
    get labelFont(): string {
        return this.labelNode.font;
    }

    set labelFill(value: string | null) {
        this.labelNode.fillStyle = value;
    }
    get labelFill(): string | null {
        return this.labelNode.fillStyle;
    }

    private _markerSize: number = 0;
    set markerSize(value: number) {
        if (this._markerSize !== value) {
            this._markerSize = value;
            this.markerNode.radiusX = value / 2;
            this.markerNode.radiusY = value / 2;
        }
    }
    get markerSize(): number {
        return this._markerSize;
    }

    set markerFill(value: string | null) {
        this.markerNode.fillStyle = value;
    }
    get markerFill(): string | null {
        return this.markerNode.fillStyle;
    }

    set markerStroke(value: string | null) {
        this.markerNode.strokeStyle = value;
    }
    get markerStroke(): string | null {
        return this.markerNode.strokeStyle;
    }

    set markerLineWidth(value: number) {
        this.markerNode.lineWidth = value;<commit_msg>Square legend markers.<commit_after>import { Group } from "../scene/group";
import { Rect } from "../scene/shape/rect";
import { Text } from "../scene/shape/text";

export class MarkerLabel extends Group {

    private static defaults = {
        padding: 8,
        markerSize: 14
    };

    private markerNode = new Rect();
    private labelNode = new Text();

    constructor() {
        super();

        this.markerSize = MarkerLabel.defaults.markerSize;

        const labelNode = this.labelNode;
        labelNode.textBaseline = 'middle';
        labelNode.textAlign = 'start';

        this.padding = MarkerLabel.defaults.padding;

        this.append([this.markerNode, labelNode]);
    }

    set label(value: string) {
        this.labelNode.text = value;
    }
    get label(): string {
        return this.labelNode.text;
    }

    set labelFont(value: string) {
        this.labelNode.font = value;
    }
    get labelFont(): string {
        return this.labelNode.font;
    }

    set labelFill(value: string | null) {
        this.labelNode.fillStyle = value;
    }
    get labelFill(): string | null {
        return this.labelNode.fillStyle;
    }

    private _markerSize: number = 0;
    set markerSize(value: number) {
        if (this._markerSize !== value) {
            this._markerSize = value;
            this.markerNode.x = -value / 2;
            this.markerNode.y = -value / 2;
            this.markerNode.width = value;
            this.markerNode.height = value;
        }
    }
    get markerSize(): number {
        return this._markerSize;
    }

    set markerFill(value: string | null) {
        this.markerNode.fillStyle = value;
    }
    get markerFill(): string | null {
        return this.markerNode.fillStyle;
    }

    set markerStroke(value: string | null) {
        this.markerNode.strokeStyle = value;
    }
    get markerStroke(): string | null {
        return this.markerNode.strokeStyle;
    }

    set markerLineWidth(value: number) {
        this.markerNode.lineWidth = value;
{'fraction_non_alphanumeric': 0.1133250311332503, 'fraction_numerical': 0.0029887920298879204, 'mean_word_length': 2.1350507416081186, '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': '6645170', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1135, 'n_words': 270}