constructor()

in src/panels/text.ts [35:60]


    constructor(opts: TextPanelOptions = {}) {
        const defaults: GrafanaTextPanel = {
            title: '',
            id: generateGraphId(),
            error: false,
            span: 12,
            editable: true,
            type: 'text',
            mode: 'markdown',
            content: '',
            style: {},
            links: [],
        };
        this.state = defaults;

        // Overwrite defaults with custom values
        Object.keys(opts).forEach((opt) => {
            this.state[opt] = opts[opt];
        });

        // finally add to row/dashboard if given
        if (opts.row && opts.dashboard) {
            opts.row.addPanel(this);
            opts.dashboard.addRow(opts.row);
        }
    }