diff --git a/src/components/QuantumLandscapeChart.js b/src/components/QuantumLandscapeChart.js index c9e1112..fd2b5d9 100644 --- a/src/components/QuantumLandscapeChart.js +++ b/src/components/QuantumLandscapeChart.js @@ -39,10 +39,7 @@ const domainIndex = { const breakpoint = 1250 let isMobile = window.outerWidth < breakpoint let svg, d - -let _isIntractable = true -let _isAdvantage = true - +let _subsetName = "All data" let areLabelsVisible = false function onSwitchClick () { areLabelsVisible = !areLabelsVisible @@ -104,13 +101,8 @@ function scatterplot ( .map(function (obj, index) { return { ...obj, id: `ID_${index + 1}` } }) - - if (!_isAdvantage && !_isIntractable) { - data = data.filter((x) => x.subsetName.toLowerCase() === 'other') - } else if (!_isAdvantage) { - data = data.filter((x) => (x.subsetName.toLowerCase() === 'other') || (x.subsetName.toLowerCase() === 'classically intractable')) - } else if (!_isIntractable) { - data = data.filter((x) => (x.subsetName.toLowerCase() === 'other') || (x.subsetName.toLowerCase() === 'quantum advantage')) + if (_subsetName !== "All data") { + data = data.filter((x) => x.subsetName.toLowerCase() === _subsetName.toLowerCase()) } // define aesthetic mappings @@ -764,8 +756,7 @@ function legend (circleSizeFields = 8) { function QuantumLandscapeChart () { const [tableJson, setTableJson] = React.useState([]) - const [isAdvantage, setIsAdvantage] = React.useState(true) - const [isIntractable, setIsIntractable] = React.useState(true) + const [subsetName, setsubsetName] = React.useState("All data") React.useEffect(() => { // Draw scatterplot from data d3.csv(progressCsv, (_d) => ({ @@ -796,15 +787,9 @@ function QuantumLandscapeChart () { setTableJson(_d) }) }, []) - - function onIntractableClick (e) { - setIsIntractable(e.target.checked) - _isIntractable = e.target.checked - redraw() - } - function onAdvantageClick (e) { - setIsAdvantage(e.target.checked) - _isAdvantage = e.target.checked + function onMetricSelectChange (e) { + setsubsetName(e.target.value) + _subsetName = e.target.value redraw() } @@ -815,6 +800,19 @@ function QuantumLandscapeChart () {

Quantum Computers: What We Need and What We Have

+
+
+
+ All Data +
+
+ Classically intractable +
+
+ Quantum advantage +
+
+
@@ -834,20 +832,6 @@ function QuantumLandscapeChart () {
-
- Classically intractable
- -
-
- Quantum advantage
- -