function Text()

in grafana/panels/text.js [25:53]


function Text(opts) {
    opts = opts || {};
    var self = this;

    var defaults = {
        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(function eachOpt(opt) {
        self.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);
    }
}