<commit_before>import TopComponent from '../TopComponent/TopComponent';

import './TopImage.scss';

export default class TopImage extends TopComponent {
    constructor(data) {
        super('div', { 'class': 'image' }, data);
    }

    render() {
        this.image = new Image();
        this.image.src = this.getData().src;

        this.image.addEventListener('load', () => {
            this.append(this.image);
            setTimeout(() => {
                this.getElement().style.maxHeight = `${this.image.height || 500}px`;
            }, 500);
        });

        return this.getElement();
    }
}<commit_msg>Fix image width<commit_after>import TopComponent from '../TopComponent/TopComponent';

import './TopImage.scss';

export default class TopImage extends TopComponent {
    constructor(data) {
        super('div', { 'class': 'image' }, data);
    }

    render() {
        this.image = new Image();
        this.image.src = this.getData().src;

        this.image.addEventListener('load', () => {
            this.append(this.image);
            setTimeout(() => {
                this.getElement().style.maxHeight = `${this.image.height || 500}px`;
                this.image.style.maxWidth = '95%';
            }, 500);
        });

        return this.getElement();
    }
}
{'fraction_non_alphanumeric': 0.1637065637065637, 'fraction_numerical': 0.010810810810810811, 'mean_word_length': 2.153284671532847, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2119753', 'n_tokens_mistral': 372, 'n_tokens_neox': 354, 'n_words': 68}