We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose a single API for PSI to use.
something like:
/** @typedef {import('./dom.js')} DOM */ /** @typedef {import('./psi-renderer.js')} PSIReportRenderer */ /** * @param {string} LHresponseJsonString * @return {Element} */ function renderPerformanceCategoryForPSI(lighthouseResponse) { var lighthouseJson = JSON.parse(lighthouseResponse); const dom = new DOM(document); const reportLHR = JSON.parse(JSON.stringify(lighthouseJson)); reportLHR.reportCategories = Object.values(reportLHR.categories); ReportRenderer.smooshAuditResultsIntoCategories(reportLHR.audits, reportLHR.reportCategories); const perfCategory = reportLHR.reportCategories.find(cat => cat.id === 'performance'); const perfRenderer = new PerformanceCategoryRenderer(dom, new DetailsRenderer(dom)); const perfEl = perfRenderer.render(perfCategory, reportLHR.categoryGroups); const scoreGaugeEl = dom.find('.lh-score__gauge', perfEl); const scoreGaugeWrapper = dom.find('.lh-gauge__wrapper', scoreGaugeEl); scoreGaugeWrapper.classList.add('lh-gauge__wrapper--huge'); scoreGaugeWrapper.removeAttribute('href'); dom.find('.lh-category-header', perfEl).remove(); dom.find('.lh-permalink', perfEl).remove(); const datauri = PerformanceCategoryRenderer.getLastScreenshot(perfCategory); return [scoreGaugeEl, perfEl, datauri]; };
The text was updated successfully, but these errors were encountered:
paulirish
Successfully merging a pull request may close this issue.
Expose a single API for PSI to use.
something like:
The text was updated successfully, but these errors were encountered: