Skip to content

Commit

Permalink
Merge pull request #926 from unitaryfund/bug_fixes
Browse files Browse the repository at this point in the history
Minor bug fixes
  • Loading branch information
WrathfulSpatula authored Jun 21, 2024
2 parents c09858c + 6e004f2 commit b4213bc
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 44 deletions.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"chartjs-adapter-moment": "^1.0.0",
"chartjs-chart-error-bars": "3.8.0",
"chartjs-plugin-annotation": "^2.2.1",
"chartjs-plugin-datalabels": "^2.0.0",
"chartjs-plugin-datalabels": "^2.2.0",
"css-loader": "^6.5.1",
"css-minimizer-webpack-plugin": "^3.2.0",
"d3": "^7.8.5",
Expand Down
28 changes: 14 additions & 14 deletions src/components/MainNavLeft.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ const MainNavLeft = () => {
<Nav className='metriq-navbar'>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/Tasks' className='metriq-navbar-text' eventKey='1'>Tasks</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/Methods' className='metriq-navbar-text' eventKey='2'>Methods</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/DataSets' className='metriq-navbar-text' eventKey='13'>Data Sets</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/Platforms' className='metriq-navbar-text' eventKey='3'>Platforms</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/Tags' className='metriq-navbar-text' eventKey='4'>Tags</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/Submissions' className='metriq-navbar-text' eventKey='5'>Submissions</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/Progress' className='metriq-navbar-text' eventKey='11'>Progress</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/Sota' className='metriq-navbar-text' eventKey='12'>SOTA</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/QEDC' className='metriq-navbar-text' eventKey='10'>QED-C</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/DataSets' className='metriq-navbar-text' eventKey='3'>Data Sets</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/Platforms' className='metriq-navbar-text' eventKey='4'>Platforms</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/Tags' className='metriq-navbar-text' eventKey='5'>Tags</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/Submissions' className='metriq-navbar-text' eventKey='6'>Submissions</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/Progress' className='metriq-navbar-text' eventKey='7'>Progress</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/Sota' className='metriq-navbar-text' eventKey='8'>SOTA</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/QEDC' className='metriq-navbar-text' eventKey='9'>QED-C</Nav.Link>
<Nav.Link as={NavLink} activeClassName='active-navlink' to='/VQA' className='metriq-navbar-text' eventKey='10'>VQA</Nav.Link>
<NavDropdown id='metriq-navbar-dropdown' title='About' active='true' className='metriq-navbar-text' alignRight>
<NavDropdown.Item as={NavLink} activeClassName='active-dropdown-navlink' to='/About' eventKey='6'><p className='font-weight-bold'>About</p></NavDropdown.Item>
<NavDropdown.Item as={NavLink} activeClassName='active-dropdown-navlink' to='/Partners' eventKey='7'><p className='font-weight-bold'>Partners</p></NavDropdown.Item>
<NavDropdown.Item as={NavLink} activeClassName='active-dropdown-navlink' to='/FAQ' eventKey='8'><p className='font-weight-bold'>F.A.Q.</p></NavDropdown.Item>
<NavDropdown.Item as={NavLink} activeClassName='active-dropdown-navlink' to='/UserGuidelines' eventKey='9'><p className='font-weight-bold'>User Guidelines</p></NavDropdown.Item>
<NavDropdown.Item as={NavLink} activeClassName='active-dropdown-navlink' to='/About' eventKey='11'><p className='font-weight-bold'>About</p></NavDropdown.Item>
<NavDropdown.Item as={NavLink} activeClassName='active-dropdown-navlink' to='/Partners' eventKey='12'><p className='font-weight-bold'>Partners</p></NavDropdown.Item>
<NavDropdown.Item as={NavLink} activeClassName='active-dropdown-navlink' to='/FAQ' eventKey='13'><p className='font-weight-bold'>F.A.Q.</p></NavDropdown.Item>
<NavDropdown.Item as={NavLink} activeClassName='active-dropdown-navlink' to='/UserGuidelines' eventKey='14'><p className='font-weight-bold'>User Guidelines</p></NavDropdown.Item>
</NavDropdown>
<span className='metriq-navbar-spacer' />
<Nav.Link href='https://twitter.com/MetriqInfo' eventKey='10'> <FaTwitter color={`${'white'}`} size={25} className='metriq-navbar-social-icon' /> </Nav.Link>
<Nav.Link href='http://discord.unitary.fund' eventKey='11'> <FaDiscord color={`${'white'}`} size={25} className='metriq-navbar-social-icon' /> </Nav.Link>
<Nav.Link href='https://github.com/unitaryfund/metriq-app' eventKey='12'> <FaGithub color={`${'white'}`} size={25} className='metriq-navbar-social-icon' /> </Nav.Link>
<Nav.Link href='https://twitter.com/MetriqInfo' eventKey='15'> <FaTwitter color={`${'white'}`} size={25} className='metriq-navbar-social-icon' /> </Nav.Link>
<Nav.Link href='http://discord.unitary.fund' eventKey='16'> <FaDiscord color={`${'white'}`} size={25} className='metriq-navbar-social-icon' /> </Nav.Link>
<Nav.Link href='https://github.com/unitaryfund/metriq-app' eventKey='17'> <FaGithub color={`${'white'}`} size={25} className='metriq-navbar-social-icon' /> </Nav.Link>
</Nav>
)
}
Expand Down
18 changes: 9 additions & 9 deletions src/components/QuantumLandscapeChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const domainIndex = {
const breakpoint = 1250
let isMobile = window.outerWidth < breakpoint
let svg, d
let _subsetName = "All data"
let _subsetName = 'All data'
let areLabelsVisible = false
function onSwitchClick () {
areLabelsVisible = !areLabelsVisible
Expand Down Expand Up @@ -101,8 +101,8 @@ function scatterplot (
.map(function (obj, index) {
return { ...obj, id: `ID_${index + 1}` }
})
if (_subsetName !== "All data") {
data = data.filter((x) => (x.subsetName.toLowerCase() === _subsetName.toLowerCase()) || (x.subsetName.toLowerCase() === "both"))
if (_subsetName !== 'All data') {
data = data.filter((x) => (x.subsetName.toLowerCase() === _subsetName.toLowerCase()) || (x.subsetName.toLowerCase() === 'both'))
}

// define aesthetic mappings
Expand Down Expand Up @@ -756,7 +756,7 @@ function legend (circleSizeFields = 8) {

function QuantumLandscapeChart () {
const [tableJson, setTableJson] = React.useState([])
const [subsetName, setsubsetName] = React.useState("All data")
const [subsetName, setsubsetName] = React.useState('All data')
React.useEffect(() => {
// Draw scatterplot from data
d3.csv(progressCsv, (_d) => ({
Expand Down Expand Up @@ -801,17 +801,17 @@ function QuantumLandscapeChart () {
</div>
</div>
<div className='row'>
<div className='col'/>
<div className='col' />
<div className='col text-left'>
<input type="radio" value="All data" onChange={onMetricSelectChange} checked={subsetName === "All data"} /> All resource estimates
<input type='radio' value='All data' onChange={onMetricSelectChange} checked={subsetName === 'All data'} /> All resource estimates
</div>
<div className='col text-left'>
<input type="radio" value="Classically intractable" onChange={onMetricSelectChange} checked={subsetName === "Classically intractable"} /> Classically intractable problems
<input type='radio' value='Classically intractable' onChange={onMetricSelectChange} checked={subsetName === 'Classically intractable'} /> Classically intractable problems
</div>
<div className='col text-left'>
<input type="radio" value="Quantum advantage" onChange={onMetricSelectChange} checked={subsetName === "Quantum advantage"} /> Useful problems
<input type='radio' value='Quantum advantage' onChange={onMetricSelectChange} checked={subsetName === 'Quantum advantage'} /> Useful problems
</div>
<div className='col'/>
<div className='col' />
</div>
<div id='cargo'>
<div id='my_dataviz' />
Expand Down
8 changes: 4 additions & 4 deletions src/components/SotaChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ class SotaChart extends React.Component {
d.sort((a, b) => (a.circuitDepth > b.circuitDepth) ? 1 : -1)
} else if (state.subset === 'platform') {
d.sort((a, b) => (a.platform > b.platform) ? 1 : -1)
} else {
} else if (state.subset === 'method') {
d.sort((a, b) => (a.method > b.method) ? 1 : -1)
}
for (let i = 0; i < d.length; ++i) {
Expand All @@ -407,7 +407,7 @@ class SotaChart extends React.Component {
key = d[i].circuitDepth ? d[i].circuitDepth.toString() : 'Uncategorized'
} else if (state.subset === 'platform') {
key = d[i].platform ? d[i].platform.toString() : 'Uncategorized'
} else {
} else if (state.subset === 'method') {
key = d[i].method ? d[i].method.toString() : 'Uncategorized'
}
if (subsets[key]) {
Expand Down Expand Up @@ -712,8 +712,8 @@ class SotaChart extends React.Component {
return 1
}

const mda = new Date(a.evaluatedAt ? a.evaluatedAt : a.createdAt)
const mdb = new Date(b.evaluatedAt ? b.evaluatedAt : b.createdAt)
const mda = new Date(a.evaluatedAt ? a.evaluatedAt : a.createdAt.substring(0, 10))
const mdb = new Date(b.evaluatedAt ? b.evaluatedAt : b.createdAt.substring(0, 10))
if (mda < mdb) {
return -1
}
Expand Down
4 changes: 2 additions & 2 deletions src/views/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Home extends React.Component {
alphabetical: [],
allNames: [],
platforms: [],
featured: [34, 50, 164],
featured: [34, 50, 51],
trending: [],
popular: [],
latest: [],
Expand Down Expand Up @@ -136,7 +136,7 @@ class Home extends React.Component {
<FeaturedTask
taskId={taskId}
index={index}
isLog={index < 2}
isLog
logBase={(index === 0) ? '2' : '10'}
isLoggedIn={this.props.isLoggedIn}
/>
Expand Down

0 comments on commit b4213bc

Please sign in to comment.