From 3f037a4426f17c0f542a06daceecead29e63803f Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Sat, 11 Apr 2020 20:16:44 -0700 Subject: document from json improvements and documentation --- src/client/views/nodes/ImageBox.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/client/views/nodes/ImageBox.tsx') diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index c45f14975..de1640027 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -186,9 +186,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent { const converter = (results: any) => { - const faceDocs = new List(); - results.reduce((face: CognitiveServices.Image.Face, faceDocs: List) => faceDocs.push(Docs.Get.DocumentHierarchyFromJson(face, `Face: ${face.faceId}`, undefined, false)!), new List()); - return faceDocs; + return results.map((face: CognitiveServices.Image.Face) => Docs.Get.FromJson({ data: face, title: `Face: ${face.faceId}` })!); }; this.url && CognitiveServices.Image.Appliers.ProcessImage(this.dataDoc, [this.fieldKey + "-faces"], this.url, Service.Face, converter); } -- cgit v1.2.3-70-g09d2