Skip to content

Commit 6d1b6a0

Browse files
committed
feat: Add a new example for join by
1 parent 7fe7249 commit 6d1b6a0

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

app/components/graphql-joinby.stories.tsx

+24-2
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ const combinations: {
3030
id: number;
3131
name: string;
3232
cubes: ChartConfig["cubes"];
33+
sourceUrl: string;
3334
}[] = [
3435
{
3536
id: 1,
3637
name: "Photovoltaik + Hydropowerplants",
38+
sourceUrl: "https://int.lindas.admin.ch/query",
3739
cubes: [
3840
{
3941
iri: "https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/14",
@@ -66,6 +68,7 @@ const combinations: {
6668
{
6769
id: 2,
6870
name: "Photovoltaik + Photovoltaik GEB",
71+
sourceUrl: "https://int.lindas.admin.ch/query",
6972
cubes: [
7073
{
7174
iri: "https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/14",
@@ -94,6 +97,7 @@ const combinations: {
9497
{
9598
id: 3,
9699
name: "NFI Cube + Electrical consumption",
100+
sourceUrl: "https://int.lindas.admin.ch/query",
97101
cubes: [
98102
{
99103
iri: "https://environment.ld.admin.ch/foen/nfi/nfi_T-changes/cube/2024-1",
@@ -142,6 +146,24 @@ const combinations: {
142146
},
143147
],
144148
},
149+
{
150+
id: 4,
151+
name: "NFI Change + Photovoltaik",
152+
sourceUrl: "https://lindas.admin.ch/query",
153+
cubes: [
154+
{
155+
iri: "https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9",
156+
joinBy:
157+
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/Kanton",
158+
filters: {},
159+
},
160+
{
161+
iri: "https://environment.ld.admin.ch/foen/nfi/nfi_T-changes/cube/2024-1",
162+
joinBy: "https://environment.ld.admin.ch/foen/nfi/unitOfReference",
163+
filters: {},
164+
},
165+
],
166+
},
145167
];
146168
const useStyles = makeStyles((theme: Theme) => ({
147169
row: {
@@ -154,7 +176,7 @@ export const JoinBy = () => {
154176
const commonQueryVariables = {
155177
locale: "en",
156178
sourceType: "sparql",
157-
sourceUrl: "https://int.lindas.admin.ch/query",
179+
sourceUrl: combination.sourceUrl,
158180
};
159181

160182
const [{ data: componentsData, fetching: fetchingComponents }] =
@@ -221,7 +243,7 @@ export const JoinBy = () => {
221243
>
222244
{combinations.map((combination) => (
223245
<MenuItem key={combination.id} value={combination.id}>
224-
{combination.name}
246+
{combination.name} <small>({combination.sourceUrl})</small>
225247
</MenuItem>
226248
))}
227249
</Select>

0 commit comments

Comments
 (0)