Skip to content

Commit 3d066ba

Browse files
authored
Merge pull request #1915 from visualize-admin/feat/confidence-intervals-formatting
feat: Improve confidence intervals formatting
2 parents e5ebe61 + e8c18e6 commit 3d066ba

File tree

3 files changed

+3
-39
lines changed

3 files changed

+3
-39
lines changed

app/charts/shared/chart-state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ export const useNumericalYErrorVariables = (
433433
const cil = getYConfidenceIntervalLower(d);
434434
const ciu = getYConfidenceIntervalUpper(d);
435435
const unit = yConfidenceIntervalUpperMeasure?.unit ?? "";
436-
return ` -${cil}${unit}, +${ciu}${unit}`;
436+
return `, [-${cil}${unit}, +${ciu}${unit}]`;
437437
}
438438
},
439439
[

app/rdf/light-cube.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ import {
77
} from "@/domain/data";
88
import { getCubeMetadata } from "@/rdf/query-cube-metadata";
99
import { getCubePreview } from "@/rdf/query-cube-preview";
10-
import {
11-
getCubeComponentTermsets,
12-
getCubeTermsets,
13-
} from "@/rdf/query-termsets";
10+
import { getCubeComponentTermsets } from "@/rdf/query-termsets";
1411

1512
type LightCubeOptions = {
1613
iri: string;
@@ -48,13 +45,6 @@ export class LightCube {
4845
return this.metadata;
4946
}
5047

51-
public async fetchTermsets() {
52-
return await getCubeTermsets(this.iri, {
53-
locale: this.locale,
54-
sparqlClient: this.sparqlClient,
55-
});
56-
}
57-
5848
public async fetchComponentTermsets() {
5949
return await getCubeComponentTermsets(this.iri, {
6050
locale: this.locale,

app/rdf/query-termsets.ts

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,11 @@
11
import groupBy from "lodash/groupBy";
22
import ParsingClient from "sparql-http-client/ParsingClient";
33

4-
import { ComponentTermsets, Termset } from "@/domain/data";
4+
import { ComponentTermsets } from "@/domain/data";
55
import { stringifyComponentId } from "@/graphql/make-component-id";
66
import { queryCubeUnversionedIri } from "@/rdf/query-cube-unversioned-iri";
77
import { buildLocalizedSubQuery } from "@/rdf/query-utils";
88

9-
export const getCubeTermsets = async (
10-
iri: string,
11-
options: {
12-
locale: string;
13-
sparqlClient: ParsingClient;
14-
}
15-
): Promise<Termset[]> => {
16-
const { sparqlClient, locale } = options;
17-
const qs = await sparqlClient.query.select(
18-
`PREFIX meta: <https://cube.link/meta/>
19-
PREFIX schema: <http://schema.org/>
20-
21-
SELECT DISTINCT ?termsetIri ?termsetLabel WHERE {
22-
?termsetIri meta:isUsedIn <${iri}> .
23-
${buildLocalizedSubQuery("termsetIri", "schema:name", "termsetLabel", { locale })}
24-
}`,
25-
{ operation: "postUrlencoded" }
26-
);
27-
28-
return qs.map((result) => ({
29-
iri: result.termsetIri.value,
30-
label: result.termsetLabel.value,
31-
__typename: "Termset",
32-
}));
33-
};
34-
359
export const getCubeComponentTermsets = async (
3610
iri: string,
3711
options: {

0 commit comments

Comments
 (0)