-
-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sessions UI: visualization, month/year charts (#15902)
- Loading branch information
Showing
38 changed files
with
3,271 additions
and
715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { reactive } from "vue"; | ||
|
||
// alternatives | ||
// const COLORS = [ "#40916C", "#52B788", "#74C69D", "#95D5B2", "#B7E4C7", "#D8F3DC", "#081C15", "#1B4332", "#2D6A4F"]; | ||
// const COLORS = ["#577590", "#43AA8B", "#90BE6D", "#F9C74F", "#F8961E", "#F3722C", "#F94144"]; | ||
// const COLORS = ["#0077b6", "#00b4d8", "#90e0ef", "#caf0f8", "#03045e"]; | ||
// const COLORS = [ "#0077B6FF", "#0096C7FF", "#00B4D8FF", "#48CAE4FF", "#90E0EFFF", "#ADE8F4FF", "#CAF0F8FF", "#03045EFF", "#023E8AFF", | ||
// const COLORS = [ "#0077B6FF", "#00B4D8FF", "#90E0EFFF", "#40A578FF", "#9DDE8BFF", "#F8961EFF", "#F9C74FFF", "#E6FF94FF"]; | ||
|
||
const colors = reactive({ | ||
text: null, | ||
muted: null, | ||
border: null, | ||
self: null, | ||
grid: null, | ||
co2PerKWh: null, | ||
pricePerKWh: null, | ||
price: "#FF912FFF", | ||
co2: "#00916EFF", | ||
background: null, | ||
selfPalette: ["#0fde41ff", "#0ba631ff", "#076f20ff", "#054e18ff", "#043611ff", "#02230bff"], | ||
palette: [ | ||
"#03C1EFFF", | ||
"#FD6158FF", | ||
"#31AB4AFF", | ||
"#0AAFBFFF", | ||
"#FF922EFF", | ||
"#0F662DFF", | ||
"#0470D4FF", | ||
"#FFBD2FFF", | ||
"#77C93EFF", | ||
"#41517AFF", | ||
"#4E1D10FF", | ||
"#813504FF", | ||
], | ||
}); | ||
|
||
function updateCssColors() { | ||
const style = window.getComputedStyle(document.documentElement); | ||
colors.text = style.getPropertyValue("--evcc-default-text"); | ||
colors.muted = style.getPropertyValue("--bs-gray-medium"); | ||
colors.border = style.getPropertyValue("--bs-border-color-translucent"); | ||
colors.self = style.getPropertyValue("--evcc-self"); | ||
colors.grid = style.getPropertyValue("--evcc-grid"); | ||
colors.background = style.getPropertyValue("--evcc-background"); | ||
colors.pricePerKWh = style.getPropertyValue("--evcc-grid"); | ||
colors.co2PerKWh = style.getPropertyValue("--evcc-grid"); | ||
} | ||
|
||
// update colors on theme change | ||
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", updateCssColors); | ||
updateCssColors(); | ||
|
||
export const dimColor = (color) => { | ||
return color.toLowerCase().replace(/ff$/, "20"); | ||
}; | ||
|
||
export const fullColor = (color) => { | ||
return color.toLowerCase().replace(/20$/, "ff"); | ||
}; | ||
|
||
export default colors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<div class="root border d-flex gap-1" role="group"> | ||
<slot></slot> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "IconSelectGroup", | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.root { | ||
border-radius: 20px; | ||
padding: 4px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<template> | ||
<div> | ||
<button | ||
type="button" | ||
class="btn gap-2 btn-sm" | ||
:class="{ active, withLabel: !!label }" | ||
:disabled="disabled" | ||
@click="$emit('click', value)" | ||
> | ||
<slot></slot> | ||
<span v-if="label" class="text-nowrap text-truncate"> | ||
{{ label }} | ||
</span> | ||
</button> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "IconSelectItem", | ||
emits: ["click"], | ||
props: { | ||
value: String, | ||
active: Boolean, | ||
label: String, | ||
disabled: Boolean, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.btn { | ||
width: 32px; | ||
height: 32px; | ||
border-radius: 2rem; | ||
color: var(--evcc-default-text); | ||
padding: 0; | ||
border: none; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.btn:hover { | ||
color: var(--evcc-gray); | ||
} | ||
.btn.active { | ||
color: var(--evcc-background); | ||
background: var(--evcc-default-text); | ||
} | ||
.btn.withLabel { | ||
width: auto; | ||
padding: 0 1rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<template> | ||
<svg :style="svgStyle" viewBox="0 0 24 24"> | ||
<path | ||
fill="currentColor" | ||
d="M4.83 4.61A1 1 0 0 1 5.75 4h12.5a1 1 0 1 1 0 2H8.11l4.95 5.115a1 1 0 0 1 .04 1.346L7.924 18.5H18.25a1 1 0 1 1 0 2H5.75a1 1 0 0 1-.76-1.65l5.999-6.999L5.03 5.695a1 1 0 0 1-.2-1.085" | ||
/> | ||
</svg> | ||
</template> | ||
|
||
<script> | ||
import icon from "../../mixins/icon"; | ||
export default { | ||
name: "Total", | ||
mixins: [icon], | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.