Skip to content

Commit

Permalink
Merge branch 'dev' into enhancement/highcharts-line-design
Browse files Browse the repository at this point in the history
* dev:
  Enhancement/ignore unknown diagram types (#776)
  • Loading branch information
Bernt Andersen committed Jan 10, 2025
2 parents 4469a14 + e0de160 commit f3712b3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
3 changes: 2 additions & 1 deletion projects/fhi-angular-highcharts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Unreleased

> Jan 8, 2025
> Jan 10, 2025
* :tada: **Enhancement** Add option `categoryAxis` to `FhiDiagramOptions`, and add support for setting the category axis title [(#763)](https://github.com/folkehelseinstituttet/Fhi.Frontend.Demo/pull/763)
* :tada: **Enhancement** Update qualitative color series [(#771)](https://github.com/folkehelseinstituttet/Fhi.Frontend.Demo/pull/771)
* :tada: **Enhancement** Use cloneDeep() to make diagramOptions immutable [(#765)](https://github.com/folkehelseinstituttet/Fhi.Frontend.Demo/pull/765)
* :tada: **Enhancement** Rewrite decimals once instead of formatting decimals in table template and tooltip [(#773)](https://github.com/folkehelseinstituttet/Fhi.Frontend.Demo/pull/773)
* :tada: **Enhancement** Add test for illegal diagram type, and for multiple equal diagram types [(#776)](https://github.com/folkehelseinstituttet/Fhi.Frontend.Demo/pull/776)
* :tada: **Enhancement** Update styling of diagram type line to mark all line points [(#779)](https://github.com/folkehelseinstituttet/Fhi.Frontend.Demo/pull/779)

## 5.2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,36 @@ export class DiagramTypeGroupService {

if (isChart) {
items.chartTypes.forEach((id) => {
group.children.push(ChartTypes.find((type) => type.id === id));
this.updateDiagramTypeGroup(id, group, ChartTypes, 'Chart');
});
}
if (isMap) {
items.mapTypes.forEach((id) => {
group.children.push(MapTypes.find((type) => type.id === id));
this.updateDiagramTypeGroup(id, group, MapTypes, 'Map');
});
}

return group;
}

private updateDiagramTypeGroup(
id: string,
group: DiagramTypeGroup,
Types: DiagramType[],
typeName: string,
) {
const type = Types.find((type) => type.id === id);
const typeExist = group.children.find((type) => type.id === id);

if (type !== undefined && typeExist === undefined) {
group.children.push(type);
} else if (typeExist) {
console.warn(typeName + ' type id: "' + id + '" is listed more than once.');
} else {
console.warn(typeName + ' type id: "' + id + '" is not valid.');
}
}

private diagramTypeIsActive(diagramType: DiagramType, groups: DiagramTypeGroup[]): boolean {
const activeFromOptionsNotFoundInGrops = (() =>
groups.every(
Expand Down

0 comments on commit f3712b3

Please sign in to comment.