diff options
| author | Abdullah Ahmed <abdullah_ahmed@brown.edu> | 2019-08-13 11:12:41 -0400 |
|---|---|---|
| committer | Abdullah Ahmed <abdullah_ahmed@brown.edu> | 2019-08-13 11:12:41 -0400 |
| commit | 843ac47f04f8c9bd687600f9f07fe4c15744e4ec (patch) | |
| tree | 7d27a7d34a55fbb633d48da60851338a52b13049 /src/Recommendations.tsx | |
| parent | 6c8b7a4e74068178b0f6ca9e491441bf982b4622 (diff) | |
recommendations
Diffstat (limited to 'src/Recommendations.tsx')
| -rw-r--r-- | src/Recommendations.tsx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Recommendations.tsx b/src/Recommendations.tsx new file mode 100644 index 000000000..ca1123ef9 --- /dev/null +++ b/src/Recommendations.tsx @@ -0,0 +1,28 @@ +import { observer } from "mobx-react"; +import React = require("react"); +import { Doc } from "./new_fields/Doc"; +import { NumCast } from "./new_fields/Types"; + +export interface RecProps { + documents: { preview: string, similarity: number }[], + node: Doc; +} + +@observer +export class Recommendations extends React.Component<RecProps> { + render() { + const transform = "translate(" + (NumCast(this.props.node.x) + 350) + "px, " + NumCast(this.props.node.y) + "px" + return ( + <div className="rec-scroll" style={{ transform: transform }}> + {this.props.documents.map(doc => { + return ( + <div className="recommendation-content"> + <img src={doc.preview} /> + <div>{doc.similarity}</div> + </div> + ) + })} + </div> + ) + } +}
\ No newline at end of file |
