Skip to content

Commit

Permalink
wide view & grid and load alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
molikk committed Dec 19, 2024
1 parent df0d699 commit ce8dfe8
Show file tree
Hide file tree
Showing 2 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.

8 changes: 4 additions & 4 deletions src/cards/compact-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ export const compactCard = (config: PowerFlowCardConfig, inverterImg: string, da
let cardWidth = data.panelMode === true ? data.cardWidth : '100%';

function gridXTransform() {
return config.align_grid ? calculated_minX - minX : 0;
return config.align_grid || config.wide_view_mode ? calculated_minX - minX : 0;
}

function loadXTransform() {
return config.align_load ? width - calculated_width : 0;
return config.align_load || config.wide_view_mode ? width - calculated_width : 0;
}

function mainXTransform() {
Expand Down Expand Up @@ -82,7 +82,7 @@ export const compactCard = (config: PowerFlowCardConfig, inverterImg: string, da
${Grid.generateShapeAndName(data, config)}
${Grid.generateDailyImport(data, config)}
${Grid.generateDailyExport(data, config)}
${Grid.generateFlowLines(data, config, gridXTransform()+mainXTransform())}
${Grid.generateFlowLines(data, config, gridXTransform() + mainXTransform())}
${Grid.generateIcon(data, config)}
${Grid.generateEnergyCost(data, config)}
${Grid.generatePhases(data, config)}
Expand Down Expand Up @@ -209,7 +209,7 @@ export const compactCard = (config: PowerFlowCardConfig, inverterImg: string, da
}
${Load.generateShapeAndName(data, config)}
${Load.generateFlowLines(data, config, loadXTransform()-mainXTransform())}
${Load.generateFlowLines(data, config, loadXTransform() - mainXTransform())}
${Load.generateIcon(data, config)}
${Load.generatePowers(data, config)}
${Load.generateTotalLoad(data, config)}
Expand Down

0 comments on commit ce8dfe8

Please sign in to comment.