{"performances":{"performances":[],"total_performances":20,"covent_garden_performances":0,"drury_lane_performances":20,"date_ranged_total_performances":19,"date_ranged_covent_garden_performances":0,"date_ranged_drury_lane_performances":19,"from_year":1732,"to_year":1809},"genre_colour":"#0048ff","performances_html":"<div class=\"row\">\n    <h3>Performances<\/h3>\n\n    <div class=\"table-responsive\">\n        <table class=\"table mt-3 table-striped\">\n            <thead>\n\n\n                \n\n                <tr>\n                    <th><a class=\"sort\" data-order=\"asc\" id=\"sort-dates\"\n                            data-sort=\"event_date\">Dates <\/a><\/th>\n\n                    <th><a class=\"sort\" data-order=\"desc\"\n                            id=\"sort-theatre\" data-sort=\"theatre_name\">Theatre <\/a><\/th>\n\n                    <th style=\"white-space: nowrap\">Performances<\/th>\n                    <th><a class=\"sort\" data-order=\"desc\"\n                            id=\"sort-command\" data-sort=\"is_requested\">Requested <\/a><\/th>\n                    <th style=\"white-space: nowrap\"><a class=\"sort\"\n                            data-order=\"desc\"\n                            id=\"sort-command\" data-sort=\"is_command_performance\">Commands <\/a>\n                    <\/th>\n                    <th><a class=\"sort\" data-order=\"desc\"\n                            id=\"sort-benefit\" data-sort=\"is_benefit\">Benefit <\/a><\/th>\n                    <th><a class=\"sort\" data-order=\"desc\"\n                            id=\"sort-revenue\" data-sort=\"event_total_receipts\">Revenue <\/a><\/th>\n                    <th style=\"white-space: nowrap\"><a class=\"sort\"\n                            data-order=\"desc\"\n                            id=\"sort-type\" data-sort=\"percentage_portion_of_receipts\">Available\n                            Revenue %<\/a><\/th>\n                    <th style=\"white-space: nowrap\"><a class=\"sort\"\n                            data-order=\"desc\" id=\"sort-type\"\n                            data-sort=\"portion_of_capacity\">Capacity %<\/a><\/th>\n                    <\/th>\n                <\/tr>\n            <\/thead>\n            <tbody>\n                                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1809-04-21?theatre=DL\">21 Apr 1809<\/a><\/td>\n                        <td class=\"text-nowrap\">Drury Lane<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/6034\" title=\"More info on Grieving's a Folly\">Grieving's a Folly<\/a>, <a target=\"_blank\" href=\"\/plays\/2943\" title=\"More info on Rosina\">Rosina<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3218<\/td>\n                        <td>56%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1809-04-22?theatre=DL\">22 Apr 1809<\/a><\/td>\n                        <td class=\"text-nowrap\">Drury Lane<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/6034\" title=\"More info on Grieving's a Folly\">Grieving's a Folly<\/a>, <a target=\"_blank\" href=\"\/plays\/3369\" title=\"More info on Three & Deuce\">Three & Deuce<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3216 3s 6d<\/td>\n                        <td>57%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1809-04-24?theatre=DL\">24 Apr 1809<\/a><\/td>\n                        <td class=\"text-nowrap\">Drury Lane<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/6034\" title=\"More info on Grieving's a Folly\">Grieving's a Folly<\/a>, <a target=\"_blank\" href=\"\/plays\/5903\" title=\"More info on Love in a tub\">Love in a tub<\/a>, <a target=\"_blank\" href=\"\/plays\/493\" title=\"More info on Mayor of Garatt\">Mayor of Garatt<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3238 6d<\/td>\n                        <td>50%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1809-04-25?theatre=DL\">25 Apr 1809<\/a><\/td>\n                        <td class=\"text-nowrap\">Drury Lane<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/6034\" title=\"More info on Grieving's a Folly\">Grieving's a Folly<\/a>, <a target=\"_blank\" href=\"\/plays\/3327\" title=\"More info on Wedding Day\">Wedding Day<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3193 7s<\/td>\n                        <td>56%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1809-04-26?theatre=DL\">26 Apr 1809<\/a><\/td>\n                        <td class=\"text-nowrap\">Drury Lane<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/6034\" title=\"More info on Grieving's a Folly\">Grieving's a Folly<\/a>, <a target=\"_blank\" href=\"\/plays\/3327\" title=\"More info on Wedding Day\">Wedding Day<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3156 6d<\/td>\n                        <td>48%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1809-04-27?theatre=DL\">27 Apr 1809<\/a><\/td>\n                        <td class=\"text-nowrap\">Drury Lane<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/6034\" title=\"More info on Grieving's a Folly\">Grieving's a Folly<\/a>, <a target=\"_blank\" href=\"\/plays\/3369\" title=\"More info on Three and Deuce\">Three and Deuce<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3242 6d<\/td>\n                        <td>61%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1809-04-28?theatre=DL\">28 Apr 1809<\/a><\/td>\n                        <td class=\"text-nowrap\">Drury Lane<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/6034\" title=\"More info on Grieving's a Folly\">Grieving's a Folly<\/a>, <a target=\"_blank\" href=\"\/plays\/5903\" title=\"More info on Love in a Tub\">Love in a Tub<\/a>, <a target=\"_blank\" href=\"\/plays\/2041\" title=\"More info on Devil to Pay\">Devil to Pay<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3166 10s<\/td>\n                        <td>55%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1809-05-01?theatre=DL\">01 May 1809<\/a><\/td>\n                        <td class=\"text-nowrap\">Drury Lane<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/6034\" title=\"More info on Grieving's a Folly\">Grieving's a Folly<\/a>, <a target=\"_blank\" href=\"\/plays\/6035\" title=\"More info on Temper\">Temper<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3214 3s 6d<\/td>\n                        <td>59%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1809-05-02?theatre=DL\">02 May 1809<\/a><\/td>\n                        <td class=\"text-nowrap\">Drury Lane<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/6034\" title=\"More info on Greiving's a Folly\">Greiving's a Folly<\/a>, <a target=\"_blank\" href=\"\/plays\/6035\" title=\"More info on Temper\">Temper<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3229 1s 6d<\/td>\n                        <td>52%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1809-05-03?theatre=DL\">03 May 1809<\/a><\/td>\n                        <td class=\"text-nowrap\">Drury Lane<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/6034\" title=\"More info on Grieving's a Folly\">Grieving's a Folly<\/a>, <a target=\"_blank\" href=\"\/plays\/5903\" title=\"More info on Love in a Tub\">Love in a Tub<\/a>, <a target=\"_blank\" href=\"\/plays\/6035\" title=\"More info on Temper\">Temper<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3229 4s 6d<\/td>\n                        <td>64%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                            <\/tbody>\n        <\/table>\n\n        <nav class=\"d-flex justify-items-center justify-content-between\">\n        <div class=\"d-flex justify-content-between flex-fill d-sm-none\">\n            <ul class=\"pagination\">\n                \n                                    <li class=\"page-item disabled\" aria-disabled=\"true\">\n                        <span class=\"page-link\">&laquo; Previous<\/span>\n                    <\/li>\n                \n                \n                                    <li class=\"page-item\">\n                        <a class=\"page-link\" href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&amp;workId=6034&amp;page=2\" rel=\"next\">Next &raquo;<\/a>\n                    <\/li>\n                            <\/ul>\n        <\/div>\n\n\n\n<div class=\"d-none flex-sm-fill d-sm-flex align-items-sm-center justify-content-sm-between\">\n    <div>\n        <p class=\"small text-muted\">\n            Showing\n            <span class=\"fw-semibold\">1<\/span>\n            to\n            <span class=\"fw-semibold\">10<\/span>\n            of\n            <span class=\"fw-semibold\">20<\/span>\n            results\n        <\/p>\n    <\/div>\n<\/div>\n\n\n    <div class=\"d-none flex-sm-fill d-sm-flex align-items-sm-center justify-content-sm-between\">\n        <div>\n            <p class=\"small text-muted\">\n                <span class=\"fw-semibold\">Items per page<\/span>\n            <\/p>\n        <\/div>\n    <\/div>\n    <div class=\"d-none flex-sm-fill d-sm-flex align-items-sm-center justify-content-sm-between\">\n        <ul id=\"perpage\" class=\"pagination\">\n            \n\n                        <li class=\"page-item  active \"><a\n                    href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&workId=6034&amp;perPage=10\" class=\"page-link per-page-link\">10<\/a>\n            <\/li>\n            <li class=\"page-item \"><a\n                    href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&workId=6034&amp;perPage=25\" class=\"page-link per-page-link\">25<\/a>\n            <\/li>\n            <li class=\"page-item \"><a\n                    href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&workId=6034&amp;perPage=50\" class=\"page-link per-page-link\">50<\/a>\n            <\/li>\n            <li class=\"page-item \"><a\n                    href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&workId=6034&amp;perPage=100\" class=\"page-link per-page-link\">100<\/a>\n            <\/li>\n        <\/ul>\n    <\/div>\n\n    <div>\n        <ul id=\"pagination\" class=\"pagination\">\n            \n                            <li class=\"page-item disabled\" aria-disabled=\"true\" aria-label=\"&laquo; Previous\">\n                    <span class=\"page-link\" aria-hidden=\"true\">&lsaquo;<\/span>\n                <\/li>\n            \n            \n                            \n                \n                \n                                                                                        <li class=\"page-item active\" aria-current=\"page\"><span\n                                    class=\"page-link\">1<\/span><\/li>\n                                                                                                <li class=\"page-item\"><a class=\"page-link\"\n                                    href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&amp;workId=6034&amp;page=2\">2<\/a><\/li>\n                                                                        \n            \n                            <li class=\"page-item\">\n                    <a class=\"page-link\" href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&amp;workId=6034&amp;page=2\" rel=\"next\"\n                        aria-label=\"Next &raquo;\">&rsaquo;<\/a>\n                <\/li>\n                    <\/ul>\n    <\/div>\n    <\/nav>\n\n        <div class=\"row\">\n            <div class=\"col p-0\">\n                <a href=\"\/api\/filters\/plays\/export\/?from=1732&amp;to=1809&amp;works[]=6034\" class=\"btn btn-primary download-plays-csv float-end\"\n                    style=\"background:#F26522; color: white !important;\">Download Export<\/a>\n            <\/div>\n        <\/div>\n\n    <\/div>\n<\/div>\n\n<div class=\"performances-receipts-graphs container mt-4\">\n    <!-- Include Chart.js -->\n\n<!-- Canvas for the chart -->\n<div class=\"chart-container\" style=\"position: relative; height:500px; width:100%\">\n    <canvas id=\"receiptsChart\"><\/canvas>\n<\/div>\n\n<script>\n\nfunction bootLineGraph(graphableReceiptsData) {\n    \/\/ Use passed data if available, otherwise fall back to page data\n    const graphable_receipts = graphableReceiptsData || {\"1808-1809\":{\"Drury Lane\":{\"formatted\":\"\\u00a33,375 6s\",\"graphable\":3375.3}}};\n    \n    \/\/ Destroy existing chart if it exists\n    if (receiptsChart) {\n        receiptsChart.destroy();\n        receiptsChart = null;\n    }\n    \n    \/\/ If no data, return early\n    if (!graphable_receipts || Object.keys(graphable_receipts).length === 0) {\n        return;\n    }\n    \n    console.log(graphable_receipts);\n\n    \/\/ Prepare data structures for the chart\n    const years = Object.keys(graphable_receipts);\n    const theaters = new Set();\n    const theaterTotals = {};\n\n    \/\/ First pass: collect all theaters and calculate total flow per theater\n    years.forEach(year => {\n        Object.keys(graphable_receipts[year]).forEach(theater => {\n            theaters.add(theater);\n            if (!theaterTotals[theater]) {\n                theaterTotals[theater] = 0;\n            }\n            theaterTotals[theater] += graphable_receipts[year][theater].graphable;\n        });\n    });\n\n    \/\/ Sort theaters by total flow value (descending)\n    const sortedTheaters = Array.from(theaters).sort((a, b) => {\n        return theaterTotals[b] - theaterTotals[a];\n    });\n\n    \/\/ Prepare datasets for Chart.js\n    const datasets = [];\n    const colorPalette = [\n        'rgba(255, 99, 132, 0.7)',\n        'rgba(54, 162, 235, 0.7)',\n        'rgba(255, 206, 86, 0.7)',\n        'rgba(75, 192, 192, 0.7)',\n        'rgba(153, 102, 255, 0.7)',\n        'rgba(255, 159, 64, 0.7)'\n    ];\n\n    \/\/ Create a dataset for each theater in order of total flow\n    sortedTheaters.forEach((theater, index) => {\n        const data = years.map(year => {\n            if (graphable_receipts[year][theater]) {\n                return graphable_receipts[year][theater].graphable;\n            }\n            return 0;\n        });\n\n        datasets.push({\n            label: theater,\n            data: data,\n            backgroundColor: colorPalette[index % colorPalette.length],\n            borderColor: colorPalette[index % colorPalette.length].replace('0.7', '1.0'),\n            borderWidth: 1\n        });\n    });\n\n    \/\/ Create and render the chart\n    const ctx = document.getElementById('receiptsChart').getContext('2d');\n    receiptsChart = new Chart(ctx, {\n        type: 'bar',\n        data: {\n            labels: years,\n            datasets: datasets\n        },\n        options: {\n            responsive: true,\n            maintainAspectRatio: false,\n            plugins: {\n                title: {\n                    display: true,\n                    text: 'Theatre Receipts by Season'\n                },\n                tooltip: {\n                    callbacks: {\n                        label: function(context) {\n                            const year = context.label;\n                            const theater = context.dataset.label;\n                            const value = context.raw;\n\n                            if (value > 0 && graphable_receipts[year][theater]) {\n                                return `${theater}: ${graphable_receipts[year][theater].formatted}`;\n                            }\n                            return `${theater}: \u00a30`;\n                        }\n                    }\n                },\n                legend: {\n                    display: true,\n                    position: 'top',\n                }\n            },\n            scales: {\n                x: {\n                    title: {\n                        display: true,\n                        text: 'Season'\n                    },\n                    stacked: true\n                },\n                y: {\n                    title: {\n                        display: true,\n                        text: 'Receipts (\u00a3)'\n                    },\n                    stacked: true,\n                    beginAtZero: true\n                }\n            }\n        }\n    });\n\n    \/\/ Function to update chart based on year range\n    window.updateChart = function(startYear, endYear) {\n        \/\/ Filter years based on range\n        const filteredYears = years.filter(year => {\n            return year >= startYear && year <= endYear;\n        });\n\n        \/\/ Update each dataset with filtered data\n        datasets.forEach(dataset => {\n            const theater = dataset.label;\n            dataset.data = filteredYears.map(year => {\n                if (graphable_receipts[year][theater]) {\n                    return graphable_receipts[year][theater].graphable;\n                }\n                return 0;\n            });\n        });\n\n        \/\/ Update chart labels and redraw\n        receiptsChart.data.labels = filteredYears;\n        receiptsChart.update();\n    };\n}\n\ndocument.addEventListener('DOMContentLoaded', function() {\n    bootLineGraph({\"1808-1809\":{\"Drury Lane\":{\"formatted\":\"\\u00a33,375 6s\",\"graphable\":3375.3}}});\n});\n<\/script>\n<\/div>\n","total_work_receipts":"\u00a33,375 6s","export_link":"\/api\/filters\/plays\/export\/?from=1732&to=1809&works[]=6034","graphable_receipts":{"1808-1809":{"Drury Lane":{"formatted":"\u00a33,375 6s","graphable":3375.3}}},"notes":null,"date_range_receipts_ratio":100,"from_year":1732,"to_year":1809,"date_ranged_total_work_receipts":"\u00a33,375 6s","date_ranged_covent_garden_revenue":"\u00a30","date_ranged_drury_lane_revenue":"\u00a33,375 6s","date_ranged_covent_garden_ratio":0,"date_ranged_drury_lane_ratio":100,"covent_garden_ratio":0,"drury_lane_ratio":100,"covent_garden_revenue":"\u00a30","drury_lane_revenue":"\u00a33,375 6s","work_year":"1809","activity_people":[{"activity_full":{"id":5,"label":"Author","slug":"author","created_at":"2022-11-02T00:33:17.000000Z","updated_at":"2024-12-17T11:10:03.000000Z","description":"AKA \u2018playwright\u2019 or \u2018poet\u2019. A writer of plays (mainpieces or afterpieces). Most were free agents, although a small number held quasi-formal positions vis-\u00e0-vis a certain theatre, or received some form of regular remuneration in exchange for a ready supply of plays."},"activity":"Author","person":"Richard Leigh","person_id":19584,"start_date":null,"start_date_year":null}],"pairings":{"performances":[],"total_performances":20,"covent_garden_performances":0,"drury_lane_performances":20,"date_ranged_total_performances":19,"date_ranged_covent_garden_performances":0,"date_ranged_drury_lane_performances":19,"from_year":1732,"to_year":1809},"performance_name":"Unknown Performance","theatres":[1,2],"this_genre_colour":"#0048ff","date_type":"Performed"}