JSFiddle - React, Tailwind, and code Playground

by Ivin Raj S

CSS

body{
	background-image:url(http://wolf-on-wall-street.com/images/new_york_city_madness_wallp.jpg);
	-webkit-background-size:cover;
	-moz-background-size:cover;
	-o-background-size:cover;
	background-size:cover;
}

JavaScript

var app = {};
app.App = function(data){ // model class
    this.plotCfg = {
        chart: {
            renderTo: "plot"
        },
        series: [{
            name: 'USD to EUR',
            data: usdeur
        }]
    };
};
app.controller = function() { // controller
    this.apk = new app.App();
    this.cfg = this.apk.plotCfg;
};
app.plotter = function(ctrl) { // config class
    return function(elem,isin, context) {
        if(!isin) {
          
          context.chart = new  Highcharts.StockChart(ctrl.cfg);          
        }
    };
};
app.view = function(ctrl) { // view
    return  m("html", [ m("body", [
        m("#plot[style=height:400px]", {config: app.plotter(ctrl)}),
        //when I set breakpoint here I can see plot for a moment. It disappears when I resume normal script flow
        m("p", "some text after plot"), 
        ]),
    ])
};
m.module(document, app);