Skip to content

Commit

Permalink
Merge pull request #6 from dream11/fix/webpage-not-loading
Browse files Browse the repository at this point in the history
fix: webpage not showing comparision chart
  • Loading branch information
mistryswapnil-dream11 authored May 22, 2024
2 parents 6d9a1f7 + bc45035 commit af31223
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ NOTE:
---
## Webpage:
1. The repository has a simple webpage build to compare performance of different react-native versions for rendering N views, texts & images.
2. Please head to https://ideal-invention-lner9k7.pages.github.io/Webpage/index.html to compare the benchmarking numbers.
2. Please head to https://dream11.github.io/rn-benchmarking/Webpage/index.html to compare the benchmarking numbers.
## Contribution:
See [CONTRIBUTION.md](./CONTRIBUTION.md) to learn how to contribute to the repository and the development workflow.
Expand All @@ -140,4 +140,4 @@ See [LICENSE](./LICENSE) to understand more about terms and conditions.
---
## Demo:
Instrested in taking a look at the demonstration!
You can view or download the video from [here](https://ideal-invention-lner9k7.pages.github.io/Demo/RNBenchmarking.mp4).
You can view or download the video from [here](./Demo/RNBenchmarking.mp4).
15 changes: 13 additions & 2 deletions Webpage/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@


const {origin, protocol, host, href} = window.document.location

const isLocalHost = origin.includes("127.0.0.1") || origin.includes('localhost')

const reportsPathSuffix = '/Reports/'
const reportsPath = isLocalHost ? `${origin}${reportsPathSuffix}` : `${origin}${reportsPathSuffix}`

const supportedVersionsPathSuffix = '/Webpage/supportedVersions.json'
const supportedVersionsPath = isLocalHost ? `${origin}${supportedVersionsPathSuffix}` : `${href}${supportedVersionsPathSuffix}`

fetchSupportedVersions().then((data) => {
const versionsContainer = document.getElementById('version-container')

Expand Down Expand Up @@ -39,7 +50,7 @@ fetchSupportedVersions().then((data) => {
})

function fetchSupportedVersions() {
return fetch("./supportedVersions.json")
return fetch(supportedVersionsPath)
.then((response) => response.json())
}

Expand Down Expand Up @@ -90,7 +101,7 @@ function injectDataViews(id, heading, labels, dataLabels, chartsContainer) {
function generateReport() {
const promises = []
const checkboxes = document.querySelectorAll('input[type="checkbox"]:checked');
checkboxes.forEach((checkbox) => promises.push(fetchBenchmarkingData(checkbox.value, `../../Reports/${checkbox.value}.json`)))
checkboxes.forEach((checkbox) => promises.push(fetchBenchmarkingData(checkbox.value, `${reportsPath}${checkbox.value}.json`)))

const charts = document.getElementById("charts-container")

Expand Down

0 comments on commit af31223

Please sign in to comment.