Skip to content

Commit

Permalink
Merge pull request #49 from molikk/fix-main-view-default-width
Browse files Browse the repository at this point in the history
fix main view default width
  • Loading branch information
molikk authored Aug 6, 2024
2 parents 4521a12 + 3292745 commit 462c31a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/mlk-power-flow-card.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/cards/compact-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export const compactCard = (config: PowerFlowCardConfig, inverterImg: string, da
let miny = config.viewbox?.viewbox_min_y ? config.viewbox.viewbox_min_y : ((config.show_solar || data.additionalLoad > 6) ? 0 : (data.additionalLoad > 0 || !config.show_battery ? 80 : 146));
let width = config.viewbox?.viewbox_width
? config.viewbox.viewbox_width
:(config.load.aux_loads > 3 || data.additionalLoad > 13) ? 610
: (config.load.aux_loads > 2 || data.additionalLoad > 8) ? 560 : 510;
:(config.load.aux_loads > 3 || data.additionalLoad > 13) ? 600
: (config.load.aux_loads > 2 || data.additionalLoad > 8) ? 552 : 505;

let height = config.viewbox?.viewbox_height ? config.viewbox.viewbox_height : (config.show_solar ? (config.show_battery ? 408 : (data.additionalLoad >= 2 ? 400 : 300)) : (config.show_battery ? (data.additionalLoad > 0 ? 350 : 271) : 271));

Expand Down
4 changes: 2 additions & 2 deletions src/cards/compact/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { Utils } from '../../helpers/utils';
import { UnitOfPower } from '../../const';

export class Load {
public static readonly LOAD_X = 420;
public static readonly GAP = Load.LOAD_X - 410;
public static readonly LOAD_X = 418;
public static readonly GAP = 8;
public static readonly rowAux: number = 3;
public static readonly row1: number = 35;
public static readonly row2: number = 110;
Expand Down

0 comments on commit 462c31a

Please sign in to comment.