Skip to content

Commit

Permalink
define geo point regex outside of the component
Browse files Browse the repository at this point in the history
  • Loading branch information
c-milocanovich committed Jun 14, 2024
1 parent 0700995 commit 16ffe20
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
16 changes: 0 additions & 16 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -932,10 +932,6 @@ export namespace Components {
* Allow the points to be selected by clicking on the graphic (columns, point markers, pie slices, map areas etc).
*/
"allowPointSelect": boolean;
/**
* A CSS class to set as the element class.
*/
"cssClass": string;
/**
* Description of the QueryViewer
*/
Expand Down Expand Up @@ -982,10 +978,6 @@ export namespace Components {
* If region = Country, this is the country to display in the map
*/
"country": QueryViewerCountry;
/**
* A CSS class to set as the `gx-query-viewer-map` element class.
*/
"cssClass": string;
/**
* Description of the QueryViewer
*/
Expand Down Expand Up @@ -2669,10 +2661,6 @@ declare namespace LocalJSX {
* Allow the points to be selected by clicking on the graphic (columns, point markers, pie slices, map areas etc).
*/
"allowPointSelect"?: boolean;
/**
* A CSS class to set as the element class.
*/
"cssClass"?: string;
/**
* Description of the QueryViewer
*/
Expand Down Expand Up @@ -2731,10 +2719,6 @@ declare namespace LocalJSX {
* If region = Country, this is the country to display in the map
*/
"country"?: QueryViewerCountry;
/**
* A CSS class to set as the `gx-query-viewer-map` element class.
*/
"cssClass"?: string;
/**
* Description of the QueryViewer
*/
Expand Down
5 changes: 0 additions & 5 deletions src/components/query-viewer-map/query-viewer-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ export class QueryViewerMap {
*/
@Prop() readonly allowPointSelect: boolean = false;

/**
* A CSS class to set as the element class.
*/
@Prop() readonly cssClass: string;

/**
* Description of the QueryViewer
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
QueryViewerServiceResponse
} from "@genexus/reporting-api";

const GEOPOINT_REGEX = /\(([^ ]+) ([^)]+)\)/;

@Component({
tag: "gx-query-viewer-map-render"
})
Expand All @@ -29,11 +31,6 @@ export class QueryViewerMapRender {
*/
@Prop() readonly country: QueryViewerCountry;

/**
* A CSS class to set as the `gx-query-viewer-map` element class.
*/
@Prop() readonly cssClass: string;

/**
* Description of the QueryViewer
*/
Expand Down Expand Up @@ -119,8 +116,7 @@ export class QueryViewerMapRender {
const key = row[axesDataField].trim();
const value = Number(row[dataField]);

const regex = /\(([^ ]+) ([^)]+)\)/;
const matches = key.match(regex);
const matches = key.match(GEOPOINT_REGEX);

if (matches) {
const [, longitude, latitude] = matches;
Expand Down Expand Up @@ -177,7 +173,6 @@ export class QueryViewerMapRender {
return (
<Host>
<gx-query-viewer-map
cssClass={this.cssClass}
description={this.description}
mapType={this.mapType}
queryTitle={this.queryTitle}
Expand Down

0 comments on commit 16ffe20

Please sign in to comment.