Skip to content
Snippets Groups Projects
Prediction.js 1.28 KiB
Newer Older
Matthieu BELLUCCI's avatar
Matthieu BELLUCCI committed
import { render } from '@testing-library/react';
import './Prediction.css';
import BarChart from './BarChart';
import PredictionTab from './Tabs';
Matthieu BELLUCCI's avatar
Matthieu BELLUCCI committed
function Prediction(props) {
    console.log(props.data);
Matthieu BELLUCCI's avatar
Matthieu BELLUCCI committed
    const bar = <BarChart data={props.arr} barColour="#AAA"/>
    const properties = Object.entries(props.data.prediction.properties);
    const tabList = properties.map(function(x) {return {name: x[0], content: <BarChart data={x[1]}/>};});
    //return (tabList[1][0]["content"]);
    const color = "green";
Matthieu BELLUCCI's avatar
Matthieu BELLUCCI committed
    return (
Matthieu BELLUCCI's avatar
Matthieu BELLUCCI committed

Matthieu BELLUCCI's avatar
Matthieu BELLUCCI committed
    <div className="Prediction">
Matthieu BELLUCCI's avatar
Matthieu BELLUCCI committed
        <div className="UpperPrediction">
            <div className="Image">
                <img 
                src={props.img}
                alt={props.label}
                />
            </div>
            <div className="Label">
                <h1 style={{color:color}}>{props.data.prediction.predicted_class}</h1>
                <p>
                    The model saw a PREDICTED_CLASS and it is CONSISTENCY with the expert knowledge.
                    ----------------- ---------------- ---------------------- -------------------
                </p>
Matthieu BELLUCCI's avatar
Matthieu BELLUCCI committed
            </div>
Matthieu BELLUCCI's avatar
Matthieu BELLUCCI committed
        </div>
Matthieu BELLUCCI's avatar
Matthieu BELLUCCI committed
        <div className="LowerPrediction">
            <PredictionTab  tabList={tabList}/>
Matthieu BELLUCCI's avatar
Matthieu BELLUCCI committed
        </div>
    </div>
    );
}

export default Prediction;