@bicharts/chart-host 0.5.113 → 0.5.115

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.
@@ -435,7 +435,7 @@ var require_papaparse_min = __commonJS({
435
435
  });
436
436
 
437
437
  // src/contract.ts
438
- var HOST_CONTRACT_VERSION = "1.9.0";
438
+ var HOST_CONTRACT_VERSION = "1.10.0";
439
439
  var GEO_POINT_PRECISIONS = ["latlon", "city", "zip3", "state", "country"];
440
440
  var MARK_CLASS = "d3-mark";
441
441
  var LEGEND_MARK_CLASS = "d3-legend-mark";
@@ -839,6 +839,9 @@ function resolveOptions(p2) {
839
839
  allowTooltips: p2.allowTooltips,
840
840
  noDataText: p2.noDataText,
841
841
  onSelect: p2.onSelect,
842
+ // Item 639. Passed straight through like onSelect: the host owns what a gesture MEANS,
843
+ // and a host that supplies nothing leaves every control behaving exactly as before.
844
+ onControlChange: p2.onControlChange,
842
845
  // ---- live-restyle knobs: `raw || undefined` / `.toString() || undefined` ----
843
846
  colorScaleLow: p2.colorScaleLow || void 0,
844
847
  colorScaleHigh: p2.colorScaleHigh || void 0,
package/dist/index.mjs CHANGED
@@ -130,7 +130,7 @@ import {
130
130
  toRGBA,
131
131
  unpinScrolledAxis,
132
132
  valuePlacementFlag
133
- } from "./chunk-IXJYGTAY.mjs";
133
+ } from "./chunk-W5XDW6OK.mjs";
134
134
  import "./chunk-A2GMXZP7.mjs";
135
135
  import "./chunk-GHODWOAL.mjs";
136
136
 
package/dist/react.mjs CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  createChartHost,
5
5
  geoFromCache,
6
6
  loadGeo
7
- } from "./chunk-IXJYGTAY.mjs";
7
+ } from "./chunk-W5XDW6OK.mjs";
8
8
  import "./chunk-A2GMXZP7.mjs";
9
9
  import "./chunk-GHODWOAL.mjs";
10
10
 
@@ -1,4 +1,4 @@
1
- export declare const HOST_CONTRACT_VERSION = "1.9.0";
1
+ export declare const HOST_CONTRACT_VERSION = "1.10.0";
2
2
  export type GeoPointPrecision = "latlon" | "city" | "zip3" | "state" | "country";
3
3
  /** Every valid tier, ordered most precise → coarsest. Runtime form of GeoPointPrecision. */
4
4
  export declare const GEO_POINT_PRECISIONS: readonly GeoPointPrecision[];
@@ -141,4 +141,34 @@ export interface RenderOptions {
141
141
  flipMode?: FlipMode;
142
142
  cardBackgroundColor?: string;
143
143
  onSelect?: (rowIdxs: number[]) => void;
144
+ /**
145
+ * A reader WORKED one of the chart's own controls — the segmented row today, the slider and
146
+ * the scrubber when they follow. ADVISORY TELEMETRY: the host logs it, and nothing about the
147
+ * chart depends on a host supplying it.
148
+ *
149
+ * ITEM 639. Until now no host could tell a control that fired from a control that does
150
+ * nothing. The Power BI visual left an INDIRECT trace, because working a control persists
151
+ * view-state and that write is logged; the Excel add-in's write is silent, so a reader
152
+ * reporting "the buttons do nothing" left no record anywhere. Establishing that a control had
153
+ * in fact fired meant pulling the generated source out of the database and reading it — which
154
+ * is exactly what item 638 had to do.
155
+ *
156
+ * CLICKS ONLY, and there is deliberately no `phase`. A control also settles on a value at
157
+ * first paint, on every resize and on every re-render; reporting those would bury the
158
+ * gestures under repaints, and the restored value is already in the persisted view-state, so
159
+ * nothing is lost by leaving it out. This field reports what a PERSON did.
160
+ *
161
+ * NEVER FATAL. It is called from inside a click handler, so a host that throws here must not
162
+ * take the reader's gesture with it: the helper swallows anything this raises.
163
+ */
164
+ onControlChange?: (e: ChartControlChange) => void;
165
+ }
166
+ /** One reader gesture on a chart's own control (item 639). */
167
+ export interface ChartControlChange {
168
+ /** The helper family that owns the control — "segmented" today. */
169
+ control: string;
170
+ /** The control's name inside the chart: "sort", "form", "measure". */
171
+ key: string;
172
+ /** The value the reader chose. */
173
+ value: string;
144
174
  }
@@ -1,4 +1,4 @@
1
- export { HOST_CONTRACT_VERSION, GEO_POINT_PRECISIONS, MARK_CLASS, LEGEND_MARK_CLASS, AXIS_FILTER_CLASS, ROW_IDX_ATTR, LIFT_SELECTED_CLASS, XFILTER_REFRESH_EVENT, CONTAINER_SLOT_ANIM_STOP, CONTAINER_SLOT_XF_CLEAR, CONTAINER_SLOT_INITIAL_XF_MARK, CONTAINER_SLOT_UI_STATE, HOST_CONTAINER_CLASS, SELECTION_ACTIVE_CLASS, MARK_SELECTED_CLASS, ACTIVE_TICK_CLASS, DIM_OPACITY_VAR, DIM_OPACITY_DEFAULT, 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, APPROXIMATE_POSITIONS_DEFAULT, VALUE_AXIS_BASELINE_DEFAULT, SEASONAL_MARKERS_DEFAULT, MAX_MAP_POINTS_DEFAULT, type GeoPointPrecision, type GeoMapKind, type TimelineStyle, type FlipMode, type ApproximatePositions, type ValueAxisBaseline, type SeasonalMarkers, type ColorScaleScope, type RenderOptions, type ViewStateProvider, } from "./contract";
1
+ export { HOST_CONTRACT_VERSION, GEO_POINT_PRECISIONS, MARK_CLASS, LEGEND_MARK_CLASS, AXIS_FILTER_CLASS, ROW_IDX_ATTR, LIFT_SELECTED_CLASS, XFILTER_REFRESH_EVENT, CONTAINER_SLOT_ANIM_STOP, CONTAINER_SLOT_XF_CLEAR, CONTAINER_SLOT_INITIAL_XF_MARK, CONTAINER_SLOT_UI_STATE, HOST_CONTAINER_CLASS, SELECTION_ACTIVE_CLASS, MARK_SELECTED_CLASS, ACTIVE_TICK_CLASS, DIM_OPACITY_VAR, DIM_OPACITY_DEFAULT, 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, APPROXIMATE_POSITIONS_DEFAULT, VALUE_AXIS_BASELINE_DEFAULT, SEASONAL_MARKERS_DEFAULT, MAX_MAP_POINTS_DEFAULT, type GeoPointPrecision, type GeoMapKind, type TimelineStyle, type FlipMode, type ApproximatePositions, type ValueAxisBaseline, type SeasonalMarkers, type ColorScaleScope, type RenderOptions, type ViewStateProvider, type ChartControlChange, } from "./contract";
2
2
  export { resolveOptions, type ResolveOptionsInput } from "./defaults";
3
3
  export { loadGeo, geoFromCache, registerGeo, registerGeoAsset, geoAssetFor, clearGeoCache, type GeoAssetName, } from "./geoLazy";
4
4
  /** REPLACE the bundled city gazetteer with another packed table. Rarely needed — see the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bicharts/chart-host",
3
- "version": "0.5.113",
3
+ "version": "0.5.115",
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",