@bicharts/chart-host 0.5.81 → 0.5.82

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
@@ -611,14 +611,15 @@ function askApplyImprovements(container, reason, opts = {}) {
611
611
 
612
612
  // src/qualifyGroups.ts
613
613
  function newQualifyGroupState() {
614
- return { preview: false, previewClosed: false, projected: false, notRecommended: false };
614
+ return { preview: false, previewClosed: false, projected: false, notRecommended: false, rankedSeen: false };
615
615
  }
616
616
  function qualifyGroupHeadingFor(row, state) {
617
617
  const preview = row.isPreview === true;
618
- if (preview && !state.preview && !state.notRecommended) {
618
+ if (preview && !state.preview && !state.notRecommended && !state.rankedSeen) {
619
619
  state.preview = true;
620
620
  return "preview";
621
621
  }
622
+ if (!preview) state.rankedSeen = true;
622
623
  if (state.preview && !state.previewClosed && !preview) {
623
624
  state.previewClosed = true;
624
625
  return "main";
@@ -15,6 +15,8 @@ export interface QualifyGroupState {
15
15
  previewClosed: boolean;
16
16
  projected: boolean;
17
17
  notRecommended: boolean;
18
+ /** A ranked (non-preview) row has been seen: from here on a badge is a badge, not a block. */
19
+ rankedSeen: boolean;
18
20
  }
19
21
  export declare function newQualifyGroupState(): QualifyGroupState;
20
22
  /**
@@ -24,7 +26,13 @@ export declare function newQualifyGroupState(): QualifyGroupState;
24
26
  *
25
27
  * ORDER OF THE CHECKS IS THE CONTRACT:
26
28
  * 1. "preview" opens the block - but never once the not-recommended block has opened, because a
27
- * preview type the ontology ruled out is NOT floated and belongs where it landed.
29
+ * preview type the ontology ruled out is NOT floated and belongs where it landed. AND NEVER
30
+ * ONCE A RANKED ROW HAS BEEN SEEN. The preview BLOCK is the set of rows the server floated
31
+ * to the top (preview TYPES, which cannot be scored); a preview LANE sits on a scorable type
32
+ * that ranks on its own merits and is deliberately left where it ranks, carrying only its
33
+ * badge. Before this clause, one badged lane mid-list opened "New - in preview" above row 13
34
+ * and closed it with "Best fit for your data" above row 14 - two headings claiming a
35
+ * grouping the list did not have.
28
36
  * 2. "main" closes it, at the first row that is not preview. Emitted only if a block opened.
29
37
  * 3. "projected" and 4. "notRecommended" are unchanged from the single-host original.
30
38
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bicharts/chart-host",
3
- "version": "0.5.81",
3
+ "version": "0.5.82",
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",