← back to Dw Discovery

README.md

35 lines

# dw-discovery

DW-owned faceted search, merchandising & display layer — replicates Boost AI Search
& Discovery as features we control. Zero dependencies, drop into any DW grid:

```html
<script src="dw-discovery.js"></script>
<script>new DWDiscovery({ mount:'#grid', products });</script>
```

Features: filter trees · merchandising (pin/boost/bury) · filter layout (sidebar↔top)
· display settings (density + card fields) · analytics insights · merge-values
canonicalization · custom dual-handle range sliders · color swatches.

State persists to localStorage. `data/products.json` is DW-shaped sample data.

## Real-catalog reference (`index.real.html`)

`build-data.py` is a READ-ONLY adapter over the local `dw_unified` mirror. It maps
one real DW collection — **Thibaut · "TEXTURE RESOURCE 9"** (149 ACTIVE SKUs,
100% color+hex+width+image+price coverage in `thibaut_catalog`) — into the module's
product shape and writes `data/products.real.json` + a derived `data/config.real.json`
(57 raw color names → 6 buckets; vendor spelling aliases). It NEVER writes to
dw_unified (`set_session(readonly=True)`).

```bash
python3 build-data.py          # regenerate the real data from dw_unified ($0, local read)
python3 -m http.server 8849    # then open index.real.html
```

`index.real.html` is a standalone internal reference page (clone of `index.html`)
pointing at the real data + derived config. Verified render: 149 cards, 149 real
Shopify-CDN images, Blue facet narrows 149→42 (see `preview.real.png`).
Live customer-facing wiring is gated — see the pending-approval memo.