visualize-admin / visualization-tool

The tool for visualizing Swiss Open Government Data. Project ownership: Federal Office for the Environment FOEN
https://visualize.admin.ch
BSD 3-Clause "New" or "Revised" License
31 stars 3 forks source link

"Preview via API" examples from docs don't work #1523

Closed sam-e-ch closed 3 months ago

sam-e-ch commented 4 months ago

Describe the bug When looking at both examples linked on https://visualize.admin.ch/docs/charts/preview-via-api there is the same error:

Application error: a client-side exception has occurred (see the browser console for more information).

The browser console shows the following message:

Error: You need an <ConfiguratorStateProvider> to useConfiguratorState
    at ew (configurator-state.tsx:1856:11)
    at R (chart-published.tsx:62:19)
    at ak (react-dom.production.min.js:167:135)
    at i (react-dom.production.min.js:290:335)
    at oD (react-dom.production.min.js:280:383)
    at react-dom.production.min.js:280:319
    at oO (react-dom.production.min.js:280:319)
    at oE (react-dom.production.min.js:271:86)
    at ox (react-dom.production.min.js:268:399)
    at x (scheduler.production.min.js:13:197)
    at MessagePort.T (scheduler.production.min.js:14:126)

To Reproduce Steps to reproduce the behavior:

  1. Open https://visualize.admin.ch/_preview or https://visualize.admin.ch/_preview_post
  2. There is an error message but no chart

Expected behavior I expect the demos to show a working chart.

Environment (please complete the following information):

I tested it both on Pop!_OS 22.04 using Chromium Version 124 and Windows 11 using Edge 124.

ptbrowne commented 4 months ago

Thanks @sam-e-ch for the feedback, and sorry for the inconvenience. It has been solved via https://github.com/visualize-admin/visualization-tool/pull/1524.

For my curiosity, could you explain to me how do you use the preview and how it is useful to you ? It might be something we'd want to include in a future "usecases" section on the visualize documentation site.

ptbrowne commented 4 months ago

It should be deployed to test.visualize.admin.ch shortly.

Rdataflow commented 4 months ago

@ptbrowne The idea is to facilitate the navigation of NFI charts - to in the future better integrate with lfi.ch/resultate/ page without going through the whole chart selection and configuration but to provide a limited set of parameters to adapt ;-)