From 7edcc150d013343cb7feca49ce43228b99e6c7e5 Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 28 Jul 2023 11:33:06 -0400 Subject: cleanup of compile errors --- .../views/newlightbox/ExploreView/ExploreView.tsx | 53 ++++++++++++---------- 1 file changed, 29 insertions(+), 24 deletions(-) (limited to 'src/client/views/newlightbox/ExploreView') diff --git a/src/client/views/newlightbox/ExploreView/ExploreView.tsx b/src/client/views/newlightbox/ExploreView/ExploreView.tsx index 855bfd9e2..44a0bcd5f 100644 --- a/src/client/views/newlightbox/ExploreView/ExploreView.tsx +++ b/src/client/views/newlightbox/ExploreView/ExploreView.tsx @@ -1,30 +1,35 @@ import './ExploreView.scss'; -import { IBounds, IExploreView, emptyBounds } from "./utils"; -import { IRecommendation } from "../components"; +import { IBounds, IExploreView, emptyBounds } from './utils'; +import { IRecommendation } from '../components'; import * as React from 'react'; import { NewLightboxView } from '../NewLightboxView'; import { StrCast } from '../../../../fields/Types'; - - export const ExploreView = (props: IExploreView) => { - const { recs, bounds=emptyBounds } = props - - return
- {recs && recs.map((rec) => { - console.log(rec.embedding, bounds) - const x_bound: number = Math.max(Math.abs(bounds.max_x), Math.abs(bounds.min_x)) - const y_bound: number = Math.max(Math.abs(bounds.max_y), Math.abs(bounds.min_y)) - console.log(x_bound, y_bound) - if (rec.embedding) { - const x = (rec.embedding.x / x_bound) * 50; - const y = (rec.embedding.y / y_bound) * 50; - console.log(x, y) - return
{}} style={{top: `calc(50% + ${y}%)`, left: `calc(50% + ${x}%)`}}> - {rec.title} -
- } else return (null) - })} -
{StrCast(NewLightboxView.NewLightboxDoc?.title)}
-
-} \ No newline at end of file + const { recs, bounds = emptyBounds } = props; + + return ( +
+ {recs && + recs.map(rec => { + console.log(rec.embedding, bounds); + const x_bound: number = Math.max(Math.abs(bounds.max_x), Math.abs(bounds.min_x)); + const y_bound: number = Math.max(Math.abs(bounds.max_y), Math.abs(bounds.min_y)); + console.log(x_bound, y_bound); + if (rec.embedding) { + const x = (rec.embedding.x / x_bound) * 50; + const y = (rec.embedding.y / y_bound) * 50; + console.log(x, y); + return ( +
{}} style={{ top: `calc(50% + ${y}%)`, left: `calc(50% + ${x}%)` }}> + {rec.title} +
+ ); + } else return null; + })} +
+ {StrCast(NewLightboxView.LightboxDoc?.title)} +
+
+ ); +}; -- cgit v1.2.3-70-g09d2