From 2ece8ae3deb9b772a6ba6ef738173188d0caa940 Mon Sep 17 00:00:00 2001 From: Vasi Date: Wed, 3 May 2023 13:51:03 +0200 Subject: [PATCH] rename legend contants --- src/constants.ts | 8 ++++---- src/legendControl.ts | 4 ++-- src/settings.ts | 5 +++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index ec80620a..8a5b93fa 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -4,8 +4,8 @@ export module constants { export const MAX_SELECTION_COUNT = 1000; export const MAPBOX_CTRL_ICON_CLASS = 'mapboxgl-ctrl-icon'; export const CONTROL_BUTTON_LASSO = 'mapbox-gl-draw_lasso'; - export const DEFAULT_HOR_WIDTH = 550 - export const DEFAULT_HOR_HEIGHT = 50 - export const DEFAULT_VER_WIDTH = 124 - export const DEFAULT_VER_HEIGHT = 180 + export const DEFAULT_HOR_LEGEND_WIDTH = 550 + export const DEFAULT_HOR_LEGEND_HEIGHT = 50 + export const DEFAULT_VER_LEGEND_WIDTH = 124 + export const DEFAULT_VER_LEGEND_HEIGHT = 180 } diff --git a/src/legendControl.ts b/src/legendControl.ts index 6658cc2b..4fdca1fc 100644 --- a/src/legendControl.ts +++ b/src/legendControl.ts @@ -227,8 +227,8 @@ export class LegendControl { objectName: "legends", selector: null, properties: { - legendWidth: settings.orientation === "row" ? constants.DEFAULT_HOR_WIDTH : constants.DEFAULT_VER_WIDTH, - legendHeight: settings.orientation === "row" ? constants.DEFAULT_HOR_HEIGHT : constants.DEFAULT_VER_HEIGHT, + legendWidth: settings.orientation === "row" ? constants.DEFAULT_HOR_LEGEND_WIDTH : constants.DEFAULT_VER_LEGEND_WIDTH, + legendHeight: settings.orientation === "row" ? constants.DEFAULT_HOR_LEGEND_HEIGHT : constants.DEFAULT_VER_LEGEND_HEIGHT, } }] }) diff --git a/src/settings.ts b/src/settings.ts index a0fb7a83..ad2abc08 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -30,6 +30,7 @@ import { dataViewObjectsParser } from "powerbi-visuals-utils-dataviewutils"; import DataViewObjectsParser = dataViewObjectsParser.DataViewObjectsParser; import powerbiVisualsApi from "powerbi-visuals-api"; import { RoleMap } from "./roleMap" +import { constants } from "./constants" export class MapboxSettings extends DataViewObjectsParser { public static roleMap: RoleMap; @@ -520,8 +521,8 @@ export class RasterSettings { } export class LegendSettings { - public legendWidth: number = 124; - public legendHeight: number = 180; + public legendWidth: number = constants.DEFAULT_VER_LEGEND_WIDTH; + public legendHeight: number = constants.DEFAULT_VER_LEGEND_HEIGHT; public orientation: string = "column"; public alignment: string = "left"; public opacity: number = 80;