ramp4-pcar4 / story-ramp

Storytelling with interactive maps using RAMP
MIT License
3 stars 12 forks source link

add support for dynamic slideshow #411

Closed RyanCoulsonCA closed 3 months ago

RyanCoulsonCA commented 4 months ago

Related Item(s)

410 and #353

Changes

Breaking Changes

For example, if this is what your current chart panel config looks like:

{
  "type": "chart",
  "charts": [
    {
      "src": "00000000-0000-0000-0000-000000000000/charts/en/chartConfig.json"
    },
    {
      "src": "00000000-0000-0000-0000-000000000000/charts/en/Total releases of ethylene glycol for 2019, by province_en.csv",
      "options": {
        "title": "Figure 2: Total releases of ethylene glycol for 2019, by province",
        "xAxisLabel": "Quantity (tonnes)",
        "subtitle": "",
        "type": "bar"
      }
    },
    {
      "src": "00000000-0000-0000-0000-000000000000/charts/en/EG_releases_2019_en.csv",
      "options": {
        "title": "Figure 1: Percentage of total ethylene glycol releases for 2019, by sector",
        "subtitle": "",
        "type": "pie"
      }
    }
  ]
}

Replace it with the following:

{
  "type": "slideshow",
  "items": [
    {
      "type": "chart",
      "src": "00000000-0000-0000-0000-000000000000/charts/en/chartConfig.json"
    },
    {
      "type": "chart",
      "src": "00000000-0000-0000-0000-000000000000/charts/en/Total releases of ethylene glycol for 2019, by province_en.csv",
      "options": {
        "title": "Figure 2: Total releases of ethylene glycol for 2019, by province",
        "xAxisLabel": "Quantity (tonnes)",
        "subtitle": "",
        "type": "bar"
      }
    },
    {
      "type": "chart",
      "src": "00000000-0000-0000-0000-000000000000/charts/en/EG_releases_2019_en.csv",
      "options": {
        "title": "Figure 1: Percentage of total ethylene glycol releases for 2019, by sector",
        "subtitle": "",
        "type": "pie"
      }
    }
  ]
}

Testing

Play around with the following and ensure everything works as expected (will add links once the demo is up):

  1. Click on the Charts Panel link in the Dynamic Panel Test slide. Ensure these charts load and can be switched.
  2. Text, map, and chart panels have been added to the slideshow in the NPRI substances reported for oil sands mining facilities slide.
  3. The image slideshow in the Reported mine tailings from oil sands surface mining facilities slide hasn't been touched. Ensure it still works as normal.
  4. There is a chart slideshow on the Chart Gallery slide that you can play around with as well.

This change is Reviewable

github-actions[bot] commented 4 months ago

Your demo site is ready! 🚀 Visit it here: https://ramp4-pcar4.github.io/story-ramp/fix-410/#/en/00000000-0000-0000-0000-000000000000