From 12fee7b54f05283ebd4e3b9ae3d265a481272a05 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 26 Nov 2024 08:40:19 +0100 Subject: [PATCH 1/2] feat: Improve confidence interval formatting --- app/charts/shared/chart-state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/charts/shared/chart-state.ts b/app/charts/shared/chart-state.ts index 6cef8872a..fcad2d852 100644 --- a/app/charts/shared/chart-state.ts +++ b/app/charts/shared/chart-state.ts @@ -433,7 +433,7 @@ export const useNumericalYErrorVariables = ( const cil = getYConfidenceIntervalLower(d); const ciu = getYConfidenceIntervalUpper(d); const unit = yConfidenceIntervalUpperMeasure?.unit ?? ""; - return ` -${cil}${unit}, +${ciu}${unit}`; + return `, [-${cil}${unit}, +${ciu}${unit}]`; } }, [ From e8c18e677e165ba1bbf6c2f01f07567a8b4f9325 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 26 Nov 2024 08:40:25 +0100 Subject: [PATCH 2/2] chore: Remove unused --- app/rdf/light-cube.ts | 12 +----------- app/rdf/query-termsets.ts | 28 +--------------------------- 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/app/rdf/light-cube.ts b/app/rdf/light-cube.ts index d27792f86..9a7e89c2b 100644 --- a/app/rdf/light-cube.ts +++ b/app/rdf/light-cube.ts @@ -7,10 +7,7 @@ import { } from "@/domain/data"; import { getCubeMetadata } from "@/rdf/query-cube-metadata"; import { getCubePreview } from "@/rdf/query-cube-preview"; -import { - getCubeComponentTermsets, - getCubeTermsets, -} from "@/rdf/query-termsets"; +import { getCubeComponentTermsets } from "@/rdf/query-termsets"; type LightCubeOptions = { iri: string; @@ -48,13 +45,6 @@ export class LightCube { return this.metadata; } - public async fetchTermsets() { - return await getCubeTermsets(this.iri, { - locale: this.locale, - sparqlClient: this.sparqlClient, - }); - } - public async fetchComponentTermsets() { return await getCubeComponentTermsets(this.iri, { locale: this.locale, diff --git a/app/rdf/query-termsets.ts b/app/rdf/query-termsets.ts index 29913d312..f953f9bac 100644 --- a/app/rdf/query-termsets.ts +++ b/app/rdf/query-termsets.ts @@ -1,37 +1,11 @@ import groupBy from "lodash/groupBy"; import ParsingClient from "sparql-http-client/ParsingClient"; -import { ComponentTermsets, Termset } from "@/domain/data"; +import { ComponentTermsets } from "@/domain/data"; import { stringifyComponentId } from "@/graphql/make-component-id"; import { queryCubeUnversionedIri } from "@/rdf/query-cube-unversioned-iri"; import { buildLocalizedSubQuery } from "@/rdf/query-utils"; -export const getCubeTermsets = async ( - iri: string, - options: { - locale: string; - sparqlClient: ParsingClient; - } -): Promise => { - const { sparqlClient, locale } = options; - const qs = await sparqlClient.query.select( - `PREFIX meta: -PREFIX schema: - -SELECT DISTINCT ?termsetIri ?termsetLabel WHERE { - ?termsetIri meta:isUsedIn <${iri}> . - ${buildLocalizedSubQuery("termsetIri", "schema:name", "termsetLabel", { locale })} -}`, - { operation: "postUrlencoded" } - ); - - return qs.map((result) => ({ - iri: result.termsetIri.value, - label: result.termsetLabel.value, - __typename: "Termset", - })); -}; - export const getCubeComponentTermsets = async ( iri: string, options: {