@bicharts/chart-host 0.6.102 → 0.6.103
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/adapters.mjs +3 -3
- package/dist/{chunk-ALX4D2I2.mjs → chunk-4BR6VJQX.mjs} +635 -32
- package/dist/{chunk-M7MBTLDP.mjs → chunk-7XRQUFVH.mjs} +3 -1
- package/dist/{chunk-ASLRGGLV.mjs → chunk-CPLWAW3Z.mjs} +1 -1
- package/dist/{chunk-B6BLSIID.mjs → chunk-IE426WU6.mjs} +2 -2
- package/dist/{chunk-3JBJ2SIF.mjs → chunk-IE7TM6DX.mjs} +1 -1
- package/dist/{chunk-5OCL4EFM.mjs → chunk-P2DLK7WZ.mjs} +1 -1
- package/dist/{chunk-PMA56BKD.mjs → chunk-PA5V6J6K.mjs} +1 -1
- package/dist/{chunk-WSNDXS3Z.mjs → chunk-TLIBO5PT.mjs} +1 -1
- package/dist/index.mjs +190 -7
- package/dist/legend-fit.mjs +3 -3
- package/dist/page.mjs +4 -4
- package/dist/react.mjs +7 -7
- package/dist/testing.mjs +1 -1
- package/dist/types/contract.d.ts +8 -1
- package/dist/types/exportTable.d.ts +100 -0
- package/dist/types/host.d.ts +3 -2
- package/dist/types/hostLinks.d.ts +11 -0
- package/dist/types/index.d.ts +4 -1
- package/dist/types/shareRate.d.ts +90 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! @bicharts/chart-host — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; Natural Earth and US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
2
|
|
|
3
3
|
// src/contract.ts
|
|
4
|
-
var HOST_CONTRACT_VERSION = "1.
|
|
4
|
+
var HOST_CONTRACT_VERSION = "1.20.0";
|
|
5
5
|
var GEO_POINT_PRECISIONS = ["latlon", "city", "zip3", "state", "country"];
|
|
6
6
|
var MARK_CLASS = "d3-mark";
|
|
7
7
|
var LEGEND_MARK_CLASS = "d3-legend-mark";
|
|
@@ -9,6 +9,7 @@ var AXIS_FILTER_CLASS = "d3-axis-filter";
|
|
|
9
9
|
var LIFT_SELECTED_CLASS = "d3-lift-selected";
|
|
10
10
|
var CONTROL_CLASS = "lch-control";
|
|
11
11
|
var ROW_IDX_ATTR = "data-row-idx";
|
|
12
|
+
var NOTE_STYLE_ATTR = "data-bic-note-style";
|
|
12
13
|
var SELECTION_RULE_ATTR = "data-lch-sel-rule";
|
|
13
14
|
var SELECTION_RULE_CLICKED_MARKS = "clicked-marks";
|
|
14
15
|
var MARK_KEY_ATTR = "data-mark-key";
|
|
@@ -80,6 +81,7 @@ export {
|
|
|
80
81
|
LIFT_SELECTED_CLASS,
|
|
81
82
|
CONTROL_CLASS,
|
|
82
83
|
ROW_IDX_ATTR,
|
|
84
|
+
NOTE_STYLE_ATTR,
|
|
83
85
|
SELECTION_RULE_ATTR,
|
|
84
86
|
SELECTION_RULE_CLICKED_MARKS,
|
|
85
87
|
MARK_KEY_ATTR,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
gestureWasDrag,
|
|
5
5
|
isInsideControl,
|
|
6
6
|
rowIdxsFromMark
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-P2DLK7WZ.mjs";
|
|
8
8
|
import {
|
|
9
9
|
AXIS_FILTER_CLASS,
|
|
10
10
|
CONTROL_CLASS,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
MARK_CLASS,
|
|
13
13
|
ROW_IDX_ATTR,
|
|
14
14
|
SNAPSHOT_SVG_ATTR
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7XRQUFVH.mjs";
|
|
16
16
|
|
|
17
17
|
// src/lasso.ts
|
|
18
18
|
var LASSO_ROW_CAP = 5e3;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! @bicharts/chart-host — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; Natural Earth and US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
2
|
import {
|
|
3
3
|
SNAPSHOT_SVG_ATTR
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7XRQUFVH.mjs";
|
|
5
5
|
|
|
6
6
|
// src/snapshot.ts
|
|
7
7
|
var DEFAULT_TIMEOUT_MS = 2e3;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! @bicharts/chart-host — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; Natural Earth and US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
2
|
import {
|
|
3
3
|
LASSO_KNOB_KEY
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IE426WU6.mjs";
|
|
5
5
|
|
|
6
6
|
// src/filterScope.ts
|
|
7
7
|
function viewToken(view) {
|
package/dist/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
svgNaturalSize,
|
|
16
16
|
svgToDataUrl,
|
|
17
17
|
tableHostOf
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-PA5V6J6K.mjs";
|
|
19
19
|
import {
|
|
20
20
|
ANNOTATION_CLASS,
|
|
21
21
|
ANNOTATION_LAYER_CLASS,
|
|
@@ -24,8 +24,10 @@ import {
|
|
|
24
24
|
AUTO_RAMP_MIN_STEP_DELTA_E,
|
|
25
25
|
BACKING_MAJORITY,
|
|
26
26
|
CLIP_TOLERANCE_PX,
|
|
27
|
+
CSV_MIME,
|
|
27
28
|
D3_PLUGIN_PACKAGES,
|
|
28
29
|
DARK_TEXT,
|
|
30
|
+
EXPORT_FORMATS,
|
|
29
31
|
GLYPH_SAMPLE_N,
|
|
30
32
|
LABEL_CONTRAST_CAP,
|
|
31
33
|
LABEL_CONTRAST_DONE_ATTR,
|
|
@@ -45,13 +47,17 @@ import {
|
|
|
45
47
|
STRADDLE_TARGET_CONTRAST,
|
|
46
48
|
VALUE_AXIS_MIN_FIT,
|
|
47
49
|
WHITE_TEXT_BG_LUM,
|
|
50
|
+
XLSX_MIME,
|
|
48
51
|
applyLabelContrast,
|
|
49
52
|
assembleD3,
|
|
50
53
|
autoRampCanvas,
|
|
51
54
|
autoRampMinStep,
|
|
52
55
|
backingHoldsGlyph,
|
|
53
56
|
blankRenderFlag,
|
|
57
|
+
browserSaveFile,
|
|
58
|
+
buildExportFile,
|
|
54
59
|
buildRenderPayload,
|
|
60
|
+
bytesToBase64,
|
|
55
61
|
cellSuppressesNormalize,
|
|
56
62
|
censusClippedText,
|
|
57
63
|
censusColourSpread,
|
|
@@ -67,7 +73,12 @@ import {
|
|
|
67
73
|
createChartHost,
|
|
68
74
|
decideLabelColor,
|
|
69
75
|
deltaEHex,
|
|
76
|
+
excelNumberFormat,
|
|
77
|
+
excelSerial,
|
|
70
78
|
explainRenderFailure,
|
|
79
|
+
exportFileName,
|
|
80
|
+
exportFormatsFor,
|
|
81
|
+
exportTableService,
|
|
71
82
|
geoAssetFor,
|
|
72
83
|
geoFromCache,
|
|
73
84
|
glyphSampleGrid,
|
|
@@ -89,15 +100,18 @@ import {
|
|
|
89
100
|
resolveOptions,
|
|
90
101
|
scopeChartIds,
|
|
91
102
|
sessionViewStateProvider,
|
|
103
|
+
sheetName,
|
|
92
104
|
straddleSampleGrid,
|
|
93
105
|
straddles,
|
|
94
106
|
stripEsmExports,
|
|
95
107
|
stripJsComments,
|
|
96
108
|
syncMemberSelection,
|
|
109
|
+
tableToCsv,
|
|
110
|
+
tableToXlsx,
|
|
97
111
|
toRGBA,
|
|
98
112
|
toSourceRows,
|
|
99
113
|
valuePlacementFlag
|
|
100
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-4BR6VJQX.mjs";
|
|
101
115
|
import {
|
|
102
116
|
LASSO_AXES_SLOT,
|
|
103
117
|
LASSO_COUNT_CLASS,
|
|
@@ -124,13 +138,13 @@ import {
|
|
|
124
138
|
lassoVerdict,
|
|
125
139
|
pointInShape,
|
|
126
140
|
registerLassoAction
|
|
127
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-IE426WU6.mjs";
|
|
128
142
|
import {
|
|
129
143
|
MIN_HIT_BAND_PX,
|
|
130
144
|
censusHitBands,
|
|
131
145
|
ensureCrossfilterHitTargets,
|
|
132
146
|
hitBandFlag
|
|
133
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-CPLWAW3Z.mjs";
|
|
134
148
|
import {
|
|
135
149
|
CONTAINER_SLOT_PRESS_AT,
|
|
136
150
|
DRAG_NOT_CLICK_PX,
|
|
@@ -155,7 +169,7 @@ import {
|
|
|
155
169
|
selectionRuleOf,
|
|
156
170
|
trackPress,
|
|
157
171
|
validRowSet
|
|
158
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-P2DLK7WZ.mjs";
|
|
159
173
|
import {
|
|
160
174
|
AXIS_PIN_BAND_PAD_PX,
|
|
161
175
|
AXIS_PIN_MAX_BAND_FRACTION,
|
|
@@ -184,7 +198,7 @@ import {
|
|
|
184
198
|
svgInkReach,
|
|
185
199
|
takeScroll,
|
|
186
200
|
unpinScrolledAxis
|
|
187
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-IE7TM6DX.mjs";
|
|
188
202
|
import {
|
|
189
203
|
_3,
|
|
190
204
|
l,
|
|
@@ -230,6 +244,7 @@ import {
|
|
|
230
244
|
MARK_KEY_ATTR,
|
|
231
245
|
MARK_SELECTED_CLASS,
|
|
232
246
|
MAX_MAP_POINTS_DEFAULT,
|
|
247
|
+
NOTE_STYLE_ATTR,
|
|
233
248
|
NO_ROW_MARKS_ATTR,
|
|
234
249
|
ROW_IDX_ATTR,
|
|
235
250
|
SEASONAL_MARKERS_DEFAULT,
|
|
@@ -243,9 +258,32 @@ import {
|
|
|
243
258
|
chartOwnsTimeline,
|
|
244
259
|
periodTickSuppressesFeedback,
|
|
245
260
|
withoutViewOnlyKeys
|
|
246
|
-
} from "./chunk-
|
|
261
|
+
} from "./chunk-7XRQUFVH.mjs";
|
|
247
262
|
import "./chunk-GHODWOAL.mjs";
|
|
248
263
|
|
|
264
|
+
// src/hostLinks.ts
|
|
265
|
+
var LINK_SCHEME_RE = /^(https?:\/\/|mailto:)/i;
|
|
266
|
+
function hostLinkServices(open, clipboard) {
|
|
267
|
+
const out = {};
|
|
268
|
+
if (clipboard) {
|
|
269
|
+
out.copyText = (text) => {
|
|
270
|
+
try {
|
|
271
|
+
if (typeof clipboard.writeText !== "function") return false;
|
|
272
|
+
return clipboard.writeText(String(text ?? "")).then(() => true, () => false);
|
|
273
|
+
} catch {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
if (typeof open === "function") {
|
|
279
|
+
out.openUrl = (url) => {
|
|
280
|
+
const u2 = String(url ?? "").trim();
|
|
281
|
+
if (LINK_SCHEME_RE.test(u2)) open(u2);
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
return out;
|
|
285
|
+
}
|
|
286
|
+
|
|
249
287
|
// src/optionsVocabulary.ts
|
|
250
288
|
var MAX_MAP_POINTS_MIN = 10;
|
|
251
289
|
var MAX_MAP_POINTS_MAX = 1e5;
|
|
@@ -911,6 +949,133 @@ function safely(fn) {
|
|
|
911
949
|
}
|
|
912
950
|
}
|
|
913
951
|
|
|
952
|
+
// src/shareRate.ts
|
|
953
|
+
var TARGET_ID = /^[a-z0-9]{1,8}$/;
|
|
954
|
+
function httpsUrl(raw) {
|
|
955
|
+
if (typeof raw !== "string" || !raw) return null;
|
|
956
|
+
try {
|
|
957
|
+
const u2 = new URL(raw);
|
|
958
|
+
return u2.protocol === "https:" ? u2.href : null;
|
|
959
|
+
} catch {
|
|
960
|
+
return null;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
function shareRateLineModel(ask) {
|
|
964
|
+
if (!ask || typeof ask !== "object") return null;
|
|
965
|
+
const rateUrl = httpsUrl(ask.rateUrl ?? ask.RateUrl);
|
|
966
|
+
const share = [];
|
|
967
|
+
const seen = /* @__PURE__ */ new Set();
|
|
968
|
+
for (const t2 of ask.targets ?? ask.Targets ?? []) {
|
|
969
|
+
if (!t2 || typeof t2 !== "object") continue;
|
|
970
|
+
const id = String(t2.id ?? t2.Id ?? "");
|
|
971
|
+
const label = String(t2.label ?? t2.Label ?? "").trim();
|
|
972
|
+
const url = httpsUrl(t2.url ?? t2.Url);
|
|
973
|
+
if (!TARGET_ID.test(id) || !label || !url || seen.has(id)) continue;
|
|
974
|
+
seen.add(id);
|
|
975
|
+
share.push({ id, label, url });
|
|
976
|
+
}
|
|
977
|
+
if (!rateUrl && share.length === 0) return null;
|
|
978
|
+
return { share, rateUrl };
|
|
979
|
+
}
|
|
980
|
+
var DEFAULT_TEXT3 = {
|
|
981
|
+
lead: "Like it? Share it on",
|
|
982
|
+
separator: " \xB7 ",
|
|
983
|
+
or: ", or",
|
|
984
|
+
rate: "rate it on AppSource",
|
|
985
|
+
rateAlone: "Like it? Rate it on AppSource",
|
|
986
|
+
note: "Your ratings and feedback encourage us to do more.",
|
|
987
|
+
thanks: "Thanks for rating it.",
|
|
988
|
+
rateToo: "Rate it on AppSource too",
|
|
989
|
+
shareMenu: "Share it"
|
|
990
|
+
};
|
|
991
|
+
function mountShareRateLine(container, opts) {
|
|
992
|
+
const model = shareRateLineModel(opts.ask);
|
|
993
|
+
if (!model) return null;
|
|
994
|
+
const doc = container.ownerDocument ?? document;
|
|
995
|
+
const text = { ...DEFAULT_TEXT3, ...opts.text ?? {} };
|
|
996
|
+
const wrap = doc.createElement("div");
|
|
997
|
+
wrap.className = "bic-share-rate" + (opts.className ? " " + opts.className : "");
|
|
998
|
+
const span = (cls, s2) => {
|
|
999
|
+
const el = doc.createElement("span");
|
|
1000
|
+
el.className = cls;
|
|
1001
|
+
el.textContent = s2;
|
|
1002
|
+
return el;
|
|
1003
|
+
};
|
|
1004
|
+
const link = (cls, label, url, onClick) => {
|
|
1005
|
+
const a2 = doc.createElement("a");
|
|
1006
|
+
a2.className = cls;
|
|
1007
|
+
a2.href = url;
|
|
1008
|
+
a2.textContent = label;
|
|
1009
|
+
a2.rel = "noopener noreferrer";
|
|
1010
|
+
a2.addEventListener("click", (e2) => {
|
|
1011
|
+
e2.preventDefault();
|
|
1012
|
+
safely2(() => opts.open(url));
|
|
1013
|
+
safely2(onClick);
|
|
1014
|
+
});
|
|
1015
|
+
return a2;
|
|
1016
|
+
};
|
|
1017
|
+
const appendNetworks = (into) => model.share.forEach((t2, i2) => {
|
|
1018
|
+
if (i2 > 0) into.append(span("bic-share-rate-sep", text.separator));
|
|
1019
|
+
const a2 = link("bic-share-rate-share", t2.label, t2.url, () => opts.onShare?.(t2.id));
|
|
1020
|
+
a2.setAttribute("data-target", t2.id);
|
|
1021
|
+
into.append(a2);
|
|
1022
|
+
});
|
|
1023
|
+
if (opts.layout === "menu") {
|
|
1024
|
+
wrap.setAttribute("data-layout", "menu");
|
|
1025
|
+
wrap.append(span("bic-share-rate-lead", text.thanks + " "));
|
|
1026
|
+
if (model.rateUrl) wrap.append(link("bic-share-rate-rate", text.rateToo, model.rateUrl, () => opts.onRate?.()));
|
|
1027
|
+
if (model.share.length > 0) {
|
|
1028
|
+
if (model.rateUrl) wrap.append(span("bic-share-rate-sep", text.separator));
|
|
1029
|
+
const toggle = doc.createElement("button");
|
|
1030
|
+
toggle.type = "button";
|
|
1031
|
+
toggle.className = "bic-share-rate-toggle";
|
|
1032
|
+
toggle.textContent = text.shareMenu;
|
|
1033
|
+
toggle.setAttribute("aria-expanded", "false");
|
|
1034
|
+
const menu = doc.createElement("span");
|
|
1035
|
+
menu.className = "bic-share-rate-menu";
|
|
1036
|
+
menu.hidden = true;
|
|
1037
|
+
menu.append(span("bic-share-rate-menu-gap", " "));
|
|
1038
|
+
appendNetworks(menu);
|
|
1039
|
+
toggle.addEventListener("click", () => {
|
|
1040
|
+
const open = menu.hidden;
|
|
1041
|
+
menu.hidden = !open;
|
|
1042
|
+
toggle.setAttribute("aria-expanded", String(open));
|
|
1043
|
+
if (open) safely2(() => opts.onMenu?.());
|
|
1044
|
+
});
|
|
1045
|
+
wrap.append(toggle, menu);
|
|
1046
|
+
}
|
|
1047
|
+
} else if (model.share.length > 0) {
|
|
1048
|
+
wrap.append(span("bic-share-rate-lead", text.lead + " "));
|
|
1049
|
+
appendNetworks(wrap);
|
|
1050
|
+
if (model.rateUrl) {
|
|
1051
|
+
wrap.append(span("bic-share-rate-or", text.or + " "));
|
|
1052
|
+
wrap.append(link("bic-share-rate-rate", text.rate, model.rateUrl, () => opts.onRate?.()));
|
|
1053
|
+
}
|
|
1054
|
+
wrap.append(span("bic-share-rate-end", "."));
|
|
1055
|
+
} else {
|
|
1056
|
+
wrap.append(link("bic-share-rate-rate", text.rateAlone, model.rateUrl, () => opts.onRate?.()));
|
|
1057
|
+
wrap.append(span("bic-share-rate-end", "."));
|
|
1058
|
+
}
|
|
1059
|
+
if (text.note && opts.layout !== "menu") wrap.append(span("bic-share-rate-note", " " + text.note));
|
|
1060
|
+
const stop = (e2) => e2.stopPropagation();
|
|
1061
|
+
wrap.addEventListener("click", stop);
|
|
1062
|
+
container.appendChild(wrap);
|
|
1063
|
+
safely2(() => opts.onShown?.());
|
|
1064
|
+
return {
|
|
1065
|
+
element: wrap,
|
|
1066
|
+
destroy() {
|
|
1067
|
+
wrap.removeEventListener("click", stop);
|
|
1068
|
+
wrap.remove();
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
1072
|
+
function safely2(fn) {
|
|
1073
|
+
try {
|
|
1074
|
+
fn();
|
|
1075
|
+
} catch {
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
|
|
914
1079
|
// src/qualifyGroups.ts
|
|
915
1080
|
function newQualifyGroupState() {
|
|
916
1081
|
return { preview: false, previewClosed: false, projected: false, notRecommended: false, rankedSeen: false };
|
|
@@ -2164,6 +2329,7 @@ export {
|
|
|
2164
2329
|
CONTAINER_SLOT_UI_STATE,
|
|
2165
2330
|
CONTAINER_SLOT_XF_CLEAR,
|
|
2166
2331
|
CONTROL_CLASS,
|
|
2332
|
+
CSV_MIME,
|
|
2167
2333
|
D3_PLUGIN_PACKAGES,
|
|
2168
2334
|
DARK_TEXT,
|
|
2169
2335
|
DEFAULT_FILTER_MATCH_STYLE,
|
|
@@ -2173,6 +2339,7 @@ export {
|
|
|
2173
2339
|
DIM_OPACITY_VAR,
|
|
2174
2340
|
DRAG_NOT_CLICK_PX,
|
|
2175
2341
|
DUPLICATE_GENERATE_WINDOW_MS,
|
|
2342
|
+
EXPORT_FORMATS,
|
|
2176
2343
|
FILTER_MIN_HEIGHT_PX,
|
|
2177
2344
|
FILTER_MIN_TERM_CHARS,
|
|
2178
2345
|
FILTER_MIN_WIDTH_PX,
|
|
@@ -2228,6 +2395,7 @@ export {
|
|
|
2228
2395
|
MIN_DELTA_E,
|
|
2229
2396
|
MIN_HIT_BAND_PX,
|
|
2230
2397
|
MIN_RAMP_FILLS,
|
|
2398
|
+
NOTE_STYLE_ATTR,
|
|
2231
2399
|
NO_ROW_MARKS_ATTR,
|
|
2232
2400
|
OPTIONS_VOCABULARY,
|
|
2233
2401
|
PAGE_MATCH_TOLERANCE,
|
|
@@ -2270,6 +2438,7 @@ export {
|
|
|
2270
2438
|
VIEW_ONLY_UI_STATE_KEYS,
|
|
2271
2439
|
WHITE_TEXT_BG_LUM,
|
|
2272
2440
|
XFILTER_REFRESH_EVENT,
|
|
2441
|
+
XLSX_MIME,
|
|
2273
2442
|
actionFor,
|
|
2274
2443
|
applyLabelContrast,
|
|
2275
2444
|
armGenerateGuard,
|
|
@@ -2281,11 +2450,14 @@ export {
|
|
|
2281
2450
|
backingHoldsGlyph,
|
|
2282
2451
|
bareBase64,
|
|
2283
2452
|
blankRenderFlag,
|
|
2453
|
+
browserSaveFile,
|
|
2454
|
+
buildExportFile,
|
|
2284
2455
|
buildPalette,
|
|
2285
2456
|
buildPaletteFromSeed,
|
|
2286
2457
|
buildProductFeedbackPayload,
|
|
2287
2458
|
buildRenderPayload,
|
|
2288
2459
|
buildReviewWire,
|
|
2460
|
+
bytesToBase64,
|
|
2289
2461
|
canConfirmLaunch,
|
|
2290
2462
|
canShowLastChart,
|
|
2291
2463
|
captureSvgSnapshot,
|
|
@@ -2328,7 +2500,13 @@ export {
|
|
|
2328
2500
|
dispatchRowSet,
|
|
2329
2501
|
encodePendingGenerate,
|
|
2330
2502
|
ensureCrossfilterHitTargets,
|
|
2503
|
+
excelNumberFormat,
|
|
2504
|
+
excelSerial,
|
|
2331
2505
|
explainRenderFailure,
|
|
2506
|
+
exportFileName,
|
|
2507
|
+
exportFormatsFor,
|
|
2508
|
+
sheetName as exportSheetName,
|
|
2509
|
+
exportTableService,
|
|
2332
2510
|
filterFitsChooser,
|
|
2333
2511
|
filterMatchStyleOf,
|
|
2334
2512
|
filterQualifyRows,
|
|
@@ -2344,6 +2522,7 @@ export {
|
|
|
2344
2522
|
glyphSampleGrid,
|
|
2345
2523
|
hasRefusalsToShow,
|
|
2346
2524
|
hitBandFlag,
|
|
2525
|
+
hostLinkServices,
|
|
2347
2526
|
htmlNaturalSize,
|
|
2348
2527
|
htmlToSvgDataUrl,
|
|
2349
2528
|
inlineFilterGate,
|
|
@@ -2379,6 +2558,7 @@ export {
|
|
|
2379
2558
|
measureContainerBoxes,
|
|
2380
2559
|
minContrastOver,
|
|
2381
2560
|
mountProductFeedbackBox,
|
|
2561
|
+
mountShareRateLine,
|
|
2382
2562
|
needsScroll,
|
|
2383
2563
|
newIdScope,
|
|
2384
2564
|
newQualifyGroupState,
|
|
@@ -2451,6 +2631,7 @@ export {
|
|
|
2451
2631
|
selectionRuleOf,
|
|
2452
2632
|
servedCorrelationProves,
|
|
2453
2633
|
sessionViewStateProvider,
|
|
2634
|
+
shareRateLineModel,
|
|
2454
2635
|
shouldCaptureThumbnail,
|
|
2455
2636
|
shouldOpenChooserOnGenerate,
|
|
2456
2637
|
shouldOpenInlineChooserOnGenerate,
|
|
@@ -2466,6 +2647,8 @@ export {
|
|
|
2466
2647
|
svgToDataUrl,
|
|
2467
2648
|
syncMemberSelection,
|
|
2468
2649
|
tableHostOf,
|
|
2650
|
+
tableToCsv,
|
|
2651
|
+
tableToXlsx,
|
|
2469
2652
|
takeScroll,
|
|
2470
2653
|
toRGBA,
|
|
2471
2654
|
toSourceRows,
|
package/dist/legend-fit.mjs
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
chartSvgOf,
|
|
4
4
|
tableHostOf
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PA5V6J6K.mjs";
|
|
6
6
|
import {
|
|
7
7
|
FIT_CONTENT_SELECTOR,
|
|
8
8
|
ctmScaleOf,
|
|
9
9
|
isPhantomBox
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-IE7TM6DX.mjs";
|
|
11
|
+
import "./chunk-7XRQUFVH.mjs";
|
|
12
12
|
import "./chunk-GHODWOAL.mjs";
|
|
13
13
|
|
|
14
14
|
// src/legendFit/legendReconcile.ts
|
package/dist/page.mjs
CHANGED
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
readControls,
|
|
15
15
|
viewFromToken,
|
|
16
16
|
viewToken
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-TLIBO5PT.mjs";
|
|
18
|
+
import "./chunk-IE426WU6.mjs";
|
|
19
|
+
import "./chunk-P2DLK7WZ.mjs";
|
|
20
|
+
import "./chunk-7XRQUFVH.mjs";
|
|
21
21
|
import "./chunk-GHODWOAL.mjs";
|
|
22
22
|
export {
|
|
23
23
|
LINKED_HOVER_CLASS,
|
package/dist/react.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
payloadRowReader,
|
|
14
14
|
viewFromToken,
|
|
15
15
|
viewToken
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TLIBO5PT.mjs";
|
|
17
17
|
import {
|
|
18
18
|
assembleD3,
|
|
19
19
|
createChartGroup,
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
loadGeo,
|
|
23
23
|
syncMemberSelection,
|
|
24
24
|
toSourceRows
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-4BR6VJQX.mjs";
|
|
26
|
+
import "./chunk-IE426WU6.mjs";
|
|
27
|
+
import "./chunk-CPLWAW3Z.mjs";
|
|
28
|
+
import "./chunk-P2DLK7WZ.mjs";
|
|
29
|
+
import "./chunk-IE7TM6DX.mjs";
|
|
30
30
|
import "./chunk-CNT3QA3R.mjs";
|
|
31
31
|
import "./chunk-A2GMXZP7.mjs";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-7XRQUFVH.mjs";
|
|
33
33
|
import "./chunk-GHODWOAL.mjs";
|
|
34
34
|
|
|
35
35
|
// src/react.tsx
|
package/dist/testing.mjs
CHANGED
package/dist/types/contract.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ExportFormat, ExportTableService, SaveFileService } from "./exportTable";
|
|
2
|
+
export declare const HOST_CONTRACT_VERSION = "1.20.0";
|
|
2
3
|
export type GeoPointPrecision = "latlon" | "city" | "zip3" | "state" | "country";
|
|
3
4
|
/** Every valid tier, ordered most precise → coarsest. Runtime form of GeoPointPrecision. */
|
|
4
5
|
export declare const GEO_POINT_PRECISIONS: readonly GeoPointPrecision[];
|
|
@@ -13,6 +14,7 @@ export declare const AXIS_FILTER_CLASS = "d3-axis-filter";
|
|
|
13
14
|
export declare const LIFT_SELECTED_CLASS = "d3-lift-selected";
|
|
14
15
|
export declare const CONTROL_CLASS = "lch-control";
|
|
15
16
|
export declare const ROW_IDX_ATTR = "data-row-idx";
|
|
17
|
+
export declare const NOTE_STYLE_ATTR = "data-bic-note-style";
|
|
16
18
|
export declare const SELECTION_RULE_ATTR = "data-lch-sel-rule";
|
|
17
19
|
export declare const SELECTION_RULE_CLICKED_MARKS = "clicked-marks";
|
|
18
20
|
export declare const MARK_KEY_ATTR = "data-mark-key";
|
|
@@ -126,6 +128,11 @@ export interface RenderOptions {
|
|
|
126
128
|
dataComplete?: boolean;
|
|
127
129
|
rowsWithheld?: number;
|
|
128
130
|
rowsFilteredOut?: number;
|
|
131
|
+
openUrl?: (url: string) => void;
|
|
132
|
+
copyText?: (text: string) => boolean | void | Promise<boolean | void>;
|
|
133
|
+
saveFile?: SaveFileService;
|
|
134
|
+
exportFormats?: readonly ExportFormat[];
|
|
135
|
+
exportTable?: ExportTableService;
|
|
129
136
|
geoPointDest?: {
|
|
130
137
|
precision: GeoPointPrecision | null;
|
|
131
138
|
precisionCounts: Record<GeoPointPrecision, number>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** The kind of value one exported column holds. Anything that is not a number, a date or a yes/no is text. */
|
|
2
|
+
export type ExportColumnType = "text" | "number" | "date" | "boolean";
|
|
3
|
+
/** One exported column, in the order the reader sees it. */
|
|
4
|
+
export interface ExportColumn {
|
|
5
|
+
/** The header, as the reader sees it. */
|
|
6
|
+
name: string;
|
|
7
|
+
type: ExportColumnType;
|
|
8
|
+
/** The d3-format specifier the chart prints this number with (a number column only). Wins over modelFormat. */
|
|
9
|
+
d3Format?: string | null;
|
|
10
|
+
/** The data model's own number format (an Excel / Power BI format string), used when there is no d3Format. */
|
|
11
|
+
modelFormat?: string | null;
|
|
12
|
+
}
|
|
13
|
+
/** One cell's value. A blank (null, undefined, "" or a value its column's type cannot read) is an empty cell. */
|
|
14
|
+
export type ExportCell = string | number | boolean | Date | null | undefined;
|
|
15
|
+
/** What a chart hands out: the visible columns in display order, and the rows in display order. */
|
|
16
|
+
export interface ExportTable {
|
|
17
|
+
/** Names the file and the worksheet. Absent: "table". */
|
|
18
|
+
title?: string | null;
|
|
19
|
+
columns: ExportColumn[];
|
|
20
|
+
rows: ExportCell[][];
|
|
21
|
+
}
|
|
22
|
+
export type ExportFormat = "csv" | "xlsx";
|
|
23
|
+
/** The formats a chart may offer, best first. */
|
|
24
|
+
export declare const EXPORT_FORMATS: readonly ExportFormat[];
|
|
25
|
+
/** A finished file, as a host's file service receives it. */
|
|
26
|
+
export interface ExportFile {
|
|
27
|
+
/** A file name with its extension, safe on every file system. */
|
|
28
|
+
name: string;
|
|
29
|
+
format: ExportFormat;
|
|
30
|
+
mime: string;
|
|
31
|
+
bytes: Uint8Array;
|
|
32
|
+
/** The same content as text, for a text format (the CSV); absent for a binary one. */
|
|
33
|
+
text?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The table the file was written from, for a host that keeps it its own way (a spreadsheet add-in that must give
|
|
36
|
+
* the new sheet a name the open workbook does not already use, and so writes the workbook again under that name).
|
|
37
|
+
*/
|
|
38
|
+
table: ExportTable;
|
|
39
|
+
}
|
|
40
|
+
export declare const XLSX_MIME = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
41
|
+
export declare const CSV_MIME = "text/csv";
|
|
42
|
+
/**
|
|
43
|
+
* Excel's day number for a UTC time: days since 1899-12-30, the fraction being the time of day. Excel counts a
|
|
44
|
+
* 29 February 1900 that never was (day 60), so a day before 1 March 1900 is one lower to read back as itself.
|
|
45
|
+
*/
|
|
46
|
+
export declare function excelSerial(t: number): number;
|
|
47
|
+
/**
|
|
48
|
+
* The Excel number format for an exported number column, or null for General. `values` are the column's numbers, so a
|
|
49
|
+
* format that shows "up to" some decimals shows as many as the data has.
|
|
50
|
+
*/
|
|
51
|
+
export declare function excelNumberFormat(col: Pick<ExportColumn, "d3Format" | "modelFormat">, values?: readonly number[]): string | null;
|
|
52
|
+
/**
|
|
53
|
+
* The table as CSV text: a header row, then one line per row, CRLF between lines, RFC 4180 quoting. A number is its
|
|
54
|
+
* plain value (a point for the decimal, no grouping), a date its ISO day (and time, when the column has one), a yes/no
|
|
55
|
+
* TRUE or FALSE. The text starts with a byte-order mark so a spreadsheet reads it as UTF-8.
|
|
56
|
+
*/
|
|
57
|
+
export declare function tableToCsv(table: ExportTable): string;
|
|
58
|
+
/** A1-style column letters for a 0-based column index. */
|
|
59
|
+
export declare function columnLetters(ci: number): string;
|
|
60
|
+
/** A worksheet name Excel accepts: at most 31 characters, none of []:*?/\, not blank, not starting or ending with '. */
|
|
61
|
+
export declare function sheetName(title: string | null | undefined): string;
|
|
62
|
+
/** A file name safe on every file system, from a title: no reserved characters, at most 80 characters. */
|
|
63
|
+
export declare function exportFileName(title: string | null | undefined, format: ExportFormat): string;
|
|
64
|
+
/**
|
|
65
|
+
* The table as an .xlsx workbook's bytes. One worksheet named after the title: a bold header row, frozen, with filter
|
|
66
|
+
* buttons; typed cells (numbers with their format where Excel can carry it, dates as dates, TRUE/FALSE); each column as
|
|
67
|
+
* wide as its widest value, within limits. Rows past Excel's limit are left out (a sheet holds 1,048,576 rows).
|
|
68
|
+
*/
|
|
69
|
+
export declare function tableToXlsx(table: ExportTable): Uint8Array;
|
|
70
|
+
/**
|
|
71
|
+
* A ZIP archive of the given files, stored without compression (method 0) - every reader of a workbook accepts it. The
|
|
72
|
+
* entries carry a fixed timestamp, so the same table always gives the same bytes.
|
|
73
|
+
*/
|
|
74
|
+
export declare function zipStored(files: Array<[string, string | Uint8Array]>): Uint8Array;
|
|
75
|
+
/** Builds the finished file for a table in one of the export formats. */
|
|
76
|
+
export declare function buildExportFile(table: ExportTable, format: ExportFormat): ExportFile;
|
|
77
|
+
/** Base64 of a file's bytes, for a host whose file service takes binary content as base64 text. */
|
|
78
|
+
export declare function bytesToBase64(bytes: Uint8Array): string;
|
|
79
|
+
/** A host's file service: saves a finished file the host's own way. False, a throw or a rejection means it did not. */
|
|
80
|
+
export type SaveFileService = (file: ExportFile) => boolean | void | Promise<boolean | void>;
|
|
81
|
+
/** The chart-facing export: what options.exportTable is. Resolves true when the host saved the file. */
|
|
82
|
+
export type ExportTableService = (table: ExportTable, format: ExportFormat) => Promise<boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* The formats a host's file service takes, best first: the host's own list (when it names one) kept to the formats
|
|
85
|
+
* this module writes, in EXPORT_FORMATS order, without repeats. Absent or not a list: every format. An empty result
|
|
86
|
+
* means the host can save none of them, so it gets no export.
|
|
87
|
+
*/
|
|
88
|
+
export declare function exportFormatsFor(hostFormats?: readonly unknown[] | null): ExportFormat[];
|
|
89
|
+
/**
|
|
90
|
+
* Builds the chart-facing exportTable from a host's file service. Never throws and never rejects: a table that cannot
|
|
91
|
+
* be written, a format the host does not take, or a host that refuses, resolves false, and the chart says the export
|
|
92
|
+
* did not happen.
|
|
93
|
+
*/
|
|
94
|
+
export declare function exportTableService(save: SaveFileService, formats?: readonly ExportFormat[]): ExportTableService;
|
|
95
|
+
/**
|
|
96
|
+
* A file service for a page in a browser: the file downloads through a link the page never shows. For a React or
|
|
97
|
+
* Blazor page, a Fabric App, or any page whose browser allows downloads; a sandboxed frame without the
|
|
98
|
+
* "allow-downloads" permission silently drops it, so a host in one passes its own service (or none) instead.
|
|
99
|
+
*/
|
|
100
|
+
export declare function browserSaveFile(doc?: Document): SaveFileService;
|
package/dist/types/host.d.ts
CHANGED
|
@@ -257,8 +257,9 @@ export interface ChartHostConfig {
|
|
|
257
257
|
/**
|
|
258
258
|
* NOTES ON MARKS. Each annotation names a key - a value in a column of this chart's data, such as a
|
|
259
259
|
* country code - and the host draws a badge on that key's mark after every render, wherever a filter,
|
|
260
|
-
* a re-query or a
|
|
261
|
-
*
|
|
260
|
+
* a re-query, a zoom or a scroll has put it. A chart that declares NOTE_STYLE_ATTR="dot" gets a small
|
|
261
|
+
* dot at a fixed spot instead, the label in its tooltip. Keyed by value, never by row position. Change
|
|
262
|
+
* them with setAnnotations; none (the default) draws nothing.
|
|
262
263
|
*/
|
|
263
264
|
annotations?: MarkAnnotation[];
|
|
264
265
|
/** A badge was clicked. The mark beneath is not selected. */
|