Skip to content

Commit

Permalink
rename legend contants
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasi committed May 3, 2023
1 parent b0e8700 commit 2ece8ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions src/legendControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}]
})
Expand Down
5 changes: 3 additions & 2 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2ece8ae

Please sign in to comment.