@bicharts/chart-host 0.6.78 → 0.6.79

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 CHANGED
@@ -261,6 +261,10 @@ var OPTIONS_VOCABULARY = Object.freeze({
261
261
  var LIVE_OPTION_KEYS = Object.freeze(
262
262
  Object.keys(OPTIONS_VOCABULARY).filter((k2) => OPTIONS_VOCABULARY[k2].timing === "live" || OPTIONS_VOCABULARY[k2].timing === "live-and-next-generate")
263
263
  );
264
+ function codeReadsOption(code, key) {
265
+ if (!code || !Object.prototype.hasOwnProperty.call(OPTIONS_VOCABULARY, key)) return false;
266
+ return new RegExp(`\\boptions\\.${key}\\b`).test(code);
267
+ }
264
268
  function wireLimitCount(count) {
265
269
  const n2 = typeof count === "number" ? count : count == null || count === "" ? NaN : Number(count);
266
270
  return Number.isFinite(n2) && n2 > 0 ? n2 : null;
@@ -2432,6 +2436,7 @@ export {
2432
2436
  clearSelectionGlyphs,
2433
2437
  clippedTextFlag,
2434
2438
  codeReadsDatesInLocalTime,
2439
+ codeReadsOption,
2435
2440
  collectD3GlyphCenters,
2436
2441
  colourSpreadFlag,
2437
2442
  compileRenderFn,
@@ -1,6 +1,6 @@
1
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, VIEW_ONLY_UI_STATE_KEYS, withoutViewOnlyKeys, 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, 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, } from "./contract";
2
2
  export { resolveOptions, type ResolveOptionsInput } from "./defaults";
3
- export { OPTIONS_VOCABULARY, LIVE_OPTION_KEYS, MAX_MAP_POINTS_MIN, MAX_MAP_POINTS_MAX, LIMIT_COUNT_MAX, wireLimitCount, type OptionVocabularyEntry, type OptionTiming, type OptionWire, type OptionKey, } from "./optionsVocabulary";
3
+ 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
4
  export { loadGeo, geoFromCache, registerGeo, registerGeoAsset, geoAssetFor, clearGeoCache, type GeoAssetName, } from "./geoLazy";
5
5
  /** REPLACE the bundled city gazetteer with another packed table. Rarely needed — see the
6
6
  * note above registerCityTable in shape-core's geoPoint.ts before using it. */
@@ -91,6 +91,14 @@ export declare const OPTIONS_VOCABULARY: Readonly<{
91
91
  export type OptionKey = keyof typeof OPTIONS_VOCABULARY;
92
92
  /** The keys whose change repaints the chart on screen, in table order. */
93
93
  export declare const LIVE_OPTION_KEYS: readonly OptionKey[];
94
+ /**
95
+ * Does this chart's code read the shared option `key`?
96
+ * A host uses it to show a control only for a chart that
97
+ * will respond to it - a switch on a chart that ignores it
98
+ * does nothing. Generated code reads options as
99
+ * `options.<key>`, so the property access is the test.
100
+ */
101
+ export declare function codeReadsOption(code: string | null | undefined, key: OptionKey): boolean;
94
102
  /**
95
103
  * THE LIMIT COUNT A REQUEST CARRIES: a positive count, or null - never 0. The server reads any value it
96
104
  * receives as the reader's own limit (and 0 as a limit of zero), so "no limit" must arrive as no value.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bicharts/chart-host",
3
- "version": "0.6.78",
3
+ "version": "0.6.79",
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",