JSFiddle - React, Tailwind, and code Playground

by Kesav Telaprolu

HTML

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<div id="container" style="width: 1240px;height: 688px;border-radius: 10px;border: 1px solid #dbdbdb;position:relative"></div>

CSS

/*
 * Legal Disclaimer
 *
    print '\n', 'Note that the webfonts share the TT sources'
 * These Fonts are licensed for unlimited use on domains and their subdomains of The Kantar Group.
 * It is illegal to download or use them on other websites.
 *
 * While the @font-face statements below may be modified by the client, this
 * disclaimer may not be removed.
 *
 * Lineto.com, 2016
 */



@font-face {
    font-family: "KantarBrownWeb-LightItalic";
    src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-LightItalic.eot");
    src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-LightItalic.eot?#iefix") format("embedded-opentype"),
         url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-LightItalic.woff2") format("woff2"),
         url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-LightItalic.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "KantarBrownWeb-BoldItalic";
    src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-BoldItalic.eot");
    src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-BoldItalic.eot?#iefix") format("embedded-opentype"),
         url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-BoldItalic.woff2") format("woff2"),
         url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-BoldItalic.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "KantarBrownWeb-Italic";
    src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-Italic.eot");
    src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-Italic.eot?#iefix") format("embedded-opentype"),
         url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-Italic.woff2")...

JavaScript

(input => {
    input.dataSeries.marketShare = formattedValue(input.dataSeries.marketShare);
    input.dataSeries.powerInMind = formattedValue(input.dataSeries.powerInMind);
    input.dataSeries.grouped.steady = formattedValue(input.dataSeries.grouped.steady);
    input.dataSeries.grouped.opportunities = formattedValue(input.dataSeries.grouped.opportunities);
    input.dataSeries.grouped.atRisk = formattedValue(input.dataSeries.grouped.atRisk);
    input.dataSeries.ungrouped.steady = formattedValue(input.dataSeries.ungrouped.steady);
    input.dataSeries.ungrouped.decreasedSpend = formattedValue(input.dataSeries.ungrouped.decreasedSpend);
    input.dataSeries.ungrouped.shareLost = formattedValue(input.dataSeries.ungrouped.shareLost);
    input.dataSeries.ungrouped.shareGained = formattedValue(input.dataSeries.ungrouped.shareGained);
    input.dataSeries.ungrouped.increasedSpend = formattedValue(input.dataSeries.ungrouped.increasedSpend);



    var equityGap;
    equityGap = formattedValue(input.dataSeries.equityGap);

    var chosenBrandValues = [input.dataSeries.marketShare, 1, equityGap];
    var powerInMind = input.dataSeries.powerInMind;
    var steadyGrouped = input.dataSeries.grouped.steady;
    var riskValue = input.dataSeries.grouped.atRisk;

    var templs = {
        "charttile": "This is <client brand>'s Equity Signature. <client brand>'s current market share is based on the combination of its Power in the mind and power in the market.	",
        "marketShare": "In this section we segment <client brand>’s market share as a function of whether people have the potential to use it more or less.	",
        "pimless": "According to this survey, <client brand> has an estimated Market Share of <cm_market_share>%. However, its Power in the mind is <cm_power_in_the_mind>%.<br>There is, therefore, a negative Equity Gap of <cm_equity_gap>% between <client brand>'s estimated share and its Power in the mind.",
        "pimhigh": "According to this survey, <client...