message: Extract location from entity.
diff: @@ -38,6 +38,11 @@ export class FlowIntelViewer implements IComponentHTMLVisual {
  this.insightFound = true;
  }
  const textInsights = this.insights.get("TextAnalytics");
  + // tslint:disable no-inner-html
  + div.innerHTML = this.createHTML(textInsights);
  + }
  +
  + private createHTML(textInsights: any): string {
  const html = `
  <ul>
  <li>
  @@ -46,8 +51,29 @@ export class FlowIntelViewer implements IComponentHTMLVisual {
  <li>
  Sentiment: ${textInsights.sentiment.toFixed(2)}
  </li>
  + ${this.listLocations(textInsights.entities)}
  </ul>`;
  - // tslint:disable no-inner-html
  - div.innerHTML = html;
  + return html;
  + }
  +
  + private listLocations(entities: any[]): string {
  + if (entities === undefined || entities.length === 0) {
  + return "";
  + }
  + const locationSet = new Set<string>();
  + for (const entity of entities) {
  + if (entity.type === "Location") {
  + locationSet.add(entity.name as string);
  + }
  + }
  + if (locationSet.size === 0) {
  + return "";
  + }
  + // const locationList = `<li>Locations:<ul>`;
  + let locationList = "";
  + for (const location of locationSet) {
  + locationList += `<li>${location}</li>`;
  + }
  + return `<li>Locations:<ul>${locationList}</ul></li>`;
  }
  }
  