Skip to content

Commit

Permalink
- Added tbody
Browse files Browse the repository at this point in the history
- added important to table and tbody height
  • Loading branch information
mentalilll committed Feb 28, 2024
1 parent f943987 commit 8e0be42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
18 changes: 6 additions & 12 deletions dist/chart.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ha-card.vpd-chart-view, ha-card.vpd-chart-view .vpd-card-container {
height: 100%;
min-height: 400px;
overflow:hidden;
}
.vpd-chart-view .gray-danger-zone {
Expand All @@ -26,14 +25,16 @@ ha-card.vpd-chart-view, ha-card.vpd-chart-view .vpd-card-container {
background-color: #1a6c9c;
}


.vpd-chart-view table {
width: 100%;
height: 100%;
}
.vpd-chart-view table {
height: 100% !important;
border: 0;
border-collapse: collapse;
}
.vpd-chart-view table tbody {
height:100% !important;
}
.vpd-chart-view .history-circle {
display:none;
}
Expand Down Expand Up @@ -149,15 +150,8 @@ ha-card.vpd-chart-view, ha-card.vpd-chart-view .vpd-card-container {
.vpd-chart-view .axes .temperature-axis .temperature-axis-label:last-child {
border-bottom:0;
}
.vpd-chart-view .vpd-table {
width: 100%;
height: 100%;
}
.vpd-chart-view .vpd-table tbody {
height:100%;
}

.vpd-chart-view #sensors,.vpd-chart-view #ghostmap {
.vpd-chart-view #sensors,.vpd-chart-view #ghostmap {
width:100%;
height:100%;
position:absolute;
Expand Down
6 changes: 2 additions & 4 deletions dist/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,21 @@ export const chart = {
table.className = 'vpd-table';

const fragment = document.createDocumentFragment();
let html = '';
let html = '<tbody>';
for (let Tair = this.min_temperature; Tair <= this.max_temperature; Tair += this.steps_temperature) {
const Tleaf = Tair - 2;
html += '<tr>';

for (let RH = this.max_humidity; RH >= this.min_humidity; RH -= this.steps_humidity) {
const key = `${Tleaf}-${Tair}-${RH}`;
let vpd = this.calculateVPD(Tleaf, Tair, RH).toFixed(2);
const phaseClass = this.getPhaseClass(vpd);
html += `<td class="cell ${phaseClass}" data-air="${Tair}" data-leaf="${Tleaf}" data-rh="${RH}" data-vpd="${vpd}"></td>`;
}

html += '</tr>';
}


table.innerHTML = html;
table.innerHTML = html + '</tbody>';
return table;
},
buildTooltip() {
Expand Down

0 comments on commit 8e0be42

Please sign in to comment.