Add granularity for aggregation, group by hour/day/month/year

This commit is contained in:
Guntis Smaukstelis
2023-07-03 23:17:43 +03:00
parent 4d93fe68dc
commit c5b84727a6
11 changed files with 198 additions and 34 deletions
+22
View File
@@ -0,0 +1,22 @@
import { Accessor, Component, Setter } from "solid-js";
import { aggregateGranularity } from "../consts";
export const SelectGranularity: Component<{
getGranularity: Accessor<string>,
setGranularity: Setter<string>,
}> = ({ getGranularity, setGranularity }) => {
return (
<div>
<h3>Select granularity</h3>
<select onChange={(e) => setGranularity(e.target.value)}>
{ aggregateGranularity.map(granularity =>
<option
value={granularity}
selected={granularity === getGranularity() ? true : false}
>{granularity}</option>
)}
</select>
</div>
);
}