@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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The clipboard half a host can supply: navigator.clipboard, or anything with the same writeText. */
|
|
2
|
+
export interface ClipboardLike {
|
|
3
|
+
writeText?: (text: string) => Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
/** The two services, ready to spread into a host's render options: each is absent when the host supplied nothing for it. */
|
|
6
|
+
export interface HostLinkServices {
|
|
7
|
+
openUrl?: (url: string) => void;
|
|
8
|
+
copyText?: (text: string) => boolean | Promise<boolean>;
|
|
9
|
+
}
|
|
10
|
+
/** Builds openUrl and copyText from a host's own opener and clipboard. */
|
|
11
|
+
export declare function hostLinkServices(open: ((url: string) => void) | undefined | null, clipboard: ClipboardLike | undefined | null): HostLinkServices;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { HOST_CONTRACT_VERSION, GEO_POINT_PRECISIONS, MARK_CLASS, LEGEND_MARK_CLASS, AXIS_FILTER_CLASS, ROW_IDX_ATTR, LIFT_SELECTED_CLASS, CONTROL_CLASS, NO_ROW_MARKS_ATTR, SELECTION_RULE_ATTR, SELECTION_RULE_CLICKED_MARKS, MARK_KEY_ATTR, CONTAINER_SLOT_CLICKED_MARKS, SNAPSHOT_SVG_ATTR, XFILTER_REFRESH_EVENT, CONTAINER_SLOT_ANIM_STOP, CONTAINER_SLOT_XF_CLEAR, CONTAINER_SLOT_INITIAL_XF_MARK, CONTAINER_SLOT_UI_STATE, CONTAINER_SLOT_SCROLL, VIEW_ONLY_UI_STATE_KEYS, withoutViewOnlyKeys, HOST_CONTAINER_CLASS, SELECTION_ACTIVE_CLASS, MARK_SELECTED_CLASS, ACTIVE_TICK_CLASS, DIM_OPACITY_VAR, DIM_OPACITY_DEFAULT, DIM_OPACITY_MIN, chartOwnsTimeline, periodTickSuppressesFeedback, ANIM_PLAY_SPEED_DEFAULT, ANIM_PLAY_SPEED_MIN, ANIM_PLAY_SPEED_MAX, ANIM_LOOP_DELAY_DEFAULT, ANIM_LOOP_DELAY_MIN, ANIM_MAX_IDEAL_FRAMES_DEFAULT, ANIM_MAX_IDEAL_FRAMES_MIN, ANIM_MAX_IDEAL_FRAMES_MAX, ANIMATION_OPTION_KEYS, COLOR_SCALE_SELF_CLAMP_PCT_DEFAULT, COLOR_SCALE_SELF_CLAMP_PCT_MIN, COLOR_SCALE_SELF_CLAMP_PCT_MAX, FLIP_MODE_DEFAULT, FLIP_INTERVAL_MIN_MS, FLIP_INTERVAL_MAX_MS, FLIP_DIRECTION_DEFAULT, APPROXIMATE_POSITIONS_DEFAULT, VALUE_AXIS_BASELINE_DEFAULT, SEASONAL_MARKERS_DEFAULT, MAX_MAP_POINTS_DEFAULT, type GeoPointPrecision, type GeoMapKind, type TimelineStyle, type FlipMode, type FlipDirection, type ApproximatePositions, type ValueAxisBaseline, type SeasonalMarkers, type ColorScaleScope, type RenderOptions, type ViewStateProvider, type ChartControlChange, type XfilterRefreshDetail, } from "./contract";
|
|
1
|
+
export { HOST_CONTRACT_VERSION, GEO_POINT_PRECISIONS, MARK_CLASS, LEGEND_MARK_CLASS, AXIS_FILTER_CLASS, ROW_IDX_ATTR, LIFT_SELECTED_CLASS, CONTROL_CLASS, NO_ROW_MARKS_ATTR, NOTE_STYLE_ATTR, SELECTION_RULE_ATTR, SELECTION_RULE_CLICKED_MARKS, MARK_KEY_ATTR, CONTAINER_SLOT_CLICKED_MARKS, SNAPSHOT_SVG_ATTR, XFILTER_REFRESH_EVENT, CONTAINER_SLOT_ANIM_STOP, CONTAINER_SLOT_XF_CLEAR, CONTAINER_SLOT_INITIAL_XF_MARK, CONTAINER_SLOT_UI_STATE, CONTAINER_SLOT_SCROLL, VIEW_ONLY_UI_STATE_KEYS, withoutViewOnlyKeys, HOST_CONTAINER_CLASS, SELECTION_ACTIVE_CLASS, MARK_SELECTED_CLASS, ACTIVE_TICK_CLASS, DIM_OPACITY_VAR, DIM_OPACITY_DEFAULT, DIM_OPACITY_MIN, chartOwnsTimeline, periodTickSuppressesFeedback, ANIM_PLAY_SPEED_DEFAULT, ANIM_PLAY_SPEED_MIN, ANIM_PLAY_SPEED_MAX, ANIM_LOOP_DELAY_DEFAULT, ANIM_LOOP_DELAY_MIN, ANIM_MAX_IDEAL_FRAMES_DEFAULT, ANIM_MAX_IDEAL_FRAMES_MIN, ANIM_MAX_IDEAL_FRAMES_MAX, ANIMATION_OPTION_KEYS, COLOR_SCALE_SELF_CLAMP_PCT_DEFAULT, COLOR_SCALE_SELF_CLAMP_PCT_MIN, COLOR_SCALE_SELF_CLAMP_PCT_MAX, FLIP_MODE_DEFAULT, FLIP_INTERVAL_MIN_MS, FLIP_INTERVAL_MAX_MS, FLIP_DIRECTION_DEFAULT, APPROXIMATE_POSITIONS_DEFAULT, VALUE_AXIS_BASELINE_DEFAULT, SEASONAL_MARKERS_DEFAULT, MAX_MAP_POINTS_DEFAULT, type GeoPointPrecision, type GeoMapKind, type TimelineStyle, type FlipMode, type FlipDirection, type ApproximatePositions, type ValueAxisBaseline, type SeasonalMarkers, type ColorScaleScope, type RenderOptions, type ViewStateProvider, type ChartControlChange, type XfilterRefreshDetail, } from "./contract";
|
|
2
2
|
export { resolveOptions, type ResolveOptionsInput } from "./defaults";
|
|
3
|
+
export { hostLinkServices, type HostLinkServices, type ClipboardLike } from "./hostLinks";
|
|
4
|
+
export { tableToCsv, tableToXlsx, buildExportFile, exportFileName, sheetName as exportSheetName, excelNumberFormat, excelSerial, bytesToBase64, exportFormatsFor, exportTableService, browserSaveFile, EXPORT_FORMATS, XLSX_MIME, CSV_MIME, type ExportTable, type ExportColumn, type ExportColumnType, type ExportCell, type ExportFormat, type ExportFile, type SaveFileService, type ExportTableService, } from "./exportTable";
|
|
3
5
|
export { OPTIONS_VOCABULARY, LIVE_OPTION_KEYS, MAX_MAP_POINTS_MIN, MAX_MAP_POINTS_MAX, LIMIT_COUNT_MAX, wireLimitCount, codeReadsOption, type OptionVocabularyEntry, type OptionTiming, type OptionWire, type OptionKey, } from "./optionsVocabulary";
|
|
4
6
|
export { loadGeo, geoFromCache, registerGeo, registerGeoAsset, geoAssetFor, clearGeoCache, type GeoAssetName, } from "./geoLazy";
|
|
5
7
|
/** REPLACE the bundled city gazetteer with another packed table. Rarely needed — see the
|
|
@@ -21,6 +23,7 @@ export { captureSvgSnapshot, svgToDataUrl, svgNaturalSize, rasterizeSvgToPngData
|
|
|
21
23
|
export { shouldReview, buildReviewWire, bareBase64, actionFor, type ReviewGate, type ReviewWire, type ReviewVerdict, type ReviewAction } from "./review";
|
|
22
24
|
export { askApplyImprovements, type ReviewDialogOptions, type ReviewDialogText } from "./reviewDialog";
|
|
23
25
|
export { mountProductFeedbackBox, normaliseProductFeedbackText, productFeedbackSendable, buildProductFeedbackPayload, PRODUCT_FEEDBACK_MAX_CHARS, PRODUCT_FEEDBACK_MIN_CHARS, type ProductFeedbackBox, type ProductFeedbackBoxOptions, type ProductFeedbackText, type ProductFeedbackSendResult, type ProductFeedbackPayload, type ProductFeedbackIdentity, type ProductFeedbackHost, } from "./productFeedback";
|
|
26
|
+
export { mountShareRateLine, shareRateLineModel, type ShareRateLine, type ShareRateLineOptions, type ShareRateText, type ShareRateModel, type ShareLink, type ShareAskWire, type ShareTargetWire, } from "./shareRate";
|
|
24
27
|
export { qualifyGroupHeadingFor, newQualifyGroupState, type QualifyGroupRow, type QualifyGroupState, type QualifyGroupHeading, orderRefusalsForDisplay, refusalIsSelectable, hasRefusalsToShow, qualifyRefusalHeadingFor, newQualifyRefusalGroupState, qualifyRefusalReason, QUALIFY_REFUSAL_UNSPECIFIED, refusalIsTileBound, QUALIFY_TILE_REFUSAL_CODES, QUALIFY_TOO_SMALL_HEADING, type QualifyRefusalRow, type QualifyRefusalGroupState, type QualifyRefusalHeading, } from "./qualifyGroups";
|
|
25
28
|
export { qualifyPick, qualifyAuto, qualifyCancel, launchGenerates, launchFavorStyle, chooserFitsViewport, shouldOpenChooserOnGenerate, shouldOpenInlineChooserOnGenerate, canConfirmLaunch, confirmLaunch, qualifyFailureFallsOpen, CHOOSER_MIN_WIDTH_PX, CHOOSER_MIN_HEIGHT_PX, type QualifyLaunchOutcome, type ChooserGateInput, } from "./qualifyLaunch";
|
|
26
29
|
export { normalizeFilterTerm, filterQualifyRows, readQualifyChartRow, readQualifyRefusalRow, DEFAULT_FILTER_MATCH_STYLE, filterMatchStyleOf, type FilterMatchStyle, filterFitsChooser, listNeedsFilter, qualifyFilterGate, inlineFilterGate, FILTER_MIN_TERM_CHARS, FILTER_ROW_PX, FILTER_MIN_WIDTH_PX, FILTER_MIN_HEIGHT_PX, INLINE_FILTER_MIN_ROWS, computeQualifyFilterView, qualifyFilterCountText, type QualifyFilterTier, type QualifyFilterResult, type QualifyFilterRead, type QualifyFilterGateReason, type QualifyFilterGateInput, type QualifyFilterRow, type QualifyFilterGroup, type QualifyFilterView, type QualifyFilterNoteKind, } from "./qualifyFilter";
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** The block as the service sends it. Either casing is accepted, because the hosts' status calls serialise differently.
|
|
2
|
+
* shape-core types the same block on the status answer (GetLicenseStatusResult.shareAsk); it is restated here because
|
|
3
|
+
* this package's published declarations import nothing they do not ship, and a typecheck test holds the two equal. */
|
|
4
|
+
export interface ShareAskWire {
|
|
5
|
+
productUrl?: string;
|
|
6
|
+
ProductUrl?: string;
|
|
7
|
+
rateUrl?: string;
|
|
8
|
+
RateUrl?: string;
|
|
9
|
+
targets?: ShareTargetWire[];
|
|
10
|
+
Targets?: ShareTargetWire[];
|
|
11
|
+
}
|
|
12
|
+
export interface ShareTargetWire {
|
|
13
|
+
id?: string;
|
|
14
|
+
Id?: string;
|
|
15
|
+
label?: string;
|
|
16
|
+
Label?: string;
|
|
17
|
+
url?: string;
|
|
18
|
+
Url?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ShareLink {
|
|
21
|
+
/** Short network id ("li", "fb", "x"); a host's click counter names it. */
|
|
22
|
+
id: string;
|
|
23
|
+
label: string;
|
|
24
|
+
url: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ShareRateModel {
|
|
27
|
+
share: ShareLink[];
|
|
28
|
+
/** The listing to rate; null when the block had none worth drawing. */
|
|
29
|
+
rateUrl: string | null;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The links to draw for a service block, or null to draw nothing. Absent block, nothing https, or nothing usable: null.
|
|
33
|
+
* A target whose URL is not https, whose id is malformed or repeated, or which has no label is dropped; the order the
|
|
34
|
+
* service sent is kept.
|
|
35
|
+
*/
|
|
36
|
+
export declare function shareRateLineModel(ask: ShareAskWire | null | undefined): ShareRateModel | null;
|
|
37
|
+
/** The words a reader sees. Hosts localize; every field has an English default. Network names come from the service. */
|
|
38
|
+
export interface ShareRateText {
|
|
39
|
+
/** Before the network links: "Like it? Share it on". */
|
|
40
|
+
lead?: string;
|
|
41
|
+
/** Between the network links. */
|
|
42
|
+
separator?: string;
|
|
43
|
+
/** Between the share links and the rate link: ", or". */
|
|
44
|
+
or?: string;
|
|
45
|
+
/** The rate link after share links: "rate it on AppSource". */
|
|
46
|
+
rate?: string;
|
|
47
|
+
/** The rate link when there is nothing to share: "Like it? Rate it on AppSource". */
|
|
48
|
+
rateAlone?: string;
|
|
49
|
+
/** After the links: "Your ratings and feedback encourage us to do more." */
|
|
50
|
+
note?: string;
|
|
51
|
+
/** Menu layout, first: "Thanks for rating it." */
|
|
52
|
+
thanks?: string;
|
|
53
|
+
/** Menu layout, the rate link: "Rate it on AppSource too". */
|
|
54
|
+
rateToo?: string;
|
|
55
|
+
/** Menu layout, the toggle that reveals the networks: "Share it". */
|
|
56
|
+
shareMenu?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ShareRateLineOptions {
|
|
59
|
+
/** The service's block, as it arrived. Nothing is drawn when it yields no links. */
|
|
60
|
+
ask: ShareAskWire | null | undefined;
|
|
61
|
+
/** Opens a URL through the host's own door. The line never navigates by itself. */
|
|
62
|
+
open: (url: string) => void;
|
|
63
|
+
text?: ShareRateText;
|
|
64
|
+
/** Added to the wrapper so the host can skin it. */
|
|
65
|
+
className?: string;
|
|
66
|
+
/** "inline" (the landing line: the networks named in the sentence) or "menu" (after a vote: a short thank-you, the
|
|
67
|
+
* rate link, and a "Share it" toggle that reveals the networks). The links, their order and the click contract are
|
|
68
|
+
* the same either way. */
|
|
69
|
+
layout?: "inline" | "menu";
|
|
70
|
+
/** Menu layout: the "Share it" toggle opened the networks. */
|
|
71
|
+
onMenu?: () => void;
|
|
72
|
+
/** Called once, when the line is mounted - the host's "shown" counter. A host that folds the line away counts it
|
|
73
|
+
* itself instead and passes nothing here. */
|
|
74
|
+
onShown?: () => void;
|
|
75
|
+
/** A network link was clicked. */
|
|
76
|
+
onShare?: (id: string) => void;
|
|
77
|
+
/** The rate link was clicked. */
|
|
78
|
+
onRate?: () => void;
|
|
79
|
+
}
|
|
80
|
+
export interface ShareRateLine {
|
|
81
|
+
element: HTMLElement;
|
|
82
|
+
destroy(): void;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Draw the line inside `container`, or return null (and draw nothing) when the block yields no links. The wrapper carries
|
|
86
|
+
* `bic-share-rate`; network links `bic-share-rate-share` with `data-target`; the rate link `bic-share-rate-rate`; the
|
|
87
|
+
* note `bic-share-rate-note`. Every link carries its real href (so it reads as a link, and a reader can copy it), but a
|
|
88
|
+
* click is cancelled and handed to `open`.
|
|
89
|
+
*/
|
|
90
|
+
export declare function mountShareRateLine(container: HTMLElement, opts: ShareRateLineOptions): ShareRateLine | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.103",
|
|
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",
|