@gooddata/sdk-ui-vis-commons 11.41.0-alpha.1 → 11.41.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/customTooltip/referenceResolver.js +8 -7
- package/esm/customTooltip/tooltipExecution.d.ts +3 -2
- package/esm/customTooltip/tooltipExecution.js +2 -1
- package/esm/customTooltip/types.d.ts +7 -9
- package/esm/customTooltip/types.js +3 -2
- package/esm/customTooltip/useTooltipLookupExecutions.d.ts +10 -22
- package/esm/customTooltip/useTooltipLookupExecutions.js +32 -38
- package/esm/index.d.ts +1 -2
- package/esm/index.js +0 -1
- package/esm/sdk-ui-vis-commons.d.ts +19 -42
- package/package.json +11 -11
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
2
|
import { REFERENCE_REGEX_MATCH } from "@gooddata/sdk-ui-kit";
|
|
3
|
+
import { labelKey, metricKey, } from "./types.js";
|
|
3
4
|
// Markdown metacharacters that, if present in a substituted value, would be
|
|
4
5
|
// reinterpreted as formatting by `markdownToHtml`. Backslash-escape them so the
|
|
5
6
|
// parser treats them as literal text. The set covers every char that can start
|
|
@@ -22,8 +23,8 @@ function renderReference(ref, strings) {
|
|
|
22
23
|
return strings.noData;
|
|
23
24
|
case "multiple":
|
|
24
25
|
return strings.multipleItems;
|
|
25
|
-
case
|
|
26
|
-
|
|
26
|
+
case undefined:
|
|
27
|
+
// Absent reference → couldn't be resolved at this point.
|
|
27
28
|
return strings.noFetch;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
@@ -49,10 +50,10 @@ export function resolveReferences(content, values, strings) {
|
|
|
49
50
|
return "";
|
|
50
51
|
}
|
|
51
52
|
return content.replace(REFERENCE_REGEX_MATCH, (_fullMatch, _wrapped, _key, prefix, identifier) => {
|
|
52
|
-
// The regex
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
const
|
|
56
|
-
return escapeMarkdownMetachars(renderReference(
|
|
53
|
+
// The regex captures the prefix case-insensitively (`metric` | `label`);
|
|
54
|
+
// route through the key helpers so the lookup format stays single-sourced
|
|
55
|
+
// with the write sites. LDM identifiers stay as-is — they are case-sensitive.
|
|
56
|
+
const key = prefix.toLowerCase() === "metric" ? metricKey(identifier) : labelKey(identifier);
|
|
57
|
+
return escapeMarkdownMetachars(renderReference(values[key], strings));
|
|
57
58
|
});
|
|
58
59
|
}
|
|
@@ -28,8 +28,9 @@ export interface ITooltipExecutionBundle {
|
|
|
28
28
|
* plus per-reference bundles used as an isolation fallback. When the batch
|
|
29
29
|
* rejects (e.g. a single invalid reference 400s the whole AFM), the consumer
|
|
30
30
|
* re-runs the per-reference bundles so one bad reference can't suppress the
|
|
31
|
-
* rest. `perRef` is a thunk: the
|
|
32
|
-
*
|
|
31
|
+
* rest. Both Highcharts and geo fan out this way. `perRef` is a thunk: the
|
|
32
|
+
* bundles are built lazily, only when the batch fails, so the success path
|
|
33
|
+
* pays nothing for it.
|
|
33
34
|
*
|
|
34
35
|
* @internal
|
|
35
36
|
*/
|
|
@@ -166,7 +166,8 @@ export function buildTooltipExecution(executionFactory, chartDefinition, tooltip
|
|
|
166
166
|
if (!batch) {
|
|
167
167
|
return null;
|
|
168
168
|
}
|
|
169
|
-
// Lazy: built only on batch failure (
|
|
169
|
+
// Lazy: built only on batch failure (Highcharts and geo both fan out); the
|
|
170
|
+
// success path never invokes it.
|
|
170
171
|
const perRef = () => externalRefs
|
|
171
172
|
.map((ref) => buildBundle(executionFactory, chartDefinition, [ref], options))
|
|
172
173
|
.filter((bundle) => bundle !== null);
|
|
@@ -61,11 +61,10 @@ export interface ICustomTooltipConfig {
|
|
|
61
61
|
/**
|
|
62
62
|
* Resolution outcome for a single `{metric/id}` / `{label/id}` reference at a
|
|
63
63
|
* data point. A discriminated union so the renderer maps each state to its own
|
|
64
|
-
* localized message instead of collapsing
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* default for an unclassified value.
|
|
64
|
+
* localized message instead of collapsing them: `empty` → "(No data)",
|
|
65
|
+
* `multiple` → "(Multiple items)". A reference that couldn't be resolved at all
|
|
66
|
+
* is represented by *absence* from the lookup (`undefined`), which the renderer
|
|
67
|
+
* maps to "(Data could not be retrieved)" — there is no explicit error variant.
|
|
69
68
|
*
|
|
70
69
|
* @internal
|
|
71
70
|
*/
|
|
@@ -76,8 +75,6 @@ export type ResolvedReference = {
|
|
|
76
75
|
readonly kind: "empty";
|
|
77
76
|
} | {
|
|
78
77
|
readonly kind: "multiple";
|
|
79
|
-
} | {
|
|
80
|
-
readonly kind: "error";
|
|
81
78
|
};
|
|
82
79
|
/**
|
|
83
80
|
* Lookup of resolved reference statuses keyed by `metric/id` or `label/id`.
|
|
@@ -90,8 +87,9 @@ export interface IResolvedReferenceValues {
|
|
|
90
87
|
/**
|
|
91
88
|
* Builds the `metric/<id>` lookup key for a metric reference. A reference key
|
|
92
89
|
* has exactly two shapes ({@link metricKey}, {@link labelKey}); keeping the
|
|
93
|
-
* convention here
|
|
94
|
-
*
|
|
90
|
+
* convention here makes it the single source for both the write sites and the
|
|
91
|
+
* read in `resolveReferences` (which routes the parsed prefix through these
|
|
92
|
+
* helpers rather than rebuilding the key).
|
|
95
93
|
*
|
|
96
94
|
* @internal
|
|
97
95
|
*/
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Builds the `metric/<id>` lookup key for a metric reference. A reference key
|
|
4
4
|
* has exactly two shapes ({@link metricKey}, {@link labelKey}); keeping the
|
|
5
|
-
* convention here
|
|
6
|
-
*
|
|
5
|
+
* convention here makes it the single source for both the write sites and the
|
|
6
|
+
* read in `resolveReferences` (which routes the parsed prefix through these
|
|
7
|
+
* helpers rather than rebuilding the key).
|
|
7
8
|
*
|
|
8
9
|
* @internal
|
|
9
10
|
*/
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import { type IPreparedExecution } from "@gooddata/sdk-backend-spi";
|
|
2
1
|
import { type ISeparators } from "@gooddata/sdk-model";
|
|
3
|
-
import { type ITooltipExecution
|
|
2
|
+
import { type ITooltipExecution } from "./tooltipExecution.js";
|
|
4
3
|
import { type IResolvedReferenceValues } from "./types.js";
|
|
5
|
-
/**
|
|
6
|
-
* Built lookup plus references that could not be retrieved at all (their fetch
|
|
7
|
-
* rejected even in the per-reference fallback). Errored references render as
|
|
8
|
-
* "(Data could not be retrieved)" at every point.
|
|
9
|
-
*
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export interface ITooltipLookupResult {
|
|
13
|
-
lookup: Map<string, IResolvedReferenceValues>;
|
|
14
|
-
erroredRefs: ReadonlySet<string>;
|
|
15
|
-
}
|
|
16
4
|
/**
|
|
17
5
|
* Single-execution variant for chart families that have one tooltip execution
|
|
18
6
|
* per chart (e.g. Highcharts). Returns `undefined` while no execution is
|
|
@@ -21,21 +9,21 @@ export interface ITooltipLookupResult {
|
|
|
21
9
|
*
|
|
22
10
|
* @internal
|
|
23
11
|
*/
|
|
24
|
-
export declare function useTooltipLookup(execution: ITooltipExecution | undefined, separators?: ISeparators):
|
|
12
|
+
export declare function useTooltipLookup(execution: ITooltipExecution | undefined, separators?: ISeparators): Map<string, IResolvedReferenceValues> | undefined;
|
|
25
13
|
/**
|
|
26
|
-
* One
|
|
27
|
-
*
|
|
14
|
+
* One tooltip execution plan paired with a caller-owned key and the context
|
|
15
|
+
* that travels with the built lookup.
|
|
28
16
|
*
|
|
29
17
|
* @internal
|
|
30
18
|
*/
|
|
31
19
|
export interface ITooltipLookupExecutionEntry<TContext> {
|
|
32
20
|
key: string;
|
|
33
|
-
execution:
|
|
34
|
-
meta: ITooltipExecutionMeta;
|
|
21
|
+
execution: ITooltipExecution;
|
|
35
22
|
context: TContext;
|
|
36
23
|
}
|
|
37
24
|
/**
|
|
38
|
-
* Built lookup for one tooltip execution entry
|
|
25
|
+
* Built lookup for one tooltip execution entry (per-entry fan-out, mirroring
|
|
26
|
+
* the single-execution variant).
|
|
39
27
|
*
|
|
40
28
|
* @internal
|
|
41
29
|
*/
|
|
@@ -45,9 +33,9 @@ export interface ITooltipLookupExecutionResult<TContext> {
|
|
|
45
33
|
}
|
|
46
34
|
/**
|
|
47
35
|
* Multi-execution variant for chart families that key tooltip executions per
|
|
48
|
-
* sub-target (e.g. geo per-layer).
|
|
49
|
-
*
|
|
50
|
-
*
|
|
36
|
+
* sub-target (e.g. geo per-layer). Each entry runs through the same batch →
|
|
37
|
+
* per-reference fan-out as the single-execution variant. `context` travels with
|
|
38
|
+
* the built lookup so downstream code needn't defensively check for it.
|
|
51
39
|
*
|
|
52
40
|
* @internal
|
|
53
41
|
*/
|
|
@@ -2,63 +2,51 @@
|
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { useCancelablePromise } from "@gooddata/sdk-ui";
|
|
4
4
|
import { buildLookupTable } from "./tooltipLookup.js";
|
|
5
|
-
import { labelKey, metricKey } from "./types.js";
|
|
6
5
|
async function executeOne(execution) {
|
|
7
6
|
const result = await execution.execute();
|
|
8
7
|
return result.readAll();
|
|
9
8
|
}
|
|
10
|
-
/**
|
|
11
|
-
* Reference keys (`metric/id`, `label/id`) a bundle's meta covers. Used to mark
|
|
12
|
-
* a failed per-reference bundle's references as errored.
|
|
13
|
-
*/
|
|
14
|
-
function refKeysOfMeta(meta) {
|
|
15
|
-
return [
|
|
16
|
-
...Object.values(meta.measureIdMap).map(metricKey),
|
|
17
|
-
...Object.values(meta.labelIdMap).map(labelKey),
|
|
18
|
-
];
|
|
19
|
-
}
|
|
20
9
|
/**
|
|
21
10
|
* Execute the batch; on failure, fan out to per-reference bundles so a single
|
|
22
|
-
* bad reference (e.g. one that 400s the batched AFM) only
|
|
23
|
-
* the rest still resolve.
|
|
24
|
-
*
|
|
11
|
+
* bad reference (e.g. one that 400s the batched AFM) only takes itself down
|
|
12
|
+
* while the rest still resolve. Isolation is structural — a failed reference is
|
|
13
|
+
* left out of the returned inputs and renders the unresolved default, with no
|
|
14
|
+
* parsing of the backend error. Fan-out fires on *any* batch rejection (a
|
|
15
|
+
* transient 5xx/timeout too, not just a bad-ref 400), so a flaky backend can
|
|
16
|
+
* produce N follow-up executions per plan.
|
|
25
17
|
*/
|
|
26
18
|
async function runWithFallback(execution) {
|
|
27
19
|
try {
|
|
28
20
|
const dataView = await executeOne(execution.batch.execution);
|
|
29
|
-
return
|
|
21
|
+
return [{ dataView, meta: execution.batch.meta }];
|
|
30
22
|
}
|
|
31
23
|
catch {
|
|
32
|
-
// Build the per-reference bundles now (lazy) and
|
|
24
|
+
// Build the per-reference bundles now (lazy) and keep the ones that resolve.
|
|
33
25
|
const perRef = execution.perRef();
|
|
34
26
|
const settled = await Promise.allSettled(perRef.map((bundle) => executeOne(bundle.execution)));
|
|
35
27
|
const inputs = [];
|
|
36
|
-
const erroredRefs = new Set();
|
|
37
28
|
settled.forEach((result, index) => {
|
|
38
|
-
const bundle = perRef[index];
|
|
39
29
|
if (result.status === "fulfilled") {
|
|
40
|
-
inputs.push({ dataView: result.value, meta:
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
refKeysOfMeta(bundle.meta).forEach((key) => erroredRefs.add(key));
|
|
30
|
+
inputs.push({ dataView: result.value, meta: perRef[index].meta });
|
|
44
31
|
}
|
|
45
32
|
});
|
|
46
|
-
return
|
|
33
|
+
return inputs;
|
|
47
34
|
}
|
|
48
35
|
}
|
|
49
36
|
/**
|
|
50
37
|
* Merge per-execution lookups into one map (by point key, shallow-merging the
|
|
51
|
-
* per-point reference statuses)
|
|
38
|
+
* per-point reference statuses). Built in a memo so a separators change rebuilds
|
|
39
|
+
* without re-executing.
|
|
52
40
|
*/
|
|
53
|
-
function
|
|
41
|
+
function buildLookup(inputs, separators) {
|
|
54
42
|
const lookup = new Map();
|
|
55
|
-
for (const { dataView, meta } of
|
|
43
|
+
for (const { dataView, meta } of inputs) {
|
|
56
44
|
for (const [pointKey, values] of buildLookupTable(dataView, meta, separators)) {
|
|
57
45
|
const existing = lookup.get(pointKey);
|
|
58
46
|
lookup.set(pointKey, existing ? { ...existing, ...values } : values);
|
|
59
47
|
}
|
|
60
48
|
}
|
|
61
|
-
return
|
|
49
|
+
return lookup;
|
|
62
50
|
}
|
|
63
51
|
/**
|
|
64
52
|
* Single-execution variant for chart families that have one tooltip execution
|
|
@@ -73,22 +61,30 @@ export function useTooltipLookup(execution, separators) {
|
|
|
73
61
|
const { result } = useCancelablePromise({
|
|
74
62
|
promise: execution ? () => runWithFallback(execution) : undefined,
|
|
75
63
|
}, [fingerprint]);
|
|
76
|
-
return useMemo(() => (result ?
|
|
64
|
+
return useMemo(() => (result ? buildLookup(result, separators) : undefined), [result, separators]);
|
|
77
65
|
}
|
|
78
66
|
const EMPTY_LOOKUPS = new Map();
|
|
79
67
|
function getEntriesFingerprint(entries) {
|
|
80
|
-
return entries
|
|
68
|
+
return entries
|
|
69
|
+
.map((entry) => `${entry.key}::${entry.execution.batch.execution.fingerprint()}`)
|
|
70
|
+
.join("||");
|
|
81
71
|
}
|
|
82
72
|
async function executeAll(entries) {
|
|
83
|
-
|
|
84
|
-
//
|
|
73
|
+
// runWithFallback resolves for any execution failure (a failed reference is
|
|
74
|
+
// just omitted), so allSettled only guards a stray throw — one layer can't
|
|
75
|
+
// drop the rest.
|
|
76
|
+
const settled = await Promise.allSettled(entries.map(async (entry) => ({
|
|
77
|
+
key: entry.key,
|
|
78
|
+
inputs: await runWithFallback(entry.execution),
|
|
79
|
+
context: entry.context,
|
|
80
|
+
})));
|
|
85
81
|
return settled.flatMap((result) => (result.status === "fulfilled" ? [result.value] : []));
|
|
86
82
|
}
|
|
87
83
|
/**
|
|
88
84
|
* Multi-execution variant for chart families that key tooltip executions per
|
|
89
|
-
* sub-target (e.g. geo per-layer).
|
|
90
|
-
*
|
|
91
|
-
*
|
|
85
|
+
* sub-target (e.g. geo per-layer). Each entry runs through the same batch →
|
|
86
|
+
* per-reference fan-out as the single-execution variant. `context` travels with
|
|
87
|
+
* the built lookup so downstream code needn't defensively check for it.
|
|
92
88
|
*
|
|
93
89
|
* @internal
|
|
94
90
|
*/
|
|
@@ -103,10 +99,8 @@ export function useTooltipLookupExecutions(entries, separators) {
|
|
|
103
99
|
}
|
|
104
100
|
const lookups = new Map();
|
|
105
101
|
for (const entry of result) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
context: entry.context,
|
|
109
|
-
});
|
|
102
|
+
const lookup = buildLookup(entry.inputs, separators);
|
|
103
|
+
lookups.set(entry.key, { lookup, context: entry.context });
|
|
110
104
|
}
|
|
111
105
|
return lookups;
|
|
112
106
|
}, [result, separators]);
|
package/esm/index.d.ts
CHANGED
|
@@ -35,7 +35,6 @@ export { measureReference, labelReference } from "./customTooltip/referenceStatu
|
|
|
35
35
|
export { buildTooltipLocalizedStrings } from "./customTooltip/localizedStrings.js";
|
|
36
36
|
export { resolveMeasureLdmIdentifier } from "./customTooltip/measureLdmIdentifier.js";
|
|
37
37
|
export { buildTooltipExecution, type IBuildTooltipExecutionOptions, type ITooltipExecution, type ITooltipExecutionBundle, type ITooltipExecutionMeta, } from "./customTooltip/tooltipExecution.js";
|
|
38
|
-
export { buildLookupTable } from "./customTooltip/tooltipLookup.js";
|
|
39
38
|
export { buildKeySegment, joinKeySegments } from "./customTooltip/tooltipKey.js";
|
|
40
39
|
export { composeCustomTooltipSectionHtml } from "./customTooltip/composeSectionHtml.js";
|
|
41
|
-
export { useTooltipLookup, useTooltipLookupExecutions, type
|
|
40
|
+
export { useTooltipLookup, useTooltipLookupExecutions, type ITooltipLookupExecutionEntry, type ITooltipLookupExecutionResult, } from "./customTooltip/useTooltipLookupExecutions.js";
|
package/esm/index.js
CHANGED
|
@@ -36,7 +36,6 @@ export { measureReference, labelReference } from "./customTooltip/referenceStatu
|
|
|
36
36
|
export { buildTooltipLocalizedStrings } from "./customTooltip/localizedStrings.js";
|
|
37
37
|
export { resolveMeasureLdmIdentifier } from "./customTooltip/measureLdmIdentifier.js";
|
|
38
38
|
export { buildTooltipExecution, } from "./customTooltip/tooltipExecution.js";
|
|
39
|
-
export { buildLookupTable } from "./customTooltip/tooltipLookup.js";
|
|
40
39
|
export { buildKeySegment, joinKeySegments } from "./customTooltip/tooltipKey.js";
|
|
41
40
|
export { composeCustomTooltipSectionHtml } from "./customTooltip/composeSectionHtml.js";
|
|
42
41
|
export { useTooltipLookup, useTooltipLookupExecutions, } from "./customTooltip/useTooltipLookupExecutions.js";
|
|
@@ -56,16 +56,6 @@ export declare class AttributeColorStrategy extends ColorStrategy {
|
|
|
56
56
|
*/
|
|
57
57
|
export declare function buildKeySegment(displayFormId: string, uri: string): string;
|
|
58
58
|
|
|
59
|
-
/**
|
|
60
|
-
* Build a per-data-point lookup keyed by `${displayFormId}:${uri}` segments
|
|
61
|
-
* (joined by `|`, sorted). Iteration is orientation-agnostic via slices/series.
|
|
62
|
-
* Each reference is tagged with a {@link ResolvedReference} status; localized
|
|
63
|
-
* placeholder strings are applied later, at the render site.
|
|
64
|
-
*
|
|
65
|
-
* @internal
|
|
66
|
-
*/
|
|
67
|
-
export declare function buildLookupTable(dataView: IDataView, meta: ITooltipExecutionMeta, separators?: ISeparators): Map<string, IResolvedReferenceValues>;
|
|
68
|
-
|
|
69
59
|
/**
|
|
70
60
|
* Returns `null` when the content has no references or all references are
|
|
71
61
|
* already in the chart (resolvable from drill data without a secondary call).
|
|
@@ -804,8 +794,9 @@ export declare type ItemBorderRadiusPredicate = (item: any) => boolean;
|
|
|
804
794
|
* plus per-reference bundles used as an isolation fallback. When the batch
|
|
805
795
|
* rejects (e.g. a single invalid reference 400s the whole AFM), the consumer
|
|
806
796
|
* re-runs the per-reference bundles so one bad reference can't suppress the
|
|
807
|
-
* rest. `perRef` is a thunk: the
|
|
808
|
-
*
|
|
797
|
+
* rest. Both Highcharts and geo fan out this way. `perRef` is a thunk: the
|
|
798
|
+
* bundles are built lazily, only when the batch fails, so the success path
|
|
799
|
+
* pays nothing for it.
|
|
809
800
|
*
|
|
810
801
|
* @internal
|
|
811
802
|
*/
|
|
@@ -853,20 +844,20 @@ export declare interface ITooltipLocalizedStrings {
|
|
|
853
844
|
}
|
|
854
845
|
|
|
855
846
|
/**
|
|
856
|
-
* One
|
|
857
|
-
*
|
|
847
|
+
* One tooltip execution plan paired with a caller-owned key and the context
|
|
848
|
+
* that travels with the built lookup.
|
|
858
849
|
*
|
|
859
850
|
* @internal
|
|
860
851
|
*/
|
|
861
852
|
export declare interface ITooltipLookupExecutionEntry<TContext> {
|
|
862
853
|
key: string;
|
|
863
|
-
execution:
|
|
864
|
-
meta: ITooltipExecutionMeta;
|
|
854
|
+
execution: ITooltipExecution;
|
|
865
855
|
context: TContext;
|
|
866
856
|
}
|
|
867
857
|
|
|
868
858
|
/**
|
|
869
|
-
* Built lookup for one tooltip execution entry
|
|
859
|
+
* Built lookup for one tooltip execution entry (per-entry fan-out, mirroring
|
|
860
|
+
* the single-execution variant).
|
|
870
861
|
*
|
|
871
862
|
* @internal
|
|
872
863
|
*/
|
|
@@ -875,18 +866,6 @@ export declare interface ITooltipLookupExecutionResult<TContext> {
|
|
|
875
866
|
context: TContext;
|
|
876
867
|
}
|
|
877
868
|
|
|
878
|
-
/**
|
|
879
|
-
* Built lookup plus references that could not be retrieved at all (their fetch
|
|
880
|
-
* rejected even in the per-reference fallback). Errored references render as
|
|
881
|
-
* "(Data could not be retrieved)" at every point.
|
|
882
|
-
*
|
|
883
|
-
* @internal
|
|
884
|
-
*/
|
|
885
|
-
export declare interface ITooltipLookupResult {
|
|
886
|
-
lookup: Map<string, IResolvedReferenceValues>;
|
|
887
|
-
erroredRefs: ReadonlySet<string>;
|
|
888
|
-
}
|
|
889
|
-
|
|
890
869
|
/**
|
|
891
870
|
* @internal
|
|
892
871
|
*/
|
|
@@ -961,8 +940,9 @@ export declare function measureReference(rawValue: number | string | null | unde
|
|
|
961
940
|
/**
|
|
962
941
|
* Builds the `metric/<id>` lookup key for a metric reference. A reference key
|
|
963
942
|
* has exactly two shapes ({@link metricKey}, {@link labelKey}); keeping the
|
|
964
|
-
* convention here
|
|
965
|
-
*
|
|
943
|
+
* convention here makes it the single source for both the write sites and the
|
|
944
|
+
* read in `resolveReferences` (which routes the parsed prefix through these
|
|
945
|
+
* helpers rather than rebuilding the key).
|
|
966
946
|
*
|
|
967
947
|
* @internal
|
|
968
948
|
*/
|
|
@@ -1033,11 +1013,10 @@ export declare type PositionType = "left" | "right" | "top" | "bottom" | "auto";
|
|
|
1033
1013
|
/**
|
|
1034
1014
|
* Resolution outcome for a single `{metric/id}` / `{label/id}` reference at a
|
|
1035
1015
|
* data point. A discriminated union so the renderer maps each state to its own
|
|
1036
|
-
* localized message instead of collapsing
|
|
1037
|
-
*
|
|
1038
|
-
*
|
|
1039
|
-
*
|
|
1040
|
-
* default for an unclassified value.
|
|
1016
|
+
* localized message instead of collapsing them: `empty` → "(No data)",
|
|
1017
|
+
* `multiple` → "(Multiple items)". A reference that couldn't be resolved at all
|
|
1018
|
+
* is represented by *absence* from the lookup (`undefined`), which the renderer
|
|
1019
|
+
* maps to "(Data could not be retrieved)" — there is no explicit error variant.
|
|
1041
1020
|
*
|
|
1042
1021
|
* @internal
|
|
1043
1022
|
*/
|
|
@@ -1048,8 +1027,6 @@ export declare type ResolvedReference = {
|
|
|
1048
1027
|
readonly kind: "empty";
|
|
1049
1028
|
} | {
|
|
1050
1029
|
readonly kind: "multiple";
|
|
1051
|
-
} | {
|
|
1052
|
-
readonly kind: "error";
|
|
1053
1030
|
};
|
|
1054
1031
|
|
|
1055
1032
|
/**
|
|
@@ -1111,13 +1088,13 @@ export declare const SupportedLegendPositions: PositionType[];
|
|
|
1111
1088
|
*
|
|
1112
1089
|
* @internal
|
|
1113
1090
|
*/
|
|
1114
|
-
export declare function useTooltipLookup(execution: ITooltipExecution | undefined, separators?: ISeparators):
|
|
1091
|
+
export declare function useTooltipLookup(execution: ITooltipExecution | undefined, separators?: ISeparators): Map<string, IResolvedReferenceValues> | undefined;
|
|
1115
1092
|
|
|
1116
1093
|
/**
|
|
1117
1094
|
* Multi-execution variant for chart families that key tooltip executions per
|
|
1118
|
-
* sub-target (e.g. geo per-layer).
|
|
1119
|
-
*
|
|
1120
|
-
*
|
|
1095
|
+
* sub-target (e.g. geo per-layer). Each entry runs through the same batch →
|
|
1096
|
+
* per-reference fan-out as the single-execution variant. `context` travels with
|
|
1097
|
+
* the built lookup so downstream code needn't defensively check for it.
|
|
1121
1098
|
*
|
|
1122
1099
|
* @internal
|
|
1123
1100
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-vis-commons",
|
|
3
|
-
"version": "11.41.0-alpha.
|
|
3
|
+
"version": "11.41.0-alpha.2",
|
|
4
4
|
"description": "GoodData.UI SDK - common functionality for different types of visualizations",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"react-intl": "7.1.11",
|
|
37
37
|
"react-measure": "^2.5.2",
|
|
38
38
|
"tslib": "2.8.1",
|
|
39
|
-
"@gooddata/sdk-backend-spi": "11.41.0-alpha.
|
|
40
|
-
"@gooddata/sdk-
|
|
41
|
-
"@gooddata/sdk-ui": "11.41.0-alpha.
|
|
42
|
-
"@gooddata/sdk-ui-theme-provider": "11.41.0-alpha.
|
|
43
|
-
"@gooddata/sdk-
|
|
39
|
+
"@gooddata/sdk-backend-spi": "11.41.0-alpha.2",
|
|
40
|
+
"@gooddata/sdk-ui": "11.41.0-alpha.2",
|
|
41
|
+
"@gooddata/sdk-ui-kit": "11.41.0-alpha.2",
|
|
42
|
+
"@gooddata/sdk-ui-theme-provider": "11.41.0-alpha.2",
|
|
43
|
+
"@gooddata/sdk-model": "11.41.0-alpha.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -81,11 +81,11 @@
|
|
|
81
81
|
"typescript": "5.9.3",
|
|
82
82
|
"vitest": "4.1.8",
|
|
83
83
|
"vitest-dom": "0.1.1",
|
|
84
|
-
"@gooddata/eslint-config": "11.41.0-alpha.
|
|
85
|
-
"@gooddata/oxlint-config": "11.41.0-alpha.
|
|
86
|
-
"@gooddata/
|
|
87
|
-
"@gooddata/
|
|
88
|
-
"@gooddata/
|
|
84
|
+
"@gooddata/eslint-config": "11.41.0-alpha.2",
|
|
85
|
+
"@gooddata/oxlint-config": "11.41.0-alpha.2",
|
|
86
|
+
"@gooddata/reference-workspace": "11.41.0-alpha.2",
|
|
87
|
+
"@gooddata/sdk-backend-mockingbird": "11.41.0-alpha.2",
|
|
88
|
+
"@gooddata/stylelint-config": "11.41.0-alpha.2"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"react": "^18.0.0 || ^19.0.0",
|