<commit_before>// Testing pages for comparing local charts against live versions

import {Router} from 'express'
import * as React from 'react'

import {renderToHtmlPage} from 'utils/server/serverUtil'
import {chartToSVG} from 'site/server/svgPngExport'
import { OldChart, Chart } from 'db/model/Chart'
import * as db from 'db/db'
import {ADMIN_BASE_URL, BAKED_GRAPHER_URL, BAKED_BASE_URL} from 'settings'
import {expectInt} from 'utils/server/serverUtil'
import * as querystring from 'querystring'
import * as _ from 'lodash'
import * as url from 'url'

const IS_LIVE = ADMIN_BASE_URL === "https://owid.cloud"

const testPages = Router()

interface ChartItem {
    id: number,
    slug: string
}

interface EmbedTestPageProps {
    prevPageUrl?: string,
    nextPageUrl?: string,
    currentPage?: number,
    totalPages?: number,
    charts: ChartItem[]
}

function EmbedTestPage(props: EmbedTestPageProps) {
    const style = `
        html, body {
            height: 100%;
            margin: 0;
            background-color: #f1f1f1;
            font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
        }

        figure, iframe {
            border: 0;
            flex: 1;
            height: 450px;
            margin: 10px;
        }

        .row {
            padding: 10px;
            margin: 0;
            border-bottom: 1px solid #ddd;
        }

        .side-by-side {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
        }

        h3 {
            width: 50%;
            text-align: center;
            margin: 0;
        }

        nav.pagination {
            width: 100%;
            text-align: center;
            padding: 15px;
        }

        .chart-id {
            font-size: 18px;
            font-weight: bold;
            padding-top: 10px;
            text-align: center;
        }
    `
    return <html>
        <head>
            <meta name="viewport" content="width=device-width, initial-scale=1"/>
            <title>Test Embeds</title>
            <style dangerouslySetInnerHTML={{__html: style}}/>
        </head>
        <body>
            <div className="row">
                <div className="side-by-side"><commit_msg>Use standard site head on test pages<commit_after>// Testing pages for comparing local charts against live versions

import {Router} from 'express'
import * as React from 'react'

import {renderToHtmlPage} from 'utils/server/serverUtil'
import {chartToSVG} from 'site/server/svgPngExport'
import { OldChart, Chart } from 'db/model/Chart'
import { Head } from 'site/server/views/Head'
import * as db from 'db/db'
import {ADMIN_BASE_URL, BAKED_GRAPHER_URL, BAKED_BASE_URL} from 'settings'
import {expectInt} from 'utils/server/serverUtil'
import * as querystring from 'querystring'
import * as _ from 'lodash'
import * as url from 'url'

const IS_LIVE = ADMIN_BASE_URL === "https://owid.cloud"

const testPages = Router()

interface ChartItem {
    id: number,
    slug: string
}

interface EmbedTestPageProps {
    prevPageUrl?: string,
    nextPageUrl?: string,
    currentPage?: number,
    totalPages?: number,
    charts: ChartItem[]
}

function EmbedTestPage(props: EmbedTestPageProps) {
    const style = `
        html, body {
            height: 100%;
            margin: 0;
            background-color: #f1f1f1;
            font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
        }

        figure, iframe {
            border: 0;
            flex: 1;
            height: 450px;
            margin: 10px;
        }

        .row {
            padding: 10px;
            margin: 0;
            border-bottom: 1px solid #ddd;
        }

        .side-by-side {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
        }

        h3 {
            width: 50%;
            text-align: center;
            margin: 0;
        }

        nav.pagination {
            width: 100%;
            text-align: center;
            padding: 15px;
        }

        .chart-id {
            font-size: 18px;
            font-weight: bold;
            padding-top: 10px;
            text-align: center;
        }
    `
    return <html>
        <Head canonicalUrl="" pageTitle="Test Embeds">
            <style dangerouslySetInnerHTML={{__html: style}}/>
        </Head>
        <body>
            <div className="row">
                <div className="side-by-side">
{'fraction_non_alphanumeric': 0.10671409515340151, 'fraction_numerical': 0.015340151178301467, 'mean_word_length': 1.8384858044164039, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 2, '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': '3189111', 'n_tokens_mistral': 1418, 'n_tokens_neox': 1333, 'n_words': 354}