<commit_before>import Scale from "./scale/scale";
import {Group} from "./scene/group";
import {Selection} from "./scene/selection";
import {Line} from "./scene/shape/line";
import {NumericTicks} from "./util/ticks";
import {normalizeAngle360, normalizeAngle360Inclusive, toRadians} from "./util/angle";
import {Text} from "./scene/shape/text";
import {Arc} from "./scene/shape/arc";
import {Shape} from "./scene/shape/shape";

enum Tags {
    Tick,
    GridLine
}

export type GridStyle = {
    strokeStyle: string | null,
    lineDash: number[] | null
};

/**
 * A general purpose linear axis with no notion of orientation.
 * The axis is always rendered vertically, with horizontal labels positioned to the left
 * of the axis line by default. The axis can be {@link rotation | rotated} by an arbitrary angle,
 * so that it can be used as a top, right, bottom, left, radial or any other kind
 * of linear axis.
 */
export class Axis<D> {
    constructor(scale: Scale<D, number>, group: Group) {
        this.scale = scale;
        this.group = group;
        this.groupSelection = Selection.select(group).selectAll<Group>();
        group.append(this.line);
    }

    readonly scale: Scale<D, number>;
    readonly group: Group;
    private groupSelection: Selection<Group, Group, D, D>;
    private line = new Line();

    /**
     * The horizontal translation of the axis group.
     */
    translationX: number = 0;

    /**
     * The vertical translation of the axis group.
     */
    translationY: number = 0;<commit_msg>Axis constructor only takes a scale now, the group is auto-created.<commit_after>import Scale from "./scale/scale";
import {Group} from "./scene/group";
import {Selection} from "./scene/selection";
import {Line} from "./scene/shape/line";
import {NumericTicks} from "./util/ticks";
import {normalizeAngle360, normalizeAngle360Inclusive, toRadians} from "./util/angle";
import {Text} from "./scene/shape/text";
import {Arc} from "./scene/shape/arc";
import {Shape} from "./scene/shape/shape";

enum Tags {
    Tick,
    GridLine
}

export type GridStyle = {
    strokeStyle: string | null,
    lineDash: number[] | null
};

/**
 * A general purpose linear axis with no notion of orientation.
 * The axis is always rendered vertically, with horizontal labels positioned to the left
 * of the axis line by default. The axis can be {@link rotation | rotated} by an arbitrary angle,
 * so that it can be used as a top, right, bottom, left, radial or any other kind
 * of linear axis.
 */
export class Axis<D> {
    constructor(scale: Scale<D, number>) {
        this.scale = scale;
        this.groupSelection = Selection.select(this.group).selectAll<Group>();
        this.group.append(this.line);
    }

    readonly scale: Scale<D, number>;
    readonly group = new Group();
    private groupSelection: Selection<Group, Group, D, D>;
    private line = new Line();

    /**
     * The horizontal translation of the axis group.
     */
    translationX: number = 0;

    /**
     * The vertical translation of the axis group.
     */
    translationY: number = 0;
{'fraction_non_alphanumeric': 0.12293756065998059, 'fraction_numerical': 0.00517631834357813, 'mean_word_length': 3.2648275862068967, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3129743', 'n_tokens_mistral': 895, 'n_tokens_neox': 861, 'n_words': 332}