Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
MatsJohansen87 committed Oct 12, 2023
2 parents 674d180 + cda94f0 commit 58303e8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
9 changes: 8 additions & 1 deletion packages/demo/src/AppCCP.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
const catalogueKeyToResponseKeyMap = [
["gender", "Gender"],
["age_at_diagnosis", "Age"],
['diagnosis', 'diagnosis'],
['medicationStatements', "MedicationType"],
["sample_kind", 'sample_kind' ],
["therapy_of_tumor", "ProcedureType"],
["75186-7", "75186-7"],
// ["encounter", "Encounter"],
];
const siteToDefaultCollectionId: string[][] = [
Expand Down Expand Up @@ -209,6 +215,7 @@
title="Diagnosis"
catalogueGroupCode="diagnosis"
chartType="bar"
indexAxis='y'
clickToAddState={true}
/>
</div>
Expand Down Expand Up @@ -239,7 +246,7 @@
<div class="chart-wrapper">
<lens-chart
title="Systemische Therapien"
catalogueGroupCode=""
catalogueGroupCode="medicationStatements"
chartType="bar"
clickToAddState={true}
/>
Expand Down
6 changes: 6 additions & 0 deletions packages/demo/src/ccp.css
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,10 @@ lens-search-bar-multiple::part(query-delete-button-group) {

lens-search-button::part(lens-search-button) {
background-color: var(--light-blue);
}

.chart-diagnosis lens-chart::part(chart-canvas) {
width: 100%;
max-height: 1000px;
height: 940px;
}
11 changes: 4 additions & 7 deletions packages/lib/src/components/results/ChartComponent.wc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
export let title: string = ""; // e.g. 'Gender Distribution'
export let catalogueGroupCode: string = ""; // e.g. "gender"
export let indexAxis: string = "x";
export let clickToAddState: boolean = false;
let responseGroupCode: string;
$: responseGroupCode =
Expand Down Expand Up @@ -84,6 +85,7 @@
],
},
options: {
indexAxis: indexAxis,
maintainAspectRatio: false,
plugins: {
legend: {
Expand All @@ -110,7 +112,7 @@
const getChartDataSets = (
responseStore: ResponseStore,
chartLabels: string[]
): { label; data; backgroundColors; backgroundHoverColors }[] => {
): { label; data; backgroundColor; backgroundHoverColor }[] => {
let dataSet: number[];
if (perSite) {
Expand Down Expand Up @@ -149,7 +151,7 @@
* watches the response store and updates the chart data
*/
const setChartData = (responseStore: ResponseStore) => {
console.log(responseStore);
if (responseStore.size === 0) return;
let isDataAvailable: boolean = false;
Expand Down Expand Up @@ -184,14 +186,12 @@
$: {
if ($responseStore.size !== 0){
console.log($responseStore);
setChartData($responseStore);
}
}
onMount(() => {
console.log(initialChartData);
chart = new Chart(canvas, initialChartData);
});
Expand Down Expand Up @@ -220,9 +220,7 @@
*/
const stratifier = chart.getActiveElements()[0];
if (!stratifier || !clickToAddState) return;
console.log(typeof chart.data.labels[stratifier.index]);
const label: string = chart.data.labels[stratifier.index] as string;
console.log(stratifier, label);
let queryItem: QueryItem;
$catalogue.forEach((parentCategory: Category) => {
if ("childCategories" in parentCategory) {
Expand All @@ -233,7 +231,6 @@
"criteria" in childCategorie
) {
let values: QueryValue[] = [];
console.log(childCategorie);
if (childCategorie.fieldType === "number") {
/**
Expand Down

0 comments on commit 58303e8

Please sign in to comment.