{"id":4737,"date":"2026-02-17T05:16:03","date_gmt":"2026-02-17T05:16:03","guid":{"rendered":"https:\/\/empeiroscapital.com\/?page_id=4737"},"modified":"2026-02-17T08:22:38","modified_gmt":"2026-02-17T08:22:38","slug":"dashboard","status":"publish","type":"page","link":"https:\/\/empeiroscapital.com\/?page_id=4737","title":{"rendered":"Dashboard"},"content":{"rendered":"\n<div id=\"tracker-container\" style=\"font-family: sans-serif; border: 1px solid #ddd; padding: 20px; border-radius: 10px; background: #fff; max-width: 600px; margin: auto;\">\n    <h2 style=\"text-align:center;\">\ud83d\udcca Asset Flow Tracker<\/h2>\n    <div id=\"update-time\" style=\"text-align:center; color:#888; font-size:12px; margin-bottom:10px;\">Loading&#8230;<\/div>\n    <div id=\"strategy-box\" style=\"background:#f0f7ff; padding:15px; border-radius:8px; margin-bottom:20px; font-weight:bold; color:#004085; border-left: 5px solid #007bff;\">Initializing&#8230;<\/div>\n    <table style=\"width:100%; border-collapse:collapse;\">\n        <thead>\n            <tr style=\"border-bottom:2px solid #333;\">\n                <th style=\"text-align:left; padding:10px;\">Asset (Click for Details)<\/th>\n                <th style=\"text-align:right; padding:10px;\">Net Flow ($M)<\/th>\n            <\/tr>\n        <\/thead>\n        <tbody id=\"flow-table\"><\/tbody>\n    <\/table>\n<\/div>\n\n<script>\n\/\/ Toggle function for the detail rows\nwindow.toggleDetails = (id) => {\n    const el = document.getElementById('details-' + id);\n    if (el) {\n        el.style.display = (el.style.display === 'none' || el.style.display === '') ? 'table-row' : 'none';\n    }\n};\n\nconst loadData = async () => {\n    try {\n        \/\/ REPLACE 'fund_flows.json' with the actual URL to your JSON file\n        const JSON_URL = 'fund_flows.json'; \n        const res = await fetch('https:\/\/empeiroscapital.com\/scripts\/fund_data.json?t=' + new Date().getTime(), {\n                cache: 'no-cache'\n            });\n\n        \n        if (!res.ok) throw new Error(\"Could not load data\");\n        \n        const data = await res.json();\n\n        \/\/ Update Header Info\n        document.getElementById('update-time').innerText = \"Last Updated: \" + data.last_updated;\n        document.getElementById('strategy-box').innerText = \"Strategy: \" + data.strategy;\n\n        const tableBody = document.getElementById('flow-table');\n        let htmlContent = ''; \/\/ Build string first for better performance\n\n        data.assets.forEach(asset => {\n            const color = asset.net >= 0 ? '#28a745' : '#dc3545';\n            const safeId = asset.class.replace(\/[^a-zA-Z0-9]\/g, ''); \/\/ Robust ID naming\n            const hasDetails = asset.top_5 && asset.top_5.length > 0;\n\n            \/\/ Main Row\n            htmlContent += `\n                <tr style=\"border-bottom:1px solid #eee; cursor:${hasDetails ? 'pointer' : 'default'};\" \n                    onclick=\"${hasDetails ? `toggleDetails('${safeId}')` : ''}\">\n                    <td style=\"padding:12px 10px; font-weight:500;\">\n                        ${asset.class} ${hasDetails ? '<span style=\"font-size:10px; color:#007bff;\">[\u25bc Details]<\/span>' : ''}\n                    <\/td>\n                    <td style=\"padding:12px 10px; text-align:right; color:${color}; font-weight:bold;\">\n                        ${asset.net > 0 ? '+' : ''}${asset.net}M\n                    <\/td>\n                <\/tr>`;\n\n            \/\/ Hidden Details Row\n            if (hasDetails) {\n                htmlContent += `\n                    <tr id=\"details-${safeId}\" style=\"display:none; background:#fcfcfc; font-size:13px;\">\n                        <td colspan=\"2\" style=\"padding:15px; border-bottom:1px solid #eee;\">\n                            <strong style=\"display:block; margin-bottom:8px; color:#555;\">Top 5 Holdings\/Inflows:<\/strong>\n                            <ul style=\"list-style:none; padding:0; margin:0;\">\n                                ${asset.top_5.map(item => `\n                                    <li style=\"padding:3px 0; border-bottom:1px dashed #ddd; display:flex; justify-content:space-between;\">\n                                        <span>\u2022 ${item.name}<\/span>\n                                        <span style=\"font-weight:bold; color:#28a745;\">+${item.flow}M<\/span>\n                                    <\/li>\n                                `).join('')}\n                            <\/ul>\n                        <\/td>\n                    <\/tr>`;\n            }\n        });\n\n        tableBody.innerHTML = htmlContent;\n\n    } catch (err) {\n        console.error(err);\n        document.getElementById('strategy-box').innerText = \"Error loading data. Check file path.\";\n        document.getElementById('strategy-box').style.color = \"red\";\n    }\n};\n\n\/\/ Start the load\nloadData();\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udcca Asset Flow Tracker Loading&#8230; Initializing&#8230; Asset (Click for Details) Net Flow ($M)<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-4737","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=\/wp\/v2\/pages\/4737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4737"}],"version-history":[{"count":9,"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=\/wp\/v2\/pages\/4737\/revisions"}],"predecessor-version":[{"id":4761,"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=\/wp\/v2\/pages\/4737\/revisions\/4761"}],"wp:attachment":[{"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}