@bicharts/chart-host 0.6.95 → 0.6.97
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/README.md +9 -1
- package/dist/adapters.mjs +3 -3
- package/dist/card.mjs +2 -2
- package/dist/{chunk-NNLBFIWU.mjs → chunk-3JBJ2SIF.mjs} +1 -1
- package/dist/{chunk-VEVBXK44.mjs → chunk-5OCL4EFM.mjs} +1 -1
- package/dist/{chunk-PDVEIW42.mjs → chunk-ASLRGGLV.mjs} +1 -1
- package/dist/{chunk-QHMLMF4L.mjs → chunk-B6BLSIID.mjs} +34 -2
- package/dist/{chunk-NQFJHNMC.mjs → chunk-KFU44UEN.mjs} +346 -316
- package/dist/{chunk-45VILLJT.mjs → chunk-M7MBTLDP.mjs} +1 -1
- package/dist/{chunk-CJ4IG6G5.mjs → chunk-P6VCB6SF.mjs} +19 -19
- package/dist/{chunk-VC3Z5CH7.mjs → chunk-PMA56BKD.mjs} +1 -1
- package/dist/{chunk-4ICQEVZX.mjs → chunk-SFDKACWG.mjs} +86 -30
- package/dist/{chunk-CR7DSJVG.mjs → chunk-WSNDXS3Z.mjs} +1 -1
- package/dist/index.mjs +13 -9
- package/dist/legend-fit.mjs +3 -3
- package/dist/page.mjs +4 -4
- package/dist/react.mjs +25 -14
- package/dist/testing.mjs +1 -1
- package/dist/types/contract.d.ts +6 -1
- package/dist/types/host.d.ts +9 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/lasso.d.ts +18 -1
- package/dist/types/payload.d.ts +5 -0
- package/dist/zoom-memory.mjs +3 -3
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type { Controls, ControlInfo, ControlsAttachment } from "./controls";
|
|
|
14
14
|
export { createChartGroup, toSourceRows, syncMemberSelection, type ChartGroup, type ChartGroupMember, type ChartGroupSelection, type ChartGroupChange, type ChartGroupMemberOptions, type ChartGroupSourceOptions, type ChartGroupPayload } from "./group";
|
|
15
15
|
export type { Filter, FilterScope, FilterOptions, FilterKey, FilterChangeReason, FilterBinding, BindFilterOptions, VegaInteractionEvent, PageView } from "./filterScope";
|
|
16
16
|
export { createMarkResolver, isInsideControl, rowIdxsFromMark, nextSelection, DRAG_NOT_CLICK_PX, gestureWasDrag, trackPress, pressOf, clearPress, clickWasDrag, CONTAINER_SLOT_PRESS_AT, type PressPoint, dispatchRowSet, validRowSet, ROW_SET_MAX, selectionRuleOf, markKeyOf, planSelectionPaint, nextClickedMarks, sameRowSet, type SelectionRule, type ClickedMarks, type SelectionPaintMark, type SelectionPaintMode, type SelectionPaintPlan, collectD3GlyphCenters, clearSelectionGlyphs, paintSelectionGlyphs, SELECTION_GLYPH_CLASS, type MarkResolver, type MarkResolverEnv, type GlyphCenter, type SelectionGlyphStyle, type SelectionModifiers, } from "./selection";
|
|
17
|
-
export { installLasso, clearLasso, lassoVerdict, lassoRowCap, lassoActions, registerLassoAction, pointInShape, LASSO_ROW_CAP, LASSO_DRAG_PX, LASSO_SAMPLE_PX, LASSO_MAX_VERTICES, LASSO_RESTORE_MAX_VERTICES, LASSO_RESTORE_MAX_SHAPES, LASSO_EVENT, LASSO_SURFACE_CLASS, LASSO_OUTLINE_CLASS, LASSO_COUNT_CLASS, LASSO_NOTE_CLASS, LASSO_PLOT_CLASS, LASSO_MODE_ATTR, LASSO_KNOB_KEY, LASSO_AXES_SLOT, LASSO_DEFAULT_ACTIONS, type LassoSetting, type LassoVerdict, type LassoMode, type LassoSpace, type LassoShape, type LassoStored, type LassoEventDetail, type LassoAxes, type LassoAction, type LassoActionContext, type LassoEnv, type LassoHandle, } from "./lasso";
|
|
17
|
+
export { installLasso, clearLasso, lassoVerdict, lassoRowCap, lassoActions, lassoEffect, registerLassoAction, pointInShape, LASSO_ROW_CAP, LASSO_DRAG_PX, LASSO_SAMPLE_PX, LASSO_MAX_VERTICES, LASSO_RESTORE_MAX_VERTICES, LASSO_RESTORE_MAX_SHAPES, LASSO_EVENT, LASSO_SURFACE_CLASS, LASSO_OUTLINE_CLASS, LASSO_COUNT_CLASS, LASSO_NOTE_CLASS, LASSO_PLOT_CLASS, LASSO_MODE_ATTR, LASSO_KNOB_KEY, LASSO_AXES_SLOT, LASSO_DEFAULT_ACTIONS, LASSO_DEFAULT_EFFECT, type LassoSetting, type LassoVerdict, type LassoEffect, type LassoMode, type LassoSpace, type LassoShape, type LassoStored, type LassoEventDetail, type LassoAxes, type LassoAction, type LassoActionContext, type LassoEnv, type LassoHandle, } from "./lasso";
|
|
18
18
|
export type { AdapterEvent, AdapterHit, AdapterId, AdapterScene, MarkHandle, MarkInfo, MarkRole, PaintRequest, RendererAdapter, RowTable, } from "./adapters/types";
|
|
19
19
|
export { planTrivialChart, compileTrivialSource, type TrivialPlan, type TrivialShapeKind } from "./trivial";
|
|
20
20
|
export { captureSvgSnapshot, svgToDataUrl, svgNaturalSize, rasterizeSvgToPngDataUrl, tableHostOf, chartSvgOf, htmlToSvgDataUrl, htmlNaturalSize, type SnapshotOptions } from "./snapshot";
|
package/dist/types/lasso.d.ts
CHANGED
|
@@ -49,6 +49,12 @@ export type LassoVerdict = "on" | "not-capable" | "disabled" | "over-cap";
|
|
|
49
49
|
export declare function lassoRowCap(setting: LassoSetting | null | undefined): number;
|
|
50
50
|
/** The action names to run on release, in order. Anything that is not a list of names is the default. */
|
|
51
51
|
export declare function lassoActions(setting: LassoSetting | null | undefined): string[];
|
|
52
|
+
/** What circling a group does to the page: "filter" publishes it as the selection, "highlight" only lights it. */
|
|
53
|
+
export type LassoEffect = "filter" | "highlight";
|
|
54
|
+
/** The effect when the setting names none. */
|
|
55
|
+
export declare const LASSO_DEFAULT_EFFECT: LassoEffect;
|
|
56
|
+
/** The effect in force: "highlight" only when the setting says exactly that, else LASSO_DEFAULT_EFFECT. */
|
|
57
|
+
export declare function lassoEffect(setting: LassoSetting | null | undefined): LassoEffect;
|
|
52
58
|
/** Whether a chart with `rows` rows in view gets a lasso under `setting`. */
|
|
53
59
|
export declare function lassoVerdict(setting: LassoSetting | null | undefined, rows: number): LassoVerdict;
|
|
54
60
|
type Pt = [number, number];
|
|
@@ -104,6 +110,16 @@ export type LassoAction = (ctx: LassoActionContext) => void;
|
|
|
104
110
|
* registered is skipped, so a host can carry a list ahead of the build that understands it.
|
|
105
111
|
*/
|
|
106
112
|
export declare function registerLassoAction(name: string, action: LassoAction): void;
|
|
113
|
+
/**
|
|
114
|
+
* A NEW HOST ON A CONTAINER claims the bag's lasso for its chart. The bag outlives every host on the element, so a lasso
|
|
115
|
+
* parked by another chart (a new `code` on the same element, a destroy and create) would be re-drawn on this one and then
|
|
116
|
+
* persisted with the next slider's write under this chart's state. A different chart, or a parked lasso with no record of
|
|
117
|
+
* whose it is, starts without it; the same chart built again (a host rebuilt for its config) keeps it. Only the lasso
|
|
118
|
+
* goes: a slider's value in the bag is meant to outlive a new chart. `sessionState` is the host's own session view-state
|
|
119
|
+
* on the same element (never a caller's provider, which keys its own state): its `knobs.lasso` is the same parked copy.
|
|
120
|
+
* Returns whether a parked lasso was dropped.
|
|
121
|
+
*/
|
|
122
|
+
export declare function claimParkedLasso(container: Element | null | undefined, chartKey: unknown, sessionState?: Record<string, unknown> | null): boolean;
|
|
107
123
|
/** What the host gives the lasso. The lasso never reaches into the host's selection itself. */
|
|
108
124
|
export interface LassoEnv {
|
|
109
125
|
container: HTMLElement;
|
|
@@ -111,7 +127,8 @@ export interface LassoEnv {
|
|
|
111
127
|
options: () => RenderOptions;
|
|
112
128
|
/** How many rows the chart was handed: the number the cap is measured against. */
|
|
113
129
|
rows: number;
|
|
114
|
-
/**
|
|
130
|
+
/** Make this row set the selection (what the "select" action does). The host decides, from the setting's
|
|
131
|
+
* effect, whether it is published to the page or only lit inside the chart. */
|
|
115
132
|
select(rows: number[]): void;
|
|
116
133
|
/** Clear the host's selection the way an empty click does: the chart's own clear slot first when the
|
|
117
134
|
* chart owns the selection, then a published clear. A no-op when nothing is selected. */
|
package/dist/types/payload.d.ts
CHANGED
|
@@ -70,6 +70,10 @@ export interface RenderPayload {
|
|
|
70
70
|
/** Which columns the re-anchoring actually moved (diagnostics; empty when every date was already
|
|
71
71
|
* UTC midnight). Present only alongside dateCellsAreUtcDays. */
|
|
72
72
|
utcDayColumns?: string[];
|
|
73
|
+
/** The host re-anchored timed date cells to the UTC wall clock (opts.localWallClock). Present only when it was requested. */
|
|
74
|
+
dateCellsAreUtcWallClock?: boolean;
|
|
75
|
+
/** Which columns that moved (diagnostics). Present only alongside dateCellsAreUtcWallClock. */
|
|
76
|
+
utcWallClockColumns?: string[];
|
|
73
77
|
}
|
|
74
78
|
export declare function buildRenderPayload(cols: Array<{
|
|
75
79
|
name: string;
|
|
@@ -78,6 +82,7 @@ export declare function buildRenderPayload(cols: Array<{
|
|
|
78
82
|
kind: string;
|
|
79
83
|
} | null, point?: GeoPointBinding | null, destination?: GeoPointBinding | null, opts?: {
|
|
80
84
|
utcDays?: boolean;
|
|
85
|
+
localWallClock?: boolean;
|
|
81
86
|
aliases?: ReadonlyArray<{
|
|
82
87
|
name: string;
|
|
83
88
|
alias: string;
|
package/dist/zoom-memory.mjs
CHANGED
|
@@ -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
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
K
|
|
4
|
+
} from "./chunk-KFU44UEN.mjs";
|
|
5
5
|
import "./chunk-GHODWOAL.mjs";
|
|
6
6
|
|
|
7
7
|
// src/zoomMemory/zoomMemory.ts
|
|
@@ -262,7 +262,7 @@ function forgetZoom(host) {
|
|
|
262
262
|
}
|
|
263
263
|
function createZoomMemoryHook(host) {
|
|
264
264
|
const hook = {
|
|
265
|
-
keyFor: (code, width, height) => zoomStateKey(
|
|
265
|
+
keyFor: (code, width, height) => zoomStateKey(K(String(code ?? "")), width, height),
|
|
266
266
|
capture: (d3) => captureZoomBehaviors(d3, host),
|
|
267
267
|
restore: (container, capture, key, d3) => {
|
|
268
268
|
const mine = adoptedContainers.get(host);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.97",
|
|
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",
|