Skip to content

Commit 5154496

Browse files
authored
Fix labels (#316)
* Fixes dev mode asset path. * Fixes chart labels.
1 parent 213d788 commit 5154496

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

src/UIComponents/ColumnDetailsCategorical.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const ColumnDetailsCategorical = ({
3737
getLocalizedValue(option, datasetId),
3838
);
3939
const barData = {
40-
localizedLabels,
40+
labels: localizedLabels,
4141
datasets: [
4242
{
4343
label: id,

src/indexDev.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import './assetPath';
1+
import './setAssetPathDev';
22
import './setPublicPath';
33
import {initAll, instructionsDismissed} from './index';
44
import queryString from 'query-string';

src/setAssetPathDev.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Dev-only: seed the asset-path global for the standalone dev host page.
2+
//
3+
// Production consumers (e.g. dashboard) call setAssetPath(...) themselves
4+
// before loading the bundle, pointing it at wherever they serve the
5+
// images + datasets. In dev the standalone index.html IS the consumer,
6+
// so we inline the assignment here.
7+
//
8+
// Import this FIRST in indexDev.tsx so the global is set before either
9+
// `setPublicPath` reads it for webpack's `__webpack_public_path__` OR
10+
// the direct readers in `index.tsx` / `SelectDataset.tsx` build URLs
11+
// from it. ESM guarantees depth-first evaluation in import order, so
12+
// this module's body runs before any later import is evaluated.
13+
//
14+
// Value: './' — webpack emits images to `images/` (in-memory, served by
15+
// webpack-dev-middleware) and `webpack-dev-server --static public`
16+
// serves `public/datasets/*` at `/datasets/*` on disk. Both sit at the
17+
// root, so the single-prefix model works.
18+
import {setAssetPath} from './assetPath';
19+
20+
setAssetPath('./');

0 commit comments

Comments
 (0)