Sorry, but I still don’t get what you’re after.
mapsArray is static:
// A static version of mapsArray
mapsArray = [
{
directory: "Atlas/Flux_Transcom/Inversions-GCP2019",
ressource:
"fco2_CAMS-V18-2-2019_June2018-ext3_1979-2018_yearlymean-anom_XYT.nc",
period: "yearlymean-anom",
variable: "Terrestrial_flux",
range: [-432, 291],
palette: "div-RdYlBu",
numcolorbands: 20,
opacity: 100
},
{
directory: "Atlas/Flux_Transcom/Inversions-GCP2019",
ressource:
"fco2_CAMS-V18-2-2019_June2018-ext3_1979-2018_yearlymean-anom_XYT.nc",
period: "yearlymean-anom",
variable: "Ocean_flux",
range: [-29.9, 39.2],
palette: "div-RdYlBu",
numcolorbands: 20,
opacity: 100
}
]
mapsArray1 is mutable:
mapsArray1 = {
var mapsArray = [];
for (let i = 0; i < mapsArrayMutable.length; i++) {
mapsArray.push(mapsArrayMutable[i]);
}
return mapsArray;
}
mapsArray1 has an initial value of 0. Before that value can increment, it listens to MapsArrayMutable, which is empty:
mutable mapsArrayMutable = []
for this value to change, it must be populated. the change comes from mapsSelectionButtons:
mapsSelectionButtons = Inputs.button(
[
[
"Add",
() => {
mutable mapsArrayMutable = mapsArrayMutable.concat(addMap());
//mutable mapsArrayMutable.push(addMap());
}
],
[
"Remove last",
() => {
mutable mapsArrayMutable = mapsArrayMutable.slice(0, -1);
//mutable mapsArrayMutable.splice(1, 1);
}
],
[
"Reset",
() => {
mutable mapsArrayMutable = [];
}
]
],
{ value: [], label: "List of maps" }
)
… so if you embed any of the other cells without mapsSelectionButtons, they will only reflect their initial value b/c there’s nothing else to trigger a change event.
You can only export a mutable cell alongside the thing that mutates it in order for it to function.
maybe you can build a frame of your desired output?