@bicharts/chart-host 0.5.53 → 0.5.54
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/dist/index.mjs +3 -3
- package/dist/types/qualifyLaunch.d.ts +11 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -613,7 +613,7 @@ function hasRefusalsToShow(rows) {
|
|
|
613
613
|
}
|
|
614
614
|
|
|
615
615
|
// src/qualifyLaunch.ts
|
|
616
|
-
var qualifyPick = (chartType) => ({ kind: "pick", chartType });
|
|
616
|
+
var qualifyPick = (chartType, projectionKey) => ({ kind: "pick", chartType, ...projectionKey ? { projectionKey } : {} });
|
|
617
617
|
var qualifyAuto = () => ({ kind: "auto" });
|
|
618
618
|
var qualifyCancel = () => ({ kind: "cancel" });
|
|
619
619
|
function launchGenerates(outcome) {
|
|
@@ -639,8 +639,8 @@ function shouldOpenInlineChooserOnGenerate(i) {
|
|
|
639
639
|
function canConfirmLaunch(selected) {
|
|
640
640
|
return typeof selected === "string" && selected.trim() !== "";
|
|
641
641
|
}
|
|
642
|
-
function confirmLaunch(selected) {
|
|
643
|
-
return canConfirmLaunch(selected) ? qualifyPick(String(selected).trim()) : qualifyCancel();
|
|
642
|
+
function confirmLaunch(selected, projectionKey) {
|
|
643
|
+
return canConfirmLaunch(selected) ? qualifyPick(String(selected).trim(), projectionKey) : qualifyCancel();
|
|
644
644
|
}
|
|
645
645
|
function qualifyFailureFallsOpen(viaGenerate) {
|
|
646
646
|
return viaGenerate === true;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
/** How the reader left the chooser. Three outcomes, never two - see the note above. */
|
|
2
2
|
export type QualifyLaunchOutcome =
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* A named type. Rides the host's explicit-pick lane for exactly one generation.
|
|
5
|
+
*
|
|
6
|
+
* `projectionKey` is set when the row the reader clicked was a PROJECTED one: the list offers
|
|
7
|
+
* such a type once per projection that admits it, so the same chart appears at two grains and
|
|
8
|
+
* the pick has to say which. Absent for a direct row, and for a host that does not offer the
|
|
9
|
+
* choice - the server then picks the first projection that admits the type, as it always did.
|
|
10
|
+
*/
|
|
4
11
|
{
|
|
5
12
|
kind: "pick";
|
|
6
13
|
chartType: string;
|
|
14
|
+
projectionKey?: string;
|
|
7
15
|
}
|
|
8
16
|
/** "Choose for me." Generates with NO preference expressed. */
|
|
9
17
|
| {
|
|
@@ -13,7 +21,7 @@ export type QualifyLaunchOutcome =
|
|
|
13
21
|
| {
|
|
14
22
|
kind: "cancel";
|
|
15
23
|
};
|
|
16
|
-
export declare const qualifyPick: (chartType: string) => QualifyLaunchOutcome;
|
|
24
|
+
export declare const qualifyPick: (chartType: string, projectionKey?: string | null) => QualifyLaunchOutcome;
|
|
17
25
|
export declare const qualifyAuto: () => QualifyLaunchOutcome;
|
|
18
26
|
export declare const qualifyCancel: () => QualifyLaunchOutcome;
|
|
19
27
|
/** Does this outcome start a generation? False for cancel ALONE. */
|
|
@@ -120,7 +128,7 @@ export declare function canConfirmLaunch(selected: string | null | undefined): b
|
|
|
120
128
|
* reading is "this click means nothing", not "this click means spend a credit". The host's
|
|
121
129
|
* disabled state is the first guard; this is the second.
|
|
122
130
|
*/
|
|
123
|
-
export declare function confirmLaunch(selected: string | null | undefined): QualifyLaunchOutcome;
|
|
131
|
+
export declare function confirmLaunch(selected: string | null | undefined, projectionKey?: string | null): QualifyLaunchOutcome;
|
|
124
132
|
/**
|
|
125
133
|
* WHAT A FAILED QUALIFY MEANS depends on which door the reader came through, and this is the
|
|
126
134
|
* one place that says so.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.54",
|
|
4
4
|
"description": "Run a BIC-generated D3 chart in any web host: compiles the generated render() function, applies the shared option defaults, resolves mark clicks (through tooltip overlays), owns the selection affordance, and translates row indices between cross-filtered charts. The same contract the BIC Power BI visual implements, minus Power BI. React bindings at @bicharts/chart-host/react.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|