diff --git a/src/UIComponents/ColumnDetailsCategorical.tsx b/src/UIComponents/ColumnDetailsCategorical.tsx index 706869b4..da8938e3 100644 --- a/src/UIComponents/ColumnDetailsCategorical.tsx +++ b/src/UIComponents/ColumnDetailsCategorical.tsx @@ -37,7 +37,7 @@ const ColumnDetailsCategorical = ({ getLocalizedValue(option, datasetId), ); const barData = { - localizedLabels, + labels: localizedLabels, datasets: [ { label: id, diff --git a/src/indexDev.tsx b/src/indexDev.tsx index 2aa07138..d569cea5 100644 --- a/src/indexDev.tsx +++ b/src/indexDev.tsx @@ -1,4 +1,4 @@ -import './assetPath'; +import './setAssetPathDev'; import './setPublicPath'; import {initAll, instructionsDismissed} from './index'; import queryString from 'query-string'; diff --git a/src/setAssetPathDev.ts b/src/setAssetPathDev.ts new file mode 100644 index 00000000..eaa3f7dc --- /dev/null +++ b/src/setAssetPathDev.ts @@ -0,0 +1,20 @@ +// Dev-only: seed the asset-path global for the standalone dev host page. +// +// Production consumers (e.g. dashboard) call setAssetPath(...) themselves +// before loading the bundle, pointing it at wherever they serve the +// images + datasets. In dev the standalone index.html IS the consumer, +// so we inline the assignment here. +// +// Import this FIRST in indexDev.tsx so the global is set before either +// `setPublicPath` reads it for webpack's `__webpack_public_path__` OR +// the direct readers in `index.tsx` / `SelectDataset.tsx` build URLs +// from it. ESM guarantees depth-first evaluation in import order, so +// this module's body runs before any later import is evaluated. +// +// Value: './' — webpack emits images to `images/` (in-memory, served by +// webpack-dev-middleware) and `webpack-dev-server --static public` +// serves `public/datasets/*` at `/datasets/*` on disk. Both sit at the +// root, so the single-prefix model works. +import {setAssetPath} from './assetPath'; + +setAssetPath('./');